compiler-rt.mk 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. ################################################################################
  2. #
  3. # compiler-rt
  4. #
  5. ################################################################################
  6. COMPILER_RT_VERSION = $(LLVM_PROJECT_VERSION)
  7. COMPILER_RT_SOURCE = compiler-rt-$(COMPILER_RT_VERSION).src.tar.xz
  8. COMPILER_RT_SITE = $(LLVM_PROJECT_SITE)
  9. COMPILER_RT_LICENSE = NCSA MIT
  10. COMPILER_RT_LICENSE_FILES = LICENSE.TXT
  11. COMPILER_RT_CPE_ID_VENDOR = llvm
  12. COMPILER_RT_DEPENDENCIES = host-clang libxcrypt llvm
  13. COMPILER_RT_SUPPORTS_IN_SOURCE_BUILD = NO
  14. COMPILER_RT_INSTALL_STAGING = YES
  15. COMPILER_RT_INSTALL_TARGET = NO
  16. COMPILER_RT_CONF_OPTS = \
  17. -DCOMPILER_RT_STANDALONE_BUILD=ON \
  18. -DCOMPILER_RT_DEFAULT_TARGET_TRIPLE=$(GNU_TARGET_NAME) \
  19. -DLLVM_CONFIG_PATH=$(HOST_DIR)/bin/llvm-config \
  20. -DCMAKE_MODULE_PATH=$(HOST_DIR)/lib/cmake/llvm
  21. # The installation of the target runtime libraries defaults to DESTDIR, however
  22. # host-clang resources directory needs a link so Clang can find the runtime
  23. # libraries in the same location they would be if built as part of the Clang
  24. # build. The "resources" directory is loosely documented and seems to be
  25. # assumed, as compiler-rt is usually build at the same time as Clang and not
  26. # standalone.
  27. define COMPILER_RT_SETUP_RUNTIME_LIBS
  28. mkdir -p $(HOST_DIR)/lib/clang/$(HOST_CLANG_VERSION)/lib
  29. ln -sf ../../../../$(GNU_TARGET_NAME)/sysroot/usr/lib/linux $(HOST_DIR)/lib/clang/$(HOST_CLANG_VERSION)/lib/linux
  30. ln -sf ../../../../$(GNU_TARGET_NAME)/sysroot/usr/share $(HOST_DIR)/lib/clang/$(HOST_CLANG_VERSION)/share
  31. endef
  32. COMPILER_RT_POST_INSTALL_STAGING_HOOKS += COMPILER_RT_SETUP_RUNTIME_LIBS
  33. $(eval $(cmake-package))