LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 11-26-2009, 02:29 PM   #1
dbbolton
LQ Newbie
 
Registered: Sep 2009
Location: WV
Distribution: Debian
Posts: 28

Rep: Reputation: 15
Building GCC for LFS


I am currently on chapter 5.5 of LFS, the first GCC pass. I ran the configure script as follows:

Code:
./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
Then I got this error from make:

Code:
make[2]: Leaving directory `/mnt/lfs/gcc-build/gcc-4.4.2/host-x86_64-unknown-linux-gnu/mpfr'                                                                    
make[2]: Entering directory `/mnt/lfs/gcc-build/gcc-4.4.2/host-x86_64-unknown-linux-gnu/mpfr'                                                                   
make[2]: *** No rule to make target `@MAINTAINER_MODE_TRUE@', needed by `../.././mpfr/Makefile.in'.  Stop.                                                      
make[2]: Leaving directory `/mnt/lfs/gcc-build/gcc-4.4.2/host-x86_64-unknown-linux-gnu/mpfr'                                                                    
make[1]: *** [all-mpfr] Error 2                                                 
make[1]: Leaving directory `/mnt/lfs/gcc-build/gcc-4.4.2'                       
make: *** [all] Error 2
I tried googling the error but I couldn't find this specific problem.
 
Old 11-26-2009, 02:51 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,516

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Welcome to LQ.

And which version of LFS ?
http://www.linuxfromscratch.org/lfs/...skforhelp.html
..the essential things to include in any request for help are
..The version of the book being used ..
( § 1.5.1. )
 
1 members found this post helpful.
Old 11-26-2009, 02:59 PM   #3
dbbolton
LQ Newbie
 
Registered: Sep 2009
Location: WV
Distribution: Debian
Posts: 28

Original Poster
Rep: Reputation: 15
Thanks for the reply.

- development version of LFS
- Debian testing (with only a few packages from unstable)

Code:
./version-check.sh                                               
bash, version 4.0.28(1)-release                                                 
/bin/sh -> /bin/dash
Binutils: (GNU Binutils for Debian) 2.20
./version-check.sh: line 9: bison: command not found
yacc not found
bzip2,  Version 1.0.5, 10-Dec-2007.
Coreutils:  7.4
diff (GNU diffutils) 2.8.1
find (GNU findutils) 4.4.2
GNU Awk 3.1.6
/usr/bin/awk -> /usr/bin/gawk
gcc (Debian 4.3.4-6) 4.3.4
GNU C Library (EGLIBC) stable release version
GNU grep 2.5.4
gzip 1.3.12
Linux version 2.6.31-dbb-deb (2.6.31) (root@ganymed) (gcc version 4.3.4 (Debian 4.3.4-5) ) #1 SMP PREEMPT Tue Oct 27 02:39:01 EDT 2009
m4 (GNU M4) 1.4.13
GNU Make 3.81
patch 2.5.9
Perl version='5.10.1';
GNU sed version 4.2.1
tar (GNU tar) 1.22
makeinfo (GNU texinfo) 4.13
Compilation OK
I didn't intentionally deviate from the book, but it's possible that I messed up somewhere.
 
Old 11-26-2009, 03:44 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,516

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
I think you need a build directory outside gcc-4.4.2/
Quote:
The GCC documentation recommends building GCC outside
of the source directory in a dedicated build directory
Hence this configure line : ../gcc-4.4.2/configure..............

The recommandation can be read as it isn't important,
but not doing it will cause problems.

The same goes for binutils, better start from scratch again.
.....

Seems you are missing 'bison' on your Debian ?
.....

Last edited by knudfl; 11-26-2009 at 03:48 PM.
 
Old 11-26-2009, 03:58 PM   #5
dbbolton
LQ Newbie
 
Registered: Sep 2009
Location: WV
Distribution: Debian
Posts: 28

Original Poster
Rep: Reputation: 15
I thought I set up the build directories correctly:

Code:
lfs@ganymed:~$ cd $LFS

lfs@ganymed:/mnt/lfs$ ls
binutils-build  gcc-build  sources  tools

lfs@ganymed:/mnt/lfs$ ls binutils-build/
binutils-2.20  binutils-2.20.tar.bz2

lfs@ganymed:/mnt/lfs$ ls gcc-build/
gcc-4.4.2  gcc-4.4.2.tar.bz2
I just installed bison 2.4.1.dfsg-3.
 
Old 11-26-2009, 05:09 PM   #6
10110111
Member
 
Registered: Jun 2008
Location: St.-Petersburg, Russia
Distribution: (B)LFS, Ubuntu, SliTaz
Posts: 403

Rep: Reputation: 51
Quote:
lfs@ganymed:/mnt/lfs$ ls gcc-build/
gcc-4.4.2 gcc-4.4.2.tar.bz2
This is incorrect.

You should read this page first: http://www.linuxfromscratch.org/lfs/...roduction.html
For some reason this very important notice was eliminated after LFS 6.3. I couldn't find it in development version of LFS, though it used to be in 6.3:
Quote:
Important
Before issuing the build instructions for a package, the package should be unpacked as user lfs, and a cd into the created directory should be performed. The build instructions assume that the bash shell is in use.
This means that
Code:
mkdir -v ../gcc-build
cd ../gcc-build
commands as well as previous ones on the page should be done in the gcc-4.4.2 directory.
You have to start building from scratch.

Last edited by 10110111; 11-26-2009 at 05:14 PM.
 
1 members found this post helpful.
Old 11-26-2009, 05:12 PM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,516

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
It's just that your configure line looks wrong.

cd gcc-build/

and then do

../gcc-4.4.2/configure.....

and do not do

./configure.....

.....

Last edited by knudfl; 11-27-2009 at 06:12 AM.
 
Old 11-26-2009, 05:48 PM   #8
dbbolton
LQ Newbie
 
Registered: Sep 2009
Location: WV
Distribution: Debian
Posts: 28

Original Poster
Rep: Reputation: 15
So, if I understand correctly, I must create an empty directory, change to that empty directory, and then execute configure from within that directory.
 
Old 11-26-2009, 06:20 PM   #9
10110111
Member
 
Registered: Jun 2008
Location: St.-Petersburg, Russia
Distribution: (B)LFS, Ubuntu, SliTaz
Posts: 403

Rep: Reputation: 51
Yes. Just follow the book. After you extracted the package and made cd to its directory you can execute the commands from the page about that package and, ideally, no extra commands should be needed.
 
1 members found this post helpful.
Old 11-27-2009, 03:35 AM   #10
JohnGraham
Member
 
Registered: Oct 2009
Posts: 467

Rep: Reputation: 139Reputation: 139
Quote:
Originally Posted by dbbolton View Post
So, if I understand correctly, I must create an empty directory, change to that empty directory, and then execute configure from within that directory.
Yes - also, the second directory (i.e. the one you change to in order to run the configure script) should not be a subdirectory of the source directory.
 
  


Reply

Tags
gcc, lfs, make



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
error using lfs while compiling lfs book's 6.12 (gcc-4.1.2) section aditya_gpch Linux From Scratch 3 04-24-2008 04:23 PM
Building 64bit LFS currir55 Linux From Scratch 1 11-15-2005 03:47 PM
Building LFS on a Pocket PC Immolo Linux From Scratch 0 05-21-2004 04:51 AM
building LFS GCC question citrus Linux From Scratch 6 05-12-2004 08:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:16 PM.

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