|
|
Subscribe / Log in / New account

Linux from Scratch version 10.0 released

On September 1, the Linux From Scratch (LFS) project announced the release of version 10.0 of LFS along with Beyond Linux From Scratch (BLFS). LFS is "a project that provides you with step-by-step instructions for building your own customized Linux system entirely from source"; BLFS picks up where LFS leaves off. Both books are available online either with or without systemd: LFS System V, LFS systemd, BLFS System V, and BLFS systemd. "The LFS release includes updates to glibc-2.31, and binutils-2.34. A total of 35 packages have been updated. A new package, zstd-1.4.4, has also been added. Changes to text have been made throughout the book. The Linux kernel has also been updated to version 5.5.3. The BLFS version includes approximately 1000 packages beyond the base Linux From Scratch Version 9.1 book. This release has over 840 updates from the previous version in addition to numerous text and formatting changes."

to post comments

Linux from Scratch version 10.0 released

Posted Sep 5, 2020 14:43 UTC (Sat) by tjc (guest, #137) [Link]

Linux from Scratch version 10.0 released

Posted Sep 6, 2020 10:21 UTC (Sun) by ppisa (subscriber, #67307) [Link] (3 responses)

I am curious for (may it be 10 years) why the Linux from Scratch is using newlib trick to bring-up toolchain. In the fact I have even fear that configuring final toolchain with Newlib based one installed and its libraries used for final configure can lead to contamination of configure decisions by newlib limitations. When I want to have compatible toolchain, I use real target system tree as sysroot. When I want to have clean, GCC, glibc developers proposed clean unpolluted configuration, then I use Glibc install-headers.

I start with binutils

CFLAGS=-O2 LDFLAGS=-s \
../../../src/binutils/configure \
        --prefix=/usr \
        --exec-prefix=/usr \
        --disable-nls \
        --with-gnu-ld --with-gnu-as \
        --verbose --with-mmap --enable-64-bit-bfd \
        --build=x86_64-linux-gnu \
        --host=x86_64-linux-gnu \
        --target=riscv64-linux-gnu \
        \
        --enable-targets=riscv64-linux-gnu \
        --enable-threads=posix \
        --enable-linker-build-id \
        --enable-gnu-unique-object \
        --with-sysroot=/usr/riscv64-linux-gnu/sys-root \
        --with-system-zlib \
        --enable-multiarch \
        --disable-werror \
        --enable-checking=release
Then Glibc without C compiller
CC=riscv64-unknown-elf-gcc \
../../../src/glibc/configure --prefix=/usr \
        --build=x86_64-linux-gnu \
        --host=riscv64-linux-gnu \
        --prefix=/usr \
        --enable-add-ons=libidn,nptl \
        --without-selinux \
        --with-xlen=64 \
        --with-headers=/usr/riscv64-linux-gnu/sys-include \
        --enable-kernel=4.19.0 \


make DESTDIR=/usr/local/pkg/glibc-linux-riscv-2.29-1 \
     inst_includedir=/usr/local/pkg/glibc-linux-riscv-2.29-1/include \
     install-bootstrap-headers=yes install-headers
Gcc
../../../src/gcc-9/configure -v \
         --enable-languages=c \
         --prefix=/usr \
         --with-system-zlib \
         --without-included-gettext \
         --enable-threads=posix \
         --enable-shared \
         --disable-nls \
         --with-gnu-ld \
         --with-gnu-as \
         --disable-newlib \
         --enable-clocale=gnu \
         --enable-objc-gc \
         --enable-mpfr \
         --enable-tls \
         --enable-secureplt \
         --enable-targets=riscv64-linux-gnu \
         --enable-symvers=gnu \
         --enable-checking=release \
         --build=x86_64-linux-gnu \
         --host=x86_64-linux-gnu \
         --target=riscv64-linux-gnu \
         --enable-version-specific-runtime-libs \
         --disable-libgomp \
         --with-sysroot=/usr/riscv64-linux-gnu/sys-root \
         \
         --enable-linker-build-id \
         --enable-libstdcxx-time=yes \
         --enable-gnu-unique-object \
         --enable-plugin \
         --disable-multiarch \
         --disable-multilib \
         --with-tune=size \
         --disable-sjlj-exceptions \
then real Glibc build
../../../src/glibc-git/configure \
        --build=x86_64-linux-gnu \
        --host=riscv64-linux-gnu \
        --prefix=/usr \
        --enable-add-ons=libidn,nptl \
        --without-selinux \
        --with-xlen=64 \
        --with-headers=/usr/riscv64-linux-gnu/sys-include \
        --enable-kernel=4.19.0 \
and then GCC again so build stabilizes.

I believe that this way I obtain clean build not influenced by any previous toolchains decisions.

Have somebody idea, if this solution has some drawbacks why it should not be used and why LFS does not use it? I expect that LFS is result of many people much more knowable than me.

Linux from Scratch version 10.0 released

Posted Sep 6, 2020 10:32 UTC (Sun) by ppisa (subscriber, #67307) [Link]

I have forgot the preparation step, setup and configure Linux kernel and run
make ARCH=riscv INSTALL_HDR_PATH=/usr/riscv64-linux-gnu/sys-include headers_install
RISC-V is taken as example only and it was the last toolchain I have build from scratch, but setup worked for ARMs, PowerPCs, etc...

For PowerPC there was some fun to decide some choices to be compatible with other Linux distros in the past (example from 2008)

libc_cv_ppc_machine=yes \
libc_cv_mabi_ibmlongdouble=yes \
libc_cv_mlong_double_128=yes \
libc_cv_forced_unwind=yes \
libc_cv_c_cleanup=yes \
../../../src/glibc/configure --prefix=/usr \
        --build=x86_64-linux-gnu \
        --host=powerpc-linux-gnu \
        --prefix=/usr \
        --without-cvs \
        --enable-add-ons=libidn,nptl \
        --enable-profile \
        --without-selinux \
        --with-headers=/usr/powerpc-linux-gnu/sys-include \
        --enable-kernel=2.6.26 \
        --enable-hacker-mode \
         --without-cvs --disable-sanity-checks \


make DESTDIR=/usr-pkg/glibc-linux-powerpc-2.7-1 \
     inst_includedir=/usr-pkg/glibc-linux-powerpc-2.7-1/include \
     install-headers
But it worked and I hope I have got again really clean build not pulling in any previous history and implicit choices.

Linux from Scratch version 10.0 released

Posted Sep 7, 2020 17:23 UTC (Mon) by jsm28 (subscriber, #104141) [Link] (1 responses)

No glibc version with RISC-V support also supported the old add-ons mechanism, and NPTL ceased to be an add-on some years before that, so those configure options appear to be copied from options applicable to a much older glibc version. The install-bootstrap-headers mechanism is something even older from EGLIBC that was never added to glibc because a newer bootstrap process superseded the process it was intended to be used with. --with-newlib in this context is confusingly named; it does not mean to use newlib; it means to define inhibit_libc when building libgcc. For the recommended modern (fully supported with glibc 2.16 and GCC 4.9 or later) process for bootstrapping a cross toolchain with glibc, I advise looking at how glibc's build-many-glibcs.py script, used in CI to build toolchains for every ABI supported by glibc, does the bootstrap.

https://sourceware.org/legacy-ml/libc-alpha/2018-03/msg00... discusses these bootstrap processes in more detail.

Linux from Scratch version 10.0 released

Posted Sep 7, 2020 18:16 UTC (Mon) by ppisa (subscriber, #67307) [Link]

Thanks much for clarification. I have not realized that --with-newlib can be used when newlib is not made available to the build. You are right that I keep and reuse some configs from nineties when I have started to build GCC 2.x for m68k. I usually compare options with these used by Debian distribution, RTEMS etc. Thanks for pointer to the script and discussion. I will look at it.


Copyright © 2020, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds