Skip to content

Commit 2e4f547

Browse files
[𝘀𝗽𝗿] initial version
Created using spr 1.3.7
2 parents 7be3cac + 89b3758 commit 2e4f547

File tree

4 files changed

+120
-0
lines changed

4 files changed

+120
-0
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
set(LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "")
2+
set(LIBUNWIND_INSTALL_LIBRARY ON CACHE BOOL "")
3+
set(LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
4+
5+
set(LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "")
6+
set(COMPILER_RT_CXX_LIBRARY "libcxx" CACHE STRING "")
7+
8+
set(COMPILER_RT_USE_LLVM_UNWINDER OFF CACHE BOOL "")
9+
set(COMPILER_RT_BUILD_BUILTINS ON CACHE BOOL "")
10+
set(COMPILER_RT_BUILD_CRT ON CACHE BOOL "")
11+
set(COMPILER_RT_BUILD_STANDALONE_LIBATOMIC OFF CACHE BOOL "")
12+
set(COMPILER_RT_HAS_FNO_BUILTIN_FLAG ON CACHE BOOL "")
13+
set(COMPILER_RT_BUILTINS_HIDE_SYMBOLS ON CACHE BOOL "")
14+
set(COMPILER_RT_HAS_VISIBILITY_HIDDEN_FLAG ON CACHE BOOL "")
15+
set(COMPILER_RT_BUILD_MEMPROF OFF CACHE BOOL "")
16+
set(COMPILER_RT_BUILD_PROFILE OFF CACHE BOOL "")
17+
set(COMPILER_RT_BUILD_SANITIZERS ON CACHE BOOL "")
18+
set(COMPILER_RT_BUILD_XRAY OFF CACHE BOOL "")
19+
set(COMPILER_RT_BUILD_ORC OFF CACHE BOOL "")
20+
set(COMPILER_RT_BUILD_LIBFUZZER OFF CACHE BOOL "")
21+
set(COMPILER_RT_DEBUG OFF CACHE BOOL "")
22+
set(COMPILER_RT_CRT_USE_EH_FRAME_REGISTRY ON CACHE BOOL "")
23+
24+
set(LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
25+
set(LIBCXXABI_USE_LLVM_UNWINDER OFF CACHE BOOL "")
26+
set(LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
27+
set(LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
28+
set(LIBCXX_INCLUDE_BENCHMARKS OFF CACHE BOOL "")
29+
30+
set(LIBCXX_ENABLE_STATIC ON CACHE BOOL "")
31+
set(LIBCXX_INSTALL_LIBRARY ON CACHE BOOL "")
32+
set(LIBCXX_CXX_ABI libcxxabi CACHE STRING "")
33+
34+
# confirmed not available in libc
35+
set(LIBCXX_ENABLE_LOCALIZATION OFF CACHE BOOL "")
36+
set(LIBCXX_ENABLE_WIDE_CHARACTERS OFF CACHE BOOL "")
37+
38+
# missing at least `<sys/statvfs.h>` and `utimes`
39+
set(LIBCXX_ENABLE_FILESYSTEM OFF CACHE BOOL "")
40+
41+
# missing at least `ioctl`
42+
set(LIBCXX_ENABLE_RANDOM_DEVICE OFF CACHE BOOL "")
43+
44+
# unclear what this is missing
45+
set(LIBCXX_ENABLE_MONOTONIC_CLOCK OFF CACHE BOOL "")
46+
47+
# requires LIBCXX_ENABLE_MONOTONIC_CLOCK=ON
48+
set(LIBCXX_ENABLE_THREADS OFF CACHE BOOL "")
49+
set(LIBCXXABI_ENABLE_THREADS OFF CACHE BOOL "")
50+
51+
# these are fine
52+
set(LIBCXX_ENABLE_UNICODE ON CACHE BOOL "")
53+
set(LIBCXX_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
54+
set(LIBCXXABI_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
55+
set(LIBCXX_ENABLE_RTTI OFF CACHE BOOL "")
56+
set(RUNTIMES_USE_LIBC "llvm-libc" CACHE STRING "")
57+
58+
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "")
59+
set(LLVM_ENABLE_RUNTIMES "compiler-rt;libc;libunwind;libcxxabi;libcxx" CACHE STRING "")
60+
set(LLVM_LIBC_FULL_BUILD ON CACHE BOOL "")
61+
set(LLVM_LIBC_INCLUDE_SCUDO ON CACHE BOOL "")
62+
set(COMPILER_RT_BUILD_GWP_ASAN OFF CACHE BOOL "")
63+
set(COMPILER_RT_BUILD_SCUDO_STANDALONE_WITH_LLVM_LIBC ON CACHE BOOL "")
64+
65+
#set(CMAKE_SYSROOT "/home/gha/libc-sysroot" CACHE STRING "")
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# This testing configuration handles running the test suite against LLVM's libc++
2+
# using a static library.
3+
4+
lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
5+
6+
config.substitutions.append(('%{flags}',
7+
'-pthread' + (' -isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else '')
8+
))
9+
config.substitutions.append(('%{compile_flags}',
10+
'-nostdinc++ -I %{include-dir} -I %{target-include-dir} -I /home/gha/llvm-project/build-runtimes/libc/include -I %{libcxx-dir}/test/support'
11+
))
12+
config.substitutions.append(('%{link_flags}',
13+
'-nodefaultlibs -nostartfiles -L %{lib-dir} -lc++ -lc++abi /home/gha/llvm-project/build-runtimes/libc/startup/linux/crt1.o /home/gha/llvm-project/build-runtimes/libc/lib/libc.a /home/gha/llvm-project/build-runtimes/libc/lib/libm.a -static -fno-use-cxa-atexit /home/gha/llvm-project/build-runtimes/compiler-rt/lib/linux/libclang_rt.builtins-x86_64.a'
14+
))
15+
config.substitutions.append(('%{exec}',
16+
'%{executor} --execdir %{temp} -- '
17+
))
18+
19+
import os, site
20+
site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
21+
import libcxx.test.params, libcxx.test.config
22+
libcxx.test.config.configure(
23+
libcxx.test.params.DEFAULT_PARAMETERS,
24+
libcxx.test.features.DEFAULT_FEATURES,
25+
config,
26+
lit_config
27+
)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# This testing configuration handles running the test suite against LLVM's libc++abi
2+
# using a static library.
3+
4+
lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
5+
6+
config.substitutions.append(('%{flags}',
7+
'-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else ''
8+
))
9+
config.substitutions.append(('%{compile_flags}',
10+
'-nostdinc++ -I %{include} -I %{cxx-include} -I %{cxx-target-include} %{maybe-include-libunwind} -I %{libcxx}/test/support -I %{libcxx}/src -D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS'
11+
))
12+
config.substitutions.append(('%{link_flags}',
13+
'-nodefaultlibs -nostartfiles -L %{lib} -lc++ -lc++abi -pthread /home/gha/llvm-project/build-runtimes/libc/startup/linux/crt1.o /home/gha/llvm-project/build-runtimes/libc/lib/libc.a -static -fno-use-cxa-atexit'
14+
))
15+
config.substitutions.append(('%{exec}',
16+
'%{executor} --execdir %{temp} -- '
17+
))
18+
19+
import os, site
20+
site.addsitedir(os.path.join('@LIBCXXABI_LIBCXX_PATH@', 'utils'))
21+
import libcxx.test.params, libcxx.test.config
22+
libcxx.test.config.configure(
23+
libcxx.test.params.DEFAULT_PARAMETERS,
24+
libcxx.test.features.DEFAULT_FEATURES,
25+
config,
26+
lit_config
27+
)

runtimes/cmake/Modules/HandleLibC.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ elseif (RUNTIMES_USE_LIBC STREQUAL "llvm-libc")
3030
check_cxx_compiler_flag(-nostdlibinc CXX_SUPPORTS_NOSTDLIBINC_FLAG)
3131
if(CXX_SUPPORTS_NOSTDLIBINC_FLAG)
3232
target_compile_options(runtimes-libc-headers INTERFACE "-nostdlibinc")
33+
target_compile_options(runtimes-libc-headers INTERFACE "-idirafter${LIBC_KERNEL_HEADERS}")
3334
endif()
3435

3536
add_library(runtimes-libc-static INTERFACE)

0 commit comments

Comments
 (0)