File: flang-runtime.diff

package info (click to toggle)
llvm-toolchain-21 1%3A21.1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,236,628 kB
  • sloc: cpp: 7,619,704; ansic: 1,433,956; asm: 1,058,748; python: 252,197; f90: 94,671; objc: 70,753; lisp: 42,813; pascal: 18,401; sh: 8,601; ml: 5,111; perl: 4,720; makefile: 3,661; awk: 3,523; javascript: 2,272; xml: 892; fortran: 770
file content (53 lines) | stat: -rw-r--r-- 2,180 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
https://github.com/llvm/llvm-project/pull/160581

diff --git a/clang/cmake/caches/Release.cmake b/clang/cmake/caches/Release.cmake
index a523cc561b3f9..947a3e63dbbef 100644
--- a/clang/cmake/caches/Release.cmake
+++ b/clang/cmake/caches/Release.cmake
@@ -36,7 +36,7 @@ if (${CMAKE_HOST_SYSTEM_NAME} MATCHES "Linux")
   list(APPEND DEFAULT_PROJECTS "bolt")
 endif()
 
-set (DEFAULT_RUNTIMES "compiler-rt;libcxx")
+set (DEFAULT_RUNTIMES "compiler-rt;libcxx;openmp;flang-rt")
 if (NOT WIN32)
   list(APPEND DEFAULT_RUNTIMES "libcxxabi" "libunwind")
 endif()
@@ -119,6 +119,7 @@ if (LLVM_RELEASE_ENABLE_LTO)
   set_instrument_and_final_stage_var(LLVM_ENABLE_LLD "ON" BOOL)
 endif()
 set_instrument_and_final_stage_var(LLVM_ENABLE_LIBCXX "ON" BOOL)
+set_instrument_and_final_stage_var(RUNTIMES_CMAKE_ARGS "-DLLVM_ENABLE_LIBCXX=ON" STRING)
 set_instrument_and_final_stage_var(LLVM_STATIC_LINK_CXX_STDLIB "ON" BOOL)
 set(RELEASE_LINKER_FLAGS "-rtlib=compiler-rt --unwindlib=libunwind")
 if(NOT ${CMAKE_HOST_SYSTEM_NAME} MATCHES "Darwin")
diff --git a/openmp/libompd/src/CMakeLists.txt b/openmp/libompd/src/CMakeLists.txt
index ba228d5181048..410f486220e84 100644
--- a/openmp/libompd/src/CMakeLists.txt
+++ b/openmp/libompd/src/CMakeLists.txt
@@ -11,16 +11,21 @@
 project (libompd)
 cmake_minimum_required(VERSION 3.20.0)
 
+set(LIBOMPD_LD_STD_FLAGS FALSE CACHE BOOL
+  "Use -stdlibc++ instead of -libc++ library for C++ ")
+
+set(LIBCXX_DEP)
+if("libcxx" IN_LIST LLVM_ENABLE_RUNTIMES AND NOT ${LIBOMPD_LD_STD_FLAGS})
+  set(LIBCXX_DEP cxx)
+endif()
+
 add_library (ompd SHARED TargetValue.cpp omp-debug.cpp omp-state.cpp omp-icv.cpp)
 
 # libompd must not link against libomp, there is no code dependency.
-add_dependencies(ompd omp) # ensure generated import library is created first
+add_dependencies(ompd omp ${LIBCXX_DEP}) # ensure generated import library is created first
 
 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
 
-set(LIBOMPD_LD_STD_FLAGS FALSE CACHE BOOL
-  "Use -stdlibc++ instead of -libc++ library for C++ ")
-
 if(${LIBOMPD_LD_STD_FLAGS})
 #  Find and replace/add libstdc++ to compile flags     
    STRING( FIND "${CMAKE_CXX_FLAGS}" "-stdlib=libc++" OUT )