Front page | perl.perl5.porters |
Postings from November 2000
From: H . Merijn Brand
November 24, 2000 00:33
Message ID: 20001124092242.7C31.H.M.BRAND@hccnet.nl
Now that we have README.aix, 19991007.005/2 might be added somewhere. I don't
work with C++, so I cannot confirm this is still needed.
I have identified a problem with Perl's DynaLoader/dl_aix.xs
which is very specific to the IBM AIX platform.
This problem is specific to Perl to C extensions that
first call C functions but the C functions call C++ functions
and the C++ code makes use of statics. The statics are not
getting initialized. To get them to initialize properly the
load and unload function calls in DynaLoader/dl_aix.xs need to be
replaced with libC_r.a function calls loadAndInit and
terminateAndUnload. dl_aix.xs also now needs
to include the load.h file, on my system I included
#include </usr/ibmcxx/include/load.h>. In addition, the code
now needs to link with -lC_r.
Making these changes should not impact any extension that
doesn't require this fix.
If for some reason you do not want to patch dl_aix.xs, I would
strongly recommend that at a minimum a README for aix (README.aix)
be created that identifies this problem and suggests this work around.
Linking with libC_r.a should not be a problem since it is
shipped with base AIX. This change was made to the Perl code
that is now shipped with AIX 4.3.3. I just put a post out to
comp.lang.perl.misc today (October 7, 1999) announcing this.
I have also been using both Perl5.005_02 and then Perl5.005_03 fixed
with my patch for roughly one year and it has not broken any other
part of Perl. I have now, twice in the last 3 weeks, been contacted
by two different IBMers, one in IBM Research and one in Burlington
Vermont, confirming that this fix was also required for some of
their Perl to C extensions to work properly.
This was one of the most difficult bugs that I've had to
tackle in IBM. Patching base Perl specifically the
DynaLoader/dl_aix.xs will save many other people from the
4 weeks of pain that I went through. Being a new developer
of Perl to C extensions last year, I first
assumed this problem was in my code, it wasn't, next I figured
it must be in the code I was calling, it wasn't, finally
after scanning through many IBM internal news groups I hit
on a similar fix someone had to make to Rexx calling C calling
C++. The fix worked for me and was very easy to make.
For people outside of IBM who don't have access to our internal
news groups this would be an extremely painful bug to resolve.
I would be very willing to download and build a new level of Perl
that includes this fix to verify that the fix was done correctly
and works on the 1 out of 5 of my extensions that requires it.
Please feel free to contact me with questions!
H.Merijn Brand Amsterdam Perl Mongers (http://www.amsterdam.pm.org/)
using perl-5.005.03, 5.6.0, 5.7.1 & 620 on HP-UX 10.20 & 11.00, AIX 4.2 & 4.3,
DEC OSF/1 4.0 and WinNT 4.0 SP-6a, often with Tk800.022 and/or DBD-Unify
by H . Merijn Brand