linux to freebsd cross compiler
I was trying to compile a gcc cross compiler for linux x86_64 (build and host) to freebsd x86_64.
I tried to follow this http://marcelog.github.io/articles/articles.html and then some other guides around the web, but I continue to get this:
Code:
Code:
...
make[3]: Leaving directory '/home/nick/Scaricati/build-gcc/x86_64-freebsd10.1/libgcc'
DEFINES='' HEADERS='' \
../../../gcc-4.9.2/libgcc/mkheader.sh > tmp-libgcc_tm.h
/bin/bash ../../../gcc-4.9.2/libgcc/../move-if-change tmp-libgcc_tm.h libgcc_tm.h
echo timestamp > libgcc_tm.stamp
/home/nick/Scaricati/build-gcc/./gcc/xgcc -B/home/nick/Scaricati/build-gcc/./gcc/ -B/usr/local/cross/x86_64-freebsd10.1/bin/ -B/usr/local/cross/x86_64-freebsd10.1/lib/ -isystem /usr/local/cross/x86_64-freebsd10.1/include -isystem /usr/local/cross/x86_64-freebsd10.1/sys-include -g -O2 -O2 -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fpic -pthread -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc -fpic -pthread -I. -I. -I../.././gcc -I../../../gcc-4.9.2/libgcc -I../../../gcc-4.9.2/libgcc/. -I../../../gcc-4.9.2/libgcc/../gcc -I../../../gcc-4.9.2/libgcc/../include -DHAVE_CC_TLS -o _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3 -c ../../../gcc-4.9.2/libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS
In file included from ../../../gcc-4.9.2/libgcc/../gcc/tsystem.h:44:0,
from ../../../gcc-4.9.2/libgcc/libgcc2.c:27:
/home/nick/Scaricati/build-gcc/gcc/include/stddef.h:56:24: fatal error: sys/_types.h: No such file or directory
#include <sys/_types.h>
^
compilation terminated.
Makefile:463: recipe for target '_muldi3.o' failed
make[2]: *** [_muldi3.o] Error 1
make[2]: Leaving directory '/home/nick/Scaricati/build-gcc/x86_64-freebsd10.1/libgcc'
Makefile:12757: recipe for target 'all-target-libgcc' failed
make[1]: *** [all-target-libgcc] Error 2
make[1]: Leaving directory '/home/nick/Scaricati/build-gcc'
Makefile:869: recipe for target 'all' failed
make: *** [all] Error 2
this is the lasts logs of make process of gcc-4.9.2 sources with TARGET=x86_64-freebsd10.1
what I'm doing wrong? Any ideas?
Re: linux to freebsd cross compiler
Code:
#include <sys/_types.h>
The problem is here. The compiler cannot find the file sys/_types.h. This is either because the compiler cannot find the directory sys within the defined include paths or within the sys directory the file _types.h does not exist.
Does the file _types.h exist on the system somewhere and if it does has the required include directories been specified properly?
Re: linux to freebsd cross compiler
Quote:
Originally Posted by
2kaud
Code:
#include <sys/_types.h>
The problem is here. The compiler cannot find the file sys/_types.h. This is either because the compiler cannot find the directory sys within the defined include paths or within the sys directory the file _types.h does not exist.
Does the file _types.h exist on the system somewhere and if it does has the required include directories been specified properly?
Yes, I know, and I found _types.h in /usr/include/freebsd/sys.
Now?
Re: linux to freebsd cross compiler
Quote:
Originally Posted by
NickF_93
Yes, I know, and I found _types.h in /usr/include/freebsd/sys.
Now?
Change the #include so it finds the path or set up the includes path to include this path.
Re: linux to freebsd cross compiler
Quote:
Originally Posted by
Arjay
Change the #include so it finds the path or set up the includes path to include this path.
Obviously this is not a good way because I'm building a program like gcc for another target.
However I found the solution and so, also, my error: I didn't set up properly sysroot.
I had to dowload (or take it from a build and working system) the target system on my machine and then I was able to set --with-sysroot in configuration process of binutils and gcc sources, and then run
$ make
and
# make install
And finally I got my toolchain! :D