Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[HOWTO] distcc amd64 -> x86 with simple wrapper script
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
all-inc.
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2004
Posts: 138
Location: Darmstadt.Germany.EU

PostPosted: Sun Sep 24, 2006 7:19 pm    Post subject: [HOWTO] distcc amd64 -> x86 with simple wrapper script Reply with quote

Hi
Because of This Post I start this HowTo.

0. Introduction
Many people have bought an amd64 box and want it help their other x86 boxes compiling their stuff...
It's easier than most people think! Some guides advice to use crossdev. But that's not neccesairy! x86_64 gcc can compile fully x86-compatible 32-bit binaries with the -m32 option. That's it. But to make this thing working with distcc in a gentoo way, check this out.

1. Get the Stuff
Of course you need distcc at all boxes and the target's(I'll call the x86 machine target in this HowTo) gcc version installed on the host(s)(I'll call the amd64 helper(s) host(s))(Note: The target's gcc version hasn't to be the default on the hosts).
Get gcc-config and target's binutils version as well.

2. Let's wrap around
Now we install the x86 wrapper script on the host.

At first, you'll notice that gcc-config -B shows something like /usr/x86_64-pc-linux-gnu/gcc-bin/4.1.1
We create the pseudo gcc-bin dir with mkdir -p $(echo `gcc-config -B` | sed -e 's:x86_64:i686:').
Or, if your host's default gcc version isn't the one the target uses with mkdir -p $(echo `gcc-config -B x86_64-pc-linux-gnu-<target's gcc version>` | sed -e 's:x86_64:i686:').
Next, switch to this new dir: cd /usr/i686-pc-linux-gnu/gcc-bin/<t's version>
Here, create a file named i686-pseudo-wrapper.sh with the following content
Code:
#!/bin/bash
# wrapper script for the pseudo i686 compiler on amd64 machines
# by all-inc.

$(echo $(/usr/bin/which $0) | /usr/bin/sed -e 's:i686:x86_64:g') -m32 "$@"

At last, but not least, we have to create the symlinks for all compilers:
for c in {g++,gcc,c++,cpp}; do ln -s i686-pseudo-wrapper.sh ${c}; ln -s ${c} i686-pc-linux-gnu-${c}; done
(I think we can omit ln -s i686-pc-linux-gnu-gcc i686-pc-linux-gnu-gcc-<t's ver>)

3. Configure distccd(on the hosts!)
Go into /etc/conf.d and cp distccd distccd-x86
This is our special x86 compiler distccd configuration file. Change the red marked settings:
my /etc/conf.d/distccd-x86 without comments wrote:
DISTCCD_OPTS="-j4"
DISTCCD_EXEC="/usr/bin/distccd"
DISTCCD_PIDFILE="/var/run/distccd/distccd-x86-<optional gcc version>.pid"
DISTCCD_OPTS="${DISTCCD_OPTS} --port 3633" Change the default port only if you want your standard amd64 distccd listen at the default port 3632
DISTCCD_OPTS="${DISTCCD_OPTS} --log-level critical"
DISTCCD_OPTS="${DISTCCD_OPTS} --listen 192.168.0.24 --allow 192.168.0.0/24" This should fit your network ;)
DISTCCD_NICE="10"

Now, cd /etc/init.d and do ln -s distccd distccd-x86 or cp distccd distccd-x86 if you prefer to not edit distccd(Note: The way we edit distccd won't affect the default amd64 distccd). I use the symlink because of flexibility. If you have three distccds, e.g. distccd-x86-3.4.4, distccd-x86-4.1.1 and distccd-amd64-3.4.4, you only have to create the configs in conf.d and the symlinks.
Edit distccd (or distccd-x86 if you don't like the symlink method) and change the red stuff(or, if you did't use the symlink method, only make static changes...so don't use variables like $_a_suffix etc.):
Quote:
depend() {
need net
use ypbind
}

_a_suffix="$(echo ${SVCNAME} | cut -s -d "-" -f 2)" #extract arch from suffix
[[ -z ${_a_suffix} ]] && _a_suffix="amd64"
_g_suffix="$(echo ${SVCNAME} | cut -s -d "-" -f 3)" #extract gcc-version from suffix
[[ -z ${_g_suffix} ]] && _gcc_profile="" || _gcc_profile="x86_64-pc-linux-gnu-${_g_suffix}"


start() {
[ -e "${DISTCCD_PIDFILE}" ] && rm -f ${DISTCCD_PIDFILE} &>/dev/null

ebegin "Starting distccd/${_a_suffix}-${_g_suffix:-"default"}"
chown distcc `dirname ${DISTCCD_PIDFILE}` &>/dev/null
_binpath="$(gcc-config -B ${_gcc_profile})"
[[ ${_a_suffix} == "x86" ]] && \
_PATH=$(echo ${_binpath} | \
sed -e 's:x86_64:i686:g') || \
_PATH=${_binpath}

TMPDIR="${TMPDIR}" \
PATH="${_PATH}" \
/sbin/start-stop-daemon --start --quiet --startas ${DISTCCD_EXEC} \
--pidfile ${DISTCCD_PIDFILE} -- \
--pid-file ${DISTCCD_PIDFILE} -N ${DISTCCD_NICE} --user distcc \
${DISTCCD_OPTS}

eend $?
}

stop() {
ebegin "Stopping distccd/${_a_suffix}-${_g_suffix:-"default"}"
start-stop-daemon --stop --quiet --pidfile "${DISTCCD_PIDFILE}"
rm -f "${DISTCCD_PIDFILE}"
eend $?
}

Now, your x86 distccd is finish! start it with /etc/init.d/distccd-x86
(Note: If the host's default gcc version isn't the target's one, please use /etc/conf.d,init.d/distccd-x86-<t's gcc version> so the right bin paths are extracted.)

4. Configure distcc(on the target!)
simply add host-ip:3633/3 or something similar that fits your needs to /etc/distcc/hosts
(Note: You don't need to set the port if you use the default port for distccd-x86)
And of course set MAKEOPTS="-j4" or similar in your make.conf.
Now test it!

I use this method for quiet a while and I already ran emerge -uD world on a x86 successfully, so I think it works ;)

I hope you liked this HowTo. If, or if not, please give me your feedback here. If you find errors or typos, PM me PLEASE

With best regards, Sebastian Stammler
_________________
# make config; not war
registered linux user # 265707


Last edited by all-inc. on Mon Sep 25, 2006 7:46 pm; edited 2 times in total
Back to top
View user's profile Send private message
Bigun
Advocate
Advocate


Joined: 21 Sep 2003
Posts: 2196

PostPosted: Mon Sep 25, 2006 11:40 am    Post subject: Re: [HOWTO] distcc amd64 -> x86 with simple wrapper scrip Reply with quote

You may wanna change all the quotes to code.
_________________
"It's ok, they might have guns but we have flowers." - Perpetual Victim
Back to top
View user's profile Send private message
all-inc.
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2004
Posts: 138
Location: Darmstadt.Germany.EU

PostPosted: Mon Sep 25, 2006 10:50 pm    Post subject: Reply with quote

Well, this would be more 'correct', but then I can't colorize some points. And I think it's much easier to see the points one has to change than find them oneself. Or am I missing something :?:
_________________
# make config; not war
registered linux user # 265707


Last edited by all-inc. on Tue Oct 03, 2006 11:21 pm; edited 1 time in total
Back to top
View user's profile Send private message
Bigun
Advocate
Advocate


Joined: 21 Sep 2003
Posts: 2196

PostPosted: Mon Sep 25, 2006 10:53 pm    Post subject: Reply with quote

Nevermind, you fixed it... some of the code was coming out in emoticons.
_________________
"It's ok, they might have guns but we have flowers." - Perpetual Victim
Back to top
View user's profile Send private message
ofornaro
n00b
n00b


Joined: 07 Sep 2006
Posts: 21

PostPosted: Fri Sep 29, 2006 6:47 pm    Post subject: Reply with quote

Hi, Thank you for these scripts and notes.

I wish to use distcc, but in some cases stops with something similar to
Quote:

gcc -c -DHAVE_CONFIG_H -march=i686 -O2 -pipe -I. -I/var/tmp/portage/gcc-4.1.1/work/gcc-4.1.1/libiberty/../include -W -Wall -pedantic -Wwrite-strings -Wstrict-prototypes /var/tmp/portage/gcc-4.1.1/work/gcc-4.1.1/libiberty/regex.c -o regex.o
/var/tmp/portage/gcc-4.1.1/work/gcc-4.1.1/libiberty/regex.c:1: error: el CPU que seleccionó no tiene soporte para el conjunto de instrucciones x86-64
/var/tmp/portage/gcc-4.1.1/work/gcc-4.1.1/libiberty/regex.c:1: error: el CPU que seleccionó no tiene soporte para el conjunto de instrucciones x86-64
distcc[5308] ERROR: compile /var/tmp/portage/gcc-4.1.1/work/gcc-4.1.1/libiberty/regex.c on 192.168.10.190 failed
make[1]: *** [regex.o] Error 1
make[1]: Leaving directory `/var/tmp/portage/gcc-4.1.1/work/build/build-i686-pc-linux-gnu/libiberty'
make: *** [all-build-libiberty] Error 2

!!! ERROR: sys-devel/gcc-4.1.1 failed.
Call stack:
ebuild.sh, line 1546: Called dyn_compile
ebuild.sh, line 937: Called src_compile
ebuild.sh, line 1255: Called toolchain_src_compile
toolchain.eclass, line 24: Called gcc_src_compile
toolchain.eclass, line 1534: Called gcc_do_make
toolchain.eclass, line 1408: Called die

!!! emake failed with profiledbootstrap
!!! If you need support, post the topmost build error, and the call stack if relevant.


Please note that this error only appears in some applications and many others compiles well.
Ther exist any workaround?

Osvaldo
Back to top
View user's profile Send private message
all-inc.
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2004
Posts: 138
Location: Darmstadt.Germany.EU

PostPosted: Sun Oct 01, 2006 11:51 pm    Post subject: Reply with quote

you're welcome ;)

The errors you described are very easy to explain: Never use distcc with different compiler versions!
That means, never use distcc when you compile your new gcc. the reason is, that when you compile gcc, it compiles in 2 stages:
  1. the new gcc gets compiled with the old compiler(no prob with distcc..same versions)
  2. the new gcc gets again compiled with the previous compiled new gcc.(The versions have changed, distcc will break! and it should ;) ) why this? so the code for the new gcc is genereated from the new gcc ;) sounds weird, but if you think about it, you will understand that it's better. using gcc-4 compiled from a gcc-3 would be paradox. you want to use the optimized code from gcc-4, but the gcc itself is compiled from gcc-3...would be stupid.


there are some packages known to break when using distcc...most of them have "make -j1" in the src_compile() function in their ebuild so they won't use distcc(eg openoffice)... when some packages break with distcc, this has nothing to do with this method...it's just that it won't work with distcc on different archs at all(no matter if you use a real cross compiler or this wrapper script). if you experience distcc troubles with some packages, feel free to post at bugs.gentoo.org . of course, you should mention that your distcc helper boxes are amd64 and use gcc -m32.

i hope i could help you, sebastian
_________________
# make config; not war
registered linux user # 265707


Last edited by all-inc. on Tue Oct 03, 2006 11:35 pm; edited 3 times in total
Back to top
View user's profile Send private message
ofornaro
n00b
n00b


Joined: 07 Sep 2006
Posts: 21

PostPosted: Mon Oct 02, 2006 11:37 am    Post subject: Reply with quote

Thank You Sebastian, for an extensive explanation. I will to research a bit more. distcc is even a great tool.

Thanks again.

Osvaldo
Back to top
View user's profile Send private message
javlinz
n00b
n00b


Joined: 15 Nov 2003
Posts: 29

PostPosted: Tue Oct 03, 2006 5:47 pm    Post subject: Reply with quote

Hello. I'm having trouble getting the distccd init script to work, and was hoping someone could help me troubleshoot it. My host computer has both GCC 3.4.6 and 4.1.1, with 4.1.1 being the default. My target computer has GCC 3.4.6.

This is what I get when trying to start it with log level on debug.
Quote:

# /etc/init.d/distccd-x86-3.4.6 start
* Caching service dependencies ... [ ok ]
* Starting distccd/x86-3.4.6 ...
distccd[15967] (dcc_should_be_inetd) stdin is a tty; assuming --daemon mode
distccd[15967] (dcc_discard_root) discarded root privileges, changed to uid=240 gid=2 [ !! ]


Here's my /etc/conf.d/distccd-x86-3.4.6
Quote:

DISTCCD_OPTS="-j3"
DISTCCD_EXEC="/usr/bin/distccd"
DISTCCD_PIDFILE="/var/run/distccd/distccd-x86-3.4.6.pid"
DISTCCD_OPTS="${DISTCCD_OPTS} --port 3633"
DISTCCD_OPTS="${DISTCCD_OPTS} --log-level debug"
DISTCCD_OPTS="${DISTCCD_OPTS} --listen 192.168.1.99 --allow 192.168.1.0/24"
DISTCCD_NICE="10"


Here's my /etc/init.d/distccd-x86-3.4.6, which is a symlink to /etc/init.d/distccd
Quote:

#!/sbin/runscript
# $Header: /var/cvsroot/gentoo-x86/sys-devel/distcc/files/2.18/init,v 1.1 2004/10/12 17:21:43 lisa Exp $

depend() {
need net
use ypbind
}

_a_suffix="$(echo ${SVCNAME} | cut -s -d "-" -f 2)" #extract arch from suffix
[[ -z ${_a_suffix} ]] && _a_suffix="amd64"
_g_suffix="$(echo ${SVCNAME} | cut -s -d "-" -f 3)" #extract gcc-version from suffix
[[ -z ${_g_suffix} ]] && _gcc_profile="" || _gcc_profile="x86_64-pc-linux-gnu-${_g_suffix}"

start() {
[ -e "${DISTCCD_PIDFILE}" ] && rm -f ${DISTCCD_PIDFILE} &>/dev/null

ebegin "Starting distccd/${_a_suffix}-${_g_suffix:-"default"}"
chown distcc `dirname ${DISTCCD_PIDFILE}` &>/dev/null
_binpath="$(gcc-config -B ${_gcc_profile})"
[[ ${_a_suffix} == "x86" ]] && \
_PATH=$(echo ${_binpath} | \
sed -e 's:x86_64:i686:g') || \
_PATH=${_binpath}
TMPDIR="${TMPDIR}" \
PATH="${_PATH}" \
/sbin/start-stop-daemon --start --quiet --startas ${DISTCCD_EXEC} \
--pidfile ${DISTCCD_PIDFILE} -- \
--pid-file ${DISTCCD_PIDFILE} -N ${DISTCCD_NICE} --user distcc \
${DISTCCD_OPTS}

eend $?
}


Any help will be greatly appreciated.
Back to top
View user's profile Send private message
all-inc.
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2004
Posts: 138
Location: Darmstadt.Germany.EU

PostPosted: Tue Oct 03, 2006 9:24 pm    Post subject: Reply with quote

hi, if I start my distccd with log-level debug, I also get this warning messages! But nevertheless it works perfectly, so I think the problems you experience haven't anything to do with this messages...the start-stop-daemon invocation fails, so try to substitute --quiet by --verbose in the /etc/init.d/distccd file... hopefully this will give us some useful information. dmesg | tail -n 20 could be interesitng, too. If all this doesn't help, please try to start your distccd manually with all options the start-stop-daemon would start it:
Code:
# PATH="/usr/i686-pc-linux-gnu/gcc-bin/3.4.6" /usr/bin/distccd --pid-file /var/run/distccd/distccd-x86-3.4.6.pid -N 10 --user distcc -j3 --port 3633 --log-level debug --listen 192.168.1.99 --allow 192.168.1.0/24

you could also extract some debug infos from the init script by inserting the following lines just before the TMPDIR="${TMPDIR}" \ line:
Code:
echo "_PATH is ${_PATH}"
echo "DISTCCD_OPTS are ${DISTCCD_OPTS}"
and what else comes into your mind...

hope we'll find something

[EDIT] Please also add the output of your syslog that belongs to the distccd (/var/log/everything/current or /var/log/messages) or add --log-file /var/log/distccd-x86-3.4.6.log to the DISTCCD_OPTS (this option is recommend to use in the distccd manpage...see man distccd) and post its output. [/EDIT]
_________________
# make config; not war
registered linux user # 265707
Back to top
View user's profile Send private message
javlinz
n00b
n00b


Joined: 15 Nov 2003
Posts: 29

PostPosted: Tue Oct 03, 2006 11:00 pm    Post subject: Reply with quote

Thank you for the reply. With your help, I've been able to narrow down the problem. I was able to start the init script when I removed "--listen 192.168.1.99" from DISTCCD_OPTS.

This is the output from /var/log/everything/current when I add --listen to DISTCCD_OPTS
Quote:

Oct 3 15:07:25 [distccd] (dcc_setup_daemon_path) daemon's PATH is /usr/i686-pc-linux-gnu/gcc-bin/3.4.6
Oct 3 15:07:25 [distccd] (dcc_should_be_inetd) stdin is a tty; assuming --daemon mode
Oct 3 15:07:25 [distccd] (dcc_listen_by_addr) ERROR: bind of 192.168.1.99:3633 failed: Cannot assign requested address
Oct 3 15:07:25 [distccd] (dcc_exit) exit: code 102; self: 0.004000 user 0.000000 sys; children: 0.000000 user 0.000000 sys


This is the output from /var/log/everything/current when I remove --listen from DISTCCD_OPTS
Quote:

Oct 3 15:41:22 [distccd] (dcc_setup_daemon_path) daemon's PATH is /usr/i686-pc-linux-gnu/gcc-bin/3.4.6
Oct 3 15:41:22 [distccd] (dcc_should_be_inetd) stdin is a tty; assuming --daemon mode
Oct 3 15:41:22 [distccd] (dcc_listen_by_addr) listening on 0.0.0.0:3633
Oct 3 15:41:22 [distccd] (dcc_standalone_server) 1 CPU online on this server
Oct 3 15:41:22 [distccd] (dcc_standalone_server) allowing up to 3 active jobs
Oct 3 15:41:22 [distccd] (dcc_log_daemon_started) preforking daemon started (2.18.3 x86_64-pc-linux-gnu, built Oct 2 200$


Any idea of why I can't use --listen?
Back to top
View user's profile Send private message
all-inc.
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2004
Posts: 138
Location: Darmstadt.Germany.EU

PostPosted: Tue Oct 03, 2006 11:15 pm    Post subject: Reply with quote

ok, good that we found the problem ;) hmm, your IP seems to be requested from a DHCP, right? perhaps your IP isn't always 192.168.1.99, what shows ifconfig ? Is it really your ip?
_________________
# make config; not war
registered linux user # 265707
Back to top
View user's profile Send private message
javlinz
n00b
n00b


Joined: 15 Nov 2003
Posts: 29

PostPosted: Tue Oct 03, 2006 11:35 pm    Post subject: Reply with quote

Both my host's and target's IP addresses are static. My host's IP is 192.168.1.25, and target's IP is 192.168.1.99. Will distcc work if I don't set the --listen option?
Back to top
View user's profile Send private message
all-inc.
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2004
Posts: 138
Location: Darmstadt.Germany.EU

PostPosted: Tue Oct 03, 2006 11:42 pm    Post subject: Reply with quote

Ah, that's the point where you made an error! the --listen option specifies on which ip to listen on, that means, to which ip to bind! your distccd runs on the .25 machine, right? so you have to set --listen 192.168.1.25 because you bind to this address. this option doesn't mean listen for the given ip. --allow is for this. The one you called host is the machine with distccd running, I assume ^^
Of course distccd also works without --listen, it doesn't care, if it listens on all or only the given ip. It's just a security option. If this host is, eg., connected to the internet directly and you haven't set your firewall proper, some users could access the distccd service from the internet. OK, this doesn't happen every day, but who knows... ;)
_________________
# make config; not war
registered linux user # 265707
Back to top
View user's profile Send private message
javlinz
n00b
n00b


Joined: 15 Nov 2003
Posts: 29

PostPosted: Tue Oct 03, 2006 11:56 pm    Post subject: Reply with quote

You're right. I had the --listen option mixed up :oops: . I've corrected the problem, and it's working great now. Thank you for your help, and for this HOWTO. Great work!
Back to top
View user's profile Send private message
nickd
Tux's lil' helper
Tux's lil' helper


Joined: 29 Dec 2003
Posts: 81
Location: London, UK

PostPosted: Sat Nov 11, 2006 12:26 pm    Post subject: Reply with quote

I'm a bit worried that I'm being stupid here, but the init.d script is failing. I think it's because ${SVCNAME} is undefined.

Code:
/etc/init.d/distccd-x86 start
 * Caching service dependencies ...                                                                        [ ok ]
 * Starting distccd/x86-default ...
/etc/init.d/distccd-x86: line 21:  : command not found
/etc/init.d/distccd-x86: line 23:  : command not found


Code:
14 start() {
15         [ -e "${DISTCCD_PIDFILE}" ] && rm -f ${DISTCCD_PIDFILE} &>/dev/null
16
17         #ebegin "Starting distccd"
18         ebegin "Starting distccd/${_a_suffix}-${_g_suffix:-"default"}"
19         chown distcc `dirname ${DISTCCD_PIDFILE}` &>/dev/null
20         _binpath="$(gcc-config -B ${_gcc_profile})"
21         [[ ${_a_suffix} == "x86" ]] && \
22         _PATH=$(echo ${_binpath} | \
23         sed -e 's:x86_64:i686:g') || \
24         _PATH=${_binpath}
25         TMPDIR="${TMPDIR}" \
26         #PATH="$(gcc-config --get-bin-path):${PATH}" \
27         PATH="${_PATH}" \


Any clues please.

TIA.

Nick
Back to top
View user's profile Send private message
all-inc.
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2004
Posts: 138
Location: Darmstadt.Germany.EU

PostPosted: Sun Nov 12, 2006 6:27 pm    Post subject: Reply with quote

hi,
SVCNAME is provided by /sbin/runscript. (have a look at /sbin/runscript.sh)
in the lines 21 and 23 at your quotes i read:
Quote:
21 [[ ${_a_suffix} == "x86" ]] && \
23 sed -e 's:x86_64:i686:g') || \

this commands can't show "/etc/init.d/distccd-x86: line 21: : command not found" ... this doesn't make sense ;)
please show the correct lines that cause the error messages.[/glsa]
_________________
# make config; not war
registered linux user # 265707
Back to top
View user's profile Send private message
nickd
Tux's lil' helper
Tux's lil' helper


Joined: 29 Dec 2003
Posts: 81
Location: London, UK

PostPosted: Sun Nov 12, 2006 8:15 pm    Post subject: Reply with quote

Thanks for the response.

Here's the whole file:
Code:
 1 #!/sbin/runscript
 2 # $Header: /var/cvsroot/gentoo-x86/sys-devel/distcc/files/2.18/init,v 1.1 200   4/10/12 17:21:43 lisa Exp $
 3
 4 depend() {
 5         need net
 6         use ypbind
 7 }
 8
 9 _a_suffix="$(echo ${SVCNAME} | cut -s -d "-" -f 2)" #extract arch from suffix   
10 [[ -z ${_a_suffix} ]] && _a_suffix="amd64"
11 _g_suffix="$(echo ${SVCNAME} | cut -s -d "-" -f 3)" #extract gcc-version from    suffix
12 [[ -z ${_g_suffix} ]] && _gcc_profile="" || _gcc_profile="x86_64-pc-linux-gnu   -${_g_suffix}"
13
14 start() {
15         [ -e "${DISTCCD_PIDFILE}" ] && rm -f ${DISTCCD_PIDFILE} &>/dev/null
16         
17         #ebegin "Starting distccd"
18         ebegin "Starting distccd/${_a_suffix}-${_g_suffix:-"default"}"
19         chown distcc `dirname ${DISTCCD_PIDFILE}` &>/dev/null
20         _binpath="$(gcc-config -B ${_gcc_profile})"
21         [[ ${_a_suffix} == "x86" ]] && \
22         _PATH=$(echo ${_binpath} | \
23         sed -e 's:x86_64:i686:g') || \
24         _PATH=${_binpath}
25         TMPDIR="${TMPDIR}" \
26         #PATH="$(gcc-config --get-bin-path):${PATH}" \
27         PATH="${_PATH}" \
28         /sbin/start-stop-daemon --start --quiet --startas ${DISTCCD_EXEC} \
29         --pidfile ${DISTCCD_PIDFILE} -- \
30         --pid-file ${DISTCCD_PIDFILE} -N ${DISTCCD_NICE} --user distcc \
31         ${DISTCCD_OPTS}
32
33         eend $?
34 }
35
36 stop() {
37         #ebegin "Stopping distccd"
38         ebegin "Stopping distccd/${_a_suffix}-${_g_suffix:-"default"}"
39         start-stop-daemon --stop --quiet --pidfile "${DISTCCD_PIDFILE}"
40         rm -f "${DISTCCD_PIDFILE}"
41         eend $?
42 }


Does that make any sense?

Ack the sunscript.sh - so why is mine not returning a SVCNAME value? I see it there, and being exported.

N.
Back to top
View user's profile Send private message
Fi
n00b
n00b


Joined: 27 Jul 2002
Posts: 33

PostPosted: Wed Nov 15, 2006 3:56 pm    Post subject: Reply with quote

got all running,
(except distcc bugs on distcc-config --install, not creating the simlinks in /usr/lib/distcc/lib, which i did manualy)
but updating world stopped on initng-0.6.7
it uses cmake, if it may have anything to do with that, i get :

error: CPU you selected does not support x86-64 instruction set

i've tried redefining " CC=i686-pc-linux-gnu-gcc emerge initng -u "
in case it was not pasing the correct cc version. thought i understand from this distcc-x86 script that it doesnt actually needs it (or does it?).
but it didnt work anyways.

Any ideas? Thanks
Back to top
View user's profile Send private message
all-inc.
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2004
Posts: 138
Location: Darmstadt.Germany.EU

PostPosted: Wed Nov 15, 2006 7:55 pm    Post subject: Reply with quote

As I mentioned before, there are just some programs that stop compiling with errors, e.g. yours CPU you selected does not support x86-64 instruction set. Especially programs that act on a low level, like initng does. In that case just compile the package without distcc. if you experience such errors, please mail them at bugs.gentoo.org so they can change the ebuild to not use distccd in the future. but include some informations like the host and target machine archs and that you use this method here...
--edit-- ah, and you don't need CC=i686-pc-linux-gnu-gcc or similar --edit--

@nickd
why exactly do you think that SVCNAME isn't available?! please add some debug messages to your /etc/init.d/distccd-x86 file. for example, add
Code:
echo "svcname: ${SVCNAME}"
echo "_gcc_profile: ${_gcc_profile}; _a_suffix: ${_a_suffix}"
and some other things that could be interesting... or add at line 14/15 echo "I call start()" and such stuff at other points...

cya all-inc.
_________________
# make config; not war
registered linux user # 265707
Back to top
View user's profile Send private message
Fi
n00b
n00b


Joined: 27 Jul 2002
Posts: 33

PostPosted: Wed Nov 15, 2006 9:59 pm    Post subject: Reply with quote

so i investigated somewhat
and there is something not going well

if i use the wrapper script on my target computer
so that /usr/lib/distcc/bin/gxx is mapped to /usr/lib/disticc/bin/i686-pc-linux-gnu-gxx
as the crossdev howto explains

then initng compiles with distcc

so i changed things around in the script changing
Code:
exec /usr/lib/distcc/bin/i686-pc-linux-gnu-g${0:$[-2]} "$@"


to
Code:
exec /usr/bin/distcc -m32  "$@"


and it works fine, it yields the same "CPU you selected does not support x86-64 instruction set" error if "-m32" is ommited

so i changed the line again to

Code:
exec /usr/lib/distcc/bin/x86_64-pc-linux-gnu-g${0:$[-2]} -m32 "$@"


and created the corresponding links of x86_64....-gxx to point to /usr/bin/distcc
but i'm getting problems here for some reason despite i removed localhost from /etc/distcc/hosts
it still does some compilation on localhost
so i made a symlink from x86_64--- to /usr/bin/gxx on the target
with no succes for the moment (but trying this might be a stupid idea)

anyhow, there is something going wrong somewhere

i'd love to put logs of distcc but i can't find the log anywhere
i wonder if distcc is actually using my configure options from /etc/conf.d/distcc....


Last edited by Fi on Wed Nov 15, 2006 10:21 pm; edited 1 time in total
Back to top
View user's profile Send private message
Fi
n00b
n00b


Joined: 27 Jul 2002
Posts: 33

PostPosted: Wed Nov 15, 2006 10:20 pm    Post subject: Reply with quote

I was wondering if the problem is not comming from the host configuration

somehow the gxx command is not trapped by the wrapper script on the host
probably because of a path problem

using a wrapper script on the target solves the problem in my case

what do you think?
Back to top
View user's profile Send private message
Fi
n00b
n00b


Joined: 27 Jul 2002
Posts: 33

PostPosted: Thu Nov 16, 2006 10:15 am    Post subject: Reply with quote

so my little P3 has been updating things

and it blocked on opensp, but rather curiously it blocked at link time ??

i thought it should not have problems with linking

Code:
undefined reference to `__cxa_get_exception_ptr'


and ld exits with error status 1

i suppose i'll need to fill in a bug,
thought i wonder if the problem is in distcc or the crosscompiling, i've searched google for __cxa---
and havnt found anything explicit
any ideas?
Back to top
View user's profile Send private message
all-inc.
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2004
Posts: 138
Location: Darmstadt.Germany.EU

PostPosted: Sun Nov 19, 2006 3:26 pm    Post subject: Reply with quote

hi,
does this problem occur if you compile without distcc? please try for every problem if it occurs without distcc...
if you use ccache and updated your gcc, then clean your ccache database!
and pleeaassee add debug information/echo'ing to your script(s)!

thank you, all-inc.
_________________
# make config; not war
registered linux user # 265707
Back to top
View user's profile Send private message
Fi
n00b
n00b


Joined: 27 Jul 2002
Posts: 33

PostPosted: Mon Nov 20, 2006 12:02 pm    Post subject: Reply with quote

sorry, i've of course tried without distcc and everything works fine,
i dont use ccache

i have the log level of distcc set to critical but havnt found any log (/var/log/critical??).
about debuging messages. i'm not sure what you would need

for the moment i've finished updating my system without distcc as i had too many problems

if nobody else is having problems, it migth be my install, perhaps some conflict between crossdev which i had installed before and your scripts.
perhaps also network problems, when using distcc with my wireless network, (my amd64 box is used as master) the atheros drivers fails and i have to reinitialisze the network device, i never had this problem in any other situations !!!?!
so i switch to ieee1394 network link. but i still have problems with distcc.

i'll try to find some time to modify my scripts and retry compiling, and post more information

regards,
Back to top
View user's profile Send private message
Fi
n00b
n00b


Joined: 27 Jul 2002
Posts: 33

PostPosted: Mon Nov 20, 2006 12:06 pm    Post subject: Reply with quote

ok, /me stupid, i miss interpreted --log-level critical thing and thougth it meant log everything as critical
and not only log critical events
changed it to debug and will post information later
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum