Help with ppc-linux cross
Kai Ruottu
karuottu@freenet.hut.fi
Tue Aug 24 03:51:00 GMT 1999
Brendan Simon wrote:
> find some runtime libs. eg. I used the yellowdog linux glibc libraries which were
> pointed out to me by Kai Ruottu. Here are his instructions.
>
> http://www.yellowdoglinux.com/
< clip >
> Probably need to fix the "-dynamic-linker" statement in the specs file
> ($prefix/lib/gcc-lib/$target/$egcs-version/specs) to be "-dynamic-linker
> $prefix/$target/lib/ld.so.1".
This is wrong... The '--dynamic-linker ....' shouldn't be touched! It tells
where to found the file at runtime on a ppc-linux machine. This info will be
recorded into the executable:
----- clip ---------
E:\usr\local\samples>strings tst_linux-gnu.x | less
/lib/ld-linux.so.2
__gmon_start__
libc.so.6
_DYNAMIC
_GLOBAL_OFFSET_TABLE_
_fini
_init
__libc_init_first
----- clip ---------
Although also this may help to find the file at link-time, the right option
would be using the '-rpath-link $prefix/$target/lib', where the $prefix and
$target are set to tell where the 'dynamic-linker' file is at link-time...
These things were new to me when I wrote the stuff, if one reads the messages
since a couple a weeks in this list, about Linux, AIX and Solaris target tools,
the '-rpath' (set the link-time/runtime search paths) and the '-rpath-link'
(set the search path for the linked-libraries, inside a shared library).
Ian Lance Taylor wrote:
>> I actually don't think --rpath-link is needed on AIX. On ELF, the
>> --rpath-link option is used because one shared library can refer
>> directly to another, and the linker wants to try to track down the
>> referenced shared library in order to give appropriate warnings if
>> some shared library or symbol is not defined.
Many thanks to Ian Lance Taylor for clarifying this to all of us!
The 'dynamic-linker' file is referenced in the Linux-gnu 'libc.so',
here is the 'x86-linux-gnu' target one:
----- clip ---------
E:\usr\local\i586-linux-gnu\lib>strings libc.so | grep ld-linux
ld-linux.so.2
/lib/ld-linux.so.2
----- clip ---------
Without the '-rpath-link', this would be searched in the current
directory and in '/lib'. Of course one can think to install it to
'/lib' in the x86-linux-gnu host, the 'ppc-linux-gnu' one is named
differently as 'ld.so.2' or something, but keeping all the target
stuff in one place would be nicer...
Cheers, Kai
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com
More information about the crossgcc
mailing list