From 9dfc02ff38f26117daffe7d8b822ebb64a3fed04 Mon Sep 17 00:00:00 2001 From: Zack Winkles Date: Mon, 3 May 2004 21:28:58 +0000 Subject: Current BE-LFS (but w/ GCC 3.3.3) merged -> 6.0 branch git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@3445 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- chapter05/bash.xml | 2 +- chapter05/binutils-pass2.xml | 13 +++++++- chapter05/bison.xml | 46 ++++++++++++++++++++++++++++ chapter05/bzip2.xml | 6 +++- chapter05/chapter05.xml | 6 ++++ chapter05/flex.xml | 57 +++++++++++++++++++++++++++++++++++ chapter05/gcc-pass1.xml | 5 ++-- chapter05/gcc-pass2.xml | 35 ++++------------------ chapter05/gettext.xml | 15 +++++++++- chapter05/glibc.xml | 44 +++++++++++++++------------ chapter05/hostreqs.xml | 26 ++++++++++++++++ chapter05/kernel-headers.xml | 10 +++---- chapter05/linux-libc-headers.xml | 34 +++++++++++++++++++++ chapter05/m4.xml | 46 ++++++++++++++++++++++++++++ chapter05/perl.xml | 6 ---- chapter05/udev.xml | 65 ++++++++++++++++++++++++++++++++++++++++ chapter05/util-linux.xml | 8 +++-- 17 files changed, 356 insertions(+), 68 deletions(-) create mode 100644 chapter05/bison.xml create mode 100644 chapter05/flex.xml create mode 100644 chapter05/hostreqs.xml create mode 100644 chapter05/linux-libc-headers.xml create mode 100644 chapter05/m4.xml create mode 100644 chapter05/udev.xml (limited to 'chapter05') diff --git a/chapter05/bash.xml b/chapter05/bash.xml index a2ec5683e..d5d5ee747 100644 --- a/chapter05/bash.xml +++ b/chapter05/bash.xml @@ -29,7 +29,7 @@ patch: Now prepare Bash for compilation: -./configure --prefix=/tools +./configure --prefix=/tools --without-bash-malloc Compile the program: diff --git a/chapter05/binutils-pass2.xml b/chapter05/binutils-pass2.xml index 32c749b77..78436e1b0 100644 --- a/chapter05/binutils-pass2.xml +++ b/chapter05/binutils-pass2.xml @@ -50,7 +50,16 @@ running the test suites for the temporary tools here in this chapter. If nevertheless you want to run the Binutils test suite, the following command will do so: -make check +make -k check + +Except for a few known failures, the binutils tests should all pass. The +exceptions to this rule are as follows: + +* 5 FAIL (unexpected failure) for visibility +* 1 FAIL for selective4 +* 1 FAIL for selective5 + + + And install the package: make install diff --git a/chapter05/bison.xml b/chapter05/bison.xml new file mode 100644 index 000000000..8be0bc2b9 --- /dev/null +++ b/chapter05/bison.xml @@ -0,0 +1,46 @@ + + + %general-entities; +]> + +Bison-&bison-version; + + + +Bison +tools + + + +&buildtime; 0.6 SBU +&diskspace; 10.6 MB + + + + + +Installation of Bison + +Prepare Bison for compilation: + +./configure --prefix=/tools + +Compile the package: + +make + +To test the results, issue: +make check. + +Now install the package: + +make install + + + + +The details on this package are found in . + + + diff --git a/chapter05/bzip2.xml b/chapter05/bzip2.xml index 11b45b599..0671fcc16 100644 --- a/chapter05/bzip2.xml +++ b/chapter05/bzip2.xml @@ -23,7 +23,11 @@ Installation of Bzip2 The Bzip2 package doesn't contain a configure -script. Compile and install it with a straightforward: +script. Compile it with a straightforward: + +make + +And install it: make PREFIX=/tools install diff --git a/chapter05/chapter05.xml b/chapter05/chapter05.xml index 9a939e00e..bf810d2fb 100644 --- a/chapter05/chapter05.xml +++ b/chapter05/chapter05.xml @@ -9,9 +9,11 @@ + + @@ -35,8 +37,12 @@ + + + + diff --git a/chapter05/flex.xml b/chapter05/flex.xml new file mode 100644 index 000000000..b158c5f5a --- /dev/null +++ b/chapter05/flex.xml @@ -0,0 +1,57 @@ + + + %general-entities; +]> + +Flex-&flex-version; + + + +Flex +tools + + + +&buildtime; 0.6 SBU +&diskspace; 10.6 MB + + + + + +Installation of Bison + +Flex contains several known bugs. Fix these with the following patch: + +patch -Np1 -i ../flex-&flex-version;-debian-fixes-2.patch + +The GNU autotools detects that the Flex source code has been modified by +the patch, and tries to update the man pages to include those changes, but this +breaks on many systems, and the default pages are fine, so make sure they don't +get renegerated: + +touch doc/*.1 + +Now prepare Flex for compilation: + +./configure --prefix=/tools + +Compile the package: + +make + +To test the results, issue: +make check. + +Now install the package: + +make install + + + + +The details on this package are found in . + + + diff --git a/chapter05/gcc-pass1.xml b/chapter05/gcc-pass1.xml index 68c429fb0..d5b2a3fa0 100644 --- a/chapter05/gcc-pass1.xml +++ b/chapter05/gcc-pass1.xml @@ -40,9 +40,8 @@ cd ../gcc-build Prepare GCC for compilation: ../gcc-&gcc-version;/configure --prefix=/tools \ - --with-local-prefix=/tools \ - --disable-nls --enable-shared \ - --enable-languages=c + --libexecdir=/tools/lib --with-local-prefix=/tools \ + --disable-nls --enable-shared --enable-languages=c The meaning of the configure options: diff --git a/chapter05/gcc-pass2.xml b/chapter05/gcc-pass2.xml index d89d82e82..fbf321af4 100644 --- a/chapter05/gcc-pass2.xml +++ b/chapter05/gcc-pass2.xml @@ -83,10 +83,9 @@ variables that override the default optimization flags. Now prepare GCC for compilation: ../gcc-&gcc-version;/configure --prefix=/tools \ - --with-local-prefix=/tools \ - --enable-clocale=gnu --enable-shared \ - --enable-threads=posix --enable-__cxa_atexit \ - --enable-languages=c,c++ + --libexecdir=/tools/lib --with-local-prefix=/tools \ + --enable-clocale=gnu --enable-shared --enable-threads=posix \ + --enable-__cxa_atexit --enable-languages=c,c++ The meaning of the new configure options: @@ -141,34 +140,12 @@ a summary of the test suite results, run this: You can compare your results to those posted to the gcc-testresults mailing list for similar configurations to your own. For an example of how current GCC-&gcc-version; should look on i686-pc-linux-gnu, see -. - -Note that the results contain: - -* 1 XPASS (unexpected pass) for g++ -* 1 FAIL (unexpected failure) for gcc -* 24 XPASS's for libstdc++ - -The unexpected pass for g++ is due to the use of ---enable-__cxa_atexit. Apparently not all platforms -supported by GCC have support for __cxa_atexit in their C -libraries, so this test is not always expected to pass. - -The 24 unexpected passes for libstdc++ are due to the use of ---enable-clocale=gnu. This option, which is the correct -choice on Glibc-based systems of versions 2.2.5 and above, enables in the GNU C -library a locale support that is superior to the otherwise selected -generic model (which may be applicable if for instance you -were using Newlibc, Sun-libc or whatever other libc). The libstdc++ test suite -is apparently expecting the generic model, hence those -tests are not always expected to pass. +. Having a few unexpected failures often cannot be avoided. The GCC developers are usually aware of these, but haven't yet gotten around to fixing -them. One particular case in point is the filebuf_members test in the C++ -standard library testsuite. This test has been observed to fail in some -situations, but succeeed in others. In short, unless your results are vastly -different from those at the above URL, it is safe to continue. +them. In short, unless your results are vastly different from those at the above +URL, it is safe to continue. And finally install the package: diff --git a/chapter05/gettext.xml b/chapter05/gettext.xml index cebff68f1..836b3c3ef 100644 --- a/chapter05/gettext.xml +++ b/chapter05/gettext.xml @@ -24,7 +24,20 @@ Prepare Gettext for compilation: -./configure --prefix=/tools +./configure --prefix=/tools --disable-libasprintf \ + --disable-csharp + + +--disable-libasprintf: This flag tells +Gettext that we don't want its asprintf library. Nothing in Chapter 5 or 6 +requires this, and gettext gets rebuilt later, so we exclude it to save +time/space. + +--disable-csharp: Gettext has a nasty +habit of searching for a C# compiler on the host, and building bindings for it. +We've already locked ourselves into the temporary tools though, +which doesn't have a C# compiler. + Compile the programs: diff --git a/chapter05/glibc.xml b/chapter05/glibc.xml index 92d2f3ad8..48c22ea07 100644 --- a/chapter05/glibc.xml +++ b/chapter05/glibc.xml @@ -39,38 +39,44 @@ cd ../glibc-build Next, prepare Glibc for compilation: -../glibc-&glibc-version;-20031202/configure --prefix=/tools \ - --disable-profile --enable-add-ons=linuxthreads \ - --with-binutils=/tools/bin --with-headers=/tools/include \ - --without-gd --without-cvs +../glibc-&glibc-version;/configure --prefix=/tools \ + --disable-profile --enable-add-ons=nptl --with-tls \ + --with-binutils=/tools/bin --without-gd --without-cvs \ + --with-headers=/tools/glibc-kernheaders The meaning of the configure options: ---disable-profile: This -builds the libraries without profiling information. Omit this option if you -plan to do profiling on the temporary tools. +--disable-profile: This builds the +libraries without profiling information. Omit this option if you plan to do +profiling on the temporary tools. ---enable-add-ons=linuxthreads: This -tells Glibc to use the Linuxthreads add-on as its threading -library. +--enable-add-ons=nptl: This +tells Glibc to use the NPTL add-on as its threading library. ---with-binutils=/tools/bin and ---with-headers=/tools/include: Strictly speaking -these switches are not required. But they ensure nothing can go wrong with -regard to what kernel headers and Binutils programs get used during the -Glibc build. +--with-tls: This tells Glibc to include +support for TLS (thread-local storage). This is required for NPTL to work. + ---without-gd: This prevents -the build of the memusagestat program, which -strangely enough insists on linking against the host's libraries (libgd, -libpng, libz, and so forth). +--with-binutils=/tools/bin: Strictly +speaking this switch is not required. But it does ensure nothing can go wrong +with regard to what Binutils programs get used during the Glibc build. + +--without-gd: This prevents the build +of the memusagestat program, which strangely enough insists +on linking against the host's libraries (libgd, libpng, libz, and so forth). + --without-cvs: This is meant to prevent the Makefiles from attempting automatic CVS checkouts when using a CVS snapshot. But it's not actually needed these days. We use it because it suppresses an annoying but harmless warning about a missing autoconf program. + +--with-headers=/tools/glibc-kernheaders: +This tells Glibc to compile against the raw kernel headers, so +that it knows exactly what features the kernel has, and can optimize itself +accordingly. Not strictly necessary, but nice to have. During this stage you might see the following warning: diff --git a/chapter05/hostreqs.xml b/chapter05/hostreqs.xml new file mode 100644 index 000000000..c2d2ef4fb --- /dev/null +++ b/chapter05/hostreqs.xml @@ -0,0 +1,26 @@ + + + %general-entities; +]> + +Host system requirements + + +Due to the experimental nature of BE-LFS, the host must be running at +least a 2.6.2 kernel. The reasons for this high requirement +is the use of NPTL, but more importantly the use of udev. Udev creates devices +dynamically by reading from the sysfs file system. Only very recently has +support for this file system been implemented in most of the kernel drivers, +however. We must be sure that all the critical system devices get created +properly. + +As for obtaining such a kernel, let's hope you distributor has provided +a 2.6 kernel package for you. If so, install it. If not, you'll have to compile +it yourself. If you're forced into a situation where you need to compile it +yourself, it is highly recommended that you compile your kernel in a monolithic +manner, as you probably don't want to go fiddling with your hosts module +utilities. Supposing you don't want to listen, open up the module-init-tools +tarball and check out the README on how to get module support for 2.6. + + diff --git a/chapter05/kernel-headers.xml b/chapter05/kernel-headers.xml index e825fe66d..d4a4e0742 100644 --- a/chapter05/kernel-headers.xml +++ b/chapter05/kernel-headers.xml @@ -38,17 +38,17 @@ un-tarring. Create the platform-specific include/asm symlink: -make symlinks +make include/asm Install the platform-specific header files: -mkdir /tools/include/asm -cp include/asm/* /tools/include/asm -cp -R include/asm-generic /tools/include +mkdir /tools/glibc-kernheaders +cp -HR include/asm /tools/glibc-kernheaders +cp -R include/asm-generic /tools/glibc-kernheaders Finally, install the cross-platform kernel header files: -cp -R include/linux /tools/include +cp -R include/linux /tools/glibc-kernheaders diff --git a/chapter05/linux-libc-headers.xml b/chapter05/linux-libc-headers.xml new file mode 100644 index 000000000..5f7fdec1a --- /dev/null +++ b/chapter05/linux-libc-headers.xml @@ -0,0 +1,34 @@ + + + %general-entities; +]> + +Linux-Libc-Headers-&linux-libc-headers-version; + + + +Linux-Libc-Headers +tools, headers + +&buildtime; 0.1 SBU +&diskspace; 22 MB + + + +Installation of Linux-Libc-Headers + +For years it has been common practice to use so-called raw +kernel headers (straight from a kernel tarball) in /usr/include, but over the +last few years, the kernel developers have taken a strong stance that such +things should not be done. Thus was born the linux-libc-headers project, +designed to maintain an API stable version of the Linux headers. + +Install the header files: + +cp -R include/asm-i386 /tools/include/asm +cp -R include/linux /tools/include + + + + diff --git a/chapter05/m4.xml b/chapter05/m4.xml new file mode 100644 index 000000000..c07576003 --- /dev/null +++ b/chapter05/m4.xml @@ -0,0 +1,46 @@ + + + %general-entities; +]> + +M4-&m4-version; + + + +M4 +tools + + + +&buildtime; 0.1 SBU +&diskspace; 3.0 MB + + + + + +Installation of M4 + +Prepare M4 for compilation: + +./configure --prefix=/tools + +Compile the package: + +make + +To test the results, issue: +make check. + +Now install the package: + +make install + + + + +The details on this package are found in . + + + diff --git a/chapter05/perl.xml b/chapter05/perl.xml index 556bb66ea..2216d7154 100644 --- a/chapter05/perl.xml +++ b/chapter05/perl.xml @@ -26,12 +26,6 @@ patch -Np1 -i ../perl-&perl-version;-libc-1.patch -Perl insists on using the arch program to find out -the machine type. Create a little script to mimic this command: - -echo "uname -m" > /tools/bin/arch -chmod 755 /tools/bin/arch - Now prepare Perl for compilation (make sure you get the 'IO Fcntl POSIX' right, they are all letters): diff --git a/chapter05/udev.xml b/chapter05/udev.xml new file mode 100644 index 000000000..af957e2c0 --- /dev/null +++ b/chapter05/udev.xml @@ -0,0 +1,65 @@ + + + %general-entities; +]> + +Udev-&udev-version; + + + +Udev +tools + + + +&buildtime; 0.2 SBU +&diskspace; 5.2 MB + + + + +Installation of Udev + +By default, the permissions udev assigns to nodes are all uniform, +being owned by user root, group root, and only accessible to root. As you +can easily imagine, this isn't ideal. Give it a much better configuration +by applying the following patch: + +patch -Np1 -i ../udev-&udev-version;-config-1.patch + + +The udevstart program hardcodes the path to the udev program in itself, +which is bad since we install udev in a non-standard location. Fix this by +running the following: + +sed -i 's:\/sbin\/udev:/tools&:' udevstart.c + +Also assure that udev knows the correct location to look for its +configuration files: + +sed -i 's:\/etc:/tools&:' etc/udev/udev.conf.in + +Now compile Udev: + +make prefix=/tools etcdir=/tools/etc + +Generate Udev's main configuration file: + +make udevdir=/dev etc/udev/udev.conf + +And install finally install it: + +make DESTDIR=/tools install + + + + +The details on this package are found in . + + + diff --git a/chapter05/util-linux.xml b/chapter05/util-linux.xml index d5007d79a..7954b0f83 100644 --- a/chapter05/util-linux.xml +++ b/chapter05/util-linux.xml @@ -22,12 +22,16 @@ Installation of Util-linux +Util-linux has issues with the Linux 2.6 kernel series - fix these issues +by applying the following patch: + +patch -Np1 -i ../util-linux-&util-linux-version;-kernel-dj-2.6-1.patch + Util-linux doesn't use the freshly installed headers and libraries from the /tools directory. This is fixed by altering the configure script: -cp configure configure.backup -sed "s@/usr/include@/tools/include@g" configure.backup > configure +sed -i "s@/usr/include@/tools/include@g" configure Prepare Util-linux for compilation: -- cgit v1.2.3-54-g00ecf