# HOWTO: Use a Windows box as a distcc server for linux.

## PowerFactor

EDIT: This HOWTO has now been  posted on the gentoo-wiki.  The version there may be more up to date. This one is now unmaintained.

EDIT: 2007-02-11: Nowdays I think gentoo on colinux would be a better choice for most people than this.  It would surely be easer to maintain.

I know it sounds weird, sacreligious even, but there are reasons you would want to do it.  The best way of course is to use a distcc enabled livecd but that isn't possible in every situation.  So what is one to do?  Cygwin to the rescue.  It ain't as fast as linux(if you haven't used cygwin much you will be amazed at how slow it compiles stuff), but it will make better use of that cpu than solitaire. :Very Happy: 

First off there's not much really new in this howto.  See references that the bottom.  Just thought I would get it all in one place and relate the extra problems and solutions I ran into.  This won't get you the smallest or fastest cross toolchain you can get, it is just the basics that worked for me.  Also I'm no expert on cross compilers and I've heard they can cause problems with some packages. I haven't had any problems so far but I haven't tested this extensively. If you don't want to compile it all youself then look here.

So, how do we go about this.  Well first you need a working cygwin installation, with a full set of build tools.  I won't go into that here, there's plenty of info on that over at cygwin.com.  You will of course need gcc make and all that.  I have cygwin-1.3.22 and gcc-3.2-3 installed for the purposes of this howto.

EDIT: Make sure you choose the "all users" option in the cygwin installation and either have CYGWIN="ntsec tty" in your system environment variables  or set it before starting distccd.  Thanks Veto.

EDIT: I have been asked to list what packages are needed on cygwin for this.  Truth is, I never looked into the minimum requirements for compiling gcc on cygwin. I installed gcc. gcc-g++, make autoconf, automake, m4, and I think those pulled in all the rest I have.

Once you get cygwin installed to your liking and can compile stuff on it you can build the cross-compiler toolchain you will need for compiling programs for linux.

A little convention: Any command that has cygwin$ at the frint is one you execute in the cygwin shell on you windows box and any with linux$ in front is one you run on your gentoo box.

First we set some environment variables. I install to /usr/local/cross-linux because that's where I wanted to put it. You can change that and SRC_ROOT and BUILD but leave the rest alone

```

cygwin$ export HOST=i686-pc-cygwin

cygwin$ export BUILD=i686-pc-cygwin

cygwin$ export TARGET=i686-pc-linux-gnu

cygwin$ export PREFIX=/usr/local/cross-linux

cygwin$ export SRC_ROOT=~/

cygwin$ export BUILDDIR=$SRC_ROOT/build

```

EDIT: Fixed BUILDDIR variable, see Veto's post.

Binutils

I have binutils-2.13.90.0.18 on my linux boxes. But couldn't get that to compile on cygwin so I went with binutils-2.13.1. It compiled without a hitch.  Now to actually build it.  You could also add "--disable-nls" to the configure options but I didn't try it that way.

```

cygwin$ cd $src-root

cygwin$ tar -xzvf binutils-2.13.1.tar.gz

cygwin$ mkdir $BUILDDIR/binutils

cygwin$ cd $BUILDDIR/binutils

cygwin$  ../../binutils-2.13.1/configure --with-included-gettext \

      --target=$TARGET --host=$HOST --build=$BUILD \

      --prefix=$PREFIX -v && \

make && make install

```

EDIT:Can't belive I left this out

IMPORTANT Add $prefix/bin to your PATH Before going forward.

```
cygwin$ export PATH=$PATH:$prefix/bin
```

Test

```
cygwin$ $TARGET-ld --version

GNU ld version 2.13.1

Copyright 2002 Free Software Foundation, Inc.

This program is free software; you may redistribute it under the terms of

the GNU General Public License.  This program has absolutely no warranty.

```

Binutils looks good so move on.

GLIBC and linux-headers

Everything I read said it wasn't worth it to compile glibc on cygwin so I didn't even try.  So get on your linux box and continue.  I used glibc-2.3.1 because that's what I have.

```

linux$ cd /tmp

linux$ mkdir glibc

linux$ cd glibc

linux$ tar -xzvf /usr/portage/distfiles/glibc-2.3.1.tar.gz

linux$ cd glibc-2.3.1

linux$ tar -xzvf /usr/portage/distfiles/glibc-linuxthreads-2.3.1.tar.gz

linux$ mkdir ../build

linux$ cd ../build

linux$ ../glibc-2.3.1/configure --enable-add-ons \

       --prefix=/usr/local/cross-linux/i686-pc-linux-gnu/

linux$ make

linux$ make install

```

Now we need to make a slight adjustment and get our kernel headers.

```

linux$ cd /usr/local/cross-linux/i686-pc-linux-gnu

linux$ ln -s include sys-include

linux$ cd include

linux$ ( cd /usr/include/; tar -cf - linux ) | tar -xf -

linux$ ( cd /usr/include/; tar -cf - asm ) | tar -xf -

```

EDIT: According to Veto you should omit the sys-include symlink if you're going to use GCC-3.2.3. See his post below.

Now your ready to copy the whole thing over to your windows box.

```

cygwin$ cd /

cygwin$ ssh linuxbox '( cd / ; tar -cf - usr/local/cross-linux )' | \

       tar -xf -

```

Now you should be ready to build gcc.

GCC

Here I used gcc-3.2.2 since that's what I had on my gentoo boxen.  I just grabbed the tarball out of my distfiles and copied it over to the windows box for building.

```

cygwin$ cd $SRC_ROOT

cygwin$ tar -xjvf gcc-3.2.2.tar.bz2
```

At this point you may want to modify gcc to not put the exe extension on executables as it does by default on cygwin.  So open $SRC_ROOT/gcc-3.2.2/gcc/config/i386/xm-cygwin.h and comment out the EXECUTABLE_SUFFIX macro.  I don't think this is necessary just for distcc use but I did it anyway since this compiler will build linux programs and I can't think of any circumstances where you would want to put the exe extension on them.  Anyway now you're ready to build it.

```

cygwin$ cd $BUILDDIR

cygwin$ mkdir gcc

cygwin$ cd gcc

cygwin$ ../../gcc-3.2.2/configure --enable-languages=c,c++ \

    --with-included-gettext --enable-shared \

    --enable-threads=posix \

    --with-headers=$PREFIX/i686-pc-linux-gnu/include/ \

    --target=$TARGET --host=$HOST --build=$BUILD \

    --prefix=$PREFIX -v

cygwin$ make

cygwin$ make install

```

If it dies during the compile with something like this

```

../../gcc-3.2.2/gcc/fixinc/gnu-

regex.c:5723: undefined reference to `___mempcpy'
```

don't worry.  Just open $SRC_ROOT/gcc-3.2.2/gcc/fixinc/gnu-regex.c and search for __mempcpy.  You should find something like this.

```

#if defined HAVE_MEMPCPY || defined _LIBC

          *((char *) __mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';

#else

          memcpy (errbuf, msg, errbuf_size - 1);

          errbuf[errbuf_size - 1] = 0;

#endif
```

just change

```
#if defined HAVE_MEMPCPY || defined _LIBC
```

to

```
#if 0 /* defined HAVE_MEMPCPY || defined _LIBC */
```

Then empty out your build directory and do the configure, make, make install again.  I had to do this but I'm not sure if it is a universal problem with gcc and cygwin or if it was just a problem with my box.  It is working fine as far as I can tell so you may want to do this to begin with if your in a hurry.  It will have been compiling for a pretty good while before you get this error.

Now when all that's done you should have a working cross-compiler. You can try it out as follows.

```
cygwin$ cat > hello.c << EOF

#include <stdio.h>

int

main()

{

  printf("hello world\n");

  return 0;

}

EOF

cygwin$ $TARGET-gcc -o hello hello.c
```

That should give you a hello executable that you can copy over to your linux box and run.

distcc

If that's all good now we can compile distcc.  This is pretty easy.  I used distcc-2.5 because that's what I have on my gentoo boxes.  If you've used distcc much you realize that it is important to have the same version on all machines in order for them to play nice.

```

cygwin$ cd $SRC_ROOT

cygwin$ tar -xjvf distcc-2.5.tar.bz2

cygwin$ cd distcc-2.5

cygwin$ ./configure --prefix=/usr/local

cygwin$ make && make install

```

That's all there is to it.  Now you should be able to run distccd on your windows box and add it to the pool.

```

cygwin$ export PATH="/usr/local/cross-linux/bin:/usr/local/cross-linux/$target/bin:$PATH"

cygwin$ distccd --daemon --nice 19

```

Now you can just add the windows box to the distcc hosts on a gentoo box and compile something on the linux box and check that it distributes properly.

Optional: Setting up distccd as a service in windows

You will need to have cygrunsrv installed on cygwin for this to work.  There are several other ways to do this but I'm just going to cover this one method. Also this will not work on any version of win9x. Only the NT based versions of windows have true services.

First we need a script to make sure distccd gets the proper PATH. I made mine /usr/local/bin/i686-pc-linux-gnu-distccd.sh  But you can of course name it whatever.

```

#!/bin/sh

TARGET="i686-pc-linux-gnu"

CROSS_CC_PATH="/usr/local/cross-linux/bin:/usr/local/cross-linux/$TARGET/bin"

DISTCCD_EXEC=/usr/local/bin/distccd

DISTCCD_ARGS="--nice 19 --no-detach --daemon"

export PATH="$CROSS_CC_PATH:$PATH"

exec $DISTCCD_EXEC $DISTCCD_ARGS
```

Now we install the service

```

cygwin$ cygrunsrv -I distccd --path /usr/local/bin/i686-pc-linux-gnu-distccd.sh \

       --shutdown
```

EDIT: See this post for an alternative.

Now you can start and stop distccd from the services control panel applet or with cygrunsrv.

References:

http://www.xraylith.wisc.edu/~khan/software/gnu-win32/cygwin-to-linux-cross-howto.txt

http://dev.gentoo.org/~aiken/cygwin-cross

That one seems to be broken since the gentoo server shuffle last week.

EDIT: Aiken's page doesn't exist anymore.  He did repost it on the zynot forums however.

Appendix: Making it smaller

You probably realized the if you package all this up It makes a huge tarball.  I don't really know how far you can go but I was able to reduce it's size by almost half.  I haven't tested this extensively so it may break things, I don't know.  When you build glibc on the linux box you can remove a bunch of stuff.  Delete all the directories inside of /usr/local/cross-linux/i686-pc-linux-gnu except include and lib.  You can also remove most of the contents of the lib directory, see khan's article for what you need to leave.  Finally when it is all done on the windows box you can remove the info and man directories from /usr/local/cross-linux to save a little more space.  I'm sure there are other things you can do as there is a 22MB tarball out there and the smallest I've managed so far is 27MB not including distcc.

EDIT: Various typo corections.Last edited by PowerFactor on Sun Feb 11, 2007 5:06 pm; edited 11 times in total

----------

## Veto

In the environment section on the cygwin side you have BUILD defined twice, I suggest using

cygwin$ export BUILDDIR=$SRC_ROOT/build

----------

## PowerFactor

Doh! :Embarassed:  Thanks, fixed it.

----------

## satellite

```
cygwin$ cd $src-root

cygwin$ tar -xjvf binutils-2.13.1.tar.gz

cygwin$ mkdir $BUILDDIR/binutils

cygwin$ cd $BUILDDIR/binutils

cygwin$  ../../binutils-2.13.1/configure --with-included-gettext \

      --target=$TARGET --host=$HOST --build=$BUILD \

      --prefix=$PREFIX -v && \

make && make install 
```

I think the first tar command should be -xzvf not -xjvf

Good job though PowerFactor... just seeing whether it works  :Smile: 

Satellite

----------

## Veto

Okay, I have created a cross-linux-3.2.2 with binutils and gcc from Gentoo stable (2.13.90 & 3.2.2) and tar.bz2'ed it up.  I'm coming in ~28MB.  If someone wants a copy or would like to host it, drop me a line.  All that is missing is distcc and I'm thinking about building it into cross-linux as well, with the distccd.sh script so it's completely self-containted.

Very cool stuff, now my slackard WinXP boxes can join in the fun when it comes time to compile KDE or X or what have you.

----------

## PowerFactor

 *satellite wrote:*   

> [I think the first tar command should be -xzvf not -xjvf

 Thanks satellite.  Leftover from trying the binutils from gentoo which was in a .bz2.  I need to learn to copy and paste better.  :Laughing: 

----------

## Veto

PowerFactor,

I found small typo in the gcc/configure part:

--with-headers=$PREFIX/i686-linux-pc-gnu

should be:

--with-headers=$PREFIX/i686-pc-linux-gnu

pc-linux is transposed.

Additonally, from my initial tests it looks like there may be some massaging needed for building gcc-3.2.3/binutils-2.14.x.x.x, I'm running into some issues with gcc-3.2.3 removing some headers and binutils-2.14 possibly being broken...not sure yet, I'm going through the steps again as it was very late last night when I ran into them.

----------

## Veto

Okay, I've figured it out. Two things you might want to change:

1) Make sure your path is set to /usr/local/cross-linux/bin:$PATH

2) Do not make the symlink from include to sys-include, gcc-3.2.3 will copy the needed files from include to sys-include and apparently removes to source...which is a bad thing if you have a symlink.

I now have a new binutils-2.14xxx, glibc-2.3.2, gcc-3.2.3 cross-linux setup for cygwin.  Only downside is that it's grown to 48MB, but it looks like some of that is due to keeping the .a's around which I don't mind.

----------

## PowerFactor

 *Veto wrote:*   

> I found small typo in the gcc/configure part: 

 Thanks, got it.

1) Yep, you kinda need that. :Embarassed:   I had it in there to start with, just got lost in the final assembly.

2)  I added a note about it.  You may not even need the symlink for gcc-3.2.2 but I haven't tried it without it yet.

Thanks for the comments and corrections.  :Very Happy: 

----------

## Veto

Power,

Just so you know, I really appreciate you keeping this HOWTO up to date, it's a great resource for people thinking about doing this.  I'm actually suprised more people  aren't using cygwin on their resting Windows boxes.

I found one other thing you might want to add for the service part, mine wouldn't start properly and I tracked it down to the install method and something that I needed to add to the cygrunsrv.

1) Install cygwin for all users, not "Only this user"...it'll just make things better down the road.   :Smile: 

2) cygrunsrv -I distccd -e /usr/local/bin/distccd.sh -y tcpip -d "Cygwin distccd" -e "CYGWIN=ntsec tty"

The last part with the CYGWIN seemed to make it work fine for me on my burner machine and when I snuck a Cygwin install onto my wife's laptop a bit ago.  (with the service running and at --nice 19, she'll never know the difference!)

It's damned nifty to do a base cygwin install with just checking off cygrunsrv, 2-3 minutes later you bring over the .tar.bz2 file and untar it and you have a distcc host up and running with service in less than 10 minutes and the machine doesn't have any visible footprint of you ever doing anything.

----------

## PowerFactor

Thanks Veto, just trying to do a little something for the community.  Glad to know someone in getting some use out of it.  :Very Happy: 

Good point on the "all users" install.  I've never used the "only for this user" install so I didn't think about it.   I've also had CYGWIN="ntsec tty binmode" in my system environment varibles since "the beginning" so I didn't think about that either.

About that tcpip dependancy. Is this a XP box you're running?  I have 2k and I don't seem to have that service.  At least I cant find it.  I tried reinstalling distccd with that dependancy and I didn't get any error. And it starts fine. But when I look at distccd in the services applet it still shows no dependencies,  so that makes me more suspicious that I don't have a service by that name on my box.

----------

## jago25_98

 :Smile: 

----------

## Kick

Hello !

First of all, thanks a lot for this nice HOWTO.

But (yes, there's a but  :Very Happy: ), I have a little problem with gcc compilation. I followed the first steps and everything worked like a charm. Then, I tried to compile gcc 3.2-3, following the instructions. Gcc itself is ok, but the libraries won't compile. I get stuck with thoses error messages :

```

/home/kick/build/gcc/gcc/xgcc -shared-libgcc -B/home/kick/build/gcc/gcc/ -nostdinc++ -L/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/src -L/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/src/.libs -B/usr/local/cross-linux/i686-pc-linux-gnu/bin/ -B/usr/local/cross-linux/i686-pc-linux-gnu/lib/ -isystem /usr/local/cross-linux/i686-pc-linux-gnu/include -I../../../../../gcc-3.2-3/libstdc++-v3/../gcc -I../../../../../gcc-3.2-3/libstdc++-v3/../include -I/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/i686-pc-linux-gnu -I/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include -I../../../../../gcc-3.2-3/libstdc++-v3/libsupc++ -g -O2 -D_GNU_SOURCE -fno-implicit-templates -Wall -Wno-format -W -Wwrite-strings -Winline -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -g -c ../../../../../gcc-3.2-3/libstdc++-v3/libsupc++/eh_alloc.cc  -fPIC -DPIC -o eh_alloc.o

In file included from ../../../../../gcc-3.2-3/libstdc++-v3/libsupc++/eh_alloc.cc:33:

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:86: `div_t'

   not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:87: `ldiv_t

   ' not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:89: `abort'

   not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:90: `abs'

   not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:91: `atexit

   ' not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:92: `atof'

   not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:93: `atoi'

   not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:94: `atol'

   not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:95: `

   bsearch' not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:96: `calloc

   ' not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:97: `div'

   not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:98: `exit'

   not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:99: `free'

   not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:100: `

   getenv' not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:101: `labs'

   not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:102: `ldiv'

   not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:103: `

   malloc' not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:104: `mblen

   ' not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:105: `

   mbstowcs' not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:106: `

   mbtowc' not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:107: `qsort

   ' not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:108: `rand'

   not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:109: `

   realloc' not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:110: `srand

   ' not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:111: `

   strtod' not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:112: `

   strtol' not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:113: `

   strtoul' not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:114: `

   system' not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:115: `

   wcstombs' not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:116: `

   wctomb' not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib: In

   function `long int std::abs(long int)':

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:119: `labs'

   undeclared (first use this function)

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:119: (Each

   undeclared identifier is reported only once for each function it appears

   in.)

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib: At global

   scope:

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:122: syntax

   error before `(' token

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:138: `

   lldiv_t' not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:139: `_Exit

   ' not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:148: syntax

   error before `(' token

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:149: syntax

   error before `.' token

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:149: syntax

   error before `.' token

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:152: syntax

   error before `(' token

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:153: syntax

   error before `.' token

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:153: syntax

   error before `.' token

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:155: `atoll

   ' not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:156: `

   strtof' not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:157: `

   strtoll' not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:158: `

   strtoull' not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:159: `

   strtold' not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:160: parse

   error before `}' token

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:164: `

   lldiv_t' not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:165: `_Exit

   ' not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:168: `div'

   not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:169: `lldiv

   ' not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:170: `atoll

   ' not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:171: `

   strtof' not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:172: `

   strtoll' not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:173: `

   strtoull' not declared

/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/include/cstdlib:174: `

   strtold' not declared

../../../../../gcc-3.2-3/libstdc++-v3/libsupc++/eh_alloc.cc: In function `void*

   __cxa_allocate_exception(unsigned int)':

../../../../../gcc-3.2-3/libstdc++-v3/libsupc++/eh_alloc.cc:102: `malloc'

   undeclared in namespace `std'

../../../../../gcc-3.2-3/libstdc++-v3/libsupc++/eh_alloc.cc: In function `void

   __cxa_free_exception(void*)':

../../../../../gcc-3.2-3/libstdc++-v3/libsupc++/eh_alloc.cc:162: `free'

   undeclared in namespace `std'

make[2]: *** [eh_alloc.lo] Error 1

make[2]: Leaving directory `/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3/libsupc++'

make[1]: *** [install-recursive] Error 1

make[1]: Leaving directory `/home/kick/build/gcc/i686-pc-linux-gnu/libstdc++-v3'

make: *** [install-target-libstdc++-v3] Error 2

```

It seems like the stdlib.h used is not the good one. So I tried to change its path in include statements, with no luck.

I don't understand why all theses structures are not declared. If somebody could point me out the problem...

----------

## Safrax

I've got a wee bit of a problem.  I followed the directions except I replaced binutils, glibc, and gcc with their newer portage counterparts.  Whenever I attempt to use distcc, anything that is compiled on the windows machine will result in a "file not recognized:  File format not recognized" error.  The test hello world program does work fine on my linux machine though.  Any ideas?

----------

## PowerFactor

Kick: I was never able to get gcc-3.2-3(the cygwin gcc) to compile as a cross-compiler.  I used gcc-3.2.2 (haven't upgraded any of my boxes to 3.2.3 yet) and Veto was able to sucessfully compile gcc-3.2.3 so you might want to try one of those.

Safrax:  If the test program runs then you must have the tools built correctly.  My guess is that your PATH is not being set correctly and distcc is using the native cygwin gcc instead of your cross-compiler.  Have a look at the distcc section again.

----------

## Kick

Thanks a lot, PowerFactor. It worked like a charm with gcc 3.2.2

Let's go cross-compiling !  :Smile: 

----------

## rk187

en installant gentoo sur un VMware sous windows, ça peut marcher aussi, apres faut voir coté performance de compilation !

qu'en pensez vous ?

 :Laughing: 

----------

## Safrax

 *rk187 wrote:*   

> en installant gentoo sur un VMware sous windows, ça peut marcher aussi, apres faut voir coté performance de compilation !
> 
> qu'en pensez vous ?
> 
> 

 

Crappy machine translation for those of us who don't understand french...

 *Quote:*   

> 
> 
> while installing gentoo on VMware under Windows, that can also go,
> 
> after is necessary to see with dimensions performance of compilation!
> ...

 

----------

## PowerFactor

 *Safrax wrote:*   

> Crappy machine translation for those of us who don't understand french...
> 
>  *Quote:*   
> 
> while installing gentoo on VMware under Windows, that can also go,
> ...

 

Is rk187 asking which would perform better at compiling, this or gentoo under vmware?  I quite frankly don't know.  I don't have a copy of vmware and probably won't anytime soon since I can build a pretty decent box (relative to any that I currently have anyway) for the same money.  :Wink:  (And yes, I know they have a free trial.)  Plus my windows box presently doesn't really have enough ram to run vmware well.  And until recently neither did my main linux box.

----------

## Safrax

 *PowerFactor wrote:*   

> Is rk187 asking which would perform better at compiling, this or gentoo under vmware?  I quite frankly don't know.  I don't have a copy of vmware and probably won't anytime soon since I can build a pretty decent box (relative to any that I currently have anyway) for the same money.  (And yes, I know they have a free trial.)  Plus my windows box presently doesn't really have enough ram to run vmware well.  And until recently neither did my main linux box.

 

I have a copy of vmware on the same machine im trying to do this cross compiling thing on.  It's a lowly 1.7ghz p4 with 256kb of cache, 400mhz fsb and 512mb of sdram.  It's not a fast computer by any means.  I haven't had much time to test this setup but from initial observations the cygwin cross compiler setup seems to be faster than the vmware virtual machine.  The extra overhead for compiling under vmware, set ram limit, virtualization of devices, etc takes its toll on I/O of any form.  Cygwin doesn't really have this problem.  I guess what I'm saying is that Cygwin should be faster but I dunno if it is or not without more testing.

----------

## xkjyeah

In case of errors

Should you get any errors while compiling GCC, GLIBC or BINUTILS, you might want to try getting Portage to apply patches on the source. To do this on GCC, you can:

```

# ebuild /usr/portage/sys-devel/gcc/gcc-3.3.1-r4.ebuild unpack

```

That will unpack GCC source, and apply patches at the same time. I think the most important files yet are the branch updates. Anyway, I received a problem in when using variable-length arguments (or something about "format" in the errors) in sscanf while compiling GLIBC using the stock source.

BINUTILS 2.14.0 straight from GNU should compile without fail using Cygwin GCC. (At least it did not in my case). It failed with 2.14.90.0 (... perhaps because I had not used portage-patched BINUTILS?)

Distcc on Cygwin did not fail the compile on my Cygwin.

The rule is: always get patched source code, and update your Cygwin.

Summary of what I did:

1) Binutils. Failed 2.14.90.0-unpatched. Success on Cygwin with 2.14.0.0 unpatched.

2) GLIBC. Failed 2.3.2 unpatched on Linux. Success when patched.

3) GCC. Didn't bother to let it remain unpatched. ebuild unpacked 3.3.1-r4 code, bzipped and transferred to Cygwin and compiled.

----------

## ylon

You might also mention placing `--enable-add-ons=linuxthreads' versus just `--enable-add-ons' when compiling glibc. ( compiling 2.3.2-r8 )

----------

## ylon

Maybe we ought to build an ebuild to handle this for us so that we can always have a sync'd cross-compiler with our linux systems that can just be installed on the cygwin systems.  Any thoughts?

----------

## ylon

Having troubles once I get to the section on compiling gcc (3.3.2-r2) on the cygwin machine.  One error had to do with a missing wchar.h, where I had to edit _G_config.h to change:

#include <wchar.h> -> #include <bits/wchar.h>

but once I got through that, I'm now seeing a bunch more junk:

/home/me/build/gcc/gcc/xgcc -B/home/me/build/gcc/gcc/ -B/usr/local/cross-linux/i686-pc-linux-gnu/bin/ -B/usr/local/cross-linux/i686-pc-linux-gnu/lib/ -isystem /usr/local/cross-linux/i686-pc-linux-gnu/include -O2 -DIN_GCC -DCROSS_COMPILE   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include  -I. -I. -I../../../src/gcc-3.3.2-r2/work/gcc-3.3.2/gcc -I../../../src/gcc-3.3.2-r2/work/gcc-3.3.2/gcc/. -I../../../src/gcc-3.3.2-r2/work/gcc-3.3.2/gcc/config -I../../../src/gcc-3.3.2-r2/work/gcc-3.3.2/gcc/../include  -g0 -finhibit-size-directive -fno-inline-functions -fno-exceptions -fno-zero-initialized-in-bss -fno-omit-frame-pointer \

   -c ../../../src/gcc-3.3.2-r2/work/gcc-3.3.2/gcc/crtstuff.c -DCRT_BEGIN \

  -o crtbegin.o

In file included from /usr/local/cross-linux/i686-pc-linux-gnu/include/libio.h:32,

                 from /usr/local/cross-linux/i686-pc-linux-gnu/include/stdio.h:72,

                 from ../../../src/gcc-3.3.2-r2/work/gcc-3.3.2/gcc/tsystem.h:72,

                 from ../../../src/gcc-3.3.2-r2/work/gcc-3.3.2/gcc/crtstuff.c:62:

/usr/local/cross-linux/i686-pc-linux-gnu/include/_G_config.h:29: error: syntax error before "__mbstate_t"

/usr/local/cross-linux/i686-pc-linux-gnu/include/_G_config.h:34: error: syntax error before "__mbstate_t"

In file included from /usr/local/cross-linux/i686-pc-linux-gnu/include/_G_config.h:44,

... a bunch more ...

What to do?  Are the sources out of sync and incompatible with cygwin?  I'm actually using cygwin's: gcc (GCC) 3.3.1 (cygming special) .

----------

## Kick

 *ylon wrote:*   

> Maybe we ought to build an ebuild to handle this for us so that we can always have a sync'd cross-compiler with our linux systems that can just be installed on the cygwin systems.  Any thoughts?

 

Oh yes, I absolutely agree this idea. It would be much easier than downloading sources, patching, passing right configuration options and compiling, all by hand on the Cygwin distcc host, each time Gentoo GCC is updated. I'm ready to thoroughly test any ebuild written in this way.  :Smile: 

----------

## ylon

Well Kick, I'm not sure I'd be able to help at this moment as I've not gotten PowerFactor's steps to work thus far with newer apps in the current portage tree.  Perhaps we can get those problems that we currently may see worked out and then get this rolling, as I think its much more convenient as well as reliable than following a document each time.  Also, perhaps the gentoo on cygwin project would be of help:

http://www.toso-digitals.de/gentoo/

If we could get a joint e-build going there that would be great.  For folks with access to bunches of systems it would be rather easy for them to deploy something like this in which they could run the ebuild on the linux side to get the files necessary, then tftp or ssh over to that linux box to pull necessary libs and get the cygwin ebuild running and then have some sort of menu built on the linux side that would easily walk you though popping in the distcc and make flags for the number of processors on your network (and when you upgrade to more boxen)...  Anyways, I could see some neat things coming of this.  It'd be easy for many linux machines, but this would be handy any way you look at it.  Also, we can incorporate Mac OS X into the mix.

----------

## jago25_98

Don't know about you but I find doing this stuff on Windows a bit of a pain; not what I have windows for.

 A great big .exe or .zip that does it all would be a dream. Could it just be a case of combining:

- cygwin, 

- gcc tarball

- a distcc binary compiled by self

into one place (.exe / .zip)?

----------

## Veto

I have created a new verstion of my my cross-linux toolkit dist for Cygwin.  It is a complete toolchain and utilities for makign a Cygwin host a distcc host.  It includes:

binutils-2.14.90.0.6

glibc-2.3.2

gcc-3.2.3 (from -r3)

distcc-2.11.1

This 27MB .tar.bz2 can be downloaded and untarred into /usr and it will create a local directory (or overlay your own).  In /usr/local/bin you can find a script called 'mkservice' which will install distcc as a NT service (as long as you have cygrunsrv installed).

Once you've done this and started the distcc service (net start distccd) you should have a complete distcc host ready to run.  I have tested it by compling the 2.4.22 kernel only on my Cygwin-Distcc hosts and it completes fine.

It can be found at ftp://ftp.dympna.com/pub

--

Veto

----------

## jago25_98

veto:

can't seem to connect to ftp://ftp.dympna.com/pub ...?

That new cross compiler sounds handy. How's about a small httpd server if that makes things simpler.

----------

## Veto

Ugh, I've fixed this problem...the ftp server should be available now.  Sorry about that.

--

Veto

----------

## john.robinson

[fx] *BANG* *BANG* *BANG* [/fx of head against wall]

Wish I'd read to the end of the thread. I did do a month or so ago, the last time I checked it out, but now I was feeling brave enough to have a go. gcc is now compiling, but sure as fate it'll be all wrong, and I'll be better off using the tarball.

Thanks very much for your efforts, Veto and PowerFactor, and for keeping things up to date!

I do wonder, though, since distcc only passes pre-processed C source over, and Cygwin's own gcc binary package is only 3Mb, whether we can get this down to 3Mb or so? Or am I being really stupid  :Confused:  and we really do need all the other binutils, libs and includes?

Also, if I understand ylon's suggestion right, that means (i) building a cross-compiler from gentoo to cygwin targets, so that we can (ii) build the cross-compiler for cygwin? That might be quite cool, but just a little exhausting for our systems. OTOH once you've done it once, you'll have a distributed cc which can do it, so it'll be quicker the next time  :Very Happy: 

----------

## john.robinson

Oh darn.

```
John@cygwin ~

$ gcc -o hello hello.c

/usr/local/cross-linux/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/../../../../i686-pc-linux-gnu/lib/crt1.o(.text+0xc): In function `_start':

: undefined reference to `__libc_csu_fini'

/usr/local/cross-linux/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/../../../../i686-pc-linux-gnu/lib/crt1.o(.text+0x11): In function `_start':

: undefined reference to `__libc_csu_init'

collect2: ld returned 1 exit status

John@cygwin ~

$
```

This is on an Athlon box running XP, on latest cygwin.  :Sad: 

----------

## john.robinson

I whinged about gcc not working, but that doesn't seem to affect distcc. btw that gcc was i686-pc-linux-gnu-gcc, I had the path etc. set properly, and the same results happen when you say `i686-pc-linux-gnu-gcc --target=i686-pc-linux-gnu -o hello.o hello.c`, but I don't care; I think it's because hello.c says #include <stdio.h> which is of course done by distcc before the source is passed over. Anyway, ignorant musings over.

Happy New Year all!

----------

## Veto

I just wanted to let you guys know that I've updated my Cygwin hosted Linux distcc/gcc toolchain to 1.2 (012104).  This toolchain will allow you to use your Windows boxes as Distcc compile hosts for your Linux machines.  It is specifically designed for Gentoo Stable with the addition of distcc-2.12.1.  I would guess it will work on other distributions, but I don't have any feedback on this.

The toolchain contains:

binutils-2.14.90.0.7

glibc-2.3.2-r9 (Gentoo patched and built with linuxthreads)

gcc-3.2.3-r3 (Gentoo patched)

distcc-2.12.1

This 25MB distribution can be found at ftp://ftp.dympna.com/pub/cross-linux-012104-stripped.tar.bz2

To install just cd /usr/local && tar xvjf /some/where/cross-linux-012104-stripped.tar.bz2.  Read the README for making distcc a Windows Service so it'll run transparently and startup.

----------

## jago25_98

So ftp://ftp.dympna.com/pub/cross-linux-012104-stripped.tar.bz2 is all a Windows user needs to be a distccd server?

 Cygwin still need to be installed?

Is there a way we can make it simpler? - just double click would be best, if not, .zip?

----------

## Veto

You will still need a installed Cygwin install.  I won't be doing an .exe or a .zip, but you are welcome to.  90% of the work is in actually getting the toolchain configured, built and installed properly and then into the tarball.

Downloading the file and reading the README might be a good start.

----------

## Harri

Veto, 

Thanks a million for this. It works great, and because of you I installed Cygwin for the first time and looked into it also.  :Smile: 

----------

## warlock55

Hi, 

I got 3 box: 2 gentoo and 1 windows. I wanna run distcc on all of them. 

On the Windows machine, I didnt use Veto file. I installed Cygwin and Gcc-3.2.3 and distcc.2.11.1 successfully... and distcc works fine on all of them. However, there're packages that the Windows machine will break the compilation like Python-2.3. It compile fine between 2 Gentoo systems. And there's packages like gaim-0.75 which distcc between 2 Gentoo systems also break the compilation. 

the errors said: distcc on local host fail...

I'm wondering if the error is because of my wrong setup or distcc... 

All the machine are using the same version of gcc and distcc. 

Planning to compile openoffice tonight using distcc on 3 systems.   :Very Happy: 

----------

## Veto

warlock55,

Are you using a consistently patched gcc and a consistently patched glibc?  I've seen similar issues with the Cygwin/DistCC compiles when I used the plain distribution of either gcc or glibc.  These went away when I switched to using the patched Gentoo sources to build the tools.

Hari,

Glad to see you liked it!  It's actually pretty handy having Cygwin on a Windows box anyways.

-Veto

----------

## warlock55

Oh Thanks alot Veto,

That's the reason, I'm using the plain distribution of gcc and distcc on the Windows machine...

----------

## gralves

 *Veto wrote:*   

> I just wanted to let you guys know that I've updated my Cygwin hosted Linux distcc/gcc toolchain to 1.2 (012104).  This toolchain will allow you to use your Windows boxes as Distcc compile hosts for your Linux machines.  It is specifically designed for Gentoo Stable with the addition of distcc-2.12.1.  I would guess it will work on other distributions, but I don't have any feedback on this.
> 
> The toolchain contains:
> 
> binutils-2.14.90.0.7
> ...

 

Veto, do you have any scripts to build those? It's been a pain to try to manually extract and patch c++ + binutils to lastest versions...

----------

## gralves

I've followed the instructions and  I'having this error when I try to emerge something:

```

cc1: warning: -fPIC ignored for target (all code is position independent)

 distcc -DPACKAGE_NAME=\"lcms\" -DPACKAGE_TARNAME=\"lcms\" -DPACKAGE_VERSION=\"1.12\" "-DPACKAGE_STRING=\"lcms 1.12\"" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DSIZEOF_INT=4 -DSIZEOF_UNSIGNED_INT=4 -DSIZEOF_LONG=4 -DSIZEOF_UNSIGNED_LONG=4 -DSIZEOF_LONG_LONG=8 -DSIZEOF_UNSIGNED_LONG_LONG=8 -DHasJPEG=1 -DHasZLIB=1 -DHasTIFF=1 -DHAVE_TIFFCONF_H=1 -I. -I. -I../include -I../include -O3 -march=athlon-xp -O3 -pipe -fomit-frame-pointer -ffast-math -mmmx -m3dnow -msse -mfpmath=sse,387 -c cmsvirt.c -o liblcms_la-cmsvirt.o >/dev/null 2>&1

/bin/sh ../libtool --mode=link distcc  -march=athlon-xp -O3 -pipe -fomit-frame-pointer -ffast-math -mmmx -m3dnow -msse -mfpmath=sse,387   -o liblcms.la -rpath /usr/lib -no-undefined -version-info 1:12:0 liblcms_la-cmscnvrt.lo liblcms_la-cmserr.lo liblcms_la-cmsgamma.lo liblcms_la-cmsgmt.lo liblcms_la-cmsintrp.lo liblcms_la-cmsio1.lo liblcms_la-cmslut.lo liblcms_la-cmsmatsh.lo liblcms_la-cmsmtrx.lo liblcms_la-cmspack.lo liblcms_la-cmspcs.lo liblcms_la-cmswtpnt.lo liblcms_la-cmsxform.lo liblcms_la-cmssamp.lo liblcms_la-cmscam97.lo liblcms_la-cmsnamed.lo liblcms_la-cmsps2.lo liblcms_la-cmscam02.lo liblcms_la-cmsvirt.lo -lm

distcc -shared  .libs/liblcms_la-cmscnvrt.o .libs/liblcms_la-cmserr.o .libs/liblcms_la-cmsgamma.o .libs/liblcms_la-cmsgmt.o .libs/liblcms_la-cmsintrp.o .libs/liblcms_la-cmsio1.o .libs/liblcms_la-cmslut.o .libs/liblcms_la-cmsmatsh.o .libs/liblcms_la-cmsmtrx.o .libs/liblcms_la-cmspack.o .libs/liblcms_la-cmspcs.o .libs/liblcms_la-cmswtpnt.o .libs/liblcms_la-cmsxform.o .libs/liblcms_la-cmssamp.o .libs/liblcms_la-cmscam97.o .libs/liblcms_la-cmsnamed.o .libs/liblcms_la-cmsps2.o .libs/liblcms_la-cmscam02.o .libs/liblcms_la-cmsvirt.o  -lm  -march=athlon-xp -mmmx -m3dnow -msse -mfpmath=sse,387 -Wl,-soname -Wl,liblcms.so.1 -o .libs/liblcms.so.1.0.12

.libs/liblcms_la-cmserr.o: file not recognized: File format not recognized

collect2: ld returned 1 exit status

distcc[13247] ERROR: compile on localhost failed

distcc[13246] ERROR: compile on localhost failed

make[1]: *** [liblcms.la] Error 1

make[1]: Leaving directory `/var/tmp/portage/lcms-1.12/work/lcms-1.12/src'

make: *** [all-recursive] Error 1

```

Everything works ok if I disable distcc.

Anyideias?

--------------

I will not triple post so I'm just editing this one...

You have to 

```

ln -s /usr/local/cross-linux/gcc.exe /usr/local/cross-linux/cc.exe

```

Or some ebuilds will fail

----------

## Veto

Thanks for the tip gralves, I'll add that to the next go at my toolchain.

Also, I don't have any scripts to do it, I do it by hand each time...and yes, it can be a pain in the ass.  It's a 3-4hour ordeal each time with at least one recompile and some breakages to fix.  I think it was the last go that I found that the plain gcc would compile fine, but the -r3 wouldn't.  I knew that I had to make the -r3 work since a plain gcc will puke on some code and on top of that, it's the 'right thing (tm)' to do.

-Veto

----------

## rk187

maybe colinux with Gentoo...

http://www.colinux.org

----------

## Trejkaz

I'm wondering if there are any pitfalls to watch out for with respect to multiple architectures (in the GCC -march sense of the word.)

The install instructions specify i686-pc-linux-gnu, now... GCC accepts -march=athlon-xp supposedly so would it make more sense if my Gentoo install were setup for that architecture, to setup things differently?  Or does the setup descripted result in the Gentoo box passing -march=athlon-xp to the Cygwin daemon?

Also, what is the deal if you _do_ have multiple architectures around the network?  Does a single distccd installation need to cater for just one sort?  Or does it switch between the directories depending on what the client machines ask it to perform?

----------

## dewhite

Wouldn't that be the point of cross compiling?  ALSO - does anyone have a copy of this bz mirrored?

----------

## dewhite

reading the readme a few times over really made this more clear to me.  I think I've got it done and working now proper.

Is there a good way to know if it's working?  Should I just watch task manager to see if its using process time?

----------

## odessit

You can just look at the task manager in Windows.

distcc has monitoring utility but I never used it.

What -j is everybody using? 

I have 2 CPUS on 100-BT switched) LAN

localhost P3-866m and the cygwin host with XP1925MHz 

-j3 barely touches the XP, ~30% with rare spikes to ~85%

-j4 does it better with ~60% util. and spikes up to ~90%

Should I try -j5/6 to load the cygwin-distcc even more? 

Can this break anything? (<-linux nub paranoiah)

BTW, Thank you PowerFactor and Veto and other developers for working on this project  :Exclamation:   :Laughing: 

----------

## odessit

here's the link I found.

Looks like somebody created knoppix bootable CD with distcc on it.

fairly handy for the systems without cygwin or the hard drive

http://opendoorsoftware.com/cgi/http.pl?p=distccKNOPPIX

----------

## dewhite

2 questions...

1.  Will that knoppix cd boot with nvnet support for my NF7-S mobo?  Or, is there a way to make it work with said adapter?

2.  If not, is there anyway you could repackage the bz2 image with gcc 3.3.2 instead of 3.2.3 for us ~x86 users veto?

----------

## PowerFactor

 *Trejkaz wrote:*   

> The install instructions specify i686-pc-linux-gnu, now... GCC accepts -march=athlon-xp supposedly so would it make more sense if my Gentoo install were setup for that architecture, to setup things differently?  Or does the setup descripted result in the Gentoo box passing -march=athlon-xp to the Cygwin daemon?

 

Leave it as i686-pc-linux-gnu unless you have changed your CHOST in make.conf to something else (eg. i586-pc-linux-gnu).  CFLAGS like -march are passed to the server by distcc.

 *Trejkaz wrote:*   

> Also, what is the deal if you _do_ have multiple architectures around the network?  Does a single distccd installation need to cater for just one sort?  Or does it switch between the directories depending on what the client machines ask it to perform?

 

I have mixed i586-linux-gnu and i686-linux-gnu machines in the compile team with no apparent problems. YMMV.

Sorry I haven't been keeping this updated lately folks.  My 2 widows machines are still running the first build I got working. (busy semester last fall)

Right now I'm trying to work out an improved method ( i.e. build the whole cross toolchain on linux).  If we can get that working then new possibilities could emerge. :Wink: 

----------

## odessit

 *dewhite wrote:*   

> 2 questions...
> 
> 1.  Will that knoppix cd boot with nvnet support for my NF7-S mobo?  Or, is there a way to make it work with said adapter?
> 
> 2.  If not, is there anyway you could repackage the bz2 image with gcc 3.3.2 instead of 3.2.3 for us ~x86 users veto?

 

Unfortunately I do not know anything about the CD. I could not test it yersterday, my test PC was not behaving (read dead). I will come home and search on the net. Or you can do the same, it will probably befaster

----------

## bqf

Just writing to say thanks to everyone helping to keep this updated (especially Powerfactor of course), and thanks to Veto for the Cygwin package - this windows box would still be idling most of the time if it hadn't been for your precompiled toolchain... I can be pretty lazy when it comes to longsome stuff like building a cross-compiler and dealing with all possibly arising problems  :Embarassed: 

P.S.: Curse Martin Schlemmer for "gcc-3.3.2-r5.ebuild: Bump to stable for x86." the day i finally put gcc-3.2.3-r3 on my windows box...  :Wink: 

----------

## john.robinson

I wouldn't go so far as cursing Martin Schlemmer, but it does mean it would be handy for me too if there was a new toolchain. *smiles sweetly at Veto* Please? I'm sure I'm not the only one who screwed up trying to do this myself.

Re mixed platforms - my Gentoo is on an AMD K6-2 with CHOST=i586-pc-linux-gnu, and I also have an AMD Athlon Thunderbird running Windows XP and another running Fedora Core 1 with CHOST=i386-redhat-linux. Both other platforms seem happy to produce things for Gentoo, in the case of the Fedora box I'm using their gcc 3.2 and everything's worked OK.

Of course all these are x86, I haven't tried installing on my Sun JavaStation (sparc) but if I go for Gentoo I'll definitely need to get cross-compiling going on one of the other boxes (it has 32M RAM and a 125MHz CPU). I have more pressing things to do though, which is why it currently runs Red Hat 6.2 if I ever turn it on.

----------

## Veto

I'll be rebuilding my toolchain on Monday for the large number fo changes we just had.

I could probably use my current glibc but I don't think that's proper so I've got both of my Gentoo boxes up-to-date, rebuilt glibc, etc.  Tomorrow I'll rebuild glibc for Cygwin (with gcc-3.3.2-r5) and then go over and build gcc-3.3.2-r5. After that I'll test, strip and package.

----------

## Veto

I've updated my tool-chain to include a rebuilt glibc-2.3.2-r9 and gcc-3.3.2-r5.  I also made sure to get cc.exe as a link in there as suggested and even managed to lose about 5MB (down to 19MB) of size with a bit more aggressive stripping.  It's compiled the 2.6.2-rc1-mm1 kernel so I'm guessing it's good to go.

You can read more about it HERE

or just grab it via FTP HERE

----------

## Ronald Dehuysser

If I would use the distccKNOPPIX and presume it has an older gcc version than my gentoo box, would that be a problem for compiling stuff with distcc?

Thanks in advance,

Ronald

----------

## bqf

 *Ronald Dehuysser wrote:*   

> If I would use the distccKNOPPIX and presume it has an older gcc version than my gentoo box, would that be a problem for compiling stuff with distcc?

 

See http://distcc.samba.org/faq.html#mixed-gcc for info about that.

(edit)

I hate editing my posts, but i totally overlooked Veto's posting. So basically I'm editing to say "thank you" for spending your time on this... again  :Smile: 

(/edit)

----------

## john.robinson

Me too   :Very Happy:   Thanks again Veto!

Suggestion, if I may be so bold and just in case you haven't already, go and take a copy of your .bash_history (or whatever) on both boxes, I'd be happy to turn them into configurable scripts (but perhaps not an ebuild) if desired (not that you couldn't, this is just my cack-handed way of offering assistance  :Embarassed:  ).

----------

## Veto

 *john.robinson wrote:*   

> Me too    Thanks again Veto!
> 
> Suggestion, if I may be so bold and just in case you haven't already, go and take a copy of your .bash_history (or whatever) on both boxes, I'd be happy to turn them into configurable scripts (but perhaps not an ebuild) if desired (not that you couldn't, this is just my cack-handed way of offering assistance  ).

 

Argh, i just looked over my Gentoo box and it's history is already munged up...no real good there.  I'll be sure to capture a clean history next time I go through it.  I'm guessing we'll see a glibc upgrade in the next couple of weeks...I almost held off doing this run because of it, but I wanted the windows boxen to do something besides sit there during all the changes.

----------

## ehudokai

In case anyone cares.  I'm SUPER siked because I just followed the original howto and was able to get a cross-compiler/distcc setup running on a Mac G4  running OS X 10.3 that doesn't get much use here in the office  :Very Happy:  !!!  Gonna transfer it to a G5 tomorrow  :Smile:  ...

If anyone want's me to post a tarball and has a place to put it, let me know!

I might be able to host one, but not sure.  Depends on demand.

-joel

----------

## Harri

 *Veto wrote:*   

> I've updated my tool-chain to include a rebuilt glibc-2.3.2-r9 and gcc-3.3.2-r5.  I also made sure to get cc.exe as a link in there as suggested and even managed to lose about 5MB (down to 19MB) of size with a bit more aggressive stripping.  It's compiled the 2.6.2-rc1-mm1 kernel so I'm guessing it's good to go.
> 
> You can read more about it HERE
> 
> or just grab it via FTP HERE

 

Thanks again for your great work. This is AWESOME and works 100%.

Get to work XP Desktops!  :Wink: 

----------

## sphen

First of all thanks for the great HOW-TO.

Is it possible to get distccmon-text to show anything in cygwin.  I set the interval but still no luck.  However, when compiling stuff in gentoo, the lights on the router go crazy and Windows task manager does show gcc.exe as doing something occasionally.

Thanks

Stephen.

----------

## Harri

 *sphen wrote:*   

> First of all thanks for the great HOW-TO.
> 
> Is it possible to get distccmon-text to show anything in cygwin.  I set the interval but still no luck.  However, when compiling stuff in gentoo, the lights on the router go crazy and Windows task manager does show gcc.exe as doing something occasionally.
> 
> Thanks
> ...

 

Run distccmon-text on the gentoo computer that you are compiling for.  

Depending on your Distcc installation age try the following:

DISTCC_DIR=/var/tmp/portage/.distcc distccmon-text 2

or

DISTCC_DIR=/var/tmp/distccd/.distcc distccmon-text 2

That should show the windows computers hard at work.

----------

## sphen

 *Harri wrote:*   

> 
> 
> Run distccmon-text on the gentoo computer that you are compiling for.  
> 
> Depending on your Distcc installation age try the following:
> ...

 

Thanks Harri.  Great now I have a good excuse to spend all my money on some more machines.   :Laughing: 

----------

## bruor

veto, 

thanks for the amazing setup, i was having a hard tiem getting things running,  but i got oyur file untarred and ran the script and bang  works like a dream 

extremely appreciated !!!

 :Smile: 

----------

## Veto

Glad to see people are getting use out of Powerfactors great HOWTO and my binary package built on it.

I'm guessing we're going to have a bump of glibc coming up...just seems like about time for one.  When that happens I'll grab my history file and see if we can't create some type of script to build your own package from scratch.  If Powerfactor does find a way to build all of it under Gentoo then we'll could possibly have a script to gen a up to date bindist at any time...that would be very cool.

----------

## bios_2110

i've downloaded the wonderful package, and installed it on a machine with cyg, and done the service and all, but when i try to compile i get this friendly error

```

distccd[556] (dcc_execvp) ERROR: failed to exec gcc: Permission denied

distcc[6679] ERROR: compile on 192.168.1.202 failed with exit code 110

make[2]: *** [getopt.o] Error 1

make[2]: *** Waiting for unfinished jobs....

distccd[2596] (dcc_execvp) ERROR: failed to exec gcc: Permission denied

distcc[6693] ERROR: compile on 192.168.1.202 failed with exit code 110

make[2]: *** [regex.o] Error 1

make[2]: Leaving directory `/var/tmp/portage/sed-4.0.7/work/sed-4.0.7/lib'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/var/tmp/portage/sed-4.0.7/work/sed-4.0.7'

make: *** [all] Error 2

!!! ERROR: sys-apps/sed-4.0.7 failed.

!!! Function src_compile,

```

any help would be greatly appreceated

----------

## bios_2110

okay, so i may have read the permissions wrong. i guess it's hard to execute a file when it doesn't have the -x permission, eh?

----------

## bios_2110

okay, so i gave cross-linux RWX for all and this is what i get for a listing for gcc

```

Andrew Preece@apiii /usr/local/cross-linux/bin

$ ls -al gcc.exe

-rwxr-xr-x+   1 Andrew P None            0 Feb  9 18:31 gcc.exe

```

and this is what i get when i run it

```

Andrew Preece@apiii /usr/local/cross-linux/bin

$ ./gcc

bash: ./gcc: Permission denied

```

----------

## Veto

Hmm, does the long named gcc run?  It should be something like: /usr/local/cross-linux/bin/gcc-i686-cygwin<blah blah blah>.exe

----------

## dankegel

For what it's worth, I'm updating http://kegel.com/crosstool

to support Cygwin and Mac OS X, and to build distcc by default;

this should make it fairly easy to put together a hetrogenous

distcc build cluster for any desired combination of gcc, glibc, and

target CPU type.  These features should be in version 0.28 when

I release it next week or so, knock on wood.

----------

## jago25_98

Is it possible to create a static binary so all a windoze user needs to do is click it?

----------

## piyo

Thanks for this topic. I have successfully gotten useful results. Can you imagine playing around with gentoo linux 2004.0 on a VIA EPIA (=P3-533Mhz) computer? Slow slow glacial compile times. My windows computers can now be put to good use!

I was wondering why is it important to have glibc recompiled on the linux computer? Why can't you just copy glibc binaries already installed as a package over to the windows machine? Obviously the installed glibc is targeted for that machine.

---

piyo

----------

## Daath

Damn it's nice, my 900MHz laptop running gentoo, my P4 2GHz machine running XP is assisting my 1GHz Via C3 server right now, it's incredibly fast!

Installation was VERY smooth and easy thanks to rob's toolchains etc. and the cygwin net installer  :Smile:  Very nice!

----------

## Veto

There is a new binutils out...I'll be rebuilding the toolkit soon, does anyone still want the -history- out of it?

-veto

----------

## ryceck

I got a Windows XP pc here with cygwin on it ofcourse and after a lot of tweaking and doing and using the cross-tools.bz2 presented here i got distcc running at it, but.....

I get this weird error when compiling from my gentoo-box:

```

gcc -fno-strict-aliasing -DNDEBUG -O3 -march=athlon -funroll-loops -pipe -fPIC -DALL_STATIC=1 -Ic/i386 -I/usr/include/python2.3 -c c/psyco.c -o build/temp.linux-i686-2.3/c/psyco.o

cc1: warning: -fPIC ignored for target (all code is position independent)

gcc -pthread -shared -O3 -march=athlon -funroll-loops -pipe build/temp.linux-i686-2.3/c/psyco.o -o build/lib.linux-i686-2.3/psyco/_psyco.so

build/temp.linux-i686-2.3/c/psyco.o: file not recognized: File format not recognized

collect2: ld returned 1 exit status

distcc[28006] ERROR: compile (null) on localhost failed

error: command 'gcc' failed with exit status 1

!!! ERROR: dev-python/psyco-1.2 failed.

!!! Function distutils_src_compile, Line 38, Exitcode 1

!!! compilation failed

```

The "cc1" it mentions here is the compiler from Cygwin.... but it seems like that one cant compile the .o file...

I tried this with multiple emerges (centericq for example) and it all gives the same error. With distcc disabled or with this host removed from my distcc/hosts list it does work so the problem is with the compiler at cygwin.

I retrieved the latest file from: ftp://ftp.dympna.com/pub/cross-linux-latest.tar.bz2 and put that one in: /usr/local/cross-linux.

I created the necessary exports and created the service using

```
cygrunsrv.exe -I distcc -d "CYGWIN Distcc" -e "CYGWIN=ntsec tty" -p /usr/local/bin/distccd.sh
```

Looks to me i did everything right but i must have forgotten something....

Anyone got a clue?

[edit]

Hmm.... The windows box doesnt seem to be the problem.... it appears to be a problem on my gentoo box. Cuz my laptop compiles wonderful using the windows-pc as a distcc-dump. Gonna try and debug my gentoo-box then  :Smile: 

Another [edit]: Recompiled distcc and the problem seems to be gone.

The problem was apparantely caused by starting a second emerge next to the one already distcc'ing... That kinda b0rked my distcc :/

[/edit]

----------

## Veto

Well, it looks like it's time to rebuild the toolkit since we got a new binutils recently and now we have a new gcc and glibc.  I'll be rebuilding the toolkit sometime before the end of the week.  I'll make sure to keep a history for anyone who cares to try to script something up.

----------

## image

cool, thanks veto. i just did a couple mixed envirornment distcc compiles, and my laptop doesn't seem to have any kinds of problems using a combo of 3.3.3 and 3.3.2, but it would be great to update my cygwin boxes asap.

----------

## helamonster

Just a heads up to everyone: If you enable gettext, you will need the gettext-devel cygwin package to make binutils.

I tried without it and the make of binutils failed because of the lack of the msgfmt program.

----------

## alterself.com

The how-to I wrote is for getting distcc to work and accept jobs from my gentoo boxes. the link can be found here at my site: http://www.alterself.com/.

please let me know if there are any qustions, comments or issues, let me know.

----------

## Veto

I have updated the tool-chain, FINALLY.  You can find it at ftp://ftp.geocomputing.net/pub/cross-linux-072004.tar.bz2.  It's about 20MB in size, but has been migrated to a much faster server.

I just realized that I built glibc with --mcpu=athlon-xp, but it's not --march so it should work everywhere.

Let me know if you encounter any issues.

----------

## bizkit

Way to complicated, I would definetily use it if it were more simple.

----------

## Veto

It's one of those things, if you can't intstall Cygwin and do a tar, read a README then don't use it.

No harm, no foul.

I've been asked to make a Win32 installer and my response is always the same: No, I've already spent the considerable time to create the tool-chain, strip the appropriate binaries and package it up.  If others can't manage to use Cygwin and use tar, there is no way I want to support them.

Now if someone else want's to package it up in an installer, they are more than welcome to use my tool-chain.

----------

## bqf

Thanks again Veto  :Smile: 

I actually do have a fully automated 12meg executable for deploying a very small cygwin install and configuring the distccd as a startup service - if anyone is interested in getting it and / or hosting it just let me know (because I don't have that much spare bandwidth).

----------

## john.robinson

Veto - I quite agree with you but I wonder if bizkit was referring to the content of the first page or so of this thread, before you'd packaged it all and people were having to try and build by hand  :Smile: 

Oh and thanks again for your build!

I've put a copy of bqf's ready-to-run build with installer up at ftp://ftp.yuiop.co.uk/gentoo/win32/distccd_install.exe for anyone who wants to try it, but please direct any queries to him/her not me.

The ftp server only supports passive mode, and it if hits more than a couple of hundred downloads a month we'll have to find somewhere else to put it. (My hosting provider's bandwidth is not cheap but I've got spare at the moment; I just don't want this pushing me up the the next charge band)

----------

## bqf

The installer john.robinson posted a link to...

installs cygwin/distcc to c:\cygwin (you don't have a choice)

needs about 70 MiB of free HD space on c:

needs to be run as an admin user for being able to add the cygwin registry entries

configures the distccd as a boot service with a niceness of 19 (i.e. lowest possible / idle) and starts it right after the installation

It was done using Veto's toolchain, a very small cygwin install, 7zip and AutoIt.

If you don't like it or want it to be configurable - well, bad luck  :Smile: 

(unless enough people want me to do a "real" setup for this)

----------

## Veto

If you guys need a place to host this, I can offer a high-speed FTP server.

----------

## Veto

I've mirrored bqf's .exe installer on my site.

ftp://ftp.geocomputing.net/pub/

-Veto

----------

## BarryJ

I installed this using Veto's tarball (thanks very much by the way, it works great!), how do I change the niceness of the service?  It's eating up a bit more of my CPU than I'd like on my windows computer.

----------

## Bad_Byte

About the "distccd_install.exe" is it able to run on my amd xp and assist compiling for my amd64, creating 64bit binaries. ?

----------

## PowerFactor

Just to let everyone know, I have finally posted the howto on the gentoo-wiki.  Feel free to make any updates that I missed. It's been quite a while since the last time I did anything with it..

----------

## Veto

Barry,

If I remember correctly, just right click on the process in Taskman and select it's priority and I think it remembers it across service start/stops...but I'm not certain.

----------

## bqf

BarryJ:

Either do what Veto proposed (I don't think it "remembers" the niceness level though), or change the DISTCCD_ARGS in $yourcygwinpath\usr\local\bin\distccd.sh to

```
DISTCCD_ARGS="--nice 19 --no-detach --daemon"
```

 (or whatever level you want) and restart the daemon. Note that if you are using "my" .exe installer it's already set to lowest priority.

Bad_Byte:

I "somehow don't think" (i.e. I don't know) it would work, but you can always just try doing it  :Wink: 

----------

## xenu

What version of DISTCC was used in the distccd_install.exe

Is there a simple way of updating the version of distcc?I can download the latest tar, but it I can't make install. I'm asuming it's missing pieces.

Sorry for the nub question. Just trying to speed builds on a PII pc.

----------

## Veto

FYI, I'll be rebuilding this weekend (or sooner, depends on if I can free up tomorrow afternoon...and how much of the previous build I deleted!) for the new gcc.

-Veto

----------

## Twink

Hi, I'm trying to follow the commands to get a distcc on a windows box however i can't seem to compile glibc on my linux box.

using 

configure --enable-add-ons --prefix=/usr/local/cross-linux/i686-pc-linux-gnu/

I get *** Linux threads and NPTL addons are both available, only one must be used.

unfortunately i'm not sure what NPTL is or how to disable it for this compile

----------

## Veto

I've rebuilt the tool-chain and will strip and package it tomorrow for public consumption.

----------

## Veto

The tool-chain has been rebuilt and is now with the latest stable Cygwin with Gentoo stable binutils-2.14.90.0.8-r1, gcc-3.3.4, glibc-2.3.3.

It can be found at the normal place:

ftp://ftp.geocomputing.net/pub/cross-linux-stripped-13Sep04.tar.bz2

ftp://ftp.geocomputing.net/pub/cross-linux-latest.tar.bz2

Enjoy!

----------

## hotplainrice

Veto, can I still use the distcc binaries that you provide even though I have changed to linux26-headers, glibc for nptl?

----------

## PowerFactor

I think I've got a slightly easier way to build glibc now. See the wiki for details.

----------

## purevirtual

I'm currently working on a minimal gcc/distcc - Package. So far I've managed a working package of 3.5 MB (uncompressed!).

At the moment I'm developing a small Windows App for configuration purposes etc.

I hope to get stable packages for various target platforms online within the next few weeks.

----------

## Veto

 *hotplainrice wrote:*   

> Veto, can I still use the distcc binaries that you provide even though I have changed to linux26-headers, glibc for nptl?

 

I doubt it'll work with nptl as I'm running without.  I -think- built this with 2.6 headers....but I'm not 100% certain (just got in from a trip, won't be clear headed enough to check until tomorrow).

-Veto

----------

## hotplainrice

Thx.

----------

## john.robinson

I have wiped lots of the cross-linux produced by Veto, and so for those who want a smaller download (6.2M rather than 22M) and smaller runtime (19M rather than 84M) and who are definitely only interested in distcc for Gentoo may visit ftp://ftp.yuiop.co.uk/gentoo/win32/cross-linux-stripped-13Sep04-slim.tar.bz2 then should follow the same process as per Veto's instructions (roughly: unpack to /usr/local then use /usr/local/bin/mkservice).

Veto, Powerfactor, I just thought that seeing as distcc only sends compile jobs (no preprocess, no linking) over to slaves, we could cope without includes and libraries, and I wiped manuals etc. too. I can send you an `ls -R` of my cross-linux-not-needed directory if you like, but I'm not honestly sure I've got it entirely right  :Very Happy:  but I expect that since no headers, libraries are required by distcc it should either work or not  :Smile: 

Just my 0.000005c to the Gentoo community... but if my ISP bandwidth leaps too much I'll cut it off (sorry).

----------

## TiCpu

Will that last file work with gcc 3.4.x ? I unpacked it and I can see it contains gcc 3.3.4 only, will that create broken executable if my client have gcc 3.4.2-r3 installed (not realy installed but I wanted to compile it with distcc then use it) Thanks for any info.

----------

## john.robinson

It's gcc-3.3.4-r1 built by Veto. It'll certainly work with your own 3.3.4 to help you build 3.4.x; once that's done, though, according to http://distcc.samba.org/faq.html#mixed-gcc it's probably not a good idea to mix versions.

----------

## zealott

Power Factor:  

I appreciate your howto on this subject.  I have followed it, and it works.  I now have a working toolchain to make Gentoo binaries on my Windows box  :Very Happy:   though, not very well tested.

To all you gurus and people who know this subject:

What would you do if you installed distcc per this howto, and invoking distccd --daemon does not open a tcp port?  That is where I am stuck  :Evil or Very Mad:    I am talking about distccd under Cygwin.  I get an error saying something to the effect that connection to the host was refused on the Gentoo side.  nmap confirms that the port is not open.  Why would a computer refuse to open a port    :Question: 

In case some backgound info will help you. . .

  - Latest version of Cygwin as of this post

  - distccd 2.16 on both Cygwin and Gentoo

  - Win98se with all known patches, updates, etc.

  - Using gcc  3.3.4 -r1 (binaries downloaded from Veto)

  - P4 2GHz, 256 DDR

  - Ethernet adapter built into Asus P4S533 mobo.

Please help, I am a major n00b, almost any advice will help me, seriously.

----------

## john.robinson

Well first off, you're not looking for an open port under Gentoo, you're looking for it under Windows (waiting for distcc to send a job).

Secondly, if you get a command prompt - or Cygwin shell - under Windows, you can see if distccd is running OK; say `netstat -a` and if you see port 3632 open, distccd is running.

If you have Windows XP SP2 - or any other with the firewall stuff running - you need to make a hole in the firewall; go to the Windows Security Centre (under SP2) or the properties of your network connection (under the others) and make sure the machine will accept connections on TCP port 3632.

I've just got back from the pub, so I'm probably talking rubbish; if the above doesn't help, please do ask again in the morning. Actually, afternoon (GMT), give me a chance to sober up and get over my (inevitable) hangover  :Wink: 

----------

## zealott

Thanks man!  I never knew what netstat was for.  It shows a buttload of ports "listening" that are not found to be open from nmap, but no 3632. . . DAMN!

--btw, I have no firewall on this machine.  What's the point when nmap says, in regards to the sequence number predictability, "trivial joke?"  :Rolling Eyes: 

----------

## john.robinson

Today I shall mostly be hung over  :Crying or Very sad: 

Yes, netstat shows you what ports are open on the local machine; whether or not these are really exposed to the network depends on (i) what address they're bound to - many are only bound to localhost; (ii) whether you've got a firewall.

I just looked at your post again, I see you're using Windows 98. It's a long time since I fired up a Win98 machine, so just for fun this morning I got my trusty old Pentium 166 machine out. Actually it runs Windows ME, but it's nearly the same. I found that running `distccd --daemon` didn't work - distccd just quit - but `distccd --daemon --no-detach` did. Perhaps Win9x can't detach child processes. Anyway: I just used /usr/local/bin/distccd.sh from Veto's package, which includes this option, and successfully sent a job from my Gentoo box.

I don't know what you'll have to do to get distccd running as a service from boot-up, though; perhaps there's some kind of wrapper but I doubt the Cygwin widget cygrunsrv works on anything other than NT and its derivatives.

----------

## zealott

Thanks John,

The --no-detach argument seems to have done it!  I will do some further testing today, but I emerged a small package just a little while ago, and got no errors.

later---

----------

## JazzSax006

Has anybody been able to get a gcc 3.4.x build on a windows/cygwin for x86_64 target?  I've tried compiling several different gcc versions and all have died with an error message (though the error differs for different gcc versions)

----------

## zealott

I just wanted to confirm that I am running distccd under Win98se/Cygwin.  The --no-detach argument is essential.  Also, make sure that you explicitly run. . .

```
distccd.sh
```

. . .if you would like to run the included script with the environment and arguments 'canned.'  To make this script slightly more convenient, add '&' at the end of the exec statement to put distccd in the background and allwo you to continue using the same terminal for other purposes.

----------

## antiflag1980

I just set up gentoo colinux and installed distcc and ccache on my moms P4 and I'ts been a great contributor to my distcc farm for months now and it's completely hassle free, I've set up a batch file for launching it and I always just close the monitor window right away and everythings completely maninance free, as far as she's concerned it's just a minimized command line window sitting on her computer.  With the occasional mantinance of me sshing and emerge syncing and emerge -uDv world to keep everything up to date.  If I ever get around to it, I'll make a stage 4 dvd for bittorent distribution, installation on another persons p4 would be as simple as burning the dvd and installing colinux and overwriting all the files in the C:\colinux folder on their hardrive with the files from the dvd, that is considering my settings are sufficient for their computer as in the ram amount setting and stuff, but my installation is kind of large (around 4GB I think) because I made separate extra loopback partitions to be mounted by fstab as swap and /usr maybe a couple others I don't remember.  All the end user would have to do is get the tap driver working for their system. before overwriting all the colinux files.  I find it  a much easier solution than cgywin, just to use a windows box in your distcc farm.

----------

## jago25_98

Another option could be running a stripped down coLinux image with distccd on it and minimal gcc related tools.

I guess a start could be to take the coLinux gentoo image, add distccd and then start cutting it down.

----------

## john.robinson

I just don't see the Cygwin setup as difficult:

  (i) run Cygwin setup (remember to include cygrunsrv);

  (ii) untar Veto's tarball into /usr/local;

  (iii) run a script (/usr/local/bin/mkservice)

is about all it involves...

It's different if you're working from source; I guess it depends on what you want it for.

----------

## jago25_98

I heard that because you're (cross compiling) or using cygwin that can cause problems.

running a .exe is preferrable. remember these are all sorts of windows users - i.e. dads computer upstairs... better have it running as low priority eh?

----------

## jago25_98

Might be a good idea to do testing with a normal but small ./configure && make 

, and replcae make with distcc. oh and set /etc/distcc* (off the op of my head; at work) to use only the Windows cygwin computer.

----------

## CtHu

hi al, thanks for your nice work here  :Wink: 

still no update since 13 sep?

----------

## jago25_98

still think it should be easier. can't get it working :/

----------

## FuriousGeorge

 *jago25_98 wrote:*   

> still think it should be easier. can't get it working :/

 

i think i found an easier way

on cygwin:

1>  get and unpack Dan Kegel's Crosstool http://www.kegel.com/crosstool/ , a script which builds a crosscompiler

2> get and unpack http://www.research.ibm.com/trl/projects/security/ssp/ gcc patch

3> read the howto and set up the script for crosstool.  real easy.  basically consists of making the /opt/crosstool folder on your cygwin system and a few other details:

   -for it to work out of the box on fresh cygwin installs you will need some sutff like automake, autoconf, gcc, make, bison, flex,wget for automagic  and all the obvious things.  

   -i find that installing everything under libs and devel takes less time than having it fail because you forgot flex

   -assuming youre installing on a cygwin system like miine, uncomment the line in demo-i686.sh of crosstools script that reflects what gcc and glibc version combination you want

   -in i686.dat file, change the target= line from i686-unknown-linux-gnu to i686-pc-linux-gnu, or youre gonna have to do some linking for distcc to work with your toolchain

UPDATE:  even easier way

3.5 on gentoo box "ebuild /usr/portage/sys-devel/gcc/gcc-(yourversion).ebuild unpack"

  -tar.bz2 the patched gcc source it puts in /var/temp/portage/gcc-(ver)/work/gcc-(ver)/ and get it to your cygwin box.  warning, if you dont do this, copying file by file could cause winodows to fubar the permissions on the files, and give you a "Cannot find Makefile.in" (and ls M* will tell you cannot find Makefile.in.  wierd"

   -now you have to stop dan's great script from getting unpacking and patching its own gcc.  open the file getandunpack.sh and comment out the two lines that look like this:

```

case $GCC_DIR in

   gcc-2.95.3)

      getUnpackAndPatch ftp://ftp.gnu.org/pub/gnu/gcc/$GCC_DIR.tar.gz ;;

  # gcc-3.3.3)  <--- This one and the one below it commented by default i believe in version whatever.i.have (FG)

     # getUnpackAndPatch ftp://ftp.gnu.org/pub/gnu/gcc/releases/$GCC_DIR/$GCC_D$

  # gcc-3.3.5)  <----  I commented this one and the one below it.

   #   getUnpackAndPatch ftp://gcc.gnu.org/pub/gcc/releases/$GCC_DIR/$GCC_DIR.t$

   gcc-4.0.[012345]-200*)

      dir=`echo $GCC_DIR | sed s/gcc-/prerelease-/`

      getUnpackAndPatch ftp://gcc.gnu.org/pub/gcc/$dir/$GCC_DIR.tar.gz ;;

   gcc-3.[345]-200*|gcc-4.0-200*)

```

-then run demo-i686.sh and your done

4.  when its done your toolchain will be in /opt/crosstool/i686-pc-linux-gnu/

5.  remember to use the same version of distcc on both systems.  use ebuild /path/to/distcc.ver.u.have.ebuild unpack to unpack and patch the source and copy your version to cygwin

6.  Put your toolchain in the path

7.  run distccd.exe --alllow (ip.of.client) --deamon

So far ive installed some thirty pacakges and only one gave me problems:  gkellm.  i'm trying to find a way to ebuild gcc.ebuild unpack and drop that in the build dir so you dont have to worry about any patches, but that doesnt work yet

use at your own risk, not well tested at all, requires looking at by someone qualified (not me), your mialage may vary

----------

## dundas

 *john.robinson wrote:*   

> I just don't see the Cygwin setup as difficult:
> 
>   (i) run Cygwin setup (remember to include cygrunsrv);
> 
>   (ii) untar Veto's tarball into /usr/local;
> ...

 

This sounds neat, and I do have some newbie questions, I've installed cygwin as instructed in the howto already, and did the above instructions by john.robinson, 

at the (iii), I just did 

```
cd /usr/local/bin
```

and then

```
./mkservice
```

but I guess this only makes distcc as a service?and how do I actually install veto's package (installing all binutils, distcc, gcc manually also?btw, I think gcc is already installed, since gcc -v returns the version, but I'm not sure about the others)

and in the gentoo, I've already set up distcc, set hosts to be "localhost cygwin_pc's_ip" and started it successfully, then I switched in XP and started the "Cygwin distcc" service, however, when I'm emerging something, and opened disctccmon-gui and found nothing, also in windows, the task manager shows, distccd.exe is not doing anything.......

btw the following stuff from powerfactory's wiki is not working for me, so something is wrong?

 *Quote:*   

> Now test to see if we have binutils working. 
> 
> cygwin$ $TARGET-ld --version
> 
> GNU ld version 2.13.1
> ...

 

I used gcc 3.3.3-3 in cygwin and 3.3.5 in gentoo box, and I untared veto's latest bzip2 as instructed in the 3 steps.

so I'm wondering if I've missed something?I have to go through the details in the wiki howto to install binutils, even I used veto's great script?or...?

thx a lot!

----------

## Veto

I've FINALLY updated my cross-linux tool-chain to stable.  Download and read more HERE.

----------

## Kow

So.. yea... how would u do this on a windows xp comp with an athlonxp cross compiling x86_64 code for an amd64 install? I'm assuming you have to change some of those BUILD/TARGET/HOST vars, which I thought I did right (changed TARGET to x86_64-whatevertherestis) and got to the gcc compile process and then it errored out. I lost the error message but basically it was looking for asm-x86_64/errno.h but none of it exists. I followed the guide which is the first posting[/code] in this thread.

----------

## Polzin

Hi Veta,

thanks for the cross-linux packages!!

I am wondering why you put the include, share, man files into the stripped package. 

As distccd receives a cpp-processed file, I conjecture that there is a lot to leave out.

It would be good if we could prepaire a list of things that are needed / not needed.

My suggestions (as rsync --include-from pattern)

+ i686-pc-linux-gnu/bin/as.exe

+ i686-pc-linux-gnu/bin/*++.exe

+ i686-pc-linux-gnu/bin/gcc.exe

+ lib/*.o

+ lib/gcc/i686-pc-linux-gnu/*/*.o

+ lib/gcc/i686-pc-linux-gnu/*/specs

+ libexec/gcc/i686-pc-linux-gnu/*/cc1*

+ /lib**/

+ /libexec**/

+ /i686-pc-linux-gnu**/

- *

This has worked for me, but I did not do a rigorous testing

I don´t know, what´s about the precompiled headers:

+ include/c++/*/i686-pc-linux-gnu/bits/stdc++.h.gch/*

As they are 36MB probably it´s better to leave them out.

I have tried with 4.0.1 and got to 26MB, significantly smaller than the original 63MB.

The tar.gz is 10 MB.

Any comment?

Tobias

----------

## risqer

Gentoo 2006.0 has been released. There is a need for an updated toolchain compatible with the 2006.0 release. 

Best of luck experts!  :Smile: 

----------

## linolium

Is there any development on this?  I would really like to get my windows box to help out Gentoo compile things but I don't know if I can use any of this stuff or whether it is too outdated.

Anyone?

----------

## nova-

@linolium: eh? just use colinux if cygwin doesn't work.

personally, I'd recommend you try colinux (which runs with windows) first.

----------

## Boyscout

Hi there.

Can somebody please tell my why all of this is necessary? Complete toolchain? glibc? What for?

 *http://distcc.samba.org/ wrote:*   

> distcc sends the complete preprocessed source code across the network for each job, so all it requires of the volunteer machines is that they be running the distccd daemon, and that they have an appropriate compiler installed.

 Sounds like besides distcc all you need is a gcc capable of building the proper object files and nothing else. What am I missing?

----------

## PowerFactor

 *Boyscout wrote:*   

> Hi there.
> 
> Can somebody please tell my why all of this is necessary? Complete toolchain? glibc? What for?
> 
>  *http://distcc.samba.org/ wrote:*   distcc sends the complete preprocessed source code across the network for each job, so all it requires of the volunteer machines is that they be running the distccd daemon, and that they have an appropriate compiler installed. Sounds like besides distcc all you need is a gcc capable of building the proper object files and nothing else. What am I missing?

 

The glibc headers are needed for compiling the cross-gcc.  You could probably get rid of it entirely after gcc is built. Binutils is needed (even for distcc) for the assembler.  You could probably get rid of any part of binutils that isn't needed to support the assembler.  I just never broke it down that far.

 *nova- wrote:*   

> @linolium: eh? just use colinux if cygwin doesn't work. 
> 
> personally, I'd recommend you try colinux (which runs with windows) first.

 

++

Nowadays I think that's probably the best way to go.  Gentoo on colinux would be much easier to keep up to date than this.  It would probably give better performance too.  I haven't tried it though, but I don't use this anymore either. In case you're wondering why I did this, colinux hadn't been realeased, at least I hadn't heard of it, at the time.

----------

