LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 12-21-2016, 04:42 AM   #1
meikitsu
LQ Newbie
 
Registered: Nov 2006
Distribution: Slackware 15.0
Posts: 17

Rep: Reputation: 0
LFS7.10 step 6.7.1 - make headers_install fails / seemingly missing executable


Hi all,

These past few days I've been working on my first LFS build, using book version 7.10. I have come across an interesting error when trying to build the Linux API headers in step 6.7.1.

When executing the step:
Code:
make INSTALL_HDR_PATH=dest headers_install
I receive the following output:
Quote:
CHK include/generated/uapi/linux/version.h
HOSTCC scripts/basic/fixdep
gcc: error trying to exec '/tools/lib/gcc/i686-pc-linux-gnu/6.2.0/../../../../i686-pc-linux-gnu/bin/as': execv: No such file or directory
make[1]: *** [scripts/Makefile.host:91: scripts/basic/fixdep] Error 1
make: *** [Makefile:446: scripts_basic] Error 2
As it appears I have a missing binary, I figured I made an error in one of the previous steps. I checked whether the file even exists, and the interesting part is: apparently it does. I can cd into the directory /tools/lib/gcc/i686-pc-linux-gnu/6.2.0/../../../../i686-pc-linux-gnu/bin, and the binary 'as' is there:

Quote:
root:/tools/i686-pc-linux-gnu/bin# ls -il
total 50256
309411 -rwxr-xr-x 2 root root 4658696 Dec 19 17:02 ar
309390 -rwxr-xr-x 2 root root 7003248 Dec 21 10:15 as
309392 -rwxr-xr-x 4 root root 6106088 Dec 19 17:02 ld
309392 -rwxr-xr-x 4 root root 6106088 Dec 19 17:02 ld.bfd
309418 -rwxr-xr-x 2 root root 4487116 Dec 19 17:02 nm
309414 -rwxr-xr-x 2 root root 5299236 Dec 19 17:02 objcopy
309410 -rwxr-xr-x 2 root root 6414160 Dec 19 17:02 objdump
309413 -rwxr-xr-x 2 root root 4658692 Dec 19 17:02 ranlib
309416 -rwxr-xr-x 2 root root 1414504 Dec 19 17:02 readelf
309419 -rwxr-xr-x 2 root root 5299236 Dec 19 17:02 strip
The time stamp is there because I tried touching it; as in real life, I just start poking stuff to see if it will wake up When trying to execute it, this happens:
Code:
root:/tools/i686-pc-linux-gnu/bin# ./as
Quote:
bash: ./as: No such file or directory
Even odder: I can execute the file from the host system (Ubuntu 16.10).

I have tried rebooting the host, re-mounting the LFS partition, re-setting the $LFS variable, re-mounting/populating /dev (step 6.2.2), re-mounting the Virtual Kernel File Systems (6.2.3) and re-chrooting (6.4), but to no avail. What bugs me particularly is the fact that I have an executable that 'does not exist' in my new environment, while I can clearly see it sitting there.

Would anyone have any idea what might have caused this, and how I can either solve it or prevent from making the same mistake in the future?

Thanks a million!
 
Old 12-21-2016, 05:21 AM   #2
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,153

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
please post the output of the version and library check scripts from the book, ubuntu is known as a problem host system.
 
Old 12-21-2016, 05:43 AM   #3
meikitsu
LQ Newbie
 
Registered: Nov 2006
Distribution: Slackware 15.0
Posts: 17

Original Poster
Rep: Reputation: 0
Ah, I did not know that, but somehow it doesn't surprise me...

The version check indicates:
Quote:
bash, version 4.3.46(1)-release
/bin/sh -> /bin/bash
Binutils: (GNU Binutils for Ubuntu) 2.27
bison (GNU Bison) 3.0.4
/usr/bin/yacc -> /usr/bin/bison.yacc
bzip2, Version 1.0.6, 6-Sept-2010.
Coreutils: 8.25
diff (GNU diffutils) 3.3
find (GNU findutils) 4.7.0-git
GNU Awk 4.1.3, API: 1.1 (GNU MPFR 3.1.5, GNU MP 6.1.1)
/usr/bin/awk -> /usr/bin/gawk
gcc (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005
g++ (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005
(Ubuntu GLIBC 2.24-3ubuntu2) 2.24
grep (GNU grep) 2.25
gzip 1.6
Linux version 4.8.0-30-generic (buildd@lcy01-09) (gcc version 6.2.0 20161005 (Ubuntu 6.2.0-5ubuntu12) ) #32-Ubuntu SMP Fri Dec 2 03:43:33 UTC 2016
m4 (GNU M4) 1.4.17
GNU Make 4.1
GNU patch 2.7.5
Perl version='5.22.2';
sed (GNU sed) 4.2.2
tar (GNU tar) 1.29
texi2any (GNU texinfo) 6.1
xz (XZ Utils) 5.1.0alpha
g++ compilation OK
Library check:
Quote:
libgmp.la: not found
libmpfr.la: not found
libmpc.la: not found
As far as I could see, I'm OK version-wise, but I have to admit: it's my first try.

Thanks in advance for your help!
 
Old 12-21-2016, 06:42 AM   #4
dlb101010
Member
 
Registered: Dec 2016
Posts: 61

Rep: Reputation: 18
Hey meikitsu!

Excuse me if I'm over-simplifying things (I'm new at this, too), but because you see the file there and can execute it from the host, it seems like you somehow don't have a proper path env. Either $PATH isn't what it should be, or when compiling ar's package you missed a step. Have you tried reinstalling the package ar came from, then redoing step 6.7.1?

HTH,
Dave
 
Old 12-22-2016, 03:03 AM   #5
meikitsu
LQ Newbie
 
Registered: Nov 2006
Distribution: Slackware 15.0
Posts: 17

Original Poster
Rep: Reputation: 0
Hi Dave,

Thanks for your reply! Could the $PATH be the issue if I invoke the binary directly? I.e., if I'm in the directory and I try a ./as, I will still get the "No such file or directory" message. There might have been a faulty setting during the build of the specific binaries though.

My current reasoning is that either I messed up a step in the book (forgetting to set an environment variable for the build, or skipping some instruction), or my host OS is causing a bit of an issue. To eliminate both, I'm considering restarting the build over the weekend with a different host OS (Slackware 14.2).

One question remains though: how is it possible that I can see the file, but when I try to run it, I get a "No such file or directory"? Especially when the exact same file in the exact same location is executable from the host?

One day I'll find out
 
Old 12-22-2016, 05:22 AM   #6
dlb101010
Member
 
Registered: Dec 2016
Posts: 61

Rep: Reputation: 18
Yeah, an unfortunate possibility is that the binary runs from the host install because of cross-contamination, and it's using dependencies from the host. That might explain why it doesn't execute from the LFS build. (But I'm guessing here.)

Before starting over, maybe double check a couple things. (Apologies if you already have.) Like, when you 'echo $PATH', is 'tools/bin' in there at the end, and is everything else present that should be in your path? And did you following 6.2.2, 6.2.3 and 6.4 before trying to execute 'as', in case you've logged out and back in since doing so?

Dave
 
Old 12-23-2016, 10:58 AM   #7
meikitsu
LQ Newbie
 
Registered: Nov 2006
Distribution: Slackware 15.0
Posts: 17

Original Poster
Rep: Reputation: 0
Hi Dave,

Thanks again for thinking along. I verified the PATH and I re-did steps 6.2.2, 6.2.3 and 6.4 just to make sure -- same error. I installed Slackware 14.2 last night, and gave LFS another go, and now the specific binary is executable. Will be arriving at 6.7.1 anytime soon now, but I'm confident that I will be able to move on.

I think I have figured out the error, too. You know how in the book they tell you:

Quote:
3. For each package:
a. Using the tar program, extract the package to be built. In Chapter 5, ensure you are the lfs user
when extracting the package.
b. Change to the directory created when the package was extracted.
c. Follow the book's instructions for building the package.
d. Change back to the sources directory.
e. Delete the extracted source directory unless instructed otherwise.

(p. 36)
Oops.
 
Old 12-23-2016, 06:06 PM   #8
dlb101010
Member
 
Registered: Dec 2016
Posts: 61

Rep: Reputation: 18
Sorry to hear you had to start over, but glad that whatever cause the problem wasn't duplicated in the second go-through!

Dave
 
  


Reply



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
make fails : configure: error: C++ compiler missing or inoperational During gcc-4.8.1 manoj7410 Ubuntu 7 01-28-2014 02:36 AM
[SOLVED] make headers_install deleted header files ma1 Linux - Newbie 3 05-11-2012 01:39 PM
LXer: Complete Step by Step Guide to Make ISO Images in Ubuntu LXer Syndicated Linux News 0 06-09-2011 02:20 PM
LFS Step 6.7 - make headers_check fails ice13berg Linux From Scratch 7 01-07-2011 09:05 AM
Make Headers_Install error Slackware64 linus72 Slackware 7 12-14-2010 01:41 AM

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

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