LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-23-2006, 04:37 PM   #16
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,

That is incorrect, it should be /tools/bin/gcc.

Different things could have gone wrong. Incorrect PATH setting and/or chap 5.5 (gcc pass 1) failed somewhere. Maybe it's something else, but these came to mind first.
 
Old 09-23-2006, 05:59 PM   #17
status1
Member
 
Registered: Sep 2006
Posts: 122

Original Poster
Rep: Reputation: 15
Hello,
At what point /tools/bin/gcc should be created ?
Is there a way to work around this problem ? (copy the files needed to the right directory )

I just rebooted and I tried the command which gcc and it's the same /usr/bin/gcc
so it never changed from the begining
Is the ln -s gcc /tools/bin/cc command supposed to create that ?
 
Old 09-24-2006, 06:24 AM   #18
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,

In chapter 5.5 you build and install a temporary gcc (in /tools/usr/bin), the ln -s gcc /tools/bin/cc makes a link from cc to the new gcc in /tools/usr/bin This link isn't gcc related it's cc related (some programs call cc instead of gcc).

In order to build the rest of the temporary environment you need access to the new gcc (the one in /tools/usr/bin), otherwise things will fail. I wouldn't take any shortcuts here, just restart at chapter 5.5 and continue from there (personally I would start at the beginning of chapter 5).

Chapter 5 is (very) important, it's the base you are going to use to create your LFS system (done in chapter 6). This base should be 100% correct otherwise you will end up with a LFS system that doesn't work or is very unstable/buggy.

Hope this helps.

EDIT
/tools/usr/bin should be /tools/bin

Last edited by druuna; 09-24-2006 at 09:34 AM.
 
Old 09-24-2006, 08:12 AM   #19
status1
Member
 
Registered: Sep 2006
Posts: 122

Original Poster
Rep: Reputation: 15
Hello,
How does the program know where to create it?
Is it built into the program ?
I looked in the book and I did't find any place that it mentions /tools/usr/bin
I just want to clarify something here a little bit.
Yesterday you said that gcc should be in /tools/bin/gcc.
You are saying that"In chapter 5.5 you build and install a temporary gcc (in /tools/usr/bin)
Is that the actual place where gcc is installed or /tools/bin/gcc
In chapter 4.4 when seting op the environment there is a line where the PATH
is set and it shows PATH=/tools/bin:/bin:/usr/bin
Do you think this has anything to do with it ?
 
Old 09-24-2006, 08:38 AM   #20
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:
Originally Posted by status1
How does the program know where to create it?
That information is pre-defined, but can be overruled (--prefix=/tools being an example of that). To find out which part is placed were, take a look at the output of ./configure --help. This should also explain a bit more what all the --xxxxx options do. The actual pre-defined settings are inside the configure script.

Quote:
Is it built into the program ?
?? I'm not sure where it refers to. I suspect that the above answer also answers this questions.

Quote:
I looked in the book and I did't find any place that it mentions /tools/usr/bin
Not literally, but the --prefix=/tools is mentioned. The rest is up to the program that is being installed (the pre-defined settings) and should be known by the person installing it (to override where needed).

Quote:
I just want to clarify something here a little bit.
Yesterday you said that gcc should be in /tools/bin/gcc.
Correct for gcc in chapter 5.5

Quote:
You are saying that"In chapter 5.5 you build and install a temporary gcc (in /tools/usr/bin)
Is that the actual place where gcc is installed or /tools/bin/gcc
Chapter 5.5 installs gcc in /tools/bin

Quote:
In chapter 4.4 when seting op the environment there is a line where the PATH
is set and it shows PATH=/tools/bin:/bin:/usr/bin
Do you think this has anything to do with it ?
This (PATH=/tools/bin:/bin:/usr/bin) looks correct. The /tools/bin dir is checked first.
 
Old 09-24-2006, 01:34 PM   #21
status1
Member
 
Registered: Sep 2006
Posts: 122

Original Poster
Rep: Reputation: 15
Hello,
I looked at the configure file but I am nut sure exactly what to look for.
The closest thing I found was a line that's something like this
bindir = ${prefix}/bin
The /tools/bin is created after running Binutils but the gcc is not placed
in there after running gcc-3.4.1
Should gcc be in /tools/bin or is it just linked to it ?
 
Old 09-24-2006, 01:59 PM   #22
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,

If there is no gcc in /tools/bin, gcc is not/not correctly installed.

Like I said before: Something probably went wrong while doing chapter 5.5 (gcc pass 1) .

In order to build the rest of the temporary environment you need access to the gcc installed in chapter 5.5, otherwise things will fail. I wouldn't take any shortcuts here, just restart at chapter 5.5 and continue from there (personally I would start at the beginning of chapter 5).
 
Old 09-24-2006, 03:05 PM   #23
status1
Member
 
Registered: Sep 2006
Posts: 122

Original Poster
Rep: Reputation: 15
Hello,
Well I always restart because I don't want to leave my laptop on The only thing is that I have my commands on a floppy so it will always be the same unless I made a mistake making the commads

I was reading a little bit about the toolchain technical notes on page 39
where it talks about obtaining detailed information from gcc by passing it the -v command line option while compiling a dummy program
So after typing gcc -v I get
Reading specs from /usr/lib/gcc/i486-pc-linux-gnu/3.4.1/specs which is the
wrong one
After that the next line is
Configured with ../gcc-3.4.1/configure --prefix=/usr --libexecdir=/usr/lib
--enable-shared --enable-threads=posix --enable-_cxa_atexit --enable-clocale=gnu --enable-languages=c.c++
thread model : posix
gcc version 3.4.1

I was wondering where is the "--prefix=/usr" in that line is coming from or if this has anything to do with with where gcc is placed.

I can put the gcc into /tools/bin so that when I type which gcc I get
/tools/bin/gcc but that's not going to change the path of where the specs is read from
I have to find out somehow where this path is located so I can change it or make it read from somewhere else
 
Old 09-24-2006, 04:17 PM   #24
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
Quote:
Originally Posted by status1
Well I always restart because I don't want to leave my laptop on The only thing is that I have my commands on a floppy so it will always be the same unless I made a mistake making the commads
With restart I mean: Scratch all you have and start over, not restarting your computer. This removes any mistakes, bad links, misplaced files etc, etc.

Rechecking all the automated commands wouldn't be a bad idea Especially those concerning gcc pass 1.

Quote:
I was reading a little bit about the toolchain technical notes on page 39 where it talks about obtaining detailed information from gcc by passing it the -v command line option while compiling a dummy program
So after typing gcc -v I get
Reading specs from /usr/lib/gcc/i486-pc-linux-gnu/3.4.1/specs which is the wrong one
After that the next line is
Configured with ../gcc-3.4.1/configure --prefix=/usr --libexecdir=/usr/lib
--enable-shared --enable-threads=posix --enable-_cxa_atexit --enable-clocale=gnu --enable-languages=c.c++
thread model : posix
gcc version 3.4.1

I was wondering where is the "--prefix=/usr" in that line is coming from or if this has anything to do with with where gcc is placed.
I (most of us) don't have the book, so page 39 doesn't tell us that much. A chapter would be a lot better (online LFS 6.0). I think you are talking about chapter 5.3 (Toolchain Technical Notes).

The information shown is from the gcc that came on the cd, the wrong gcc. You need the newly installed gcc files (chap 5.5) from chapter 5.10 (tcl) onwards. That is why you need to adjust the toolchain (chap 5.9) and have to check the Requesting program interpreter.

But, you already noticed that there is no /tools/bin/gcc. Conclusion: gcc pass 1 went wrong.

Quote:
I can put the gcc into /tools/bin so that when I type which gcc I get /tools/bin/gcc but that's not going to change the path of where the specs is read from
I have to find out somehow where this path is located so I can change it or make it read from somewhere else
I still think that something went wrong while installing gcc pass 1. This part is too important to 'play around' with, restart with chapter 5.5
 
Old 09-24-2006, 06:13 PM   #25
status1
Member
 
Registered: Sep 2006
Posts: 122

Original Poster
Rep: Reputation: 15
Hello,
Do I not start from scratch if I boot from the cd?
I don't see how else can I restart without the cd at this point in the begining
If I don't use the cd it will boot into windows

I will check my commands again but I am pretty sure that it's correct.
It may be due to where I am executing the commads from.
I am thinking that I am running the first commands (from chapter2.3 to 4.4)
from the floppy dir (/mnt/floppy) then after the sources dir is created copy the rest of the commands from the floppy to sources and run it from there
Do you think that may be the problem ?
 
Old 09-25-2006, 04:20 AM   #26
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:
Originally Posted by status1
Hello,
Do I not start from scratch if I boot from the cd?
Starting from the cd gives you a base to work from. Not necessarely a clean environment.

You already created a minimal directory structure and installed binutils (to name just 2), so in this case starting from the cd will not give you a clean environement but a base and a partially installed LFS.

Make sure all the old stuff is gone, then restart with the LFS parts.

Quote:
I don't see how else can I restart without the cd at this point in the begining
If I don't use the cd it will boot into windows
By starting with the cd, clean what you've already done and start over.

Quote:
I will check my commands again but I am pretty sure that it's correct.
It may be due to where I am executing the commads from.
I am thinking that I am running the first commands (from chapter2.3 to 4.4)
from the floppy dir (/mnt/floppy) then after the sources dir is created copy the rest of the commands from the floppy to sources and run it from there
Do you think that may be the problem ?
If you never installed LFS before, automating it is on hell of a challenge. Saving all the commands you entered is a good thing, but I would not automate things if this is your first LFS install. Even if you have a good grasp of LFS, automating it is a challenge.

First try to get an idea what and why certain things are done and after a successful LFS install you can consider automating it.
 
Old 09-25-2006, 06:37 PM   #27
status1
Member
 
Registered: Sep 2006
Posts: 122

Original Poster
Rep: Reputation: 15
Hello,
"You already created a minimal directory structure and installed binutils"

That would be a nice change if something would stay there after I turn it off
but that is not the case.
When I turn it on again there is nothing there except the empty lfs directory
which is created by the cd in /mnt
I have no /tools no /sources nothing and no binutils either
I don't know how else to delete something that is not there unless I format the hard drive which I am not planing on doing

Is there any command I can use to make sure I start clean even though I don't see any directories that were created ?

I am not trying to fully automate it I just want to save time on typing and avoid typos. I am running small sections at a time. I only automate one program or file at a time after I type it in first to make sure it's working without errors.

"First try to get an idea what and why certain things are done"
Well that's why I am here, to get an idea of what is supposed to be happening
at certain points in the building process from someone who has built an lfs
before.
 
Old 09-25-2006, 08:28 PM   #28
Axalon
LQ Newbie
 
Registered: May 2006
Distribution: Archlinux, LFS 6.2
Posts: 20

Rep: Reputation: 0
You probably didn't remount the partition. Unless you list the partition in /etc/fstab, you'll have to manually mount it every time you start the computer.

Last edited by Axalon; 09-25-2006 at 08:30 PM.
 
Old 09-26-2006, 01:31 AM   #29
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
Quote:
Originally Posted by status1
Hello,
"You already created a minimal directory structure and installed binutils"

That would be a nice change if something would stay there after I turn it off
but that is not the case.
When I turn it on again there is nothing there except the empty lfs directory
which is created by the cd in /mnt
I have no /tools no /sources nothing and no binutils either
I don't know how else to delete something that is not there unless I format the hard drive which I am not planing on doing
If this is the case, you are doing something wrong (or the book is corrupt....... )
One of the steps is to create, format and mount the LFS partition (chapter 2). $LFS should point to this partition. This is NOT /tmp and this NOT done by the cd, it should be done by you.

This partition will be on your HD and will still be there after a reboot.

It could be that you created it, but forgot to mount it after you resumed the LFS install.

This, creating/formatting/mounting the LFS partition, should be done first. Without it you won't go anywhere.
 
Old 09-26-2006, 06:30 PM   #30
status1
Member
 
Registered: Sep 2006
Posts: 122

Original Poster
Rep: Reputation: 15
Hello,
Well I guess I have a problem then because I have nothing after I reboot except
an empty lfs directory. Maybe the cd is somehow overwriting it when it boots up ?

I tried to delete the lfs directory but it shows up as soon as I reboot.

So you are saying that I should have everything there whatever I put in there
the /tools /sources and any untarred files ?
If that is the case this is definitely a problem.
That's the only reason I put the commads on the floppy because everytime I reboot everything is lost

I will try to rename lfs something else temporarily just to see what happens
when I reboot
 
  


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
GCC 4.1.1 missing specs WontonSoup Linux From Scratch 7 08-09-2006 05:03 AM
Minimum specs for file/print server + distro suggestion? automaton_be Linux - Newbie 4 01-02-2006 06:51 PM
rpmbuild -bb error: does not appear to be a specfile. keisinger Linux - Software 2 12-07-2005 01:11 PM
gcc 4: no specs file rconan Linux From Scratch 6 07-11-2005 12:21 PM
I ersased my GCC specs file shanenin Linux From Scratch 2 01-30-2004 10:36 AM

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

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