libtool
[Top][All Lists]
Advanced

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

export_symbols_cmds erroneously expanded


From: Charles Wilson
Subject: export_symbols_cmds erroneously expanded
Date: Mon, 11 Dec 2006 12:17:38 -0500

When building pcre (which uses libtool --export-symbols-regex) I get the
following error (libtool cvs branch 1.5, 20061014 checkout):

/bin/sh ./libtool --mode=link gcc -export-symbols-regex '^[^_]'  -I.
-I/c/msys/1.0/local/src/pcre/cygports/pcre-6.7-1/src/pcre-6.7 -rpath
/usr/lib -no-undefined -version-info \
                '0:1:0' -o libpcre.la pcre_chartables.lo pcre_compile.lo 
pcre_config.lo pcre_dfa_exec.lo pcre_exec.lo pcre_fullinfo.lo pcre_get.lo 
pcre_globals.lo pcre_info.lo pcre_maketables.lo pcre_ord2utf8.lo 
pcre_refcount.lo pcre_study.lo pcre_tables.lo pcre_try_flipped.lo 
pcre_ucp_searchfuncs.lo pcre_valid_utf8.lo pcre_version.lo pcre_xclass.lo 
generating symbol list for `libpcre.la'
/usr/bin/nm -B  .libs/pcre_chartables.o .libs/pcre_compile.o
.libs/pcre_config.o .libs/pcre_dfa_exec.o .libs/pcre_exec.o
.libs/pcre_fullinfo.o .libs/pcre_get.o .libs/pcre_globals.o
.libs/pcre_info.o .libs/pcre_maketables.o .libs/pcre_ord2utf8.o
.libs/pcre_refcount.o .libs/pcre_study.o .libs/pcre_tables.o
.libs/pcre_try_flipped.o .libs/pcre_ucp_searchfuncs.o
.libs/pcre_valid_utf8.o .libs/pcre_version.o .libs/pcre_xclass.o  | sed
-n -e 's/^.*[   ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[         ][     
]*_\([_A-Za-z][_A-Za-z0-9]*\)$/\1 _\2 \2/p' | /usr/bin/sed -e
'/^[BCDGRS] /s/. /s/.. \([^ ]*\)/\1 DATA/' | /usr/bin/sed -e '/^[AITW]
/s/. /s/.. //' | sort | uniq > .libs/libpcre.exp
/usr/bin/sed: -e expression #1, char 20: unknown option to `s'
/usr/bin/sed: -e expression #1, char 18: unknown option to `s'
/usr/bin/grep -E -e "^[^_]" ".libs/libpcre.exp" > ".libs/libpcre.expT"


The two offending sed expressions are:

'/^[BCDGRS] /s/. /s/.. \([^ ]*\)/\1 DATA/'
'/^[AITW] /s/. /s/.. //'

These *should* have been

'/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'
'/^[AITW] /s/.* //'

It appears that around line 3978 in ltmain.in:

            cmds=$export_symbols_cmds
            save_ifs="$IFS"; IFS='~'
            for cmd in $cmds; do
              IFS="$save_ifs"
[[ cmd ok here , but $NM etc are not expanded ]]
              eval cmd=\"$cmd\"
[[ cmd not ok here -- $NM etc are expanded, but s/// expression messed
up ]]
              if len=`expr "X$cmd" : ".*"` &&
               test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le
               -1; then
                $show "$cmd"
                $run eval "$cmd" || exit $?
                skipped_export=false
              else

bad things are happening to the .* in the original s/// expressions.  I
tried umpteen ways of changing the quotes but couldn't seem to get
libtool to DTRT, short of introducing another variable for an extra
level of indirection (similar to how global_symbol_pipe itself is
handled):

# The commands to list exported symbols.
export_filter="sed -e '/^[BCDGRS] /s/.* \\([^ ]*\\)/\\1 DATA/' | sed -e
'/^[AITW] /s/.* //'"
export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe
| \$export_filter | sort | uniq > \$export_symbols"

(We can't change global_symbol_pipe itself, because it's used in other
contexts).

There's also the (uglier, but less invasive -- doesn't require a new
_LT_TAG_VAR for each tag):

# The commands to list exported symbols.
export_symbols_cmds="DOTSTAR='.*'~\$NM \$libobjs \$convenience |
\$global_symbol_pipe | \$SED -e '/^[BCDGRS] /s/\$DOTSTAR \\\\([^
]*\\\\)/\\\\1 DATA/' | \$SED -e '/^[AITW] /s/\$DOTSTAR //' | sort | uniq
> \$export_symbols"


Any ideas what the RIGHT fix for this problem is?

--
Chuck





reply via email to

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