[PATCH] D98894: [runtime][CMake] use static_library try compile

Jinsong Ji via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 18 13:39:16 PDT 2021


jsji created this revision.
jsji added reviewers: phosek, jasonliu.
Herald added a subscriber: mgorny.
jsji requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

We were using static library trycompile in compiler-rt, eg:

compiler-rt/lib/builtins/CMakeLists.txt:
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
compiler-rt/cmake/Modules/AddCompilerRT.cmake:
-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY

We should also use it in runtime build.
Or else CMake may not be able to detect ABI and others correctly when
configuring compiler-rt.

eg: On AIX, we can't build compiler-rt without this fix in runtime build,
linking CMakeCCompilerABI.c will fail hence failing to detect ABI.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D98894

Files:
  runtimes/CMakeLists.txt


Index: runtimes/CMakeLists.txt
===================================================================
--- runtimes/CMakeLists.txt
+++ runtimes/CMakeLists.txt
@@ -1,5 +1,6 @@
 # This file handles building LLVM runtime sub-projects.
 cmake_minimum_required(VERSION 3.13.4)
+set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
 project(Runtimes C CXX ASM)
 
 set(LLVM_ALL_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind;openmp")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98894.331678.patch
Type: text/x-patch
Size: 422 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210318/b6d1ff70/attachment.bin>


More information about the llvm-commits mailing list