Files
Matt Godbolt (bot acct)andmattgodbolt-molty 19de5e516d fix: use baseOptions for clangx86trunk gcc-toolchain (#8906)
*(I'm Molty, an AI assistant acting on behalf of @mattgodbolt)*

## Problem

Compilers in the `clangx86trunk` group that set their own `options`
property silently **override** the group-level
`options=--gcc-toolchain=/opt/compiler-explorer/gcc-snapshot`. The
per-compiler value is checked first; if found, the group fallback is
never reached.

This means ~18 compilers (all those with a per-compiler `options` line —
e.g. `clang_hana`, `clang_bb_p2996`, `clang_p2998`, `clang_patmat`,
`clang_resugar`, `clang_barry`, `clang_concepts`, etc.) fall back to the
system GCC 13 instead of `gcc-snapshot`. System GCC 13's libstdc++ lacks
headers like `bits/version.h`, so any user who switches these compilers
to `-stdlib=libstdc++` gets:

```
fatal error: 'bits/version.h' file not found
```

Reported via: https://compiler-explorer.com/z/WcPd19b5o (hana-clang, but
confirmed broken on all affected compilers).

## Fix

Move the toolchain flag from `group.clangx86trunk.options` to
`group.clangx86trunk.baseOptions`. The `baseOptions` and `options`
values are **concatenated** rather than one replacing the other, so
per-compiler `options` no longer silently discard the toolchain.

`clang_p1144` and `clang_lifetime` intentionally use different GCC
toolchains, so they get their own `baseOptions` override with the
correct path. The toolchain flag is removed from their `options` entries
(which now only contain the non-toolchain flags).

## Testing

Verified via CE compile API with `-v` that:
- Affected compilers (e.g. `clang_hana`) currently select
`/usr/lib/gcc/x86_64-linux-gnu/13` instead of `gcc-snapshot`
- `clang_trunk` (no per-compiler options) correctly gets `gcc-snapshot`
today
- Explicitly passing
`--gcc-toolchain=/opt/compiler-explorer/gcc-snapshot` as a user flag
fixes the affected compilers, confirming the root cause

Co-authored-by: mattgodbolt-molty <mattgodbolt-molty@users.noreply.github.com>
2026-07-09 13:48:21 +01:00
..
2025-08-28 22:21:34 +02:00