LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Chapter 6.7. Linux-3.16.2 API Headers , errors on installation of API headers (https://www.linuxquestions.org/questions/linux-from-scratch-13/chapter-6-7-linux-3-16-2-api-headers-errors-on-installation-of-api-headers-4175534129/)

JimmyJ1776 02-15-2015 06:16 PM

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!

Keith Hedger 02-16-2015 11:47 AM

In chapter 6 you have to chroot into the temp system have you done that?

Krejzi 02-16-2015 12:44 PM

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.

JimmyJ1776 02-16-2015 06:45 PM

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.

Krejzi 02-16-2015 07:14 PM

Quote:

Originally Posted by JimmyJ1776 (Post 5318410)
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.

JimmyJ1776 02-16-2015 07:43 PM

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?

Krejzi 02-16-2015 08:29 PM

Quote:

Originally Posted by JimmyJ1776 (Post 5318432)
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.

ReaperX7 02-16-2015 10:38 PM

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.

JimmyJ1776 02-17-2015 09:00 PM

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?

Krejzi 02-17-2015 09:29 PM

Quote:

Originally Posted by JimmyJ1776 (Post 5319139)
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.


All times are GMT -5. The time now is 10:34 AM.