]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Build AIX shared libraries with binutils 2.19.50+.
authorRichard Sandiford <richards@transitive.com>
Sat, 6 Jun 2009 06:48:44 +0000 (08:48 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 6 Jun 2009 06:48:44 +0000 (08:48 +0200)
* libltdl/m4/libtool.m4 (_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG)
<lt_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.
Adjust the whole_archive_flag_spec value for GNU ld on AIX.
* NEWS, THANKS: Update.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
NEWS
THANKS
libltdl/m4/libtool.m4

index a1927bfb1c742654888a45c0be04b26258ccb37f..eab3a7f7993838755ea8796fcc8a3b139638f5f4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2009-06-06  Richard Sandiford  <richards@transitive.com>
+
+       Build AIX shared libraries with binutils 2.19.50+.
+       * libltdl/m4/libtool.m4 (_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG)
+       <lt_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.
+       Adjust the whole_archive_flag_spec value for GNU ld on AIX.
+       * NEWS, THANKS: Update.
+
 2009-05-27  Peter O'Gorman  <peter@pogma.com>
 
        Don't run compiler checks twice.
diff --git a/NEWS b/NEWS
index 42d3c6993ee59b63dae0dfe553ada794dc58ab09..3656acdd7f0b04f6c9c352b1c9031017a1839389 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -20,6 +20,7 @@ New in 2.2.8 2009-??-??: git version 2.2.7a, Libtool team:
   - Support for GNU/kOpenSolaris (kopensolaris*-gnu).
   - Initial support for compilers on BlueGene BG/L.
   - Improved support for Atari FreeMiNT.
+  - With binutils 2.19.50+, shared libraries can be built on AIX.
 
 * Bug fixes:
 
diff --git a/THANKS b/THANKS
index f9c7a8671b4aff3c40f56294059b7db39caf1343..9bf16db9037e75dea3d299aebb838e6189369c9d 100644 (file)
--- a/THANKS
+++ b/THANKS
   Rainer Tammer                        tammer@tammer.net
   Ralf Menzel                  menzel@ls6.cs.uni-dortmund.de
   Richard Purdie               rpurdie@rpsys.net
+  Richard Sandiford            richards@transitive.com
   Robert Millan                        rmh@aybabtu.com
   Robert Ă–gren                        lists@roboros.com
   Roberto Bagnara              bagnara@cs.unipr.it
index 3596384d63d300e8da9c629cd0f3c7433ce5a3d3..21db0b070e0f36e48cdec0e87357424877b728bf 100644 (file)
@@ -4208,7 +4208,33 @@ dnl Note also adjust exclude_expsyms for C++ above.
   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.
+  lt_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]]*) ;;
+         *)
+           lt_use_gnu_ld_interface=yes
+           ;;
+       esac
+       ;;
+      *)
+       lt_use_gnu_ld_interface=yes
+       ;;
+    esac
+  fi
+
+  if test "$lt_use_gnu_ld_interface" = yes; then
     # If archive_cmds runs LD, not CC, wlarc should be empty
     wlarc='${wl}'
 
@@ -4241,11 +4267,12 @@ dnl Note also adjust exclude_expsyms for C++ above.
        _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
@@ -4605,8 +4632,13 @@ _LT_EOF
          # -berok will link without error, but may produce a broken library.
          _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
          _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-         # Exported symbols can be pulled into shared objects from archives
-         _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+         if test "$with_gnu_ld" = yes; then
+           # We only use this code for GNU lds that support --whole-archive.
+           _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+         else
+           # Exported symbols can be pulled into shared objects from archives
+           _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+         fi
          _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
          # This is similar to how AIX traditionally builds its shared libraries.
          _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
@@ -5546,8 +5578,13 @@ if test "$_lt_caught_CXX_error" != yes; then
            # -berok will link without error, but may produce a broken library.
            _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
            _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-           # Exported symbols can be pulled into shared objects from archives
-           _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+           if test "$with_gnu_ld" = yes; then
+             # We only use this code for GNU lds that support --whole-archive.
+             _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+           else
+             # Exported symbols can be pulled into shared objects from archives
+             _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+           fi
            _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
            # This is similar to how AIX traditionally builds its shared
            # libraries.