Index: chapter05/gcc-pass1.xml =================================================================== --- chapter05/gcc-pass1.xml (revision 11147) +++ chapter05/gcc-pass1.xml (working copy) @@ -68,8 +68,7 @@ class="directory">/usr/include from GCC's include search path. Issue: -for file in \ - $(find gcc/config -name linux64.h -o -name linux.h -o -name sysv4.h) +for file in gcc/config/{linux,i386/linux{,64}}.h do cp -uv $file{,.orig} sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \ @@ -97,7 +96,18 @@ Finally, we use touch to update the timestamp on the copied files. When used in conjunction with cp -u, this prevents unexpected changes to the original files in case the commands are - inadvertently run twice. + inadvertently run twice. + + Finally, on x86_64 hosts, set the default directory name for + 64-bit libraries to lib: + +case $(uname -m) in + x86_64) + sed -e '/m64=/s/lib64/lib/' \ + -i.orig gcc/config/i386/t-linux64 + ;; +esac + + If building on x86_64, change the default direcotory name for 64-bit + libraries to lib: + +case $(uname -m) in + x86_64) + sed -e '/m64=/s/lib64/lib/' \ + -i.orig gcc/config/i386/t-linux64 + ;; +esac + The GCC documentation recommends building GCC in a dedicated build directory: mkdir -v build @@ -175,10 +185,8 @@ Depending on your machine architecture, the above may differ slightly, the difference usually being the name of the directory - after /usr/lib/gcc. If your machine is - a 64-bit system, you may also see a directory named lib64 - towards the end of the string. The important thing to - look for here is that gcc has found all three + after /usr/lib/gcc. The important + thing to look for here is that gcc has found all three crt*.o files under the /usr/lib directory. Index: chapter06/glibc.xml =================================================================== --- chapter06/glibc.xml (revision 11147) +++ chapter06/glibc.xml (working copy) @@ -57,6 +57,18 @@ patch -Np1 -i ../&glibc-fhs-patch; + Create a symlink for LSB compliance and, for x86_64, a + compatibility symlink required for the dynamic loader to function + correctly: + +case $(uname -m) in + x86) ln -s ld-linux.so.2 /lib/ld-lsb.so.3 + ;; + x86_64) ln -s ../lib/ld-linux-x86-64.so.2 /lib64 + ln -s ../lib/ld-linux-x86-64.so.2 /lib64/ld-lsb-x86-64.so.3 + ;; +esac + The Glibc documentation recommends building Glibc in a dedicated build directory: @@ -67,7 +79,8 @@ ../configure --prefix=/usr \ --enable-kernel=&min-kernel; \ - --enable-obsolete-rpc + --enable-obsolete-rpc \ + libc_cv_slibdir=/lib Compile the package: Index: chapter06/libcap.xml =================================================================== --- chapter06/libcap.xml (revision 11147) +++ chapter06/libcap.xml (working copy) @@ -55,7 +55,7 @@ Install the package: -make RAISE_SETFCAP=no prefix=/usr install +make RAISE_SETFCAP=no lib=lib prefix=/usr install chmod -v 755 /usr/lib/libcap.so