nixpkgs/pkgs/development/compilers/llvm/5/compiler-rt-codesign.patch
2017-09-26 16:51:17 -05:00

156 lines
6.0 KiB
Diff

From 3dec5f3475a26aeb4678627795c4b67c6b7b4785 Mon Sep 17 00:00:00 2001
From: Will Dietz <w@wdtz.org>
Date: Tue, 19 Sep 2017 13:13:06 -0500
Subject: [PATCH] remove codesign use on Apple, disable ios sim testing that
needs it
---
cmake/Modules/AddCompilerRT.cmake | 8 ------
test/asan/CMakeLists.txt | 52 ---------------------------------------
test/tsan/CMakeLists.txt | 47 -----------------------------------
3 files changed, 107 deletions(-)
diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake
index bc5fb9ff7..b64eb4246 100644
--- a/cmake/Modules/AddCompilerRT.cmake
+++ b/cmake/Modules/AddCompilerRT.cmake
@@ -210,14 +210,6 @@ function(add_compiler_rt_runtime name type)
set_target_properties(${libname} PROPERTIES IMPORT_PREFIX "")
set_target_properties(${libname} PROPERTIES IMPORT_SUFFIX ".lib")
endif()
- if(APPLE)
- # Ad-hoc sign the dylibs
- add_custom_command(TARGET ${libname}
- POST_BUILD
- COMMAND codesign --sign - $<TARGET_FILE:${libname}>
- WORKING_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR}
- )
- endif()
endif()
install(TARGETS ${libname}
ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}
diff --git a/test/asan/CMakeLists.txt b/test/asan/CMakeLists.txt
index 8bfc15b5c..f23d0f71a 100644
--- a/test/asan/CMakeLists.txt
+++ b/test/asan/CMakeLists.txt
@@ -83,58 +83,6 @@ foreach(arch ${ASAN_TEST_ARCH})
endif()
endforeach()
-# iOS and iOS simulator test suites
-# These are not added into "check-all", in order to run these tests, use
-# "check-asan-iossim-x86_64" and similar. They also require that an extra env
-# variable to select which iOS device or simulator to use, e.g.:
-# SANITIZER_IOSSIM_TEST_DEVICE_IDENTIFIER="iPhone 6"
-if(APPLE)
- set(EXCLUDE_FROM_ALL ON)
-
- set(ASAN_TEST_TARGET_CC ${COMPILER_RT_TEST_COMPILER})
- set(ASAN_TEST_IOS "1")
- pythonize_bool(ASAN_TEST_IOS)
- set(ASAN_TEST_DYNAMIC True)
-
- foreach(arch ${DARWIN_iossim_ARCHS})
- set(ASAN_TEST_IOSSIM "1")
- pythonize_bool(ASAN_TEST_IOSSIM)
- set(ASAN_TEST_TARGET_ARCH ${arch})
- set(ASAN_TEST_TARGET_CFLAGS "-arch ${arch} -isysroot ${DARWIN_iossim_SYSROOT} ${COMPILER_RT_TEST_COMPILER_CFLAGS}")
- set(ASAN_TEST_CONFIG_SUFFIX "-${arch}-iossim")
- get_bits_for_arch(${arch} ASAN_TEST_BITS)
- string(TOUPPER ${arch} ARCH_UPPER_CASE)
- set(CONFIG_NAME "IOSSim${ARCH_UPPER_CASE}Config")
- configure_lit_site_cfg(
- ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
- ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg
- )
- add_lit_testsuite(check-asan-iossim-${arch} "AddressSanitizer iOS Simulator ${arch} tests"
- ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/
- DEPENDS ${ASAN_TEST_DEPS})
- endforeach()
-
- foreach (arch ${DARWIN_ios_ARCHS})
- set(ASAN_TEST_IOSSIM "0")
- pythonize_bool(ASAN_TEST_IOSSIM)
- set(ASAN_TEST_TARGET_ARCH ${arch})
- set(ASAN_TEST_TARGET_CFLAGS "-arch ${arch} -isysroot ${DARWIN_ios_SYSROOT} ${COMPILER_RT_TEST_COMPILER_CFLAGS}")
- set(ASAN_TEST_CONFIG_SUFFIX "-${arch}-ios")
- get_bits_for_arch(${arch} ASAN_TEST_BITS)
- string(TOUPPER ${arch} ARCH_UPPER_CASE)
- set(CONFIG_NAME "IOS${ARCH_UPPER_CASE}Config")
- configure_lit_site_cfg(
- ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
- ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg
- )
- add_lit_testsuite(check-asan-ios-${arch} "AddressSanitizer iOS ${arch} tests"
- ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/
- DEPENDS ${ASAN_TEST_DEPS})
- endforeach()
-
- set(EXCLUDE_FROM_ALL OFF)
-endif()
-
# Add unit tests.
if(COMPILER_RT_INCLUDE_TESTS)
set(ASAN_TEST_DYNAMIC False)
diff --git a/test/tsan/CMakeLists.txt b/test/tsan/CMakeLists.txt
index a68908612..cde0accb5 100644
--- a/test/tsan/CMakeLists.txt
+++ b/test/tsan/CMakeLists.txt
@@ -42,53 +42,6 @@ foreach(arch ${TSAN_TEST_ARCH})
list(APPEND TSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME})
endforeach()
-# iOS and iOS simulator test suites
-# These are not added into "check-all", in order to run these tests, use
-# "check-tsan-iossim-x86_64" and similar. They also require an extra environment
-# variable to select which iOS device or simulator to use, e.g.:
-# SANITIZER_IOSSIM_TEST_DEVICE_IDENTIFIER="iPhone 6"
-if(APPLE)
- set(EXCLUDE_FROM_ALL ON)
-
- set(TSAN_TEST_TARGET_CC ${COMPILER_RT_TEST_COMPILER})
- set(TSAN_TEST_IOS "1")
- pythonize_bool(TSAN_TEST_IOS)
-
- set(arch "x86_64")
- set(TSAN_TEST_IOSSIM "1")
- pythonize_bool(TSAN_TEST_IOSSIM)
- set(TSAN_TEST_TARGET_ARCH ${arch})
- set(TSAN_TEST_TARGET_CFLAGS "-arch ${arch} -isysroot ${DARWIN_iossim_SYSROOT} ${COMPILER_RT_TEST_COMPILER_CFLAGS}")
- set(TSAN_TEST_CONFIG_SUFFIX "-${arch}-iossim")
- string(TOUPPER ${arch} ARCH_UPPER_CASE)
- set(CONFIG_NAME "IOSSim${ARCH_UPPER_CASE}Config")
- configure_lit_site_cfg(
- ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
- ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg
- )
- add_lit_testsuite(check-tsan-iossim-${arch} "ThreadSanitizer iOS Simulator ${arch} tests"
- ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/
- DEPENDS ${TSAN_TEST_DEPS})
-
- set(arch "arm64")
- set(TSAN_TEST_IOSSIM "0")
- pythonize_bool(TSAN_TEST_IOSSIM)
- set(TSAN_TEST_TARGET_ARCH ${arch})
- set(TSAN_TEST_TARGET_CFLAGS "-arch ${arch} -isysroot ${DARWIN_ios_SYSROOT} ${COMPILER_RT_TEST_COMPILER_CFLAGS}")
- set(TSAN_TEST_CONFIG_SUFFIX "-${arch}-ios")
- string(TOUPPER ${arch} ARCH_UPPER_CASE)
- set(CONFIG_NAME "IOS${ARCH_UPPER_CASE}Config")
- configure_lit_site_cfg(
- ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
- ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg
- )
- add_lit_testsuite(check-tsan-ios-${arch} "ThreadSanitizer iOS Simulator ${arch} tests"
- ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/
- DEPENDS ${TSAN_TEST_DEPS})
-
- set(EXCLUDE_FROM_ALL OFF)
-endif()
-
if(COMPILER_RT_INCLUDE_TESTS)
configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in
--
2.14.1