LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices

Reply
 
Search this Thread
Old 01-28-2006, 01:18 AM   #1
newcomer4
LQ Newbie
 
Registered: Jan 2006
Posts: 21

Rep: Reputation: 15
Question Building gcc bootsrap compiler failure


Currently I am building GNU toolchain in linux for i386 host and target system.
Packages selected are :
binutils-2.14
gcc-4.0.2
glibc-2.3.6

For the initial setup, I have built kernel headers and binutils successfully. When I try to build bootstrap compiler , I get error.

Cofiguration command:
$../gcc-4.0.2/configure --target=$TARGET \
--prefix=${PREFIX} --without-headers --with-newlib \
--enable-languages=c

No error in configuration.

To build compiler:
$make all-gcc

Here the error comes.
............
............
.............
.........
......
.........
.......
......

TARGET_CPU_DEFAULT="" \
HEADERS="ansidecl.h" DEFINES="" \
/bin/sh ../../gcc-4.0.2/gcc/mkconfig.sh tconfig.h
/home/sowmya/embedded-linux/example/build-tools/build-boot-gcc/gcc/xgcc -B/home/sowmya/embedded-linux/example/build-tools/build-boot-gcc/gcc/ -B/home/sowmya/embedded-linux/example/tools/i386-linux/bin/ -B/home/sowmya/embedded-linux/example/tools/i386-linux/lib/ -isystem /home/sowmya/embedded-linux/example/tools/i386-linux/include -isystem /home/sowmya/embedded-linux/example/tools/i386-linux/sys-include -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -I. -I. -I../../gcc-4.0.2/gcc -I../../gcc-4.0.2/gcc/. -I../../gcc-4.0.2/gcc/../include -I../../gcc-4.0.2/gcc/../libcpp/include -g0 -finhibit-size-directive -fno-inline-functions -fno-exceptions -fno-zero-initialized-in-bss -fno-unit-at-a-time -fno-omit-frame-pointer \
-c ../../gcc-4.0.2/gcc/crtstuff.c -DCRT_BEGIN \
-o crtbegin.o
In file included from ../../gcc-4.0.2/gcc/crtstuff.c:64:
../../gcc-4.0.2/gcc/tsystem.h:90:19: error: stdio.h: No such file or directory
../../gcc-4.0.2/gcc/tsystem.h:93:23: error: sys/types.h: No such file or directory
../../gcc-4.0.2/gcc/tsystem.h:96:19: error: errno.h: No such file or directory
../../gcc-4.0.2/gcc/tsystem.h:103:20: error: string.h: No such file or directory
../../gcc-4.0.2/gcc/tsystem.h:104:20: error: stdlib.h: No such file or directory
../../gcc-4.0.2/gcc/tsystem.h:105:20: error: unistd.h: No such file or directory
../../gcc-4.0.2/gcc/tsystem.h:111:18: error: time.h: No such file or directory
make[1]: *** [crtbegin.o] Error 1
make[1]: Leaving directory `/home/sowmya/embedded-linux/example/build-tools/build-boot-gcc/gcc'
make: *** [all-gcc] Error 2


I am very much confused.....Plz help me out
 
Old 01-28-2006, 02:24 AM   #2
dombrowsky
Member
 
Registered: Dec 2005
Location: New York
Distribution: Debian/GNU
Posts: 235

Rep: Reputation: 31
I don't know what's going wrong, it could be anything. Trace it down to the exact command that's causing the error and figure out how to fix it. Then either edit the header file causing the error or the makefile.

and are you sure you don't want to 'make bootstrap'?
 
Old 01-28-2006, 03:39 AM   #3
ebonhand
LQ Newbie
 
Registered: Jan 2006
Location: Australia
Distribution: Linux From Scratch
Posts: 6

Rep: Reputation: 0
Additionally, the LFS book recommends a different directory structure than you're using to build the toolchain... perhaps investigate the early chapters of the LFS book again, where it instructs you on how to set things up..

- ebonhand
 
Old 01-30-2006, 05:21 AM   #4
newcomer4
LQ Newbie
 
Registered: Jan 2006
Posts: 21

Original Poster
Rep: Reputation: 15
Unhappy Struck again

When I gave make bootstrap, though it compiled properly, when I tried to install it using

make install

it asked for root permission. Wehn I issued same command as root, though it seems to install,when I look into bin dir(it is in my toolchain dir)I find -gcc.
Moreover, I fear that gcc version of the host might be corrupted.

What does that - imply in bin/-gcc ?
What to do for this ?
 
Old 01-30-2006, 02:25 PM   #5
dombrowsky
Member
 
Registered: Dec 2005
Location: New York
Distribution: Debian/GNU
Posts: 235

Rep: Reputation: 31
do a 'make check' first to test it and see if it compiled right.

and I've never heard it installing an executable named anything other than `gcc'.
 
Old 02-23-2006, 09:24 AM   #6
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Rep: Reputation: 35
I'm following LFS-6.1.1
In LFS I have Binutils-2.15.94.0.2.2
Then I try to build GCC-3.4.3 as described in the book, but get the following error:
Code:
- - - -
SHLIB_EXT='.so' \
SHLIB_MULTILIB='' \
SHLIB_MKMAP='../../gcc-3.4.3/gcc/mkmap-symver.awk' \
SHLIB_MKMAP_OPTS='' \
SHLIB_MAPFILES='../../gcc-3.4.3/gcc/libgcc-std.ver ../../gcc-3.4.3/gcc/config/libgcc-glibc.ver' \
SHLIB_NM_FLAGS='-pg' \
MULTILIB_OSDIRNAMES='' \
mkinstalldirs='/bin/sh ../../gcc-3.4.3/gcc/mkinstalldirs' \
  /bin/sh mklibgcc > tmp-libgcc.mk
mv tmp-libgcc.mk libgcc.mk
TARGET_CPU_DEFAULT="" \
HEADERS="ansidecl.h" DEFINES="" \
/bin/sh ../../gcc-3.4.3/gcc/mkconfig.sh tconfig.h
./xgcc -B./ -B/tools/i686-pc-linux-gnu/bin/ -isystem /tools/i686-pc-linux-gnu/include -isystem /tools/i686-pc-linux-gnu/sys-include -L/home/lfs/lfs/sources/gcc-build/gcc/../ld -O2 -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -I. -I. -I../../gcc-3.4.3/gcc -I../../gcc-3.4.3/gcc/. -I../../gcc-3.4.3/gcc/../include   -g0 -finhibit-size-directive -fno-inline-functions -fno-exceptions -fno-zero-initialized-in-bss -fno-unit-at-a-time -fno-omit-frame-pointer \
   -c ../../gcc-3.4.3/gcc/crtstuff.c -DCRT_BEGIN \
  -o crtbegin.o
In file included from ../../gcc-3.4.3/gcc/crtstuff.c:62:
../../gcc-3.4.3/gcc/tsystem.h:79:19: stdio.h: No such file or directory
../../gcc-3.4.3/gcc/tsystem.h:82:23: sys/types.h: No such file or directory
../../gcc-3.4.3/gcc/tsystem.h:85:19: errno.h: No such file or directory
../../gcc-3.4.3/gcc/tsystem.h:92:20: string.h: No such file or directory
../../gcc-3.4.3/gcc/tsystem.h:93:20: stdlib.h: No such file or directory
../../gcc-3.4.3/gcc/tsystem.h:94:20: unistd.h: No such file or directory
In file included from ./include/syslimits.h:7,
                 from ./include/limits.h:11,
                 from ../../gcc-3.4.3/gcc/tsystem.h:97,
                 from ../../gcc-3.4.3/gcc/crtstuff.c:62:
./include/limits.h:122:61: limits.h: No such file or directory
In file included from ../../gcc-3.4.3/gcc/crtstuff.c:62:
../../gcc-3.4.3/gcc/tsystem.h:100:18: time.h: No such file or directory
make[2]: *** [crtbegin.o] Error 1
make[2]: Leaving directory `/mnt/lfs/sources/gcc-build/gcc'
make[1]: *** [stage1_build] Error 2
make[1]: Leaving directory `/mnt/lfs/sources/gcc-build/gcc'
make: *** [bootstrap] Error 2
lfs:~/lfs/sources/gcc-build$
This is really stupid, because I don't understand why does it look in ../../gcc
I'm building outside sources, I also have tried to build within gcc-3.4.3/BUILD dir (created by myself), but there was the same error.

Thanks.
 
Old 02-23-2006, 12:37 PM   #7
FinalFantasy
Member
 
Registered: Sep 2003
Location: UK
Distribution: CLFS-32bit-x86 / LFS-SVN-20060210
Posts: 49

Rep: Reputation: Disabled
Use binutils 2.16.1 instead. the 2.15.94.0.2.2 one causes a lot of problems according to my experiences.

For you problem, I suggest to start again. I had this problem before and after I repeat , the problem is not there anymore. I must mistype something in my first time.
 
Old 02-23-2006, 08:45 PM   #8
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Rep: Reputation: 35
----------

Last edited by kornerr; 02-23-2006 at 08:52 PM.
 
Old 02-23-2006, 09:35 PM   #9
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Rep: Reputation: 35
I've tried binutils-2.6.1, but still get the same error!
I even tried just to do "make" instead of "make bootstrap", but the same error occurs!
What to do?

Thanks.
 
Old 02-24-2006, 04:23 PM   #10
FinalFantasy
Member
 
Registered: Sep 2003
Location: UK
Distribution: CLFS-32bit-x86 / LFS-SVN-20060210
Posts: 49

Rep: Reputation: Disabled
I don't have any idea.

Do you copied the libc-linux-headers from your host system or from the package?
Another possible reason would be that you did not patch correctly.
 
Old 02-24-2006, 07:54 PM   #11
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Rep: Reputation: 35
Well, for now I succeeded with GCC-3.3.4, but I applied only one patch for 3.4.3 which fixes ld location...
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Building compiler from source corbis_demon Programming 2 06-08-2005 08:34 AM
Building cross-compiler gcc for powerpc-linux ccool Linux - General 3 09-17-2004 06:33 AM
GCC Compiler HELP Otaking Linux - Newbie 5 04-08-2004 06:17 PM
Building an ARM7 cross compiler from gcc Charlie_B Linux - Software 2 08-20-2003 08:59 AM
Building GCC natesch Linux - Newbie 4 05-09-2002 12:38 AM


All times are GMT -5. The time now is 11:15 AM.

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 Google+: linuxquestions
Open Source Consulting | Domain Registration