From b890b4cba3c3b7e0a5a454b5160721361d11fec3 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Wed, 5 Aug 2026 13:44:05 +0200 Subject: [PATCH] CI: build the MinGW Clang matrix without debug info (#5360) Linking test-regression2_cpp20 intermittently fails with unit-regression2.cpp.obj:(.debug_info+0x16): relocation truncated to fit: IMAGE_REL_AMD64_SECREL against `.debug_line' The failure moves between matrix entries from run to run, and the same commit can pass and fail on consecutive runs, so it is the size of the debug sections rather than any one Clang version. The jobs only build and run the tests, so override CMAKE_CXX_FLAGS_DEBUG to drop the default -g. Everything else about the Debug build is unchanged: no optimization flag is added and NDEBUG stays undefined, so JSON_ASSERT remains active. Signed-off-by: Niels Lohmann --- .github/workflows/windows.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index b7c640ce8..ff3089b1d 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -153,10 +153,16 @@ jobs: with: platform: x64 version: 12.2.0 # https://github.com/egor-tensin/setup-mingw/issues/14 + # CMAKE_CXX_FLAGS_DEBUG is overridden to drop the default -g: linking + # test-regression2_cpp20 intermittently fails with "relocation truncated + # to fit: IMAGE_REL_AMD64_SECREL against `.debug_line'" because the + # MinGW linker cannot relocate the debug sections this test produces. + # The tests are only built and run here, so the debug info is not used. - name: Run CMake run: cmake -S . -B build ^ -DCMAKE_CXX_COMPILER="C:/Program Files/LLVM/bin/clang++.exe" ^ -DCMAKE_CXX_FLAGS="--target=x86_64-w64-mingw32 -stdlib=libstdc++ -pthread" ^ + -DCMAKE_CXX_FLAGS_DEBUG="-g0" ^ -DCMAKE_EXE_LINKER_FLAGS="-lwinpthread" ^ -G"MinGW Makefiles" ^ -DCMAKE_BUILD_TYPE=Debug ^