libtool-patches
[Top][All Lists]
Advanced

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

[PATCH] Build AIX shared libraries with binutils 2.19.50+


From: Richard Sandiford
Subject: [PATCH] Build AIX shared libraries with binutils 2.19.50+
Date: Mon, 16 Mar 2009 09:49:17 +0000
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

Hi,

If you try to configure libtool to build shared libraries on AIX,
it prints the following message when using GNU ld:

*** Warning: the GNU linker, at least up to release 2.9.1, is reported
*** to be unable to reliably create shared libraries on AIX.
*** Therefore, libtool is disabling shared libraries support.  If you
*** really care for shared libraries, you may want to modify your PATH
*** so that a non-GNU linker is found, and then restart.

binutils 2.19 doesn't work either, so the patch below updates the
version number.  However, a series of AIX patches were applied to
binutils CVS this weekend:

  http://sourceware.org/ml/binutils/2009-03/msg00172.html

These patches are enough to build working GCC shared libraries
(shared libgcc, libstdc++, libgfortran, libobjc, etc.).  We've also
used them internally to build proprietary shared libraries.

Hopefully things are in good enough shape that any failures can be
treated like any other binutils bug.  I'd therefore like to remove
the restriction above for binutils 2.19.50+.

One fix would be to add "real" GNU ld support if the linker is
new enough.  However, GNU ld tries to be command-line compatible
with the native AIX linker, so the handling for native AIX linkers
works for binutils too.  I've therefore added a new variable that
controls whether the GNU or native interface should be used.

Tested using GCC.  Does the patch look OK?  Please install if so.

Thanks,
Richard

PS. As far as copyright goes, this work is covered by the IBM assignment.


        * libltdl/m4/libtool.m4 (use_gnu_ld_interface): New variable
        to control whether the GNU ld or native ld interface is used.
        Set to "no" for GNU ld 2.19.50+ on AIX, otherwise mirror
        $with_gnu_ld.  Update the warning message that is printed
        when using GNU ld on AIX.

Index: libltdl/m4/libtool.m4
===================================================================
--- libltdl/m4/libtool.m4       2009-03-16 09:15:55.000000000 +0000
+++ libltdl/m4/libtool.m4       2009-03-16 09:24:42.000000000 +0000
@@ -4192,7 +4192,33 @@ dnl Note also adjust exclude_expsyms for
   esac
 
   _LT_TAGVAR(ld_shlibs, $1)=yes
+
+  # On some targets, GNU ld is compatible enough with the native linker
+  # that we're better off using the native interface for both.
+  use_gnu_ld_interface=no
   if test "$with_gnu_ld" = yes; then
+    case $host_os in
+      aix*)
+       # The AIX port of GNU ld has always aspired to compatibility
+       # with the native linker.  However, as the warning in the GNU ld
+       # block says, versions before 2.19.5* couldn't really create working
+       # shared libraries, regardless of the interface used.
+       case `$LD -v 2>&1` in
+         *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+         *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
+         *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
+         *)
+           use_gnu_ld_interface=yes
+           ;;
+       esac
+       ;;
+      *)
+       use_gnu_ld_interface=yes
+       ;;
+    esac
+  fi
+
+  if test "$use_gnu_ld_interface" = yes; then
     # If archive_cmds runs LD, not CC, wlarc should be empty
     wlarc='${wl}'
 
@@ -4225,11 +4251,12 @@ dnl Note also adjust exclude_expsyms for
        _LT_TAGVAR(ld_shlibs, $1)=no
        cat <<_LT_EOF 1>&2
 
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** Warning: the GNU linker, at least up to release 2.19, is reported
 *** to be unable to reliably create shared libraries on AIX.
 *** Therefore, libtool is disabling shared libraries support.  If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
 
 _LT_EOF
       fi




reply via email to

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