Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cross compile x86_64 on i686 system on Ubuntu with distcc

I am attempting to setup a small build cluster at home using distcc. There are two x64 systems and 1 i686 systems. All systems are running Ubuntu 10.10 and are up to date. The system that is initiating the build is x64. Distcc works fine between the two x64 systems but all build tasks sent to the i686 system fail.

So far:

  • I have installed the multilib package for g++ on that system. I am able to cross-compile to x64 locally using g++ -m64
  • Changed the link in /usr/lib/distcc/g++ to point to a script that explicity sets the -m64 parameter.

Any suggestions?

like image 324
Jesse Vogt Avatar asked Jan 12 '11 20:01

Jesse Vogt


1 Answers

Attempting this one again after more research:

GCC has a page describing the i386 and x86-64 options. The -m64 flag says to generate 64-bit code, but you'll also want to specify the type of CPU with -march=i686 or -march=k8 or similar, to use the correct instruction set.

Since distcc sends the GCC command line flags out, you should try adding these to the distcc command running locally and skip the remote script for setting flags.

If you test the architecture flags on your local x64 machine without distcc, just g++, then it should give you the right binaries when using distcc.

like image 153
Harold L Avatar answered Sep 30 '22 12:09

Harold L