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.
Ran through procedures. First time did 'make -j4'. Then 'make check' wouldn't even run. Backtracked, deleted the build dir and started over from there. Then did 'make' and 'make check'. This time it completed, but I got 141 failures and 2 xpass that aren't all listed in the notes regarding expected failures.
Toying with proceeding boldly on and going back and trying the process again. I'll update when I make a decision, working on something else right now. Just dropping a line in case someone has some brilliant wisdom to simplify the decision making process.
At last! Someone who gets a list similar to mine! Let's do a comparison. First, what is your architecture, 32-bit or 64-bit? I'm building out of a 64-bit system but it's a multilib build so I need a 32-bit glibc as well as a 64-bit one. On the native 64-bit glibc build, I get only a couple of errors but my 32-bit glibc behaves just like yours.
The nptl errors have to do with the POSIX thread library. How many errors do you get if you subtract those? Ignore XPASSes, XFAILs and unsupported tests; they're harmless.
As I only need the 32-bit glibc for my printer driver, which wouldn't be using threads, I ignore the errors. However, you can't do that with your main glibc. I've been using -j4 so far but I'm going to try without and see if that makes a difference. I suspect that your first check failed, not because you used -j4 but because you forget to make those ld-linux links specified in the book. Those weren't needed in LFS-8.4 but they are now. I forgot them first time around and also got a crash.
OK, here's the (possible) answer. I have just built glibc again. The 64-bit library was built and tested with -j4 as this didn't cause any previous trouble. The 32-bit glibc was built and tested this time with -j1. And the answers came out identical: 3 FAILs, two of them expected.
So I suggest that you scrap your wonky glibc build and redo it with -j1 for both the build and the test stages. There's something about multiple core use that doesn't agree with the 32-bit POSIX thread library.
Though I'm not sure what role the i386 plays in my lfs build process, because I just want to build 64bit and proceeded accordingly. Admittedly, there was a bit of information in the book about cross compiling and architectures that I glossed over. At this point I'm not worried about drivers too much, I just want to boot into LFS, write hello world in vim and then compile and run it. Just to tick this LFS thing off the bucket list.
Glad to see someone else with the same issues too. I noticed in addition to the nptl errors that there were a couple of failed test cases about threads in different test suites, I'm was a bit worried about that because I use pthreads in alot of code I write and I'm sure that linux packages depend heavily on them too.
So I just continued on last night and ignored the make check fails. Then when I tried to compile dummy.c I got linker errors. First for crt1.0 and crti.o. I wasn't sure what to do. I ctrl+f-ed the pdf and couldn't find anywhere that we were supposed to make links to those. So I just went ahead and made links myself between /lib and /tools/lib ( I think, I forget). This solved that issue but then ld couldn't find libc, I got an error like blah-ld: cannot find -lc. At this point I decided I should just start over, and went to bed. Today going to start from scratch and be even more careful about reading hte book.
Do you have any insight on those linker errors? Was there some obvious step that I missed? Thanks for the info Hazel! I'm going to look into building 64 and 32 bit tools on my next go round and I'll see what comes up.
You can't simply go on. The tests already show that your glibc is screwed. I'm interested that in your case the problem showed up in 64-bit glibc, which didn't cause me any problems at all. I wonder if it is something to do with your using Ubuntu as a build host; it has a poor reputation in LFS circles.
Did you save your tool set before adjusting it, as suggested in the book? If so, you can go back: clear the tools directory and repopulate it with the saved set. Then build glibc again with -j1 and check it with -j1 too. For me, that cleared the problem. Your mileage may vary!
The multilib build that I am using is unofficial. The official way to do multilib is using CLFS. But this thread started by Emmett1 shows how you can do a multilib build within LFS itself. I need this because I have a printer with 32-bit drivers which depend on a 32-bit libc.
I didnt back up the tools at the end of chapter 5 because the chapter 5 process was so simple that I was sure it wouldnt be necessary, this go around I definitely will!
I've got a T430 in the closet with debian 9 I havent touched in a while. Will try that and post back with results. If I'm not lazy maybe I can build on both in parallel and see if Ubuntu is in fact finicky.
Hoping to post a success story ( about glibc at least ) within 24 hours!
With Debian, there are two things you need to fix before you start building LFS.
1) Install gawk. Debian uses mawk by default and that won't work.
2) Make sure your system shell (/bin/sh) points to bash. By default it will be dash and that doesn't work either. Apart from that, you shouldn't have any problems.
PS: I've just had an idea: what does Ubuntu use for these 2 tools? Because Ubuntu is based on Debian after all.
gawk + dash but its easy to dpkg --reconfigure dash to bash as I've done. It meets all the requirements in the book and passes the version-check.sh script when sh -> bash.
Debian is a pita sometimes I think Ill actually leave that alone for now because I don't know what havok changing mawk to gawk might wreak. I'm thinking ubuntu for one last try!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.