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 02-15-2015, 06:16 PM   #1
JimmyJ1776
LQ Newbie
 
Registered: Jan 2015
Location: Alabama
Distribution: Slackware 14.1, Ubuntu 14.04
Posts: 4

Rep: Reputation: Disabled
Chapter 6.7. Linux-3.16.2 API Headers , errors on installation of API headers


Hello all, I am working on LFS 7.6 and I have made it to chapter 6. I am following the same procedure as in chapter 5. That is; extracting the tar from the /mnt/lfs/sources directory, cd(ing) to the extracted directory and following the instructions from the book. When trying to compile the Linux API headers (chapter 6.7), I am getting the following error messages:

root:/sources/linux-3.16.2# make mrproper
CLEAN include/generated
CLEAN include/generated/uapi/linux/version.h
root:/sources/linux-3.16.2# make INSTALL_HDR_PATH=dest headers_install
CHK include/generated/uapi/linux/version.h
UPD include/generated/uapi/linux/version.h
HOSTCC scripts/basic/fixdep
gcc: error trying to exec '/tools/lib/gcc/x86_64-unknown-linux-gnu/4.9.1/../../../../x86_64-unknown-linux-gnu/bin/as': execv: No such file or directory
scripts/Makefile.host:118: recipe for target 'scripts/basic/fixdep' failed
make[1]: *** [scripts/basic/fixdep] Error 1
Makefile:454: recipe for target 'scripts_basic' failed
make: *** [scripts_basic] Error 2
<find dest/include \( -name .install -o -name ..install.cmd \) -delete
find: `dest/include': No such file or directory
root:/sources/linux-3.16.2# cp -rv dest/include/* /usr/include
cp: cannot stat 'dest/include/*': No such file or directory

root:/sources/linux-3.16.2#

My host system is Slackware 14.1, cpu is x86_64 Intel core I3.
All of the tests from chapter 5 passed with no errors.
Can someone please tell me where my problem may be. I have searched online and found nothing. Thanks in advance!
 
Old 02-16-2015, 11:47 AM   #2
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Linux From Scratch, Slackware64, Partedmagic
Posts: 3,137

Rep: Reputation: 855Reputation: 855Reputation: 855Reputation: 855Reputation: 855Reputation: 855Reputation: 855
In chapter 6 you have to chroot into the temp system have you done that?
 
Old 02-16-2015, 12:44 PM   #3
Krejzi
Member
 
Registered: Jan 2015
Posts: 215

Rep: Reputation: Disabled
Given that it says that /tools/lib/gcc/x86_64-unknown-linux-gnu/4.9.1/../../../../x86_64-unknown-linux-gnu/bin/as is "missing", I'd try looking if it's there first. If you do find out the file exist, run the following command from your host to verify if your toolchain has been linked to your host: "readelf -e /tools/lib/gcc/x86_64-unknown-linux-gnu/4.9.1/../../../../x86_64-unknown-linux-gnu/bin/as | grep interpreter". If it doesn't include /tools/lib64/ld-linux-x86-64.so.2, then I'm afraid your toolchain is broken and you have to rebuild it from scratch.
 
1 members found this post helpful.
Old 02-16-2015, 06:45 PM   #4
JimmyJ1776
LQ Newbie
 
Registered: Jan 2015
Location: Alabama
Distribution: Slackware 14.1, Ubuntu 14.04
Posts: 4

Original Poster
Rep: Reputation: Disabled
Yes, I was chrooted into the temp system. Also, I have started over at the beginning of chapter 6 several times, but still same result.

In response to Krejzi: the "as" file is there, in the bin directory, although I don't understand the "/../../../.." part of the path, it seems to me it goes down a few levels and then backs out, in the same command.
I ran the "readelf -e /tools/lib/gcc/x86_64-unknown-linux-gnu/4.9.1/../../../../x86_64-unknown-linux-gnu/bin/as | grep interpreter"
command from the / directory on the host system, it returned "[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]" but not "/tools/lib64/ld-linux-x86-64.so.2". Not knowing if it would make any difference I ran the same command with "mnt/lfs/" at the beginning of the path, it returned the same result. Does this mean I have a broken tool chain?

Thanks for the quick response guys and any other suggestions would be greatly appreciated.
 
Old 02-16-2015, 07:14 PM   #5
Krejzi
Member
 
Registered: Jan 2015
Posts: 215

Rep: Reputation: Disabled
Quote:
Originally Posted by JimmyJ1776 View Post
I ran the "readelf -e /tools/lib/gcc/x86_64-unknown-linux-gnu/4.9.1/../../../../x86_64-unknown-linux-gnu/bin/as | grep interpreter"
command from the / directory on the host system, it returned "[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]" but not "/tools/lib64/ld-linux-x86-64.so.2". Not knowing if it would make any difference I ran the same command with "mnt/lfs/" at the beginning of the path, it returned the same result. Does this mean I have a broken tool chain?
Yes, your toolchain is broken. The most common mistake that people make and end up like this is that they use PDF version of a book and TYPE the commands written in the book. This is wrong. If you are doing this, stop doing it, find a html version and copy/paste the instructions.

Instructions which make GCC use /tools/lib* instead of /lib* are part of GCC Pass 1 and GCC Pass 2 in chapter 5 - the big, complicated box starting with "for". People try and type that and usually end up typing something wrong (and I don't blame them) resulting in a broken toolchain like yours.

If you are building in a VM, install openssh on your guest os and ssh from your host's X terminal emulator so you can easily copy/paste the commands from the html version of the book.
 
1 members found this post helpful.
Old 02-16-2015, 07:43 PM   #6
JimmyJ1776
LQ Newbie
 
Registered: Jan 2015
Location: Alabama
Distribution: Slackware 14.1, Ubuntu 14.04
Posts: 4

Original Poster
Rep: Reputation: Disabled
Okay, so my backup of the tools folder after chapter 5 is no good? I need to rebuild all of the packages in chapter 5?
 
Old 02-16-2015, 08:29 PM   #7
Krejzi
Member
 
Registered: Jan 2015
Posts: 215

Rep: Reputation: Disabled
Quote:
Originally Posted by JimmyJ1776 View Post
Okay, so my backup of the tools folder after chapter 5 is no good? I need to rebuild all of the packages in chapter 5?
Yes.
 
Old 02-16-2015, 10:38 PM   #8
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,554
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
Often you end up with a carot symbol being misplaced by an apostrophe symbol, and it screws everything up.

I've typed the book out myself, but you have to take extreme care in doing so.
 
1 members found this post helpful.
Old 02-17-2015, 09:00 PM   #9
JimmyJ1776
LQ Newbie
 
Registered: Jan 2015
Location: Alabama
Distribution: Slackware 14.1, Ubuntu 14.04
Posts: 4

Original Poster
Rep: Reputation: Disabled
Okay, thanks for the help everyone. One last question: can I start over at the beginning of chapter 5, or should I go all the way back to the beginning of the book?
 
Old 02-17-2015, 09:29 PM   #10
Krejzi
Member
 
Registered: Jan 2015
Posts: 215

Rep: Reputation: Disabled
Quote:
Originally Posted by JimmyJ1776 View Post
Okay, thanks for the help everyone. One last question: can I start over at the beginning of chapter 5, or should I go all the way back to the beginning of the book?
You should be fine to start over from Binutils Pass 1 if the lfs user is still in place. Note that you need to remove everything from /tools/ directory (rm -rf /tools/*) before starting the build. Be sure to verify if the environment is set as it should be.
 
1 members found this post helpful.
  


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
Cannot install Linux API Headers in LFS 7.1 chapter 6.7 ffx77905 Linux From Scratch 18 07-02-2012 05:23 AM
[SOLVED] Failed on chapter 6.7.1. Installation of Linux API Headers, make headers_check sunmoon Linux From Scratch 11 02-16-2012 12:51 PM
Linux API Headers install errors t8rsalad Linux From Scratch 2 08-14-2009 04:17 PM
Installation of Linux API Headers... crik91 Linux From Scratch 7 01-05-2008 03:11 PM
Installation of Linux API Headers martinwprior Linux From Scratch 3 09-28-2007 01:19 AM

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

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