[SOLVED] Multilib LFS-10: problem with zlib x32 build (LFS-9 as host)
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.
If you do/did the sanity test for x32, you will see why the symlink is needed (it's not needed for 32-bit). I've looked through the latest multilib book and don't see the creation of the symlink anywhere so i think the book is missing that. I guess the move to the new build system was pretty disruptive and it's taking time to sort things out for the multilib edition.
My memory says the host kernel does indeed require x32 support for at least one package (otherwise it will error out during configure). It may have been zlib - don't remember. The symlink should be /libx32 --> /usr/libx32.
So let me get this clear: I make a symlink to /usr/libx32instead of creating a separate directory for /libx32 as instructed. I would like to get this to work, not for my own requirements but because, if there is indeed a glitch in the book, it needs to be found and corrected. I'm quite happy to go back to the beginning if that's necessary. And just for safety, I'll rebuild my host kernel to support x32 as well.
So here is what I did. First I rebuilt and reinstalled the host kernel with 32x support added. No problems there. Then I started rebuilding LFS-10. I ran into another spot of bother which happened the last time too but I forgot to mention it in my earlier posts: when I was building M4 (the first item in the new Chap 6), it aborted because of some incompatibility in limits.h. And yes, before you ask, I did remember to carry out that extra copy operation after installing gcc. As soon as I saw it, I recalled that this had happened before and that I solved it by rebuilding and reinstalling gcc. So I did that again and everything worked fine until I got to zlib. All three versions of glibc installed correctly, all three versions of ncurses installed correctly, but for zlib, only 64-bit and pure 32-bit could be built. 32x failed at configuration.
Now as regards this link from $LFS/libx32 to $LFS/usr/libx32. I can't work out exactly when I'm supposed to create this or how to specify the link target. You can't at this stage use "/usr/libx32" as a target because you're not in chroot and so it simply tries to link to a non-existent directory on the host. But you need to have something of that name as a top-level $LFS directory or glibc-x32 won't build. The book (chap 4.2) says to create a proper directory there, not a link, before you build anything. That works for glibc-x32 but it results in 32x libraries being distributed across both directories, with the linknames in $LFS/usr/libx32 and the actual libraries and sonames in $LFS/libx32.
Sorry, i was thinking of my system where i have /bin and /lib symlinked to usr/{bin,lib}. The book doesn't do it that way. I think you are going to find the host kernel needs to be set up like this to build for all "3" architectures:
Code:
#
# Binary Emulations
#
CONFIG_IA32_EMULATION=y
CONFIG_X86_X32=y
CONFIG_COMPAT_32=y
CONFIG_COMPAT=y
CONFIG_COMPAT_FOR_U64_ALIGNMENT=y
CONFIG_SYSVIPC_COMPAT=y
# end of Binary Emulations
See the bottom of the page in the book section: 2.2. Host System Requirements:
Quote:
In case your kernel does not have 'x32 ABI for 64-bit mode' enabled but only 'IA32 Emulation', you can continue to build your system but you have to leave out any sections showing instructions for building x32 objects. If neither 'IA32 Emulation' nor 'x32 ABI for 64-bit mode' is enabled, you will run in errors latest when building glibc in Chapter 6, so an upgrade of your host system kernel is required.
Sorry, i was thinking of my system where i have /bin and /lib symlinked to usr/{bin,lib}. The book doesn't do it that way.
Good, that sorts out the link conundrum.
Quote:
I think you are going to find the host kernel needs to be set up like this to build for all "3" architectures:
Code:
#
# Binary Emulations
#
CONFIG_IA32_EMULATION=y
CONFIG_X86_X32=y
CONFIG_COMPAT_32=y
CONFIG_COMPAT=y
CONFIG_COMPAT_FOR_U64_ALIGNMENT=y
CONFIG_SYSVIPC_COMPAT=y
# end of Binary Emulations
See the bottom of the page in the book section: 2.2. Host System Requirements:
Well, here's mine after rebuilding the kernel:
Code:
# Binary Emulations
#
CONFIG_IA32_EMULATION=y
# CONFIG_IA32_AOUT is not set
CONFIG_X86_X32=y
CONFIG_COMPAT_32=y
CONFIG_COMPAT=y
CONFIG_COMPAT_FOR_U64_ALIGNMENT=y
CONFIG_SYSVIPC_COMPAT=y
CONFIG_X86_DEV_DMA_OPS=y
CONFIG_HAVE_GENERIC_GUP=y
Of course there could have been a glitch during the reinstallation. Really just to be sure, I ought to have the configuration dumped to /proc so I can check it for the actual running kernel. But thanks, I'll read that section again.
Any ideas on the limits.h glitch? I didn't get that with the published book.
Sent my last post before i saw your reply...
In my notes, i see no problems with m4 in chapter 6 (this with Sept 15 dated multilib book). So, i don't know what is going on there.
Regarding zlib for x32: After you boot with newly configured host kernel, you could try compiling zlib for x32 directly on the host (or just completing a successful configure). If it doesn't work on the host, it won't work in the chroot.
Correction - that would not work unless the host compiler is set up to build x32 stuff. Uh, I think at this point i would just omit x32 zlib and only build 32/x32 glibc.
It is after the sanity check for plain glibc in Chapt. 5 -- And, just before "5.5.2. Building Glibc - 32bit". This is with the latest multilib checkout dated Nov 1 (they updated it). I don't have a older version to check.
Bah! Yet another failure. This time it's the gcc rebuild in chapter 6 which crashes with a whole string of error messages while building isl. That's very strange because the first gcc build in chapter 5 also used isl and built normally.
Do I actually need isl? I've never used it in gcc builds before (and that includes the published version of LFS-10). I googled a bit and it only seems to be required to do loop optimisations, presumably to speed up compilations.
I assume it's just the authors preference - the multilib book used to also include a firmware tarball. I guess you could omit it but I would be concerned about the errors - i never had an issue including isl. Perhaps it's time to start over? Maybe you are okay if all sanity tests pass.
I think you're probably right. I've often told people who get into trouble with standard LFS that it's no good just ploughing on regardless, using improvised fixes to get over problems. So it makes no sense to do that myself. I'm just annoyed that I ran into so many problems. That isn't normal for me.
There may be an issue with package versions. I was using the standard LFS-10 packages since I already have them on disk, but I noticed that the svn has some differences. In particular they use a later version of mpfr. I don't know how much difference that would make.
I'll see how I feel. Thanks for all your help anyway.
There may be an issue with package versions. I was using the standard LFS-10 packages since I already have them on disk, but I noticed that the svn has some differences. In particular they use a later version of mpfr. I don't know how much difference that would make.
I have used older mpc, mpfr and gmp and changed versions here and there before and mostly it's safe. GCC, glibc and binutils are more important.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.