From 1ba4a12ef0bc3615865c2eb7e40b555f86a01965 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 31 Jan 2026 12:10:39 +0000 Subject: [PATCH 1/2] [CI] Move gold linker flag to Linux-only in reusable workflow The -DLLVM_USE_LINKER=gold flag was being passed via extra_cmake_args to all platforms including Windows. The gold linker is Linux-only and meaningless on MSVC (where link.exe ignores the -fuse-ld=gold flag). Move the flag into the Linux-specific section of llvm-project-tests.yml and remove it from the callers' extra_cmake_args. This ensures: - Linux builds continue to use the gold linker for faster link times - Windows builds no longer receive an irrelevant linker flag - macOS builds are unaffected (they never used gold) https://claude.ai/code/session_017NN2b54K47DTW7awZEKXx9 --- .github/workflows/amd-aie-tests.yml | 2 +- .github/workflows/amd-upstream-tests.yml | 4 ++-- .github/workflows/llvm-project-tests.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/amd-aie-tests.yml b/.github/workflows/amd-aie-tests.yml index d84551feb89f..9961e20a8c72 100644 --- a/.github/workflows/amd-aie-tests.yml +++ b/.github/workflows/amd-aie-tests.yml @@ -29,5 +29,5 @@ jobs: build_target: check-llvm-aie check-clang-aie check-lld-aie projects: clang;lld cache-key: amd-aie - extra_cmake_args: '-DLLVM_USE_LINKER=gold -C clang/cmake/caches/Peano-AIE.cmake' + extra_cmake_args: '-C clang/cmake/caches/Peano-AIE.cmake' os_list: '["ubuntu-22.04"]' diff --git a/.github/workflows/amd-upstream-tests.yml b/.github/workflows/amd-upstream-tests.yml index 34290724938e..83e99fd09d9e 100644 --- a/.github/workflows/amd-upstream-tests.yml +++ b/.github/workflows/amd-upstream-tests.yml @@ -29,7 +29,7 @@ jobs: build_target: check-all projects: clang cache-key: amd-upstream - extra_cmake_args: '-DLLVM_USE_LINKER=gold -DLLVM_TARGETS_TO_BUILD="X86;ARM;AArch64;AMDGPU" -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=""' + extra_cmake_args: '-DLLVM_TARGETS_TO_BUILD="X86;ARM;AArch64;AMDGPU" -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=""' os_list: ${{ github.ref_name == 'aie-public' && '["ubuntu-22.04", "windows-2022"]' || '["ubuntu-22.04"]' }} check_lld: @@ -40,6 +40,6 @@ jobs: build_target: check-lld projects: lld cache-key: amd-upstream - extra_cmake_args: '-DLLVM_USE_LINKER=gold -DLLVM_TARGETS_TO_BUILD="X86;ARM;AArch64;AMDGPU" -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=""' + extra_cmake_args: '-DLLVM_TARGETS_TO_BUILD="X86;ARM;AArch64;AMDGPU" -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=""' os_list: ${{ github.ref_name == 'aie-public' && '["ubuntu-22.04", "windows-2022"]' || '["ubuntu-22.04"]' }} diff --git a/.github/workflows/llvm-project-tests.yml b/.github/workflows/llvm-project-tests.yml index 802f538be839..5a9e3c599dd8 100644 --- a/.github/workflows/llvm-project-tests.yml +++ b/.github/workflows/llvm-project-tests.yml @@ -132,7 +132,7 @@ jobs: builddir="/mnt/build/" sudo mkdir -p $builddir sudo chown gha $builddir - extra_cmake_args="-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang" + extra_cmake_args="-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DLLVM_USE_LINKER=gold" else builddir="$(pwd)"/build fi From d2b6959c26c8fca21d74aeab4b7402126b1ec4a7 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 31 Jan 2026 12:52:01 +0000 Subject: [PATCH 2/2] [Test] Fix 5 Windows test failures in upstream check-all Fix the 5 tests that fail on windows-2022 in the AIEngine Upstream Tests CI workflow: 1. LLVM-Unit :: ExecutionEngine/Orc/OrcJITTests.exe ReOptimizeLayerTest.BasicReOptimization: On Windows, the default InProcessMemoryManager can return non-contiguous allocations, causing .pdata (SEH unwind data) Pointer32 relocations to overflow when reaching .text. Use MapperJITLinkMemoryManager with a 10MB contiguous slab instead. (Upstream fix: llvm/llvm-project#163495) 2-5. Clang :: CodeGen/fake-use-this.cpp Clang :: CodeGen/fake-use-noreturn.cpp Clang :: CodeGen/fake-use-determinism.c Clang :: CodeGen/extend-variable-liveness.c These tests lacked an explicit -triple, so on Windows they used the host triple (x86_64-pc-windows-msvc). The CHECK patterns expect Itanium ABI name mangling (_Z... symbols), which doesn't match MSVC mangling. Add -triple x86_64-unknown-linux-gnu to each. (Upstream fix: llvm/llvm-project@de9b0dd) Also add triple to extend-variable-liveness-except.cpp which uses __cxa_begin_catch (Itanium EH, not available under MSVC ABI). https://claude.ai/code/session_017NN2b54K47DTW7awZEKXx9 --- clang/test/CodeGen/extend-variable-liveness-except.cpp | 2 +- clang/test/CodeGen/extend-variable-liveness.c | 2 +- clang/test/CodeGen/fake-use-determinism.c | 2 +- clang/test/CodeGen/fake-use-noreturn.cpp | 2 +- clang/test/CodeGen/fake-use-this.cpp | 2 +- llvm/unittests/ExecutionEngine/Orc/ReOptimizeLayerTest.cpp | 6 +++++- 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/clang/test/CodeGen/extend-variable-liveness-except.cpp b/clang/test/CodeGen/extend-variable-liveness-except.cpp index 13a5c2e64404..5a09ad53fc08 100644 --- a/clang/test/CodeGen/extend-variable-liveness-except.cpp +++ b/clang/test/CodeGen/extend-variable-liveness-except.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm -fextend-variable-liveness -fcxx-exceptions -fexceptions -o - | FileCheck %s +// RUN: %clang_cc1 %s -triple x86_64-unknown-linux-gnu -emit-llvm -fextend-variable-liveness -fcxx-exceptions -fexceptions -o - | FileCheck %s // This test checks that the fake uses can be generated in exception handling // blocks and that we can emit fake uses for the __int128 data type. diff --git a/clang/test/CodeGen/extend-variable-liveness.c b/clang/test/CodeGen/extend-variable-liveness.c index 0eae155a9259..c6bca48e6469 100644 --- a/clang/test/CodeGen/extend-variable-liveness.c +++ b/clang/test/CodeGen/extend-variable-liveness.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm -fextend-variable-liveness -o - | FileCheck %s --implicit-check-not=llvm.fake.use +// RUN: %clang_cc1 %s -triple x86_64-unknown-linux-gnu -emit-llvm -fextend-variable-liveness -o - | FileCheck %s --implicit-check-not=llvm.fake.use // Check that fake use calls are emitted at the correct locations, i.e. // at the end of lexical blocks and at the end of the function. diff --git a/clang/test/CodeGen/fake-use-determinism.c b/clang/test/CodeGen/fake-use-determinism.c index 459d7915cbe9..039d8de69243 100644 --- a/clang/test/CodeGen/fake-use-determinism.c +++ b/clang/test/CodeGen/fake-use-determinism.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm -fextend-variable-liveness %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -fextend-variable-liveness %s -o - | FileCheck %s // // We are checking that the fake.use calls for i, j and k appear // in a particular order. It is not the order itself that is important diff --git a/clang/test/CodeGen/fake-use-noreturn.cpp b/clang/test/CodeGen/fake-use-noreturn.cpp index 6a3a07cc5abe..db7f27735b1d 100644 --- a/clang/test/CodeGen/fake-use-noreturn.cpp +++ b/clang/test/CodeGen/fake-use-noreturn.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm -fextend-variable-liveness -o - | FileCheck %s +// RUN: %clang_cc1 %s -triple x86_64-unknown-linux-gnu -emit-llvm -fextend-variable-liveness -o - | FileCheck %s // // Check we can correctly produce fake uses for function-level variables even // when we have a return in a nested conditional and there is no code at the end diff --git a/clang/test/CodeGen/fake-use-this.cpp b/clang/test/CodeGen/fake-use-this.cpp index 2c49694b2cd4..3d2e52187648 100644 --- a/clang/test/CodeGen/fake-use-this.cpp +++ b/clang/test/CodeGen/fake-use-this.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm -fextend-this-ptr-liveness -o - | FileCheck %s --implicit-check-not=fake.use +// RUN: %clang_cc1 %s -triple x86_64-unknown-linux-gnu -emit-llvm -fextend-this-ptr-liveness -o - | FileCheck %s --implicit-check-not=fake.use // Check that we generate a fake_use call with the 'this' pointer as argument, // and no other fake uses. // The call should appear after the call to bar(). diff --git a/llvm/unittests/ExecutionEngine/Orc/ReOptimizeLayerTest.cpp b/llvm/unittests/ExecutionEngine/Orc/ReOptimizeLayerTest.cpp index 083a924ce9aa..ba5113e73261 100644 --- a/llvm/unittests/ExecutionEngine/Orc/ReOptimizeLayerTest.cpp +++ b/llvm/unittests/ExecutionEngine/Orc/ReOptimizeLayerTest.cpp @@ -9,6 +9,8 @@ #include "llvm/ExecutionEngine/Orc/IRTransformLayer.h" #include "llvm/ExecutionEngine/Orc/JITLinkRedirectableSymbolManager.h" #include "llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h" +#include "llvm/ExecutionEngine/Orc/MapperJITLinkMemoryManager.h" +#include "llvm/ExecutionEngine/Orc/MemoryMapper.h" #include "llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h" #include "llvm/ExecutionEngine/Orc/ObjectTransformLayer.h" #include "llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h" @@ -69,7 +71,9 @@ class ReOptimizeLayerTest : public testing::Test { ES = std::make_unique(std::move(*EPC)); JD = &ES->createBareJITDylib("main"); ObjLinkingLayer = std::make_unique( - *ES, std::make_unique(16384)); + *ES, std::make_unique( + 10 * 1024 * 1024, + std::make_unique(16384))); DL = std::make_unique(std::move(*DLOrErr)); auto TM = JTMB->createTargetMachine();