Problems using shared library in corss environment

Graham Stoney greyham at
Tue Aug 22 11:34:11 EST 2000

Seong-kyu Ko writes:
> First, I compile the binutils for powerpc cpu.
> Second, I build cross compiler with gcc.
> Third, I compile glibc for powerpc with cross compiler that I made.
> Last, I re-build cross compiler include glibc for library.

OK, sounds good.

> but I compile shell with shared labrary, it use and
> The problem is can't found
> The error message is this :
> 'error in loading shared libraries: cannot open shared object
> file: No such file or directory'

In order to find on the host, I found that I needed to edit
$prefix/powerpc-linux/lib/ to use an absolute path to refer to
$prefix/powerpc-linux/lib/  For some reason, gcc wouldn't find it
otherwise, even when I specified --rpath.

Next, to ensure that the dynamic linker could find in the right
place on the target, I edited $prefix/lib/gcc-lib/powerpc-linux/2.95.2/specs
to add this right after -dynamic-linker:
    --rpath /lib --rpath-link /opt/gcc-2.95.2/powerpc-linux/lib

Good luck,
Graham Stoney
Principal Hardware/Software Engineer
Canon Information Systems Research Australia
Ph: +61 2 9805 2909  Fax: +61 2 9805 2929

** Sent via the linuxppc-embedded mail list. See

More information about the Linuxppc-embedded mailing list