LinuxQuestions.org
Review your favorite Linux distribution.
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
 
LinkBack Search this Thread
Old 11-13-2012, 04:34 PM   #16
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 394

Rep: Reputation: 124Reputation: 124

Quote:
Originally Posted by jjsmithct

Guess I could just make symlinks in /usr/lib to get around this, although not sure this is the best solution?
That is a very bad idea, IMO. I have never had to do such a thing building an LFS system.

So when you created the lfs user and set up the working environment, did you also do the step to source ~/.bash_profile? Or, have you logged out and logged back in as lfs since creating the lfs user? Confirm the environment variables have been established.
 
1 members found this post helpful.
Old 11-13-2012, 06:25 PM   #17
jjsmithct
LQ Newbie
 
Registered: Nov 2012
Posts: 6

Rep: Reputation: 0
Thanks for the reply.

I cannot find anything wrong with the environment. Environment variables are set and no problems with lfs user.

Actually, at least for an experiment, I copied the two lib archives into /usr/lib. After that I was able to make GCC 1st pass without errors. I'm not satisfied with that workaround, and would still like to know what's going wrong - but it seems the workaround did work.
I will continue to troubleshoot it - I'm open to suggestions.

I'm very deliberate and thorough going through each step and following the book, and have been doing as much reading as I can.

I've ran across another issue, would like to get your thoughts on this. The last step in GCC pass 1 is to fix a dependency for glic by running the command:
Code:
ln -sv libgcc.a `$LFS_TGT-gcc -print-libgcc-file-name | sed 's/libgcc/&_eh/'`
.

However it's not clear where this symlink should live. The book does not explicitly say to change directories, and at this point in the process, I'm in my build directory which I delete before going on to the next step. Where should the symlink go? The ln above will create it in the dir you run it from, so the only thing that made sense was to do it where libgcc.a lives. (/mnt/lfs/tools/lib/gcc/i686-lfs-linux-gnu/4.7.2). Is this correct?

Thx!
 
Old 11-14-2012, 01:41 AM   #18
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Quote:
Originally Posted by jjsmithct View Post
I'm working from SVN-20121103 version of the book
Why did you choose to use the development version and not the stable version?

The development version doesn't come with any guarantee and the build might not even work. It is a work in progress that should become the next stable LFS version. The stable version (7.2 at this moment) works and the only 2 "errors" found are these: LFS 7.2 errata

I would strongly advise to use the latest stable LFS version, especially if you are new to building a LFS system.


stoat asked in post #16 if your lfs user environment is correctly set up and you mention in post 17 that it is. Are you really sure about that? I'm asking because I see this:
Quote:
Originally Posted by jjsmithct View Post
make errs out with this...

Code:
libtool: install: warning: remember to run `libtool --finish /tools/libexec/gcc/i686-lfs-linux-gnu/4.7.2'
configure: WARNING: fixed-point is not supported for this target, ignored
Links are now set up to build a cross-compiler
 from i686-pc-linux-gnu to i686-lfs-linux-gnu.
configure: WARNING: using cross tools not prefixed with host triplet
configure: WARNING: cannot check for properly working vsnprintf when cross compiling, will assume it's ok
libtool: link: warning: library `/usr/lib/libmpfr.la' was moved.
/bin/sed: can't read /usr/lib/libgmp.la: No such file or directory
libtool: link: `/usr/lib/libgmp.la' is not a valid libtool archive
make[4]: *** [libmpc.la] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-mpc] Error 2
make: *** [all] Error 2
This host triplet is set in lfs' .bashrc:
Code:
LFS_TGT=$(uname -m)-lfs-linux-gnu
This is also explained here: 5.2. Toolchain Technical Notes
A very important variable during the build!

I agree with stoat that creating a link that is not mentioned in the book is a very bad idea and it might get you in trouble later on in the build (especially if you don't know what the underlying problem is).


Quote:
Originally Posted by jjsmithct View Post
I've ran across another issue, would like to get your thoughts on this. The last step in GCC pass 1 is to fix a dependency for glic by running the command:
Code:
ln -sv libgcc.a `$LFS_TGT-gcc -print-libgcc-file-name | sed 's/libgcc/&_eh/'`
In this specific case it doesn't really matter were you stand, but in general you should be in the extracted directory during a chapter, as mentioned here (second Important box, point 3): 5.3. General Compilation Instructions
 
Old 11-14-2012, 05:45 AM   #19
jjsmithct
LQ Newbie
 
Registered: Nov 2012
Posts: 6

Rep: Reputation: 0
Thanks Druuna. The biggest thing you've pointed out is that I'm using a development version which I didn't realize. I'll go back to the links and find the right one - not sure how I missed this.

As far as the environment goes, it was set...

lfs:~$ cat .bashrc
set +h
umask 022
LFS=/mnt/lfs
LC_ALL=POSIX
LFS_TGT=$(uname -m)-lfs-linux-gnu
PATH=/tools/bin:/bin:/usr/bin
export LFS LC_ALL LFS_TGT PATH

However - no matter - I'll get the last stable version and start over.

Thanks,
Jeff
 
Old 11-14-2012, 08:15 AM   #20
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 394

Rep: Reputation: 124Reputation: 124
Quote:
Originally Posted by jjsmithct

...I'll get the last stable version and start over.
I, too, wondered why you were using the development version of LFS. You when get to BLFS, that is all we have nowadays. BLFS is no longer released in periodic stable versions and has become sort of a daily rolling release. But the LFS book still is produced in periodic stable releases. And considering that LFS mostly just consists of core utilities and compiling tools, there isn't much benefit to pushing that kind of stuff to the cutting edge of current development, IMO.

I like the way BLFS is released now. When I'm ready to build a new BLFS system, I download the current daily svn version and try to stick with it to the end. But occasionally, undetected issues with something in that version will cause me to look at the newest version to solve that issue (and it usually does). When it doesn't though, I create a new ticket for the issue at the wiki. And there are a few issues that I still go backward to an older version (e.g., cdrtools).

Anyway, I wanted to make one other suggestion in addition to starting over with the stable version of LFS. It's to ditch the VM business for this. True, it is possible. True, many people have done it. True, VM is a wonderful thing. But IMO, it adds its own layer of complexity on top of the LFS process which doesn't really need more complexity. It's got plenty already. The book is written from the position that we start in a compatible Linux system and build LFS in its own partition on the hard drive. Unless you happen to work at Oracle developing VirtualBox, do it the book's way if at all possible.

Of course do what you think is best.
 
Old 11-15-2012, 03:41 PM   #21
jjsmithct
LQ Newbie
 
Registered: Nov 2012
Posts: 6

Rep: Reputation: 0
Hi stoat. Yep - using the development version was my bad. I went back and started over with 7.2, and everything so far has been smooth as silk. I'm through section 5 and starting on section 6, where I intend to take my time, and take a lot of detours exploring in more detail all the packages and layouts. Perfect for what I want to do right now.

Your suggestions to use a physical machine is a good one, but for practical purposes at this time VMware is serving me very well. I don't have hardware lying around to do this on, with the exception of some old laptops - all of which need to be inspected to find out what works and what doesn't. My plans include doing this on one or more of those once I've gotten through the process on the vm. Going through this process will help me formulate more clearly what I want to do on any physical machines I can salvage.

LFS is great for giving me a platform/process to learn much more than I know now - and fill a lot of the gaps in my knowledge that have been neglected for too long ;-)

I'm pretty busy with LFS, but most likely BLFS is in the not too distant future. Thanks for your help.

Jeff
 
Old 01-29-2013, 10:18 PM   #22
vitronix
LQ Newbie
 
Registered: Dec 2012
Posts: 21

Rep: Reputation: Disabled
don't copy and paste

Hi,

if you copy and paste the commands from the book it won't work. the command is the folllowing:

./gcc-4.7.1/configure \
--target=$LFS_TGT \
--prefix=/tools \
--with-sysroot=$LFS \
--with-newlib \
--without-headers \
--with-local-prefix=/tools \
--with-native-system-header-dir=/tools/include \
--disable-nls \
--disable-shared \
--disable-multilib \
--disable-decimal-float \
--disable-threads \
--disable-libmudflap \
--disable-libssp \
--disable-libgomp \
--disable-libquadmath \
--enable-languages=c \
--with-mpfr-include=$(pwd)/gcc-4.7.1/mpfr/src \
--with-mpfr-lib=$(pwd)/mpfr/src/.libs

In my case it still didn't compile, I needed to install flex too.
 
Old 01-30-2013, 01:18 AM   #23
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Quote:
Originally Posted by vitronix View Post
Hi,

if you copy and paste the commands from the book it won't work. the command is the folllowing:

./gcc-4.7.1/configure \
.
.
.
--with-mpfr-include=$(pwd)/gcc-4.7.1/mpfr/src \
--with-mpfr-lib=$(pwd)/mpfr/src/.libs

In my case it still didn't compile, I needed to install flex too.
Just as a warning for those that read reply #22: The above is wrong!

It starts the execution in the current build directory and not, as one should, in the gcc directory (./gcc-4.7.1/configure instead of ../gcc-4.7.1/configure).

LFS 7.2 is a proven concept and works as described in the book. If you need to change/add anything: Something is wrong and you need to fix it by retracing your steps.
 
1 members found this post helpful.
Old 01-30-2013, 08:37 AM   #24
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 394

Rep: Reputation: 124Reputation: 124
Quote:
Originally Posted by vitronix

don't copy and paste
Hello everybody,

I know vitronix didn't mean that as a universal decree, but I thought I would add here (also for future readers, just in case) that copying and pasting is generally the most accurate way to enter a large block of commands like that.

P.S.: The 7.2 version of the book is now mature and the next version will be along in a month or so. Since its release last September, the 7.2 version has had only two errata published related to changes in the GRUB package.

Last edited by stoat; 01-30-2013 at 08:46 AM.
 
Old 01-31-2013, 03:42 AM   #25
vitronix
LQ Newbie
 
Registered: Dec 2012
Posts: 21

Rep: Reputation: Disabled
Not the whole story

Quote:
Originally Posted by druuna View Post
Just as a warning for those that read reply #22: The above is wrong!

It starts the execution in the current build directory and not, as one should, in the gcc directory (./gcc-4.7.1/configure instead of ../gcc-4.7.1/configure).

LFS 7.2 is a proven concept and works as described in the book. If you need to change/add anything: Something is wrong and you need to fix it by retracing your steps.
As the book mentions, and I realized it later, you should build gcc out of the source directory for example gcc-build.
After that you can issue the following command ./gcc-build/gcc-4.7.1/configure with all the switches.
Anyway you should leave out the two .. at the bottom of the switches.

I'm sorry to have provided wrong information, but keep in mind that I am a novice.
 
Old 01-31-2013, 04:36 AM   #26
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Quote:
Originally Posted by vitronix View Post
As the book mentions, and I realized it later, you should build gcc out of the source build directory for example gcc-build.
Fixed the above, you should build from the build directory, and not the source directory.
Quote:
Originally Posted by vitronix View Post
After that you can issue the following command ./gcc-build/gcc-4.7.1/configure with all the switches.
No, that is not correct!
Follow the book: Enter the build (gcc-build) directory and issue the configure command as stated in the book (_with_ the 2 dots!!). I.e:
Code:
cd $LFS/sources
tar gcc.xyz.tar
cd gcc.xyz
<do commands>
mkdir ../gcc-build
cd ../gcc-build
../gcc-xyz/configure <options>
<rest of chapter>
Quote:
Originally Posted by vitronix View Post
Anyway you should leave out the two .. at the bottom of the switches.
No you should not!, you should follow the book.
 
Old 01-31-2013, 08:51 AM   #27
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 394

Rep: Reputation: 124Reputation: 124
Hello again everybody,

I just built v7.2 (and BLFS on top of it) again. Here are the results for all three GCC installations that I simply and obediently copied and pasted...
Problems with Pass 1 = 0
Problems with Pass 2 = 0
Problems with the system GCC = 0
IMO, vitronix is over-thinking the process of entering commands. It's great to think and learn while building, but stop thinking and trust the book when that moment arrives to enter some commands (especially if you're a beginner). The general instructions in section 5.3 (which vitronix should re-read) never stop being applicable...
Code:
untar => change to build directory => [stop thinking] => copy & paste => change back to source directory => delete build directory => [resume thinking and learning]
The parts of that in brackets are my additions and opinion. One possible exception to all this is when custom information has to be substituted for a placeholder (see <paper_size> for Groff, for example). Anyway, I just finished doing that above sequence probably three or four hundred times. And once again, it served me well from beginning to the end. There always will be things to sort out during a BLFS build. The BLFS books always have some issues of one kind or another due to constant ongoing changes and development. But I found none of that with the LFS v7.2 book.

P.S.: My comments are not meant to be piling on but are meant in the kindest possible way. I'm just interested and want to pitch in some. Especially since vitronix does not yet seem to believe druuna or the book.

Last edited by stoat; 02-01-2013 at 12:23 PM.
 
Old 02-01-2013, 09:29 AM   #28
vitronix
LQ Newbie
 
Registered: Dec 2012
Posts: 21

Rep: Reputation: Disabled
Hello again,

O.K. Druna, you obviously know more about Linux then me, and maybe it's a bit odd to starting something like LFS as a newbie.
I am sorry for the confusion I created. Mea culpa.
Thing is that when you build GCC the way I did, you don't get any errors.
I have to start over again, this time the proper way.
Again: I am sorry and will think twice before I try to help somebody.
 
  


Reply

Tags
error message, gcc, lfs


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
lfs : gcc make problem :error: libmpfr not found or uses a different ABI k84834 Linux From Scratch 5 08-18-2012 03:39 AM
gcc (GCC) 4.3.2 20081105 (Red Hat 4.3.2-7) compilation error adhesh_19 Red Hat 0 01-05-2010 05:34 AM
custom gcc build wont work (libmpfr.so.1: cannot open shared object file) furryfreak Linux - Software 2 04-03-2009 03:39 AM
have gcc compilation error during gcc installtion in linuxfromscratch vbshanmugaprakash Linux - General 3 12-13-2006 05:52 AM


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