LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 05-17-2010, 03:09 PM   #1
ecco_the_dolphin
LQ Newbie
 
Registered: Nov 2009
Posts: 1

Rep: Reputation: 0
cannot compile cross-gcc for arm


I am trying to build cross-toolchain for arm. I dont want ready-to-use solution. I want my own . I want to build toolchain manually, but I cannot compile gcc. When I invoke "make" I get the following error:
Code:
-c ../../../../src/gcc-4.4.2/libgcc/../gcc/config/arm/lib1funcs.asm -include _arm_addsubsf3.vis
/home/ecco/Progs/cross-compilers/build/arm-linux/build/build-gcc/./gcc/xgcc -B/home/ecco/Progs/cross-compilers/build/arm-linux/build/build-gcc/./gcc/ -B/home/ecco/Progs/cross-compilers/result/arm-linux/arm-linux/bin/ -B/home/ecco/Progs/cross-compilers/result/arm-linux/arm-linux/lib/ -isystem /home/ecco/Progs/cross-compilers/result/arm-linux/arm-linux/include -isystem /home/ecco/Progs/cross-compilers/result/arm-linux/arm-linux/sys-include -g -O2 -O2  -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wcast-qual -Wold-style-definition  -isystem ./include  -fomit-frame-pointer -fPIC  -Wno-missing-prototypes -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED   -I. -I. -I../.././gcc -I../../../../src/gcc-4.4.2/libgcc -I../../../../src/gcc-4.4.2/libgcc/. -I../../../../src/gcc-4.4.2/libgcc/../gcc -I../../../../src/gcc-4.4.2/libgcc/../include  -DHAVE_CC_TLS -o _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3 -c ../../../../src/gcc-4.4.2/libgcc/../gcc/libgcc2.c \
	  -fvisibility=hidden -DHIDE_EXPORTS
In file included from ../../../../src/gcc-4.4.2/libgcc/../gcc/libgcc2.c:29:
../../../../src/gcc-4.4.2/libgcc/../gcc/tsystem.h:87:19: error: stdio.h: No such file or directory
../../../../src/gcc-4.4.2/libgcc/../gcc/tsystem.h:90:23: error: sys/types.h: No such file or directory
../../../../src/gcc-4.4.2/libgcc/../gcc/tsystem.h:93:19: error: errno.h: No such file or directory
../../../../src/gcc-4.4.2/libgcc/../gcc/tsystem.h:100:20: error: string.h: No such file or directory
../../../../src/gcc-4.4.2/libgcc/../gcc/tsystem.h:101:20: error: stdlib.h: No such file or directory
../../../../src/gcc-4.4.2/libgcc/../gcc/tsystem.h:102:20: error: unistd.h: No such file or directory
../../../../src/gcc-4.4.2/libgcc/../gcc/tsystem.h:108:18: error: time.h: No such file or directory
make[2]: *** [_muldi3.o] Error 1
make[2]: Leaving directory `/home/ecco/Progs/cross-compilers/build/arm-linux/build/build-gcc/arm-linux/libgcc'
make[1]: *** [all-target-libgcc] Error 2
make[1]: Leaving directory `/home/ecco/Progs/cross-compilers/build/arm-linux/build/build-gcc'
make: *** [all] Error 2
Here is more detailed description of what I have and what I am doing:
I have gentoo box and source code of binutils-2.20.1,glibc-2.11,linux-2.6.33.4,gcc-4.4.2.

First I build binutils:
Code:
../../src/binutils-2.20.1/configure --target=arm-linux --prefix=~/Progs/cross-compilers/result/arm-linux --disable-nls
make
make install
So, my binutils for arm are in /home/ecco/Progs/cross-compilers/result/arm-linux/bin/

Then, I get header files of linux kernel for my target (AFAIK I need my targets kernel header files to build cross compiler):
Code:
..
cd linux-2.6.33.4/
make ARCH=arm menuconfig
make headers_install
mkdir ../kernel_headers_2.6.33.4
cp -dR /home/ecco/Progs/cross-compilers/build/arm-linux/src/linux-2.6.33.4/usr/* ../kernel_headers_2.6.33.4
So, I have a copy of kernel headers in ~/Progs/cross-compilers/build/arm-linux/src/kernel_headers_2.6.33.4

Then, I try to build gcc:
Code:
../../src/gcc-4.4.2/configure --target=arm-linux --enable-languages=c -- prefix=/home/ecco/Progs/cross-compilers/result/arm-linux --with-headers=../../src/kernel_headers_2.6.33.4/include/
make
Make fails...

The funny thing is that my arm-linux-gcc is actually can be built. When I do the following:
Code:
make all-gcc
make install
I get my arm-linux-gcc in ~/Progs/cross-compilers/result/arm-linux. So I can compile kernel , but I want user-space , so I do:
Code:
make all-target-libgcc
Make fails when it tries to build libgcc (AFAIK I need libgcc to build glibc).

But why does it fails? I have header files like "stdio.h" on my gentoo box. Maybe compiler somehow wants files like "stdio.h" for my TARGET (arm-linux)? But AFAIK these are files are Standart C Library header files, and glibc did not even compiled yet, so I dont have these headers for my TARGET...

I found description of this error here: http://www.ailis.de/~k/archives/19-A...html#toolchain (gcc part). But when I add additional flags -Dinhibit_libc -D__gthr_posix_h, then make fails when it tries to compile ../gcc-4.4.2/gcc/crtstuff.c with the same errors.

Could someone explain whats the hell is going on?

Last edited by ecco_the_dolphin; 05-17-2010 at 03:31 PM.
 
Old 05-24-2010, 05:02 PM   #2
mpapet
Member
 
Registered: Nov 2003
Location: Los Angeles
Distribution: debian
Posts: 370

Rep: Reputation: 41
It could be failing because you don't have the ARM version of the headers.

Just use buildroot. You are just duplicating their (really hard) work.

http://www.buildroot.org/
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help to cross compile vlc to arm 4monkeys Linux - Embedded 3 03-14-2011 05:33 AM
Trying to cross-compile mono for ARM hal_2001 Programming 2 05-11-2010 03:18 PM
how to cross compile tslib for arm ? sunr2007 Linux - Embedded 3 06-29-2009 12:41 AM
Compile the linux2.6.14.1 for arm must ues the arm-linux-gcc-3.4.4? frankyue Linux - Embedded 2 12-20-2008 07:28 AM
Gcc 4.3.0 cross compilation for arm is failing bhagat_singh Linux - Software 2 07-10-2008 02:38 PM


All times are GMT -5. The time now is 12:02 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration