[Top][All Lists]

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

Re: SCO/bugfix patch 3 of 10: AC_LIBTOOL_DLOPEN_SELF

From: Ralf Wildenhues
Subject: Re: SCO/bugfix patch 3 of 10: AC_LIBTOOL_DLOPEN_SELF
Date: Mon, 31 Oct 2005 13:14:30 +0100
User-agent: Mutt/1.5.11

Hi Kean,

* Kean Johnston wrote on Mon, Oct 31, 2005 at 02:04:01AM CET:

> Rationale:
> The test for being able to dlopen yourself is flawed. It was using
> $link_static_flag, which is only present in the generated libtool.

OMG, flawed it truly is.  Good catch!

> During autoconfiscation, the variable is called $lt_prog_compiler_static.
> This was causing false positives becuase -Bstatic/-static were not being
> passed through to the link editor, and thus we were actually testing
> a dynamic a.out. Since $lt_prog_compiler_static most likely uses $wl,
> ensure that wl is set to $lt_prog_compiler_wl before running the test,
> so that $lt_prog_compiler_static expands correctly.

Your fix isn't correct, as there needs to be one more expansion level,
so that the compiler won't see ${wl}, but its variable expansion.  Also,
I'd like to avoid cluttering namespace.

we use $lt_prog_compiler_static wrongly in one more place.  Also, while
looking at this I happened to stumble over a couple of wrong variables
that presumably used to be used instead of ${wl} (?).

My current version of this patch is shown below.  Not checking it in
yet; it affects all systems and needs a bit more testing (for example,
on my GNU/Linux system the test will fail), and checking that $wl does
not need to be set/expanded in more places.


2005-10-31  Kean Johnston  <address@hidden>,
            Ralf Wildenhues  <address@hidden>

        * libtool.m4 (AC_LIBTOOL_DLOPEN_SELF): Use
        `lt_prog_compile_static', not `link_static_flag'.  Expand `$wl'
        so expansion of `export_dynamic_flag_spec' works.
        (AC_LIBTOOL_PROG_LD_SHLIBS) [ aix3 ]: Likewise.
        (AC_LIBTOOL_PROG_COMPILER_PIC) [ hpux* ]: Use `${wl}'.

Index: libtool.m4
RCS file: /cvsroot/libtool/libtool/Attic/libtool.m4,v
retrieving revision 1.314.2.117
diff -u -r1.314.2.117 libtool.m4
--- libtool.m4  31 Oct 2005 09:59:15 -0000      1.314.2.117
+++ libtool.m4  31 Oct 2005 11:32:45 -0000
@@ -949,7 +949,7 @@
     if test "x$lt_cv_dlopen_self" = xyes; then
-      LDFLAGS="$LDFLAGS $link_static_flag"
+      LDFLAGS=$LDFLAGS\ `wl=$lt_prog_compiler_wl eval echo 
       AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
          lt_cv_dlopen_self_static, [dnl
@@ -4850,14 +4850,14 @@
        case $cc_basename in
            _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a 
+           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
            if test "$host_cpu" != ia64; then
              _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
            _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a 
+           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
            case $host_cpu in
              # +Z the default
@@ -5516,7 +5516,7 @@
       # Note: this linker hardcodes the directories in LIBPATH if there
       # are no directories specified by -L.
       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      if test "$GCC" = yes && test -z "$link_static_flag"; then
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
        # Neither direct hardcoding nor static linking is supported with a
        # broken collect2.
        _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported

reply via email to

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