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.
In LFS they did not use /usr/lib64 and /lib64 only for linkers thats why its not in sanity test result. And actually i just noticed the difference from the book today. I dont know if the book got it wrong, because the book use /lib and /usr/lib for 64bit libraries. I haven't build pure64 LFS for so long, maybe i will try build pure64 follow the book and fix the instructions here.
They changed the filesystem, I think at LFS 8.0. Before that, /lib64 was a link to /lib and /usr/lib64 linked to /usr/lib. I suspect that you were using an earlier book.
I'm surprised that you didn't get that swathe of glibc-32 errors that I got. Maybe that's because I was modifying an existing setup rather than doing it from scratch. I won't know until I build my next LFS .
They changed the filesystem, I think at LFS 8.0. Before that, /lib64 was a link to /lib and /usr/lib64 linked to /usr/lib. I suspect that you were using an earlier book.
Yeah i know theres was symlink /lib64 to /lib before, i started LFS around 7.9
Quote:
Originally Posted by hazel
I'm surprised that you didn't get that swathe of glibc-32 errors that I got. Maybe that's because I was modifying an existing setup rather than doing it from scratch. I won't know until I build my next LFS .
Yeah maybe. I've experimenting with pure64 LFS and i found the book was right about sanity test result. And i got very hard time enabling multilib from pure64, its just work before, maybe changes on recent toolchain version failing it. Last thing i can think of to enable multilib on pure64 is by build from scratch using my multilib method until gcc on chapter 6 then copy over all files into current running system replacing everything (be careful, i'm not test this method yet). Or build over everything from scratch
Note: i've updated the instruction, add sanity test result for 64 and 32 bit, and stripping 32bit libraries (/tools/lib32/*)
This is different than my experience.
I place 64-bit libs in /lib64 & /usr/lib64, 32-bit went in /lib & /usr/lib.
Its CLFS method, i've successfully build multilib system using CLFS method with working full DE and 32bit binary before but i dont like how it put the libraries. CLFS use default libraries hierarchy, 64bit in /lib64 and /usr/lib64, and 32bit in /lib and /usr/lib. Then I need add "PKG_CONFIG_PATH=/usr/lib64/pkgconfig" and "--libdir=/usr/lib64" to every 64bit build. I found this is not relevan since its 64bit system and just need some 32bit libraries. gcc and glibc dev should change this already in its code.
Triumph! I installed cups-filters, copied over the Brother driver files from Slackware and I can now print in LFS for the first time. The sheaf of check errors in glibc-32 don't seem to stop it working in practice.
Thanks, Emmett1! I shall build my next LFS as multilib from the start, using your method.
Distribution: LFS 9.0 Custom, Merged Usr, Linux 4.19.x
Posts: 616
Rep:
IIRC the reason the devs moved from using lib64 to lib was because of the Linux Standard Base. Standards committees trash things like existing structures that are working well all the time for what they assure us are very good reasons. However, such reasons usually make little to no actual sense to anyone outside of said comity.
As for multilib, it needed for very little on a user compiled system. That said, I know there is some commercial software (Steam) that needs 32 bit natives. I'd like to see a setup with only enough lib32 to support the few things that actually need them, rather than building 2 versions of every single library on the system. LFS is busy enough without having to build things like libgpm32.so and libgpm64.so when they former will never be used by anything.
+1 on that. I made my LFS multilib so that I could use my printer in it. It's a Brother and uses 32-bit drivers. But the only 32-bit library it needs is glibc. I suspect most proprietary drivers are like that.
Incidentally I used to use Crux, and the way they do it is to include 32-bit glibc and libstdc++ in the core repository and put all the other 32-bit libraries in a separate repo so that people can just install those they need.
Last edited by hazel; 05-26-2019 at 06:45 AM.
Reason: Added paragraph
I am one step closer to stepping away from main stream distros.
Yep, steam, wine and other 32bit program running fine for me. And I already ditch Arch completely from my machine. I can play game on steam on my LFS based distro now.
Check out here for my distro: https://venomlinux.org
I've been working through this for LFS 9.0-rc1. So far I've found one necessary change in Chapter 6 32-bit glibc. This version requires a symlink to be made to the just-compiled linker-loader before the tests are run. The book places this link in /lib.
Code:
case $(uname -m) in
i?86) ln -sfnv $PWD/elf/ld-linux.so.2 /lib ;;
x86_64) ln -sfnv $PWD/elf/ld-linux-x86-64.so.2 /lib ;;
esac
For a 32-bit build, it needs to go in /usr/lib32 which is the directory specified by the libc_cv_slibdir config variable. If it is not there, the tests won't run.
This requires a consequent change in the install directions:
ln -sv ../usr/lib32/ld-linux.so.2 /lib/ld-linux.so.2
becomes
ln -sfv ../usr/lib32/ld-linux.so.2 /lib/ld-linux.so.2
CORRECTION: That change is not necessary after all. ln -sv is good enough for both links.
I got a huge number of failures in these tests, though if you look closely, you will see that many of them fall into a single family. When you take out all the nptl failures, the number drops from 144 to 25.
CORRECTION: It drops to 3 if both the build and the test are carried out with -j1.
Last edited by hazel; 08-23-2019 at 09:41 AM.
Reason: Corrections
Another important point. The book has a detailed sanity check after installing glibc and adjusting the paths used by binutils and gcc. This check does not work for glibc-32 because the dummy file doesn't compile successfully. The problem, as far as I can see, is that the compiler (or more likely the loader) does not find a library called libgcc_s.so. There's a version in /tools but the gcc adjustment means that this tree is no longer searched. A version needs to be provided in /usr/lib32 by using symbolic links, as is done for 64-bit.
Unfortunately, in trying to fix this, I screwed up my /tools directory, so I shall have to start again from chapter 5.
Postscript: OK, recovered. The tests worked this time around, except with one oddity: readelf on the 32-bit dummy file reported an attempt to use a loader called /lib32/ld-linux.so.2. Now /lib32 does not exist on this system. Nevertheless, all the other tests worked and the final one showed that /usr/lib32/ld-linux.so.2 was the linker that was actually used.
Last edited by hazel; 08-23-2019 at 10:34 AM.
Reason: Added postscript
I am trying to follow this procedure with the following variations:
1) I am following the 5.9 book here. It seems to have included the modifications of Emmett1.
2) I am trying to use the packages from the LFS book 9.0 because I need something newer.
Everything is working fine until I get to the config of binutils in 5.9. Binutils-2.25 - Pass 2. I get the following result.
lfs:/lfs/sources/binutils-build$ CC=$LFS_TGT-gcc \
> AR=$LFS_TGT-ar \
> RANLIB=$LFS_TGT-ranlib \
> ../binutils-2.32/configure \
> --prefix=/tools \
> --disable-nls \
> --disable-werror \
> --with-lib-path=/tools/lib \
> --with-sysroot \
> --enable-64-bit-bfd
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for gawk... gawk
checking for gcc... x86_64-lfs-linux-gnu-gcc
checking whether the C compiler works... no
configure: error: in `/lfs/sources/binutils-build':
configure: error: C compiler cannot create executables
See `config.log' for more details
lfs:/lfs/sources/binutils-build$
Has anyone else run into this problem?
What additional information can I provide to help troubleshoot this?
Has anyone else tried this procedure using newer LFS 9.0 packages?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.