[Top][All Lists]

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

A bug in 'libtool' on Digital Unix 4

From: Victor Danilchenko
Subject: A bug in 'libtool' on Digital Unix 4
Date: Thu, 19 Jul 2001 12:28:23 -0400 (EDT)

        Actually, it probably affects other platforms as well, but I
only saw it on DU4... it also affects other packages which come with
their own libtool -- in fact, I only traced it down in such a
libtool-using package (libxml), not in a standalone libtool distribution
(although the erroneous result is present there as well). The bug seems
to stem from incorrect metacharacter escaping in ltconfig script.

        So far, I have seen this bug manifest itself only during dynamic
library linkage on Digital Unix -- because the 'allow_undefined_flag'
variable there contains an asterisk that does not get escaped
correctly, and which therefore gets expanded by the shell instead of
getting passed on to the linker.

        The line that is the problem is in DU libtool:

allow_undefined_flag=" \${wl}-expect_unresolved \${wl}\\*"

        This creates the erroneous output, and the linking fails without
producing the desired library. There should be one additional backslash
there, like the following line, which results in correct output:

allow_undefined_flag=" \${wl}-expect_unresolved \${wl}\\\*"

        The original definition of "allow_undefined_flag" in ltconfig is

ltconfig:1425-  osf4* | osf5*)  # As osf3* with the addition of the -msym flag
ltconfig:1426-    if test "$with_gcc" = yes; then
ltconfig:1427:      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'

        But when the metacharacters are escaped, the result is the
above-mentioned incorrect string. This is where the problem occurs in
ltconfig (it's the '*)' clause):

ltconfig:2687:    case "$var" in
ltconfig:2688:    reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
ltconfig:2689:    old_postinstall_cmds | old_postuninstall_cmds | \
ltconfig:2690:    export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
ltconfig:2691:    postinstall_cmds | postuninstall_cmds | \
ltconfig:2692:    finish_cmds | sys_lib_search_path_spec | 
ltconfig:2693:      # Double-quote double-evaled strings.
ltconfig:2694:      eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e 
\"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e 
ltconfig:2695:      ;;
ltconfig:2696:    *)
ltconfig:2697:      eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e 

        After the last line, the value of $allow_undefined_flag becomes
" \${wl}-expect_unresolved \${wl}\\*" instead of "
\${wl}-expect_unresolved \${wl}\\\*" which it should be. This in turn
seems to occur because the asterisk is not in
$sed_quote_subst variable.

        I attached a patch that adds '*' to the list of characters top
be escaped, but I am not sure if that's the correct solution -- there
seem to be other variables which should *not* have an asterisk escaped
thusly (in my case however, libxml built flawlessly with the above
patch). I am sure that at least in this specific case
(allow_undefined_flag variable) the asterisk is supposed to be escaped.
Perhaps an additional special-purpose substitution, on that variable
only, is called for?

|  Victor  Danilchenko  | Don't criticize a man until you've walked |
| address@hidden | a mile in his moccasins -- then you'll be |
|   CSCF   |   5-4231   | a mile away, and you will have his shoes. |

Attachment: ltconfig.patch
Description: The patch to ltconfig script fixing metacharacter escaping error

reply via email to

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