Crosscompling wiht distcc

This forum is for topics specific to the Raspberry Pi and Arch Linux ARM

Crosscompling wiht distcc

Postby disfido » Mon Sep 24, 2012 4:18 pm

Hi, I'm trying to cross-compile software with distcc for our raspberrypi:

server machine: bridged Virtualbox Archlinux 64
daemon machine: raspberry-pi

1) I used instruction from the wiki: https://wiki.archlinux.org/index.php/Distcc
2) I created my toolchains using AUR PKGBUILDS:
  • arm-linux-gnueabi-binutils
  • arm-linux-gnueabi-gcc

3) So after successful compilation/installation did symlinks to arm-linux-gnueabi's binaries and add the path to PATH variable on the server machine.

4) I did makepkg from daemon machine (raspberry pi) but only some c sources are compiled, for others I received the distcc this error:
$this->bbcode_second_pass_code('', 'distcc[8615] (dcc_build_somewhere) Warning: failed to distribute, running locally instead')

and finally this:
$this->bbcode_second_pass_code('', 'CMakeFiles/oscam.dir/oscam.o: file not recognized: File format not recognized')

When the compilation starts I had this on the server machine:
$this->bbcode_second_pass_code('', ' (dcc_job_summary) client: 192.168.0.2:38206 COMPILE_ERROR exit:1 sig:0 core:0 ret:0 time:4ms gcc /home/adriano/oscam-svn/src/oscam-build/CMakeFiles/CMakeTmp/testCCompiler.c')

I tried too use this how to http://archlinuxarm.org/developers/dist ... -compiling
width pre-compiled x-tools toolchain but I had the same error...
disfido
 
Posts: 11
Joined: Mon Jun 25, 2012 5:21 pm

Re: Crosscompling wiht distcc

Postby pezz » Tue Sep 25, 2012 9:55 am

I followed the guides and got it working fine (have compiled a kernel a couple of times).

Just to get things straight, as your terminology is confusing:

- The daemon machine is not the pi, it's your server box, right? The Pi just has "distcc" and DISTCC_HOSTS set in makepkg.conf

- You have the path set to the x-tools chain on the server box set correctly?

e.g. export PATH="/opt/x-tools6h/arm-unknown-linux-gnueabi/bin:$PATH" in /etc/rc.d/distccd on the server?

*Edit: I moved my x-tools to /opt and ran some finds to fix permissions.

- The x-tools stuff is executable by the user that distccd runs as (e.g. nobody)?
pezz
 
Posts: 75
Joined: Fri Sep 14, 2012 11:19 pm
Location: Geelong, Australia

Re: Crosscompling wiht distcc

Postby disfido » Tue Sep 25, 2012 12:41 pm

$this->bbcode_second_pass_quote('pezz', 'I') followed the guides and got it working fine (have compiled a kernel a couple of times).

Just to get things straight, as your terminology is confusing:

- The daemon machine is not the pi, it's your server box, right? The Pi just has "distcc" and DISTCC_HOSTS set in makepkg.conf

- You have the path set to the x-tools chain on the server box set correctly?

e.g. export PATH="/opt/x-tools6h/arm-unknown-linux-gnueabi/bin:$PATH" in /etc/rc.d/distccd on the server?

*Edit: I moved my x-tools to /opt and ran some finds to fix permissions.

- The x-tools stuff is executable by the user that distccd runs as (e.g. nobody)?


On the raspberry pi I set DISTCC_HOSTS in makepkg.conf.
On the x86_64 pc I symlinks the arm-linux-gnueabi binaries, installed from AUR, in a new folder (/usr/bin/cross/arm-linux-gnueabi) and export PATH=/usr/bin/cross/arm-linux-gnueabi:$PATH.

Now something works, all *.c sources was compiled but finally the linking process fails:

$this->bbcode_second_pass_code('', '
Linking C executable oscam
/usr/bin/ld: error: oscam uses VFP register arguments, CMakeFiles/oscam.dir/oscam.o does not
/usr/bin/ld: failed to merge target specific data of file CMakeFiles/oscam.dir/oscam.o
/usr/bin/ld: error: oscam uses VFP register arguments, libcsoscam.a(oscam-garbage.o) does not
/usr/bin/ld: failed to merge target specific data of file libcsoscam.a(oscam-garbage.o)
...
collect2: error: ld returned 1 exit status
distcc[7565] ERROR: compile (null) on localhost failed
make[2]: *** [oscam] Errore 1
make[1]: *** [CMakeFiles/oscam.dir/all] Errore 2
make: *** [all] Errore 2
==> ERROR: A failure occurred in build().
Aborting...
')

EDIT:
I have the same error using xtools instead the tools from AUR.
disfido
 
Posts: 11
Joined: Mon Jun 25, 2012 5:21 pm

Re: Crosscompling wiht distcc

Postby pezz » Tue Sep 25, 2012 12:57 pm

I'm just guessing here (not even sure what you're trying to compile)...

But are you running the newly released Arch ARM image (the hard float one), or one you've been running for a while and have kept updated?

The CFLAGS etc in makepkg.conf for the latest OS and x-tools uses hard float, different -march etc.

If you are using all the latest - make distclean and try again?
pezz
 
Posts: 75
Joined: Fri Sep 14, 2012 11:19 pm
Location: Geelong, Australia

Re: Crosscompling wiht distcc

Postby disfido » Tue Sep 25, 2012 1:15 pm

Yes I'm using the latest image archlinux-hf-2012-09-18.img with this flags in makepkg.conf:

$this->bbcode_second_pass_code('', '
CFLAGS="-march=armv6 -mfloat-abi=hard -mfpu=vfp -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
CXXFLAGS="-march=armv6 -mfloat-abi=hard -mfpu=vfp -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
')

I imagined that x-tools was for old images, for this reason I compiled the cross-tools from AUR, but I have also problems...

Maybe I must compile arm-linux-gnueabi-gcc with hard float support...but how?
disfido
 
Posts: 11
Joined: Mon Jun 25, 2012 5:21 pm

Re: Crosscompling wiht distcc

Postby pezz » Tue Sep 25, 2012 1:31 pm

Dunno mate, I'm using the latest pre-compiled x-tools and I can distcc fine.

Sorry. :/
pezz
 
Posts: 75
Joined: Fri Sep 14, 2012 11:19 pm
Location: Geelong, Australia

Re: Crosscompling wiht distcc

Postby disfido » Tue Sep 25, 2012 1:44 pm

but are you using the latest xtools with armv6 FLAGS?
disfido
 
Posts: 11
Joined: Mon Jun 25, 2012 5:21 pm

Re: Crosscompling wiht distcc

Postby pezz » Tue Sep 25, 2012 2:43 pm

Yep.
pezz
 
Posts: 75
Joined: Fri Sep 14, 2012 11:19 pm
Location: Geelong, Australia

Re: Crosscompling wiht distcc

Postby WarheadsSE » Tue Sep 25, 2012 3:44 pm

The armv6h x-tools that we have zipped on that page are what we used to make the v6h repo.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: Crosscompling wiht distcc

Postby disfido » Tue Sep 25, 2012 5:02 pm

I prefer to use PKGBUILDs (the arch-way :P)
so I solved recompiling the arm-linux-gnueabi-* packages from AUR with this flags:

$this->bbcode_second_pass_code('', '
--with-arch=armv6
--with-float=hard
--with-fpu=vfp
')

The problem is the distccd.service for systemd.
I set PATH=/mytoolchain/:$PATH
And next restart distccd: systemd restart distccd

but it starts with the original path:
$this->bbcode_second_pass_code('', '
distccd[20612] (dcc_setup_daemon_path) daemon's PATH is /usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/core_perl
')

If starts it manually all works fine...suggestions?
disfido
 
Posts: 11
Joined: Mon Jun 25, 2012 5:21 pm

Next

Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 14 guests