Crosscompling wiht distcc

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

Re: Crosscompling wiht distcc

Postby WarheadsSE » Tue Sep 25, 2012 6:17 pm

Use the /etc/conf.d/distcc to do this.
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 pezz » Wed Sep 26, 2012 6:15 am

$this->bbcode_second_pass_quote('WarheadsSE', 'U')se the /etc/conf.d/distcc to do this.


You can't export PATH in that file as /etc/rc.d/functions (which resets PATH) is sourced after the conf.d file in the init script.

You have to hack it in to /etc/rc.d/distccd
pezz
 
Posts: 76
Joined: Fri Sep 14, 2012 11:19 pm
Location: Geelong, Australia

Re: Crosscompling wiht distcc

Postby pezz » Wed Sep 26, 2012 6:17 am

Sorry, just realised you and disfido were talking about systemd, which uses the conf.d file.
pezz
 
Posts: 76
Joined: Fri Sep 14, 2012 11:19 pm
Location: Geelong, Australia

Re: Crosscompling wiht distcc

Postby disfido » Wed Sep 26, 2012 11:25 am

$this->bbcode_second_pass_quote('WarheadsSE', 'U')se the /etc/conf.d/distcc to do this.


I added PATH=/mytoolchain/ to /etc/conf.d/distccd and it works perfectly
Thanks you
disfido
 
Posts: 11
Joined: Mon Jun 25, 2012 5:21 pm

Re: Crosscompling wiht distcc

Postby WarheadsSE » Fri Sep 28, 2012 5:09 pm

I touched up my distccd configure on my Systemd running VM.
$this->bbcode_second_pass_code('', '
# cp /etc/conf.d/distccd /etc/conf.d/distccd5

# ln -s /usr/bin/distccd /usr/bin/distccd5

# cp /usr/lib/systemd/system/distccd.service /usr/lib/systemd/system/distccd5.service

# cat /etc/conf.d/distccd5
PATH=/usr/local/x-tools/arm-unknown-linux-gnueabi/bin:$PATH
DISTCC_ARGS="--user nobody --allow 192.168.11.0/24 --port 3632"

# cat /usr/lib/systemd/system/distccd5.service
[Unit]
Description=A distributed C/C++ compiler armv5
Documentation=man:distccd(1)

[Service]
EnvironmentFile=/etc/conf.d/distccd5
ExecStart=/usr/bin/distccd5 --daemon --no-detach $DISTCC_ARGS

[Install]
WantedBy=multi-user.target

# systemctl enable distccd5.service
')
I changed a few things in the service & created a link so that I know which one is 5/6/7 since my VM does all of them.

The PATH in conf.d/distccd is the key, but since I have multiples, I split them this way instead of altering the originals.
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 Philoo » Wed Oct 03, 2012 7:18 pm

a couple of basics:

1/ if cross compiling make sure that either the folder where your cross compiler sits is first in $PATH (I think I saw that in the wrong order) and/or explicitely masquerade the compilers , as per the man page:

$this->bbcode_second_pass_quote('', 'M')ASQUERADING
The basic idea is to create a "masquerade directory" which contains links from the name of the real compiler to the distcc binary. This directory is inserted early on the PATH, so that calls to the compiler are intercepted and distcc is run instead. distcc then removes itself from the PATH to find the real compiler.

For example:

# mkdir /usr/lib/distcc/bin
# cd /usr/lib/distcc/bin
# ln -s ../../../bin/distcc gcc
# ln -s ../../../bin/distcc cc
# ln -s ../../../bin/distcc g++
# ln -s ../../../bin/distcc c++


this is to be done the server(s)

2/ distccd processes are actually running on the server (ps awx | grep distccd)

3/ as a regular user (stricto sensu you also can as root but it's not adviseable) you can run distccd in non-daemon, verbose/debug-output-on-the console mode

4/ make sure your port is open $this->bbcode_second_pass_code('', 'nmap -p 3632 distcc.server.ip') and you are looking a the right host (it took me a couple hours to figure that I was sending jobs to my VM host instead of the guest the first time)
Philoo
 
Posts: 102
Joined: Wed Aug 10, 2011 9:20 pm
Top

Previous

Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 35 guests