User talk:Jluis

From Openmoko

Jump to: navigation, search


toolchain + distcc + shr = "Developer Workstation"

Work in progress mixed language 

Tested with 20080808 shr-lite after opkg-cl update opkg-cl upgrade

On the PC:

Install the openmoko [toolchain [Toolchain]]

If we are going to use mascareded distcc we need to create simbolic links for the short nanes of the /usr/local/openmoko/arm/bin/arm-angstrom-linux-gnueabi-* executables.

Install distcc server and run it on a shell that has the toolchain on the path and if using mascaraded distcc the directory with the links, with:

distccd -a --verbose --no-detach --daemon --log-stderr

On Neo:

Create a suitable hello.c to test compiler.

cat > hello.c <<EOF
#include <stdio.h>
int main(void) {
printf("Hello world\n");
return 0;

Create a suitable swapfile:

dd if=/dev/zero of=/swapfile bs=4k count=128k
mkswap /swapfile
swapon /swapfile

Install what is needed to compile distcc in a loop to lower the opkg's memory footprint.

for i in libc6-dev binutils-symlinks gcov gcc-symlinks cpp make \
python-distutils python-doctest python-devel;do opkg install $i;done

test the setup so far :

root@om-gta02:~# gcc -o hello hello.c
root@om-gta02:~# hello ;rm hello
Hello world

We create a new user to no compile as root:

root@om-gta02 ~ $ adduser developer
Changing password for developer
Enter the new password (minimum of 5, maximum of 8 characters)
Please use a combination of upper and lower case letters and numbers.
Enter new password:
Re-enter new password:
Password changed.
root@om-gta02 ~ $ su - developer
developer@om-gta02 ~ $

Compiling distcc distribution

Download distcc souce from and uncompress them and install distcc.

developer@om-gta02 ~ $ wget
developer@om-gta02 ~ $ zcat distcc-3.1.tar.gz |tar -vx;cd distcc-3.1;./configure;make ;make install

Testing and finishing neo configuration

We test the available hosts with "distcc --show-hosts" it should respondo with

We edit /usr/local/etc/default/distcc to prevent distccd from loading at startup, we kill its procces and test it works: y comprobamos que funciona: svn checkout distcc-read-onlyroot@om-gta02:~# killall distccd root@om-gta02:~# distcc --show-hosts root@om-gta02:~# /etc/init.d/distcc start STARTDISTCC is set to false in /etc/default/distcc /usr/bin/distccd not starting Creamos los enlaces simbólicos para gcc y cc llamen a distcc: root@om-gta02:~# mkdir /usr/local root@om-gta02:~# mkdir /usr/local/bin root@om-gta02:~# ln -s /usr/bin/distcc /usr/local/bin/gcc root@om-gta02:~# ln -s /usr/bin/distcc /usr/local/bin/cc

Y probamos : root@om-gta02:~# rm hello root@om-gta02:~# DISTCC_VERBOSE=1 gcc -c hello.c -o hello #si no usamos -c compila en local distcc[8252] (dcc_trace_version) distcc 2.18.3 arm-angstrom-linux-gnueabi; built Aug 5 2008 03:45:13 distcc[8252] (dcc_recursion_safeguard) safeguard level=0 distcc[8252] (main) compiler name is "cc" .... distcc[8252] (dcc_parse_hosts) found tcp token "" distcc[8252] (dcc_lock_host) got cpu lock on slot 0 as fd3 .... distcc[8252] (dcc_connect_by_addr) started connecting to ..... distcc[8252] (dcc_compile_remote) client finished sending request to server distcc[8252] (dcc_note_state) note state 5, file "(NULL)", host "" distcc[8252] 18057 bytes from hello.c compiled on in 0.5536s, rate 32kB/s ...

Personal tools