From: Richard Sandiford Date: Sat, 6 Jun 2009 06:48:44 +0000 (+0200) Subject: Build AIX shared libraries with binutils 2.19.50+. X-Git-Tag: v2.2.7b~88 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=19880129dd60fb0aaefa03ee764951af38b0451e;p=thirdparty%2Flibtool.git Build AIX shared libraries with binutils 2.19.50+. * libltdl/m4/libtool.m4 (_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG) : 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 --- diff --git a/ChangeLog b/ChangeLog index a1927bfb1..eab3a7f79 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2009-06-06 Richard Sandiford + + Build AIX shared libraries with binutils 2.19.50+. + * libltdl/m4/libtool.m4 (_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG) + : 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 Don't run compiler checks twice. diff --git a/NEWS b/NEWS index 42d3c6993..3656acdd7 100644 --- 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 f9c7a8671..9bf16db90 100644 --- a/THANKS +++ b/THANKS @@ -137,6 +137,7 @@ 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 diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4 index 3596384d6..21db0b070 100644 --- a/libltdl/m4/libtool.m4 +++ b/libltdl/m4/libtool.m4 @@ -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.