LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 05-11-2010, 10:20 AM   #1
kc3
Member
 
Registered: Jun 2009
Distribution: Linux from Scratch
Posts: 172

Rep: Reputation: 35
Just stating out, gcc issues


Okay, everytime I've attempted this I keep getting problems compiling gcc and I can't get it to work, someone please help

Quote:
defaults.h" DEFINES="UCLIBC_DEFAULT=0" \
/bin/sh ../../gcc-4.4.3/gcc/mkconfig.sh tm.h
gawk -f ../../gcc-4.4.3/gcc/opt-gather.awk ../../gcc-4.4.3/gcc/ada/gcc-interface/lang.opt ../../gcc-4.4.3/gcc/fortran/lang.opt ../../gcc-4.4.3/gcc/java/lang.opt ../../gcc-4.4.3/gcc/c.opt ../../gcc-4.4.3/gcc/common.opt ../../gcc-4.4.3/gcc/config/i386/i386.opt ../../gcc-4.4.3/gcc/config/linux.opt > tmp-optionlist
/bin/sh ../../gcc-4.4.3/gcc/../move-if-change tmp-optionlist optionlist
echo timestamp > s-options
gawk -f ../../gcc-4.4.3/gcc/opt-functions.awk -f ../../gcc-4.4.3/gcc/opth-gen.awk \
< optionlist > tmp-options.h
/bin/sh ../../gcc-4.4.3/gcc/../move-if-change tmp-options.h options.h
echo timestamp > s-options-h
TARGET_CPU_DEFAULT="" \
HEADERS="auto-host.h ansidecl.h" DEFINES="" \
/bin/sh ../../gcc-4.4.3/gcc/mkconfig.sh bconfig.h
gcc -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wcast-qual -Wold-style-definition -Wc++-compat -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I../../gcc-4.4.3/gcc -I../../gcc-4.4.3/gcc/build -I../../gcc-4.4.3/gcc/../include -I../../gcc-4.4.3/gcc/../libcpp/include -I../../gcc-4.4.3/gcc/../libdecnumber -I../../gcc-4.4.3/gcc/../libdecnumber/dpd -I../libdecnumber -o build/errors.o ../../gcc-4.4.3/gcc/errors.c
build/genmodes -h > tmp-modes.h
/bin/sh: build/genmodes: No such file or directory
make[2]: *** [s-modes-h] Error 127
make[2]: Leaving directory `/mnt/lfs/tools/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/mnt/lfs/tools'
make: *** [all] Error 2
lfs:/mnt/lfs/tools$
There's a lot more text but the forums won't let me post that long of a post so I hope this is enough.

Last edited by kc3; 05-11-2010 at 06:25 PM.
 
Old 05-11-2010, 01:16 PM   #2
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Hi,

please always post which version you are trying to build and which chapter you are. I assume LFS 6.6 chapter 5.5.1? Also post which commands you issued, i.e. as you typed them into the console. Do not just copy+paste them from the book. It is also better to just post the last 20 lines of the log before the error occurred. The rest of the log can be uploaded as attachment if necessary.

As for your problem it appears that you used /mnt/lfs/tools/ as build directory. You are not supposed to do that. You should keep the source in /mnt/lfs/sources/gcc/ and compile gcc in /mnt/lfs/sources/gcc-build/.
 
Old 05-11-2010, 06:24 PM   #3
kc3
Member
 
Registered: Jun 2009
Distribution: Linux from Scratch
Posts: 172

Original Poster
Rep: Reputation: 35
Oh okay, sorry about all the text... So I tried it again, would what directory I have it in really change if it works or not? Anyways this is what I typed
Quote:
lfs:/mnt/lfs/sources/gcc-build$ ./configure \
> --target=$LFS_TGT --prefix=/tools \
> --disable-nls --disable-shared --disable-multilib \
> --disable-decimal-float --disable-threads \
> --disable-libmudflap --disable-libssp \
> --disable-libgomp --enable-languages=c
and so far that worked, than I tried just make and this is now the output
Quote:
c-linux-gnu/gcc/xgcc -B/mnt/lfs/sources/gcc-build/host-i686-pc-linux-gnu/gcc/ -B/tools/i686-lfs-linux-gnu/bin/ -B/tools/i686-lfs-linux-gnu/lib/ -isystem /tools/i686-lfs-linux-gnu/include -isystem /tools/i686-lfs-linux-gnu/sys-include -E
checking whether decimal floating point is supported... no
checking whether fixed-point is supported... no
checking for __attribute__((visibility("hidden")))... yes
checking whether the target assembler supports thread-local storage... yes
updating cache ./config.cache
configure: creating ./config.status
config.status: creating Makefile
config.status: executing default commands
make[2]: Entering directory `/mnt/lfs/sources/gcc-build/i686-lfs-linux-gnu/libgcc'
Makefile:143: ../.././gcc/libgcc.mvars: No such file or directory
make[2]: *** No rule to make target `../.././gcc/libgcc.mvars'. Stop.
make[2]: Leaving directory `/mnt/lfs/sources/gcc-build/i686-lfs-linux-gnu/libgcc'
make[1]: *** [all-target-libgcc] Error 2
make[1]: Leaving directory `/mnt/lfs/sources/gcc-build'
make: *** [all] Error 2
And yes I am in chapter 5.5.1 of the 6.6 version. Also for where to build it the book says outside the source directory in it's own directory and well, I did that one too and it still didn't work, I had tried different three directories and none worked.

Last edited by kc3; 05-11-2010 at 06:40 PM.
 
Old 05-11-2010, 06:42 PM   #4
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Hi,

did you also untar mpfr and gmp in gcc's source directory before you executed configure? Which host system are you using? If it is not the liveCD, have you checked all the requirements?

Also, when you build binutils in the previous chapter, did you also use /mnt/lfs/tools as build directory?
 
Old 05-11-2010, 06:53 PM   #5
kc3
Member
 
Registered: Jun 2009
Distribution: Linux from Scratch
Posts: 172

Original Poster
Rep: Reputation: 35
Quote:
Originally Posted by crts View Post
Hi,

did you also untar mpfr and gmp in gcc's source directory before you executed configure? Which host system are you using? If it is not the liveCD, have you checked all the requirements?

Also, when you build binutils in the previous chapter, did you also use /mnt/lfs/tools as build directory?
No I didn't use that as the build directory, I'm using Slackware 13 as the host system and I did check and yes gmp and mpfr are in the gcc directory
 
Old 05-11-2010, 07:17 PM   #6
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Quote:
Originally Posted by kc3 View Post
No I didn't use that as the build directory, I'm using Slackware 13 as the host system and I did check and yes gmp and mpfr are in the gcc directory
Ok, however since you used /mnt/lfs/tools as build directory it is probably corrupted. So it is best to start completely over with chapter 5, reformating the build partition. Make sure you have a copy of the source-tars on another partition available.
Only use /lfs/mnt/sources/ to keep your source and build directories in, e.g. binutils's source resides in
/mnt/lfs/binutils-2.20/
and the build directory
/mnt/lfs/binutils-build/
If you make a mistake always start with a fresh untarred source of the package and a fresh build directory - if one is needed for that package.

In the meantime you can upload the output of the configure script as attachment. Not sure if your error is a follow-up of trying to recompile gcc from a 'used' source or if something else is up.
 
Old 05-11-2010, 07:21 PM   #7
kc3
Member
 
Registered: Jun 2009
Distribution: Linux from Scratch
Posts: 172

Original Poster
Rep: Reputation: 35
Okay, I will try that, thanks

[Update] Yep that worked, I appreciate the help

Last edited by kc3; 05-11-2010 at 08:06 PM.
 
Old 02-28-2015, 04:06 AM   #8
shaddoo@gmail.com
LQ Newbie
 
Registered: Feb 2015
Posts: 1

Rep: Reputation: Disabled
build/genmodes not found error while compiling gcc

After extracting gcc the folder structure will be as follows
gcc-4.4.6
gcc-4.4.6/gcc

If you directly go inside gcc-4.4.6/gcc and try to do ./configure and compile(make) from there then you will encounter below problem
build/genmodes -h > tmp-modes.h
/bin/sh: build/genmodes: No such file or directory

Solution is do ./configure and make from gcc-4.4.6 and no errors will be shown related to genmodes. This will compile all modules including gcc. You may have to install mpfr and gmp modules which are needed by gcc if any error shown by ./configure
 
  


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
Geforce FX 5200 stating unknown since the livna drivers almost000 Fedora 13 08-03-2007 09:52 PM
problem in stating httpd service!! mhmo Linux - Software 10 03-23-2007 11:18 PM
Apache 2.2 error log stating file doesnt exist, when it clearly does. sarina1975 Linux - General 5 08-20-2006 05:56 PM
Microsoft stating the obvious acid_kewpie General 22 07-29-2002 09:15 AM
Stating the cron goochable Linux - Newbie 1 04-14-2001 03:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 03:26 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