Skip to content

Commit

Permalink
Merge pull request #272 from nathanchance/handle-llvm_enable_terminfo…
Browse files Browse the repository at this point in the history
…-removal

tc_build: llvm: Handle removal of LLVM_ENABLE_TERMINFO
  • Loading branch information
msfjarvis authored May 30, 2024
2 parents 26a242c + d7ece82 commit c2077a3
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions tc_build/llvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ def __init__(self):
self.build_targets = ['all']
self.ccache = False
self.check_targets = []
# Removes system dependency on terminfo to keep the dynamic library
# dependencies slim. This can be unconditionally done as it does not
# impact clang's ability to show colors for certain output like
# warnings.
self.cmake_defines = {'LLVM_ENABLE_TERMINFO': 'OFF'}
self.cmake_defines = {}
self.install_targets = []
self.tools = None
self.projects = []
Expand Down Expand Up @@ -252,6 +248,18 @@ def configure(self):
self.cmake_defines['CMAKE_INSTALL_PREFIX'] = self.folders.install

self.cmake_defines['LLVM_ENABLE_PROJECTS'] = ';'.join(self.projects)
# Remove system dependency on terminfo to keep the dynamic library
# dependencies slim. This can be done unconditionally when the option
# exists, as it does not impact clang's ability to show colors for
# certain output like warnings. If the option does not exist, it means
# that the linked change from clang-19 is present, which basically
# makes LLVM_ENABLE_TERMINFO=OFF the default, so do not add it in that
# case to avoid a cmake warning.
# https://github.com/llvm/llvm-project/commit/6bf450c7a60fa62c642e39836566da94bb9bbc91
llvm_cmakelists = Path(self.folders.source, 'llvm/CMakeLists.txt')
llvm_cmakelists_txt = llvm_cmakelists.read_text(encoding='utf-8')
if 'LLVM_ENABLE_TERMINFO' in llvm_cmakelists_txt:
self.cmake_defines['LLVM_ENABLE_TERMINFO'] = 'OFF'
# execinfo.h might not exist (Alpine Linux) but the GWP ASAN library
# depends on it. Disable the option to avoid breaking the build, the
# kernel does not depend on it.
Expand Down

0 comments on commit c2077a3

Please sign in to comment.