]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libltdl/config/ltmain.m4sh (func_mode_link): Filter
authorPeter Ekberg <peda@lysator.liu.se>
Thu, 22 Sep 2005 07:46:08 +0000 (07:46 +0000)
committerPeter Rosin <peda@lysator.liu.se>
Thu, 22 Sep 2005 07:46:08 +0000 (07:46 +0000)
user supplied symfile to tag relevant symbols as data
symbols. Fixes segfault in stresstest.at on Cygwin and
makes the test pass.

ChangeLog
libltdl/config/ltmain.m4sh

index 1d49b020b927df2247e91f000573d094f7dfbccd..7c6fc5a3748666ee2c86d67267f7e395f65b7fd7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-09-22  Peter Ekberg  <peda@lysator.liu.se>,
+           Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+       * libltdl/config/ltmain.m4sh (func_mode_link): Filter
+       user supplied symfile to tag relevant symbols as data
+       symbols. Fixes segfault in stresstest.at on Cygwin and
+       makes the test pass.
+
 2005-09-22  Peter Ekberg  <peda@lysator.liu.se>,
 
        * tests/link-order.test: Clean up the uninstalled libraries
index 7967a6f187bcbea5a4720cc7baba6ad3d8521932..a1093ee6b07ba8a12e9d5bfa4ff14b37b5fc7352 100644 (file)
@@ -4933,6 +4933,26 @@ EOF
        # Use standard objects if they are pic
        test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
 
+       orig_export_symbols=
+       case $host_os in
+       cygwin* | mingw*)
+         if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
+           # exporting using user supplied symfile
+           if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
+             # and it's NOT already a .def file. Must figure out
+             # which of the given symbols are data symbols and tag
+             # them as such. So, trigger use of export_symbols_cmds.
+             # export_symbols gets reassigned inside the "prepare
+             # the list of exported symbols" if statement, so the
+             # include_expsyms logic still works.
+             orig_export_symbols="$export_symbols"
+             export_symbols=
+             always_export_symbols=yes
+           fi
+         fi
+         ;;
+       esac
+
        # Prepare the list of exported symbols
        if test -z "$export_symbols"; then
          if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
@@ -4966,7 +4986,22 @@ EOF
        fi
 
        if test -n "$export_symbols" && test -n "$include_expsyms"; then
-         $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$export_symbols"'
+         tmp_export_symbols="$export_symbols"
+         test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+         $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
+       fi
+
+       if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+         # The given exports_symbols file has to be filtered, so filter it.
+         func_echo "filter symbol list for \`$libname.la' to tag DATA exports"
+         # FIXME: $output_objdir/$libname.filter potentially contains lots of
+         # 's' commands which not all seds can handle. GNU sed should be fine
+         # though. Also, the filter scales superlinearly with the number of
+         # global variables. join(1) would be nice here, but unfortunately
+         # isn't a blessed tool.
+         $opt_dry_run || $SED -e '/[[ ,]]DATA/!d;s,\(.*\)\([[ \,]].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+         export_symbols=$output_objdir/$libname.def
+         $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
        fi
 
        tmp_deplibs=