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)
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
# 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);
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