LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Stuck in 6.7.*Linux-4.9.9 API of Linux from scratch (https://www.linuxquestions.org/questions/linux-newbie-8/stuck-in-6-7-%2Alinux-4-9-9-api-of-linux-from-scratch-4175608908/)

liuxu1005 06-30-2017 09:40 AM

Stuck in 6.7.*Linux-4.9.9 API of Linux from scratch
 
Hi folks,

I am following LFS - Version 8.0-rc1-systemd to build my linux.

I am currently stuck on 6.7.*Linux-4.9.9 API:
after I chroot

make mrproper
make INSTALL_HDR_PATH=dest headers_install

I got error:
cannot exec "tools//lib/gcc/x86_64-pc-linux-gnu/6.3.0/../../../../x86_64-pc-linux-gnu/bin/as"
no such file or directory.

Where I went wrong?
Thanks a lot.

business_kid 06-30-2017 02:25 PM

Code:

"tools//lib/gcc/x86_64-pc-linux-gnu/6.3.0/../../../../x86_64-pc-linux-gnu/bin/as"
tools//lib<blah> looks wrong. 2 backslashes? Is tools in the kernel directory? Is your system 32 bit? Maybe
Code:

/tools/lib64/<blah>

liuxu1005 06-30-2017 02:34 PM

Thanks for comment.
Double slash is typo.
I manually type in the error instead of copying it.

I just follow the instructions from http://www.linuxfromscratch.org/lfs/...-NOCHUNKS.html

first, create the cross-compile tools and put them in /mnt/lfs/tools;
then chroot with /mnt/lfs/tools as / ; use the tool chain in /mnt/lfs/tools to install all required software for my linux system.

When I try to install linux API headers from /mnt/lfs/resources/linux-4.4.9, I got the error.

There should be /mnt/lfs/tools/lib/gcc/x86_64-pc-linux-gnu/6.3.0 if everything goes well.
I don't know why I don't have directory of /mnt/lfs/tools/lib/gcc/x86_64-pc-linux-gnu while I only have an executable /mnt/lfs/tools/lib/gcc/x86_64-pc-linux-gnu

liuxu1005 06-30-2017 02:36 PM

Usually if I install gcc correctly, there should be /usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/....

Here I install gcc in /mnt/lfs/tools, and there should be /mnt/lfs/tools/lib/gcc/x86_64-pc-linux-gnu/6.3.0/.... , correct?

business_kid 07-01-2017 03:39 AM

Why not try
Code:

cd /mnt/lfs/tools
find -name 'as'


hazel 07-01-2017 11:12 AM

Your makefile shouldn't be using the as program at all because you are not compiling here, just copying headers to their final location.

Are you sure that you deleted the kernel source tree created in 5.6 and unpacked a fresh one from the source tarball?

And please don't create duplicate posts. It's against forum rules.

business_kid 07-01-2017 12:48 PM

Code:

make INSTALL_HDR_PATH=dest headers_install
The "dest" in that line also looks like a typo. My lfs days were a long time ago.

Relying on memory, The destination is usually /usr/include/ ? It looks like you should have /mnt/lfs/<something> in there. The 'dest' is a tmpdir. At this stage, path errors are common. You're still using the static toolchain in ~/tools to build the system in /mnt/lfs, and /tools will be removed in time.

hazel 07-01-2017 02:17 PM

Quote:

Originally Posted by business_kid (Post 5729504)
Code:

make INSTALL_HDR_PATH=dest headers_install
The "dest" in that line also looks like a typo. My lfs days were a long time ago.

Relying on memory, The destination is usually /usr/include/ ? It looks like you should have /mnt/lfs/<something> in there. The 'dest' is a tmpdir. At this stage, path errors are common. You're still using the static toolchain in ~/tools to build the system in /mnt/lfs, and /tools will be removed in time.

No, whatever else is wrong, the "dest" is correct. Installing the kernel headers deletes everything in the destination directory, so a temporary one is used for safety. Then a sanitised set of headers (not the full set) is copied to /usr/include. You can check the instructions here.

The OP's problem is that his makefile is trying to access binutils and it shouldn't be doing so for the headers_install target.

jsmnsr 07-27-2017 09:23 PM

I'm having the same issue, could it have something to do with building on a 64-bit system? I have noted a couple of things:

1. ls will find this binary:
root:/sources/linux-4.9.9# ls -alh /tools/lib64/gcc/x86_64-pc-linux-gnu/6.3.0/>
-rwxr-xr-x 2 root root 1.8M Jul 23 18:48 /tools/lib64/gcc/x86_64-pc-linux-gnu/6.3.0/../../../../x86_64-pc-linux-gnu/bin/as

2. Running it outputs an error saying it can't find it:
root:/sources/linux-4.9.9# /tools/lib64/gcc/x86_64-pc-linux-gnu/6.3.0/../../..>
bash: /tools/lib64/gcc/x86_64-pc-linux-gnu/6.3.0/../../../../x86_64-pc-linux-gnu/bin/as: No such file or directory

3. readelf (from the lfs user shell) reports /lib64/ld-linux-x86-64.so.2:
lfs@ubuntu:~$ readelf -l /tools/lib/gcc/x86_64-pc-linux-gnu/6.3.0/../../../../x86_64-pc-linux-gnu/bin/as | grep interpreter
[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]

This is symlinked to /lib/x86_64-linux-gnu/ld-2.23.so in the lfs user shell
lfs@ubuntu:~$ ls -alh /lib64/ld-linux-x86-64.so.2
lrwxrwxrwx 1 root root 32 Jun 16 20:57 /lib64/ld-linux-x86-64.so.2 -> /lib/x86_64-linux-gnu/ld-2.23.so
but is not found in the chroot shell

I don't think I missed a step, but it is possible that the 64-bit ld is not being properly referenced.


All times are GMT -5. The time now is 11:24 AM.