aboutsummaryrefslogtreecommitdiff
path: root/runtimes/CMakeLists.txt
diff options
context:
space:
mode:
authorur4t <46435411+ur4t@users.noreply.github.com>2023-09-19 13:56:03 +0800
committerGitHub <noreply@github.com>2023-09-18 22:56:03 -0700
commit7ac1f60f01a73f9678bba2385e933864ecce8622 (patch)
treee4677f2dc70b281bcfdad825f6e195d7b48d957b /runtimes/CMakeLists.txt
parent44532a9dd4a0ed08850dbddf80b7abcc51c4a7f1 (diff)
downloadllvm-7ac1f60f01a73f9678bba2385e933864ecce8622.zip
llvm-7ac1f60f01a73f9678bba2385e933864ecce8622.tar.gz
llvm-7ac1f60f01a73f9678bba2385e933864ecce8622.tar.bz2
[llvm-libgcc][CMake] Refactor llvm-libgcc (#65455)
There are some issues in `llvm-libgcc` before this patch: Commit c5a20b518203613497fa864867fc232648006068 ([llvm-libgcc] initial commit) uses `$<TARGET_OBJECTS:unwind_static>` to get libunwind objects, which is empty. The built library is actually a shared version of libclang_rt.builtins. When configuring with `llvm/CMakeLists.txt`, target `llvm-libgcc` requires a corresponding target in `llvm-libgcc/CMakeLists.txt`. Per target installation is not handled by `llvm-libgcc`, which is not consistent with `libunwind`. This patch fixes those issues by: Reusing target `unwind_shared` in `libunwind`, linking `compiler-rt.builtins` objects into it, and applying version script. Adding target `llvm-libgcc`, creating symlinks, and utilizing cmake's dependency and component mechanism to ensure link targets will be built and installed along with symlinks. Mimicking `libunwind` to handle per target installation. It is quite hard to set necessary options without further modifying the order of runtime projects in `runtimes/CMakeLists.txt`. So though this patch reveals the possibility of co-existence of `llvm-libgcc` and `compiler-rt`/`libunwind` in `LLVM_ENABLE_RUNTIMES`, we still inhibit it to minimize influence on other projects, considering that `llvm-libgcc` is only intended for toolchain vendors, and not for casual use.
Diffstat (limited to 'runtimes/CMakeLists.txt')
-rw-r--r--runtimes/CMakeLists.txt17
1 files changed, 0 insertions, 17 deletions
diff --git a/runtimes/CMakeLists.txt b/runtimes/CMakeLists.txt
index 58af4c8..010ec87 100644
--- a/runtimes/CMakeLists.txt
+++ b/runtimes/CMakeLists.txt
@@ -216,23 +216,6 @@ if(LLVM_INCLUDE_TESTS)
umbrella_lit_testsuite_begin(check-runtimes)
endif()
-# llvm-libgcc incorporates both compiler-rt and libunwind as subprojects with very
-# specific flags, which causes clashes when they're independently built too.
-if("llvm-libgcc" IN_LIST runtimes)
- if("compiler-rt" IN_LIST runtimes OR "compiler-rt" IN_LIST LLVM_ENABLE_PROJECTS)
- message(FATAL_ERROR
- "Attempting to build both compiler-rt and llvm-libgcc will cause irreconcilable "
- "target clashes. Please choose one or the other, but not both.")
- endif()
-
- if("libunwind" IN_LIST runtimes)
- message(
- FATAL_ERROR
- "Attempting to build both libunwind and llvm-libgcc will cause irreconcilable "
- "target clashes. Please choose one or the other, but not both.")
- endif()
-endif()
-
# We do this in two loops so that HAVE_* is set for each runtime before the
# other runtimes are added.
foreach(entry ${runtimes})