Opened 6 months ago

Closed 5 months ago

#15085 closed bug (fixed)

Bootstraps broken post-gcc8

Reported by: kallisti5 Owned by: bonefish
Priority: normal Milestone: Unscheduled
Component: Build System Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description (last modified by kallisti5)

Bootstrap of all platforms is broken post-gcc8.

Investigation so far:

  • cross-tools build successfully sysroot=.../cross-tools-$(arch)/sysroot
  • cross-tools builds gcc_bootstrap:
    • --with-sysroot=/
    • --with-build-sysroot=/work/generated.x86_64/objects/haiku/x86_64/packaging/repositories/HaikuPortsCross-build/sys-devel/gcc_bootstrap/work-7.3.0_2018_05_01/boot/cross-sysroot/x86_64/
    • (I was trying to build 7.3.0 here, but also tried using gcc_bootstrap-8.x. the same path is used except the version differs)

The issue is the gcc_bootstrap attempts to create a binary and fails due to being unable to locate:

/work/generated.x86_64/cross-tools-x86_64/lib/gcc/x86_64-unknown-haiku/8.3.0/../../../../x86_64-unknown-haiku/bin/ld: cannot find crti.o: No such file or directory
/work/generated.x86_64/cross-tools-x86_64/lib/gcc/x86_64-unknown-haiku/8.3.0/../../../../x86_64-unknown-haiku/bin/ld: cannot find start_dyn.o: No such file or directory
/work/generated.x86_64/cross-tools-x86_64/lib/gcc/x86_64-unknown-haiku/8.3.0/../../../../x86_64-unknown-haiku/bin/ld: cannot find init_term_dyn.o: No such file or directory
/work/generated.x86_64/cross-tools-x86_64/lib/gcc/x86_64-unknown-haiku/8.3.0/../../../../x86_64-unknown-haiku/bin/ld: cannot find -lroot
/work/generated.x86_64/cross-tools-x86_64/lib/gcc/x86_64-unknown-haiku/8.3.0/../../../../x86_64-unknown-haiku/bin/ld: cannot find crtn.o: No such file or directory

These do exist within the sysroot though:

root@4e0d056f6d26:/work/generated.x86_64/objects/haiku/x86_64/packaging/repositories/HaikuPortsCross-build/sys-devel/gcc_bootstrap/work-7.3.0_2018_05_01/boot/cross-sysroot/x86_64# find . | grep lib
./packages/gcc_bootstrap_syslibs-7.3.0_2018_05_01-1
./packages/gcc_bootstrap_syslibs-7.3.0_2018_05_01-1/.self
./packages/gcc_bootstrap_syslibs_devel-7.3.0_2018_05_01-1
./packages/gcc_bootstrap_syslibs_devel-7.3.0_2018_05_01-1/.self
./boot/system/develop/lib
./boot/system/develop/lib/crti.o
./boot/system/develop/lib/crtn.o
./boot/system/develop/lib/init_term_dyn.o
./boot/system/develop/lib/start_dyn.o
./boot/system/develop/lib/haiku_version_glue.o
./boot/system/develop/lib/libroot.so
./boot/system/develop/headers/glibc
./boot/system/develop/headers/glibc/_G_config.h
./boot/system/develop/headers/glibc/printf.h
./boot/system/develop/headers/posix/libgen.h
./boot/system/develop/headers/posix/libio.h
./boot/system/develop/headers/posix/stdlib.h
./boot/system/develop/headers/bsd/libutil.h
./boot/system/develop/headers/bsd/stdlib.h

In the past, we saw this on RISC-V due to this issue which resulted in similar errors: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89955

However, the STARTFILE_PREFIX_SPEC doesn't seem to be at play here since all architectures see the issue, and only riscv64 redefine it.

As noted above, tried building gcc_bootstrap 7 with the gcc 8 cross-tools... and the same error occurred. This seems to indicate that there is some change within the initial buildtools (gcc8) cross-tools-build causing the issue.

Change History (3)

comment:1 by kallisti5, 6 months ago

Description: modified (diff)

comment:2 by kallisti5, 6 months ago

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90653 was raised for this issue.

tldr: gcc isn't prefixing the BELIBRARIES/STARTFILE/ENDFILE with the provided --sysroot internally when calling ld after the gcc8 update.

I have no idea what the cause is at this time... nothing obvious.

comment:3 by waddlesplash, 5 months ago

Resolution: fixed
Status: newclosed

This was fixed by btrev43146.

Note: See TracTickets for help on using tickets.