Hello scratch box developers,

My short term goal is to get hold of a static binary of tcpdump for
powerpc 405. My longterm goal is to get a working scratchbox target
for powerpc 405.

I have not been able to find a working native compiler but I managed
to build a working crosscompiler using Dan Kegel's crosstool-0.38
(demo-ppc405.sh). I can crosscompile libpcap but not tcpdump so I
thought why not give scratchbox a chance.

On the machine (i686) I'm running Debian Sid and have installed the
following packages (all version 1.0.2):
scratchbox-core
scratchbox-devkit-debian
scratchbox-devkit-doctools
scratchbox-devkit-perl
scratchbox-libs
scratchbox-toolchain-i686-gcc3.3-glibc2.3 1.0.2

I tried to follow wangji's recent mail about on how to build a
crosstool toolchain inside the HOST target. But using the host
toolchain scratchbox-toolchain-i686-gcc3.3-glibc2.3 1.0.2 the
demo-ppc405.sh stops with an error when building libiberty saying
something like I should use --host instead of --build. Outside of
scratchbox the demo-ppc405.sh script just works.

Then I thought I could copy my working crosscompiler into
/scratchbox/compilers/powerpc-405-gcc-3.4.1-glibc-2.3.3/ and created
the 3 files: compiler-name, gcc.specs, target_setup.sh

======================================
# cat compiler-name
powerpc-405-gcc-3.4.1-glibc-2.3.3:/scratchbox/compilers/powerpc-405-gcc-3.4.1-glibc-2.3.3:powerpc-405::glibc:

======================================
# cat target_setup.sh
#!/bin/sh

target=$1
source=/scratchbox/compilers/powerpc-405-gcc-3.4.1-glibc-2.3.3

mkdir -p $target/lib
mkdir -p $target/usr/lib
mkdir -p $target/usr/include
mkdir -p $target/usr/bin

cp -af $source/lib/*                 $target/lib/
cp -af $source/lib/* $target/usr/lib/

cp -af $source/include/* $target/usr/include/

ln -sf /bin/cpp $target/lib/
ln -sf /bin/cc  $target/usr/bin/

chmod +x $target/lib/ld-*.so
======================================

Now I can select target "powerpc-405 
powerpc-405-gcc-3.4.1-glibc-2.3.3" in sb-menu but typing cc gives:
Shell restarting...
[sbox-powerpc-405: ~] > cc
sbox-powerpc-405--cc: No such file or directory
[sbox-powerpc-405: ~] >

Note the double dash between 405 and cc.

Any suggestions and help would be greatly appreciated!

When this hurdle is done I guess the next step is to crosscompile
sbrshd for powerpc 405?
I tried to run qemu-pcc hello on a static hello world and get:

$ qemu-ppc ./hello_static
Hello World
Invalid data memory access: 0x821ffc68
Invalid segfault errno (00)
qemu: uncaught target signal 11 (Segmentation fault) - exiting

And on a dynamic I get:
$ qemu-ppc ./hello_dynamic
/lib/ld.so.1: No such file or directory
Segmentation fault (core dumped)

Regards
Peter M
_______________________________________________
Scratchbox-devel mailing list
[email protected]
http://lists.scratchbox.org/cgi-bin/mailman/listinfo/scratchbox-devel

Reply via email to