On Sat, Apr 20, 2013 at 04:47:07PM +0200, Sebastien Fievet wrote: > Hello there, > > I am the happy owner of a 64 bits laptop onto which I deliberately built a 32 > bits > only LFS. Everything was fine until yesterday when I bought the latest > release of > Matlab (2013a) which linux version is 64 bits only. :-( > > I'd like to try building a 64 bits version of the libc to make it happy, but > I am not > too sure about the steps (and what would be the effort)... > > Do I need to create 64 bits capable versions of binutils and gcc beforehand ? > If so, will the 64 bits versions overwrite their already installed 32 bits > counterparts ? > Will they support building both 32 bits and 64 bits binaries ? > > I took a look a cbls, but I am not too sure how I can "adapt" the build > process to > my need. > > Any help will be much appreciated. > > Thanks, > Seb.
First, confirm exactly what you need. I'm guessing that means libc in /usr/lib64 but it is _possible_ that you might need an old version, or one built for an old kernel [ you never know, with binary software, so it pays to ask before you get started ]. You might also need gcc libraries, particularly a specific version of libstdc++. That might be a deal breaker. In an ideal world, you would have a spare system (32-bit, with a processor capable of 64-bit) which you could use for testing. Your question makes me think you don't have such a system. Can you copy your existing 32-bit LFS to a different partition, to use as a test playground ? (if you can't, what will you do when you want to build your next LFS/BLFS system ?). Basically, this question is like the motorist asking for directions from an old countryman - "I wouldn't start from here". As lux-integ said, glibc is one of the fundamental parts of the system. However, if you need to install a second glibc in /usr/lib64 when everything is currently using /usr/lib, it _might_ be possible. I'm thinking along the following lines: 1. Follow cross-lfs x86_64 multilib. You don't have a 64-bit toolchain, nor libc, so it's probably best to build their chapters 5 and 6, and then more-or-less follow the chroot method. 2. Actually, your kernel is 32-bit. So you will need to build a 64-bit kernel using the cross-lfs chapter 7 packages [ obviously, you don't need grub, nor the CLFS bootscripts, and it's probably best to compile everything in rather than using modules ]. Once you have a 64-bit kernel you can boot it (to run your 32-bit userspace) and use that to chroot to the new system - so, keep the toolchain around for your next kernel upgrade. 3. Build and install glibc 64-bit [ strictly, this ie eglibc in clfs ]. I'm guessing you can skip the 32-bit glibc. As well as the libraries, glibc installs a lot of programs and headers. I'm not sure about the headers [ I haven't built multilib for many years ], but if you aren't going to build 64-bit userspace then you don't need them. For the programs, you want the 32-bit LFS versions. Keep a log of what eglibc installs [ or just do it in a DESTDIR, since you won't be completing the clfs build ], then copy all the /lib64 and /usr/lib64 files to your LFS system. And add the 64-bit directories to /etc/ld.so.conf [ section 10.8.4 in clfs ]. Might work, might not. Cross compiling is always a pain, particularly when upgrading the kernel. If the package versions in clfs-2.0 are suitable for the binaries you have bought, it might be easier to build a new system following the clfs book. Or get a 64-bit Live CD and use that to build a 64-bit LFS [ again, assuming that it will match your binary's requirements ]. The real pain of multilib, which is why I gave it up, is working through the dependencies (some things are only needed in one size, some in the other, yet others are needed in both sizes - depending on what *you* want to achieve), and passing the appropriate -m32|-m64 and LIBDIR settings. If you follow what is in cblfs you will notice that many things are built for both sizes [ strictly, "all" sizes - they cover MIPS ]. That works, but at the cost of building all libraries twice. ĸen -- das eine Mal als Tragödie, das andere Mal als Farce -- http://linuxfromscratch.org/mailman/listinfo/blfs-support FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page
