libtool-patches
[Top][All Lists]
Advanced

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

glibc and dlopen self static (was: SCO/bugfix patch 3 of 10: AC_LIBTOOL_


From: Ralf Wildenhues
Subject: glibc and dlopen self static (was: SCO/bugfix patch 3 of 10: AC_LIBTOOL_DLOPEN_SELF)
Date: Tue, 1 Nov 2005 05:25:10 +0100
User-agent: Mutt/1.5.9i

* Kean Johnston wrote on Mon, Oct 31, 2005 at 06:14:27PM CET:
> 
> So getting back to an actual bit of libtool code, we could have:
> 
> sflag=`wl=$lt_prog_compiler_wl eval echo \"$lt_prog_compiler_static\"`
> LDFLAGS="$LDFLAGS $sflag"

Let's just go a different, simpler route:
wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"

Similarly to a few lines above the offending snippet.


I have a completely different set of questions now:  Why in the world is
that test executable (changed as below) giving me
| /opt/intel_cc_80/lib/: cannot read file data: Is a directory

when I try to dlopen(0, ..), whereas dlopen("./conftest", ..) gives me
| ./conftest: cannot dynamically load executable

on GNU/Linux, glibc-2.3.2 (Debian sarge)?  Hmm, when I unset
LD_LIBRARY_PATH, the former becomes
| /lib/: cannot read file data: Is a directory

instead.  Bug in dlopen/dlerror?

Cheers,
Ralf

Index: libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/libtool.m4,v
retrieving revision 1.314.2.118
diff -u -r1.314.2.118 libtool.m4
--- libtool.m4  31 Oct 2005 18:54:20 -0000      1.314.2.118
+++ libtool.m4  1 Nov 2005 04:21:09 -0000
@@ -854,6 +854,8 @@
       else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
       /* dlclose (self); */
     }
+  else
+    puts (dlerror ());
 
     exit (status);
 }]
@@ -960,7 +962,7 @@
     ])
 
     if test "x$lt_cv_dlopen_self" = xyes; then
-      LDFLAGS="$LDFLAGS $link_static_flag"
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS 
$lt_prog_compiler_static\"
       AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
          lt_cv_dlopen_self_static, [dnl
          _LT_AC_TRY_DLOPEN_SELF(
@@ -4861,14 +4857,14 @@
        case $cc_basename in
          CC*)
            _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a 
${ac_cv_prog_cc_wl}archive"
+           _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'
            fi
            ;;
          aCC*)
            _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a 
${ac_cv_prog_cc_wl}archive"
+           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
            case $host_cpu in
            hppa*64*|ia64*)
              # +Z the default
@@ -5527,7 +5523,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]