Skip to content

Commit e9ddf7d

Browse files
Use gcc-7.5.0/8.5.0 as host compilers with correct version bands (#45)
SS_Stack was introduced in gcc 8's Ada runtime and bindgen.adb, so gcc-8.5.0's gnatbind generates SS_Stack references — incompatible with gcc 5-7 Ada runtimes. Correct the version bands: MAJOR <= 7 : gcc-7.5.0 (bindgen predates SS_Stack) MAJOR 8-10 : gcc-8.5.0 (bindgen has SS_Stack; no __gnat_begin_handler_v1) Replaces gcc-9.4.0 (no longer needed) with gcc-7.5.0 in the Dockerfile. 🤖 Generated by LLM (Claude, via OpenClaw) Co-authored-by: mattgodbolt-molty <mattgodbolt-molty@users.noreply.github.com>
1 parent b17e101 commit e9ddf7d

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@ RUN apt update -y -q && apt upgrade -y -q && apt upgrade -y -q && apt install -y
3535
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s - -y
3636

3737
# Install CE compilers for use as host when building old GCC versions.
38-
# - gcc 9.4.0: C/C++ host for MAJOR <= 10 (modern g++ 11+ too strict for old GCC source)
39-
# - gcc 8.5.0: Ada (gnat) host for MAJOR <= 8 (gcc 9.4.0's gnat uses SS_Stack which
40-
# gcc 5-8 Ada runtimes don't have; gcc 8.5.0's gnat predates that interface)
38+
# SS_Stack was introduced in gcc 8's Ada runtime and bindgen.adb; __gnat_begin_handler_v1
39+
# was introduced in gcc 11. So:
40+
# MAJOR <= 7 : gcc-7.5.0 host (bindgen predates SS_Stack; compatible with gcc 5-7)
41+
# MAJOR 8-10 : gcc-8.5.0 host (bindgen has SS_Stack; no __gnat_begin_handler_v1)
4142
RUN git clone --depth=1 https://github.com/compiler-explorer/infra /opt/compiler-explorer/infra && \
4243
cd /opt/compiler-explorer/infra && make ce && \
43-
/opt/compiler-explorer/infra/bin/ce_install install 'compilers/c++/x86/gcc 9.4.0' && \
44+
/opt/compiler-explorer/infra/bin/ce_install install 'compilers/c++/x86/gcc 7.5.0' && \
4445
/opt/compiler-explorer/infra/bin/ce_install install 'compilers/c++/x86/gcc 8.5.0'
4546

4647
# We build from a directory that must be at least searchable with

build/build.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -311,13 +311,13 @@ applyPatchesAndConfig "gcc${PATCH_VERSION:-$VERSION}"
311311
# For GCC 5-10, the system compiler (gcc-11+) and system gnat are incompatible
312312
# with older GCC source and Ada runtimes. Pick a CE-installed host GCC whose
313313
# C++ and Ada (gnat1/gnatbind) are ABI-compatible with the version being built:
314-
# MAJOR <= 8 : gcc-8.5.0 (C++ host + gnat; predates SS_Stack Ada interface)
315-
# MAJOR 9-10 : gcc-9.4.0 (C++ host + gnat; no __gnat_begin_handler_v1)
314+
# MAJOR <= 7 : gcc-7.5.0 (bindgen predates SS_Stack; compatible with gcc 5-7 Ada)
315+
# MAJOR 8-10 : gcc-8.5.0 (bindgen has SS_Stack; no __gnat_begin_handler_v1)
316316
if [[ "${MAJOR}" =~ ^[0-9]+$ ]] && [[ "${MAJOR}" -le 10 ]]; then
317-
if [[ "${MAJOR}" -le 8 ]]; then
318-
CE_HOST_GCC=/opt/compiler-explorer/gcc-8.5.0
317+
if [[ "${MAJOR}" -le 7 ]]; then
318+
CE_HOST_GCC=/opt/compiler-explorer/gcc-7.5.0
319319
else
320-
CE_HOST_GCC=/opt/compiler-explorer/gcc-9.4.0
320+
CE_HOST_GCC=/opt/compiler-explorer/gcc-8.5.0
321321
fi
322322
if [[ ! -d "${CE_HOST_GCC}" ]]; then
323323
echo "ERROR: CE host gcc not found at ${CE_HOST_GCC} (required to build gcc ${MAJOR})"

0 commit comments

Comments
 (0)