libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MLB] Proper collect2 test for AIX


From: Robert Boehne
Subject: Re: [MLB] Proper collect2 test for AIX
Date: Tue, 13 Feb 2001 13:32:42 -0600

Alexandre Oliva wrote:
> 
> On Feb  9, 2001, Robert Boehne <address@hidden> wrote:
> 
> > +    export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if 
> > (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != 
> > ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
> 
> FYI, this doesn't work correctly with GNU nm.  -C == --demangle with
> GNU nm, whereas it means --no-demangle with AIX nm.  I've got a patch
> to fix this, that I'm testing right now.  Seems like this was the only
> problem that showed up with my testing session on AIX 4.1.
> 

Here is a patch to fix the collect2 test problem under AIX 4.3+.
I couldn't find any list archives that go back that far, and even
if I had, my guess is that 4.3 wasn't released yet (just a guess).
So, for lack of conclusive evidence, the following patch will
allow AIX 4.3 w/ gcc/g++ (and AIX nm) to pass all but two tests.
Which incedentally, is the same result as when using xlc/xlC.

ChangeLog entry:

2001-02-12  Robert Boehne  <address@hidden>
        
        * ltcf-cxx.sh: Only check for broken collect2 under
        AIX 4.[012], the check only works on these OS versions.
        
        * ltcf-c.sh: Ditto.
        
        * ltcf-gcj.sh: Ditto.


-- 
Robert Boehne             Software Engineer
Ricardo Software   Chicago Technical Center
TEL: (630)789-0003 x. 238
FAX: (630)789-0127
email:  address@hidden
ChangeLog entry:

2001-02-12  Robert Boehne  <address@hidden>
        
        * ltcf-cxx.sh: Only check for broken collect2 under
        AIX 4.[012], the check only works on these OS versions.
        
        * ltcf-c.sh: Ditto.
        
        * ltcf-gcj.sh: Ditto.


Index: ltcf-c.sh
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/ltcf-c.sh,v
retrieving revision 1.1.2.26
diff -u -r1.1.2.26 ltcf-c.sh
--- ltcf-c.sh   2001/02/12 18:08:11     1.1.2.26
+++ ltcf-c.sh   2001/02/13 19:13:20
@@ -273,24 +273,29 @@
     # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
     # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
     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
+      case "$host_os" in aix4.[012]|aix4.[012].*)
+      # We only want to do this on AIX 4.2 and lower, the check
+      # below for broken collect2 doesn't work under 4.3+
+        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
+      esac
       shared_flag='-shared'
     else
+      # not using gcc
       if test "$host_cpu" = ia64; then
         shared_flag='${wl}-G'
       else
Index: ltcf-cxx.sh
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/ltcf-cxx.sh,v
retrieving revision 1.1.2.31
diff -u -r1.1.2.31 ltcf-cxx.sh
--- ltcf-cxx.sh 2001/02/12 18:08:11     1.1.2.31
+++ ltcf-cxx.sh 2001/02/13 19:13:20
@@ -131,30 +131,36 @@
     # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
     # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
     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
+      case "$host_os" in aix4.[012]|aix4.[012].*)
+      # We only want to do this on AIX 4.2 and lower, the check
+      # below for broken collect2 doesn't work under 4.3+
+        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
+      esac
       shared_flag='-shared'
     else
+      # not using gcc
       if test "$host_cpu" = ia64; then
         shared_flag='${wl}-G'
       else
         shared_flag='${wl}-bM:SRE'
       fi
     fi
+
     if test "$host_cpu" = ia64; then
       # On IA64, the linker does run time linking by default, so we don't
       # have to do anything special.
Index: ltcf-gcj.sh
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/ltcf-gcj.sh,v
retrieving revision 1.1.2.12
diff -u -r1.1.2.12 ltcf-gcj.sh
--- ltcf-gcj.sh 2001/02/12 18:08:11     1.1.2.12
+++ ltcf-gcj.sh 2001/02/13 19:13:20
@@ -264,24 +264,29 @@
     # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
     # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
     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
+      case "$host_os" in aix4.[012]|aix4.[012].*)
+      # We only want to do this on AIX 4.2 and lower, the check
+      # below for broken collect2 doesn't work under 4.3+
+        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
+      esac
       shared_flag='-shared'
     else
+      # not using gcc
       if test "$host_cpu" = ia64; then
         shared_flag='${wl}-G'
       else

reply via email to

[Prev in Thread] Current Thread [Next in Thread]