[SOLVED] Chapter 6.7. Linux-3.16.2 API Headers , errors on installation of API headers
Linux From ScratchThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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!
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.
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.
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.
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?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.