Bug 17222 - libjava fails to build due to command line length during link
Summary: libjava fails to build due to command line length during link
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libgcj (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 4.0.0
Assignee: Kelley Cook
URL:
Keywords:
Depends on:
Blocks: 17574
  Show dependency treegraph
 
Reported: 2004-08-28 13:50 UTC by Kelley Cook
Modified: 2005-07-23 22:49 UTC (History)
4 users (show)

See Also:
Host: powerpc-apple-darwin6.8
Target: powerpc-apple-darwin6.8
Build: powerpc-apple-darwin6.8
Known to work:
Known to fail:
Last reconfirmed:


Attachments
First line in attachment is the 73,000+ character linker command (12.45 KB, text/plain)
2004-08-28 13:52 UTC, Kelley Cook
Details
The new huge command line after the rth patch (15.64 KB, text/plain)
2005-03-02 17:26 UTC, Kelley Cook
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kelley Cook 2004-08-28 13:50:06 UTC
Bootstrap fails during libjava on some targets

This is apparently due to the extremely long command line of 73,379 characters
given to the linker.

Though it seems Automake should be able to handle this itself, I would think
this could be circumvented by splitting the link into a several convenience
libraries and then linking those together.

Build output below
Comment 1 Kelley Cook 2004-08-28 13:52:45 UTC
Created attachment 6998 [details]
First line in attachment is the 73,000+ character linker command
Comment 2 Andrew Pinski 2004-08-28 17:14:55 UTC
Actually I thought we are already doing this ...
Comment 3 Andreas Tobler 2004-08-30 18:20:02 UTC
Well, to be honest libjava on darwin < 7.0 does not make much sense. You can
only use a subset of the library for very limited functionality. The big part
missing is the shared library support. For example all the SWING/AWT part you
can't use since the libgcc is statically linked in for several libraries.
Comment 4 Bryce McKinlay 2004-08-30 18:37:05 UTC
Andreas, can we document the "minimum Darwin 7.x" requirement somewhere -
perhaps install.texi? Perhaps we should also set up configure to only build
libjava by default on Darwin >= 7.0.

Bryce
Comment 5 Andreas Tobler 2004-08-30 19:15:51 UTC
oh, now I seem to remember why shared libraries are not supported under darwin <
7.0. Afair it was due to the missing MD_FALLBACK_FRAME_STATE_FOR macro at the
time when I introduced the changes for shared libraries on darwin.
Now this macro is in and it should also support darwin < 7.0.

You may try to modify ltcf-c.sh, ltcf-cxx.sh, ltcf-gcj.sh and ltconfig in the
toplevel gcc dir. See where it says:

  case $host_os in
      darwin[1-6]*)
          can_build_shared=no
          ;;
      darwin7*)
          can_build_shared=yes
          ;;
  esac

To say yes for darwin6.x too. It may help. I don't know since I no longer have a
6.x machine around. Just an idea.
Comment 6 Kelley Cook 2004-09-23 11:46:48 UTC
a) Changing the lt* scripts had no effect.
b) This problem also happens under cygwin.
Comment 7 Tom Tromey 2004-09-27 22:31:45 UTC
The original thread has a patch:

http://gcc.gnu.org/ml/gcc/2004-09/msg01301.html
Comment 8 Kelley Cook 2004-09-28 17:37:12 UTC
The patch fixes the problem on cygwin.  On its face it certainly appears that it
would also fix the problem under the older OS X versions.  I recently upgraded
my iMac to OS X 10.3, so I can't test it there.  Perhaps Lars could help as he
also reported the problem.

As the initiator of the PR, I would support its closing upon installation of the
patch.
Comment 9 GCC Commits 2004-09-28 20:37:49 UTC
Subject: Bug 17222

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	tromey@gcc.gnu.org	2004-09-28 20:37:45

Modified files:
	libjava        : ChangeLog Makefile.am Makefile.in 

Log message:
	PR libgcj/17222:
	* Makefile.am (libgcj.la): Restored.
	* Makefile.in: Rebuilt.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/ChangeLog.diff?cvsroot=gcc&r1=1.3101&r2=1.3102
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/Makefile.am.diff?cvsroot=gcc&r1=1.416&r2=1.417
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/Makefile.in.diff?cvsroot=gcc&r1=1.444&r2=1.445

Comment 10 Tom Tromey 2004-09-28 20:39:53 UTC
Fix checked in.
Thanks Kelley.
Comment 11 Lars Sonchocky-Helldorf 2004-09-28 21:22:14 UTC
> Perhaps Lars could help as he also reported the problem.

I'll test that by the time the next weekly snapshot of head is out.
Comment 12 Lars Sonchocky-Helldorf 2004-10-09 16:08:21 UTC
I successfully bootstrapped gcc-4.0-20041003 on Mac OS X 10.2.8 (powerpc-apple-darwin6.8). This 
bugg seems to be fixed here too.

see: http://gcc.gnu.org/ml/gcc/2004-10/msg00379.html
Comment 13 Kelley Cook 2005-03-02 17:25:21 UTC
This bootstrap bug unfortunately became re-introduced with this Richard
Henderson patch which moved the command line linking the thousands of sources
directly from libgcj.la to a convenience library libgcj0_convenience_la.  This
commandline happens to be 94,720 characters long which exceeds reasonable
expectations.

http://gcc.gnu.org/ml/java-patches/2005-q1/msg00402.html

This should be pretty straightforeward to fix by moving Tom Tromey's previous
clever hack to the new convenience library.  I'll try that and report back the
results.
Comment 14 Kelley Cook 2005-03-02 17:26:46 UTC
Created attachment 8313 [details]
The new huge command line after the rth patch
Comment 15 Andrew Pinski 2005-03-02 18:24:43 UTC
This was filed under PR 20155.

The orginal problem was fixed but showed up again via soemthing.  Next time open a new bug instead 
of reopening this one.