Cross compiling glibc for PowerPC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi there,
 
I'm trying to cross compile glibc-2.3.4 to PowerPC MPC7457.
 
I have a prebuilt toolchain on my dev host:
 
# $CC --version
ppc_60x-gcc (GCC) 3.4.4
# uname -a
Linux 2.4.21-53.ELsmp #1 SMP Mon Dec 3 12:48:08 CST 2007 i686 i686 i386 GNU/Linux
 
I'm cpnfigurin with the followint options:

# cd $PROJECT_OBJ_DIR
# $SOURCE_DIR/configure --prefix=$PROJECT_INSTALL_DIR/usr/local CC=ppc_60x-gcc --with-sysroot=$PROJECT_INSTALL_DIR --build=i686-pc-linux-gnu --target=powerpc-unknown-linux-gnu --host=powerpc-unknown-linux-gnu --enable-add-ons CC=ppc_60x-gcc CXX=ppc_60x-g++ build_alias=i686-pc-linux-gnu host_alias=powerpc-unknown-linux-gnu target_alias=powerpc-unknown-linux-gnu
 
where $PROJECT_OBJ_DIR, $PROJECT_SRC_DIR and $PROJECT_INTALL_DIR are subdirectories of my whole project, and reside on the same directory level.
 
Configuration, compilation and installation run without any problems. But when I copy the compiled files in /usr/local to the target, and try to start a simple application I get errors like this:
 
/usr/local/bin/ldd: line 167: $PROJECT_ISNTALL_DIR/usr/local/lib/ld.so.1: No such file or directory
ldd: $PROJECT_INSTALL_DIR/usr/local/lib/ld.so.1 exited with unknown exit code (127)
 
The ld.so.1 is located in two directories after I copy the newly compiled files to the target:
 
-sh-3.00# find / -name ld.so.1
/lib/ld.so.1
/usr/local/lib/ld.so.1
 
Here are the library search path and exec path:

-sh-3.00# echo $LD_LIBRARY_PATH
/lib:/usr/lib:/export/doocs/lib
-sh-3.00# echo $PATH
/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/export/doocs/server

I have also tried to cross-compile a new compiler for the target, but when I copy it and try to compile a simple "Hello World" program it cannot find stdio.h for example. Here's the configuration string for GCC:
# $SOURCE_DIR/configure --prefix$PROJECT_INSTALL_DIR/usr/local \
--with-sysroot$PROJECT_INSTALL_DIR --build=i686-pc-linux --host=powerpc-unknown-linux-gnu \
--target=powerpc-unknown-linux-gnu --enable-languages=c,c++,ada \
--enable-shared --enable-threads --enable-bootstrap \
CC=ppc_60x-gcc
 
Can someone please give me a clue what I'm doing wrong, or how should I configure glibc, so it will have the right search paths?
 
Thanks in advance,
Konstantin Boyanov

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux