From 5facfc34a18c8b6ae479e0f29533579c98543536 Mon Sep 17 00:00:00 2001 From: Christian Buttner Date: Tue, 16 Jul 2024 16:09:39 +0200 Subject: [PATCH 1/2] Build compiler-rt from the runtimes directory. --- .github/workflows/ci.yml | 1 + build.bat | 8 ++++++++ set-env.bat | 25 ++++++++++++++++++------- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fb5557a..8c145a2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,7 @@ jobs: runs-on: windows-latest env: LLVM_VERSION: 18.1.8 + LLVM_MAJOR_VERSION: 18 strategy: fail-fast: false diff --git a/build.bat b/build.bat index bf6d77a..cee9c0a 100644 --- a/build.bat +++ b/build.bat @@ -17,4 +17,12 @@ cmake --build . --target install %CMAKE_BUILD_FLAGS% cd %THIS_DIR% +mkdir runtimes\build +cd runtimes\build +cmake .. %RUNTIMES_CMAKE_CONFIGURE_FLAGS% +cmake --build . %CMAKE_BUILD_FLAGS% +cmake --build . --target install %CMAKE_BUILD_FLAGS% + +cd %THIS_DIR% + 7z a -t7z %GITHUB_WORKSPACE%\%LLVM_RELEASE_FILE% %LLVM_RELEASE_NAME% \ No newline at end of file diff --git a/set-env.bat b/set-env.bat index 4d9f894..47af256 100644 --- a/set-env.bat +++ b/set-env.bat @@ -116,6 +116,7 @@ goto :loop set CONFIGURATION=Release set DEBUG_SUFFIX= set LLVM_CMAKE_CONFIGURE_EXTRA_FLAGS= +set RUNTIME_CMAKE_CONFIGURE_EXTRA_FLAGS= set CLANG_CMAKE_CONFIGURE_EXTRA_FLAGS= shift goto :loop @@ -127,6 +128,7 @@ goto :loop set CONFIGURATION=Debug set DEBUG_SUFFIX=-dbg set LLVM_CMAKE_CONFIGURE_EXTRA_FLAGS=-DLLVM_BUILD_TOOLS=OFF -DLLVM_ENABLE_ASSERTIONS=ON +set RUNTIME_CMAKE_CONFIGURE_EXTRA_FLAGS= set CLANG_CMAKE_CONFIGURE_EXTRA_FLAGS=-DCLANG_BUILD_TOOLS=OFF shift goto :loop @@ -165,17 +167,29 @@ set LLVM_CMAKE_CONFIGURE_FLAGS= ^ -DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=TRUE ^ -DCMAKE_MSVC_RUNTIME_LIBRARY=%CMAKE_CRT% ^ -DCMAKE_MT=mt ^ - -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON ^ -DLLVM_ENABLE_TERMINFO=OFF ^ -DLLVM_ENABLE_ZLIB=OFF ^ -DLLVM_INCLUDE_BENCHMARKS=OFF ^ -DLLVM_INCLUDE_DOCS=OFF ^ - -DLLVM_ENABLE_PROJECTS=clang;lld ^ + -DLLVM_ENABLE_PROJECTS=lld ^ -DLLVM_INCLUDE_EXAMPLES=OFF ^ - -DLLVM_INCLUDE_GO_TESTS=OFF ^ + -DLLVM_INCLUDE_RUNTIMES=OFF ^ -DLLVM_INCLUDE_TESTS=OFF ^ -DLLVM_INCLUDE_UTILS=OFF ^ %LLVM_CMAKE_CONFIGURE_EXTRA_FLAGS% + +set RUNTIMES_CMAKE_CONFIGURE_FLAGS= ^ + -G "%CMAKE_GENERATOR%%CMAKE_GENERATOR_SUFFIX%" ^ + -Thost=x64 ^ + -DCMAKE_INSTALL_PREFIX=%LLVM_RELEASE_DIR%/lib/clang/%LLVM_MAJOR_VERSION% ^ + -DCMAKE_MSVC_RUNTIME_LIBRARY=%CMAKE_CRT% ^ + -DCMAKE_MT=mt ^ + -DCMAKE_C_COMPILER_TARGET="x86_64-pc-windows-msvc" ^ + -DLLVM_ENABLE_RUNTIMES=compiler-rt ^ + -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON ^ + -DCOMPILER_RT_BUILD_BUILTINS=OFF ^ + %RUNTIME_CMAKE_CONFIGURE_EXTRA_FLAGS% + set CMAKE_BUILD_FLAGS= ^ --config %CONFIGURATION% ^ -- ^ @@ -188,15 +202,12 @@ set DEPLOY_FILE=%LLVM_RELEASE_FILE% echo --------------------------------------------------------------------------- echo LLVM_VERSION: %LLVM_VERSION% +echo LLVM_MAJOR_VERSION: %LLVM_MAJOR_VERSION% echo LLVM_MASTER_URL: %LLVM_MASTER_URL% echo LLVM_DOWNLOAD_URL: %LLVM_DOWNLOAD_URL% echo LLVM_RELEASE_FILE: %LLVM_RELEASE_FILE% echo LLVM_RELEASE_URL: %LLVM_RELEASE_URL% echo LLVM_CMAKE_CONFIGURE_FLAGS: %LLVM_CMAKE_CONFIGURE_FLAGS% echo --------------------------------------------------------------------------- -echo CLANG_DOWNLOAD_URL: %CLANG_DOWNLOAD_URL% -echo CLANG_RELEASE_FILE: %CLANG_RELEASE_FILE% -echo CLANG_CMAKE_CONFIGURE_FLAGS: %CLANG_CMAKE_CONFIGURE_FLAGS% -echo --------------------------------------------------------------------------- echo DEPLOY_FILE: %DEPLOY_FILE% echo --------------------------------------------------------------------------- \ No newline at end of file From 49e4bfc40ea05f84b5d2f8c71c0907ed048364c9 Mon Sep 17 00:00:00 2001 From: Christian Buttner Date: Tue, 16 Jul 2024 17:33:02 +0200 Subject: [PATCH 2/2] Fix the runtimes build. --- build.bat | 10 ++++------ set-env.bat | 2 ++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.bat b/build.bat index cee9c0a..728d029 100644 --- a/build.bat +++ b/build.bat @@ -7,18 +7,16 @@ cd %WORKING_DIR% set THIS_DIR=%CD% -cd llvm-project - -mkdir llvm\build -cd llvm\build +mkdir llvm-project\llvm\build +cd llvm-project\llvm\build cmake .. %LLVM_CMAKE_CONFIGURE_FLAGS% cmake --build . %CMAKE_BUILD_FLAGS% cmake --build . --target install %CMAKE_BUILD_FLAGS% cd %THIS_DIR% -mkdir runtimes\build -cd runtimes\build +mkdir llvm-project\runtimes\build +cd llvm-project\runtimes\build cmake .. %RUNTIMES_CMAKE_CONFIGURE_FLAGS% cmake --build . %CMAKE_BUILD_FLAGS% cmake --build . --target install %CMAKE_BUILD_FLAGS% diff --git a/set-env.bat b/set-env.bat index 47af256..08ccce5 100644 --- a/set-env.bat +++ b/set-env.bat @@ -209,5 +209,7 @@ echo LLVM_RELEASE_FILE: %LLVM_RELEASE_FILE% echo LLVM_RELEASE_URL: %LLVM_RELEASE_URL% echo LLVM_CMAKE_CONFIGURE_FLAGS: %LLVM_CMAKE_CONFIGURE_FLAGS% echo --------------------------------------------------------------------------- +echo RUNTIMES_CMAKE_CONFIGURE_FLAGS: %RUNTIMES_CMAKE_CONFIGURE_FLAGS% +echo --------------------------------------------------------------------------- echo DEPLOY_FILE: %DEPLOY_FILE% echo --------------------------------------------------------------------------- \ No newline at end of file