It seems the file sys/_types.h is missing from FreeBSD Kernel headers. Although there is an ebuild sys-freebsd/freebsd-headers-6.0 , I cannot merge them. They are ~x86-fbsd masked and merging them after unmasking they miss the setvar command.

I have tried to set an alias for setvar=set which didnt succeed for me. I also wrote a little replacement script called setvar which just calls set with its positional parameters as a workarround but same error occured.

gcc emerged, however that was not using crossdev and it was 3.4.5-r1.
No idea why you are getting the setvar error.

EDIT:
Note: glibc will fail:

Code:

*** The GNU C library is currently not available for this platform.
*** So far nobody cared to port it and if there is no volunteer it
*** might never happen. So, if you have interest to see glibc on
*** this platform visit
*** http://www.gnu.org/software/libc/porting.html
*** and join the group of porters

Flameeyes: Thank you for the information and your work on this project. I was considering suggesting too2two create a bug for crossdev.

too2two: If you are wanting to forge on to create the cross compilers in the meantime, try
Copying all the files and subdirectories from /usr/include on the FreeBSD box to /usr/i386-unknown-freebsd6.0/include.
Copying
crt1.o
crti.o
libc.a
crtn.o
libm.a
from /usr/lib on the FreeBSD box to /usr/i386-unknown-freebsd6.0/lib and then running

Code:

USE="-*" emerge -pv cross-i386-unknown-freebsd6.0/gcc

You may need more files from /usr/lib. After the above I was able to compile two trivial C and C++ programs, copy them to the FreeBSD box, and execute them.

Unfortunately this is not yet done, I'm afraid.
There are a couple of things that have yet to be tweaked:

* you need to force it to build immediately the headers (--with-headers in commandline, yes the option is not documented);
* you need to merge before doing anything the packages pmake and freebsd-mk-defs; the latter has to be set ~x86-fbsd with package.keywords;
* you need to unset or set to safe values CFLAGS, CXXFLAGS, LDFLAGS and ASFLAGS, as they'll be used during crosscompile phases, too;
* it will fail to build freebsd-lib thus it won't be able to build c++ programs, and probably not even to link c programs correctly, it will just suffice to distcc c-only programs.

The reason of this is that freebsd-lib is not yet completely crosscompilable. I'll work on this so that it will be possible to get a full c++ compiler soon.

Okay, just to keep the head up on this while Planet still doesn't aggregate my blog, sigh.

Anyway, I was able to build freebsd-lib fine on Gentoo Linux AMD64, so I'm at step3 of the crossdev stages. It builds only crt* files, libc and libm, but they should be enough to get the stage4 building.

Unfortunately, it still doesn't work:

Code:

checking for main in -lm... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.
make: *** [configure-target-libstdc++-v3] Error 1

I'll ask Mike (vapier) for help later, I hope to get it to work soon.
The points above are still needed tho.