Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
HOWTO: Use a Windows box as a distcc server for linux.
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3, 4, 5, 6  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
PowerFactor
Veteran
Veteran


Joined: 30 Jan 2003
Posts: 1693
Location: out of it

PostPosted: Sat Jul 12, 2003 10:01 pm    Post subject: HOWTO: Use a Windows box as a distcc server for linux. Reply with quote

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.:D

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
Code:

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.
Code:

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.
Code:
cygwin$ export PATH=$PATH:$prefix/bin

Test
Code:
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.
Code:

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.
Code:

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.
Code:

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.
Code:

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.
Code:

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
Code:

../../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.
Code:

#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
Code:
#if defined HAVE_MEMPCPY || defined _LIBC
to
Code:
#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.
Code:
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.
Code:

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.
Code:

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.
Code:

#!/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
Code:

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
Back to top
View user's profile Send private message
Veto
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jul 2003
Posts: 83

PostPosted: Sun Jul 13, 2003 4:29 am    Post subject: Reply with quote

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

cygwin$ export BUILDDIR=$SRC_ROOT/build
Back to top
View user's profile Send private message
PowerFactor
Veteran
Veteran


Joined: 30 Jan 2003
Posts: 1693
Location: out of it

PostPosted: Sun Jul 13, 2003 4:54 am    Post subject: Reply with quote

Doh!:oops: Thanks, fixed it.
Back to top
View user's profile Send private message
satellite
n00b
n00b


Joined: 17 Jul 2002
Posts: 20
Location: U.K

PostPosted: Sun Jul 13, 2003 4:46 pm    Post subject: Reply with quote

Code:
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 :-)

Satellite
Back to top
View user's profile Send private message
Veto
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jul 2003
Posts: 83

PostPosted: Sun Jul 13, 2003 5:11 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
PowerFactor
Veteran
Veteran


Joined: 30 Jan 2003
Posts: 1693
Location: out of it

PostPosted: Sun Jul 13, 2003 6:32 pm    Post subject: Reply with quote

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. :lol:
Back to top
View user's profile Send private message
Veto
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jul 2003
Posts: 83

PostPosted: Thu Jul 17, 2003 4:56 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Veto
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jul 2003
Posts: 83

PostPosted: Thu Jul 17, 2003 6:44 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
PowerFactor
Veteran
Veteran


Joined: 30 Jan 2003
Posts: 1693
Location: out of it

PostPosted: Thu Jul 17, 2003 7:58 pm    Post subject: Reply with quote

Veto wrote:
I found small typo in the gcc/configure part:
Thanks, got it.

1) Yep, you kinda need that.:oops: 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. :D
Back to top
View user's profile Send private message
Veto
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jul 2003
Posts: 83

PostPosted: Thu Jul 17, 2003 10:15 pm    Post subject: Reply with quote

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. :)

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.
Back to top
View user's profile Send private message
PowerFactor
Veteran
Veteran


Joined: 30 Jan 2003
Posts: 1693
Location: out of it

PostPosted: Fri Jul 18, 2003 1:03 am    Post subject: Reply with quote

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

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.
Back to top
View user's profile Send private message
jago25_98
Apprentice
Apprentice


Joined: 23 Aug 2002
Posts: 180

PostPosted: Tue Jul 22, 2003 11:51 pm    Post subject: woohoo, am I gonna have fun at University tomorrow :p Reply with quote

:)
Back to top
View user's profile Send private message
Kick
n00b
n00b


Joined: 23 Jul 2003
Posts: 13

PostPosted: Fri Jul 25, 2003 8:30 am    Post subject: Reply with quote

Hello !
First of all, thanks a lot for this nice HOWTO.
But (yes, there's a but :D), 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 :

Code:

/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...
Back to top
View user's profile Send private message
Safrax
Guru
Guru


Joined: 23 Apr 2002
Posts: 422

PostPosted: Fri Jul 25, 2003 5:39 pm    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
PowerFactor
Veteran
Veteran


Joined: 30 Jan 2003
Posts: 1693
Location: out of it

PostPosted: Fri Jul 25, 2003 7:34 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Kick
n00b
n00b


Joined: 23 Jul 2003
Posts: 13

PostPosted: Sat Jul 26, 2003 4:45 pm    Post subject: Reply with quote

Thanks a lot, PowerFactor. It worked like a charm with gcc 3.2.2
Let's go cross-compiling ! :)
Back to top
View user's profile Send private message
rk187
Tux's lil' helper
Tux's lil' helper


Joined: 14 Apr 2003
Posts: 136
Location: France - Paris

PostPosted: Sat Jul 26, 2003 8:00 pm    Post subject: Reply with quote

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

qu'en pensez vous ?

:lol:
Back to top
View user's profile Send private message
Safrax
Guru
Guru


Joined: 23 Apr 2002
Posts: 422

PostPosted: Sat Jul 26, 2003 8:53 pm    Post subject: Reply with quote

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 ?

:lol:



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!

what think about it?
Back to top
View user's profile Send private message
PowerFactor
Veteran
Veteran


Joined: 30 Jan 2003
Posts: 1693
Location: out of it

PostPosted: Sat Jul 26, 2003 9:17 pm    Post subject: Reply with quote

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,
after is necessary to see with dimensions performance of compilation!

what think about it?

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.
Back to top
View user's profile Send private message
Safrax
Guru
Guru


Joined: 23 Apr 2002
Posts: 422

PostPosted: Sat Jul 26, 2003 10:18 pm    Post subject: Reply with quote

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. :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.


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.
Back to top
View user's profile Send private message
xkjyeah
n00b
n00b


Joined: 10 May 2003
Posts: 72

PostPosted: Tue Oct 14, 2003 5:35 am    Post subject: When compiling GLIBC... Reply with quote

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:

Code:

# 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.
Back to top
View user's profile Send private message
ylon
n00b
n00b


Joined: 04 Jun 2003
Posts: 5

PostPosted: Sat Nov 15, 2003 10:35 pm    Post subject: Reply with quote

You might also mention placing `--enable-add-ons=linuxthreads' versus just `--enable-add-ons' when compiling glibc. ( compiling 2.3.2-r8 )
Back to top
View user's profile Send private message
ylon
n00b
n00b


Joined: 04 Jun 2003
Posts: 5

PostPosted: Sat Nov 15, 2003 10:39 pm    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
ylon
n00b
n00b


Joined: 04 Jun 2003
Posts: 5

PostPosted: Sun Nov 16, 2003 1:12 am    Post subject: Reply with quote

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) .
Back to top
View user's profile Send private message
Kick
n00b
n00b


Joined: 23 Jul 2003
Posts: 13

PostPosted: Thu Nov 20, 2003 8:04 am    Post subject: Reply with quote

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. :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page 1, 2, 3, 4, 5, 6  Next
Page 1 of 6

 
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