Changeset View
Standalone View
cmake/config-ix.cmake
Show All 13 Lines | |||||
# CodeGen options. | # CodeGen options. | ||||
check_cxx_compiler_flag(-fPIC COMPILER_RT_HAS_FPIC_FLAG) | check_cxx_compiler_flag(-fPIC COMPILER_RT_HAS_FPIC_FLAG) | ||||
check_cxx_compiler_flag(-fPIE COMPILER_RT_HAS_FPIE_FLAG) | check_cxx_compiler_flag(-fPIE COMPILER_RT_HAS_FPIE_FLAG) | ||||
check_cxx_compiler_flag(-fno-builtin COMPILER_RT_HAS_FNO_BUILTIN_FLAG) | check_cxx_compiler_flag(-fno-builtin COMPILER_RT_HAS_FNO_BUILTIN_FLAG) | ||||
check_cxx_compiler_flag(-fno-exceptions COMPILER_RT_HAS_FNO_EXCEPTIONS_FLAG) | check_cxx_compiler_flag(-fno-exceptions COMPILER_RT_HAS_FNO_EXCEPTIONS_FLAG) | ||||
check_cxx_compiler_flag(-fomit-frame-pointer COMPILER_RT_HAS_FOMIT_FRAME_POINTER_FLAG) | check_cxx_compiler_flag(-fomit-frame-pointer COMPILER_RT_HAS_FOMIT_FRAME_POINTER_FLAG) | ||||
check_cxx_compiler_flag(-funwind-tables COMPILER_RT_HAS_FUNWIND_TABLES_FLAG) | check_cxx_compiler_flag(-funwind-tables COMPILER_RT_HAS_FUNWIND_TABLES_FLAG) | ||||
check_cxx_compiler_flag(-fno-stack-protector COMPILER_RT_HAS_FNO_STACK_PROTECTOR_FLAG) | check_cxx_compiler_flag(-fno-stack-protector COMPILER_RT_HAS_FNO_STACK_PROTECTOR_FLAG) | ||||
check_cxx_compiler_flag(-fno-sanitize=safe-stack COMPILER_RT_HAS_FNO_SANITIZE_SAFE_STACK_FLAG) | |||||
check_cxx_compiler_flag(-fvisibility=hidden COMPILER_RT_HAS_FVISIBILITY_HIDDEN_FLAG) | check_cxx_compiler_flag(-fvisibility=hidden COMPILER_RT_HAS_FVISIBILITY_HIDDEN_FLAG) | ||||
check_cxx_compiler_flag(-fno-rtti COMPILER_RT_HAS_FNO_RTTI_FLAG) | check_cxx_compiler_flag(-fno-rtti COMPILER_RT_HAS_FNO_RTTI_FLAG) | ||||
check_cxx_compiler_flag(-ffreestanding COMPILER_RT_HAS_FFREESTANDING_FLAG) | check_cxx_compiler_flag(-ffreestanding COMPILER_RT_HAS_FFREESTANDING_FLAG) | ||||
check_cxx_compiler_flag("-Werror -fno-function-sections" COMPILER_RT_HAS_FNO_FUNCTION_SECTIONS_FLAG) | check_cxx_compiler_flag("-Werror -fno-function-sections" COMPILER_RT_HAS_FNO_FUNCTION_SECTIONS_FLAG) | ||||
check_cxx_compiler_flag(-std=c++11 COMPILER_RT_HAS_STD_CXX11_FLAG) | check_cxx_compiler_flag(-std=c++11 COMPILER_RT_HAS_STD_CXX11_FLAG) | ||||
check_cxx_compiler_flag(-ftls-model=initial-exec COMPILER_RT_HAS_FTLS_MODEL_INITIAL_EXEC) | check_cxx_compiler_flag(-ftls-model=initial-exec COMPILER_RT_HAS_FTLS_MODEL_INITIAL_EXEC) | ||||
check_cxx_compiler_flag(-fno-lto COMPILER_RT_HAS_FNO_LTO_FLAG) | check_cxx_compiler_flag(-fno-lto COMPILER_RT_HAS_FNO_LTO_FLAG) | ||||
check_cxx_compiler_flag(-msse3 COMPILER_RT_HAS_MSSE3_FLAG) | check_cxx_compiler_flag(-msse3 COMPILER_RT_HAS_MSSE3_FLAG) | ||||
▲ Show 20 Lines • Show All 220 Lines • ▼ Show 20 Lines | |||||
filter_available_targets(DFSAN_SUPPORTED_ARCH x86_64 mips64 mips64el) | filter_available_targets(DFSAN_SUPPORTED_ARCH x86_64 mips64 mips64el) | ||||
filter_available_targets(LSAN_SUPPORTED_ARCH x86_64 mips64 mips64el) | filter_available_targets(LSAN_SUPPORTED_ARCH x86_64 mips64 mips64el) | ||||
filter_available_targets(MSAN_SUPPORTED_ARCH x86_64 mips64 mips64el) | filter_available_targets(MSAN_SUPPORTED_ARCH x86_64 mips64 mips64el) | ||||
filter_available_targets(PROFILE_SUPPORTED_ARCH x86_64 i386 i686 arm mips mips64 | filter_available_targets(PROFILE_SUPPORTED_ARCH x86_64 i386 i686 arm mips mips64 | ||||
mipsel mips64el aarch64 powerpc64 powerpc64le) | mipsel mips64el aarch64 powerpc64 powerpc64le) | ||||
filter_available_targets(TSAN_SUPPORTED_ARCH x86_64 mips64 mips64el) | filter_available_targets(TSAN_SUPPORTED_ARCH x86_64 mips64 mips64el) | ||||
filter_available_targets(UBSAN_SUPPORTED_ARCH x86_64 i386 i686 arm aarch64 mips | filter_available_targets(UBSAN_SUPPORTED_ARCH x86_64 i386 i686 arm aarch64 mips | ||||
mipsel mips64 mips64el powerpc64 powerpc64le) | mipsel mips64 mips64el powerpc64 powerpc64le) | ||||
filter_available_targets(SAFESTACK_SUPPORTED_ARCH x86_64 i386 i686) | |||||
jfb: I haven't been through the LLVM-side code yet, but what prevents other architectures from being… | |||||
Not Done ReplyInline ActionsNot much as far as I know, but I understand that the general policy for these clauses is that the person who adds support for a particular architecture gets to add their architecture to the list. pcc: Not much as far as I know, but I understand that the general policy for these clauses is that… | |||||
Not Done ReplyInline ActionsGood point, in principle the code is fairly cross platform (although we only tested it on x86). ksvladimir: Good point, in principle the code is fairly cross platform (although we only tested it on x86). | |||||
if(ANDROID) | if(ANDROID) | ||||
set(OS_NAME "Android") | set(OS_NAME "Android") | ||||
else() | else() | ||||
set(OS_NAME "${CMAKE_SYSTEM_NAME}") | set(OS_NAME "${CMAKE_SYSTEM_NAME}") | ||||
endif() | endif() | ||||
if (SANITIZER_COMMON_SUPPORTED_ARCH AND NOT LLVM_USE_SANITIZER AND | if (SANITIZER_COMMON_SUPPORTED_ARCH AND NOT LLVM_USE_SANITIZER AND | ||||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | |||||
# -msse3 flag is not valid for Mips therefore clang gives a warning | # -msse3 flag is not valid for Mips therefore clang gives a warning | ||||
# message with -msse3. But check_c_compiler_flags() checks only for | # message with -msse3. But check_c_compiler_flags() checks only for | ||||
# compiler error messages. Therefore COMPILER_RT_HAS_MSSE3_FLAG turns out to be | # compiler error messages. Therefore COMPILER_RT_HAS_MSSE3_FLAG turns out to be | ||||
# true on Mips, so we make it false here. | # true on Mips, so we make it false here. | ||||
if("${LLVM_NATIVE_ARCH}" STREQUAL "Mips") | if("${LLVM_NATIVE_ARCH}" STREQUAL "Mips") | ||||
set(COMPILER_RT_HAS_MSSE3_FLAG FALSE) | set(COMPILER_RT_HAS_MSSE3_FLAG FALSE) | ||||
endif() | endif() | ||||
if (SAFESTACK_SUPPORTED_ARCH AND | |||||
OS_NAME MATCHES "Darwin|Linux|FreeBSD") | |||||
Not Done ReplyInline ActionsWhat's missing for Windows support? Thread and TLS support? It's the most significant platform for Chrome (well, and Android), and we're looking forward to LLVM support on Windows. Not having SafeStack would be sad. This can be a different patch, but I think it's important. jfb: What's missing for Windows support? Thread and TLS support? It's the most significant platform… | |||||
Not Done ReplyInline Actions
LLVM already supports TLS on Windows (I believe), but we will have to find some way to intercept thread creation to allocate both stacks.
Agree. pcc: > What's missing for Windows support? Thread and TLS support?
LLVM already supports TLS on… | |||||
Not Done ReplyInline ActionsTagging @rnk FYI. jfb: Tagging @rnk FYI. | |||||
set(COMPILER_RT_HAS_SAFESTACK TRUE) | |||||
else() | |||||
set(COMPILER_RT_HAS_SAFESTACK FALSE) | |||||
endif() |
I haven't been through the LLVM-side code yet, but what prevents other architectures from being supported? IIUC nothing is x86 specific since it's in `lib/Transforms`, right?