5

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?

Jesse Vogt
  • 16,229
  • 16
  • 59
  • 72
  • What are the specific symptoms of the failure? – Martin v. Löwis Jan 12 '11 at 21:08
  • The systems were pretty general - the machine that was initiating was reporting that the 32 machine had errors so it tried to build locally. Each time it built locally it worked, so the 32 bit machine eventually was put on the "black list" for a little bit. – Jesse Vogt Jan 13 '11 at 06:55

1 Answers1

5

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.

Harold L
  • 5,166
  • 28
  • 28
  • I've definitely used `-m64` to get 64-bit builds on x86 recently. – Mark B Jan 12 '11 at 22:49
  • Arghhh...so simple. To make it work I just set (on the x64 machine that was initiating the build) CFLAGS and CXXFLAGS to -m64. Thanks! – Jesse Vogt Jan 13 '11 at 06:43