develooper Front page | perl.perl5.porters | Postings from August 2001

Re: Dynamic Build of Perl 5.6.1 on AIX 4.3.3... using gcc

Thread Previous
From:
Jens-Uwe Mager
Date:
August 2, 2001 12:05
Subject:
Re: Dynamic Build of Perl 5.6.1 on AIX 4.3.3... using gcc
Message ID:
20010802210502.A36670@ans.helios.de
On Thu, Jan 04, 2001 at 02:38:14PM +0100, H.Merijn Brand wrote:
> On Thu 02 Aug 2001 14:15, LBaxter@FLEETCC.COM wrote:
> > Hi all (especially you IBMers out there).
> > 
> > I am trying to build perl from sources with a version of gcc we downloaded
> > from IBM's linux compatibility software website (gcc version
> > 2.9-aix43-010216).
> > 
> > >From reading various archives I discovering the -Xlinker ccdlflags option
> > that allows me to get past link errors, during the build.  The problem I now
> > have is that 'make test' fails loading the Dynamic extensions:
> 
> try 'slibclean' before you start
> 
> > op/defins............Can't load '../lib/auto/File/Glob/Glob.a' for module
> > File::Glob: dlopen: ../lib/auto/File/Glob/Glob.a: can't load library
> > ../lib/auto/File/Glob/Glob.a103 ../lib/auto/File/Glob/Glob.a at
> > ../lib/XSLoader.pm line 75.
> >  at ../lib/File/Glob.pm line 101
> > Compilation failed in require at op/defins.t line 95.
> > BEGIN failed--compilation aborted at op/defins.t line 95.
> > FAILED at test 1
> > 
> > Tim Bunce noticed that it was trying to load a '.a' file as a DL.  But I
> > understand the IBM is a little 'different' and used .a as the DL extension.
> > Also .a is the default DL extention for AIX when one
> 
> *ALL* objects on AIX are shared, and AIX has no difference between shared
> libraries and static one's (AFAIK). All objects are relocatable, and all
> libraries end with .a

Well, not all objects are shared, only these that have been linked with
-bM:SRE linker option. A normal object module as the result of cc -c
file.c is not shared. Opposed to many other platforms all objects
generated by the AIX compilers are relocatable, so no -fpic option is
needed on AIX and you can simply build a shared object by linking a few
object files provided that you have an export file. All this does not
say anything about file suffices as all the AIX tools like the linker
do not look at the suffix but at the file magic to check the file
type.

As an additional speciality AIX supports shared objects inside library
archives made by ar, these are conventionally named with a .a suffix.
All the OS libraries are delivered in this format, and these sometimes
have multiple shared objects (suffixed .o) archived to cope with
multiple shared library versions. But nothing requires that a .a file
really is an archive, I have been delivering simple -bM:SRE shared
objects with a .a suffix as shared libraries, and this works just fine.

If you look at shared objects that are supposed to be loaded via dlopen
then you can use any suffix you like, perl does use .so here for
consistency with other platforms. The AIX dlopen is also able load one
particular member from an archive, one has to specify the RTLD_MEMBER
flag to dlopen then and the file name must be of the form
"libname(membername)", where libname commonly has a .a suffix and
membername .o, but again this is not required.

-- 
Jens-Uwe Mager

HELIOS Software GmbH
Steinriede 3
30827 Garbsen
Germany

Phone:		+49 5131 709320
FAX:		+49 5131 709325
Internet:	jum@helios.de

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About