From 7ca0e6d96e806cb6fd026dfda2e58449af177969 Mon Sep 17 00:00:00 2001 From: David Edelsohn Date: Thu, 9 Nov 2000 21:41:11 +0000 Subject: [PATCH] ltcf-c.sh (aix4): Improve shared library configuration; require exporting symbols. * ltcf-c.sh (aix4): Improve shared library configuration; require exporting symbols. * ltcf-cxx.sh (aix4): Define. * ltconfig (aix4): Define library and soname specs appropriate for AIX. Define command to create export symbols list. From-SVN: r37347 --- ChangeLog | 8 ++++++++ ltcf-c.sh | 14 +++++++------- ltcf-cxx.sh | 8 ++++++-- ltconfig | 4 +++- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index c12754fc820..0f2bb66b86d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2000-11-09 David Edelsohn + + * ltcf-c.sh (aix4): Improve shared library configuration; require + exporting symbols. + * ltcf-cxx.sh (aix4): Define. + * ltconfig (aix4): Define library and soname specs appropriate for + AIX. Define command to create export symbols list. + Mon Nov 6 14:19:35 2000 Christopher Faylor * config.sub: Add support for Sun Chorus diff --git a/ltcf-c.sh b/ltcf-c.sh index e57abb1cb2b..6bccb11c5d6 100644 --- a/ltcf-c.sh +++ b/ltcf-c.sh @@ -277,13 +277,13 @@ else hardcode_direct=yes fi allow_undefined_flag=' ${wl}-berok' - archive_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}' - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}' - case "$host_os" in aix4.[01]|aix4.[01].*) - # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on - always_export_symbols=yes ;; - esac - ;; + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + # -bexpall does not export symbols beginning with underscore (_) + always_export_symbols=yes + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec=' ' + build_libtool_need_lc=yes + ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' diff --git a/ltcf-cxx.sh b/ltcf-cxx.sh index c134a429486..cefa0085624 100644 --- a/ltcf-cxx.sh +++ b/ltcf-cxx.sh @@ -135,8 +135,12 @@ case "$host_os" in ld_shlibs=no ;; aix4*) - # FIXME: insert proper C++ library support - ld_shlibs=no + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + # -bexpall does not export symbols beginning with underscore (_) + always_export_symbols=yes + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec=' ' + build_libtool_need_lc=yes ;; chorus*) case "$cc_basename" in diff --git a/ltconfig b/ltconfig index fb0bf8b8b18..a79434264e4 100755 --- a/ltconfig +++ b/ltconfig @@ -949,8 +949,10 @@ aix4*) # collect2, so additional links can be useful in future. # We preserve .a as extension for shared libraries though AIX4.2 # and later linker supports .so - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.a' + library_names_spec='${libname}${release}.a $libname.a' shlibpath_var=LIBPATH + soname_spec='${libname}${release}.so$major.o' + 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' ;; amigaos*)