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 Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Fi
n00b
n00b


Joined: 27 Jul 2002
Posts: 33

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

fist, as i have done a depclean of my system, crossdev is gone, so it shouldnt be that
i've restroed my /usr/i686-pc-linux-gnu/gcc-bin/3.4.6/ directory
i've removed my wrapper on the target in /usr/lib/distcc/bin i had added to ensure -m32 argument was used

in debug of distcc on the host i get seg faults all the time :

for example

Code:

distccd[11819] (dcc_check_client) connection from 192.168.0.94:4711
distccd[11819] (dcc_check_address) match client 0x5e00a8c0, value 0xa8c0, mask 0xffff
distccd[11819] (dcc_r_token_int) got DIST00000001
distccd[11819] (dcc_r_token_int) got ARGC00000008
distccd[11819] (dcc_r_argv) reading 8 arguments from job submission
distccd[11819] (dcc_r_token_int) got ARGV00000015
distccd[11819] (dcc_r_argv) argv[0] = "i686-pc-linux-gnu-g++"
distccd[11819] (dcc_r_token_int) got ARGV0000000f
distccd[11819] (dcc_r_argv) argv[1] = "-march=pentium3"
distccd[11819] (dcc_r_token_int) got ARGV00000003
distccd[11819] (dcc_r_argv) argv[2] = "-O3"
distccd[11819] (dcc_r_token_int) got ARGV00000005
distccd[11819] (dcc_r_argv) argv[3] = "-pipe"
distccd[11819] (dcc_r_token_int) got ARGV00000002
distccd[11819] (dcc_r_argv) argv[4] = "-c"
distccd[11819] (dcc_r_token_int) got ARGV0000000d
distccd[11819] (dcc_r_argv) argv[5] = "ParserApp.cxx"
distccd[11819] (dcc_r_token_int) got ARGV00000002
distccd[11819] (dcc_r_argv) argv[6] = "-o"
distccd[11819] (dcc_r_token_int) got ARGV0000000b
distccd[11819] (dcc_r_argv) argv[7] = "ParserApp.o"
distccd[11819] (dcc_r_argv) got arguments: i686-pc-linux-gnu-g++ -march=pentium3 -O3 -pipe -c ParserApp.cxx -o ParserApp.o
distccd[11819] (dcc_scan_args) scanning arguments: i686-pc-linux-gnu-g++ -march=pentium3 -O3 -pipe -c ParserApp.cxx -o ParserApp.o
distccd[11819] (dcc_scan_args) found input file "ParserApp.cxx"
distccd[11819] (dcc_scan_args) found object/output file "ParserApp.o"
distccd[11819] compile from ParserApp.cxx to ParserApp.o
distccd[11819] (dcc_run_job) output file ParserApp.o
distccd[11819] (dcc_input_tmpnam) input file ParserApp.cxx
distccd[11819] (dcc_r_token_int) got DOTI00054f81
distccd[11819] (dcc_r_file) received 348033 bytes to file /tmp/distccd_eff4a1ee.ii
distccd[11819] (dcc_r_file_timed) 348033 bytes received in 0.140971s, rate 2411kB/s
distccd[11819] (dcc_set_input) changed input from "ParserApp.cxx" to "/tmp/distccd_eff4a1ee.ii"
distccd[11819] (dcc_set_input) command after: i686-pc-linux-gnu-g++ -march=pentium3 -O3 -pipe -c /tmp/distccd_eff4a1ee.ii -o ParserApp.o
distccd[11819] (dcc_set_output) changed output from "ParserApp.o" to "/tmp/distccd_efaca1ee.o"
distccd[11819] (dcc_set_output) command after: i686-pc-linux-gnu-g++ -march=pentium3 -O3 -pipe -c /tmp/distccd_eff4a1ee.ii -o /tmp/distccd_efaca1ee.o
distccd[11819] (dcc_spawn_child) forking to execute: i686-pc-linux-gnu-g++ -march=pentium3 -O3 -pipe -c /tmp/distccd_eff4a1ee.ii -o /tmp/distccd_efaca1ee.o
distccd[12002] (dcc_increment_safeguard) setting safeguard: _DISTCC_SAFEGUARD=1
distccd[11819] (dcc_spawn_child) child started as pid12002
distccd[11819] (dcc_collect_child) cc child 12002 terminated with status 0xb
distccd[11819] (dcc_collect_child) cc times: user 0.000000s, system 0.000000s, 82 minflt, 0 majflt
distccd[11819] (dcc_x_token_int) send DONE00000001
distccd[11819] (dcc_x_token_int) send STAT0000000b
distccd[11819] (dcc_x_file) send 99 byte file /tmp/distcc_e848a1ee.stderr with token SERR
distccd[11819] (dcc_x_token_int) send SERR00000063
distccd[11819] (dcc_x_file) send 0 byte file /tmp/distcc_e81ba1ee.stdout with token SOUT
distccd[11819] (dcc_x_token_int) send SOUT00000000
distccd[11819] (dcc_x_token_int) send DOTO00000000
distccd[11819] i686-pc-linux-gnu-g++ ParserApp.cxx on localhost:Segmentation fault
distccd[11819] job complete
distccd[11819] (dcc_cleanup_tempfiles) deleted 4 temporary files



which should explain why compilation is sooo slow as it spends time using the network sending compilations that end up in seg fault

was wondering, would it be the -03 flag?
i'll try without

as for the echos in distcc-x86: it outputs

Code:

svcname: distccd-x86
_gcc_profile: ; _a_suffix: x86


i suppose it's ok,

opensp did not end up with a compilation error this time
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: Thu Nov 23, 2006 7:52 pm    Post subject: Reply with quote

hmm, segfault shouldn't have something to do with the wrapper or the -O3 flags...this are "deeper" errors in the system ;)
just try out to compile a simple program like:
Code:
#include <iostream>
#include <string>

using namespace std;

int main() {
        string* s = new string("abcdefg");
        int c = 0;
        int idx = s->find('a');
        cout << s->substr((idx+=3), 3) << s->substr(idx, 3) << endl;
        delete s;
}
by saving it in save.cc and then run /usr/lib/distcc/bin/i686-pc-linux-gnu-g++ save.cc. then, do file test to ensure that it's a 32 and not a 64 bit executable. if it segfaults, then just run a simple g++ save.cc so your regular 64-bit compiler runs. i hope we'll find out something...[/b]
_________________
# 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: Fri Dec 01, 2006 9:45 am    Post subject: Reply with quote

Sorry, long time no loggin

indeed, i do suppose the segfault have to do with the system...somehow

thank very much for your suggestion, and involvement in trying to figure out what is going wrong with my setup. it is appreciated.

I tried to compiled as you said (from the target, my PIII i presumed ?)
it seems it compiles it on my localhost and hence outputs a 32bit exec

not understanding why, i re-emerged distcc on localhost...

i get this error during install,
Code:

 * Installing links to native compilers...
Creating /etc/env.d/02distcc...
Traceback (most recent call last):
  File "/usr/bin/distcc-config", line 140, in ?
    chost = re.compile('CHOST="(.*)"').search(makeconf).group(1)
AttributeError: 'NoneType' object has no attribute 'group'
 * Setting permissions on /var/run/distccd


i had corrected this by hand by creating the links in /usr/lib/distcc/bin
but maybe i am doing something wrong here
or maybe if this install failed, something else is going wrong and didn't appear
note that the emerge of distcc does'nt echo any error after merge...

so i suppose all my problems come from my target system
and i certainly should try to figure out what is going wrong with this emerge
(my system is up to date using ~x86, have done a revdep-rebuild )

something is going wrong with python, and i suppose i have to fil in a bug for distcc ebuild or something..

thought if you had any idea what could be causing this install bug, it'll help me much, as i have no clue at the moment

sincerely

Philippe Leroux
Back to top
View user's profile Send private message
Kwirl
n00b
n00b


Joined: 18 Jul 2005
Posts: 48
Location: Bonn, Germany

PostPosted: Mon Dec 04, 2006 2:42 pm    Post subject: Reply with quote

Hi,

i found this nice howto and it fits perfectly to my needs. But it is not working for my setup. The i686-Host sends its files to the amd64-machine and it tries to compile. But it ends up with a segfault. Here is the debug-aoutput from distccd:

Code:


Dec  4 15:24:10 ads2 distccd[4512]: (dcc_check_client) connection from 192.168.0.1:56128
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_check_address) match client 0x11b6886, value 0x106886, mask 0xf0ffff
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_token_int) got DIST00000001
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_token_int) got ARGC0000001a
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_argv) reading 26 arguments from job submission
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_token_int) got ARGV00000015
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_argv) argv[0] = "i686-pc-linux-gnu-g++"
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_token_int) got ARGV0000000e
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_argv) argv[1] = "-Wno-long-long"
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_token_int) got ARGV00000007
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_argv) argv[2] = "-Wundef"
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_token_int) got ARGV00000005
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_argv) argv[3] = "-ansi"
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_token_int) got ARGV0000000c
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_argv) argv[4] = "-Wcast-align"
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_token_int) got ARGV0000000c
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_argv) argv[5] = "-Wconversion"
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_token_int) got ARGV00000011
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_argv) argv[6] = "-Wchar-subscripts"
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_token_int) got ARGV00000005
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_argv) argv[7] = "-Wall"
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_token_int) got ARGV00000002
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_argv) argv[8] = "-W"
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_token_int) got ARGV0000000f
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_argv) argv[9] = "-Wpointer-arith"
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_token_int) got ARGV00000003
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_argv) argv[10] = "-O2"
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_token_int) got ARGV00000003
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_argv) argv[11] = "-O2"
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_token_int) got ARGV0000000f
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_argv) argv[12] = "-march=pentium4"
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_token_int) got ARGV00000014
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_argv) argv[13] = "-fomit-frame-pointer"
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_token_int) got ARGV00000005
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_argv) argv[14] = "-pipe"
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_token_int) got ARGV00000011
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_argv) argv[15] = "-Wformat-security"
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_token_int) got ARGV0000001a
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_argv) argv[16] = "-Wmissing-format-attribute"
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_token_int) got ARGV00000015
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_argv) argv[17] = "-Wno-non-virtual-dtor"
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_token_int) got ARGV0000000f
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_argv) argv[18] = "-fno-exceptions"
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_token_int) got ARGV0000000e
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_argv) argv[19] = "-fno-check-new"
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_token_int) got ARGV0000000b
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_argv) argv[20] = "-fno-common"
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_token_int) got ARGV00000002
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_argv) argv[21] = "-c"
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_token_int) got ARGV0000000a
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_argv) argv[22] = "imdata.cpp"
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_token_int) got ARGV00000005
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_argv) argv[23] = "-fPIC"
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_token_int) got ARGV00000002
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_argv) argv[24] = "-o"
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_token_int) got ARGV0000000e
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_argv) argv[25] = ".libs/imdata.o"
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_argv) got arguments: i686-pc-linux-gnu-g++ -Wno-long-long -Wundef -ansi -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -O2 -O2 -march=pentium4 -fomit-frame-pointer -pipe -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common -c imdata.cpp -fPIC -o .libs/imdata.o
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_scan_args) scanning arguments: i686-pc-linux-gnu-g++ -Wno-long-long -Wundef -ansi -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -O2 -O2 -march=pentium4 -fomit-frame-pointer -pipe -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common -c imdata.cpp -fPIC -o .libs/imdata.o
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_scan_args) found input file "imdata.cpp"
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_scan_args) found object/output file ".libs/imdata.o"
Dec  4 15:24:10 ads2 distccd[4512]: compile from imdata.cpp to imdata.o
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_run_job) output file .libs/imdata.o
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_input_tmpnam) input file imdata.cpp
Dec  4 15:24:10 ads2 distccd[4512]: (dcc_r_token_int) got DOTI00045614
Dec  4 15:24:11 ads2 distccd[4512]: (dcc_r_file) received 284180 bytes to file /tmp/distccd_1a882f8a.ii
Dec  4 15:24:11 ads2 distccd[4512]: (dcc_r_file_timed) 284180 bytes received in 0.264960s, rate 1047kB/s
Dec  4 15:24:11 ads2 distccd[4512]: (dcc_set_input) changed input from "imdata.cpp" to "/tmp/distccd_1a882f8a.ii"
Dec  4 15:24:11 ads2 distccd[4512]: (dcc_set_input) command after: i686-pc-linux-gnu-g++ -Wno-long-long -Wundef -ansi -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -O2 -O2 -march=pentium4 -fomit-frame-pointer -pipe -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common -c /tmp/distccd_1a882f8a.ii -fPIC -o .libs/imdata.o
Dec  4 15:24:11 ads2 distccd[4512]: (dcc_set_output) changed output from ".libs/imdata.o" to "/tmp/distccd_1aaa2f8a.o"
Dec  4 15:24:11 ads2 distccd[4512]: (dcc_set_output) command after: i686-pc-linux-gnu-g++ -Wno-long-long -Wundef -ansi -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -O2 -O2 -march=pentium4 -fomit-frame-pointer -pipe -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common -c /tmp/distccd_1a882f8a.ii -fPIC -o /tmp/distccd_1aaa2f8a.o
Dec  4 15:24:11 ads2 distccd[4512]: (dcc_spawn_child) forking to execute: i686-pc-linux-gnu-g++ -Wno-long-long -Wundef -ansi -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -O2 -O2 -march=pentium4 -fomit-frame-pointer -pipe -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common -c /tmp/distccd_1a882f8a.ii -fPIC -o /tmp/distccd_1aaa2f8a.o
Dec  4 15:24:11 ads2 distccd[4524]: (dcc_increment_safeguard) setting safeguard: _DISTCC_SAFEGUARD=1
Dec  4 15:24:11 ads2 distccd[4524]: segfault at 0000000000000005 rip 00002b4fb66cf35a rsp 00007ffff45344e0 error 4
Dec  4 15:24:11 ads2 distccd[4512]: (dcc_spawn_child) child started as pid4524
Dec  4 15:24:11 ads2 distccd[4512]: (dcc_collect_child) cc child 4524 terminated with status 0xb
Dec  4 15:24:11 ads2 distccd[4512]: (dcc_collect_child) cc times: user 0.000000s, system 0.000000s, 104 minflt, 0 majflt
Dec  4 15:24:11 ads2 distccd[4512]: (dcc_x_token_int) send DONE00000001
Dec  4 15:24:11 ads2 distccd[4512]: (dcc_x_token_int) send STAT0000000b
Dec  4 15:24:11 ads2 distccd[4512]: (dcc_x_file) send 98 byte file /tmp/distcc_111a2f8a.stderr with token SERR
Dec  4 15:24:11 ads2 distccd[4512]: (dcc_x_token_int) send SERR00000062
Dec  4 15:24:11 ads2 distccd[4512]: (dcc_x_file) send 0 byte file /tmp/distcc_12e42f8a.stdout with token SOUT
Dec  4 15:24:11 ads2 distccd[4512]: (dcc_x_token_int) send SOUT00000000
Dec  4 15:24:11 ads2 distccd[4512]: (dcc_x_token_int) send DOTO00000000
Dec  4 15:24:11 ads2 distccd[4512]: i686-pc-linux-gnu-g++ imdata.cpp on localhost:Segmentation fault
Dec  4 15:24:11 ads2 distccd[4512]: job complete
Dec  4 15:24:11 ads2 distccd[4512]: (dcc_cleanup_tempfiles) deleted 4 temporary files



Here is the output from "/etc/init.d/distccd-x86 start":
Code:

/etc/init.d/distccd-x86 start
 * Starting distccd/x86-default ...
distccd[5123] (dcc_should_be_inetd) stdin is a tty; assuming --daemon mode
distccd[5123] (dcc_discard_root) discarded root privileges, changed to uid=240 gid=2


Is this ok?
Back to top
View user's profile Send private message
Kwirl
n00b
n00b


Joined: 18 Jul 2005
Posts: 48
Location: Bonn, Germany

PostPosted: Wed Dec 20, 2006 2:49 pm    Post subject: Reply with quote

all-inc. wrote:
by saving it in save.cc and then run /usr/lib/distcc/bin/i686-pc-linux-gnu-g++ save.cc. then, do file test to ensure that it's a 32 and not a 64 bit executable. if it segfaults, then just run a simple g++ save.cc so your regular 64-bit compiler runs. i hope we'll find out something...[/b]


I don't even have this programm /usr/lib/distcc/bin/i686-pc-linux-gnu-g++ on my 64bit-machine. There is just x86_64.... Is that correct?
Back to top
View user's profile Send private message
tipp98
Tux's lil' helper
Tux's lil' helper


Joined: 28 Jan 2007
Posts: 113

PostPosted: Sat Mar 29, 2008 5:00 am    Post subject: Reply with quote

Awesome scripts. I only had one slight issue
Code:
/usr/i686-pc-linux-gnu/gcc-bin/4.1.2/gcc: line 5: /usr/bin/sed: No such file or directory
/usr/i686-pc-linux-gnu/gcc-bin/4.1.2/gcc: line 5: -m32: command not found
distcc[24353] ERROR: compile scripts/mod/empty.c on Falcon failed with exit code 127

after emerging sed, which didn't fix the problem, and trying to unmerge it with a "may damage your system" warning I realized it was already installed and simply changed /usr/bin/sed to /bin/sed.
Now my "make CC="distcc gcc" -j4" actively uses both systems. Although I didn't let the make finish to see if it works.

A question however, is it possible to compile 64bit code on the 32bit machine in this manner, without using crossdev? I tried transposing the amd64's with the x86's and the x86_64's with the i686's in your script but when I try the kernel make I get
Code:
arch/x86/kernel/process_64.c:1: error: code model 'kernel' not supported in the 32 bit mode
arch/x86/kernel/process_64.c:1: sorry, unimplemented: 64-bit mode not compiled in
distcc[19555] ERROR: compile arch/x86/kernel/process_64.c on Woody failed
make[1]: *** [arch/x86/kernel/process_64.o] Error 1
make: *** [arch/x86/kernel] Error 2
make: *** Waiting for unfinished jobs....

I see there is a multilib flag for gcc but it only referrs to "64bit systems".
Quote:
multilib
Global: On 64bit systems, if you want to be able to compile 32bit and 64bit binaries


Thats odd, multilib is not set on my 64bit system. Is this going to cause problems and if not what the heck is it for?
Back to top
View user's profile Send private message
rada
Apprentice
Apprentice


Joined: 21 Oct 2005
Posts: 202
Location: Ottawa, Canada

PostPosted: Mon May 19, 2008 4:45 pm    Post subject: Re: [HOWTO] distcc amd64 -> x86 with simple wrapper scrip Reply with quote

Couple small fixes.

1. Wrapper script: /usr/bin/sed does not exist, its /bin/sed
2. Link i686-pc-linux-gnu-gcc -> i686-pseudo-wrapper.sh instead of i686-pc-linux-gnu-gcc -> gcc -> i686-pseudo-wrapper.sh
3. Add small reminder to do chmod +x on the script

all-inc. wrote:

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) | /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 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>)
Remember to chmod +x i686-pseudo-wrapper.sh
Back to top
View user's profile Send private message
rada
Apprentice
Apprentice


Joined: 21 Oct 2005
Posts: 202
Location: Ottawa, Canada

PostPosted: Mon May 19, 2008 4:51 pm    Post subject: Reply with quote

tipp98 wrote:
A question however, is it possible to compile 64bit code on the 32bit machine in this manner, without using crossdev?

No, x86 is a subset of x86_64. x86_64 does not exist (natively) within x86.

tipp98 wrote:
Thats odd, multilib is not set on my 64bit system. Is this going to cause problems and if not what the heck is it for?

To set the multilib useflag, switch to the 2008.0 profile: 'eselect profile list' then 'eselect profile set <number>'
Back to top
View user's profile Send private message
Jormangeud
n00b
n00b


Joined: 05 Jul 2004
Posts: 24
Location: Finland

PostPosted: Mon Feb 27, 2012 2:23 am    Post subject: Re: [HOWTO] distcc amd64 -> x86 with simple wrapper scrip Reply with quote

Thanks, Sebastian for the howto.

No need to edit or copy distcc init or configs on the x86_64 host.

Lets just put the wrapper script in /usr/local/bin, it should be on the path for distccd.

/usr/local/bin/i686-pseudo-wrapper.bash:
Code:

#!/bin/bash
$(echo $(basename $0) | sed -e 's:i686:x86_64:g') -m32 "$@"


Then link it as the i686 compilers and make executable:
Code:
                                   
for i in {c++,cpp,g++,gcc}; do ln -s i686-pseudo-wrapper.bash /usr/local/bin/i686-pc-linux-gnu-$i; done
chmod a+x /usr/local/bin/i686-pseudo-wrapper.bash


The shorthands (c++, cpp, g++, gcc) probably need editing the distcc as on OP. However, ebuild environment should use the chost compiler and work fine.
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 Previous  1, 2
Page 2 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