LinuxQuestions.org
Review your favorite Linux distribution.
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 11-11-2020, 08:20 AM   #16
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,646

Original Poster
Blog Entries: 19

Rep: Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480

Quote:
Originally Posted by bryan_S View Post
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/libx32 instead 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.
 
Old 11-12-2020, 09:16 AM   #17
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,646

Original Poster
Blog Entries: 19

Rep: Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480
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.
 
Old 11-12-2020, 09:19 AM   #18
bryan_S
Member
 
Registered: Aug 2014
Location: N. Florida
Distribution: Linux-from-Scratch
Posts: 109

Rep: Reputation: Disabled
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.
 
Old 11-12-2020, 09:42 AM   #19
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,646

Original Poster
Blog Entries: 19

Rep: Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480
Quote:
Originally Posted by bryan_S View Post
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.
 
Old 11-12-2020, 09:50 AM   #20
bryan_S
Member
 
Registered: Aug 2014
Location: N. Florida
Distribution: Linux-from-Scratch
Posts: 109

Rep: Reputation: Disabled
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.

Last edited by bryan_S; 11-12-2020 at 10:04 AM.
 
Old 11-12-2020, 10:16 AM   #21
bryan_S
Member
 
Registered: Aug 2014
Location: N. Florida
Distribution: Linux-from-Scratch
Posts: 109

Rep: Reputation: Disabled
Did you run this in 5.5. Glibc-2.32?
Code:
$LFS/tools/libexec/gcc/$LFS_TGT/10.2.0/install-tools/mkheaders
That would account for the limits.h issue i would think, which is more serious than inablility to build x32 zlib.
 
Old 11-12-2020, 10:19 AM   #22
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,646

Original Poster
Blog Entries: 19

Rep: Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480
Quote:
Originally Posted by bryan_S View Post
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.
Nor me, but I seem to have worked around it.
Quote:
Uh, I think at this point i would just omit x32 zlib and only build 32/x32 glibc.
That's exactly what I plan to do. But when the build is finished, I might try building 32x-zlib on the new system and see how that goes.
 
Old 11-12-2020, 10:28 AM   #23
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,646

Original Poster
Blog Entries: 19

Rep: Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480
Quote:
Originally Posted by bryan_S View Post
Did you run this in 5.5. Glibc-2.32?
Code:
$LFS/tools/libexec/gcc/$LFS_TGT/10.2.0/install-tools/mkheaders
That would account for the limits.h issue i would think, which is more serious than inablility to build x32 zlib.
No. Where does it say to do that? I don't remember seeing it anywhere.
 
Old 11-12-2020, 10:40 AM   #24
bryan_S
Member
 
Registered: Aug 2014
Location: N. Florida
Distribution: Linux-from-Scratch
Posts: 109

Rep: Reputation: Disabled
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.
 
Old 11-12-2020, 10:48 AM   #25
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,646

Original Poster
Blog Entries: 19

Rep: Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480
You're right! I never noticed that instruction. But I suppose that reinstalling gcc did the same thing.

In the mean time, I tried building x32 zlib by using the same configuration method that is used for x32 ncurses and that works perfectly well.

Last edited by hazel; 11-12-2020 at 11:07 AM.
 
Old 11-13-2020, 11:40 AM   #26
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,646

Original Poster
Blog Entries: 19

Rep: Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480
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.
 
Old 11-13-2020, 04:29 PM   #27
bryan_S
Member
 
Registered: Aug 2014
Location: N. Florida
Distribution: Linux-from-Scratch
Posts: 109

Rep: Reputation: Disabled
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.
 
1 members found this post helpful.
Old 11-14-2020, 04:29 AM   #28
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,646

Original Poster
Blog Entries: 19

Rep: Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480
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.
 
Old 11-14-2020, 08:48 AM   #29
hendrickxm
Member
 
Registered: Feb 2014
Posts: 344

Rep: Reputation: Disabled
Quote:
Originally Posted by hazel View Post
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.
 
Old 11-14-2020, 11:01 AM   #30
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,646

Original Poster
Blog Entries: 19

Rep: Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480
Quote:
Originally Posted by hendrickxm View Post
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.
Those are all the same.
 
  


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
Blacklisting zlib after multilib update? Lysander666 Slackware 5 07-14-2018 06:24 AM
VirtualBox Starter Pack - LFS as a Host For Your LFS Build basica Linux From Scratch 4 11-25-2015 12:02 PM
[SOLVED] Build LFS 64 bit on multilib Slackware64-current mralk3 Linux From Scratch 3 07-27-2015 11:35 AM
no matching comp found: client zlib none, zlib@openssh.com lost connection jorge_ivan Linux - Networking 0 08-14-2006 07:09 PM
Cygwin/X has problem when running on IBM X32 ThinkPad math_physics Linux - Software 13 03-20-2006 04:19 PM

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

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