Looking for the standard way to build a standalone gcc+glibc+binutils toolchain at Linux

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi there,

I'm looking for the standard way to build a standalone
gcc+glibc+binutils toolchain at Linux. I want to use that standalone
toolchain to build a temporary system (a second toolchain of more
build tools like make, autoconf, bison, etc.) and use it to finally
build a new x86_64 Linux system from scratch under another x86_64
Linux system. I know about LFS but I don't like the way how it's done
there. I don't like patching the official source code and making
symbolic link at the root of the host Linux filesystem.

I tried to do it similar to LFS and without the things I don't like
but it doesn't work properly. For example running make-toolchain.sh of
the attached tarball ends with strange errors like following when it
tries to make a first compilation test of a trivial C code:

/home/rosti/toolchain/build/lib/gcc/x86_64-unknown-linux-gnu/7.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld:
cannot find /home/rosti/toolchain/build/lib/libc.so.6 inside
/home/rosti/toolchain/build

Why it tries to find an absolute path withing another absolute path?

I tried to change the --with-sysroot path and other build
configurations but it only changed the error I get. For example
instead of this error I had something like
x86_64-unknown-linux-gnu/bin/ld: cannot find crt1.o, i.e. it tried to
find that crt1.o in the current directory.

So I'm stuck and I'm looking for the standard way to make a standalone
gcc+glibc+binutils toolchain that will be independent from the host
system. Does it exist?

I've found a few other articles besides LFS about how people made such
a toolchain. But they also patched the official source code and made a
few other tricks.

P.S. to reduce the attachment size I've removed all files from the
artifacts directory in my tarball, so you need to put following files
into that directory before you try running make-toolchain.sh

binutils-2.29.1.tar.xz
gcc-7.2.0.tar.xz
glibc-2.26.tar.xz
gmp-6.1.2.tar.xz
isl-0.18.tar.bz2
linux-4.13.14.tar.xz
mpc-1.0.3.tar.gz
mpfr-3.1.6.tar.xz

Attachment: toolchain.tar.xz
Description: Binary data


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux