Skip to content

Commit

Permalink
Merge pull request #244 from MaskRay/thin
Browse files Browse the repository at this point in the history
build-llvm.py: Utilize thin archives
  • Loading branch information
nathanchance authored Oct 2, 2023
2 parents 796736c + 744315b commit 59a3a88
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tc_build/llvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,16 @@ def configure(self):

if self.tools.ar:
self.cmake_defines['CMAKE_AR'] = self.tools.ar
# Utilize thin archives to save space. Use the deprecated -T for
# compatibility with binutils<2.38 and llvm-ar<14. Unfortunately, thin
# archives make compiler-rt archives not easily distributable, so we
# disable the optimization when compiler-rt is enabled and there is an
# install directory. Ideally thin archives should still be usable for
# non-compiler-rt projects.
if not (self.folders.install and self.project_is_enabled('compiler-rt')):
self.cmake_defines['CMAKE_CXX_ARCHIVE_CREATE'] = '<CMAKE_AR> DqcT <TARGET> <OBJECTS>'
self.cmake_defines['CMAKE_CXX_ARCHIVE_FINISH'] = 'true'

if self.tools.ranlib:
self.cmake_defines['CMAKE_RANLIB'] = self.tools.ranlib
if 'CMAKE_BUILD_TYPE' not in self.cmake_defines:
Expand Down

0 comments on commit 59a3a88

Please sign in to comment.