LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-13-2015, 09:48 PM   #1
NickF_93
LQ Newbie
 
Registered: Mar 2015
Posts: 6

Rep: Reputation: Disabled
Unhappy 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:
...
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?
 
Old 03-18-2015, 10:34 AM   #2
NickF_93
LQ Newbie
 
Registered: Mar 2015
Posts: 6

Original Poster
Rep: Reputation: Disabled
Solved.

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!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cross compiler for power PC on Linux psmurthy Linux - Software 1 09-22-2010 02:32 PM
linux arm cross compiler habeshkumar Linux - Software 4 07-26-2010 07:52 AM
My c compiler doesn't work after the cross-compiler installed heracles.cn Linux - Newbie 1 06-05-2007 03:55 AM
windows to linux cross-compiler back2morrie Linux - General 8 07-13-2005 03:15 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration