From 8a4f2c03af00425449441f067ad5f8e8ec17dcb8 Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Thu, 16 Jan 2025 13:16:12 +0000 Subject: [PATCH 01/62] Shared library build ci --- .github/workflows/Windows.yml | 68 +++++++------------ unittests/CppInterOp/CUDATest.cpp | 9 --- .../CppInterOp/FunctionReflectionTest.cpp | 10 --- unittests/CppInterOp/InterpreterTest.cpp | 12 ---- unittests/CppInterOp/JitTest.cpp | 3 - 5 files changed, 24 insertions(+), 78 deletions(-) diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index 58bc8faa7..8da37a419 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -21,27 +21,13 @@ jobs: fail-fast: false matrix: include: - - name: win2025-msvc-clang-repl-19 + - name: win2025-shared-lib os: windows-2025 - compiler: msvc - clang-runtime: '19' - cling: Off - llvm_enable_projects: "clang" - llvm_targets_to_build: "host;NVPTX" - - name: win2025-msvc-clang-repl-18 - os: windows-2025 - compiler: msvc + compiler: clang clang-runtime: '18' cling: Off llvm_enable_projects: "clang" llvm_targets_to_build: "host;NVPTX" - - name: win2025-msvc-clang-repl-17 - os: windows-2025 - compiler: msvc - clang-runtime: '17' - cling: Off - llvm_enable_projects: "clang" - llvm_targets_to_build: "host;NVPTX" steps: - uses: actions/checkout@v4 @@ -87,7 +73,7 @@ jobs: path: | llvm-project ${{ matrix.cling=='On' && 'cling' || '' }} - key: ${{ env.CLING_HASH }}-${{ runner.os }}-${{ matrix.os }}-${{ matrix.compiler }}-clang-${{ matrix.clang-runtime }}.x-patch-${{ hashFiles(format('patches/llvm/clang{0}-*.patch', matrix.clang-runtime)) || 'none' }} + key: ${{ env.CLING_HASH }}-${{ runner.os }}-${{ matrix.os }}-${{ matrix.compiler }}-clang-${{ matrix.clang-runtime }}.x-patch-${{ hashFiles(format('patches/llvm/clang{0}-*.patch', matrix.clang-runtime)) || 'none' }}-shared-lib lookup-only: true - name: Setup default Build Type on Windows @@ -107,10 +93,10 @@ jobs: choco install llvm --version=$ver --no-progress -my clang --version # - $env:CC="clang" - $env:CXX="clang++" - echo "CC=clang" >> $env:GITHUB_ENV - echo "CXX=clang++" >> $env:GITHUB_ENV + $env:CC="clang-cl" + $env:CXX="clang-cl" + echo "CC=clang-cl" >> $env:GITHUB_ENV + echo "CXX=clang-cl" >> $env:GITHUB_ENV } elseif ( "${{ matrix.compiler }}" -imatch "msvc" ) { @@ -153,7 +139,7 @@ jobs: if ( "${{ matrix.cling }}" -imatch "On" ) { cd build - cmake -DLLVM_ENABLE_PROJECTS="${{ matrix.llvm_enable_projects}}" ` + cmake -G Ninja -DLLVM_ENABLE_PROJECTS="${{ matrix.llvm_enable_projects}}" ` -DLLVM_EXTERNAL_PROJECTS=cling ` -DLLVM_EXTERNAL_CLING_SOURCE_DIR="$env:CLING_DIR" ` -DLLVM_TARGETS_TO_BUILD="${{ matrix.llvm_targets_to_build }}" ` @@ -166,6 +152,9 @@ jobs: -DLLVM_ENABLE_ZSTD=OFF ` -DLLVM_ENABLE_TERMINFO=OFF ` -DLLVM_ENABLE_LIBXML2=OFF ` + -DLLVM_BUILD_LLVM_DYLIB_VIS=On ` + -DLLVM_LINK_LLVM_DYLIB=On ` + -DCLANG_LINK_CLANG_DYLIB=On ` ..\llvm cmake --build . --config Release --target clang --parallel ${{ env.ncpus }} cmake --build . --config Release --target cling --parallel ${{ env.ncpus }} @@ -188,7 +177,7 @@ jobs: } cd build echo "Apply clang${{ matrix.clang-runtime }}-*.patch patches:" - cmake -DLLVM_ENABLE_PROJECTS="${{ matrix.llvm_enable_projects}}" ` + cmake -G Ninja -DLLVM_ENABLE_PROJECTS="${{ matrix.llvm_enable_projects}}" ` -DLLVM_TARGETS_TO_BUILD="${{ matrix.llvm_targets_to_build }}" ` -DCMAKE_BUILD_TYPE=Release ` -DLLVM_ENABLE_ASSERTIONS=ON ` @@ -199,6 +188,9 @@ jobs: -DLLVM_ENABLE_ZSTD=OFF ` -DLLVM_ENABLE_TERMINFO=OFF ` -DLLVM_ENABLE_LIBXML2=OFF ` + -DLLVM_BUILD_LLVM_DYLIB_VIS=On ` + -DLLVM_LINK_LLVM_DYLIB=On ` + -DCLANG_LINK_CLANG_DYLIB=On ` ..\llvm cmake --build . --config Release --target clang clang-repl --parallel ${{ env.ncpus }} } @@ -238,24 +230,12 @@ jobs: fail-fast: false matrix: include: - - name: win2025-msvc-clang-repl-19 - os: windows-2025 - compiler: msvc - clang-runtime: '19' - cling: Off - cppyy: Off - - name: win2025-msvc-clang-repl-18 + - name: win2025-shared-lib os: windows-2025 - compiler: msvc + compiler: clang clang-runtime: '18' cling: Off cppyy: Off - - name: win2025-msvc-clang-repl-17 - os: windows-2025 - compiler: msvc - clang-runtime: '17' - cling: Off - cppyy: Off steps: - uses: actions/checkout@v4 @@ -309,10 +289,10 @@ jobs: choco install llvm --version=$ver --no-progress -my clang --version # - $env:CC="clang" - $env:CXX="clang++" - echo "CC=clang" >> $env:GITHUB_ENV - echo "CXX=clang++" >> $env:GITHUB_ENV + $env:CC="clang-cl" + $env:CXX="clang-cl" + echo "CC=clang-cl" >> $env:GITHUB_ENV + echo "CXX=clang-cl" >> $env:GITHUB_ENV } elseif ( "${{ matrix.compiler }}" -imatch "msvc" ) { @@ -330,7 +310,7 @@ jobs: path: | llvm-project ${{ matrix.cling=='On' && 'cling' || '' }} - key: ${{ env.CLING_HASH }}-${{ runner.os }}-${{ matrix.os }}-${{ matrix.compiler }}-clang-${{ matrix.clang-runtime }}.x-patch-${{ hashFiles(format('patches/llvm/clang{0}-*.patch', matrix.clang-runtime)) || 'none' }} + key: ${{ env.CLING_HASH }}-${{ runner.os }}-${{ matrix.os }}-${{ matrix.compiler }}-clang-${{ matrix.clang-runtime }}.x-patch-${{ hashFiles(format('patches/llvm/clang{0}-*.patch', matrix.clang-runtime)) || 'none' }}-shared-lib - name: Build and Test/Install CppInterOp on Windows systems run: | @@ -382,7 +362,7 @@ jobs: echo "CPPINTEROP_BUILD_DIR=$env:CPPINTEROP_BUILD_DIR" >> $env:GITHUB_ENV if ( "${{ matrix.cling }}" -imatch "On" ) { - cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} ` + cmake -G Ninja -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} ` -DUSE_CLING=ON ` -DUSE_REPL=OFF ` -DCling_DIR="$env:LLVM_BUILD_DIR\tools\cling" ` @@ -392,7 +372,7 @@ jobs: } else { - cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} ` + cmake -G Ninja -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} ` -DLLVM_DIR="$env:LLVM_BUILD_DIR\lib\cmake\llvm" ` -DLLVM_ENABLE_WERROR=On ` -DClang_DIR="$env:LLVM_BUILD_DIR\lib\cmake\clang" -DCODE_COVERAGE=${{ env.CODE_COVERAGE }} -DCMAKE_INSTALL_PREFIX="$env:CPPINTEROP_DIR" ..\ diff --git a/unittests/CppInterOp/CUDATest.cpp b/unittests/CppInterOp/CUDATest.cpp index ea171b46e..17bf80dff 100644 --- a/unittests/CppInterOp/CUDATest.cpp +++ b/unittests/CppInterOp/CUDATest.cpp @@ -46,18 +46,12 @@ TEST(DISABLED_CUDATest, Sanity) { #else TEST(CUDATest, Sanity) { #endif // CLANG_VERSION_MAJOR < 16 -#ifdef _WIN32 - GTEST_SKIP() << "Disabled on Windows. Needs fixing."; -#endif if (!HasCudaSDK()) GTEST_SKIP() << "Skipping CUDA tests as CUDA SDK not found"; EXPECT_TRUE(Cpp::CreateInterpreter({}, {"--cuda"})); } TEST(CUDATest, CUDAH) { -#ifdef _WIN32 - GTEST_SKIP() << "Disabled on Windows. Needs fixing."; -#endif if (!HasCudaSDK()) GTEST_SKIP() << "Skipping CUDA tests as CUDA SDK not found"; @@ -67,9 +61,6 @@ TEST(CUDATest, CUDAH) { } TEST(CUDATest, CUDARuntime) { -#ifdef _WIN32 - GTEST_SKIP() << "Disabled on Windows. Needs fixing."; -#endif if (!HasCudaRuntime()) GTEST_SKIP() << "Skipping CUDA tests as CUDA runtime not found"; diff --git a/unittests/CppInterOp/FunctionReflectionTest.cpp b/unittests/CppInterOp/FunctionReflectionTest.cpp index efc1ca815..12b2ccd6d 100644 --- a/unittests/CppInterOp/FunctionReflectionTest.cpp +++ b/unittests/CppInterOp/FunctionReflectionTest.cpp @@ -800,9 +800,6 @@ TEST(FunctionReflectionTest, IsStaticMethod) { TEST(FunctionReflectionTest, GetFunctionAddress) { if (llvm::sys::RunningOnValgrind()) GTEST_SKIP() << "XFAIL due to Valgrind report"; -#ifdef _WIN32 - GTEST_SKIP() << "Disabled on Windows. Needs fixing."; -#endif std::vector Decls, SubDecls; std::string code = "int f1(int i) { return i * i; }"; @@ -1129,9 +1126,6 @@ TEST(FunctionReflectionTest, GetFunctionArgDefault) { TEST(FunctionReflectionTest, Construct) { if (llvm::sys::RunningOnValgrind()) GTEST_SKIP() << "XFAIL due to Valgrind report"; -#ifdef _WIN32 - GTEST_SKIP() << "Disabled on Windows. Needs fixing."; -#endif Cpp::CreateInterpreter(); @@ -1170,10 +1164,6 @@ TEST(FunctionReflectionTest, Destruct) { if (llvm::sys::RunningOnValgrind()) GTEST_SKIP() << "XFAIL due to Valgrind report"; -#ifdef _WIN32 - GTEST_SKIP() << "Disabled on Windows. Needs fixing."; -#endif - Cpp::CreateInterpreter(); Interp->declare(R"( diff --git a/unittests/CppInterOp/InterpreterTest.cpp b/unittests/CppInterOp/InterpreterTest.cpp index 22c5f0e99..5d72fe3cb 100644 --- a/unittests/CppInterOp/InterpreterTest.cpp +++ b/unittests/CppInterOp/InterpreterTest.cpp @@ -57,9 +57,6 @@ TEST(InterpreterTest, DebugFlag) { } TEST(InterpreterTest, Evaluate) { -#ifdef _WIN32 - GTEST_SKIP() << "Disabled on Windows. Needs fixing."; -#endif if (llvm::sys::RunningOnValgrind()) GTEST_SKIP() << "XFAIL due to Valgrind report"; // EXPECT_TRUE(Cpp::Evaluate(I, "") == 0); @@ -76,9 +73,6 @@ TEST(InterpreterTest, Evaluate) { } TEST(InterpreterTest, Process) { -#ifdef _WIN32 - GTEST_SKIP() << "Disabled on Windows. Needs fixing."; -#endif if (llvm::sys::RunningOnValgrind()) GTEST_SKIP() << "XFAIL due to Valgrind report"; Cpp::CreateInterpreter(); @@ -128,9 +122,6 @@ TEST(InterpreterTest, DetectResourceDir) { #else TEST(InterpreterTest, DISABLED_DetectResourceDir) { #endif // LLVM_BINARY_DIR -#ifdef _WIN32 - GTEST_SKIP() << "Disabled on Windows. Needs fixing."; -#endif Cpp::CreateInterpreter(); EXPECT_STRNE(Cpp::DetectResourceDir().c_str(), Cpp::GetResourceDir()); llvm::SmallString<256> Clang(LLVM_BINARY_DIR); @@ -140,9 +131,6 @@ TEST(InterpreterTest, DISABLED_DetectResourceDir) { } TEST(InterpreterTest, DetectSystemCompilerIncludePaths) { -#ifdef _WIN32 - GTEST_SKIP() << "Disabled on Windows. Needs fixing."; -#endif std::vector includes; Cpp::DetectSystemCompilerIncludePaths(includes); EXPECT_FALSE(includes.empty()); diff --git a/unittests/CppInterOp/JitTest.cpp b/unittests/CppInterOp/JitTest.cpp index 310f87efe..5d0e55d58 100644 --- a/unittests/CppInterOp/JitTest.cpp +++ b/unittests/CppInterOp/JitTest.cpp @@ -14,9 +14,6 @@ static int printf_jit(const char* format, ...) { TEST(JitTest, InsertOrReplaceJitSymbol) { if (llvm::sys::RunningOnValgrind()) GTEST_SKIP() << "XFAIL due to Valgrind report"; -#ifdef _WIN32 - GTEST_SKIP() << "Disabled on Windows. Needs fixing."; -#endif std::vector Decls; std::string code = R"( extern "C" int printf(const char*,...); From ef71aadfce0e7225f433e814d106809c6e2f758a Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Thu, 16 Jan 2025 13:19:00 +0000 Subject: [PATCH 02/62] Add shared build options to CppInterOp build --- .github/workflows/Windows.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index 8da37a419..de14d60fc 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -368,6 +368,7 @@ jobs: -DCling_DIR="$env:LLVM_BUILD_DIR\tools\cling" ` -DLLVM_DIR="$env:LLVM_BUILD_DIR" ` -DLLVM_ENABLE_WERROR=On ` + -DLLVM_BUILD_LLVM_DYLIB_VIS=On -DLLVM_LINK_LLVM_DYLIB=On -DCLANG_LINK_CLANG_DYLIB=On ` -DClang_DIR="$env:LLVM_BUILD_DIR" -DCODE_COVERAGE=${{ env.CODE_COVERAGE }} -DCMAKE_INSTALL_PREFIX="$env:CPPINTEROP_DIR" ..\ } else @@ -375,6 +376,7 @@ jobs: cmake -G Ninja -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} ` -DLLVM_DIR="$env:LLVM_BUILD_DIR\lib\cmake\llvm" ` -DLLVM_ENABLE_WERROR=On ` + -DLLVM_BUILD_LLVM_DYLIB_VIS=On -DLLVM_LINK_LLVM_DYLIB=On -DCLANG_LINK_CLANG_DYLIB=On ` -DClang_DIR="$env:LLVM_BUILD_DIR\lib\cmake\clang" -DCODE_COVERAGE=${{ env.CODE_COVERAGE }} -DCMAKE_INSTALL_PREFIX="$env:CPPINTEROP_DIR" ..\ cmake --build . --config ${{ env.BUILD_TYPE }} --target googletest --parallel ${{ env.ncpus }} } From 0f21a3de5a34ddd1d9d8a34cc9222f42726f0b6e Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Thu, 16 Jan 2025 13:26:35 +0000 Subject: [PATCH 03/62] Fix git clone for draft PR --- .github/workflows/Windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index de14d60fc..c10b63df4 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -130,7 +130,7 @@ jobs: } else { - git clone --depth=1 -b release/${{ matrix.clang-runtime }}.x https://github.com/llvm/llvm-project.git + git clone --depth=1 -b llvm-export-api-18.0 https://github.com/fsfod/llvm-project.git } cd llvm-project From 5c9ef540c4d9c934f1ce58bc36bcf28e278f14ec Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Thu, 16 Jan 2025 13:34:31 +0000 Subject: [PATCH 04/62] Add ASM compiler which works --- .github/workflows/Windows.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index c10b63df4..90cfa5a14 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -155,6 +155,8 @@ jobs: -DLLVM_BUILD_LLVM_DYLIB_VIS=On ` -DLLVM_LINK_LLVM_DYLIB=On ` -DCLANG_LINK_CLANG_DYLIB=On ` + -DCMAKE_ASM_MASM_COMPILER=llvm-ml ` + -DCMAKE_ASM_MASM_FLAGS="-m64" ` ..\llvm cmake --build . --config Release --target clang --parallel ${{ env.ncpus }} cmake --build . --config Release --target cling --parallel ${{ env.ncpus }} @@ -191,6 +193,8 @@ jobs: -DLLVM_BUILD_LLVM_DYLIB_VIS=On ` -DLLVM_LINK_LLVM_DYLIB=On ` -DCLANG_LINK_CLANG_DYLIB=On ` + -DCMAKE_ASM_MASM_COMPILER=llvm-ml ` + -DCMAKE_ASM_MASM_FLAGS="-m64" ` ..\llvm cmake --build . --config Release --target clang clang-repl --parallel ${{ env.ncpus }} } From 81402d1e3d5da3adacb6f262c5b0c63142ff41fe Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Thu, 16 Jan 2025 14:23:31 +0000 Subject: [PATCH 05/62] LLVM_ENABLE_PLUGINS --- .github/workflows/Windows.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index 90cfa5a14..7703ab18a 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -146,6 +146,7 @@ jobs: -DCMAKE_BUILD_TYPE=Release ` -DLLVM_ENABLE_ASSERTIONS=ON ` -DCLANG_ENABLE_STATIC_ANALYZER=OFF ` + -DLLVM_ENABLE_PLUGINS=On ` -DCLANG_ENABLE_ARCMT=OFF ` -DCLANG_ENABLE_FORMAT=OFF ` -DCLANG_ENABLE_BOOTSTRAP=OFF ` @@ -190,11 +191,12 @@ jobs: -DLLVM_ENABLE_ZSTD=OFF ` -DLLVM_ENABLE_TERMINFO=OFF ` -DLLVM_ENABLE_LIBXML2=OFF ` - -DLLVM_BUILD_LLVM_DYLIB_VIS=On ` - -DLLVM_LINK_LLVM_DYLIB=On ` - -DCLANG_LINK_CLANG_DYLIB=On ` - -DCMAKE_ASM_MASM_COMPILER=llvm-ml ` - -DCMAKE_ASM_MASM_FLAGS="-m64" ` + -DLLVM_ENABLE_PLUGINS=On ` + -DLLVM_BUILD_LLVM_DYLIB_VIS=On ` + -DLLVM_LINK_LLVM_DYLIB=On ` + -DCLANG_LINK_CLANG_DYLIB=On ` + -DCMAKE_ASM_MASM_COMPILER=llvm-ml ` + -DCMAKE_ASM_MASM_FLAGS="-m64" ` ..\llvm cmake --build . --config Release --target clang clang-repl --parallel ${{ env.ncpus }} } From c81693a0d053dafe597082376acf909aa374acf0 Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Thu, 16 Jan 2025 14:28:02 +0000 Subject: [PATCH 06/62] Update Windows.yml --- .github/workflows/Windows.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index 7703ab18a..01c443a11 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -155,10 +155,7 @@ jobs: -DLLVM_ENABLE_LIBXML2=OFF ` -DLLVM_BUILD_LLVM_DYLIB_VIS=On ` -DLLVM_LINK_LLVM_DYLIB=On ` - -DCLANG_LINK_CLANG_DYLIB=On ` - -DCMAKE_ASM_MASM_COMPILER=llvm-ml ` - -DCMAKE_ASM_MASM_FLAGS="-m64" ` - ..\llvm + -DCLANG_LINK_CLANG_DYLIB=On -DCMAKE_ASM_MASM_COMPILER=llvm-ml -DCMAKE_ASM_MASM_FLAGS="-m64" ..\llvm cmake --build . --config Release --target clang --parallel ${{ env.ncpus }} cmake --build . --config Release --target cling --parallel ${{ env.ncpus }} # Now build gtest.a and gtest_main for CppInterOp to run its tests. @@ -194,10 +191,7 @@ jobs: -DLLVM_ENABLE_PLUGINS=On ` -DLLVM_BUILD_LLVM_DYLIB_VIS=On ` -DLLVM_LINK_LLVM_DYLIB=On ` - -DCLANG_LINK_CLANG_DYLIB=On ` - -DCMAKE_ASM_MASM_COMPILER=llvm-ml ` - -DCMAKE_ASM_MASM_FLAGS="-m64" ` - ..\llvm + -DCLANG_LINK_CLANG_DYLIB=On -DCMAKE_ASM_MASM_COMPILER=llvm-ml -DCMAKE_ASM_MASM_FLAGS="-m64" ..\llvm cmake --build . --config Release --target clang clang-repl --parallel ${{ env.ncpus }} } cd ..\ From 68e253f8f5969ce11bde0d363380fde8eedb146e Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Thu, 16 Jan 2025 15:14:53 +0000 Subject: [PATCH 07/62] Update Windows.yml --- .github/workflows/Windows.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index 01c443a11..8c7777e58 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -27,7 +27,7 @@ jobs: clang-runtime: '18' cling: Off llvm_enable_projects: "clang" - llvm_targets_to_build: "host;NVPTX" + llvm_targets_to_build: "host" steps: - uses: actions/checkout@v4 @@ -179,20 +179,16 @@ jobs: echo "Apply clang${{ matrix.clang-runtime }}-*.patch patches:" cmake -G Ninja -DLLVM_ENABLE_PROJECTS="${{ matrix.llvm_enable_projects}}" ` -DLLVM_TARGETS_TO_BUILD="${{ matrix.llvm_targets_to_build }}" ` - -DCMAKE_BUILD_TYPE=Release ` - -DLLVM_ENABLE_ASSERTIONS=ON ` + -DCMAKE_BUILD_TYPE=RelWithDebInfo ` + -DCMAKE_CXX_COMPILER=clang-cl ` + -DCMAKE_C_COMPILER=clang-cl ` -DCLANG_ENABLE_STATIC_ANALYZER=OFF ` -DCLANG_ENABLE_ARCMT=OFF ` - -DCLANG_ENABLE_FORMAT=OFF ` - -DCLANG_ENABLE_BOOTSTRAP=OFF ` - -DLLVM_ENABLE_ZSTD=OFF ` - -DLLVM_ENABLE_TERMINFO=OFF ` - -DLLVM_ENABLE_LIBXML2=OFF ` -DLLVM_ENABLE_PLUGINS=On ` -DLLVM_BUILD_LLVM_DYLIB_VIS=On ` -DLLVM_LINK_LLVM_DYLIB=On ` -DCLANG_LINK_CLANG_DYLIB=On -DCMAKE_ASM_MASM_COMPILER=llvm-ml -DCMAKE_ASM_MASM_FLAGS="-m64" ..\llvm - cmake --build . --config Release --target clang clang-repl --parallel ${{ env.ncpus }} + cmake --build . --config RelWithDebInfo --target clang clang-repl --parallel ${{ env.ncpus }} } cd ..\ rm -r -force $(find.exe . -maxdepth 1 ! -name "build" ! -name "llvm" ! -name "clang" ! -name ".") From 411ff893272070e36396a4bbddecf0ed28467ea8 Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Thu, 16 Jan 2025 22:44:43 +0000 Subject: [PATCH 08/62] Update Windows.yml --- .github/workflows/Windows.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index 8c7777e58..a25a268a5 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -361,6 +361,7 @@ jobs: cmake -G Ninja -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} ` -DUSE_CLING=ON ` -DUSE_REPL=OFF ` + -DBUILD_SHARED_LIBS=ON ` -DCling_DIR="$env:LLVM_BUILD_DIR\tools\cling" ` -DLLVM_DIR="$env:LLVM_BUILD_DIR" ` -DLLVM_ENABLE_WERROR=On ` @@ -372,6 +373,7 @@ jobs: cmake -G Ninja -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} ` -DLLVM_DIR="$env:LLVM_BUILD_DIR\lib\cmake\llvm" ` -DLLVM_ENABLE_WERROR=On ` + -DBUILD_SHARED_LIBS=ON ` -DLLVM_BUILD_LLVM_DYLIB_VIS=On -DLLVM_LINK_LLVM_DYLIB=On -DCLANG_LINK_CLANG_DYLIB=On ` -DClang_DIR="$env:LLVM_BUILD_DIR\lib\cmake\clang" -DCODE_COVERAGE=${{ env.CODE_COVERAGE }} -DCMAKE_INSTALL_PREFIX="$env:CPPINTEROP_DIR" ..\ cmake --build . --config ${{ env.BUILD_TYPE }} --target googletest --parallel ${{ env.ncpus }} From 2171d80398e92bcc8ff4de094b62dd9000e1e178 Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Thu, 16 Jan 2025 22:52:33 +0000 Subject: [PATCH 09/62] Update Windows.yml --- .github/workflows/Windows.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index a25a268a5..13152f1eb 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -154,6 +154,7 @@ jobs: -DLLVM_ENABLE_TERMINFO=OFF ` -DLLVM_ENABLE_LIBXML2=OFF ` -DLLVM_BUILD_LLVM_DYLIB_VIS=On ` + -DLLVM_BUILD_LLVM_DYLIB=On ` -DLLVM_LINK_LLVM_DYLIB=On ` -DCLANG_LINK_CLANG_DYLIB=On -DCMAKE_ASM_MASM_COMPILER=llvm-ml -DCMAKE_ASM_MASM_FLAGS="-m64" ..\llvm cmake --build . --config Release --target clang --parallel ${{ env.ncpus }} @@ -186,6 +187,7 @@ jobs: -DCLANG_ENABLE_ARCMT=OFF ` -DLLVM_ENABLE_PLUGINS=On ` -DLLVM_BUILD_LLVM_DYLIB_VIS=On ` + -DLLVM_BUILD_LLVM_DYLIB=On ` -DLLVM_LINK_LLVM_DYLIB=On ` -DCLANG_LINK_CLANG_DYLIB=On -DCMAKE_ASM_MASM_COMPILER=llvm-ml -DCMAKE_ASM_MASM_FLAGS="-m64" ..\llvm cmake --build . --config RelWithDebInfo --target clang clang-repl --parallel ${{ env.ncpus }} From efcea6d63f346e4f9df484630746e0820ea28aae Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Fri, 17 Jan 2025 13:26:51 +0000 Subject: [PATCH 10/62] Temperory ignore removing of link to libLLVM.so on Windows(will revert) --- lib/Interpreter/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index ba699dc83..4b23a4b3d 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -68,7 +68,6 @@ else() if(NOT WIN32) list(APPEND link_libs dl) - endif() # Get rid of libLLVM-X.so which is appended to the list of static libraries. if (LLVM_LINK_LLVM_DYLIB) @@ -116,7 +115,7 @@ else() clangStaticAnalyzerCore ) endif(LLVM_LINK_LLVM_DYLIB) - + endif() add_llvm_library(clangCppInterOp DISABLE_LLVM_LINK_LLVM_DYLIB CppInterOp.cpp From 2351a07d48b855ff78f5118e5fd1bb60ac345bd0 Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Fri, 17 Jan 2025 14:44:20 +0000 Subject: [PATCH 11/62] Update Windows.yml --- .github/workflows/Windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index 13152f1eb..46987c5fc 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -190,7 +190,7 @@ jobs: -DLLVM_BUILD_LLVM_DYLIB=On ` -DLLVM_LINK_LLVM_DYLIB=On ` -DCLANG_LINK_CLANG_DYLIB=On -DCMAKE_ASM_MASM_COMPILER=llvm-ml -DCMAKE_ASM_MASM_FLAGS="-m64" ..\llvm - cmake --build . --config RelWithDebInfo --target clang clang-repl --parallel ${{ env.ncpus }} + cmake --build . --config RelWithDebInfo --target clang clang-repl clangInterpreter --parallel ${{ env.ncpus }} } cd ..\ rm -r -force $(find.exe . -maxdepth 1 ! -name "build" ! -name "llvm" ! -name "clang" ! -name ".") From 0f132d0697f9a1da1d8dc631891a1cc418a7c027 Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Fri, 17 Jan 2025 15:52:13 +0000 Subject: [PATCH 12/62] Add assertions back into Windows llvm build --- .github/workflows/Windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index 46987c5fc..6f386a855 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -181,6 +181,7 @@ jobs: cmake -G Ninja -DLLVM_ENABLE_PROJECTS="${{ matrix.llvm_enable_projects}}" ` -DLLVM_TARGETS_TO_BUILD="${{ matrix.llvm_targets_to_build }}" ` -DCMAKE_BUILD_TYPE=RelWithDebInfo ` + -DLLVM_ENABLE_ASSERTIONS=ON ` -DCMAKE_CXX_COMPILER=clang-cl ` -DCMAKE_C_COMPILER=clang-cl ` -DCLANG_ENABLE_STATIC_ANALYZER=OFF ` From aef60c83bc295efe76e32fa8d460f8ed83225628 Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Fri, 17 Jan 2025 16:51:01 +0000 Subject: [PATCH 13/62] Update Windows.yml --- .github/workflows/Windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index 6f386a855..c34c6f92b 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -191,7 +191,7 @@ jobs: -DLLVM_BUILD_LLVM_DYLIB=On ` -DLLVM_LINK_LLVM_DYLIB=On ` -DCLANG_LINK_CLANG_DYLIB=On -DCMAKE_ASM_MASM_COMPILER=llvm-ml -DCMAKE_ASM_MASM_FLAGS="-m64" ..\llvm - cmake --build . --config RelWithDebInfo --target clang clang-repl clangInterpreter --parallel ${{ env.ncpus }} + cmake --build . --config RelWithDebInfo --target clang clangInterpreter --parallel ${{ env.ncpus }} } cd ..\ rm -r -force $(find.exe . -maxdepth 1 ! -name "build" ! -name "llvm" ! -name "clang" ! -name ".") From 5968551e43cb8aa3fcfda626dbb9beebae1fd344 Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Fri, 17 Jan 2025 17:43:50 +0000 Subject: [PATCH 14/62] Update Windows.yml --- .github/workflows/Windows.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index c34c6f92b..d7a28512d 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -130,7 +130,7 @@ jobs: } else { - git clone --depth=1 -b llvm-export-api-18.0 https://github.com/fsfod/llvm-project.git + git clone --depth=1 -b llvm-export-api-20.0 https://github.com/fsfod/llvm-project.git } cd llvm-project @@ -180,7 +180,7 @@ jobs: echo "Apply clang${{ matrix.clang-runtime }}-*.patch patches:" cmake -G Ninja -DLLVM_ENABLE_PROJECTS="${{ matrix.llvm_enable_projects}}" ` -DLLVM_TARGETS_TO_BUILD="${{ matrix.llvm_targets_to_build }}" ` - -DCMAKE_BUILD_TYPE=RelWithDebInfo ` + -DCMAKE_BUILD_TYPE=Release ` -DLLVM_ENABLE_ASSERTIONS=ON ` -DCMAKE_CXX_COMPILER=clang-cl ` -DCMAKE_C_COMPILER=clang-cl ` @@ -191,7 +191,7 @@ jobs: -DLLVM_BUILD_LLVM_DYLIB=On ` -DLLVM_LINK_LLVM_DYLIB=On ` -DCLANG_LINK_CLANG_DYLIB=On -DCMAKE_ASM_MASM_COMPILER=llvm-ml -DCMAKE_ASM_MASM_FLAGS="-m64" ..\llvm - cmake --build . --config RelWithDebInfo --target clang clangInterpreter --parallel ${{ env.ncpus }} + cmake --build . --config Release --target clang clangInterpreter --parallel ${{ env.ncpus }} } cd ..\ rm -r -force $(find.exe . -maxdepth 1 ! -name "build" ! -name "llvm" ! -name "clang" ! -name ".") From a5a8ff690e2947df4ce0be4b739892eef0fba46e Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Fri, 17 Jan 2025 18:49:01 +0000 Subject: [PATCH 15/62] Update support llvm to 20 --- CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ad2b58591..cf6cf09df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,14 +67,14 @@ include(GNUInstallDirs) ## Define supported version of clang and llvm set(CLANG_MIN_SUPPORTED 13.0) - set(CLANG_MAX_SUPPORTED "19.1.x") - set(CLANG_VERSION_UPPER_BOUND 20.0.0) + set(CLANG_MAX_SUPPORTED "20.1.x") + set(CLANG_VERSION_UPPER_BOUND 21.0.0) set(LLD_MIN_SUPPORTED 13.0) - set(LLD_MAX_SUPPORTED "19.1.x") - set(LLD_VERSION_UPPER_BOUND 20.0.0) + set(LLD_MAX_SUPPORTED "20.1.x") + set(LLD_VERSION_UPPER_BOUND 21.0.0) set(LLVM_MIN_SUPPORTED 13.0) - set(LLVM_MAX_SUPPORTED "19.1.x") - set(LLVM_VERSION_UPPER_BOUND 20.0.0) + set(LLVM_MAX_SUPPORTED "20.1.x") + set(LLVM_VERSION_UPPER_BOUND 21.0.0) ## Set Cmake packages search order From 28929d31b428de8eb8ceeca247c43bbecc471a71 Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Fri, 17 Jan 2025 19:44:16 +0000 Subject: [PATCH 16/62] Ouput link_libs (debug) --- lib/Interpreter/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index 4b23a4b3d..7b7ec4d3e 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -116,6 +116,7 @@ else() ) endif(LLVM_LINK_LLVM_DYLIB) endif() + message(STATUS "link_libs: LLVM ${link_libs}") add_llvm_library(clangCppInterOp DISABLE_LLVM_LINK_LLVM_DYLIB CppInterOp.cpp From 8a177bc1f1a8f77abf397c5bd748487eab3836dd Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sat, 18 Jan 2025 18:10:26 +0000 Subject: [PATCH 17/62] Debug CMakeLists.txt --- lib/Interpreter/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index 7b7ec4d3e..a6908393b 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -117,6 +117,7 @@ else() endif(LLVM_LINK_LLVM_DYLIB) endif() message(STATUS "link_libs: LLVM ${link_libs}") + message(STATUS "llvm_targets_to_build: LLVM ${LLVM_TARGETS_TO_BUILD}") add_llvm_library(clangCppInterOp DISABLE_LLVM_LINK_LLVM_DYLIB CppInterOp.cpp From c37cf9053f0c5921dd79a46b7338ec398907e817 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sat, 18 Jan 2025 19:21:34 +0000 Subject: [PATCH 18/62] Debug Windows.yml --- .github/workflows/Windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index d7a28512d..9a633bff8 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -381,7 +381,7 @@ jobs: -DClang_DIR="$env:LLVM_BUILD_DIR\lib\cmake\clang" -DCODE_COVERAGE=${{ env.CODE_COVERAGE }} -DCMAKE_INSTALL_PREFIX="$env:CPPINTEROP_DIR" ..\ cmake --build . --config ${{ env.BUILD_TYPE }} --target googletest --parallel ${{ env.ncpus }} } - cmake --build . --config ${{ env.BUILD_TYPE }} --target check-cppinterop --parallel ${{ env.ncpus }} + cmake --build . --config ${{ env.BUILD_TYPE }} --target check-cppinterop - name: Setup tmate session if: ${{ failure() && runner.debug }} From 472bf56d56b90d19f697a6cbb67ff27ae6203414 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sat, 18 Jan 2025 19:31:26 +0000 Subject: [PATCH 19/62] Debug --- lib/Interpreter/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index a6908393b..b56a879ca 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -116,6 +116,7 @@ else() ) endif(LLVM_LINK_LLVM_DYLIB) endif() + string(REPLACE "LLVM" "" link_libs "${link_libs}") message(STATUS "link_libs: LLVM ${link_libs}") message(STATUS "llvm_targets_to_build: LLVM ${LLVM_TARGETS_TO_BUILD}") add_llvm_library(clangCppInterOp From 0c5362dc33a6f34a60e301bb88b9192df5c33ef9 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sat, 18 Jan 2025 19:40:34 +0000 Subject: [PATCH 20/62] Update CMakeLists.txt --- lib/Interpreter/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index b56a879ca..f538e4af8 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -116,8 +116,8 @@ else() ) endif(LLVM_LINK_LLVM_DYLIB) endif() - string(REPLACE "LLVM" "" link_libs "${link_libs}") - message(STATUS "link_libs: LLVM ${link_libs}") + message(STATUS "link_libs: ${link_libs}") + message(STATUS "DLM ${DLM}") message(STATUS "llvm_targets_to_build: LLVM ${LLVM_TARGETS_TO_BUILD}") add_llvm_library(clangCppInterOp DISABLE_LLVM_LINK_LLVM_DYLIB From 32a6269ac871e8ec79a9005e6bafb6527b0f0b8a Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sat, 18 Jan 2025 19:50:30 +0000 Subject: [PATCH 21/62] Debug CMakeLists.txt --- lib/Interpreter/CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index f538e4af8..6eb899ecb 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -68,7 +68,8 @@ else() if(NOT WIN32) list(APPEND link_libs dl) - + endif() + # Get rid of libLLVM-X.so which is appended to the list of static libraries. if (LLVM_LINK_LLVM_DYLIB) set(new_libs ${link_libs}) @@ -81,6 +82,8 @@ else() continue() endif() foreach(transitive_lib ${transitive_libs}) + message(STATUS "transitive libs ${transitive_libs}") + message(STATUS "transitive lib ${transitive_lib}") get_target_property(lib_type ${transitive_lib} TYPE) if("${lib_type}" STREQUAL "STATIC_LIBRARY") list(APPEND static_transitive_libs ${transitive_lib}) @@ -115,10 +118,7 @@ else() clangStaticAnalyzerCore ) endif(LLVM_LINK_LLVM_DYLIB) - endif() - message(STATUS "link_libs: ${link_libs}") - message(STATUS "DLM ${DLM}") - message(STATUS "llvm_targets_to_build: LLVM ${LLVM_TARGETS_TO_BUILD}") + add_llvm_library(clangCppInterOp DISABLE_LLVM_LINK_LLVM_DYLIB CppInterOp.cpp From 2accf5f3e1d0d445fe8baca6aac05bd2c88bc8dd Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sat, 18 Jan 2025 20:00:44 +0000 Subject: [PATCH 22/62] Remove clangedit transistive libs --- lib/Interpreter/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index 6eb899ecb..9481edc1e 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -81,6 +81,7 @@ else() if (NOT transitive_libs) continue() endif() + string(REPLACE "clangEdit;" "" transitive_libs "${transitive_libs}") foreach(transitive_lib ${transitive_libs}) message(STATUS "transitive libs ${transitive_libs}") message(STATUS "transitive lib ${transitive_lib}") From a7c23ce8a867f38a369f69b1a2e4a39637cc6114 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sat, 18 Jan 2025 20:06:22 +0000 Subject: [PATCH 23/62] Remove LLVM --- lib/Interpreter/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index 9481edc1e..c7ddd493d 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -82,6 +82,7 @@ else() continue() endif() string(REPLACE "clangEdit;" "" transitive_libs "${transitive_libs}") + string(REPLACE "LLVM;" "" transitive_libs "${transitive_libs}") foreach(transitive_lib ${transitive_libs}) message(STATUS "transitive libs ${transitive_libs}") message(STATUS "transitive lib ${transitive_lib}") From 6729a8f2b01f53e8039cc7c14353027646a83dad Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sat, 18 Jan 2025 20:09:21 +0000 Subject: [PATCH 24/62] Remove clangAST --- lib/Interpreter/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index c7ddd493d..fea8a2d91 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -82,7 +82,8 @@ else() continue() endif() string(REPLACE "clangEdit;" "" transitive_libs "${transitive_libs}") - string(REPLACE "LLVM;" "" transitive_libs "${transitive_libs}") + string(REPLACE "LLVM" "" transitive_libs "${transitive_libs}") + string(REPLACE "clangAST;" "" transitive_libs "${transitive_libs}") foreach(transitive_lib ${transitive_libs}) message(STATUS "transitive libs ${transitive_libs}") message(STATUS "transitive lib ${transitive_lib}") From 015f49501db47ea251f4a22aded1ae71490199c6 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sat, 18 Jan 2025 20:16:42 +0000 Subject: [PATCH 25/62] remove version --- lib/Interpreter/CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index fea8a2d91..0cf75fb76 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -81,9 +81,7 @@ else() if (NOT transitive_libs) continue() endif() - string(REPLACE "clangEdit;" "" transitive_libs "${transitive_libs}") - string(REPLACE "LLVM" "" transitive_libs "${transitive_libs}") - string(REPLACE "clangAST;" "" transitive_libs "${transitive_libs}") + string(REPLACE "version;" "" transitive_libs "${transitive_libs}") foreach(transitive_lib ${transitive_libs}) message(STATUS "transitive libs ${transitive_libs}") message(STATUS "transitive lib ${transitive_lib}") From deaabaad373aa6bd2e91704637144976da6def39 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sat, 18 Jan 2025 20:23:11 +0000 Subject: [PATCH 26/62] Update Windows.yml --- .github/workflows/Windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index 9a633bff8..4893b2962 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -191,7 +191,7 @@ jobs: -DLLVM_BUILD_LLVM_DYLIB=On ` -DLLVM_LINK_LLVM_DYLIB=On ` -DCLANG_LINK_CLANG_DYLIB=On -DCMAKE_ASM_MASM_COMPILER=llvm-ml -DCMAKE_ASM_MASM_FLAGS="-m64" ..\llvm - cmake --build . --config Release --target clang clangInterpreter --parallel ${{ env.ncpus }} + cmake --build . --config Release --target clang clang-repl --parallel ${{ env.ncpus }} } cd ..\ rm -r -force $(find.exe . -maxdepth 1 ! -name "build" ! -name "llvm" ! -name "clang" ! -name ".") From ae532b70eaba1dbf47f1f09747667791495364c9 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sat, 18 Jan 2025 21:40:43 +0000 Subject: [PATCH 27/62] Update Windows.yml --- .github/workflows/Windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index 4893b2962..1e65e9d97 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -191,7 +191,7 @@ jobs: -DLLVM_BUILD_LLVM_DYLIB=On ` -DLLVM_LINK_LLVM_DYLIB=On ` -DCLANG_LINK_CLANG_DYLIB=On -DCMAKE_ASM_MASM_COMPILER=llvm-ml -DCMAKE_ASM_MASM_FLAGS="-m64" ..\llvm - cmake --build . --config Release --target clang clang-repl --parallel ${{ env.ncpus }} + cmake --build . --config Release --target clang clangInterpreter clangStaticAnalyzerCore --parallel ${{ env.ncpus }} } cd ..\ rm -r -force $(find.exe . -maxdepth 1 ! -name "build" ! -name "llvm" ! -name "clang" ! -name ".") From e98360395348bf54ebe2cbc0e5169096666552da Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sat, 18 Jan 2025 22:48:55 +0000 Subject: [PATCH 28/62] Try removing link to support and see what happens --- lib/Interpreter/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index 0cf75fb76..c958187d5 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -21,6 +21,7 @@ if(EMSCRIPTEN) PUBLIC "SHELL: -s WASM_BIGINT" ) else() + if(NOT WIN32) set(LLVM_LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD} BinaryFormat @@ -29,6 +30,15 @@ else() OrcJit Support ) + else() + set(LLVM_LINK_COMPONENTS + ${LLVM_TARGETS_TO_BUILD} + BinaryFormat + Core + Object + OrcJit + ) + endif() # FIXME: Investigate why this needs to be conditionally included. if ("LLVMFrontendDriver" IN_LIST LLVM_AVAILABLE_LIBS) list(APPEND LLVM_LINK_COMPONENTS FrontendDriver) From 9bab8d1d461fb269f6805faa85f0d5d82a843a14 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sat, 18 Jan 2025 22:57:09 +0000 Subject: [PATCH 29/62] Try solution --- lib/Interpreter/CMakeLists.txt | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index c958187d5..90f32e043 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -21,7 +21,6 @@ if(EMSCRIPTEN) PUBLIC "SHELL: -s WASM_BIGINT" ) else() - if(NOT WIN32) set(LLVM_LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD} BinaryFormat @@ -30,14 +29,6 @@ else() OrcJit Support ) - else() - set(LLVM_LINK_COMPONENTS - ${LLVM_TARGETS_TO_BUILD} - BinaryFormat - Core - Object - OrcJit - ) endif() # FIXME: Investigate why this needs to be conditionally included. if ("LLVMFrontendDriver" IN_LIST LLVM_AVAILABLE_LIBS) @@ -108,7 +99,7 @@ else() endif() endforeach(transitive_lib) # Update the target properties with the list of only static libraries. - set_target_properties(${lib} PROPERTIES INTERFACE_LINK_LIBRARIES "${static_transitive_libs}") + set_target_properties(${lib} PROPERTIES INTERFACE_LINK_LIBRARIES "") set(static_transitive_libs "") endif() endforeach(lib) From cea847f501c6512f4295e4b7285578e2410b8aea Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sat, 18 Jan 2025 23:02:11 +0000 Subject: [PATCH 30/62] Update Windows.yml --- .github/workflows/Windows.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index 1e65e9d97..898131aa6 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -154,7 +154,6 @@ jobs: -DLLVM_ENABLE_TERMINFO=OFF ` -DLLVM_ENABLE_LIBXML2=OFF ` -DLLVM_BUILD_LLVM_DYLIB_VIS=On ` - -DLLVM_BUILD_LLVM_DYLIB=On ` -DLLVM_LINK_LLVM_DYLIB=On ` -DCLANG_LINK_CLANG_DYLIB=On -DCMAKE_ASM_MASM_COMPILER=llvm-ml -DCMAKE_ASM_MASM_FLAGS="-m64" ..\llvm cmake --build . --config Release --target clang --parallel ${{ env.ncpus }} From 52f13e0f6d1737ac704625bb1028ee0382299100 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sat, 18 Jan 2025 23:05:53 +0000 Subject: [PATCH 31/62] Update CMakeLists.txt --- lib/Interpreter/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index 90f32e043..e273332aa 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -29,7 +29,6 @@ else() OrcJit Support ) - endif() # FIXME: Investigate why this needs to be conditionally included. if ("LLVMFrontendDriver" IN_LIST LLVM_AVAILABLE_LIBS) list(APPEND LLVM_LINK_COMPONENTS FrontendDriver) From aa731f007f8bc5433fb1ea84c66e4c586104422e Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sat, 18 Jan 2025 23:06:20 +0000 Subject: [PATCH 32/62] Update CMakeLists.txt --- lib/Interpreter/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index e273332aa..0cf75fb76 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -98,7 +98,7 @@ else() endif() endforeach(transitive_lib) # Update the target properties with the list of only static libraries. - set_target_properties(${lib} PROPERTIES INTERFACE_LINK_LIBRARIES "") + set_target_properties(${lib} PROPERTIES INTERFACE_LINK_LIBRARIES "${static_transitive_libs}") set(static_transitive_libs "") endif() endforeach(lib) From 7696d73696c67e4cff42f541f3aa97bd98418d1b Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sun, 19 Jan 2025 10:12:38 +0000 Subject: [PATCH 33/62] Update CMakeLists.txt --- lib/Interpreter/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index 0cf75fb76..031db7afd 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -82,6 +82,7 @@ else() continue() endif() string(REPLACE "version;" "" transitive_libs "${transitive_libs}") + string(REPLACE "LLVM" "" transitive_libs "${transitive_libs}") foreach(transitive_lib ${transitive_libs}) message(STATUS "transitive libs ${transitive_libs}") message(STATUS "transitive lib ${transitive_lib}") @@ -119,7 +120,9 @@ else() clangStaticAnalyzerCore ) endif(LLVM_LINK_LLVM_DYLIB) - + message(STATUS "link libs ${link_libs}") + string(REPLACE "LLVM" "" link_libs "${link_libs}") + message(STATUS "link libs ${link_libs}") add_llvm_library(clangCppInterOp DISABLE_LLVM_LINK_LLVM_DYLIB CppInterOp.cpp From a061d6dedb50d8520c8b7d34c971c72bfe4e1518 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sun, 19 Jan 2025 10:28:16 +0000 Subject: [PATCH 34/62] debug --- lib/Interpreter/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index 031db7afd..9e06ef0a3 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -87,6 +87,7 @@ else() message(STATUS "transitive libs ${transitive_libs}") message(STATUS "transitive lib ${transitive_lib}") get_target_property(lib_type ${transitive_lib} TYPE) + message(STATUS "lib_type ${lib_type}") if("${lib_type}" STREQUAL "STATIC_LIBRARY") list(APPEND static_transitive_libs ${transitive_lib}) else() From 2498a0888398a0ea0c1aa56874245598f23aeefb Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sun, 19 Jan 2025 11:02:53 +0000 Subject: [PATCH 35/62] Try workaround --- lib/Interpreter/CMakeLists.txt | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index 9e06ef0a3..69e0638ed 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -82,10 +82,7 @@ else() continue() endif() string(REPLACE "version;" "" transitive_libs "${transitive_libs}") - string(REPLACE "LLVM" "" transitive_libs "${transitive_libs}") foreach(transitive_lib ${transitive_libs}) - message(STATUS "transitive libs ${transitive_libs}") - message(STATUS "transitive lib ${transitive_lib}") get_target_property(lib_type ${transitive_lib} TYPE) message(STATUS "lib_type ${lib_type}") if("${lib_type}" STREQUAL "STATIC_LIBRARY") @@ -121,9 +118,7 @@ else() clangStaticAnalyzerCore ) endif(LLVM_LINK_LLVM_DYLIB) - message(STATUS "link libs ${link_libs}") - string(REPLACE "LLVM" "" link_libs "${link_libs}") - message(STATUS "link libs ${link_libs}") +SET(LDFLAGS "-Wl,--allow-multiple-definition") add_llvm_library(clangCppInterOp DISABLE_LLVM_LINK_LLVM_DYLIB CppInterOp.cpp From d2fec8c4bf55c4fee65ff157dbf3cd42f7b4fbbf Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sun, 19 Jan 2025 12:42:21 +0000 Subject: [PATCH 36/62] Change to llvm_add_library --- lib/Interpreter/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index 69e0638ed..feabc5412 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -118,8 +118,7 @@ else() clangStaticAnalyzerCore ) endif(LLVM_LINK_LLVM_DYLIB) -SET(LDFLAGS "-Wl,--allow-multiple-definition") - add_llvm_library(clangCppInterOp + llvm_add_library(clangCppInterOp DISABLE_LLVM_LINK_LLVM_DYLIB CppInterOp.cpp CXCppInterOp.cpp From 399cececf1b2cf7f8cabd7abbe0441d480d57fa3 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sun, 19 Jan 2025 12:48:50 +0000 Subject: [PATCH 37/62] Update Windows.yml --- .github/workflows/Windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index 898131aa6..cdda0f6ea 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -189,6 +189,7 @@ jobs: -DLLVM_BUILD_LLVM_DYLIB_VIS=On ` -DLLVM_BUILD_LLVM_DYLIB=On ` -DLLVM_LINK_LLVM_DYLIB=On ` + -DDISABLE_LLVM_LINK_LLVM_DYLIB=On ` -DCLANG_LINK_CLANG_DYLIB=On -DCMAKE_ASM_MASM_COMPILER=llvm-ml -DCMAKE_ASM_MASM_FLAGS="-m64" ..\llvm cmake --build . --config Release --target clang clangInterpreter clangStaticAnalyzerCore --parallel ${{ env.ncpus }} } From 8e855271a379abc618899f027ca3f69906d61255 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sun, 19 Jan 2025 12:52:56 +0000 Subject: [PATCH 38/62] Update Windows.yml --- .github/workflows/Windows.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index cdda0f6ea..af75c81c5 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -189,7 +189,6 @@ jobs: -DLLVM_BUILD_LLVM_DYLIB_VIS=On ` -DLLVM_BUILD_LLVM_DYLIB=On ` -DLLVM_LINK_LLVM_DYLIB=On ` - -DDISABLE_LLVM_LINK_LLVM_DYLIB=On ` -DCLANG_LINK_CLANG_DYLIB=On -DCMAKE_ASM_MASM_COMPILER=llvm-ml -DCMAKE_ASM_MASM_FLAGS="-m64" ..\llvm cmake --build . --config Release --target clang clangInterpreter clangStaticAnalyzerCore --parallel ${{ env.ncpus }} } @@ -368,7 +367,7 @@ jobs: -DCling_DIR="$env:LLVM_BUILD_DIR\tools\cling" ` -DLLVM_DIR="$env:LLVM_BUILD_DIR" ` -DLLVM_ENABLE_WERROR=On ` - -DLLVM_BUILD_LLVM_DYLIB_VIS=On -DLLVM_LINK_LLVM_DYLIB=On -DCLANG_LINK_CLANG_DYLIB=On ` + -DLLVM_BUILD_LLVM_DYLIB_VIS=On -DLLVM_LINK_LLVM_DYLIB=On -DCLANG_LINK_CLANG_DYLIB=On -DDISABLE_LLVM_LINK_LLVM_DYLIB=On ` -DClang_DIR="$env:LLVM_BUILD_DIR" -DCODE_COVERAGE=${{ env.CODE_COVERAGE }} -DCMAKE_INSTALL_PREFIX="$env:CPPINTEROP_DIR" ..\ } else @@ -377,7 +376,7 @@ jobs: -DLLVM_DIR="$env:LLVM_BUILD_DIR\lib\cmake\llvm" ` -DLLVM_ENABLE_WERROR=On ` -DBUILD_SHARED_LIBS=ON ` - -DLLVM_BUILD_LLVM_DYLIB_VIS=On -DLLVM_LINK_LLVM_DYLIB=On -DCLANG_LINK_CLANG_DYLIB=On ` + -DLLVM_BUILD_LLVM_DYLIB_VIS=On -DLLVM_LINK_LLVM_DYLIB=On -DCLANG_LINK_CLANG_DYLIB=On -DDISABLE_LLVM_LINK_LLVM_DYLIB=On ` -DClang_DIR="$env:LLVM_BUILD_DIR\lib\cmake\clang" -DCODE_COVERAGE=${{ env.CODE_COVERAGE }} -DCMAKE_INSTALL_PREFIX="$env:CPPINTEROP_DIR" ..\ cmake --build . --config ${{ env.BUILD_TYPE }} --target googletest --parallel ${{ env.ncpus }} } From b555cba5553f3f469923622155cc0857f1d37019 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sun, 19 Jan 2025 13:33:26 +0000 Subject: [PATCH 39/62] Try setting LLVM_DYLIB_COMPONENTS --- .github/workflows/Windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index af75c81c5..71a9305ee 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -154,6 +154,7 @@ jobs: -DLLVM_ENABLE_TERMINFO=OFF ` -DLLVM_ENABLE_LIBXML2=OFF ` -DLLVM_BUILD_LLVM_DYLIB_VIS=On ` + -DLLVM_DYLIB_COMPONENTS="BinaryFormat;Core;Object;OrcJit;Support;FrontendDriver;OrcDebugging;Coverage;FrontendHLSL;LTO;clangCodeGen;clangStaticAnalyzerCore" ` -DLLVM_LINK_LLVM_DYLIB=On ` -DCLANG_LINK_CLANG_DYLIB=On -DCMAKE_ASM_MASM_COMPILER=llvm-ml -DCMAKE_ASM_MASM_FLAGS="-m64" ..\llvm cmake --build . --config Release --target clang --parallel ${{ env.ncpus }} From c86cdcba0c99ce634b2d7d3ca46d8590f2d80373 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sun, 19 Jan 2025 14:57:51 +0000 Subject: [PATCH 40/62] Update CMakeLists.txt --- lib/Interpreter/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index feabc5412..e7ebb67f8 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -118,6 +118,7 @@ else() clangStaticAnalyzerCore ) endif(LLVM_LINK_LLVM_DYLIB) + if(NOT WIN32) llvm_add_library(clangCppInterOp DISABLE_LLVM_LINK_LLVM_DYLIB CppInterOp.cpp @@ -126,6 +127,14 @@ else() LINK_LIBS ${link_libs} ) + else() + llvm_add_library(clangCppInterOp + DISABLE_LLVM_LINK_LLVM_DYLIB + CppInterOp.cpp + CXCppInterOp.cpp + ${DLM} + ) + endif() endif() string(REPLACE ";" "\;" _VER CPPINTEROP_VERSION) From 591e7ac52846efa45ce3423ff211835ae9dc2bf1 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sun, 19 Jan 2025 18:31:05 +0000 Subject: [PATCH 41/62] Start adding libs back in --- lib/Interpreter/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index e7ebb67f8..5cb9e256f 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -133,6 +133,9 @@ else() CppInterOp.cpp CXCppInterOp.cpp ${DLM} + LINK_LIBS + clangCodeGen + clangStaticAnalyzerCore ) endif() endif() From c376819b928c08e666f5eb2a920b0ccbfdf61a1b Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sun, 19 Jan 2025 19:23:35 +0000 Subject: [PATCH 42/62] Update Windows.yml --- .github/workflows/Windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index 71a9305ee..996a9fee9 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -377,7 +377,7 @@ jobs: -DLLVM_DIR="$env:LLVM_BUILD_DIR\lib\cmake\llvm" ` -DLLVM_ENABLE_WERROR=On ` -DBUILD_SHARED_LIBS=ON ` - -DLLVM_BUILD_LLVM_DYLIB_VIS=On -DLLVM_LINK_LLVM_DYLIB=On -DCLANG_LINK_CLANG_DYLIB=On -DDISABLE_LLVM_LINK_LLVM_DYLIB=On ` + -DLLVM_BUILD_LLVM_DYLIB_VIS=On -DCLANG_LINK_CLANG_DYLIB=On ` -DClang_DIR="$env:LLVM_BUILD_DIR\lib\cmake\clang" -DCODE_COVERAGE=${{ env.CODE_COVERAGE }} -DCMAKE_INSTALL_PREFIX="$env:CPPINTEROP_DIR" ..\ cmake --build . --config ${{ env.BUILD_TYPE }} --target googletest --parallel ${{ env.ncpus }} } From 23f1b39989b6b2c698601430f219a1c6f3978dd7 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sun, 19 Jan 2025 19:28:12 +0000 Subject: [PATCH 43/62] Update Windows.yml --- .github/workflows/Windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index 996a9fee9..cf1d56d99 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -377,7 +377,7 @@ jobs: -DLLVM_DIR="$env:LLVM_BUILD_DIR\lib\cmake\llvm" ` -DLLVM_ENABLE_WERROR=On ` -DBUILD_SHARED_LIBS=ON ` - -DLLVM_BUILD_LLVM_DYLIB_VIS=On -DCLANG_LINK_CLANG_DYLIB=On ` + -DCLANG_LINK_CLANG_DYLIB=On ` -DClang_DIR="$env:LLVM_BUILD_DIR\lib\cmake\clang" -DCODE_COVERAGE=${{ env.CODE_COVERAGE }} -DCMAKE_INSTALL_PREFIX="$env:CPPINTEROP_DIR" ..\ cmake --build . --config ${{ env.BUILD_TYPE }} --target googletest --parallel ${{ env.ncpus }} } From a56ed8718fbdb3158be78d1adcf13380a98043de Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sun, 19 Jan 2025 20:50:13 +0000 Subject: [PATCH 44/62] Update CMakeLists.txt --- lib/Interpreter/CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index 2b66ab858..29f96924e 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -137,13 +137,9 @@ else() ) else() llvm_add_library(clangCppInterOp - DISABLE_LLVM_LINK_LLVM_DYLIB CppInterOp.cpp CXCppInterOp.cpp ${DLM} - LINK_LIBS - clangCodeGen - clangStaticAnalyzerCore ) endif() endif() From a5250a7dae77dc45ef6e2b1b2d298ec8c9795d5d Mon Sep 17 00:00:00 2001 From: mcbarton Date: Mon, 20 Jan 2025 08:34:07 +0000 Subject: [PATCH 45/62] Try allowing multiple definitions --- lib/Interpreter/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index 29f96924e..343893263 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -136,10 +136,16 @@ else() ${link_libs} ) else() + set_target_properties(clangCppInterOp PROPERTIES + LINK_FLAGS "-Wl,--allow-multiple-definition" + ) llvm_add_library(clangCppInterOp + DISABLE_LLVM_LINK_LLVM_DYLIB CppInterOp.cpp CXCppInterOp.cpp ${DLM} + LINK_LIBS + ${link_libs} ) endif() endif() From 563f6c5e2abcd7af6bde7289a15d6b76a2554b1f Mon Sep 17 00:00:00 2001 From: mcbarton Date: Mon, 20 Jan 2025 08:40:21 +0000 Subject: [PATCH 46/62] Try using ldflags to allow multiple definitions --- .github/workflows/Windows.yml | 1 + lib/Interpreter/CMakeLists.txt | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index cf1d56d99..094e8029f 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -357,6 +357,7 @@ jobs: mkdir build cd build $env:CPPINTEROP_BUILD_DIR="$env:PWD_DIR" + $env:LDFLAGS="-Wl,--allow-multiple-definition" echo "CPPINTEROP_BUILD_DIR=$env:CPPINTEROP_BUILD_DIR" echo "CPPINTEROP_BUILD_DIR=$env:CPPINTEROP_BUILD_DIR" >> $env:GITHUB_ENV if ( "${{ matrix.cling }}" -imatch "On" ) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index 343893263..1255d063d 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -136,9 +136,6 @@ else() ${link_libs} ) else() - set_target_properties(clangCppInterOp PROPERTIES - LINK_FLAGS "-Wl,--allow-multiple-definition" - ) llvm_add_library(clangCppInterOp DISABLE_LLVM_LINK_LLVM_DYLIB CppInterOp.cpp From a054e0da2d34e28c751ff35215b6cac9ec780dc9 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Mon, 20 Jan 2025 08:47:14 +0000 Subject: [PATCH 47/62] Update Windows.yml --- .github/workflows/Windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index 094e8029f..a0d19bd46 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -357,7 +357,7 @@ jobs: mkdir build cd build $env:CPPINTEROP_BUILD_DIR="$env:PWD_DIR" - $env:LDFLAGS="-Wl,--allow-multiple-definition" + $env:LDFLAGS="--allow-multiple-definition" echo "CPPINTEROP_BUILD_DIR=$env:CPPINTEROP_BUILD_DIR" echo "CPPINTEROP_BUILD_DIR=$env:CPPINTEROP_BUILD_DIR" >> $env:GITHUB_ENV if ( "${{ matrix.cling }}" -imatch "On" ) From 03f270a48cf7731dc846492684c5fde389fad155 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Mon, 20 Jan 2025 09:15:10 +0000 Subject: [PATCH 48/62] Try to fix flag --- .github/workflows/Windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index a0d19bd46..aa35beb29 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -357,7 +357,7 @@ jobs: mkdir build cd build $env:CPPINTEROP_BUILD_DIR="$env:PWD_DIR" - $env:LDFLAGS="--allow-multiple-definition" + $env:LDFLAGS="-allow-multiple-definition" echo "CPPINTEROP_BUILD_DIR=$env:CPPINTEROP_BUILD_DIR" echo "CPPINTEROP_BUILD_DIR=$env:CPPINTEROP_BUILD_DIR" >> $env:GITHUB_ENV if ( "${{ matrix.cling }}" -imatch "On" ) From a56a3f2e27f279deb5f9c43372a215d4a6e91320 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Mon, 20 Jan 2025 09:19:01 +0000 Subject: [PATCH 49/62] Try different flag --- .github/workflows/Windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index aa35beb29..20a59a3c6 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -357,7 +357,7 @@ jobs: mkdir build cd build $env:CPPINTEROP_BUILD_DIR="$env:PWD_DIR" - $env:LDFLAGS="-allow-multiple-definition" + $env:LDFLAGS="-Xlink=-force:multiple" echo "CPPINTEROP_BUILD_DIR=$env:CPPINTEROP_BUILD_DIR" echo "CPPINTEROP_BUILD_DIR=$env:CPPINTEROP_BUILD_DIR" >> $env:GITHUB_ENV if ( "${{ matrix.cling }}" -imatch "On" ) From e734b4d896c25044a75364fe905306bcfa49cea6 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Mon, 20 Jan 2025 19:27:32 +0000 Subject: [PATCH 50/62] Update Windows.yml --- .github/workflows/Windows.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index 20a59a3c6..05a034d9c 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -188,8 +188,6 @@ jobs: -DCLANG_ENABLE_ARCMT=OFF ` -DLLVM_ENABLE_PLUGINS=On ` -DLLVM_BUILD_LLVM_DYLIB_VIS=On ` - -DLLVM_BUILD_LLVM_DYLIB=On ` - -DLLVM_LINK_LLVM_DYLIB=On ` -DCLANG_LINK_CLANG_DYLIB=On -DCMAKE_ASM_MASM_COMPILER=llvm-ml -DCMAKE_ASM_MASM_FLAGS="-m64" ..\llvm cmake --build . --config Release --target clang clangInterpreter clangStaticAnalyzerCore --parallel ${{ env.ncpus }} } From c743ecaaa21d7de15c32c477cd81efe6b9247e37 Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Mon, 20 Jan 2025 19:33:54 +0000 Subject: [PATCH 51/62] Revert "Update Windows.yml" This reverts commit e734b4d896c25044a75364fe905306bcfa49cea6. --- .github/workflows/Windows.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index 05a034d9c..20a59a3c6 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -188,6 +188,8 @@ jobs: -DCLANG_ENABLE_ARCMT=OFF ` -DLLVM_ENABLE_PLUGINS=On ` -DLLVM_BUILD_LLVM_DYLIB_VIS=On ` + -DLLVM_BUILD_LLVM_DYLIB=On ` + -DLLVM_LINK_LLVM_DYLIB=On ` -DCLANG_LINK_CLANG_DYLIB=On -DCMAKE_ASM_MASM_COMPILER=llvm-ml -DCMAKE_ASM_MASM_FLAGS="-m64" ..\llvm cmake --build . --config Release --target clang clangInterpreter clangStaticAnalyzerCore --parallel ${{ env.ncpus }} } From 9a329887ca4a2090a2d195c5508c06123074aa9f Mon Sep 17 00:00:00 2001 From: mcbarton Date: Mon, 20 Jan 2025 21:31:28 +0000 Subject: [PATCH 52/62] Update Windows.yml --- .github/workflows/Windows.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index 20a59a3c6..cf1d56d99 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -357,7 +357,6 @@ jobs: mkdir build cd build $env:CPPINTEROP_BUILD_DIR="$env:PWD_DIR" - $env:LDFLAGS="-Xlink=-force:multiple" echo "CPPINTEROP_BUILD_DIR=$env:CPPINTEROP_BUILD_DIR" echo "CPPINTEROP_BUILD_DIR=$env:CPPINTEROP_BUILD_DIR" >> $env:GITHUB_ENV if ( "${{ matrix.cling }}" -imatch "On" ) From 2a9ddc1f295a3fea5099a6933c8e64518033fa83 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sat, 25 Jan 2025 18:45:51 +0000 Subject: [PATCH 53/62] Update CMakeLists.txt --- lib/Interpreter/CMakeLists.txt | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index 1255d063d..d1adfc6d8 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -29,14 +29,17 @@ if(EMSCRIPTEN) PUBLIC "SHELL: -s WASM_BIGINT" ) else() - set(LLVM_LINK_COMPONENTS - ${LLVM_TARGETS_TO_BUILD} - BinaryFormat - Core - Object - OrcJit - Support - ) + IF(WIN32) + set(LLVM_LINK_COMPONENTS "") + else() + set(LLVM_LINK_COMPONENTS + ${LLVM_TARGETS_TO_BUILD} + BinaryFormat + Core + Object + OrcJit + Support + ) # FIXME: Investigate why this needs to be conditionally included. if ("LLVMFrontendDriver" IN_LIST LLVM_AVAILABLE_LIBS) list(APPEND LLVM_LINK_COMPONENTS FrontendDriver) From c0cc3a6019773be5c9d7fdec7dabdd79098ff9bb Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sat, 25 Jan 2025 19:47:46 +0000 Subject: [PATCH 54/62] Update CMakeLists.txt --- lib/Interpreter/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index d1adfc6d8..d360c09b9 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -40,6 +40,7 @@ else() OrcJit Support ) + endif() # FIXME: Investigate why this needs to be conditionally included. if ("LLVMFrontendDriver" IN_LIST LLVM_AVAILABLE_LIBS) list(APPEND LLVM_LINK_COMPONENTS FrontendDriver) From cd0c392bc6a70bf011fd665c3e219660ffada086 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sat, 25 Jan 2025 19:58:32 +0000 Subject: [PATCH 55/62] Update CMakeLists.txt --- lib/Interpreter/CMakeLists.txt | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index d360c09b9..c28bd04b3 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -30,7 +30,18 @@ if(EMSCRIPTEN) ) else() IF(WIN32) - set(LLVM_LINK_COMPONENTS "") + llvm_map_components_to_libnames( + llvm_libs + ${LLVM_TARGETS_TO_BUILD} + orcjit + support + core + irreader + codegen + mc + mcparser + option +) else() set(LLVM_LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD} @@ -140,14 +151,15 @@ else() ${link_libs} ) else() - llvm_add_library(clangCppInterOp - DISABLE_LLVM_LINK_LLVM_DYLIB + add_library(clangCppInterOp + SHARED CppInterOp.cpp CXCppInterOp.cpp ${DLM} - LINK_LIBS - ${link_libs} - ) + ) + target_link_libraries(clangCppInterOp + PRIVATE ${llvm_libs} + ) endif() endif() From 6b65ec3a01592aa6aefc7ca1e7d4cc525215fcec Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sat, 25 Jan 2025 19:59:09 +0000 Subject: [PATCH 56/62] Update CMakeLists.txt --- lib/Interpreter/CMakeLists.txt | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index c28bd04b3..adc1dd093 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -32,15 +32,12 @@ else() IF(WIN32) llvm_map_components_to_libnames( llvm_libs - ${LLVM_TARGETS_TO_BUILD} - orcjit - support - core - irreader - codegen - mc - mcparser - option + ${LLVM_TARGETS_TO_BUILD} + BinaryFormat + Core + Object + OrcJit + Support ) else() set(LLVM_LINK_COMPONENTS From 2b214f2a3f3f2d091df14bb403e96558bc3d5333 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sat, 25 Jan 2025 20:04:30 +0000 Subject: [PATCH 57/62] Update CMakeLists.txt --- lib/Interpreter/CMakeLists.txt | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index adc1dd093..8347cb139 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -31,13 +31,8 @@ if(EMSCRIPTEN) else() IF(WIN32) llvm_map_components_to_libnames( - llvm_libs - ${LLVM_TARGETS_TO_BUILD} - BinaryFormat - Core - Object - OrcJit - Support + llvm_lib_shared + LLVM-20git ) else() set(LLVM_LINK_COMPONENTS @@ -155,7 +150,7 @@ else() ${DLM} ) target_link_libraries(clangCppInterOp - PRIVATE ${llvm_libs} + PRIVATE ${llvm_lib_shared} ) endif() endif() From 4a3b4d3d89979e62448c57cf8e7cdea0b0d7ebb4 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sat, 25 Jan 2025 20:08:52 +0000 Subject: [PATCH 58/62] Update CMakeLists.txt --- lib/Interpreter/CMakeLists.txt | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index 8347cb139..e90e79362 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -29,12 +29,7 @@ if(EMSCRIPTEN) PUBLIC "SHELL: -s WASM_BIGINT" ) else() - IF(WIN32) - llvm_map_components_to_libnames( - llvm_lib_shared - LLVM-20git -) - else() + IF(NOT WIN32) set(LLVM_LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD} BinaryFormat @@ -150,7 +145,7 @@ else() ${DLM} ) target_link_libraries(clangCppInterOp - PRIVATE ${llvm_lib_shared} + PRIVATE LLVM-20git ) endif() endif() From cc397df3a6bb846ffc640df4ac118b00f3259c80 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sat, 25 Jan 2025 20:12:23 +0000 Subject: [PATCH 59/62] Update CMakeLists.txt --- lib/Interpreter/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index e90e79362..930c3ca54 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -144,8 +144,8 @@ else() CXCppInterOp.cpp ${DLM} ) - target_link_libraries(clangCppInterOp - PRIVATE LLVM-20git + set_target_properties(clangCppInterOp PROPERTIES + LINK_FLAGS "-lLLVM-20git" ) endif() endif() From f71e757810caae9cc116b43ed4ea62472ef37567 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sat, 25 Jan 2025 20:31:42 +0000 Subject: [PATCH 60/62] Update Windows.yml --- .github/workflows/Windows.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index cf1d56d99..460b248fe 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -377,7 +377,8 @@ jobs: -DLLVM_DIR="$env:LLVM_BUILD_DIR\lib\cmake\llvm" ` -DLLVM_ENABLE_WERROR=On ` -DBUILD_SHARED_LIBS=ON ` - -DCLANG_LINK_CLANG_DYLIB=On ` + -DLLVM_LINK_LLVM_DYLIB=On ` + -DCLANG_LINK_CLANG_DYLIB=On ` -DClang_DIR="$env:LLVM_BUILD_DIR\lib\cmake\clang" -DCODE_COVERAGE=${{ env.CODE_COVERAGE }} -DCMAKE_INSTALL_PREFIX="$env:CPPINTEROP_DIR" ..\ cmake --build . --config ${{ env.BUILD_TYPE }} --target googletest --parallel ${{ env.ncpus }} } From 38acf18b2ceede801cbfcc2722869f0e80fc99a1 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sat, 25 Jan 2025 20:32:17 +0000 Subject: [PATCH 61/62] Update CMakeLists.txt --- lib/Interpreter/CMakeLists.txt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index 930c3ca54..b960147c1 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -138,15 +138,11 @@ else() ${link_libs} ) else() - add_library(clangCppInterOp - SHARED + llvm_add_library(clangCppInterOp CppInterOp.cpp CXCppInterOp.cpp ${DLM} - ) - set_target_properties(clangCppInterOp PROPERTIES - LINK_FLAGS "-lLLVM-20git" - ) + ) endif() endif() From 529968000da202b04721f654b301803210b929cc Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sat, 25 Jan 2025 20:40:22 +0000 Subject: [PATCH 62/62] Update CMakeLists.txt --- lib/Interpreter/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index b960147c1..c912d1e99 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -139,6 +139,7 @@ else() ) else() llvm_add_library(clangCppInterOp + DISABLE_LLVM_LINK_LLVM_DYLIB CppInterOp.cpp CXCppInterOp.cpp ${DLM}