diff options
Diffstat (limited to 'pkgs/development/compilers/llvm/6/compiler-rt')
| -rw-r--r-- | pkgs/development/compilers/llvm/6/compiler-rt/default.nix | 3 | ||||
| -rw-r--r-- | pkgs/development/compilers/llvm/6/compiler-rt/gnu-install-dirs.patch | 107 |
2 files changed, 109 insertions, 1 deletions
diff --git a/pkgs/development/compilers/llvm/6/compiler-rt/default.nix b/pkgs/development/compilers/llvm/6/compiler-rt/default.nix index 4de48b16a8c0..b5f9eacd996d 100644 --- a/pkgs/development/compilers/llvm/6/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/6/compiler-rt/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation { inherit version; src = fetch "compiler-rt" "1fcr3jn24yr8lh36nc0c4ikli4744i2q9m1ik67p1jymwwaixkgl"; - nativeBuildInputs = [ cmake python3 llvm ]; + nativeBuildInputs = [ cmake python3 llvm.dev ]; buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi; env.NIX_CFLAGS_COMPILE = "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0"; @@ -52,6 +52,7 @@ stdenv.mkDerivation { ./codesign.patch # Revert compiler-rt commit that makes codesign mandatory # https://github.com/llvm/llvm-project/commit/947f9692440836dcb8d88b74b69dd379d85974ce ../../common/compiler-rt/glibc.patch + ./gnu-install-dirs.patch ] ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch; diff --git a/pkgs/development/compilers/llvm/6/compiler-rt/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/6/compiler-rt/gnu-install-dirs.patch new file mode 100644 index 000000000000..8daf03994b57 --- /dev/null +++ b/pkgs/development/compilers/llvm/6/compiler-rt/gnu-install-dirs.patch @@ -0,0 +1,107 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4b953b212829..a10b69aa67dc 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -8,6 +8,7 @@ cmake_minimum_required(VERSION 3.4.3) + # Check if compiler-rt is built as a standalone project. + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR COMPILER_RT_STANDALONE_BUILD) + project(CompilerRT C CXX ASM) ++ include(GNUInstallDirs) + set(COMPILER_RT_STANDALONE_BUILD TRUE) + endif() + +diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake +index 139b6140011c..502354a37d67 100644 +--- a/cmake/Modules/AddCompilerRT.cmake ++++ b/cmake/Modules/AddCompilerRT.cmake +@@ -439,7 +439,7 @@ macro(add_compiler_rt_resource_file target_name file_name component) + add_custom_target(${target_name} DEPENDS ${dst_file}) + # Install in Clang resource directory. + install(FILES ${file_name} +- DESTINATION ${COMPILER_RT_INSTALL_PATH} ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_PREFIX} + COMPONENT ${component}) + add_dependencies(${component} ${target_name}) + +@@ -456,7 +456,7 @@ macro(add_compiler_rt_script name) + add_custom_target(${name} DEPENDS ${dst}) + install(FILES ${dst} + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/bin) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_BINDIR}) + endmacro(add_compiler_rt_script src name) + + # Builds custom version of libc++ and installs it in <prefix>. +diff --git a/cmake/Modules/CompilerRTDarwinUtils.cmake b/cmake/Modules/CompilerRTDarwinUtils.cmake +index a25540bf46d1..77ea739fea74 100644 +--- a/cmake/Modules/CompilerRTDarwinUtils.cmake ++++ b/cmake/Modules/CompilerRTDarwinUtils.cmake +@@ -375,7 +375,7 @@ macro(darwin_add_embedded_builtin_libraries) + set(DARWIN_macho_embedded_LIBRARY_OUTPUT_DIR + ${COMPILER_RT_OUTPUT_DIR}/lib/macho_embedded) + set(DARWIN_macho_embedded_LIBRARY_INSTALL_DIR +- ${COMPILER_RT_INSTALL_PATH}/lib/macho_embedded) ++ ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_LIBDIR}/macho_embedded) + + set(CFLAGS_armv7 "-target thumbv7-apple-darwin-eabi") + set(CFLAGS_i386 "-march=pentium") +diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake +index b208f0852408..cacf4e8fb69d 100644 +--- a/cmake/base-config-ix.cmake ++++ b/cmake/base-config-ix.cmake +@@ -46,11 +46,11 @@ if (LLVM_TREE_AVAILABLE) + else() + # Take output dir and install path from the user. + set(COMPILER_RT_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH +- "Path where built compiler-rt libraries should be stored.") ++ "Path where built compiler-rt build artifacts should be stored.") + set(COMPILER_RT_EXEC_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/bin CACHE PATH + "Path where built compiler-rt executables should be stored.") +- set(COMPILER_RT_INSTALL_PATH ${CMAKE_INSTALL_PREFIX} CACHE PATH +- "Path where built compiler-rt libraries should be installed.") ++ set(COMPILER_RT_INSTALL_PATH "" CACHE PATH ++ "Prefix where built compiler-rt artifacts should be installed, comes before CMAKE_INSTALL_PREFIX.") + option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests." OFF) + option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered" OFF) + # Use a host compiler to compile/link tests. +@@ -70,9 +70,9 @@ if(NOT DEFINED COMPILER_RT_OS_DIR) + string(TOLOWER ${CMAKE_SYSTEM_NAME} COMPILER_RT_OS_DIR) + endif() + set(COMPILER_RT_LIBRARY_OUTPUT_DIR +- ${COMPILER_RT_OUTPUT_DIR}/lib/${COMPILER_RT_OS_DIR}) ++ ${COMPILER_RT_OUTPUT_DIR}/${CMAKE_INSTALL_FULL_LIBDIR}/${COMPILER_RT_OS_DIR}) + set(COMPILER_RT_LIBRARY_INSTALL_DIR +- ${COMPILER_RT_INSTALL_PATH}/lib/${COMPILER_RT_OS_DIR}) ++ ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_LIBDIR}/${COMPILER_RT_OS_DIR}) + + if(APPLE) + # On Darwin if /usr/include doesn't exist, the user probably has Xcode but not +diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt +index f7efb102ab63..ab8a94d9ff40 100644 +--- a/include/CMakeLists.txt ++++ b/include/CMakeLists.txt +@@ -47,12 +47,12 @@ set_target_properties(compiler-rt-headers PROPERTIES FOLDER "Compiler-RT Misc") + install(FILES ${SANITIZER_HEADERS} + COMPONENT compiler-rt-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/sanitizer) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/sanitizer) + # Install xray headers. + install(FILES ${XRAY_HEADERS} + COMPONENT compiler-rt-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +- DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/xray) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/xray) + + if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDEs. + add_custom_target(install-compiler-rt-headers +diff --git a/lib/dfsan/CMakeLists.txt b/lib/dfsan/CMakeLists.txt +index 2c486bff821b..0ee715da95f8 100644 +--- a/lib/dfsan/CMakeLists.txt ++++ b/lib/dfsan/CMakeLists.txt +@@ -44,4 +44,4 @@ add_custom_command(OUTPUT ${dfsan_abilist_filename} + DEPENDS done_abilist.txt libc_ubuntu1404_abilist.txt) + add_dependencies(dfsan dfsan_abilist) + install(FILES ${dfsan_abilist_filename} +- DESTINATION ${COMPILER_RT_INSTALL_PATH}) ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_PREFIX}) |
