Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
devel:tools:compiler
llvm7
compiler-rt-D88922-nostdlib.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File compiler-rt-D88922-nostdlib.patch of Package llvm7
diff -ur compiler-rt-8.0.1.src.orig/CMakeLists.txt compiler-rt-8.0.1.src/CMakeLists.txt --- compiler-rt-8.0.1.src.orig/CMakeLists.txt +++ compiler-rt-8.0.1.src/CMakeLists.txt @@ -391,6 +391,25 @@ list(APPEND SANITIZER_COMMON_LINK_LIBS zircon) endif() +# TODO: COMPILER_RT_COMMON_CFLAGS and COMPILER_RT_COMMON_LINK_FLAGS are +# intended for use in non-sanitizer runtimes such as libFuzzer, profile or XRay, +# move these higher to include common flags, then derive SANITIZER_COMMON_CFLAGS +# and SANITIZER_COMMON_LINK_FLAGS from those and append sanitizer-specific flags. +set(COMPILER_RT_COMMON_CFLAGS ${SANITIZER_COMMON_CFLAGS}) +set(COMPILER_RT_COMMON_LINK_FLAGS ${SANITIZER_COMMON_LINK_FLAGS}) + +# We don't use the C++ standard library, so avoid including it by mistake. +append_list_if(COMPILER_RT_HAS_NOSTDINCXX_FLAG -nostdinc++ SANITIZER_COMMON_CFLAGS) +append_list_if(COMPILER_RT_HAS_NOSTDLIBXX_FLAG -nostdlib++ SANITIZER_COMMON_LINK_FLAGS) + +# Remove -stdlib= which is unused when passing -nostdinc++... +string(REGEX MATCHALL "-stdlib=[a-zA-Z+]*" stdlib_flag ${CMAKE_CXX_FLAGS}) +string(REGEX REPLACE "-stdlib=[a-zA-Z+]*" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) + +# ...we need it to build some runtimes and tests so readd it where appropriate. +list(APPEND COMPILER_RT_COMMON_CFLAGS ${stdlib_flag}) +list(APPEND COMPILER_RT_COMMON_LINK_FLAGS ${stdlib_flag}) + if (SANITIZER_CXX_ABI_LIBNAME STREQUAL "libc++") if (SANITIZER_CXX_ABI_INTREE) if (NOT LIBCXXABI_ENABLE_STATIC_UNWINDER AND (TARGET unwind_shared OR HAVE_LIBUNWIND)) diff -ur compiler-rt-10.0.1.src.orig/cmake/config-ix.cmake compiler-rt-10.0.1.src/cmake/config-ix.cmake --- compiler-rt-10.0.1.src.orig/cmake/config-ix.cmake +++ compiler-rt-10.0.1.src/cmake/config-ix.cmake @@ -116,6 +116,9 @@ check_cxx_compiler_flag(/wd4800 COMPILER_RT_HAS_WD4800_FLAG) # Symbols. check_symbol_exists(__func__ "" COMPILER_RT_HAS_FUNC_SYMBOL) +# Includes. +check_cxx_compiler_flag(-nostdinc++ COMPILER_RT_HAS_NOSTDINCXX_FLAG) + # Libraries. check_library_exists(dl dlopen "" COMPILER_RT_HAS_LIBDL) check_library_exists(rt shm_open "" COMPILER_RT_HAS_LIBRT) diff -ur compiler-rt-8.0.1.src.orig/lib/fuzzer/CMakeLists.txt compiler-rt-8.0.1.src/lib/fuzzer/CMakeLists.txt --- compiler-rt-8.0.1.src.orig/lib/fuzzer/CMakeLists.txt +++ compiler-rt-8.0.1.src/lib/fuzzer/CMakeLists.txt @@ -53,12 +53,11 @@ } " HAS_THREAD_LOCAL) -set(LIBFUZZER_CFLAGS ${SANITIZER_COMMON_CFLAGS}) +set(LIBFUZZER_CFLAGS ${COMPILER_RT_COMMON_CFLAGS}) if(OS_NAME MATCHES "Linux|Fuchsia" AND COMPILER_RT_LIBCXX_PATH) - list(APPEND LIBFUZZER_CFLAGS -nostdinc++ -D_LIBCPP_ABI_VERSION=Fuzzer) - # Remove -stdlib= which is unused when passing -nostdinc++. - string(REGEX REPLACE "-stdlib=[a-zA-Z+]*" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) + list(APPEND LIBFUZZER_CFLAGS -D_LIBCPP_ABI_VERSION=Fuzzer) + append_list_if(COMPILER_RT_HAS_NOSTDINCXX_FLAG -nostdinc++ LIBFUZZER_CFLAGS) elseif(TARGET cxx-headers OR HAVE_LIBCXX) set(LIBFUZZER_DEPS cxx-headers) endif() Nur in compiler-rt-11.0.1.src/lib/fuzzer: CMakeLists.txt.orig. diff -ur compiler-rt-11.0.1.src.orig/lib/sanitizer_common/tests/CMakeLists.txt compiler-rt-11.0.1.src/lib/sanitizer_common/tests/CMakeLists.txt --- compiler-rt-11.0.1.src.orig/lib/sanitizer_common/tests/CMakeLists.txt +++ compiler-rt-11.0.1.src/lib/sanitizer_common/tests/CMakeLists.txt @@ -210,9 +210,7 @@ $<TARGET_OBJECTS:RTSanitizerCommon.${arch}> $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}> $<TARGET_OBJECTS:RTSanitizerCommonSymbolizer.${arch}>) - set_target_compile_flags(SanitizerTest - ${SANITIZER_COMMON_CFLAGS} - ${SANITIZER_TEST_CFLAGS_COMMON}) + set_target_compile_flags(SanitizerTest ${SANITIZER_TEST_CFLAGS_COMMON}) # Setup correct output directory and link flags. set_target_properties(SanitizerTest PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) diff -ur compiler-rt-11.0.1.src.orig/lib/xray/CMakeLists.txt compiler-rt-11.0.1.src/lib/xray/CMakeLists.txt --- compiler-rt-11.0.1.src.orig/lib/xray/CMakeLists.txt +++ compiler-rt-11.0.1.src/lib/xray/CMakeLists.txt @@ -132,7 +132,7 @@ include_directories(..) include_directories(../../include) -set(XRAY_CFLAGS ${SANITIZER_COMMON_CFLAGS}) +set(XRAY_CFLAGS ${COMPILER_RT_COMMON_CFLAGS}) set(XRAY_COMMON_DEFINITIONS XRAY_HAS_EXCEPTIONS=1) # We don't need RTTI in XRay, so turn that off. diff --git a/compiler-rt/lib/profile/CMakeLists.txt b/compiler-rt/lib/profile/CMakeLists.txt index 63532b72ff82e..5ff0e10182b4d 100644 --- compiler-rt.orig/lib/profile/CMakeLists.txt +++ compiler-rt/lib/profile/CMakeLists.txt @@ -111,6 +111,9 @@ if(COMPILER_RT_TARGET_HAS_UNAME) -DCOMPILER_RT_HAS_UNAME=1) endif() +# We don't use the C++ Standard Library here, so avoid including it by mistake. +append_list_if(COMPILER_RT_HAS_NOSTDINCXX_FLAG -nostdinc++ EXTRA_FLAGS) + # This appears to be a C-only warning banning the use of locals in aggregate # initializers. All other compilers accept this, though. # nonstandard extension used : 'identifier' : cannot be initialized using address of automatic variable
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor