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
  Search this Thread
Old 06-19-2017, 01:51 AM   #1
Microbob
LQ Newbie
 
Registered: May 2017
Posts: 10

Rep: Reputation: Disabled
Exclamation Error when installing Binutils in chapter 6.13 (LFS v8.0)


Hello,
I'm working my way through the LFS book and I've recently come across this error when trying to install Binutils with "make tooldir=/usr":
Code:
configure:2334: loading cache ./config.cache
configure:2371: error: `target_alias' has changed since the previous run:
configure:2379:   former value:  `x86_64-lfs-linux-gnu'
configure:2381:   current value: `x86_64-pc-linux-gnu'
configure:2371: error: `LDFLAGS' has changed since the previous run:
configure:2379:   former value:  `-static-libstdc++ -static-libgcc '
configure:2381:   current value: ` '
configure:2398: error: in `/sources/binutils-2.27/build/libiberty':
configure:2400: error: changes in the environment can compromise the build
configure:2402: error: run `make distclean' and/or `rm ./config.cache' and start over
.

I've tried the suggestion to to run
Code:
make distclean
and
Code:
rm ./config.cache
, but without avail. How can I fix this problem?

Here is a general list of info that may help you:
  • My OS is Peppermint OS 8.0 (based on Ubuntu 16.04.2)
  • I'm building this in a VM
  • I do have a dual core processor, but I didn't put the "-j2" tag on the "make"s
  • I have a 64 bit architecture, and the chapter 5 sanity tests also agree with it

Thank you in advance for any help!
 
Old 06-19-2017, 05:38 AM   #2
hazel
Senior Member
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware, OpenBSD
Posts: 4,329
Blog Entries: 11

Rep: Reputation: 2452Reputation: 2452Reputation: 2452Reputation: 2452Reputation: 2452Reputation: 2452Reputation: 2452Reputation: 2452Reputation: 2452Reputation: 2452Reputation: 2452
It looks as if you are building in a source tree that you have used before. You never do that in LFS. Always delete the directory when you have finished with it. If you need to build the same package again, unpack the source tarball and create a new source tree for your build.
 
Old 06-19-2017, 07:44 PM   #3
Microbob
LQ Newbie
 
Registered: May 2017
Posts: 10

Original Poster
Rep: Reputation: Disabled
Thank you so much for helping me clear out this issue! I've been wondering about what to do with the previous "build" dir each time I'm told to run "mkdir build" again, and again, and again.

So, after I've finished using the "build" dir, I just "rm -rf build" and continue.

Thank you again!
 
Old 06-20-2017, 12:00 AM   #4
Luridis
Member
 
Registered: Mar 2014
Location: Texas
Distribution: LFS 9.0 Custom, Merged Usr, Linux 4.19.x
Posts: 616

Rep: Reputation: 167Reputation: 167
Quote:
Originally Posted by Microbob View Post
Thank you so much for helping me clear out this issue! I've been wondering about what to do with the previous "build" dir each time I'm told to run "mkdir build" again, and again, and again.

So, after I've finished using the "build" dir, I just "rm -rf build" and continue.

Thank you again!
I can tell you from experience that just scrubbing the build sub-directory may not be enough for some packages. If it doesn't work try removing the whole tree. As for doing things "again and again," you'll need to get accustom to doing so. BLFS has many more packages than the base system. Here are some things that might help with the typing:

export rr="./configure --prefix=/usr --disable-static" (or prefix=/tools where needed.)

Then you can type:

$rr && make && make check

Don't forget that you can also simply press the up-arrow to scroll back through your shell history and press enter to use the command again. Just don't forget to override or append the shell variable when there are extra configure flags.

./configure --prefix=/usr --disable-static --sysconfdir=/etc

Would be:

$rr --sysconfdir=/etc && make && make check

If unpacking is slowing you down, drop the "v" from:

tar -xvf some-package-1.0.0.tar.xz

And it will speed up considerably for packages with lots of files (gcc, libc, etc.). This is especially true if you're working through SSH.

Last edited by Luridis; 06-20-2017 at 12:03 AM.
 
Old 06-20-2017, 06:57 PM   #5
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-Current
Posts: 6,449
Blog Entries: 15

Rep: Reputation: 2023Reputation: 2023Reputation: 2023Reputation: 2023Reputation: 2023Reputation: 2023Reputation: 2023Reputation: 2023Reputation: 2023Reputation: 2023Reputation: 2023
It's best just to craft a build-script that can easily be recycled, similar to Slackware's SlackBuilds. I have actually crafted my own scripts using the SlackBuild style to enable usage of pkgtools and use them extensively with minor upgrades as needed for newer packages. Using these I also have dependencies mapped out, and have crafted a few crude pre-requisite checkers to ensure a dependency is installed before compile time.
 
Old 06-21-2017, 08:20 PM   #6
Microbob
LQ Newbie
 
Registered: May 2017
Posts: 10

Original Poster
Rep: Reputation: Disabled
I went back and restarted the book, but this time I "rm -rf build" each time I was done with the build dir. This time I got stopped at the first command in 6.10 "Adjusting the Toolchain". I couldn't
Code:
mv -v /tools/bin/{ld,ld-old}
because
Code:
mv: cannot stat '/tools/bin/ld': No such file or directory
. This also happened to the file "ld-new".

What went wrong? Everything before it went smoothly, and then I ran into this issue. What can I do to fix it?

Thanks!

P.S.: thanks for the build/make script idea, but I prefer to do each "make" command individually so I can see if there was an error when I run them.
 
Old 06-23-2017, 12:40 AM   #7
Luridis
Member
 
Registered: Mar 2014
Location: Texas
Distribution: LFS 9.0 Custom, Merged Usr, Linux 4.19.x
Posts: 616

Rep: Reputation: 167Reputation: 167
There is an order to things, during the course of the build, some things will change in /tools. (simlinks, files removed, etc.) That is why the instructions say to back up /tools after the strip at the end of chapter 5.

Basically, during the final binutils build of chapter 5, you compiled an extra linker, intended to be used after glibc was built but before the final build of binutils:

Code:
make -C ld clean
make -C ld LIB_PATH=/usr/lib:/lib
cp -v ld/ld-new /tools/bin
They had you do this then so you would have a linker pointed at the local filesystem immediately after building glibc in chapter 6. In the section "Adjusting the Toolchain" you swap it out for the one that was pointed at /tools/lib and create new simlinks with the target triple.

Code:
mv -v /tools/bin/{ld,ld-old}
mv -v /tools/$(uname -m)-pc-linux-gnu/bin/{ld,ld-old}
mv -v /tools/bin/{ld-new,ld}
ln -sv /tools/bin/ld /tools/$(uname -m)-pc-linux-gnu/bin/ld
If you had read that black-on-white bit between the code blocks (commands) you'd understand what happened. I suggest going back and reading the book by itself, without following the instructions at the same time. This is not paint by numbers.
 
Old 06-23-2017, 03:42 AM   #8
Microbob
LQ Newbie
 
Registered: May 2017
Posts: 10

Original Poster
Rep: Reputation: Disabled
Ok. I'll try it again. I remember going through that part and reading the thing about the linker, and the system worked without issue too.

Thanks though
 
  


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
[SOLVED] LFS 7.4 Chapter 6, Binutils make check warning alpo85 Linux From Scratch 2 01-16-2014 01:51 PM
[SOLVED] LFS 7.2, chapter 5., section 5.4.1 Installation of Cross Binutils Lakhan Kumar Linux From Scratch 7 11-12-2012 04:22 PM
lfs-6.3 - chapter 6: binutils-2.17 - make error regarding libbfd-2.17.so :not found me-$-on Linux From Scratch 5 07-02-2009 02:49 PM
LFS 6.4 Chapter 5.4. Binutils-2.18 - Pass 1 gazza1z Linux From Scratch 2 01-23-2009 11:16 AM
lfs chapter 6.11 Binutils-2.16.1 make problems Nislick Linux From Scratch 3 08-15-2006 05:25 PM

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

All times are GMT -5. The time now is 06:35 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration