From f9327953f20ef357f10e6553093f23ab62bd6e16 Mon Sep 17 00:00:00 2001 From: ykiko Date: Sat, 8 Nov 2025 00:50:09 +0800 Subject: [PATCH 1/6] update --- .github/workflows/linux.yml | 4 ++-- .github/workflows/macos.yml | 4 ++-- .github/workflows/windows.yml | 6 +++--- xmake.lua | 31 ++++++++++++++++++++++--------- 4 files changed, 29 insertions(+), 16 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index b77f6cb..f0fe54b 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -14,8 +14,8 @@ jobs: lto: "n" - build_type: releasedbg lto: "n" - # - build_type: releasedbg - # lto: "y" + - build_type: releasedbg + lto: "y" concurrency: group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-linux-${{ matrix.build_type }}-${{ matrix.lto }} diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 99ea8b8..c8587a6 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -14,8 +14,8 @@ jobs: lto: "n" - build_type: releasedbg lto: "n" - # - build_type: releasedbg - # lto: "y" + - build_type: releasedbg + lto: "y" concurrency: group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-macos-${{ matrix.build_type }}-${{ matrix.lto }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index b9ff876..deb3710 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -13,9 +13,9 @@ jobs: - build_type: releasedbg runtimes: MD lto: "n" - # - build_type: releasedbg - # runtimes: MT - # lto: "y" + - build_type: releasedbg + runtimes: MT + lto: "y" concurrency: group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-windows-${{ matrix.build_type }}-${{ matrix.lto }} diff --git a/xmake.lua b/xmake.lua index 8c193a1..fbe83a9 100644 --- a/xmake.lua +++ b/xmake.lua @@ -69,21 +69,34 @@ package("llvm") io.replace("clang-tools-extra/CMakeLists.txt", "add_subdirectory(pp-trace)", "", {plain = true}) local configs = { - "-DLLVM_INCLUDE_DOCS=OFF", + "-DLLVM_ENABLE_ZLIB=OFF", + "-DLLVM_ENABLE_ZSTD=OFF", + "-DLLVM_ENABLE_LIBXML2=OFF", + "-DLLVM_ENABLE_BINDINGS=OFF", + "-DLLVM_ENABLE_IDE=ON", + "-DLLVM_ENABLE_ZSTD=OFF", + "-DLLVM_ENABLE_Z3_SOLVER=OFF", + "-DLLVM_ENABLE_LIBEDIT=OFF", + "-DLLVM_ENABLE_LIBPFM=OFF", + "-DLLVM_ENABLE_LIBXML2=OFF", + "-DLLVM_ENABLE_OCAMLDOC=OFF", + "-DLLVM_ENABLE_PLUGINS=OFF", + "-DLLVM_INCLUDE_UTILS=OFF", "-DLLVM_INCLUDE_TESTS=OFF", "-DLLVM_INCLUDE_EXAMPLES=OFF", "-DLLVM_INCLUDE_BENCHMARKS=OFF", - - -- "-DCLANG_BUILD_TOOLS=OFF", - -- "-DLLVM_INCLUDE_TOOLS=OFF", - "-DLLVM_BUILD_TOOLS=OFF", + "-DLLVM_INCLUDE_DOCS=OFF", "-DLLVM_BUILD_UTILS=OFF", + "-DLLVM_BUILD_TOOLS=OFF", + "-DCLANG_BUILD_TOOLS=OFF", + "-DCLANG_INCLUDE_DOCS=OFF", + "-DCLANG_INCLUDE_TESTS=OFF", + "-DCLANG_TOOL_CLANG_IMPORT_TEST_BUILD=OFF", + "-DCLANG_TOOL_CLANG_LINKER_WRAPPER_BUILD=OFF", + "-DCLANG_TOOL_C_INDEX_TEST_BUILD=OFF", + "-DCLANG_TOOL_LIBCLANG_BUILD=O", "-DCLANG_ENABLE_CLANGD=OFF", - "-DLLVM_ENABLE_ZLIB=OFF", - "-DLLVM_ENABLE_ZSTD=OFF", - "-DLLVM_ENABLE_LIBXML2=OFF", - "-DLLVM_LINK_LLVM_DYLIB=OFF", "-DLLVM_ENABLE_RTTI=OFF", From e4f105ac954774d13b66298171dbc89a7aca95d7 Mon Sep 17 00:00:00 2001 From: star9029 Date: Sat, 8 Nov 2025 07:08:11 +0800 Subject: [PATCH 2/6] job 4 --- xmake.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xmake.lua b/xmake.lua index fbe83a9..bd92024 100644 --- a/xmake.lua +++ b/xmake.lua @@ -140,6 +140,7 @@ package("llvm") end local opt = {} + opt.jobs = "4" opt.target = { "LLVMSupport", "LLVMFrontendOpenMP", @@ -210,7 +211,7 @@ package("llvm") local opt = {} opt.recurse = true - opt.compress = "best" + -- opt.compress = "best" opt.curdir = package:installdir() local archive_dirs From 7533f1898b3c8f31e534d1aac122158e53cf1b75 Mon Sep 17 00:00:00 2001 From: star9029 Date: Sat, 8 Nov 2025 17:32:58 +0800 Subject: [PATCH 3/6] remove shared and binary --- xmake.lua | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/xmake.lua b/xmake.lua index bd92024..7519f72 100644 --- a/xmake.lua +++ b/xmake.lua @@ -25,7 +25,7 @@ local sparse_checkout_list = { package("llvm") add_urls("https://github.com/llvm/llvm-project.git", {alias = "git", includes = sparse_checkout_list}) - add_versions("git:21.1.4", "llvmorg-21.1.4") + add_versions("git:21.1.4", "222fc11f2b8f25f6a0f4976272ef1bb7bf49521d") add_versions("git:20.1.5", "llvmorg-20.1.5") add_configs("mode", {description = "Build type", default = "releasedbg", type = "string", values = {"debug", "release", "releasedbg"}}) @@ -36,10 +36,6 @@ package("llvm") add_deps("cmake", "ninja", "python 3.x", {kind = "binary"}) - if is_host("windows") then - set_policy("platform.longpaths", true) - end - on_install(function (package) if not package:config("shared") then package:add("defines", "CLANG_BUILD_STATIC") @@ -67,6 +63,10 @@ package("llvm") end io.replace("clang-tools-extra/CMakeLists.txt", "add_subdirectory(modularize)", "", {plain = true}) io.replace("clang-tools-extra/CMakeLists.txt", "add_subdirectory(pp-trace)", "", {plain = true}) + io.replace("clang-tools-extra/CMakeLists.txt", "add_subdirectory(tool-template)", "", {plain = true}) + + io.replace("llvm/lib/CMakeLists.txt", "add_subdirectory(LTO)", "", {plain = true}) + io.replace("llvm/lib/CMakeLists.txt", "add_subdirectory(Remarks)", "", {plain = true}) local configs = { "-DLLVM_ENABLE_ZLIB=OFF", @@ -88,14 +88,16 @@ package("llvm") "-DLLVM_INCLUDE_DOCS=OFF", "-DLLVM_BUILD_UTILS=OFF", "-DLLVM_BUILD_TOOLS=OFF", + "-DLLVM_INCLUDE_TOOLS=OFF", "-DCLANG_BUILD_TOOLS=OFF", "-DCLANG_INCLUDE_DOCS=OFF", "-DCLANG_INCLUDE_TESTS=OFF", "-DCLANG_TOOL_CLANG_IMPORT_TEST_BUILD=OFF", "-DCLANG_TOOL_CLANG_LINKER_WRAPPER_BUILD=OFF", "-DCLANG_TOOL_C_INDEX_TEST_BUILD=OFF", - "-DCLANG_TOOL_LIBCLANG_BUILD=O", + "-DCLANG_TOOL_LIBCLANG_BUILD=OFF", "-DCLANG_ENABLE_CLANGD=OFF", + "-DLLVM_BUILD_LLVM_C_DYLIB=OFF", "-DLLVM_LINK_LLVM_DYLIB=OFF", "-DLLVM_ENABLE_RTTI=OFF", @@ -140,7 +142,6 @@ package("llvm") end local opt = {} - opt.jobs = "4" opt.target = { "LLVMSupport", "LLVMFrontendOpenMP", @@ -211,7 +212,7 @@ package("llvm") local opt = {} opt.recurse = true - -- opt.compress = "best" + opt.compress = "best" opt.curdir = package:installdir() local archive_dirs From 14f6535e6ceaa4e174944d4097e8f2094cc7767f Mon Sep 17 00:00:00 2001 From: star9029 Date: Sat, 8 Nov 2025 18:07:16 +0800 Subject: [PATCH 4/6] fix --- xmake.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/xmake.lua b/xmake.lua index 7519f72..25da8ec 100644 --- a/xmake.lua +++ b/xmake.lua @@ -36,6 +36,10 @@ package("llvm") add_deps("cmake", "ninja", "python 3.x", {kind = "binary"}) + if is_host("windows") then + set_policy("platform.longpaths", true) + end + on_install(function (package) if not package:config("shared") then package:add("defines", "CLANG_BUILD_STATIC") @@ -65,8 +69,8 @@ package("llvm") io.replace("clang-tools-extra/CMakeLists.txt", "add_subdirectory(pp-trace)", "", {plain = true}) io.replace("clang-tools-extra/CMakeLists.txt", "add_subdirectory(tool-template)", "", {plain = true}) - io.replace("llvm/lib/CMakeLists.txt", "add_subdirectory(LTO)", "", {plain = true}) - io.replace("llvm/lib/CMakeLists.txt", "add_subdirectory(Remarks)", "", {plain = true}) + io.replace("llvm/tools/CMakeLists.txt", "add_llvm_tool_subdirectory(lto)", "", {plain = true}) + io.replace("llvm/tools/CMakeLists.txt", "add_llvm_implicit_projects()", "", {plain = true}) local configs = { "-DLLVM_ENABLE_ZLIB=OFF", @@ -88,7 +92,7 @@ package("llvm") "-DLLVM_INCLUDE_DOCS=OFF", "-DLLVM_BUILD_UTILS=OFF", "-DLLVM_BUILD_TOOLS=OFF", - "-DLLVM_INCLUDE_TOOLS=OFF", + -- "-DLLVM_INCLUDE_TOOLS=OFF", "-DCLANG_BUILD_TOOLS=OFF", "-DCLANG_INCLUDE_DOCS=OFF", "-DCLANG_INCLUDE_TESTS=OFF", From 4f2a0cd299c671f194054a399ae675748dface93 Mon Sep 17 00:00:00 2001 From: star9029 Date: Sat, 8 Nov 2025 18:34:07 +0800 Subject: [PATCH 5/6] remove headers --- xmake.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xmake.lua b/xmake.lua index 25da8ec..86d9753 100644 --- a/xmake.lua +++ b/xmake.lua @@ -72,6 +72,9 @@ package("llvm") io.replace("llvm/tools/CMakeLists.txt", "add_llvm_tool_subdirectory(lto)", "", {plain = true}) io.replace("llvm/tools/CMakeLists.txt", "add_llvm_implicit_projects()", "", {plain = true}) + -- idk + io.replace("llvm/lib/Support/SipHash.cpp", [[#include "siphash/SipHash.h"]], "", {plain = true}) + local configs = { "-DLLVM_ENABLE_ZLIB=OFF", "-DLLVM_ENABLE_ZSTD=OFF", From ad7575b752f29ab2326603dd941f338a7e32dac3 Mon Sep 17 00:00:00 2001 From: star9029 Date: Sat, 8 Nov 2025 18:44:36 +0800 Subject: [PATCH 6/6] fix third-party --- xmake.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/xmake.lua b/xmake.lua index 86d9753..04fa855 100644 --- a/xmake.lua +++ b/xmake.lua @@ -14,6 +14,7 @@ local sparse_checkout_list = { "llvm", "clang", "clang-tools-extra", + "third-party", } -- TODO: If we need compiler-rt builtin-headers, then we need to enable them. @@ -72,9 +73,6 @@ package("llvm") io.replace("llvm/tools/CMakeLists.txt", "add_llvm_tool_subdirectory(lto)", "", {plain = true}) io.replace("llvm/tools/CMakeLists.txt", "add_llvm_implicit_projects()", "", {plain = true}) - -- idk - io.replace("llvm/lib/Support/SipHash.cpp", [[#include "siphash/SipHash.h"]], "", {plain = true}) - local configs = { "-DLLVM_ENABLE_ZLIB=OFF", "-DLLVM_ENABLE_ZSTD=OFF",