Re: [gsar@ActiveState.com: v5.6.1 trial2 is available]
Hi, sorry for not answering sooner. The suggested patch seems to work find with the development branch of Perl, and I believe Sarathy will apply the patch also to the maintenance branch. On Wed, Feb 21, 2001 at 09:32:04PM +0100, Jens-Uwe Mager wrote: > On Fri, Feb 16, 2001 at 05:44:34PM +0100, [EMAIL PROTECTED] wrote: > > On Fri, 16 Feb 2001 [EMAIL PROTECTED] wrote: > > > > > Hi Jarkko, > > > > > > > > I'll try to do one or two more builds. I'd really like to try it with > > > > > Apache's mod_perl and mod_embed, these really didn't work at all with > > > > > perl-5.6.0, but I'm not sure I'll find the time. > > > > [AIX-4.3.2, IBM's C compiler, Apache apxs shared modules] > > > > I tried to get mod_perl-1.25 (an Apache/perl module that's > > supposed to let you use perl to implement script-based apache modules) > > working with perl-5.6.1-trial2, and failed. I can get mod_perl > > working with perl-5.5.3, but I never succeeded with perl-5.6.0. > > > > With perl-5.6.1-trial2, the mod-perl initialisation is successful, but I > > get a segmentation fault as soon as I try to access the perl script > > (test.pl or test.perl). > > A short while ago the Apache distribution did change over to the native > dlopen library if the AIX version 4.3 and above. For previous versions > the dlopen emulation layer is still used. Perl does always use the > emulation, which produces a conflict if Apache uses the native one in > the modperl case. I attach a patch below that changes the perl > distribution to also use the native AIX dlopen on AIX 4.3 and above as > in the Apache case. > > For getting some more involved modperl modules like Embperl to work we > probably need to change the modperl.exp file to include the magic "#! ." > instead of simply "#!" at the beginning, this signals the native dlopen > to import symbols from the main program. The patch already does that in > makedef.pl for the perl.exp file, but only on AIX 4.3 and above because > the older AIX linkers do strange things if this option is used. > > -- > Jens-Uwe Mager > > HELIOS Software GmbH > Steinriede 3 > 30827 Garbsen > Germany > > Phone:+49 5131 709320 > FAX: +49 5131 709325 > Internet: [EMAIL PROTECTED] > --- perl-5.6.1-TRIAL2/ext/DynaLoader/dl_aix.xs.orig Wed Feb 21 19:45:18 2001 > +++ perl-5.6.1-TRIAL2/ext/DynaLoader/dl_aix.xsWed Feb 21 21:16:53 2001 > @@ -14,6 +14,21 @@ > #define PERLIO_NOT_STDIO 0 > > /* > + * On AIX 4.3 and above the emulation layer is not needed any more, and > + * indeed if perl uses its emulation and perl is linked into apache > + * which is supposed to use the native dlopen conflicts arise. > + * Jens-Uwe Mager [EMAIL PROTECTED] > + */ > +#ifdef USE_NATIVE_DLOPEN > + > +#include "EXTERN.h" > +#include "perl.h" > +#include "XSUB.h" > +#include > + > +#else > + > +/* > * @(#)dlfcn.c 1.5 revision of 93/02/14 20:14:17 > * This is an unpublished work copyright (c) 1992 Helios Software GmbH > * 3000 Hannover 1, Germany > @@ -89,6 +104,13 @@ > # define FREAD(p,s,n,ldptr) fread(p,s,n,IOPTR(ldptr)) > #endif > > +#ifndef RTLD_LAZY > +# define RTLD_LAZY 0 > +#endif > +#ifndef RTLD_GLOBAL > +# define RTLD_GLOBAL 0 > +#endif > + > /* > * We simulate dlopen() et al. through a call to load. Because AIX has > * no call to find an exported symbol we read the loader section of the > @@ -627,6 +649,7 @@ > safefree(buf); > return ret; > } > +#endif /* USE_NATIVE_DLOPEN */ > > /* dl_dlopen.xs > * > @@ -672,7 +695,7 @@ > 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); > - RETVAL = dlopen(filename, 1) ; > + RETVAL = dlopen(filename, RTLD_GLOBAL|RTLD_LAZY) ; > DLDEBUG(2,PerlIO_printf(Perl_debug_log, " libref=%x\n", RETVAL)); > ST(0) = sv_newmortal() ; > if (RETVAL == NULL) > --- perl-5.6.1-TRIAL2/hints/aix.sh.orig Wed Feb 21 19:39:30 2001 > +++ perl-5.6.1-TRIAL2/hints/aix.shWed Feb 21 19:45:00 2001 > @@ -55,9 +55,11 @@ > case "$osvers" in > 3.*|4.1.*|4.2.*) >usenm='undef' > + usenativedlopen='false' >;; > *) >usenm='true' > + usenativedlopen='true' >;; > esac > > @@ -405,20 +407,25 @@ > esac > EOCBU > > -# If the C++ libraries, libC and libC_r, are available we will prefer them > -# over the vanilla libc, because the libC contain loadAndInit() and > -# terminateAndUnload() which work correctly with C++ statics while libc > -# load() and unload() do not. See ext/DynaLoader/dl_aix.xs. > -# The C-to-C_r switch is done by usethreads.cbu, if needed. > -if test -f /lib/libC.a -a X"`$cc -v 2>&1 | grep gcc`" = X; then > -# Cify libswanted. > -set `echo X "$libswanted "| sed -e 's/ c / C c /'` > -shift > -libswanted="$*" > -# Cify lddlflags. > -set `echo X "$lddlflag
Re: [gsar@ActiveState.com: v5.6.1 trial2 is available]
On Tue, Mar 13, 2001 at 05:57:20PM -0800, Gurusamy Sarathy wrote: > There is a change in behavior here that looks somewhat suspect > because the comments didn't mention it. > > >On Wed, Feb 21, 2001 at 09:32:04PM +0100, Jens-Uwe Mager wrote: > >> +#ifdef USE_NATIVE_DLOPEN > [...] > >> +#else > [...] > >> +#ifndef RTLD_LAZY > >> +# define RTLD_LAZY 0 > >> +#endif > >> +#ifndef RTLD_GLOBAL > >> +# define RTLD_GLOBAL 0 > >> +#endif > [...] > >> - RETVAL = dlopen(filename, 1) ; > >> + RETVAL = dlopen(filename, RTLD_GLOBAL|RTLD_LAZY) ; > > It seems to me that dlopen() is now being called with a second > argument of 0 instead of 1 if USE_NATIVE_DLOPEN wasn't set and > those two constants aren't defined in the system headers. > > Is this an intentional change? Does it have potential to break > anything on the pre-4.3 AIX versions? If you look in the source you will see that the mode argument of dlopen is not used at all in the dlopen emulation case, the argument "1" was not used in the previous version at all. And in fact in the dlopen emulator case there was no definition for the mode constants at all. I did change the arguments so the dlopen call can be used in both cases, with the emulator and with the native dlopen. -- Jens-Uwe Mager HELIOS Software GmbH Steinriede 3 30827 Garbsen Germany Phone: +49 5131 709320 FAX:+49 5131 709325 Internet: [EMAIL PROTECTED]
Re: [gsar@ActiveState.com: v5.6.1 trial2 is available]
On Tue, 13 Mar 2001 17:10:41 CST, Jarkko Hietaniemi wrote: >sorry for not answering sooner. The suggested patch seems to work >find with the development branch of Perl, and I believe Sarathy >will apply the patch also to the maintenance branch. There is a change in behavior here that looks somewhat suspect because the comments didn't mention it. >On Wed, Feb 21, 2001 at 09:32:04PM +0100, Jens-Uwe Mager wrote: >> +#ifdef USE_NATIVE_DLOPEN [...] >> +#else [...] >> +#ifndef RTLD_LAZY >> +# define RTLD_LAZY 0 >> +#endif >> +#ifndef RTLD_GLOBAL >> +# define RTLD_GLOBAL 0 >> +#endif [...] >> -RETVAL = dlopen(filename, 1) ; >> +RETVAL = dlopen(filename, RTLD_GLOBAL|RTLD_LAZY) ; It seems to me that dlopen() is now being called with a second argument of 0 instead of 1 if USE_NATIVE_DLOPEN wasn't set and those two constants aren't defined in the system headers. Is this an intentional change? Does it have potential to break anything on the pre-4.3 AIX versions? Sarathy [EMAIL PROTECTED]
Re: [AIX] [gsar@ActiveState.com: v5.6.1 trial2 is available]
On Fri, Feb 23, 2001 at 12:11:41PM +0100, [EMAIL PROTECTED] wrote: > > to import symbols from the main program. The patch already does that in > > makedef.pl for the perl.exp file, but only on AIX 4.3 and above because > > the older AIX linkers do strange things if this option is used. > > I tried your patch on v5.6.1 trial2. It built and the resulting perl > passed all its tests. > > However when I try to use this perl to build mod_perl, it doesn't > even succeed in performing the configuration. I use the > following configuration command: > > /usr/local/bin/perl5.6.1 Makefile.PL \ > USE_APXS=1 WITH_APXS=/usr/local/bin/apxs \ > PERL_USELARGEFILES=0 I have not used the APXS configuration method for a long time (due to the inherent memory leaks it has), so I could imagine that a problem is still lurking here. Could you try if the normal APACI mathod works? For example: perl Makefile.PL EVERYTHING=1 DO_HTTPD=1 USE_APACI=1 \ APACI_ARGS="--enable-module =most --enable-shared=max \ --disable-shared=perl --disable-shared=include" > The only thing I can imagine is that the "new" perl is > trying to open modules in the 5.6.0 or 5.5.3 site_perl subdirectories, > and that there is an incompatibility with the link options. But I can't > imagine what that incompatibility is. It is the probably the import file with a dot thing ("#! ."), the emulation I did in the past handled that differently. The dot thing means importing from the main program, whereas before without the dot it meant import later by use of the loadbind() system call explicetely. But the native dlopen from AIX does not use loadbind(), so the old plug-ins references back into the main part do not get resolved. -- Jens-Uwe Mager HELIOS Software GmbH Steinriede 3 30827 Garbsen Germany Phone: +49 5131 709320 FAX:+49 5131 709325 Internet: [EMAIL PROTECTED]
Re: [AIX] [gsar@ActiveState.com: v5.6.1 trial2 is available]
On Wed, 21 Feb 2001, Jens-Uwe Mager wrote: Hi Jum ;-), > to import symbols from the main program. The patch already does that in > makedef.pl for the perl.exp file, but only on AIX 4.3 and above because > the older AIX linkers do strange things if this option is used. I tried your patch on v5.6.1 trial2. It built and the resulting perl passed all its tests. However when I try to use this perl to build mod_perl, it doesn't even succeed in performing the configuration. I use the following configuration command: /usr/local/bin/perl5.6.1 Makefile.PL \ USE_APXS=1 WITH_APXS=/usr/local/bin/apxs \ PERL_USELARGEFILES=0 No error messages are dispayed, the configuration just stops. When I add a -w to the options I get 2 warnings: PerlSSI.disabled (enable with PERL_SSI=1) Use of uninitialized value in hash element at Makefile.PL line 1654. Use of uninitialized value in hash element at Makefile.PL line 1654. Configuring mod_perl for building via APXS + Creating a local mod_perl source tree + Setting up mod_perl build environment (Makefile) + id: mod_perl/1.25 + id: Perl/v5.6.1 (aix) [/usr/local/bin/perl5.6.1] Now please type 'make' to build libperl.so Use of uninitialized value in hash element at Makefile.PL line 1654. Use of uninitialized value in numeric ge (>=) at Makefile.PL line 1058. # but with perl5.6.0 I also get these warnings: PerlSSI.disabled (enable with PERL_SSI=1) Use of uninitialized value in hash element at Makefile.PL line 1654. Use of uninitialized value in hash element at Makefile.PL line 1654. Configuring mod_perl for building via APXS + Creating a local mod_perl source tree + Setting up mod_perl build environment (Makefile) + id: mod_perl/1.25 + id: Perl/v5.6.0 (aix) [/usr/local/bin/perl5.6.0] Now please type 'make' to build libperl.so Use of uninitialized value in hash element at Makefile.PL line 1654. Use of uninitialized value in numeric ge (>=) at Makefile.PL line 1058. Checking CGI.pm VERSION..ok Checking for LWP::UserAgent..ok . Perl5.6.0 completes the configuration normally. The only thing I can imagine is that the "new" perl is trying to open modules in the 5.6.0 or 5.5.3 site_perl subdirectories, and that there is an incompatibility with the link options. But I can't imagine what that incompatibility is. Bye Ciaran +-+ Ciaran DeignanTel: (France) 04 76 29 79 92 BULL XS-BU (http://www-frec.bull.com) HA and Consolidation Mail to: [EMAIL PROTECTED]Bullcom: 229 79 92 PGP: B1 78 FB 88 FD 86 58 A8 89 7B 22 8C D0 E8 71 FC Fax: 229 75 18 +-+
Re: [gsar@ActiveState.com: v5.6.1 trial2 is available]
On Fri, Feb 16, 2001 at 05:44:34PM +0100, [EMAIL PROTECTED] wrote: > On Fri, 16 Feb 2001 [EMAIL PROTECTED] wrote: > > > Hi Jarkko, > > > > > > I'll try to do one or two more builds. I'd really like to try it with > > > > Apache's mod_perl and mod_embed, these really didn't work at all with > > > > perl-5.6.0, but I'm not sure I'll find the time. > > [AIX-4.3.2, IBM's C compiler, Apache apxs shared modules] > > I tried to get mod_perl-1.25 (an Apache/perl module that's > supposed to let you use perl to implement script-based apache modules) > working with perl-5.6.1-trial2, and failed. I can get mod_perl > working with perl-5.5.3, but I never succeeded with perl-5.6.0. > > With perl-5.6.1-trial2, the mod-perl initialisation is successful, but I > get a segmentation fault as soon as I try to access the perl script > (test.pl or test.perl). A short while ago the Apache distribution did change over to the native dlopen library if the AIX version 4.3 and above. For previous versions the dlopen emulation layer is still used. Perl does always use the emulation, which produces a conflict if Apache uses the native one in the modperl case. I attach a patch below that changes the perl distribution to also use the native AIX dlopen on AIX 4.3 and above as in the Apache case. For getting some more involved modperl modules like Embperl to work we probably need to change the modperl.exp file to include the magic "#! ." instead of simply "#!" at the beginning, this signals the native dlopen to import symbols from the main program. The patch already does that in makedef.pl for the perl.exp file, but only on AIX 4.3 and above because the older AIX linkers do strange things if this option is used. -- Jens-Uwe Mager HELIOS Software GmbH Steinriede 3 30827 Garbsen Germany Phone: +49 5131 709320 FAX:+49 5131 709325 Internet: [EMAIL PROTECTED] --- perl-5.6.1-TRIAL2/ext/DynaLoader/dl_aix.xs.orig Wed Feb 21 19:45:18 2001 +++ perl-5.6.1-TRIAL2/ext/DynaLoader/dl_aix.xs Wed Feb 21 21:16:53 2001 @@ -14,6 +14,21 @@ #define PERLIO_NOT_STDIO 0 /* + * On AIX 4.3 and above the emulation layer is not needed any more, and + * indeed if perl uses its emulation and perl is linked into apache + * which is supposed to use the native dlopen conflicts arise. + * Jens-Uwe Mager [EMAIL PROTECTED] + */ +#ifdef USE_NATIVE_DLOPEN + +#include "EXTERN.h" +#include "perl.h" +#include "XSUB.h" +#include + +#else + +/* * @(#)dlfcn.c 1.5 revision of 93/02/14 20:14:17 * This is an unpublished work copyright (c) 1992 Helios Software GmbH * 3000 Hannover 1, Germany @@ -89,6 +104,13 @@ # define FREAD(p,s,n,ldptr)fread(p,s,n,IOPTR(ldptr)) #endif +#ifndef RTLD_LAZY +# define RTLD_LAZY 0 +#endif +#ifndef RTLD_GLOBAL +# define RTLD_GLOBAL 0 +#endif + /* * We simulate dlopen() et al. through a call to load. Because AIX has * no call to find an exported symbol we read the loader section of the @@ -627,6 +649,7 @@ safefree(buf); return ret; } +#endif /* USE_NATIVE_DLOPEN */ /* dl_dlopen.xs * @@ -672,7 +695,7 @@ 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); - RETVAL = dlopen(filename, 1) ; + RETVAL = dlopen(filename, RTLD_GLOBAL|RTLD_LAZY) ; DLDEBUG(2,PerlIO_printf(Perl_debug_log, " libref=%x\n", RETVAL)); ST(0) = sv_newmortal() ; if (RETVAL == NULL) --- perl-5.6.1-TRIAL2/hints/aix.sh.orig Wed Feb 21 19:39:30 2001 +++ perl-5.6.1-TRIAL2/hints/aix.sh Wed Feb 21 19:45:00 2001 @@ -55,9 +55,11 @@ case "$osvers" in 3.*|4.1.*|4.2.*) usenm='undef' + usenativedlopen='false' ;; *) usenm='true' + usenativedlopen='true' ;; esac @@ -405,20 +407,25 @@ esac EOCBU -# If the C++ libraries, libC and libC_r, are available we will prefer them -# over the vanilla libc, because the libC contain loadAndInit() and -# terminateAndUnload() which work correctly with C++ statics while libc -# load() and unload() do not. See ext/DynaLoader/dl_aix.xs. -# The C-to-C_r switch is done by usethreads.cbu, if needed. -if test -f /lib/libC.a -a X"`$cc -v 2>&1 | grep gcc`" = X; then -# Cify libswanted. -set `echo X "$libswanted "| sed -e 's/ c / C c /'` -shift -libswanted="$*" -# Cify lddlflags. -set `echo X "$lddlflags "| sed -e 's/ -lc / -lC -lc /'` -shift -lddlflags="$*" +if test $usenativedlopen = 'true' +then +ccflags="$ccflags -DUSE_NATIVE_DLOPEN" +else +# If the C++ libraries, libC and libC_r, are available we will prefer them +# over the vanilla libc, because the libC contain loadAndInit() and +# terminateAndUnload() which work correctly with C++ statics while libc +# load() and unload() do not. See ext/DynaLoader/dl_aix.xs. +# The C-to-C_r switch is done by usethreads.cbu, i
Re: [AIX] [gsar@ActiveState.com: v5.6.1 trial2 is available]
Hi guys, > > [AIX-4.3.2, IBM's C compiler, Apache apxs shared modules] How about putting [AIX] in the subject line? I've seen a number of people asking about AIX on the mod_perl List. 73, Ged.
Re: [gsar@ActiveState.com: v5.6.1 trial2 is available]
On Fri, 16 Feb 2001 [EMAIL PROTECTED] wrote: > Hi Jarkko, > > > > I'll try to do one or two more builds. I'd really like to try it with > > > Apache's mod_perl and mod_embed, these really didn't work at all with > > > perl-5.6.0, but I'm not sure I'll find the time. [AIX-4.3.2, IBM's C compiler, Apache apxs shared modules] I tried to get mod_perl-1.25 (an Apache/perl module that's supposed to let you use perl to implement script-based apache modules) working with perl-5.6.1-trial2, and failed. I can get mod_perl working with perl-5.5.3, but I never succeeded with perl-5.6.0. With perl-5.6.1-trial2, the mod-perl initialisation is successful, but I get a segmentation fault as soon as I try to access the perl script (test.pl or test.perl). Bye Ciaran +-+ Ciaran DeignanTel: (France) 04 76 29 79 92 BULL XS-BU (http://www-frec.bull.com) HA and Consolidation Mail to: [EMAIL PROTECTED]Bullcom: 229 79 92 PGP: B1 78 FB 88 FD 86 58 A8 89 7B 22 8C D0 E8 71 FC Fax: 229 75 18 +-+