libtool-patches
[Top][All Lists]
Advanced

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

_GLOBAL__FD_libfoo_so


From: Ralf Wildenhues
Subject: _GLOBAL__FD_libfoo_so
Date: Thu, 10 Jan 2008 21:41:11 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

Hello libtool-patches readers,

WRT this failure of demo-make.test after demo-shared.test (see [1])
on AIX/GCC:

> /bin/sh ./libtool --tag=CC   --mode=link gcc  -g -O2 -export-dynamic 
> -dlpreopen libhello.la -Wl,-brtl -o helldl dlmain.o
> rm -f .libs/helldl.nm .libs/helldl.nmS .libs/helldl.nmT
> creating .libs/helldlS.c
> extracting global C symbols from `./.libs/libhello.so.2.1.12'
> (cd .libs && gcc  -g -O2 -c -fno-builtin "helldlS.c")
> rm -f .libs/helldlS.c .libs/helldl.nm .libs/helldl.nmS .libs/helldl.nmT
> gcc -g -O2 .libs/helldlS.o -Wl,-brtl -o .libs/helldl dlmain.o  -L./.libs 
> -lhello -lm  
> -Wl,-blibpath:/daten/source/libtool/libtool-1.5.24a-cvs-gcc/tests/_inst/lib:/opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.0.0:/opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.0.0/../../..:/usr/lib:/lib
> ld: 0711-317 ERROR: Undefined symbol: _GLOBAL__FD_libhello_so
> ld: 0711-317 ERROR: Undefined symbol: _GLOBAL__FI_libhello_so
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
> collect2: ld returned 8 exit status
> gmake[3]: *** [helldl] Error 1
> gmake[3]: Target `all' not remade because of errors.
> gmake[3]: Leaving directory 
> `/daten/source/libtool/libtool-1.5.24a-cvs-gcc/demo'
> FAIL: demo-make.test


Glancing at GCC sources, I gather that symbols matching
  ^_GLOBAL__F[ID]_.*$

are init/fini functions for shared libraries.  Would it be appropriate
if libtool skipped these when doing symbol extraction?  On any system,
when GCC is used, or even with any compiler?  Would the above be the
most general egrep pattern to match these symbols?

Are there however other symbols we should not extract (so far only
_GLOBAL_OFFSET_TABLE_)?

Thus, OK to apply this patch which fixes the failures (HEAD and
branch-1-5)?

Thanks,
Ralf

[1] http://lists.gnu.org/archive/html/bug-libtool/2008-01/msg00009.html
    (the respective failure is seen in the attachment)

2008-01-10  Ralf Wildenhues  <address@hidden>

        * libltdl/m4/libtool.m4 (_LT_LINKER_SHLIBS) <exclude_expsyms>:
        Also exclude `_GLOBAL__F[ID]_.*'.  Also set for the C++ tag.
        Fixes esp. demo/helldl build failure with GCC on AIX.
        Report by Rainer Tammer.

Index: libltdl/m4/libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/m4/libtool.m4,v
retrieving revision 1.127
diff -u -r1.127 libtool.m4
--- libltdl/m4/libtool.m4       8 Jan 2008 19:43:29 -0000       1.127
+++ libltdl/m4/libtool.m4       10 Jan 2008 20:38:09 -0000
@@ -4042,6 +4128,7 @@
     _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | 
$global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
   ;;
   esac
+  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
 ], [
   runpath_var=
   _LT_TAGVAR(allow_undefined_flag, $1)=
@@ -4075,12 +4162,14 @@
   # it will be wrapped by ` (' and `)$', so one must not match beginning or
   # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
   # as well as any symbol that contains `d'.
-  _LT_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
+  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
   # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
   # platforms (ab)use it in PIC code, but their linkers get confused if
   # the symbol is explicitly referenced.  Since portable code cannot
   # rely on this symbol name, it's probably fine to never include it in
   # preloaded symbol tables.
+  # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
   extract_expsyms_cmds=
 
   case $host_os in




reply via email to

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