Bug 121307 - Parallel build issue with bootstrap-ubsan
Summary: Parallel build issue with bootstrap-ubsan
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: other (show other bugs)
Version: 16.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: build
Depends on:
Blocks: 84402
  Show dependency treegraph
 
Reported: 2025-07-30 02:25 UTC by Sam James
Modified: 2025-07-30 02:52 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
build.log.xz (316.36 KB, application/x-xz)
2025-07-30 02:25 UTC, Sam James
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sam James 2025-07-30 02:25:32 UTC
Created attachment 62000 [details]
build.log.xz

```
[...]
Configuring in ./gnattools
configure: loading cache ./config.cache
checking for a BSD-compatible install... /usr/lib/portage/python3.13/ebuild-helpers/xattr/install -c
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for x86_64-pc-linux-gnu-gcc... /var/tmp/portage/sys-devel/gcc-16.0.9999/work/build/./gcc/xgcc -B/var/tmp/portage/sys-devel/gcc-16.0.9999/work/build/./gcc/ -B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/ -isystem /usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include   -fchecking=1
checking whether the C compiler works... no
configure: error: in `/var/tmp/portage/sys-devel/gcc-16.0.9999/work/build/gnattools':
configure: error: C compiler cannot create executables
See `config.log' for more details
make[1]: *** [Makefile:13962: configure-gnattools] Error 1
make[1]: Leaving directory '/var/tmp/portage/sys-devel/gcc-16.0.9999/work/build'
[...]
config.status: executing gstdint.h commands
make[1]: Leaving directory '/var/tmp/portage/sys-devel/gcc-16.0.9999/work/build'
make: *** [Makefile:30927: bootstrap-lean] Error 2
 * ERROR: sys-devel/gcc-16.0.9999::gentoo failed (compile phase):
 *   emake failed
```

I don't have the config.log anymore, sorry, but it was straightforward with
```
$ /var/tmp/portage/sys-devel/gcc-16.0.9999/work/build/./gcc/xgcc -B/var/tmp/portage/sys-devel/gcc-16.0.9999/work/build/./gcc/ -B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/ -isystem /usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include   -fchecking=1 -g -g1 -O2    -D_GENTOO_TIME64_FORCE=0 -static-libstdc++ -static-libgcc -fsanitize=undefined -static-libubsan -DUBSAN_BOOTSTRAP -B/var/tmp/portage/sys-devel/gcc-16.0.9999/work/build/prev-x86_64-pc-linux-gnu/libsanitizer/ -B/var/tmp/portage/sys-devel/gcc-16.0.9999/work/build/prev-x86_64-pc-linux-gnu/libsanitizer/ubsan/ -B/var/tmp/portage/sys-devel/gcc-16.0.9999/work/build/prev-x86_64-pc-linux-gnu/libsanitizer/ubsan/.libs -Wl,-O1 conftest.c
```
failing b/c it couldn't find libsanitizer.spec. It existed in previous bulid dirs but not in build/gcc.

It looks to me like with bootstrap-ubsan, if you don't have the same compiler version already installed w/ libsanitizer, then in some cases, libsanitizer.spec and libubsan.a might not be found because there isn't anything forcing a dependency on libcc1, gnattools etc on libsanitizer?

Copying libsanitizer.spec and libubsan.a into /var/tmp/portage/sys-devel/gcc-16.0.9999/work/build/gcc fixed it.
Comment 1 Sam James 2025-07-30 02:48:03 UTC Comment hidden (obsolete)
Comment 2 Sam James 2025-07-30 02:52:15 UTC Comment hidden (obsolete)