LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 09-22-2006, 06:43 PM   #1
Southpaw76
Member
 
Registered: Dec 2005
Distribution: Slackware-13
Posts: 146

Rep: Reputation: 15
Is anyone having problems with "gcc 1st pass"???


Hello all,
on my ever-expanding quest for Linux knowledge I've been giving LFS a shot. Being that I've used Gentoo for a couple of years and I have become a bit comfortable with re-building, re-compiling, and re-installing system software I figured diving into LFS would be my next logical step in learning more about how Linux really works.
So, I'm using a test box for this since I can't afford to be without a fully functional box for any prolonged period of time. This PC is a ...
Code:
HP Pavillion 734n
AMD Athlon-XP 2400+ (2GHz)
512Mb PC2100 DDR RAM (266MHz)
20Gb Seagate HDD
NVidia GeForce MX420 AGP4x graphics card
RealTek RTL8139+ Integrated ethernet port
I've used this box for plenty of FreeBSD, Slackware, and Gentoo installations, so I know it works
So I'm at the beginning of chapter 5, I've already installed Binutils-2.16.1, and I'm in the process of attempting to install GCC-4.0.3 on it's "first pass". Btw, I forgot to mention that I'm using the LFS LiveCD v6.2-3 as my host system and yes I have been reading the necessary hints. I keep getting different errors either after ../gcc-4.0.3/configure, or during make bootstrap. Everytime this happens I wipe my drive, go back to the beginning, and start all over again just to make sure that I haven't missed anything.
I've read on other threads that this version of GCC is a bit buggy and that it would be better to use version GCC-4.1.1. Is there any truth to that??
Has anyone else had any problems installing or compiling with version 4.0.3??
If so, is it possible for me to use a different version GCC or will that throw the rest of the install out of wack??? Since the handbook is written with using GCC-4.0.3...
 
Old 09-24-2006, 11:41 AM   #2
Axalon
LQ Newbie
 
Registered: May 2006
Distribution: Archlinux, LFS 6.2
Posts: 20

Rep: Reputation: 0
Could you give us the error message your getting?
 
Old 09-24-2006, 09:20 PM   #3
Southpaw76
Member
 
Registered: Dec 2005
Distribution: Slackware-13
Posts: 146

Original Poster
Rep: Reputation: 15
I'm sorry about that, it's just that I've started over so many times now and the error keeps popping up during the "make bootstrap" of GCC. I guess I just wanted to make sure that it wasn't a typo error on my part. Anyway, upon the most recent attempt, "make bootstrap" exited with this to say...
Code:
ranlib libbackend.a: No space left on device
make[2]: [libbackend.a] Error 1 (ignored)
...of course, there a bunch of cflags and what not. I wasn't sure if I needed to include that or if the error's themselves were enough, let me know...
Code:
collect2: ld returned 1 exit status
make[2]: *** [cc1] Error 1
make[2]: Leaving directory `/mnt/gcc-build/gcc'
make[1]: *** [stage1_build] Error2
make[1]: Leaving directory `/mnt/gcc-build/gcc'
make: *** [bootstrap] Error 2
...as I said earlier, no matter how many times I try this from the beginning, I seem to keep running into similar errors...
 
Old 09-24-2006, 10:09 PM   #4
Axalon
LQ Newbie
 
Registered: May 2006
Distribution: Archlinux, LFS 6.2
Posts: 20

Rep: Reputation: 0
Quote:
Originally Posted by Southpaw76
Code:
ranlib libbackend.a: No space left on device)
Code:
make[2]: Leaving directory `/mnt/gcc-build/gcc'
I'm curious, where did you mount your root partition (the one where LFS will eventually be installed on)? The directions say to mount it to /mnt/lfs, yet I see here that the gcc-build folder is in /mnt, not /mnt/lfs/sources. It could be that GCC isn't being built on the mounted partition, but on the ramdisk, which would explain the error "No space left on device". Your problem could be that there's not enough room on the ramdisk to accomodate all the files created during compilation. Make sure that everything is on the hard disk partition you prepared, NOT on the ramdisk.

To be a little more clear:

If you follow the instructions in the LFS book by the letter, you should have all your source tarballs in /mnt/lfs/sources and should be extracting them in this dir (ie: when building gcc, the source dir should be /mnt/lfs/sources/gcc-4.0.3). When you create the separate build dir, it should STILL be in /mnt/lfs/sources, so the path to the gcc-build dir should be /mnt/lfs/sources/gcc-build.

Hope this solves your issue.

However, if this is not the case, then I don't know. Post the error message in its entirety if so and I'll see what I can do.

Last edited by Axalon; 09-24-2006 at 10:13 PM.
 
Old 09-24-2006, 11:04 PM   #5
Southpaw76
Member
 
Registered: Dec 2005
Distribution: Slackware-13
Posts: 146

Original Poster
Rep: Reputation: 15
See that's just it, I have been following the book to the letter and I may have stumbled upon an error here. You say that...
Quote:
If you follow the instructions in the LFS book by the letter, you should have all your source tarballs in /mnt/lfs/sources
When in the book it says...
Quote:
To create this directory, execute the following command, as user root, before starting the download session:

mkdir -v $LFS/sources
...But on the LiveCD the tarballs are located under "/lfs-sources", not much of a big deal but it threw me off a little bit at first. However, when we get to the part where I start creating the build directories it says to "cd" into "/mnt/lfs", no problem, but then it says...
Quote:
mkdir -v ../binutils-build
cd ../binutils-build
...which, correct me if I'm wrong but if I'm in "/mnt/lfs", and I cd into ../binutils-build, wouldn't that put me in /mnt/binutils-build as opposed /mnt/lfs/binutils-build.

However, on the other hand, according to what your saying I should really be under /mnt/lfs/lfs-sources/binutils-build or in my case /mnt/lfs/lfs-sources/gcc-build.

If this is the case and youre right about this being a possible ramdisk issue (which makes perfect sense to me now, btw), then do you mind browsing through the beginning chapters of the LFS Book to confirm or deny whether this is in fact an erroneous typo on the authors part or just a simple misunderstanding on my part.

I'll be sure to try reinstalling this again tomorrow after I get home from work, thanx.
 
Old 09-25-2006, 05:21 AM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Quote:
When in the book it says...
To create this directory, execute the following command, as user root, before starting the download session:
mkdir -v $LFS/sources
...But on the LiveCD the tarballs are located under "/lfs-sources", not much of a big deal but it threw me off a little bit at first.
You should copy the packages and patches from /lfs-sources to $LFS/sources (after creating $LFS/sources) as stated in the LFS documentation (chapter 3.1, the paragraph that starts with Downloaded packages and patches will need to be stored somewhere ...

Quote:
However, when we get to the part where I start creating the build directories it says to "cd" into "/mnt/lfs", no problem, but then it says...
mkdir -v ../binutils-build
cd ../binutils-build

...which, correct me if I'm wrong but if I'm in "/mnt/lfs", and I cd into ../binutils-build, wouldn't that put me in /mnt/binutils-build as opposed /mnt/lfs/binutils-build.
The LFS documentation assumes that you unpacked the package and are in the newly created directory. This is assumed for all packages (unless stated otherwise).

I.E:
cd $LFS/sources
tar jxf <packages.tar.bz2>
cd <package>

---- the book starts here with the specific commands, previous 3 lines are assumed ---

In case of binutils you are now in $LFS/sources/binutils-2.1.6 and can start with the commands that are shown in the documentation:

mkdir -v ../package-build
cd ../package-build
....
....

Hope this clears things up a bit.
 
Old 09-25-2006, 05:59 PM   #7
Southpaw76
Member
 
Registered: Dec 2005
Distribution: Slackware-13
Posts: 146

Original Poster
Rep: Reputation: 15
Excellent, that was the ticket guys, it's working beautifully thanx .
My next question before I go to do some compiling is...
When I'm done compiling each package, I believe it says in the book to delete the "package-build" directory and its source directory.. Does this mean that I delete the untarred package directory as well??? Thanx again guys...
 
Old 09-25-2006, 08:26 PM   #8
Axalon
LQ Newbie
 
Registered: May 2006
Distribution: Archlinux, LFS 6.2
Posts: 20

Rep: Reputation: 0
Yeah, like say when you're done compiling GCC, you would delete the gcc-4.0.3 and the gcc-build dirs.

Don't delete the tarballs though, you need those for Chapter 6.

PS: As a recommendation for when you get there, don't remove the linux kernel source directory when you're done (they're necessary to compile kernel modules, most notably the ATI/nVidia binary drivers). Also, to make your system a little tidier, I would recommend untarring and compiling the kernel in /usr/src, so you don't need to keep the /sources dir lying around (in the "make modules_install" command, there are symlinks created in the /lib/modules and /lib/modules/<kernel_version> directory pointing to the linux kernel source directory. If you were compiling in the /sources dir, those links would point to /sources/linux-<version> and it would be better organized to have those links pointing to /usr/src/linux-<version>.)
 
  


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
Porting to Fedora gcc 4.0 -parsing backward slash("\") comma(",") code_blew Programming 1 04-26-2006 04:07 PM
Error Compiling GCC (1st Pass) in LFS 6.0 TGWDNGHN Linux From Scratch 1 06-30-2005 08:57 PM
"Out-Of-Range" monitor error on 1st boot after install wingnut2292 Fedora 0 09-19-2004 12:42 AM
"Couldn't set pass-filter in kernel" ppp deamon error GoofyX Linux - Networking 0 02-13-2004 04:32 PM
I can't logon with the "user" and "pass"...help! bseven Linux - Newbie 5 11-08-2002 01:45 PM

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

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