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

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

Thread Next
From:
LBaxter
Date:
August 2, 2001 12:37
Subject:
FW: Dynamic Build of Perl 5.6.1 on AIX 4.3.3... using gcc
Message ID:
B1FA93A1B9A9D31189EC00508B6140CD0345D108@KPEXS08
Jens-Uwe and H.Merijn

Thank you... both of you.

I think I may now know enough to get this working... Key points:  

1. link with ld #I discovered it was using /usr/linux/ar... 8-( but I can
fix it
2. use '-bM:SRE' as link flags.

Thanks Jens for the clarification of the flags.

If either of you has the actual command string that should be used for
building say...
Glob.a (the shared library)... that would speed me on my way.  My guess that
the link is the same, whether the compiler was gcc or vac.C.  Right?

Thanks both of you for the help... I will report what I find... later this
weekend
or maybe early next week to the whole list.  If I get it working I will try
to develop an
aix_gcc hints file when I am done, so that the next guy can just "take the
defaults".

At the very least I will provide some updates to the README.aix that
H.Merign sent me.

Thanks again,

Lincoln


-----Original Message-----
From: Jens-Uwe Mager [mailto:jum@helios.de]
Sent: Thursday, August 02, 2001 3:05 PM
To: H.Merijn Brand
Cc: LBaxter@FLEETCC.COM; Perl 5 Porters
Subject: Re: Dynamic Build of Perl 5.6.1 on AIX 4.3.3... using gcc


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 Next


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