This is the mail archive of the mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more infromation.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: more Linux --> AIX cross compiler questions

Alex Smith <> wrote:

> Hi Tom, I created a Solaris 7 x86 -> AIX 4.2.1 and a Linux -> AIX 4.2.1 with
> very little problems using gcc 2.95.  I did run into some problems like you did
> with getting links instead of the real stuff (be sure to check your include
> dir, IBM put quite a few links in there too).

 Building a 'xxx-linux-gnu' target toolset needs also one to fix the links. 
When the 'lib*.so.2.0.7' or something serve both as link-time (needing to be as
'/usr/lib/lib*.so') and as run-time (needing to be as '/lib/lib*.so.6') 
libraries, all kind of links to '../../lib/lib*.so.2.0.7' will exist...

 Just tarring, copying and unpacking the libs and headers on the host isn't 
enough, all the links must be checked. So this is a common problem, the 
AIX-target isn't the only one having its system libs and headers weirdly 

> This is because the linked in Dynamic library path was
> /usr/local/powerpc-ibm-aix4.2.1.0/lib.  The location were the AIX libraries are
> install to.

 So Ian was right and it takes the run-time search path from where it found the
library at link-time, not having any 'default' search libs, like '/usr/lib' as 
hard-coded to the linker and it putting them to the binaries... The 
ELF-binaries seem to know where to find the run-time libs much better, but 
fail to find the dynamic-linker file among the libraries when linking...

> I tried to work this out in my specs file, but I couldn't get it to
> work.  I fixed this by adding -Wl,-rpath /usr/lib to my build options.

 I remember you having it joined with '-shared' (building a shared library), 
which was wrong. 

> Ideally you would put -rpath /usr/lib in the link section of your specs file
> for you cross compiler.

 The right way could be to add a '%{!static: -rpath /usr/lib}' to the '*link:' 
spec. So it would give the option when not linking 'static' binaries (let's
leave the possibility to make them still open...)

 The GNU ld should work with AIX 4.1, but how well it works with producing AIX 
4.3 ones, is still open, docs and messages I have seen say that it shouldn't 
work... It working at least 'somehow' may be a good start however...

 If linking in the native AIX 4.3 environment and having the native 'ld' 
available, there may not be much motive to get the GNU ld to work... But when 
people want to work in a cross-development environment, where the GNU ld is the 
only one available, there really is a motive to get it working... At least 
questions like "Why doesn't it work ?" may get some skilled people tired to the 
questions and start fix the problem.

 There are other systems, like the SCO OpenServer 5.0.x, which still need the 
native-ld for producing binaries for them... A SCO-OSR5 linker may be used 
under a x86-Linux with ibcs2, but having the GNU ld would be much nicer...

Cheers, Kai

Want more information?  See the CrossGCC FAQ,
Want to unsubscribe? Send a note to

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]