]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Allow dlopen self test to work with gcc's -fvisibility=hidden.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 7 Sep 2009 19:27:08 +0000 (21:27 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Tue, 8 Sep 2009 18:03:54 +0000 (20:03 +0200)
* libltdl/m4/libtool.m4 (_LT_TRY_DLOPEN_SELF): Declare default
visibility for the symbol we are going to test dlopen (NULL)
when a GCC version is used that understands the visibility
attribute, under the assumption that if -fvisibility=hidden
will be used, the user code will be sufficiently annotated
for visibility of needed symbols from the main executable.
* THANKS: Update.
Report by Josh Hursey against OpenMPI.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
THANKS
libltdl/m4/libtool.m4

index 26afae704727ba4a74556d47b179dbf89838e5bc..d3e924fee744e0c5a3710c611f0e5098d4f9cf62 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2009-09-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       Allow dlopen self test to work with gcc's -fvisibility=hidden.
+       * libltdl/m4/libtool.m4 (_LT_TRY_DLOPEN_SELF): Declare default
+       visibility for the symbol we are going to test dlopen (NULL)
+       when a GCC version is used that understands the visibility
+       attribute, under the assumption that if -fvisibility=hidden
+       will be used, the user code will be sufficiently annotated
+       for visibility of needed symbols from the main executable.
+       * THANKS: Update.
+       Report by Josh Hursey against OpenMPI.
+
        Fix and split recent testsuite addition for compile/link flags.
        * tests/flags.at (passing flags through libtool): Split into ...
        (passing CC flags through libtool)
diff --git a/THANKS b/THANKS
index 93538859828af6ef6e4f5b6a03aae6f085fd8bd9..8baf7f4129c4a6305256b89f8a1edb2477fb00df 100644 (file)
--- a/THANKS
+++ b/THANKS
   John Bowler                  jbowler@acm.org
   John R. Cary                 cary@txcorp.com
   John Wolfe                   jlw@sco.com
+  Josh Hursey                  jjhursey@open-mpi.org
   Joseph Beckenbach III                jrb3@best.com
   Lennart Poettering           lennart@poettering.net
   Karl Berry                   karl@freefriends.org
index bb1097f2eb0e3c3c730cb8d3e49469288ae973b3..662a88b12abd61b6b3d277fadf045226874d37e8 100644 (file)
@@ -1651,7 +1651,13 @@ else
 #  endif
 #endif
 
-void fnord() { int i=42;}
+/* When -fvisbility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+void fnord () __attribute__((visibility("default")));
+#endif
+
+void fnord () { int i=42; }
 int main ()
 {
   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
@@ -1660,7 +1666,11 @@ int main ()
   if (self)
     {
       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      else
+        {
+         if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+       }
       /* dlclose (self); */
     }
   else