On Mon, 2012-12-17 at 12:36 +0000, Ken Moffat wrote: > Yes, I've only built pure64 x86_64 LFS for the past few years. > The difference in LFS is that it has the /lib64 symlinks so it isn't > quite so 'clean'.
Eh, it turns out it's not that hard to get rid of those. I've been playing with that over the past week or two, and after looking at how CLFS did it and from looking at the code, I ended up with a couple of simple patches for glibc and gcc (which I've attached). The gcc one is needed for all three gcc builds, the glibc one only for the chapter 6 build. Additionally, the glibc one needs the following command run from inside the glibc-build directory, before running configure: echo "slibdir=/lib" >> configparms Now, I haven't done *much* testing of this yet, but it's sufficient to complete the LFS build without /lib64 and /usr/lib64 existing as either directories or symlinks. It's also possible there's some stuff in the patches that isn't needed, but I've not yet had time to try simplifying things any further. Simon.
Several changes to force glibc to put 64-bit libraries in /lib instead of /lib64, and 32-bit libraries in /lib32 instead of /lib. The sed expression is kind of ugly, but basically it's looking for something like: /lib64/ld-linux-x86-64.so.2 and extracting the important bits to turn it into: "/lib/ld-linux.so.2 /lib64/ld-linux-x86-64.so.2 /libx32/ld-linux-x32.so.2" The change makes it instead produce: "/lib32/ld-linux.so.2 /lib/ld-linux-x86-64.so.2 /libx32/ld-linux-x32.so.2" diff --git a/sysdeps/unix/sysv/linux/x86_64/ldconfig.h b/sysdeps/unix/sysv/linux/x86_64/ldconfig.h index 6f5b828..e8b2b6b 100644 --- a/sysdeps/unix/sysv/linux/x86_64/ldconfig.h +++ b/sysdeps/unix/sysv/linux/x86_64/ldconfig.h @@ -18,9 +18,9 @@ #include <sysdeps/generic/ldconfig.h> #define SYSDEP_KNOWN_INTERPRETER_NAMES \ - { "/lib/ld-linux.so.2", FLAG_ELF_LIBC6 }, \ + { "/lib32/ld-linux.so.2", FLAG_ELF_LIBC6 }, \ { "/libx32/ld-linux-x32.so.2", FLAG_ELF_LIBC6 }, \ - { "/lib64/ld-linux-x86-64.so.2", FLAG_ELF_LIBC6 }, + { "/lib/ld-linux-x86-64.so.2", FLAG_ELF_LIBC6 }, #define SYSDEP_KNOWN_LIBRARY_NAMES \ { "libc.so.6", FLAG_ELF_LIBC6 }, \ { "libm.so.6", FLAG_ELF_LIBC6 }, diff --git a/sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed b/sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed index 44d76e8..58d977c 100644 --- a/sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed +++ b/sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed @@ -1,3 +1,3 @@ /LD_TRACE_LOADED_OBJECTS=1/a\ add_env="$add_env LD_LIBRARY_VERSION=\\$verify_out" -s_^\(RTLDLIST=\)\(.*lib\)\(\|64\|x32\)\(/[^/]*\)\(-x86-64\|-x32\)\(\.so\.[0-9.]*\)[ ]*$_\1"\2\4\6 \264\4-x86-64\6 \2x32\4-x32\6"_ +s_^\(RTLDLIST=\)\(.*lib\)\(\|64\|x32\)\(/[^/]*\)\(-x86-64\|-x32\)\(\.so\.[0-9.]*\)[ ]*$_\1"\232\4\6 \2\4-x86-64\6 \2x32\4-x32\6"_
Force gcc to look for the 64-bit runner in /lib instead of /lib64. (also look for the 32-bit runner in /lib32 instead of /lib) diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h index 5b0a212..e4d02cc 100644 --- a/gcc/config/i386/linux64.h +++ b/gcc/config/i386/linux64.h @@ -28,6 +28,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define GNU_USER_LINK_EMULATION64 "elf_x86_64" #define GNU_USER_LINK_EMULATIONX32 "elf32_x86_64" -#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" -#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2" +#define GLIBC_DYNAMIC_LINKER32 "/lib32/ld-linux.so.2" +#define GLIBC_DYNAMIC_LINKER64 "/lib/ld-linux-x86-64.so.2" #define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2" diff --git a/gcc/config/i386/t-linux64 b/gcc/config/i386/t-linux64 index b5d3985..03d8f32 100644 --- a/gcc/config/i386/t-linux64 +++ b/gcc/config/i386/t-linux64 @@ -34,6 +34,6 @@ comma=, MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG)) MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS))) -MULTILIB_OSDIRNAMES = m64=../lib64 -MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib) +MULTILIB_OSDIRNAMES = m64=../lib +MULTILIB_OSDIRNAMES+= m32=../lib32 MULTILIB_OSDIRNAMES+= mx32=../libx32
signature.asc
Description: This is a digitally signed message part
-- http://linuxfromscratch.org/mailman/listinfo/blfs-support FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page