-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcompiler-rt
42 lines (34 loc) · 1.65 KB
/
compiler-rt
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
// pass build on linux but generate x86_64, not cpu0
git apply compiler-rt.patch
~/llvm/llvm-project/build-compiler-rt$ cmake ../compiler-rt -DLLVM_CONFIG_PATH=/home/jonathanchen/llvm/test/build/bin/llvm-config -DCOMPILER_RT_USE_LIBCXX=OFF
~/llvm/llvm-project/build-compiler-rt$ make -j4
~/llvm/llvm-project/build-compiler-rt$ ls lib/linux/
ibclang_rt.builtins-cpu0.a libclang_rt.hwasan_cxx-x86_64.a.syms libclang_rt.scudo_cxx-x86_64.a libclang_rt.ubsan_standalone-x86_64.a.syms
libclang_rt.builtins-x86_64.a
jonathanchen@hz-compiler1:/local/git/ex/c++/3$ /local/git/llvm-project/build_all_libcxx/bin/clang++ main.cpp --rtlib=compiler-rt -v
...
"/usr/bin/ld" ... -lm /local/git/llvm-project/build_all_libcxx/lib/clang/13.0.1/lib/linux/libclang_rt.builtins-x86_64.a -lc /local/git/llvm-project/build_all_libcxx/lib/clang/13.0.1/lib/linux/libclang_rt.builtins-x86_64.a ...
compiler-rt/cmake/builtin-config-ix.cmake
set(MIPS64 mips64 mips64el)
+set(CPU0 cpu0)
compiler-rt/lib/builtins/CMakeLists.txt
@@ -511,6 +511,10 @@ set(aarch64_SOURCES
aarch64/fp_mode.c
)
+set(cpu0_SOURCES
+ ${GENERIC_SOURCES}
+)
+
darwin_add_builtin_libraries(${BUILTIN_SUPPORTED_OS})
+
+ set(type "STATIC")
+ if(type STREQUAL "STATIC")
+ set(libname "clang_rt.builtins-${CPU0}")
+ else()
+ message(FATAL_ERROR "${CPU0} supports static link only")
+ endif()
+ set(sources_${libname} ${LIB_SOURCES})
+ get_compiler_rt_output_dir(${CPU0} output_dir_${libname})
+ get_compiler_rt_install_dir(${CPU0} install_dir_${libname})
+ add_library(${libname} ${type} ${sources_${libname}})
+ set(extra_cflags_${libname} ${NO_LTO_FLAGS} ${NO_PGO_FLAGS} ${LIB_CFLAGS})