Bug 121307

Summary: Parallel build issue with bootstrap-ubsan
Product: gcc Reporter: Sam James <sjames>
Component: otherAssignee: Not yet assigned to anyone <unassigned>
Status: UNCONFIRMED ---    
Severity: normal Keywords: build
Priority: P3    
Version: 16.0   
Target Milestone: ---   
See Also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60620
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed:
Bug Depends on:    
Bug Blocks: 84402    
Attachments: build.log.xz

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)