Please note: THIS PAGE IS NOT FINISHED
To create a crosscompile toolchain I searched the internet and found:
Crosstool can be used to create a build environment for ARM targets, but it doesn’t seem to be as polished as Scratchbox.
While building Crosstool for armv51b I got the following error scripts/kconfig/mconf.c:91: error: static declaration of ‘current_menu’ follows non-static declaration
scripts/kconfig/lkc.h:63: error: previous declaration of ‘current_menu’ was heremake[1]: *** [scripts/kconfig/mconf.o] Error 1 etc.
This error is a common one aparently because Google returns a lot of hits. One solution is to patch the mconf.c file and another is to use a different gcc compiler version. I chose to switch to a different compiler version.
Crosstool toolchain As an example to build my own Crosstool toolchain I copied demo-armv5b.sh, commented the current active eval ... line and added a new one: eval `cat armv5b-softfloat.dat gcc-4.0.0-glibc-2.2.5.dat` sh all.sh –notest.
After running the adapted Crosstool script a new Crosstool toolchain is available: - gcc 4.0.0 - glibc 2.2.5
Below is a list of steps I performed in getting scratchbox installed and compiling a package. These steps originate from the Scratchbox website and aditional/more detailed information about these steps can be found in the Scratchbox install manual.
vi or other text editor:# # Scratchbox # deb http://scratchbox.org/debian ./
# apt-get update
# apt-get install scratchbox-core scratchbox-toolchain-arm-gcc3.3-glibc2.3 scratchbox-devkit-cputransp
Note: Without the toolchain the scratchbox tool will not work. Also the cpu transparency is needed as a seperate install.
# apt-get install qemu
# sb-adduser <username>
# sb-menu
# /scratchbox/login
[sbox-HOST: ~] > sb-conf install -c
sb-menu, naming it ‘NA-1400’.[sbox-HOST: ~] > sb-menu
[sbox-NA-1400: ~] > tar xfz /scratchbox/packages/hello-world.tar.gz [sbox-NA-1400: ~] > cd hello-world [sbox-NA-1400: ~/hello-world] > ./autogen.sh [sbox-NA-1400: ~/hello-world] > make
file hello. This results in:[sbox-NA-1400: ~/hello-world] > file hello hello: ELF 32-bit LSB executable, ARM, version 1 (ARM), for GNU/Linux 2.0.0, dynamically linked (uses shared libs), not stripped
This shows the executable is compiled for ARM, uses shared libraries and is not stripped
[sbox-NA-1400: ~/hello-world] > ./hello Hello World!
Using the Scratchbox toolchain I was able to compile the hello.c and hello-world examples and ran them on the NA-1400. However programs using a glibc library fail to run on the NA-1400 because they are built agains glibc version 2.3 while the current version on the NA-1400 is 2.2.6.
There seem to be a few solutions to overcome this problem:
This would be a good choice, it leaves the current software on the NA-1400 as is and allowes adding new software transparantly. On the other hand I have a gut feeling that this is a difficult process which might not succeed through lack of proper patches. Remember, the distribution used for the NA-1400 is most probably a highly adapted one with many undisclosed patches.
This should be feasable but might break existing software on the NA-1400 (Normally glibc is backward compatible). Also the ugrade process is probably difficult as the glibc library is used for almost everything on the system.
Useful links:
This might be the quickest way to see results, but is also one of the less beautiful ones as it wastes a lot of disk- and memory space because every process loads the same code over and over again.
This could be the ultimate goal for me as it will give me all the controlls over the new system. This option will probably take the most time and I doubt if I can get this far by myself....