dslm4515 / Musl-LFS

Linux From Scratch using Musl as Libc
GNU General Public License v3.0
167 stars 21 forks source link

Unable to Compile GCC 10.1 for Toolchain #24

Closed dslm4515 closed 4 years ago

dslm4515 commented 4 years ago

Step 10 fails with this output after command: PATH=/bin:/usr/bin:/cross-tools/bin:/tools/bin make

Output:


configure: summary of build options:

  Version:           GNU MP 6.2.0
  Host type:         none-mlfs-linux-musl
  ABI:               standard
  Install prefix:    /tools
  Compiler:          x86_64-mlfs-linux-musl-gcc
  Static libraries:  yes
  Shared libraries:  no

make[1]: Leaving directory '/mnt/mlfs/sources/gcc-10.1.0/build'
make: *** [Makefile:963: all] Error 2
dslm4515 commented 4 years ago

Rerunning command as make :

checking for an ANSI C-conforming const... yes
checking for inline... inline
checking whether byte ordering is bigendian... no
checking for a BSD-compatible install... /bin/install -c
checking for CET support... configure: error: in `/mnt/mlfs/sources/gcc-10.1.0/build/libiberty':
configure: error: cannot run test program while cross compiling
See `config.log' for more details
make[1]: *** [Makefile:8919: configure-libiberty] Error 1
make[1]: Leaving directory '/mnt/mlfs/sources/gcc-10.1.0/build'
make: *** [Makefile:963: all] Error 2
firasuke commented 4 years ago

Yes, this is actually due to broken CET in libiberty and lto-plugin (when cross compiling GCC), and was fixed by upstream.

Fetch that patch, and run patch -p1 -i Enable-CET-in-cross-compiler-if-possible.patch in gcc's source directory.

dslm4515 commented 4 years ago

I tried the --disable-cet flag. No change. Same output. Perhaps I need the flag also when building the cross-compiler?

dslm4515 commented 4 years ago

Ugh. I didn't see the other half of your message on mobile. I will try that patch.

P.S. using a new machine! i7-9700K with 16Gb ram!

firasuke commented 4 years ago

Oh the --disable-cet won't do anything, the CET check is faulty when checking for cross compilation in both libiberty and lto-plugin, so a patch is needed (and the one I provided above is from upstream itself).

Congratulations on the new machine!

dslm4515 commented 4 years ago

I applied patch, cleared build directory, ran configure and now compiling... So far no errors! Will check back on it later.

firasuke commented 4 years ago

Good to know.

dslm4515 commented 4 years ago

GCC compiled without error!

2.5 min build time on this i7 machine!

Just realized same patch was used in current development version of LFS. I forgot to check.

Patch will be included once I finish my build and upload it as branch 7.00