Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tc_build: llvm: Use runtimes build for LLVM 20 and newer #291

Merged
merged 1 commit into from
Feb 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions tc_build/llvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
from tc_build.builder import Builder
import tc_build.utils

LLVM_VER_FOR_RUNTIMES = 20


def get_all_targets(llvm_folder):
contents = Path(llvm_folder, 'llvm/CMakeLists.txt').read_text(encoding='utf-8')
Expand Down Expand Up @@ -251,7 +253,8 @@ def configure(self):

# https://github.com/llvm/llvm-project/commit/b593110d89aea76b8b10152b24ece154bff3e4b5
llvm_enable_projects = self.projects.copy()
if self.llvm_major_version >= 21 and self.project_is_enabled('compiler-rt'):
if self.llvm_major_version >= LLVM_VER_FOR_RUNTIMES and self.project_is_enabled(
'compiler-rt'):
llvm_enable_projects.remove('compiler-rt')
self.cmake_defines['LLVM_ENABLE_RUNTIMES'] = 'compiler-rt'
self.cmake_defines['LLVM_ENABLE_PROJECTS'] = ';'.join(llvm_enable_projects)
Expand Down Expand Up @@ -433,7 +436,7 @@ def configure(self):
distribution_components.append('lld')
if build_compiler_rt:
distribution_components.append('llvm-profdata')
if self.llvm_major_version >= 21:
if self.llvm_major_version >= LLVM_VER_FOR_RUNTIMES:
distribution_components.append('runtimes')
runtime_distribution_components.append('profile')
else:
Expand Down