On Thu, Mar 09, 2000 at 09:57:28PM -0800, Ian Lance Taylor wrote:
> 
> If we decide that for some odd reason we can't live without a hack, we
> should put the hack in the place where we need it: when doing a
> one-tree build with both ld and gcc, ideally only when using
> --enable-shared.  Note that your patch would appear to cause libtool
> to relink the binary twice: once in the build directory and then again
> when installing; this is not desirable in the normal case of building
> and installing binutils.
> 
> That is, if you are using a Cygnus style top level Makefile, add a
> rule like this to all-gcc:

I like the idea. How about this? I know it is more appropriate for the
gcc mailing list. But given what happened to all my gcc patches, I
am not so sure it is a good idea. Any objections?

Thanks.

H.J.
----
2000-03-10  H.J. Lu  <[EMAIL PROTECTED]>

        * Makefile.in (all-gcc): Run ld/ld-new if necessary.

--- Makefile.in.orig    Wed Mar  8 16:18:17 2000
+++ Makefile.in Fri Mar 10 08:56:04 2000
@@ -1457,6 +1457,15 @@ $(INSTALL_X11_MODULES): installdirs
 # gcc is the only module which uses GCC_FLAGS_TO_PASS.
 .PHONY: all-gcc
 all-gcc:
+       # When configured with --enable-shared, libtool 1.3.4 creates
+       # a script in the build directory which automatically relinks
+       # the program to search for shared libraries in the build
+       # directory.  Something about this process, as yet undetermined,
+       # causes an argument size overflow in some versions of GNU/Linux.
+       # This can be avoided by running the script, so we do that here.
+       # FIXME: This should be fixed in libtool.
+       -if test -f ld/ld-new -a -f ld/.libs/ld-new; then \
+         ld/ld-new -v >/dev/null 2>&1; fi
        @if [ -f ./gcc/Makefile ] ; then \
          r=`pwd`; export r; \
          s=`cd $(srcdir); pwd`; export s; \

Reply via email to