Front page | perl.perl5.porters |
Postings from August 2003
[Fwd: dl_aix.xs and RTLD_GLOBAL usage warnings]
From:
Stas Bekman
Date:
August 27, 2003 12:43
Subject:
[Fwd: dl_aix.xs and RTLD_GLOBAL usage warnings]
Message ID:
3F4D09BB.7010602@stason.org
Any AIX gurus to comment on/review/commit my patch?
-------- Original Message --------
Date: Wed, 19 Mar 2003 13:29:17 +1100
From: Stas Bekman <stas@stason.org>
In dl_aix.xs we have:
dl_load_file(filename, flags=0)
...
if (flags & 0x01)
Perl_warn(aTHX_ "Can't make loaded symbols
global on this platform while loading %s",filename);
RETVAL = dlopen(filename, RTLD_GLOBAL|RTLD_LAZY) ;
why the warning is issued without enclosing it in #ifndef RTLD_GLOBAL/#endif?
e.g., aix 5.1 defines RTLD_GLOBAL in /usr/include/dlfcn.h
Also in order to avoid this warnings on platforms which don't support
RTLD_GLOBAL, what's the cross-platform way to figure out the available flags,
when overriding ld_load_flags? I couldn't find this functionality in the core
perl/CPAN.
Currently it seems that DynaLoader is the best place to provide this
functionality. For example the API could be:
$flag = 0x0;
# returns 0x0 if RTLD_GLOBAL is undef, 0x1 otherwise
$flag |= DynaLoader::has_load_flags('RTLD_GLOBAL');
# returns 0x4 if RTLD_LAZY is defined
$flag |= DynaLoader::has_load_flags('RTLD_LAZY');
sub ld_load_flags { $flag }
The problem with making this functionality in an external module is to
duplicate all the include mess from ext/DynaLoader/dl_*.xs files.
--- ext/DynaLoader/dl_aix.xs.orig 2003-03-19 13:14:36.000000000 +1100
+++ ext/DynaLoader/dl_aix.xs 2003-03-19 13:18:04.000000000 +1100
@@ -695,7 +695,9 @@
CODE:
DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dl_load_file(%s,%x):\n",
filename,flags));
if (flags & 0x01)
- Perl_warn(aTHX_ "Can't make loaded symbols global on this platform while
loading %s",filename);
+#if RTLD_GLOBAL == 0
+ Perl_warn(aTHX_ "Can't make loaded symbols global on this
platform while loading %s",filename);
+#endif
RETVAL = dlopen(filename, RTLD_GLOBAL|RTLD_LAZY) ;
DLDEBUG(2,PerlIO_printf(Perl_debug_log, " libref=%x\n", RETVAL));
ST(0) = sv_newmortal() ;
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
--
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
-
[Fwd: dl_aix.xs and RTLD_GLOBAL usage warnings]
by Stas Bekman