This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

AIX and broken collect2


GCC-list:

I have been working to get Libtool to work with gcc under AIX 4-5,
and there is one problem left that concerns the workaround for
broken collect2 that was apparently checked in a few years ago:

1997-11-29  Gordon Matzigkeit  <gord@gnu.org>

	* ltconfig.in (COLLECT_NAMES): Enable this workaround for a broken
	collect2 only on AIX 3.  This avoids problems on other AIX
	versions.  Reported by Stefan Westerfeld.


 Libtool under AIX checks for 'resolve_lib_name' in
 the output of strings `gcc -print-prog-name=collect2` and then sets
 a few things accordingly:
 
     if test "$with_gcc" = yes; then
       collect2name=`${CC} -print-prog-name=collect2`
       if test -f "$collect2name" && \
          strings "$collect2name" | grep resolve_lib_name >/dev/null
       then
         # We have reworked collect2
         hardcode_direct=yes
       else
         # We have old collect2
         hardcode_direct=unsupported
         # It fails to find uninstalled libraries when the uninstalled
         # path is not listed in the libpath.  Setting hardcode_minus_L
         # to unsupported forces relinking
         hardcode_minus_L=yes
         hardcode_libdir_flag_spec='-L$libdir'
        hardcode_libdir_separator=
      fi
 
On my system, PPC AIX 4.3, I don't seem to be getting the proper result.
I was tracking down failures in 'hardcode.test' and found that libtool
would pass if I changed hardcode_direct=unsupported to yes, and
hardcode_libdir_flag_spec='-L$libdir' to ${wl}-blibpath(etc.)
This is exactly undoing what the above snippet does.
What version of GCC had the broken collect2 that this workaround
is made for?
 
Here is some output from my system...
 
boreas::/icarus/GNU/libtool (173)% strings `gcc
-print-prog-name=collect2` | grep resolve_lib_name
boreas::/icarus/GNU/libtool (174)% strings `gcc
-print-prog-name=collect2` 
@(#)61
1.11  src/bos/usr/ccs/lib/libc/__threads_init.c, libcthrd, bos43K,
9823A_43K 6/12/98 12:37:06
/tmp
/usr/tmp
/tmp
/usr/tmp
ÿÿÿÿÿÿÿÿ(B
boreas::/icarus/GNU/libtool (175)% uname -a
AIX boreas 3 4 000773894C00 unknown
boreas::/icarus/GNU/libtool (176)% g++ --version
2.95.2
boreas::/icarus/GNU/libtool (177)% gcc --version
2.95.2
boreas::/icarus/GNU/libtool (178)% which strings
/bin/strings
 
As far as I can tell, the check isn't valid for gcc 2.95.2, so
perhaps if the broken versions could be identified we could
check that instead.
What versions were broken?

Thanks!


-- 
Robert Boehne             Software Engineer
Ricardo Software   Chicago Technical Center
TEL: (630)789-0003 x. 238
FAX: (630)789-0127
email:  rboehne@ricardo-us.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]