llvmPackages_7: remove at 7.1.0

+9 -3381
-68
pkgs/development/compilers/llvm/7/clang/HIP-use-PATH-7.patch
··· 1 - From 8412cba68835f8f4cc527d02194b181faa5944d4 Mon Sep 17 00:00:00 2001 2 - From: =?UTF-8?q?Holger=20W=C3=BCnsche?= <holger.o.wuensche@t-online.de> 3 - Date: Tue, 21 Jan 2020 19:46:09 +0100 4 - Subject: [PATCH] [HIP] use GetProgramPath for executable discovery 5 - 6 - This change replaces the manual building of executable paths 7 - using llvm::sys::path::append with GetProgramPath. 8 - This enables adding other paths in case executables reside 9 - in different directories and makes the code easier to read. 10 - 11 - Differential Revision: https://reviews.llvm.org/D72903 12 - --- 13 - clang/lib/Driver/ToolChains/HIP.cpp | 18 ++++++------------ 14 - 1 file changed, 6 insertions(+), 12 deletions(-) 15 - 16 - diff --git a/lib/Driver/ToolChains/HIP.cpp b/lib/Driver/ToolChains/HIP.cpp 17 - index 03acf45a9b3..75fd3226c75 100644 18 - --- a/lib/Driver/ToolChains/HIP.cpp 19 - +++ b/lib/Driver/ToolChains/HIP.cpp 20 - @@ -98,9 +98,8 @@ const char *AMDGCN::Linker::constructLLVMLinkCommand( 21 - const char *OutputFileName = 22 - C.addTempFile(C.getArgs().MakeArgString(TmpName)); 23 - CmdArgs.push_back(OutputFileName); 24 - - SmallString<128> ExecPath(C.getDriver().Dir); 25 - - llvm::sys::path::append(ExecPath, "llvm-link"); 26 - - const char *Exec = Args.MakeArgString(ExecPath); 27 - + const char *Exec = 28 - + Args.MakeArgString(getToolChain().GetProgramPath("llvm-link")); 29 - C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs)); 30 - return OutputFileName; 31 - } 32 - @@ -141,9 +140,8 @@ const char *AMDGCN::Linker::constructOptCommand( 33 - const char *OutputFileName = 34 - C.addTempFile(C.getArgs().MakeArgString(TmpFileName)); 35 - OptArgs.push_back(OutputFileName); 36 - - SmallString<128> OptPath(C.getDriver().Dir); 37 - - llvm::sys::path::append(OptPath, "opt"); 38 - - const char *OptExec = Args.MakeArgString(OptPath); 39 - + const char *OptExec = 40 - + Args.MakeArgString(getToolChain().GetProgramPath("opt")); 41 - C.addCommand(llvm::make_unique<Command>(JA, *this, OptExec, OptArgs, Inputs)); 42 - return OutputFileName; 43 - } 44 - @@ -161,9 +159,7 @@ const char *AMDGCN::Linker::constructLlcCommand( 45 - const char *LlcOutputFile = 46 - C.addTempFile(C.getArgs().MakeArgString(LlcOutputFileName)); 47 - LlcArgs.push_back(LlcOutputFile); 48 - - SmallString<128> LlcPath(C.getDriver().Dir); 49 - - llvm::sys::path::append(LlcPath, "llc"); 50 - - const char *Llc = Args.MakeArgString(LlcPath); 51 - + const char *Llc = Args.MakeArgString(getToolChain().GetProgramPath("llc")); 52 - C.addCommand(llvm::make_unique<Command>(JA, *this, Llc, LlcArgs, Inputs)); 53 - return LlcOutputFile; 54 - } 55 - @@ -178,9 +174,7 @@ void AMDGCN::Linker::constructLldCommand(Compilation &C, const JobAction &JA, 56 - ArgStringList LldArgs{"-flavor", "gnu", "--no-undefined", 57 - "-shared", "-o", Output.getFilename(), 58 - InputFileName}; 59 - - SmallString<128> LldPath(C.getDriver().Dir); 60 - - llvm::sys::path::append(LldPath, "lld"); 61 - - const char *Lld = Args.MakeArgString(LldPath); 62 - + const char *Lld = Args.MakeArgString(getToolChain().GetProgramPath("lld")); 63 - C.addCommand(llvm::make_unique<Command>(JA, *this, Lld, LldArgs, Inputs)); 64 - } 65 - 66 - -- 67 - 2.23.1 68 -
-139
pkgs/development/compilers/llvm/7/clang/default.nix
··· 1 - { lib, stdenv, llvm_meta, fetch, substituteAll, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3 2 - , buildLlvmTools 3 - , fixDarwinDylibNames 4 - , enableManpages ? false 5 - , enablePolly ? false # TODO: get this info from llvm (passthru?) 6 - }: 7 - 8 - let 9 - self = stdenv.mkDerivation ({ 10 - pname = "clang"; 11 - inherit version; 12 - 13 - src = fetch "cfe" "0vc4i87qwxnw9lci4ayws9spakg0z6w5w670snj9f8g5m9rc8zg9"; 14 - 15 - unpackPhase = '' 16 - unpackFile $src 17 - mv cfe-${version}* clang 18 - sourceRoot=$PWD/clang 19 - unpackFile ${clang-tools-extra_src} 20 - mv clang-tools-extra-* $sourceRoot/tools/extra 21 - ''; 22 - 23 - nativeBuildInputs = [ cmake python3 ] 24 - ++ lib.optional enableManpages python3.pkgs.sphinx 25 - ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; 26 - 27 - buildInputs = [ libxml2 libllvm ]; 28 - 29 - cmakeFlags = [ 30 - "-DCMAKE_CXX_FLAGS=-std=c++11" 31 - "-DLLVM_ENABLE_RTTI=ON" 32 - "-DLLVM_CONFIG_PATH=${libllvm.dev}/bin/llvm-config${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-native"}" 33 - ] ++ lib.optionals enableManpages [ 34 - "-DCLANG_INCLUDE_DOCS=ON" 35 - "-DLLVM_ENABLE_SPHINX=ON" 36 - "-DSPHINX_OUTPUT_MAN=ON" 37 - "-DSPHINX_OUTPUT_HTML=OFF" 38 - "-DSPHINX_WARNINGS_AS_ERRORS=OFF" 39 - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ 40 - "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" 41 - "-DCLANG_TABLEGEN=${buildLlvmTools.libclang.dev}/bin/clang-tblgen" 42 - ] ++ lib.optionals enablePolly [ 43 - "-DWITH_POLLY=ON" 44 - "-DLINK_POLLY_INTO_TOOLS=ON" 45 - ]; 46 - 47 - patches = [ 48 - ../../common/clang/5-8-purity.patch 49 - # make clang -xhip use $PATH to find executables 50 - ./HIP-use-PATH-7.patch 51 - # Backport for the `--unwindlib=[libgcc|compiler-rt]` flag, which is 52 - # needed for our bootstrapping to not interfere with C. 53 - ./unwindlib.patch 54 - ./gnu-install-dirs.patch 55 - (substituteAll { 56 - src = ../../clang-6-10-LLVMgold-path.patch; 57 - libllvmLibdir = "${libllvm.lib}/lib"; 58 - }) 59 - ]; 60 - 61 - postPatch = '' 62 - sed -i -e 's/DriverArgs.hasArg(options::OPT_nostdlibinc)/true/' \ 63 - -e 's/Args.hasArg(options::OPT_nostdlibinc)/true/' \ 64 - lib/Driver/ToolChains/*.cpp 65 - '' + lib.optionalString stdenv.hostPlatform.isMusl '' 66 - sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp 67 - '' + lib.optionalString stdenv.hostPlatform.isDarwin '' 68 - substituteInPlace tools/extra/clangd/CMakeLists.txt \ 69 - --replace "NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB" FALSE 70 - ''; 71 - 72 - outputs = [ "out" "lib" "dev" "python" ]; 73 - 74 - postInstall = '' 75 - ln -sv $out/bin/clang $out/bin/cpp 76 - 77 - # Move libclang to 'lib' output 78 - moveToOutput "lib/libclang.*" "$lib" 79 - substituteInPlace $out/lib/cmake/clang/ClangTargets-release.cmake \ 80 - --replace "\''${_IMPORT_PREFIX}/lib/libclang." "$lib/lib/libclang." 81 - 82 - mkdir -p $python/bin $python/share/{clang,scan-view} 83 - mv $out/bin/{git-clang-format,scan-view} $python/bin 84 - if [ -e $out/bin/set-xcode-analyzer ]; then 85 - mv $out/bin/set-xcode-analyzer $python/bin 86 - fi 87 - mv $out/share/clang/*.py $python/share/clang 88 - mv $out/share/scan-view/*.py $python/share/scan-view 89 - rm $out/bin/c-index-test 90 - patchShebangs $python/bin 91 - 92 - mkdir -p $dev/bin 93 - cp bin/clang-tblgen $dev/bin 94 - ''; 95 - 96 - passthru = { 97 - inherit libllvm; 98 - isClang = true; 99 - hardeningUnsupportedFlags = [ "fortify3" ]; 100 - }; 101 - 102 - meta = llvm_meta // { 103 - homepage = "https://clang.llvm.org/"; 104 - description = "A C language family frontend for LLVM"; 105 - longDescription = '' 106 - The Clang project provides a language front-end and tooling 107 - infrastructure for languages in the C language family (C, C++, Objective 108 - C/C++, OpenCL, CUDA, and RenderScript) for the LLVM project. 109 - It aims to deliver amazingly fast compiles, extremely useful error and 110 - warning messages and to provide a platform for building great source 111 - level tools. The Clang Static Analyzer and clang-tidy are tools that 112 - automatically find bugs in your code, and are great examples of the sort 113 - of tools that can be built using the Clang frontend as a library to 114 - parse C/C++ code. 115 - ''; 116 - mainProgram = "clang"; 117 - }; 118 - } // lib.optionalAttrs enableManpages { 119 - pname = "clang-manpages"; 120 - 121 - buildPhase = '' 122 - make docs-clang-man 123 - ''; 124 - 125 - installPhase = '' 126 - mkdir -p $out/share/man/man1 127 - # Manually install clang manpage 128 - cp docs/man/*.1 $out/share/man/man1/ 129 - ''; 130 - 131 - outputs = [ "out" ]; 132 - 133 - doCheck = false; 134 - 135 - meta = llvm_meta // { 136 - description = "man page for Clang ${version}"; 137 - }; 138 - }); 139 - in self
-281
pkgs/development/compilers/llvm/7/clang/gnu-install-dirs.patch
··· 1 - diff --git a/CMakeLists.txt b/CMakeLists.txt 2 - index 52b881939499..85662a2113e7 100644 3 - --- a/CMakeLists.txt 4 - +++ b/CMakeLists.txt 5 - @@ -5,6 +5,8 @@ cmake_minimum_required(VERSION 3.4.3) 6 - if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) 7 - project(Clang) 8 - 9 - + include(GNUInstallDirs) 10 - + 11 - # Rely on llvm-config. 12 - set(CONFIG_OUTPUT) 13 - find_program(LLVM_CONFIG "llvm-config") 14 - @@ -374,7 +376,7 @@ include_directories(BEFORE 15 - 16 - if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) 17 - install(DIRECTORY include/clang include/clang-c 18 - - DESTINATION include 19 - + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} 20 - FILES_MATCHING 21 - PATTERN "*.def" 22 - PATTERN "*.h" 23 - @@ -383,7 +385,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) 24 - ) 25 - 26 - install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/clang 27 - - DESTINATION include 28 - + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} 29 - FILES_MATCHING 30 - PATTERN "CMakeFiles" EXCLUDE 31 - PATTERN "*.inc" 32 - @@ -391,7 +393,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) 33 - ) 34 - 35 - install(PROGRAMS utils/bash-autocomplete.sh 36 - - DESTINATION share/clang 37 - + DESTINATION ${CMAKE_INSTALL_DATADIR}/clang 38 - ) 39 - endif() 40 - 41 - diff --git a/cmake/modules/AddClang.cmake b/cmake/modules/AddClang.cmake 42 - index c09a8423f9f6..39f37e0097eb 100644 43 - --- a/cmake/modules/AddClang.cmake 44 - +++ b/cmake/modules/AddClang.cmake 45 - @@ -99,9 +99,9 @@ macro(add_clang_library name) 46 - install(TARGETS ${name} 47 - COMPONENT ${name} 48 - ${export_to_clangtargets} 49 - - LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} 50 - - ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} 51 - - RUNTIME DESTINATION bin) 52 - + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} 53 - + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} 54 - + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) 55 - 56 - if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES) 57 - add_llvm_install_targets(install-${name} 58 - @@ -141,7 +141,7 @@ macro(add_clang_tool name) 59 - 60 - install(TARGETS ${name} 61 - ${export_to_clangtargets} 62 - - RUNTIME DESTINATION bin 63 - + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 64 - COMPONENT ${name}) 65 - 66 - if(NOT CMAKE_CONFIGURATION_TYPES) 67 - @@ -156,5 +156,5 @@ endmacro() 68 - macro(add_clang_symlink name dest) 69 - add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE) 70 - # Always generate install targets 71 - - llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE) 72 - + llvm_install_symlink(${name} ${dest} ${CMAKE_INSTALL_FULL_BINDIR} ALWAYS_GENERATE) 73 - endmacro() 74 - diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt 75 - index 1930d8e225c7..bb9158093079 100644 76 - --- a/lib/Headers/CMakeLists.txt 77 - +++ b/lib/Headers/CMakeLists.txt 78 - @@ -162,19 +162,19 @@ install( 79 - FILES ${files} ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h 80 - COMPONENT clang-headers 81 - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ 82 - - DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) 83 - + DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) 84 - 85 - install( 86 - FILES ${files} ${CMAKE_CURRENT_BINARY_DIR}/arm_fp16.h 87 - COMPONENT clang-headers 88 - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ 89 - - DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) 90 - + DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) 91 - 92 - install( 93 - FILES ${cuda_wrapper_files} 94 - COMPONENT clang-headers 95 - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ 96 - - DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include/cuda_wrappers) 97 - + DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include/cuda_wrappers) 98 - 99 - if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDE's. 100 - add_llvm_install_targets(install-clang-headers 101 - diff --git a/tools/c-index-test/CMakeLists.txt b/tools/c-index-test/CMakeLists.txt 102 - index 53e3421f1b35..79ae5bb4c399 100644 103 - --- a/tools/c-index-test/CMakeLists.txt 104 - +++ b/tools/c-index-test/CMakeLists.txt 105 - @@ -54,7 +54,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) 106 - set_property(TARGET c-index-test APPEND PROPERTY INSTALL_RPATH 107 - "@executable_path/../../lib") 108 - else() 109 - - set(INSTALL_DESTINATION bin) 110 - + set(INSTALL_DESTINATION ${CMAKE_INSTALL_BINDIR}) 111 - endif() 112 - 113 - install(TARGETS c-index-test 114 - diff --git a/tools/clang-check/CMakeLists.txt b/tools/clang-check/CMakeLists.txt 115 - index c5ace26c2914..97bdfca7d896 100644 116 - --- a/tools/clang-check/CMakeLists.txt 117 - +++ b/tools/clang-check/CMakeLists.txt 118 - @@ -20,4 +20,4 @@ target_link_libraries(clang-check 119 - ) 120 - 121 - install(TARGETS clang-check 122 - - RUNTIME DESTINATION bin) 123 - + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) 124 - diff --git a/tools/clang-format/CMakeLists.txt b/tools/clang-format/CMakeLists.txt 125 - index a295e8cd0b2a..1973ff82c7f6 100644 126 - --- a/tools/clang-format/CMakeLists.txt 127 - +++ b/tools/clang-format/CMakeLists.txt 128 - @@ -21,20 +21,20 @@ if( LLVM_LIB_FUZZING_ENGINE OR LLVM_USE_SANITIZE_COVERAGE ) 129 - endif() 130 - 131 - install(PROGRAMS clang-format-bbedit.applescript 132 - - DESTINATION share/clang 133 - + DESTINATION ${CMAKE_INSTALL_DATADIR}/clang 134 - COMPONENT clang-format) 135 - install(PROGRAMS clang-format-diff.py 136 - - DESTINATION share/clang 137 - + DESTINATION ${CMAKE_INSTALL_DATADIR}/clang 138 - COMPONENT clang-format) 139 - install(PROGRAMS clang-format-sublime.py 140 - - DESTINATION share/clang 141 - + DESTINATION ${CMAKE_INSTALL_DATADIR}/clang 142 - COMPONENT clang-format) 143 - install(PROGRAMS clang-format.el 144 - - DESTINATION share/clang 145 - + DESTINATION ${CMAKE_INSTALL_DATADIR}/clang 146 - COMPONENT clang-format) 147 - install(PROGRAMS clang-format.py 148 - - DESTINATION share/clang 149 - + DESTINATION ${CMAKE_INSTALL_DATADIR}/clang 150 - COMPONENT clang-format) 151 - install(PROGRAMS git-clang-format 152 - - DESTINATION bin 153 - + DESTINATION ${CMAKE_INSTALL_BINDIR} 154 - COMPONENT clang-format) 155 - diff --git a/tools/clang-func-mapping/CMakeLists.txt b/tools/clang-func-mapping/CMakeLists.txt 156 - index ae28e28d532d..8ecb2e37a8f7 100644 157 - --- a/tools/clang-func-mapping/CMakeLists.txt 158 - +++ b/tools/clang-func-mapping/CMakeLists.txt 159 - @@ -20,4 +20,4 @@ target_link_libraries(clang-func-mapping 160 - ) 161 - 162 - install(TARGETS clang-func-mapping 163 - - RUNTIME DESTINATION bin) 164 - + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) 165 - diff --git a/tools/clang-offload-bundler/CMakeLists.txt b/tools/clang-offload-bundler/CMakeLists.txt 166 - index 8718015be76a..7a038f39622e 100644 167 - --- a/tools/clang-offload-bundler/CMakeLists.txt 168 - +++ b/tools/clang-offload-bundler/CMakeLists.txt 169 - @@ -22,4 +22,4 @@ target_link_libraries(clang-offload-bundler 170 - ${CLANG_OFFLOAD_BUNDLER_LIB_DEPS} 171 - ) 172 - 173 - -install(TARGETS clang-offload-bundler RUNTIME DESTINATION bin) 174 - +install(TARGETS clang-offload-bundler RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) 175 - diff --git a/tools/clang-rename/CMakeLists.txt b/tools/clang-rename/CMakeLists.txt 176 - index 3b3ab1540a80..9aca9ba4a2cf 100644 177 - --- a/tools/clang-rename/CMakeLists.txt 178 - +++ b/tools/clang-rename/CMakeLists.txt 179 - @@ -18,8 +18,8 @@ target_link_libraries(clang-rename 180 - ) 181 - 182 - install(PROGRAMS clang-rename.py 183 - - DESTINATION share/clang 184 - + DESTINATION ${CMAKE_INSTALL_DATADIR}/clang 185 - COMPONENT clang-rename) 186 - install(PROGRAMS clang-rename.el 187 - - DESTINATION share/clang 188 - + DESTINATION ${CMAKE_INSTALL_DATADIR}/clang 189 - COMPONENT clang-rename) 190 - diff --git a/tools/diagtool/CMakeLists.txt b/tools/diagtool/CMakeLists.txt 191 - index 96d1c390249c..41c762b37b76 100644 192 - --- a/tools/diagtool/CMakeLists.txt 193 - +++ b/tools/diagtool/CMakeLists.txt 194 - @@ -21,7 +21,7 @@ target_link_libraries(diagtool 195 - if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) 196 - install(TARGETS diagtool 197 - COMPONENT diagtool 198 - - RUNTIME DESTINATION bin) 199 - + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) 200 - 201 - if (NOT CMAKE_CONFIGURATION_TYPES) 202 - add_llvm_install_targets(install-diagtool 203 - diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt 204 - index e539c8308e75..4e1fbccea35d 100644 205 - --- a/tools/libclang/CMakeLists.txt 206 - +++ b/tools/libclang/CMakeLists.txt 207 - @@ -130,7 +130,7 @@ endif() 208 - if(INTERNAL_INSTALL_PREFIX) 209 - set(LIBCLANG_HEADERS_INSTALL_DESTINATION "${INTERNAL_INSTALL_PREFIX}/include") 210 - else() 211 - - set(LIBCLANG_HEADERS_INSTALL_DESTINATION include) 212 - + set(LIBCLANG_HEADERS_INSTALL_DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) 213 - endif() 214 - 215 - install(DIRECTORY ../../include/clang-c 216 - diff --git a/tools/scan-build/CMakeLists.txt b/tools/scan-build/CMakeLists.txt 217 - index 380379300b09..adfd58ed5f7d 100644 218 - --- a/tools/scan-build/CMakeLists.txt 219 - +++ b/tools/scan-build/CMakeLists.txt 220 - @@ -41,7 +41,7 @@ if(CLANG_INSTALL_SCANBUILD) 221 - ${CMAKE_BINARY_DIR}/bin/ 222 - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile}) 223 - list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile}) 224 - - install(PROGRAMS bin/${BinFile} DESTINATION bin) 225 - + install(PROGRAMS bin/${BinFile} DESTINATION ${CMAKE_INSTALL_BINDIR}) 226 - endforeach() 227 - 228 - foreach(LibexecFile ${LibexecFiles}) 229 - @@ -53,7 +53,7 @@ if(CLANG_INSTALL_SCANBUILD) 230 - ${CMAKE_BINARY_DIR}/libexec/ 231 - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/libexec/${LibexecFile}) 232 - list(APPEND Depends ${CMAKE_BINARY_DIR}/libexec/${LibexecFile}) 233 - - install(PROGRAMS libexec/${LibexecFile} DESTINATION libexec) 234 - + install(PROGRAMS libexec/${LibexecFile} DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}) 235 - endforeach() 236 - 237 - foreach(ManPage ${ManPages}) 238 - @@ -77,7 +77,7 @@ if(CLANG_INSTALL_SCANBUILD) 239 - ${CMAKE_BINARY_DIR}/share/scan-build/ 240 - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/share/scan-build/${ShareFile}) 241 - list(APPEND Depends ${CMAKE_BINARY_DIR}/share/scan-build/${ShareFile}) 242 - - install(FILES share/scan-build/${ShareFile} DESTINATION share/scan-build) 243 - + install(FILES share/scan-build/${ShareFile} DESTINATION ${CMAKE_INSTALL_DATADIR}/scan-build) 244 - endforeach() 245 - 246 - add_custom_target(scan-build ALL DEPENDS ${Depends}) 247 - diff --git a/tools/scan-view/CMakeLists.txt b/tools/scan-view/CMakeLists.txt 248 - index b305ca562a72..554bcb379061 100644 249 - --- a/tools/scan-view/CMakeLists.txt 250 - +++ b/tools/scan-view/CMakeLists.txt 251 - @@ -21,7 +21,7 @@ if(CLANG_INSTALL_SCANVIEW) 252 - ${CMAKE_BINARY_DIR}/bin/ 253 - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile}) 254 - list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile}) 255 - - install(PROGRAMS bin/${BinFile} DESTINATION bin) 256 - + install(PROGRAMS bin/${BinFile} DESTINATION ${CMAKE_INSTALL_BINDIR}) 257 - endforeach() 258 - 259 - foreach(ShareFile ${ShareFiles}) 260 - @@ -33,7 +33,7 @@ if(CLANG_INSTALL_SCANVIEW) 261 - ${CMAKE_BINARY_DIR}/share/scan-view/ 262 - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/share/${ShareFile}) 263 - list(APPEND Depends ${CMAKE_BINARY_DIR}/share/scan-view/${ShareFile}) 264 - - install(FILES share/${ShareFile} DESTINATION share/scan-view) 265 - + install(FILES share/${ShareFile} DESTINATION ${CMAKE_INSTALL_DATADIR}/scan-view) 266 - endforeach() 267 - 268 - add_custom_target(scan-view ALL DEPENDS ${Depends}) 269 - diff --git a/utils/hmaptool/CMakeLists.txt b/utils/hmaptool/CMakeLists.txt 270 - index 5573009d343a..24b3a90f233f 100644 271 - --- a/utils/hmaptool/CMakeLists.txt 272 - +++ b/utils/hmaptool/CMakeLists.txt 273 - @@ -9,7 +9,7 @@ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/${CLANG_HM 274 - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${CLANG_HMAPTOOL}) 275 - 276 - list(APPEND Depends ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/${CLANG_HMAPTOOL}) 277 - -install(PROGRAMS ${CLANG_HMAPTOOL} DESTINATION bin) 278 - +install(PROGRAMS ${CLANG_HMAPTOOL} DESTINATION ${CMAKE_INSTALL_BINDIR}) 279 - 280 - add_custom_target(hmaptool ALL DEPENDS ${Depends}) 281 - set_target_properties(hmaptool PROPERTIES FOLDER "Utils")
-227
pkgs/development/compilers/llvm/7/clang/unwindlib.patch
··· 1 - commit a5cacb5ba7f1f18e7bb6f6709e42683eeb7e6470 2 - Author: Sterling Augustine <saugustine@google.com> 3 - Date: Tue Mar 19 20:01:59 2019 +0000 4 - 5 - Add --unwindlib=[libgcc|compiler-rt] to parallel --rtlib= [take 2] 6 - 7 - "clang++ hello.cc --rtlib=compiler-rt" 8 - 9 - now can works without specifying additional unwind or exception 10 - handling libraries. 11 - 12 - This reworked version of the feature no longer modifies today's default 13 - unwind library for compiler-rt: which is nothing. Rather, a user 14 - can specify -DCLANG_DEFAULT_UNWINDLIB=libunwind when configuring 15 - the compiler. 16 - 17 - This should address the issues from the previous version. 18 - 19 - Update tests for new --unwindlib semantics. 20 - 21 - Differential Revision: https://reviews.llvm.org/D59109 22 - 23 - llvm-svn: 356508 24 - 25 - diff --git clang/CMakeLists.txt clang/CMakeLists.txt 26 - index 52b881939499..2c3fb62f6e73 100644 27 - --- clang/CMakeLists.txt 28 - +++ clang/CMakeLists.txt 29 - @@ -244,6 +244,24 @@ if (NOT(CLANG_DEFAULT_RTLIB STREQUAL "" OR 30 - "Default runtime library to use (\"libgcc\" or \"compiler-rt\", empty for platform default)" FORCE) 31 - endif() 32 - 33 - +set(CLANG_DEFAULT_UNWINDLIB "" CACHE STRING 34 - + "Default unwind library to use (\"none\" \"libgcc\" or \"libunwind\", empty to match runtime library.)") 35 - +if (CLANG_DEFAULT_UNWINDLIB STREQUAL "") 36 - + if (CLANG_DEFAULT_RTLIB STREQUAL "libgcc") 37 - + set (CLANG_DEFAULT_UNWINDLIB "libgcc" CACHE STRING "" FORCE) 38 - + elseif (CLANG_DEFAULT_RTLIBS STREQUAL "libunwind") 39 - + set (CLANG_DEFAULT_UNWINDLIB "none" CACHE STRING "" FORCE) 40 - + endif() 41 - +endif() 42 - + 43 - +if (NOT(CLANG_DEFAULT_UNWINDLIB STREQUAL "none" OR 44 - + CLANG_DEFAULT_UNWINDLIB STREQUAL "libgcc" OR 45 - + CLANG_DEFAULT_UNWINDLIB STREQUAL "libunwind")) 46 - + message(WARNING "Resetting default unwindlib to use platform default") 47 - + set(CLANG_DEFAULT_UNWINDLIB "" CACHE STRING 48 - + "Default unwind library to use (\"none\" \"libgcc\" or \"libunwind\", empty for none)" FORCE) 49 - +endif() 50 - + 51 - set(CLANG_DEFAULT_OBJCOPY "objcopy" CACHE STRING 52 - "Default objcopy executable to use.") 53 - 54 - diff --git clang/include/clang/Basic/DiagnosticDriverKinds.td clang/include/clang/Basic/DiagnosticDriverKinds.td 55 - index 7f75f45c6578..7e1bb33b5cef 100644 56 - --- clang/include/clang/Basic/DiagnosticDriverKinds.td 57 - +++ clang/include/clang/Basic/DiagnosticDriverKinds.td 58 - @@ -52,6 +52,10 @@ def err_drv_invalid_rtlib_name : Error< 59 - "invalid runtime library name in argument '%0'">; 60 - def err_drv_unsupported_rtlib_for_platform : Error< 61 - "unsupported runtime library '%0' for platform '%1'">; 62 - +def err_drv_invalid_unwindlib_name : Error< 63 - + "invalid unwind library name in argument '%0'">; 64 - +def err_drv_incompatible_unwindlib : Error< 65 - + "--rtlib=libgcc requires --unwindlib=libgcc">; 66 - def err_drv_invalid_stdlib_name : Error< 67 - "invalid library name in argument '%0'">; 68 - def err_drv_invalid_output_with_multiple_archs : Error< 69 - diff --git clang/include/clang/Config/config.h.cmake clang/include/clang/Config/config.h.cmake 70 - index 1d624450b9d9..2d4cb747e87e 100644 71 - --- clang/include/clang/Config/config.h.cmake 72 - +++ clang/include/clang/Config/config.h.cmake 73 - @@ -23,6 +23,9 @@ 74 - /* Default runtime library to use. */ 75 - #define CLANG_DEFAULT_RTLIB "${CLANG_DEFAULT_RTLIB}" 76 - 77 - +/* Default unwind library to use. */ 78 - +#define CLANG_DEFAULT_UNWINDLIB "${CLANG_DEFAULT_UNWINDLIB}" 79 - + 80 - /* Default objcopy to use */ 81 - #define CLANG_DEFAULT_OBJCOPY "${CLANG_DEFAULT_OBJCOPY}" 82 - 83 - diff --git clang/include/clang/Driver/Options.td clang/include/clang/Driver/Options.td 84 - index 601aa8744967..0e74a2d36dea 100644 85 - --- clang/include/clang/Driver/Options.td 86 - +++ clang/include/clang/Driver/Options.td 87 - @@ -2428,6 +2428,8 @@ def std_EQ : Joined<["-", "--"], "std=">, Flags<[CC1Option]>, 88 - }]>; 89 - def stdlib_EQ : Joined<["-", "--"], "stdlib=">, Flags<[CC1Option]>, 90 - HelpText<"C++ standard library to use">, Values<"libc++,libstdc++,platform">; 91 - +def unwindlib_EQ : Joined<["-", "--"], "unwindlib=">, Flags<[CC1Option]>, 92 - + HelpText<"Unwind library to use">, Values<"libgcc,unwindlib,platform">; 93 - def sub__library : JoinedOrSeparate<["-"], "sub_library">; 94 - def sub__umbrella : JoinedOrSeparate<["-"], "sub_umbrella">; 95 - def system_header_prefix : Joined<["--"], "system-header-prefix=">, 96 - diff --git clang/include/clang/Driver/ToolChain.h clang/include/clang/Driver/ToolChain.h 97 - index 2f9c2c190e32..d5b131bcf112 100644 98 - --- clang/include/clang/Driver/ToolChain.h 99 - +++ clang/include/clang/Driver/ToolChain.h 100 - @@ -99,6 +99,12 @@ public: 101 - RLT_Libgcc 102 - }; 103 - 104 - + enum UnwindLibType { 105 - + UNW_None, 106 - + UNW_CompilerRT, 107 - + UNW_Libgcc 108 - + }; 109 - + 110 - enum RTTIMode { 111 - RM_Enabled, 112 - RM_Disabled, 113 - @@ -352,6 +358,10 @@ public: 114 - return ToolChain::CST_Libstdcxx; 115 - } 116 - 117 - + virtual UnwindLibType GetDefaultUnwindLibType() const { 118 - + return ToolChain::UNW_None; 119 - + } 120 - + 121 - virtual std::string getCompilerRTPath() const; 122 - 123 - virtual std::string getCompilerRT(const llvm::opt::ArgList &Args, 124 - @@ -484,6 +494,10 @@ public: 125 - // given compilation arguments. 126 - virtual CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const; 127 - 128 - + // GetUnwindLibType - Determine the unwind library type to use with the 129 - + // given compilation arguments. 130 - + virtual UnwindLibType GetUnwindLibType(const llvm::opt::ArgList &Args) const; 131 - + 132 - /// AddClangCXXStdlibIncludeArgs - Add the clang -cc1 level arguments to set 133 - /// the include paths to use for the given C++ standard library type. 134 - virtual void 135 - diff --git clang/lib/Driver/ToolChain.cpp clang/lib/Driver/ToolChain.cpp 136 - index cf3db34688df..d980dd5d23fb 100644 137 - --- clang/lib/Driver/ToolChain.cpp 138 - +++ clang/lib/Driver/ToolChain.cpp 139 - @@ -665,6 +665,33 @@ ToolChain::RuntimeLibType ToolChain::GetRuntimeLibType( 140 - return GetDefaultRuntimeLibType(); 141 - } 142 - 143 - +ToolChain::UnwindLibType ToolChain::GetUnwindLibType( 144 - + const ArgList &Args) const { 145 - + const Arg *A = Args.getLastArg(options::OPT_unwindlib_EQ); 146 - + StringRef LibName = A ? A->getValue() : CLANG_DEFAULT_UNWINDLIB; 147 - + 148 - + if (LibName == "none") 149 - + return ToolChain::UNW_None; 150 - + else if (LibName == "platform" || LibName == "") { 151 - + ToolChain::RuntimeLibType RtLibType = GetRuntimeLibType(Args); 152 - + if (RtLibType == ToolChain::RLT_CompilerRT) 153 - + return ToolChain::UNW_None; 154 - + else if (RtLibType == ToolChain::RLT_Libgcc) 155 - + return ToolChain::UNW_Libgcc; 156 - + } else if (LibName == "libunwind") { 157 - + if (GetRuntimeLibType(Args) == RLT_Libgcc) 158 - + getDriver().Diag(diag::err_drv_incompatible_unwindlib); 159 - + return ToolChain::UNW_CompilerRT; 160 - + } else if (LibName == "libgcc") 161 - + return ToolChain::UNW_Libgcc; 162 - + 163 - + if (A) 164 - + getDriver().Diag(diag::err_drv_invalid_unwindlib_name) 165 - + << A->getAsString(Args); 166 - + 167 - + return GetDefaultUnwindLibType(); 168 - +} 169 - + 170 - ToolChain::CXXStdlibType ToolChain::GetCXXStdlibType(const ArgList &Args) const{ 171 - const Arg *A = Args.getLastArg(options::OPT_stdlib_EQ); 172 - StringRef LibName = A ? A->getValue() : CLANG_DEFAULT_CXX_STDLIB; 173 - diff --git clang/test/Driver/compiler-rt-unwind.c clang/test/Driver/compiler-rt-unwind.c 174 - new file mode 100644 175 - index 000000000000..00024dfa7ed3 176 - --- /dev/null 177 - +++ clang/test/Driver/compiler-rt-unwind.c 178 - @@ -0,0 +1,49 @@ 179 - +// General tests that the driver handles combinations of --rtlib=XXX and 180 - +// --unwindlib=XXX properly. 181 - +// 182 - +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 183 - +// RUN: --target=x86_64-unknown-linux \ 184 - +// RUN: --gcc-toolchain="" \ 185 - +// RUN: | FileCheck --check-prefix=RTLIB-EMPTY %s 186 - +// RTLIB-EMPTY: "{{.*}}lgcc" 187 - +// RTLIB-EMPTY: "{{.*}}-lgcc_s" 188 - +// 189 - +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 190 - +// RUN: --target=x86_64-unknown-linux -rtlib=libgcc \ 191 - +// RUN: --gcc-toolchain="" \ 192 - +// RUN: | FileCheck --check-prefix=RTLIB-GCC %s 193 - +// RTLIB-GCC: "{{.*}}lgcc" 194 - +// RTLIB-GCC: "{{.*}}lgcc_s" 195 - +// 196 - +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 197 - +// RUN: --target=x86_64-unknown-linux -rtlib=libgcc --unwindlib=libunwind \ 198 - +// RUN: --gcc-toolchain="" \ 199 - +// RUN: | FileCheck --check-prefix=RTLIB-GCC-UNWINDLIB-COMPILER-RT %s 200 - +// RTLIB-GCC-UNWINDLIB-COMPILER-RT: "{{.*}}lgcc" 201 - +// RTLIB-GCC-UNWINDLIB-COMPILER-RT: "{{.*}}lunwind" 202 - +// 203 - +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 204 - +// RUN: --target=x86_64-unknown-linux -rtlib=compiler-rt \ 205 - +// RUN: --gcc-toolchain="" \ 206 - +// RUN: | FileCheck --check-prefix=RTLIB-COMPILER-RT %s 207 - +// RTLIB-COMPILER-RT: "{{.*}}libclang_rt.builtins-x86_64.a" 208 - +// 209 - +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 210 - +// RUN: --target=x86_64-unknown-linux -rtlib=compiler-rt --unwindlib=libgcc \ 211 - +// RUN: --gcc-toolchain="" \ 212 - +// RUN: | FileCheck --check-prefix=RTLIB-COMPILER-RT-UNWINDLIB-GCC %s 213 - +// RTLIB-COMPILER-RT-UNWINDLIB-GCC: "{{.*}}libclang_rt.builtins-x86_64.a" 214 - +// RTLIB-COMPILER-RT-UNWINDLIB-GCC: "{{.*}}lgcc_s" 215 - +// 216 - +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 217 - +// RUN: --target=x86_64-unknown-linux -rtlib=compiler-rt --unwindlib=libgcc \ 218 - +// RUN: -static --gcc-toolchain="" \ 219 - +// RUN: | FileCheck --check-prefix=RTLIB-COMPILER-RT-UNWINDLIB-GCC-STATIC %s 220 - +// RTLIB-COMPILER-RT-UNWINDLIB-GCC-STATIC: "{{.*}}libclang_rt.builtins-x86_64.a" 221 - +// RTLIB-COMPILER-RT-UNWINDLIB-GCC-STATIC: "{{.*}}lgcc_eh" 222 - +// 223 - +// RUN: not %clang -no-canonical-prefixes %s -o %t.o 2> %t.err \ 224 - +// RUN: --target=x86_64-unknown-linux -rtlib=libgcc --unwindlib=libunwind \ 225 - +// RUN: --gcc-toolchain="" \ 226 - +// RUN: FileCheck --input-file=%t.err --check-prefix=RTLIB-GCC-UNWINDLIB-COMPILER_RT %s 227 - +// RTLIB-GCC-UNWINDLIB-COMPILER_RT: "{{[.|\\\n]*}}--rtlib=libgcc requires --unwindlib=libgcc"
-38
pkgs/development/compilers/llvm/7/compiler-rt/armv7l.patch
··· 1 - diff -ur compiler-rt-7.1.0.src/cmake/builtin-config-ix.cmake compiler-rt-7.1.0.src-patched/cmake/builtin-config-ix.cmake 2 - --- compiler-rt-7.1.0.src/cmake/builtin-config-ix.cmake 2018-05-25 06:36:27.000000000 +0900 3 - +++ compiler-rt-7.1.0.src-patched/cmake/builtin-config-ix.cmake 2020-05-09 20:26:33.030608692 +0900 4 - @@ -24,7 +24,7 @@ 5 - 6 - 7 - set(ARM64 aarch64) 8 - -set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k) 9 - +set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k armv7l) 10 - set(HEXAGON hexagon) 11 - set(X86 i386) 12 - set(X86_64 x86_64) 13 - diff -ur compiler-rt-7.1.0.src/lib/builtins/CMakeLists.txt compiler-rt-7.1.0.src-patched/lib/builtins/CMakeLists.txt 14 - --- compiler-rt-7.1.0.src/lib/builtins/CMakeLists.txt 2018-07-31 03:18:59.000000000 +0900 15 - +++ compiler-rt-7.1.0.src-patched/lib/builtins/CMakeLists.txt 2020-05-09 20:27:38.893409318 +0900 16 - @@ -453,6 +453,7 @@ 17 - set(armv7_SOURCES ${arm_SOURCES}) 18 - set(armv7s_SOURCES ${arm_SOURCES}) 19 - set(armv7k_SOURCES ${arm_SOURCES}) 20 - +set(armv7l_SOURCES ${arm_SOURCES}) 21 - set(arm64_SOURCES ${aarch64_SOURCES}) 22 - 23 - # macho_embedded archs 24 - @@ -563,12 +564,12 @@ 25 - set(_arch ${arch}) 26 - if("${arch}" STREQUAL "armv6m") 27 - set(_arch "arm|armv6m") 28 - - elseif("${arch}" MATCHES "^(armhf|armv7|armv7s|armv7k|armv7m|armv7em)$") 29 - + elseif("${arch}" MATCHES "^(armhf|armv7|armv7s|armv7k|armv7l|armv7m|armv7em)$") 30 - set(_arch "arm") 31 - endif() 32 - 33 - # For ARM archs, exclude any VFP builtins if VFP is not supported 34 - - if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7m|armv7em)$") 35 - + if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7l|armv7m|armv7em)$") 36 - string(REPLACE ";" " " _TARGET_${arch}_CFLAGS "${TARGET_${arch}_CFLAGS}") 37 - check_compile_definition(__VFP_FP__ "${CMAKE_C_FLAGS} ${_TARGET_${arch}_CFLAGS}" COMPILER_RT_HAS_${arch}_VFP) 38 - if(NOT COMPILER_RT_HAS_${arch}_VFP)
-595
pkgs/development/compilers/llvm/7/compiler-rt/crtbegin-and-end.patch
··· 1 - Get crtbegin and crtend without compiler GCC! PR is at https://reviews.llvm.org/D28791 2 - 3 - Index: compiler-rt/CMakeLists.txt 4 - =================================================================== 5 - --- compiler-rt/CMakeLists.txt 6 - +++ compiler-rt/CMakeLists.txt 7 - @@ -29,6 +29,8 @@ 8 - 9 - option(COMPILER_RT_BUILD_BUILTINS "Build builtins" ON) 10 - mark_as_advanced(COMPILER_RT_BUILD_BUILTINS) 11 - +option(COMPILER_RT_BUILD_CRT "Build crtbegin.o/crtend.o" ON) 12 - +mark_as_advanced(COMPILER_RT_BUILD_CRT) 13 - option(COMPILER_RT_BUILD_SANITIZERS "Build sanitizers" ON) 14 - mark_as_advanced(COMPILER_RT_BUILD_SANITIZERS) 15 - option(COMPILER_RT_BUILD_XRAY "Build xray" ON) 16 - Index: compiler-rt/cmake/Modules/AddCompilerRT.cmake 17 - =================================================================== 18 - --- compiler-rt/cmake/Modules/AddCompilerRT.cmake 19 - +++ compiler-rt/cmake/Modules/AddCompilerRT.cmake 20 - @@ -132,7 +132,7 @@ 21 - # Adds static or shared runtime for a list of architectures and operating 22 - # systems and puts it in the proper directory in the build and install trees. 23 - # add_compiler_rt_runtime(<name> 24 - -# {STATIC|SHARED} 25 - +# {OBJECT|STATIC|SHARED} 26 - # ARCHS <architectures> 27 - # OS <os list> 28 - # SOURCES <source files> 29 - @@ -144,8 +144,8 @@ 30 - # PARENT_TARGET <convenience parent target> 31 - # ADDITIONAL_HEADERS <header files>) 32 - function(add_compiler_rt_runtime name type) 33 - - if(NOT type MATCHES "^(STATIC|SHARED)$") 34 - - message(FATAL_ERROR "type argument must be STATIC or SHARED") 35 - + if(NOT type MATCHES "^(OBJECT|STATIC|SHARED)$") 36 - + message(FATAL_ERROR "type argument must be OBJECT, STATIC or SHARED") 37 - return() 38 - endif() 39 - cmake_parse_arguments(LIB 40 - @@ -204,7 +204,10 @@ 41 - message(FATAL_ERROR "Architecture ${arch} can't be targeted") 42 - return() 43 - endif() 44 - - if(type STREQUAL "STATIC") 45 - + if(type STREQUAL "OBJECT") 46 - + set(libname "${name}-${arch}") 47 - + set(output_name_${libname} ${libname}${COMPILER_RT_OS_SUFFIX}) 48 - + elseif(type STREQUAL "STATIC") 49 - set(libname "${name}-${arch}") 50 - set_output_name(output_name_${libname} ${name} ${arch}) 51 - else() 52 - @@ -270,12 +273,34 @@ 53 - set(COMPONENT_OPTION COMPONENT ${libname}) 54 - endif() 55 - 56 - - add_library(${libname} ${type} ${sources_${libname}}) 57 - - set_target_compile_flags(${libname} ${extra_cflags_${libname}}) 58 - - set_target_link_flags(${libname} ${extra_link_flags_${libname}}) 59 - - set_property(TARGET ${libname} APPEND PROPERTY 60 - - COMPILE_DEFINITIONS ${LIB_DEFS}) 61 - - set_target_output_directories(${libname} ${output_dir_${libname}}) 62 - + if(type STREQUAL "OBJECT") 63 - + string(TOUPPER ${CMAKE_BUILD_TYPE} config) 64 - + get_property(cflags SOURCE ${sources_${libname}} PROPERTY COMPILE_FLAGS) 65 - + separate_arguments(cflags) 66 - + add_custom_command( 67 - + OUTPUT ${output_dir_${libname}}/${libname}.o 68 - + COMMAND ${CMAKE_C_COMPILER} ${sources_${libname}} ${cflags} ${extra_cflags_${libname}} -c -o ${output_dir_${libname}}/${libname}.o 69 - + DEPENDS ${sources_${libname}} 70 - + COMMENT "Building C object ${libname}.o") 71 - + add_custom_target(${libname} DEPENDS ${output_dir_${libname}}/${libname}.o) 72 - + install(FILES ${output_dir_${libname}}/${libname}.o 73 - + DESTINATION ${install_dir_${libname}} 74 - + ${COMPONENT_OPTION}) 75 - + else() 76 - + add_library(${libname} ${type} ${sources_${libname}}) 77 - + set_target_compile_flags(${libname} ${extra_cflags_${libname}}) 78 - + set_target_link_flags(${libname} ${extra_link_flags_${libname}}) 79 - + set_property(TARGET ${libname} APPEND PROPERTY 80 - + COMPILE_DEFINITIONS ${LIB_DEFS}) 81 - + set_target_output_directories(${libname} ${output_dir_${libname}}) 82 - + install(TARGETS ${libname} 83 - + ARCHIVE DESTINATION ${install_dir_${libname}} 84 - + ${COMPONENT_OPTION} 85 - + LIBRARY DESTINATION ${install_dir_${libname}} 86 - + ${COMPONENT_OPTION} 87 - + RUNTIME DESTINATION ${install_dir_${libname}} 88 - + ${COMPONENT_OPTION}) 89 - + endif() 90 - set_target_properties(${libname} PROPERTIES 91 - OUTPUT_NAME ${output_name_${libname}}) 92 - set_target_properties(${libname} PROPERTIES FOLDER "Compiler-RT Runtime") 93 - @@ -299,13 +324,6 @@ 94 - ) 95 - endif() 96 - endif() 97 - - install(TARGETS ${libname} 98 - - ARCHIVE DESTINATION ${install_dir_${libname}} 99 - - ${COMPONENT_OPTION} 100 - - LIBRARY DESTINATION ${install_dir_${libname}} 101 - - ${COMPONENT_OPTION} 102 - - RUNTIME DESTINATION ${install_dir_${libname}} 103 - - ${COMPONENT_OPTION}) 104 - 105 - # We only want to generate per-library install targets if you aren't using 106 - # an IDE because the extra targets get cluttered in IDEs. 107 - Index: compiler-rt/cmake/config-ix.cmake 108 - =================================================================== 109 - --- compiler-rt/cmake/config-ix.cmake 110 - +++ compiler-rt/cmake/config-ix.cmake 111 - @@ -227,6 +227,7 @@ 112 - ${ARM32} ${ARM64} ${MIPS32} ${MIPS64} ${S390X}) 113 - set(ALL_ASAN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} 114 - ${MIPS32} ${MIPS64} ${PPC64} ${S390X}) 115 - +set(ALL_CRT_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64}) 116 - set(ALL_DFSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64}) 117 - set(ALL_FUZZER_SUPPORTED_ARCH ${X86_64} ${ARM64}) 118 - 119 - @@ -474,6 +475,7 @@ 120 - SANITIZER_COMMON_SUPPORTED_ARCH) 121 - 122 - else() 123 - + filter_available_targets(CRT_SUPPORTED_ARCH ${ALL_CRT_SUPPORTED_ARCH}) 124 - # Architectures supported by compiler-rt libraries. 125 - filter_available_targets(SANITIZER_COMMON_SUPPORTED_ARCH 126 - ${ALL_SANITIZER_COMMON_SUPPORTED_ARCH}) 127 - @@ -563,6 +565,12 @@ 128 - 129 - # TODO: Add builtins support. 130 - 131 - +if (CRT_SUPPORTED_ARCH AND OS_NAME MATCHES "Linux") 132 - + set(COMPILER_RT_HAS_CRT TRUE) 133 - +else() 134 - + set(COMPILER_RT_HAS_CRT FALSE) 135 - +endif() 136 - + 137 - if (COMPILER_RT_HAS_SANITIZER_COMMON AND DFSAN_SUPPORTED_ARCH AND 138 - OS_NAME MATCHES "Linux") 139 - set(COMPILER_RT_HAS_DFSAN TRUE) 140 - Index: compiler-rt/lib/CMakeLists.txt 141 - =================================================================== 142 - --- compiler-rt/lib/CMakeLists.txt 143 - +++ compiler-rt/lib/CMakeLists.txt 144 - @@ -17,6 +17,10 @@ 145 - add_subdirectory(builtins) 146 - endif() 147 - 148 - +if(COMPILER_RT_BUILD_CRT) 149 - + add_subdirectory(crt) 150 - +endif() 151 - + 152 - function(compiler_rt_build_runtime runtime) 153 - string(TOUPPER ${runtime} runtime_uppercase) 154 - if(COMPILER_RT_HAS_${runtime_uppercase}) 155 - Index: compiler-rt/lib/crt/CMakeLists.txt 156 - =================================================================== 157 - --- /dev/null 158 - +++ compiler-rt/lib/crt/CMakeLists.txt 159 - @@ -0,0 +1,102 @@ 160 - +add_compiler_rt_component(crt) 161 - + 162 - +function(check_cxx_section_exists section output) 163 - + cmake_parse_arguments(ARG "" "" "SOURCE;FLAGS" ${ARGN}) 164 - + if(NOT ARG_SOURCE) 165 - + set(ARG_SOURCE "int main() { return 0; }\n") 166 - + endif() 167 - + 168 - + string(RANDOM TARGET_NAME) 169 - + set(TARGET_NAME "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/cmTC_${TARGET_NAME}.dir") 170 - + file(MAKE_DIRECTORY ${TARGET_NAME}) 171 - + 172 - + file(WRITE "${TARGET_NAME}/CheckSectionExists.c" "${ARG_SOURCE}\n") 173 - + 174 - + string(REGEX MATCHALL "<[A-Za-z0-9_]*>" substitutions 175 - + ${CMAKE_C_COMPILE_OBJECT}) 176 - + 177 - + set(try_compile_flags "${ARG_FLAGS}") 178 - + if(CMAKE_C_COMPILER_ID MATCHES Clang AND CMAKE_C_COMPILER_TARGET) 179 - + list(APPEND try_compile_flags "-target ${CMAKE_C_COMPILER_TARGET}") 180 - + endif() 181 - + 182 - + string(REPLACE ";" " " extra_flags "${try_compile_flags}") 183 - + 184 - + set(test_compile_command "${CMAKE_C_COMPILE_OBJECT}") 185 - + foreach(substitution ${substitutions}) 186 - + if(substitution STREQUAL "<CMAKE_C_COMPILER>") 187 - + string(REPLACE "<CMAKE_C_COMPILER>" 188 - + "${CMAKE_C_COMPILER}" test_compile_command ${test_compile_command}) 189 - + elseif(substitution STREQUAL "<OBJECT>") 190 - + string(REPLACE "<OBJECT>" "${TARGET_NAME}/CheckSectionExists.o" 191 - + test_compile_command ${test_compile_command}) 192 - + elseif(substitution STREQUAL "<SOURCE>") 193 - + string(REPLACE "<SOURCE>" "${TARGET_NAME}/CheckSectionExists.c" 194 - + test_compile_command ${test_compile_command}) 195 - + elseif(substitution STREQUAL "<FLAGS>") 196 - + string(REPLACE "<FLAGS>" "${CMAKE_C_FLAGS} ${extra_flags}" 197 - + test_compile_command ${test_compile_command}) 198 - + else() 199 - + string(REPLACE "${substitution}" "" test_compile_command 200 - + ${test_compile_command}) 201 - + endif() 202 - + endforeach() 203 - + 204 - + string(REPLACE " " ";" test_compile_command "${test_compile_command}") 205 - + 206 - + execute_process( 207 - + COMMAND ${test_compile_command} 208 - + RESULT_VARIABLE TEST_RESULT 209 - + OUTPUT_VARIABLE TEST_OUTPUT 210 - + ERROR_VARIABLE TEST_ERROR 211 - + ) 212 - + 213 - + execute_process( 214 - + COMMAND ${CMAKE_OBJDUMP} -h "${TARGET_NAME}/CheckSectionExists.o" 215 - + RESULT_VARIABLE CHECK_RESULT 216 - + OUTPUT_VARIABLE CHECK_OUTPUT 217 - + ERROR_VARIABLE CHECK_ERROR 218 - + ) 219 - + string(FIND "${CHECK_OUTPUT}" "${section}" SECTION_FOUND) 220 - + 221 - + if(NOT SECTION_FOUND EQUAL -1) 222 - + set(${output} TRUE PARENT_SCOPE) 223 - + else() 224 - + set(${output} FALSE PARENT_SCOPE) 225 - + endif() 226 - + 227 - + file(REMOVE_RECURSE ${TARGET_NAME}) 228 - +endfunction() 229 - + 230 - +check_cxx_section_exists(".init_array" COMPILER_RT_HAS_INITFINI_ARRAY 231 - + SOURCE "__attribute__((constructor)) void f() {}\nint main() { return 0; }\n") 232 - + 233 - +append_list_if(COMPILER_RT_HAS_INITFINI_ARRAY -DCRT_HAS_INITFINI_ARRAY CRT_CFLAGS) 234 - +append_list_if(COMPILER_RT_HAS_FPIC_FLAG -fPIC CRT_CFLAGS) 235 - + 236 - +foreach(arch ${CRT_SUPPORTED_ARCH}) 237 - + add_compiler_rt_runtime(clang_rt.crtbegin 238 - + OBJECT 239 - + ARCHS ${arch} 240 - + SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/crtbegin.c 241 - + CFLAGS ${CRT_CFLAGS} 242 - + PARENT_TARGET crt) 243 - + add_compiler_rt_runtime(clang_rt.crtbegin_shared 244 - + OBJECT 245 - + ARCHS ${arch} 246 - + SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/crtbegin.c 247 - + CFLAGS ${CRT_CFLAGS} -DCRT_SHARED 248 - + PARENT_TARGET crt) 249 - + add_compiler_rt_runtime(clang_rt.crtend 250 - + OBJECT 251 - + ARCHS ${arch} 252 - + SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/crtend.c 253 - + CFLAGS ${CRT_CFLAGS} 254 - + PARENT_TARGET crt) 255 - + add_compiler_rt_runtime(clang_rt.crtend_shared 256 - + OBJECT 257 - + ARCHS ${arch} 258 - + SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/crtend.c 259 - + CFLAGS ${CRT_CFLAGS} -DCRT_SHARED 260 - + PARENT_TARGET crt) 261 - +endforeach() 262 - Index: compiler-rt/lib/crt/crtbegin.c 263 - =================================================================== 264 - --- /dev/null 265 - +++ compiler-rt/lib/crt/crtbegin.c 266 - @@ -0,0 +1,108 @@ 267 - +/* ===-- crtbegin.c - Start of constructors and destructors ----------------=== 268 - + * 269 - + * The LLVM Compiler Infrastructure 270 - + * 271 - + * This file is dual licensed under the MIT and the University of Illinois Open 272 - + * Source Licenses. See LICENSE.TXT for details. 273 - + * 274 - + * ===----------------------------------------------------------------------=== 275 - + */ 276 - + 277 - +#include <stddef.h> 278 - + 279 - +__attribute__((visibility("hidden"))) 280 - +#ifdef CRT_SHARED 281 - +void *__dso_handle = &__dso_handle; 282 - +#else 283 - +void *__dso_handle = (void *)0; 284 - +#endif 285 - + 286 - +static long __EH_FRAME_LIST__[] 287 - + __attribute__((section(".eh_frame"), aligned(sizeof(void *)))) = {}; 288 - + 289 - +extern void __register_frame_info(const void *, void *) __attribute__((weak)); 290 - +extern void *__deregister_frame_info(const void *) __attribute__((weak)); 291 - + 292 - +#ifndef CRT_HAS_INITFINI_ARRAY 293 - +typedef void (*fp)(void); 294 - + 295 - +static fp __CTOR_LIST__[] 296 - + __attribute__((section(".ctors"), aligned(sizeof(fp)), used)) = {(fp)-1}; 297 - +extern fp __CTOR_LIST_END__[]; 298 - +#endif 299 - + 300 - +#ifdef CRT_SHARED 301 - +extern void __cxa_finalize(void *) __attribute__((weak)); 302 - +#endif 303 - + 304 - +static void __attribute__((used)) __do_init() { 305 - + static _Bool __initialized; 306 - + if (__builtin_expect(__initialized, 0)) 307 - + return; 308 - + __initialized = 1; 309 - + 310 - + static struct { void *p[8]; } __object; 311 - + if (__register_frame_info) 312 - + __register_frame_info(__EH_FRAME_LIST__, &__object); 313 - + 314 - +#ifndef CRT_HAS_INITFINI_ARRAY 315 - + const size_t n = __CTOR_LIST_END__ - __CTOR_LIST__ - 1; 316 - + for (size_t i = n; i >= 1; i--) __CTOR_LIST__[i](); 317 - +#endif 318 - +} 319 - + 320 - +#ifdef CRT_HAS_INITFINI_ARRAY 321 - +__attribute__((section(".init_array"), 322 - + used)) static void (*__init)(void) = __do_init; 323 - +#else // CRT_HAS_INITFINI_ARRAY 324 - +#if defined(__i386__) || defined(__x86_64__) 325 - +asm(".pushsection .init,\"ax\",@progbits\n\t" 326 - + "call " __USER_LABEL_PREFIX__ "__do_init\n\t" 327 - + ".popsection"); 328 - +#elif defined(__arm__) 329 - +asm(".pushsection .init,\"ax\",%progbits\n\t" 330 - + "bl " __USER_LABEL_PREFIX__ "__do_init\n\t" 331 - + ".popsection"); 332 - +#endif // CRT_HAS_INITFINI_ARRAY 333 - +#endif 334 - + 335 - +#ifndef CRT_HAS_INITFINI_ARRAY 336 - +static fp __DTOR_LIST__[] 337 - + __attribute__((section(".dtors"), aligned(sizeof(fp)), used)) = {(fp)-1}; 338 - +extern fp __DTOR_LIST_END__[]; 339 - +#endif 340 - + 341 - +static void __attribute__((used)) __do_fini() { 342 - + static _Bool __finalized; 343 - + if (__builtin_expect(__finalized, 0)) 344 - + return; 345 - + __finalized = 1; 346 - + 347 - +#ifdef CRT_SHARED 348 - + if (__cxa_finalize) 349 - + __cxa_finalize(__dso_handle); 350 - +#endif 351 - + 352 - +#ifndef CRT_HAS_INITFINI_ARRAY 353 - + if (__deregister_frame_info) 354 - + __deregister_frame_info(__EH_FRAME_LIST__); 355 - + 356 - + const size_t n = __DTOR_LIST_END__ - __DTOR_LIST__ - 1; 357 - + for (size_t i = 1; i < n; i++) __DTOR_LIST__[i](); 358 - +#endif 359 - +} 360 - + 361 - +#ifdef CRT_HAS_INITFINI_ARRAY 362 - +__attribute__((section(".fini_array"), 363 - + used)) static void (*__fini)(void) = __do_fini; 364 - +#else // CRT_HAS_INITFINI_ARRAY 365 - +#if defined(__i386__) || defined(__x86_64__) 366 - +asm(".pushsection .fini,\"ax\",@progbits\n\t" 367 - + "call " __USER_LABEL_PREFIX__ "__do_fini\n\t" 368 - + ".popsection"); 369 - +#elif defined(__arm__) 370 - +asm(".pushsection .fini,\"ax\",%progbits\n\t" 371 - + "bl " __USER_LABEL_PREFIX__ "__do_fini\n\t" 372 - + ".popsection"); 373 - +#endif 374 - +#endif // CRT_HAS_INIT_FINI_ARRAY 375 - Index: compiler-rt/lib/crt/crtend.c 376 - =================================================================== 377 - --- /dev/null 378 - +++ compiler-rt/lib/crt/crtend.c 379 - @@ -0,0 +1,24 @@ 380 - +/* ===-- crtend.c - End of constructors and destructors --------------------=== 381 - + * 382 - + * The LLVM Compiler Infrastructure 383 - + * 384 - + * This file is dual licensed under the MIT and the University of Illinois Open 385 - + * Source Licenses. See LICENSE.TXT for details. 386 - + * 387 - + * ===----------------------------------------------------------------------=== 388 - + */ 389 - + 390 - +#include <stdint.h> 391 - + 392 - +// Put 4-byte zero which is the length field in FDE at the end as a terminator. 393 - +const int32_t __EH_FRAME_LIST_END__[] 394 - + __attribute__((section(".eh_frame"), aligned(sizeof(int32_t)), 395 - + visibility("hidden"), used)) = {0}; 396 - + 397 - +#ifndef CRT_HAS_INITFINI_ARRAY 398 - +typedef void (*fp)(void); 399 - +fp __CTOR_LIST_END__[] 400 - + __attribute__((section(".ctors"), visibility("hidden"), used)) = {0}; 401 - +fp __DTOR_LIST_END__[] 402 - + __attribute__((section(".dtors"), visibility("hidden"), used)) = {0}; 403 - +#endif 404 - Index: compiler-rt/test/CMakeLists.txt 405 - =================================================================== 406 - --- compiler-rt/test/CMakeLists.txt 407 - +++ compiler-rt/test/CMakeLists.txt 408 - @@ -73,6 +73,9 @@ 409 - if(COMPILER_RT_BUILD_XRAY) 410 - compiler_rt_test_runtime(xray) 411 - endif() 412 - + if(COMPILER_RT_HAS_CRT) 413 - + add_subdirectory(crt) 414 - + endif() 415 - # ShadowCallStack does not yet provide a runtime with compiler-rt, the tests 416 - # include their own minimal runtime 417 - add_subdirectory(shadowcallstack) 418 - Index: compiler-rt/test/crt/CMakeLists.txt 419 - =================================================================== 420 - --- /dev/null 421 - +++ compiler-rt/test/crt/CMakeLists.txt 422 - @@ -0,0 +1,31 @@ 423 - +set(CRT_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) 424 - + 425 - +set(CRT_TESTSUITES) 426 - + 427 - +set(CRT_TEST_DEPS "") 428 - + 429 - +if(NOT COMPILER_RT_STANDALONE_BUILD AND COMPILER_RT_BUILD_CRT AND 430 - + COMPILER_RT_HAS_CRT) 431 - + list(APPEND CRT_TEST_DEPS crt) 432 - +endif() 433 - + 434 - +set(CRT_TEST_ARCH ${CRT_SUPPORTED_ARCH}) 435 - +if (COMPILER_RT_BUILD_CRT AND COMPILER_RT_HAS_CRT) 436 - + foreach(arch ${CRT_TEST_ARCH}) 437 - + set(CRT_TEST_TARGET_ARCH ${arch}) 438 - + string(TOLOWER "-${arch}-${OS_NAME}" CRT_TEST_CONFIG_SUFFIX) 439 - + get_test_cc_for_arch(${arch} CRT_TEST_TARGET_CC CRT_TEST_TARGET_CFLAGS) 440 - + string(TOUPPER ${arch} ARCH_UPPER_CASE) 441 - + set(CONFIG_NAME ${ARCH_UPPER_CASE}${OS_NAME}Config) 442 - + 443 - + configure_lit_site_cfg( 444 - + ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in 445 - + ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg) 446 - + list(APPEND CRT_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}) 447 - + endforeach() 448 - +endif() 449 - + 450 - +add_lit_testsuite(check-crt "Running the CRT tests" 451 - + ${CRT_TESTSUITES} 452 - + DEPENDS ${CRT_TEST_DEPS}) 453 - +set_target_properties(check-crt PROPERTIES FOLDER "Compiler-RT Misc") 454 - Index: compiler-rt/test/crt/dso_handle.cpp 455 - =================================================================== 456 - --- /dev/null 457 - +++ compiler-rt/test/crt/dso_handle.cpp 458 - @@ -0,0 +1,33 @@ 459 - +// RUN: %clangxx -g -DCRT_SHARED -c %s -fPIC -o %tshared.o 460 - +// RUN: %clangxx -g -c %s -fPIC -o %t.o 461 - +// RUN: %clangxx -g -shared -o %t.so -nostdlib %crti %shared_crtbegin %tshared.o %libstdcxx -lc -lm -lgcc_s %shared_crtend %crtn 462 - +// RUN: %clangxx -g -o %t -nostdlib %crt1 %crti %crtbegin %t.o %libstdcxx -lc -lm %libgcc %t.so %crtend %crtn 463 - +// RUN: %run %t 2>&1 | FileCheck %s 464 - + 465 - +#include <stdio.h> 466 - + 467 - +// CHECK: 1 468 - +// CHECK-NEXT: ~A() 469 - + 470 - +#ifdef CRT_SHARED 471 - +bool G; 472 - +void C() { 473 - + printf("%d\n", G); 474 - +} 475 - + 476 - +struct A { 477 - + A() { G = true; } 478 - + ~A() { 479 - + printf("~A()\n"); 480 - + } 481 - +}; 482 - + 483 - +A a; 484 - +#else 485 - +void C(); 486 - + 487 - +int main() { 488 - + C(); 489 - + return 0; 490 - +} 491 - +#endif 492 - Index: compiler-rt/test/crt/lit.cfg 493 - =================================================================== 494 - --- /dev/null 495 - +++ compiler-rt/test/crt/lit.cfg 496 - @@ -0,0 +1,80 @@ 497 - +# -*- Python -*- 498 - + 499 - +import os 500 - +import subprocess 501 - + 502 - +# Setup config name. 503 - +config.name = 'CRT' + config.name_suffix 504 - + 505 - +# Setup source root. 506 - +config.test_source_root = os.path.dirname(__file__) 507 - + 508 - + 509 - +def get_library_path(file): 510 - + cmd = subprocess.Popen([config.clang.strip(), 511 - + config.target_cflags.strip(), 512 - + '-print-file-name=%s' % file], 513 - + stdout=subprocess.PIPE, 514 - + env=config.environment) 515 - + if not cmd.stdout: 516 - + lit_config.fatal("Couldn't find the library path for '%s'" % file) 517 - + dir = cmd.stdout.read().strip() 518 - + if sys.platform in ['win32'] and execute_external: 519 - + # Don't pass dosish path separator to msys bash.exe. 520 - + dir = dir.replace('\\', '/') 521 - + # Ensure the result is an ascii string, across Python2.5+ - Python3. 522 - + return str(dir.decode('ascii')) 523 - + 524 - + 525 - +def get_libgcc_file_name(): 526 - + cmd = subprocess.Popen([config.clang.strip(), 527 - + config.target_cflags.strip(), 528 - + '-print-libgcc-file-name'], 529 - + stdout=subprocess.PIPE, 530 - + env=config.environment) 531 - + if not cmd.stdout: 532 - + lit_config.fatal("Couldn't find the library path for '%s'" % file) 533 - + dir = cmd.stdout.read().strip() 534 - + if sys.platform in ['win32'] and execute_external: 535 - + # Don't pass dosish path separator to msys bash.exe. 536 - + dir = dir.replace('\\', '/') 537 - + # Ensure the result is an ascii string, across Python2.5+ - Python3. 538 - + return str(dir.decode('ascii')) 539 - + 540 - + 541 - +def build_invocation(compile_flags): 542 - + return ' ' + ' '.join([config.clang] + compile_flags) + ' ' 543 - + 544 - + 545 - +# Setup substitutions. 546 - +config.substitutions.append( 547 - + ('%clang ', build_invocation([config.target_cflags]))) 548 - +config.substitutions.append( 549 - + ('%clangxx ', 550 - + build_invocation(config.cxx_mode_flags + [config.target_cflags]))) 551 - + 552 - +base_lib = os.path.join( 553 - + config.compiler_rt_libdir, "clang_rt.%%s-%s.o" % config.target_arch) 554 - +config.substitutions.append(('%crtbegin', base_lib % "crtbegin")) 555 - +config.substitutions.append(('%shared_crtbegin', base_lib % "crtbegin_shared")) 556 - +config.substitutions.append(('%crtend', base_lib % "crtend")) 557 - +config.substitutions.append(('%shared_crtend', base_lib % "crtend_shared")) 558 - + 559 - +config.substitutions.append( 560 - + ('%crt1', get_library_path('crt1.o'))) 561 - +config.substitutions.append( 562 - + ('%crti', get_library_path('crti.o'))) 563 - +config.substitutions.append( 564 - + ('%crtn', get_library_path('crtn.o'))) 565 - + 566 - +config.substitutions.append( 567 - + ('%libgcc', get_libgcc_file_name())) 568 - + 569 - +config.substitutions.append( 570 - + ('%libstdcxx', '-l' + config.sanitizer_cxx_lib.lstrip('lib'))) 571 - + 572 - +# Default test suffixes. 573 - +config.suffixes = ['.c', '.cc', '.cpp'] 574 - + 575 - +if config.host_os not in ['Linux']: 576 - + config.unsupported = True 577 - Index: compiler-rt/test/crt/lit.site.cfg.in 578 - =================================================================== 579 - --- /dev/null 580 - +++ compiler-rt/test/crt/lit.site.cfg.in 581 - @@ -0,0 +1,14 @@ 582 - +@LIT_SITE_CFG_IN_HEADER@ 583 - + 584 - +# Tool-specific config options. 585 - +config.name_suffix = "@CRT_TEST_CONFIG_SUFFIX@" 586 - +config.crt_lit_source_dir = "@CRT_LIT_SOURCE_DIR@" 587 - +config.target_cflags = "@CRT_TEST_TARGET_CFLAGS@" 588 - +config.target_arch = "@CRT_TEST_TARGET_ARCH@" 589 - +config.sanitizer_cxx_lib = "@SANITIZER_TEST_CXX_LIBNAME@" 590 - + 591 - +# Load common config for all compiler-rt lit tests 592 - +lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured") 593 - + 594 - +# Load tool-specific config that would do the real work. 595 - +lit_config.load_config(config, "@CRT_LIT_SOURCE_DIR@/lit.cfg")
-117
pkgs/development/compilers/llvm/7/compiler-rt/default.nix
··· 1 - { lib, stdenv, llvm_meta, version, fetch, cmake, python3, libllvm, libcxxabi 2 - , doFakeLibgcc ? stdenv.hostPlatform.isFreeBSD 3 - }: 4 - 5 - let 6 - 7 - useLLVM = stdenv.hostPlatform.useLLVM or false; 8 - bareMetal = stdenv.hostPlatform.parsed.kernel.name == "none"; 9 - haveLibc = stdenv.cc.libc != null; 10 - inherit (stdenv.hostPlatform) isMusl; 11 - 12 - in 13 - 14 - stdenv.mkDerivation { 15 - pname = "compiler-rt" + lib.optionalString (haveLibc) "-libc"; 16 - inherit version; 17 - src = fetch "compiler-rt" "1n48p8gjarihkws0i2bay5w9bdwyxyxxbpwyng7ba58jb30dlyq5"; 18 - 19 - nativeBuildInputs = [ cmake python3 libllvm.dev ]; 20 - buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi; 21 - 22 - env.NIX_CFLAGS_COMPILE = toString [ 23 - "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0" 24 - ]; 25 - 26 - cmakeFlags = [ 27 - "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" 28 - "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}" 29 - "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}" 30 - ] ++ lib.optionals (useLLVM || bareMetal || isMusl) [ 31 - "-DCOMPILER_RT_BUILD_SANITIZERS=OFF" 32 - "-DCOMPILER_RT_BUILD_XRAY=OFF" 33 - "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF" 34 - ] ++ lib.optionals (useLLVM || bareMetal) [ 35 - "-DCOMPILER_RT_BUILD_PROFILE=OFF" 36 - ] ++ lib.optionals ((useLLVM || bareMetal) && !haveLibc) [ 37 - "-DCMAKE_C_COMPILER_WORKS=ON" 38 - "-DCMAKE_CXX_COMPILER_WORKS=ON" 39 - "-DCOMPILER_RT_BAREMETAL_BUILD=ON" 40 - "-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}" 41 - ] ++ lib.optionals (useLLVM) [ 42 - "-DCOMPILER_RT_BUILD_BUILTINS=ON" 43 - #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program 44 - "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY" 45 - ] ++ lib.optionals (bareMetal) [ 46 - "-DCOMPILER_RT_OS_DIR=baremetal" 47 - ] ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ 48 - # The compiler-rt build infrastructure sniffs supported platforms on Darwin 49 - # and finds i386;x86_64;x86_64h. We only build for x86_64, so linking fails 50 - # when it tries to use libc++ and libc++api for i386. 51 - "-DDARWIN_osx_ARCHS=${stdenv.hostPlatform.darwinArch}" 52 - ]; 53 - 54 - outputs = [ "out" "dev" ]; 55 - 56 - patches = [ 57 - # https://github.com/llvm/llvm-project/commit/947f9692440836dcb8d88b74b69dd379d85974ce 58 - ../../common/compiler-rt/glibc.patch 59 - ../../common/compiler-rt/7-12-codesign.patch # Revert compiler-rt commit that makes codesign mandatory 60 - ./gnu-install-dirs.patch 61 - ../../common/compiler-rt/libsanitizer-no-cyclades-9.patch 62 - ] ++ lib.optional (useLLVM) ./crtbegin-and-end.patch 63 - ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch; 64 - 65 - # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks 66 - # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra 67 - # can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd 68 - # get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by 69 - # a flag and turn the flag off during the stdenv build. 70 - postPatch = lib.optionalString (!stdenv.isDarwin) '' 71 - substituteInPlace cmake/builtin-config-ix.cmake \ 72 - --replace 'set(X86 i386)' 'set(X86 i386 i486 i586 i686)' 73 - '' + lib.optionalString stdenv.isDarwin '' 74 - substituteInPlace cmake/config-ix.cmake \ 75 - --replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)' 76 - '' + lib.optionalString (useLLVM) '' 77 - substituteInPlace lib/builtins/int_util.c \ 78 - --replace "#include <stdlib.h>" "" 79 - substituteInPlace lib/builtins/clear_cache.c \ 80 - --replace "#include <assert.h>" "" 81 - substituteInPlace lib/builtins/cpu_model.c \ 82 - --replace "#include <assert.h>" "" 83 - ''; 84 - 85 - preConfigure = lib.optionalString (useLLVM && !haveLibc) '' 86 - cmakeFlagsArray+=(-DCMAKE_C_FLAGS="-nodefaultlibs -ffreestanding") 87 - ''; 88 - 89 - # Hack around weird upsream RPATH bug 90 - postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) '' 91 - ln -s "$out/lib"/*/* "$out/lib" 92 - '' + lib.optionalString (useLLVM) '' 93 - ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbegin.o 94 - ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtend.o 95 - ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o 96 - ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o 97 - '' + lib.optionalString doFakeLibgcc '' 98 - ln -s $out/lib/freebsd/libclang_rt.builtins-*.a $out/lib/libgcc.a 99 - ''; 100 - 101 - meta = llvm_meta // { 102 - homepage = "https://compiler-rt.llvm.org/"; 103 - description = "Compiler runtime libraries"; 104 - longDescription = '' 105 - The compiler-rt project provides highly tuned implementations of the 106 - low-level code generator support routines like "__fixunsdfdi" and other 107 - calls generated when a target doesn't have a short sequence of native 108 - instructions to implement a core IR operation. It also provides 109 - implementations of run-time libraries for dynamic testing tools such as 110 - AddressSanitizer, ThreadSanitizer, MemorySanitizer, and DataFlowSanitizer. 111 - ''; 112 - # "All of the code in the compiler-rt project is dual licensed under the MIT 113 - # license and the UIUC License (a BSD-like license)": 114 - license = with lib.licenses; [ mit ncsa ]; 115 - broken = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64; 116 - }; 117 - }
-117
pkgs/development/compilers/llvm/7/compiler-rt/gnu-install-dirs.patch
··· 1 - diff --git a/CMakeLists.txt b/CMakeLists.txt 2 - index 86ca2b3ef74b..555103bd97fe 100644 3 - --- a/CMakeLists.txt 4 - +++ b/CMakeLists.txt 5 - @@ -8,6 +8,7 @@ cmake_minimum_required(VERSION 3.4.3) 6 - # Check if compiler-rt is built as a standalone project. 7 - if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR COMPILER_RT_STANDALONE_BUILD) 8 - project(CompilerRT C CXX ASM) 9 - + include(GNUInstallDirs) 10 - set(COMPILER_RT_STANDALONE_BUILD TRUE) 11 - set_property(GLOBAL PROPERTY USE_FOLDERS ON) 12 - endif() 13 - diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake 14 - index cd4c704fc824..5abcd1260381 100644 15 - --- a/cmake/Modules/AddCompilerRT.cmake 16 - +++ b/cmake/Modules/AddCompilerRT.cmake 17 - @@ -478,7 +478,7 @@ macro(add_compiler_rt_resource_file target_name file_name component) 18 - add_custom_target(${target_name} DEPENDS ${dst_file}) 19 - # Install in Clang resource directory. 20 - install(FILES ${file_name} 21 - - DESTINATION ${COMPILER_RT_INSTALL_PATH}/share 22 - + DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_DATADIR} 23 - COMPONENT ${component}) 24 - add_dependencies(${component} ${target_name}) 25 - 26 - @@ -495,7 +495,7 @@ macro(add_compiler_rt_script name) 27 - add_custom_target(${name} DEPENDS ${dst}) 28 - install(FILES ${dst} 29 - PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE 30 - - DESTINATION ${COMPILER_RT_INSTALL_PATH}/bin) 31 - + DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_BINDIR}) 32 - endmacro(add_compiler_rt_script src name) 33 - 34 - # Builds custom version of libc++ and installs it in <prefix>. 35 - diff --git a/cmake/Modules/CompilerRTDarwinUtils.cmake b/cmake/Modules/CompilerRTDarwinUtils.cmake 36 - index 04cc955980fa..a99f6dfb2f82 100644 37 - --- a/cmake/Modules/CompilerRTDarwinUtils.cmake 38 - +++ b/cmake/Modules/CompilerRTDarwinUtils.cmake 39 - @@ -377,7 +377,7 @@ macro(darwin_add_embedded_builtin_libraries) 40 - set(DARWIN_macho_embedded_LIBRARY_OUTPUT_DIR 41 - ${COMPILER_RT_OUTPUT_DIR}/lib/macho_embedded) 42 - set(DARWIN_macho_embedded_LIBRARY_INSTALL_DIR 43 - - ${COMPILER_RT_INSTALL_PATH}/lib/macho_embedded) 44 - + ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_LIBDIR}/macho_embedded) 45 - 46 - set(CFLAGS_armv7 "-target thumbv7-apple-darwin-eabi") 47 - set(CFLAGS_i386 "-march=pentium") 48 - diff --git a/cmake/Modules/CompilerRTUtils.cmake b/cmake/Modules/CompilerRTUtils.cmake 49 - index e5651718fa34..d95cfc984a85 100644 50 - --- a/cmake/Modules/CompilerRTUtils.cmake 51 - +++ b/cmake/Modules/CompilerRTUtils.cmake 52 - @@ -330,7 +330,7 @@ endfunction() 53 - function(get_compiler_rt_install_dir arch install_dir) 54 - if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) 55 - get_compiler_rt_target(${arch} target) 56 - - set(${install_dir} ${COMPILER_RT_INSTALL_PATH}/${target}/lib PARENT_SCOPE) 57 - + set(${install_dir} ${COMPILER_RT_INSTALL_PATH}/${target}/${CMAKE_INSTALL_FULL_LIBDIR} PARENT_SCOPE) 58 - else() 59 - set(${install_dir} ${COMPILER_RT_LIBRARY_INSTALL_DIR} PARENT_SCOPE) 60 - endif() 61 - diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake 62 - index 91fe2494b476..b59a0ffc69f4 100644 63 - --- a/cmake/base-config-ix.cmake 64 - +++ b/cmake/base-config-ix.cmake 65 - @@ -53,11 +53,11 @@ if (LLVM_TREE_AVAILABLE) 66 - else() 67 - # Take output dir and install path from the user. 68 - set(COMPILER_RT_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH 69 - - "Path where built compiler-rt libraries should be stored.") 70 - + "Path where built compiler-rt build artifacts should be stored.") 71 - set(COMPILER_RT_EXEC_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/bin CACHE PATH 72 - "Path where built compiler-rt executables should be stored.") 73 - - set(COMPILER_RT_INSTALL_PATH ${CMAKE_INSTALL_PREFIX} CACHE PATH 74 - - "Path where built compiler-rt libraries should be installed.") 75 - + set(COMPILER_RT_INSTALL_PATH "" CACHE PATH 76 - + "Prefix where built compiler-rt artifacts should be installed, comes before CMAKE_INSTALL_PREFIX.") 77 - option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests." OFF) 78 - option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered" OFF) 79 - # Use a host compiler to compile/link tests. 80 - @@ -85,7 +85,7 @@ else(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR) 81 - set(COMPILER_RT_LIBRARY_OUTPUT_DIR 82 - ${COMPILER_RT_OUTPUT_DIR}/lib/${COMPILER_RT_OS_DIR}) 83 - set(COMPILER_RT_LIBRARY_INSTALL_DIR 84 - - ${COMPILER_RT_INSTALL_PATH}/lib/${COMPILER_RT_OS_DIR}) 85 - + ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_LIBDIR}/${COMPILER_RT_OS_DIR}) 86 - endif() 87 - 88 - if(APPLE) 89 - diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt 90 - index c4b93b89a30c..3913dc3a1ee6 100644 91 - --- a/include/CMakeLists.txt 92 - +++ b/include/CMakeLists.txt 93 - @@ -48,12 +48,12 @@ set_target_properties(compiler-rt-headers PROPERTIES FOLDER "Compiler-RT Misc") 94 - install(FILES ${SANITIZER_HEADERS} 95 - COMPONENT compiler-rt-headers 96 - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ 97 - - DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/sanitizer) 98 - + DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/sanitizer) 99 - # Install xray headers. 100 - install(FILES ${XRAY_HEADERS} 101 - COMPONENT compiler-rt-headers 102 - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ 103 - - DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/xray) 104 - + DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/xray) 105 - 106 - if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDEs. 107 - add_custom_target(install-compiler-rt-headers 108 - diff --git a/lib/dfsan/CMakeLists.txt b/lib/dfsan/CMakeLists.txt 109 - index b3ae713cf02c..52b364b900f5 100644 110 - --- a/lib/dfsan/CMakeLists.txt 111 - +++ b/lib/dfsan/CMakeLists.txt 112 - @@ -54,4 +54,4 @@ add_custom_command(OUTPUT ${dfsan_abilist_filename} 113 - DEPENDS done_abilist.txt libc_ubuntu1404_abilist.txt) 114 - add_dependencies(dfsan dfsan_abilist) 115 - install(FILES ${dfsan_abilist_filename} 116 - - DESTINATION ${COMPILER_RT_INSTALL_PATH}/share) 117 - + DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_DATADIR})
-273
pkgs/development/compilers/llvm/7/default.nix
··· 1 - { lowPrio, newScope, pkgs, lib, stdenv, cmake 2 - , preLibcCrossHeaders 3 - , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith 4 - , buildLlvmTools # tools, but from the previous stage, for cross 5 - , targetLlvmLibraries # libraries, but from the next stage, for cross 6 - , targetLlvm 7 - # This is the default binutils, but with *this* version of LLD rather 8 - # than the default LLVM version's, if LLD is the choice. We use these for 9 - # the `useLLVM` bootstrapping below. 10 - , bootBintoolsNoLibc ? 11 - if stdenv.targetPlatform.linker == "lld" 12 - then null 13 - else pkgs.bintoolsNoLibc 14 - , bootBintools ? 15 - if stdenv.targetPlatform.linker == "lld" 16 - then null 17 - else pkgs.bintools 18 - }: 19 - 20 - let 21 - release_version = "7.1.0"; 22 - version = release_version; # differentiating these is important for rc's 23 - 24 - fetch = name: sha256: fetchurl { 25 - url = "https://releases.llvm.org/${release_version}/${name}-${version}.src.tar.xz"; 26 - inherit sha256; 27 - }; 28 - 29 - clang-tools-extra_src = fetch "clang-tools-extra" "0lb4kdh7j2fhfz8kd6iv5df7m3pikiryk1vvwsf87spc90n09q0w"; 30 - 31 - inherit (import ../common/common-let.nix { inherit lib release_version; }) llvm_meta; 32 - 33 - tools = lib.makeExtensible (tools: let 34 - callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch buildLlvmTools; }); 35 - mkExtraBuildCommands0 = cc: '' 36 - rsrc="$out/resource-root" 37 - mkdir "$rsrc" 38 - ln -s "${cc.lib}/lib/clang/${release_version}/include" "$rsrc" 39 - echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags 40 - ''; 41 - mkExtraBuildCommands = cc: mkExtraBuildCommands0 cc + '' 42 - ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" 43 - ln -s "${targetLlvmLibraries.compiler-rt.out}/share" "$rsrc/share" 44 - ''; 45 - 46 - bintoolsNoLibc' = 47 - if bootBintoolsNoLibc == null 48 - then tools.bintoolsNoLibc 49 - else bootBintoolsNoLibc; 50 - bintools' = 51 - if bootBintools == null 52 - then tools.bintools 53 - else bootBintools; 54 - 55 - in { 56 - 57 - libllvm = callPackage ./llvm { 58 - inherit llvm_meta; 59 - }; 60 - 61 - # `llvm` historically had the binaries. When choosing an output explicitly, 62 - # we need to reintroduce `outputSpecified` to get the expected behavior e.g. of lib.get* 63 - llvm = tools.libllvm; 64 - 65 - libllvm-polly = callPackage ./llvm { 66 - inherit llvm_meta; 67 - enablePolly = true; 68 - }; 69 - 70 - llvm-polly = tools.libllvm-polly.lib // { outputSpecified = false; }; 71 - 72 - libclang = callPackage ./clang { 73 - inherit clang-tools-extra_src llvm_meta; 74 - }; 75 - 76 - clang-unwrapped = tools.libclang; 77 - 78 - clang-polly-unwrapped = callPackage ./clang { 79 - inherit llvm_meta; 80 - inherit clang-tools-extra_src; 81 - libllvm = tools.libllvm-polly; 82 - enablePolly = true; 83 - }; 84 - 85 - llvm-manpages = lowPrio (tools.libllvm.override { 86 - enableManpages = true; 87 - python3 = pkgs.python3; # don't use python-boot 88 - }); 89 - 90 - clang-manpages = lowPrio (tools.libclang.override { 91 - enableManpages = true; 92 - python3 = pkgs.python3; # don't use python-boot 93 - }); 94 - 95 - # pick clang appropriate for package set we are targeting 96 - clang = 97 - /**/ if stdenv.targetPlatform.libc == null then tools.clangNoLibc 98 - else if stdenv.targetPlatform.useLLVM or false then tools.clangUseLLVM 99 - else if (pkgs.targetPackages.stdenv or stdenv).cc.isGNU then tools.libstdcxxClang 100 - else tools.libcxxClang; 101 - 102 - libstdcxxClang = wrapCCWith rec { 103 - cc = tools.clang-unwrapped; 104 - # libstdcxx is taken from gcc in an ad-hoc way in cc-wrapper. 105 - libcxx = null; 106 - extraPackages = [ 107 - targetLlvmLibraries.compiler-rt 108 - ]; 109 - extraBuildCommands = mkExtraBuildCommands cc; 110 - }; 111 - 112 - libcxxClang = wrapCCWith rec { 113 - cc = tools.clang-unwrapped; 114 - libcxx = targetLlvmLibraries.libcxx; 115 - extraPackages = [ 116 - libcxx.cxxabi 117 - targetLlvmLibraries.compiler-rt 118 - ]; 119 - extraBuildCommands = mkExtraBuildCommands cc; 120 - }; 121 - 122 - lld = callPackage ./lld { 123 - inherit llvm_meta; 124 - }; 125 - 126 - lldb = callPackage ./lldb { 127 - inherit llvm_meta; 128 - }; 129 - 130 - # Below, is the LLVM bootstrapping logic. It handles building a 131 - # fully LLVM toolchain from scratch. No GCC toolchain should be 132 - # pulled in. As a consequence, it is very quick to build different 133 - # targets provided by LLVM and we can also build for what GCC 134 - # doesn’t support like LLVM. Probably we should move to some other 135 - # file. 136 - 137 - bintools-unwrapped = callPackage ../common/bintools.nix { }; 138 - 139 - bintoolsNoLibc = wrapBintoolsWith { 140 - bintools = tools.bintools-unwrapped; 141 - libc = preLibcCrossHeaders; 142 - }; 143 - 144 - bintools = wrapBintoolsWith { 145 - bintools = tools.bintools-unwrapped; 146 - }; 147 - 148 - clangUseLLVM = wrapCCWith rec { 149 - cc = tools.clang-unwrapped; 150 - libcxx = targetLlvmLibraries.libcxx; 151 - bintools = bintools'; 152 - extraPackages = [ 153 - libcxx.cxxabi 154 - targetLlvmLibraries.compiler-rt 155 - ] ++ lib.optionals (!stdenv.targetPlatform.isWasm) [ 156 - targetLlvmLibraries.libunwind 157 - ]; 158 - extraBuildCommands = '' 159 - echo "-rtlib=compiler-rt -Wno-unused-command-line-argument" >> $out/nix-support/cc-cflags 160 - echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags 161 - '' + lib.optionalString (!stdenv.targetPlatform.isWasm) '' 162 - echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags 163 - '' + lib.optionalString (!stdenv.targetPlatform.isWasm && stdenv.targetPlatform.useLLVM or false) '' 164 - echo "-lunwind" >> $out/nix-support/cc-ldflags 165 - '' + lib.optionalString stdenv.targetPlatform.isWasm '' 166 - echo "-fno-exceptions" >> $out/nix-support/cc-cflags 167 - '' + mkExtraBuildCommands cc; 168 - }; 169 - 170 - clangNoLibcxx = wrapCCWith rec { 171 - cc = tools.clang-unwrapped; 172 - libcxx = null; 173 - bintools = bintools'; 174 - extraPackages = [ 175 - targetLlvmLibraries.compiler-rt 176 - ]; 177 - extraBuildCommands = '' 178 - echo "-rtlib=compiler-rt" >> $out/nix-support/cc-cflags 179 - echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags 180 - echo "-nostdlib++" >> $out/nix-support/cc-cflags 181 - '' + mkExtraBuildCommands cc; 182 - }; 183 - 184 - clangNoLibc = wrapCCWith rec { 185 - cc = tools.clang-unwrapped; 186 - libcxx = null; 187 - bintools = bintoolsNoLibc'; 188 - extraPackages = [ 189 - targetLlvmLibraries.compiler-rt 190 - ]; 191 - extraBuildCommands = '' 192 - echo "-rtlib=compiler-rt" >> $out/nix-support/cc-cflags 193 - echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags 194 - '' + mkExtraBuildCommands cc; 195 - }; 196 - 197 - clangNoCompilerRt = wrapCCWith rec { 198 - cc = tools.clang-unwrapped; 199 - libcxx = null; 200 - bintools = bintoolsNoLibc'; 201 - extraPackages = [ ]; 202 - extraBuildCommands = '' 203 - echo "-nostartfiles" >> $out/nix-support/cc-cflags 204 - '' + mkExtraBuildCommands0 cc; 205 - }; 206 - 207 - clangNoCompilerRtWithLibc = wrapCCWith rec { 208 - cc = tools.clang-unwrapped; 209 - libcxx = null; 210 - bintools = bintools'; 211 - extraPackages = [ ]; 212 - extraBuildCommands = mkExtraBuildCommands0 cc; 213 - }; 214 - 215 - }); 216 - 217 - libraries = lib.makeExtensible (libraries: let 218 - callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; }); 219 - in { 220 - 221 - compiler-rt-libc = callPackage ./compiler-rt { 222 - inherit llvm_meta; 223 - stdenv = if stdenv.hostPlatform.useLLVM or false 224 - then overrideCC stdenv buildLlvmTools.clangNoCompilerRtWithLibc 225 - else stdenv; 226 - }; 227 - 228 - compiler-rt-no-libc = callPackage ./compiler-rt { 229 - inherit llvm_meta; 230 - stdenv = if stdenv.hostPlatform.useLLVM or false 231 - then overrideCC stdenv buildLlvmTools.clangNoCompilerRt 232 - else stdenv; 233 - }; 234 - 235 - # N.B. condition is safe because without useLLVM both are the same. 236 - compiler-rt = 237 - if stdenv.hostPlatform.isAndroid || (stdenv.hostPlatform != stdenv.buildPlatform && stdenv.hostPlatform.isDarwin) 238 - then libraries.compiler-rt-libc 239 - else libraries.compiler-rt-no-libc; 240 - 241 - stdenv = overrideCC stdenv buildLlvmTools.clang; 242 - 243 - libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang; 244 - 245 - libcxx = callPackage ./libcxx { 246 - inherit llvm_meta; 247 - stdenv = if stdenv.hostPlatform.useLLVM or false 248 - then overrideCC stdenv buildLlvmTools.clangNoLibcxx 249 - else stdenv; 250 - }; 251 - 252 - libcxxabi = callPackage ./libcxxabi { 253 - inherit llvm_meta; 254 - stdenv = if stdenv.hostPlatform.useLLVM or false 255 - then overrideCC stdenv buildLlvmTools.clangNoLibcxx 256 - else stdenv; 257 - }; 258 - 259 - libunwind = callPackage ./libunwind { 260 - inherit llvm_meta; 261 - inherit (buildLlvmTools) llvm; 262 - stdenv = if stdenv.hostPlatform.useLLVM or false 263 - then overrideCC stdenv buildLlvmTools.clangNoLibcxx 264 - else stdenv; 265 - }; 266 - 267 - openmp = callPackage ./openmp { 268 - inherit llvm_meta targetLlvm; 269 - }; 270 - }); 271 - noExtend = extensible: lib.attrsets.removeAttrs extensible [ "extend" ]; 272 - 273 - in { inherit tools libraries release_version; } // (noExtend libraries) // (noExtend tools)
-89
pkgs/development/compilers/llvm/7/libcxx/default.nix
··· 1 - { lib, stdenv, llvm_meta, fetch, cmake, python3, fixDarwinDylibNames, version 2 - , cxxabi ? if stdenv.hostPlatform.isFreeBSD then libcxxrt else libcxxabi 3 - , libcxxabi, libcxxrt 4 - , enableShared ? !stdenv.hostPlatform.isStatic 5 - }: 6 - 7 - assert stdenv.isDarwin -> cxxabi.pname == "libcxxabi"; 8 - 9 - stdenv.mkDerivation { 10 - pname = "libcxx"; 11 - inherit version; 12 - 13 - src = fetch "libcxx" "0kmhcapm2cjwalyiqasj9dmqbw59mcwdl8fgl951wg7ax84b8hj4"; 14 - 15 - postUnpack = '' 16 - unpackFile ${libcxxabi.src} 17 - export LIBCXXABI_INCLUDE_DIR="$PWD/$(ls -d libcxxabi-${version}*)/include" 18 - ''; 19 - 20 - outputs = [ "out" "dev" ]; 21 - 22 - patches = [ 23 - ./gnu-install-dirs.patch 24 - ] ++ lib.optionals stdenv.hostPlatform.isMusl [ 25 - ../../libcxx-0001-musl-hacks.patch 26 - ]; 27 - 28 - # Prevent errors like "error: 'foo' is unavailable: introduced in macOS yy.zz" 29 - postPatch = '' 30 - substituteInPlace include/__config \ 31 - --replace "# define _LIBCPP_USE_AVAILABILITY_APPLE" "" 32 - ''; 33 - 34 - prePatch = '' 35 - substituteInPlace lib/CMakeLists.txt --replace "/usr/lib/libc++" "\''${LIBCXX_LIBCXXABI_LIB_PATH}/libc++" 36 - ''; 37 - 38 - preConfigure = '' 39 - # Get headers from the cxxabi source so we can see private headers not installed by the cxxabi package 40 - cmakeFlagsArray=($cmakeFlagsArray -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$LIBCXXABI_INCLUDE_DIR") 41 - '' + lib.optionalString stdenv.hostPlatform.isMusl '' 42 - patchShebangs utils/cat_files.py 43 - ''; 44 - 45 - nativeBuildInputs = [ cmake ] 46 - ++ lib.optional stdenv.hostPlatform.isMusl python3 47 - ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; 48 - 49 - buildInputs = [ cxxabi ]; 50 - 51 - cmakeFlags = [ 52 - "-DLIBCXX_LIBCPPABI_VERSION=2" 53 - "-DLIBCXX_CXX_ABI=${cxxabi.pname}" 54 - ] ++ lib.optional stdenv.hostPlatform.isMusl "-DLIBCXX_HAS_MUSL_LIBC=1" 55 - ++ lib.optional (cxxabi.pname == "libcxxabi") "-DLIBCXX_LIBCXXABI_LIB_PATH=${cxxabi}/lib" 56 - ++ lib.optional (stdenv.hostPlatform.useLLVM or false) "-DLIBCXX_USE_COMPILER_RT=ON" 57 - ++ lib.optional (!enableShared) "-DLIBCXX_ENABLE_SHARED=OFF" ; 58 - 59 - preInstall = lib.optionalString (stdenv.isDarwin) '' 60 - for file in lib/*.dylib; do 61 - if [ -L "$file" ]; then continue; fi 62 - 63 - baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1)) 64 - installName="$out/lib/$baseName" 65 - abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/') 66 - 67 - for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do 68 - ${stdenv.cc.targetPrefix}install_name_tool -change $other ${cxxabi}/lib/$abiName $file 69 - done 70 - done 71 - ''; 72 - 73 - passthru = { 74 - isLLVM = true; 75 - inherit cxxabi; 76 - }; 77 - 78 - meta = llvm_meta // { 79 - homepage = "https://libcxx.llvm.org/"; 80 - description = "C++ standard library"; 81 - longDescription = '' 82 - libc++ is an implementation of the C++ standard library, targeting C++11, 83 - C++14 and above. 84 - ''; 85 - # "All of the code in libc++ is dual licensed under the MIT license and the 86 - # UIUC License (a BSD-like license)": 87 - license = with lib.licenses; [ mit ncsa ]; 88 - }; 89 - }
-72
pkgs/development/compilers/llvm/7/libcxx/gnu-install-dirs.patch
··· 1 - diff --git a/CMakeLists.txt b/CMakeLists.txt 2 - index acb49565ce97..6a863926cbca 100644 3 - --- a/CMakeLists.txt 4 - +++ b/CMakeLists.txt 5 - @@ -26,6 +26,8 @@ set(CMAKE_MODULE_PATH 6 - if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) 7 - project(libcxx CXX C) 8 - 9 - + include(GNUInstallDirs) 10 - + 11 - set(PACKAGE_NAME libcxx) 12 - set(PACKAGE_VERSION 7.0.0) 13 - set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") 14 - diff --git a/cmake/Modules/HandleLibCXXABI.cmake b/cmake/Modules/HandleLibCXXABI.cmake 15 - index 1c19d7e01af7..9c8aee8e8bb7 100644 16 - --- a/cmake/Modules/HandleLibCXXABI.cmake 17 - +++ b/cmake/Modules/HandleLibCXXABI.cmake 18 - @@ -59,7 +59,7 @@ macro(setup_abi_lib abidefines abilib abifiles abidirs) 19 - 20 - if (LIBCXX_INSTALL_HEADERS) 21 - install(FILES "${LIBCXX_BINARY_INCLUDE_DIR}/${fpath}" 22 - - DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1/${dstdir} 23 - + DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1/${dstdir} 24 - COMPONENT cxx-headers 25 - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ 26 - ) 27 - diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt 28 - index d9def18d725c..16494dacaf6f 100644 29 - --- a/include/CMakeLists.txt 30 - +++ b/include/CMakeLists.txt 31 - @@ -243,7 +243,7 @@ if (LIBCXX_INSTALL_HEADERS) 32 - foreach(file ${files}) 33 - get_filename_component(dir ${file} DIRECTORY) 34 - install(FILES ${file} 35 - - DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1/${dir} 36 - + DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1/${dir} 37 - COMPONENT cxx-headers 38 - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ 39 - ) 40 - @@ -252,7 +252,7 @@ if (LIBCXX_INSTALL_HEADERS) 41 - if (LIBCXX_NEEDS_SITE_CONFIG) 42 - # Install the generated header as __config. 43 - install(FILES ${LIBCXX_BINARY_DIR}/__generated_config 44 - - DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1 45 - + DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1 46 - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ 47 - RENAME __config 48 - COMPONENT cxx-headers) 49 - diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt 50 - index e068edc8a7af..b63ad92d1d78 100644 51 - --- a/lib/CMakeLists.txt 52 - +++ b/lib/CMakeLists.txt 53 - @@ -399,8 +399,8 @@ if (LIBCXX_INSTALL_LIBRARY) 54 - set(experimental_lib cxx_experimental) 55 - endif() 56 - install(TARGETS ${LIBCXX_INSTALL_TARGETS} ${filesystem_lib} ${experimental_lib} 57 - - LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx 58 - - ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx 59 - + LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx 60 - + ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx 61 - ) 62 - # NOTE: This install command must go after the cxx install command otherwise 63 - # it will not be executed after the library symlinks are installed. 64 - @@ -408,7 +408,7 @@ if (LIBCXX_INSTALL_LIBRARY) 65 - # Replace the libc++ filename with $<TARGET_LINKER_FILE:cxx> 66 - # after we required CMake 3.0. 67 - install(FILES "${LIBCXX_LIBRARY_DIR}/libc++${CMAKE_SHARED_LIBRARY_SUFFIX}" 68 - - DESTINATION ${LIBCXX_INSTALL_PREFIX}lib${LIBCXX_LIBDIR_SUFFIX} 69 - + DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX} 70 - COMPONENT libcxx) 71 - endif() 72 - endif()
-89
pkgs/development/compilers/llvm/7/libcxxabi/default.nix
··· 1 - { lib, stdenv, llvm_meta, cmake, fetch, libcxx, libunwind, llvm, version 2 - , fetchpatch 3 - , standalone ? stdenv.hostPlatform.useLLVM or false 4 - , withLibunwind ? !stdenv.isDarwin && !stdenv.hostPlatform.isWasm 5 - # on musl the shared objects don't build 6 - , enableShared ? !stdenv.hostPlatform.isStatic 7 - }: 8 - 9 - stdenv.mkDerivation { 10 - pname = "libcxxabi"; 11 - inherit version; 12 - 13 - src = fetch "libcxxabi" "1zcqxsdjhawgz1cvpk07y3jl6fg9p3ay4nl69zsirqb2ghgyhhb2"; 14 - 15 - outputs = [ "out" "dev" ]; 16 - 17 - postUnpack = '' 18 - unpackFile ${libcxx.src} 19 - unpackFile ${llvm.src} 20 - cmakeFlagsArray=($cmakeFlagsArray -DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_PATH=$PWD/$(ls -d libcxx-*) ) 21 - '' + lib.optionalString stdenv.isDarwin '' 22 - export TRIPLE=x86_64-apple-darwin 23 - '' + lib.optionalString stdenv.hostPlatform.isMusl '' 24 - patch -p1 -d $(ls -d libcxx-*) -i ${../../libcxx-0001-musl-hacks.patch} 25 - '' + lib.optionalString (!stdenv.cc.isClang) '' 26 - pushd libcxx-* 27 - patch -p2 < ${fetchpatch { 28 - url = "https://github.com/llvm/llvm-project/commit/76ccec07b4fa0cc68dfd07d557e7fb661804a468.patch"; 29 - sha256 = "1lgzkfkp7qinfc6gd8x5di1iq1gqdv81249c6f02chn9q122sbq1"; 30 - }} 31 - popd 32 - ''; 33 - 34 - patches = [ 35 - ./gnu-install-dirs.patch 36 - ]; 37 - 38 - nativeBuildInputs = [ cmake ]; 39 - buildInputs = lib.optional withLibunwind libunwind; 40 - 41 - cmakeFlags = lib.optionals standalone [ 42 - "-DLLVM_ENABLE_LIBCXX=ON" 43 - ] ++ lib.optionals (standalone && withLibunwind) [ 44 - "-DLIBCXXABI_USE_LLVM_UNWINDER=ON" 45 - ] ++ lib.optional (!enableShared) "-DLIBCXXABI_ENABLE_SHARED=OFF"; 46 - 47 - preInstall = lib.optionalString stdenv.isDarwin '' 48 - for file in lib/*.dylib; do 49 - if [ -L "$file" ]; then continue; fi 50 - 51 - # Fix up the install name. Preserve the basename, just replace the path. 52 - installName="$out/lib/$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))" 53 - 54 - # this should be done in CMake, but having trouble figuring out 55 - # the magic combination of necessary CMake variables 56 - # if you fancy a try, take a look at 57 - # https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling 58 - ${stdenv.cc.targetPrefix}install_name_tool -id $installName $file 59 - 60 - # cc-wrapper passes '-lc++abi' to all c++ link steps, but that causes 61 - # libcxxabi to sometimes link against a different version of itself. 62 - # Here we simply make that second reference point to ourselves. 63 - for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do 64 - ${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file 65 - done 66 - done 67 - ''; 68 - 69 - postInstall = '' 70 - mkdir -p "$dev/include" 71 - install -m 644 ../include/${if stdenv.isDarwin then "*" else "cxxabi.h"} "$dev/include" 72 - ''; 73 - 74 - passthru = { 75 - libName = "c++abi"; 76 - }; 77 - 78 - meta = llvm_meta // { 79 - homepage = "https://libcxxabi.llvm.org/"; 80 - description = "Provides C++ standard library support"; 81 - longDescription = '' 82 - libc++abi is a new implementation of low level support for a standard C++ library. 83 - ''; 84 - # "All of the code in libc++abi is dual licensed under the MIT license and 85 - # the UIUC License (a BSD-like license)": 86 - license = with lib.licenses; [ mit ncsa ]; 87 - maintainers = llvm_meta.maintainers ++ [ lib.maintainers.vlstill ]; 88 - }; 89 - }
-28
pkgs/development/compilers/llvm/7/libcxxabi/gnu-install-dirs.patch
··· 1 - diff --git a/CMakeLists.txt b/CMakeLists.txt 2 - index d6648ede1f59..55a8f17ca5e6 100644 3 - --- a/CMakeLists.txt 4 - +++ b/CMakeLists.txt 5 - @@ -20,6 +20,8 @@ set(CMAKE_MODULE_PATH 6 - if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) 7 - project(libcxxabi CXX C) 8 - 9 - + include(GNUInstallDirs) 10 - + 11 - set(PACKAGE_NAME libcxxabi) 12 - set(PACKAGE_VERSION 7.0.0svn) 13 - set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") 14 - diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt 15 - index 776c51294330..314b45feac69 100644 16 - --- a/src/CMakeLists.txt 17 - +++ b/src/CMakeLists.txt 18 - @@ -195,8 +195,8 @@ add_custom_target(cxxabi DEPENDS ${LIBCXXABI_BUILD_TARGETS}) 19 - 20 - if (LIBCXXABI_INSTALL_LIBRARY) 21 - install(TARGETS ${LIBCXXABI_INSTALL_TARGETS} 22 - - LIBRARY DESTINATION ${LIBCXXABI_INSTALL_PREFIX}lib${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi 23 - - ARCHIVE DESTINATION ${LIBCXXABI_INSTALL_PREFIX}lib${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi 24 - + LIBRARY DESTINATION ${LIBCXXABI_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi 25 - + ARCHIVE DESTINATION ${LIBCXXABI_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi 26 - ) 27 - endif() 28 -
-53
pkgs/development/compilers/llvm/7/libunwind/default.nix
··· 1 - { lib, stdenv, llvm_meta, version, fetch, fetchpatch, cmake, llvm 2 - , enableShared ? !stdenv.hostPlatform.isStatic 3 - }: 4 - 5 - stdenv.mkDerivation rec { 6 - pname = "libunwind"; 7 - inherit version; 8 - 9 - src = fetch pname "035dsxs10nyiqd00q07yycvmkjl01yz4jdlrjvmch8klxg4pyjhp"; 10 - 11 - postUnpack = '' 12 - unpackFile ${llvm.src} 13 - cmakeFlagsArray=($cmakeFlagsArray -DLLVM_PATH=$PWD/$(ls -d llvm-*)) 14 - ''; 15 - 16 - patches = [ 17 - ./gnu-install-dirs.patch 18 - ] ++ lib.optionals (stdenv.hostPlatform.useLLVM or false) [ 19 - # removes use of `new` that require libc++ 20 - (fetchpatch { 21 - url = "https://github.com/llvm-mirror/libunwind/commit/34a45c630d4c79af403661d267db42fbe7de1178.patch"; 22 - sha256 = "0n0pv6jvcky8pn3srhrf9x5kbnd0d2kia9xlx2g590f5q0bgwfhv"; 23 - }) 24 - # cleans up remaining libc++ dependencies (mostly header inclusions) 25 - (fetchpatch { 26 - url = "https://github.com/llvm-mirror/libunwind/commit/e050272d2eb57eb4e56a37b429a61df2ebb8aa3e.patch"; 27 - sha256 = "170mwmj0wf40iyk1kzdpaiy36rz9n8dpl881h4h7s5da0rh51xya"; 28 - includes = [ "src/libunwind.cpp" "src/UnwindCursor.hpp" ]; 29 - }) 30 - ]; 31 - 32 - outputs = [ "out" "dev" ]; 33 - 34 - nativeBuildInputs = [ cmake ]; 35 - 36 - cmakeFlags = lib.optionals (!enableShared) [ 37 - "-DLIBUNWIND_ENABLE_SHARED=OFF" 38 - ] ++ lib.optionals (stdenv.hostPlatform.useLLVM or false) [ 39 - "-DLLVM_ENABLE_LIBCXX=ON" 40 - ]; 41 - 42 - meta = llvm_meta // { 43 - # Details: https://github.com/llvm/llvm-project/blob/main/libunwind/docs/index.rst 44 - homepage = "https://clang.llvm.org/docs/Toolchain.html#unwind-library"; 45 - description = "LLVM's unwinder library"; 46 - longDescription = '' 47 - The unwind library provides a family of _Unwind_* functions implementing 48 - the language-neutral stack unwinding portion of the Itanium C++ ABI (Level 49 - I). It is a dependency of the C++ ABI library, and sometimes is a 50 - dependency of other runtimes. 51 - ''; 52 - }; 53 - }
-28
pkgs/development/compilers/llvm/7/libunwind/gnu-install-dirs.patch
··· 1 - diff --git a/CMakeLists.txt b/CMakeLists.txt 2 - index 0e48d713837a..05483c367bd1 100644 3 - --- a/CMakeLists.txt 4 - +++ b/CMakeLists.txt 5 - @@ -18,6 +18,8 @@ set(CMAKE_MODULE_PATH 6 - if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) 7 - project(libunwind) 8 - 9 - + include(GNUInstallDirs) 10 - + 11 - # Rely on llvm-config. 12 - set(CONFIG_OUTPUT) 13 - if(NOT LLVM_CONFIG_PATH) 14 - diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt 15 - index 937159e2cb86..07f8b936e7e5 100644 16 - --- a/src/CMakeLists.txt 17 - +++ b/src/CMakeLists.txt 18 - @@ -141,8 +141,8 @@ add_custom_target(unwind DEPENDS ${LIBUNWIND_BUILD_TARGETS}) 19 - 20 - if (LIBUNWIND_INSTALL_LIBRARY) 21 - install(TARGETS ${LIBUNWIND_INSTALL_TARGETS} 22 - - LIBRARY DESTINATION ${LIBUNWIND_INSTALL_PREFIX}lib${LIBUNWIND_LIBDIR_SUFFIX} COMPONENT unwind 23 - - ARCHIVE DESTINATION ${LIBUNWIND_INSTALL_PREFIX}lib${LIBUNWIND_LIBDIR_SUFFIX} COMPONENT unwind) 24 - + LIBRARY DESTINATION ${LIBUNWIND_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBUNWIND_LIBDIR_SUFFIX} COMPONENT unwind 25 - + ARCHIVE DESTINATION ${LIBUNWIND_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBUNWIND_LIBDIR_SUFFIX} COMPONENT unwind) 26 - endif() 27 - 28 - if (NOT CMAKE_CONFIGURATION_TYPES AND LIBUNWIND_INSTALL_LIBRARY)
-46
pkgs/development/compilers/llvm/7/lld/default.nix
··· 1 - { lib, stdenv, llvm_meta 2 - , buildLlvmTools 3 - , fetch 4 - , cmake 5 - , libxml2 6 - , libllvm 7 - , version 8 - }: 9 - 10 - stdenv.mkDerivation rec { 11 - pname = "lld"; 12 - inherit version; 13 - 14 - src = fetch pname "0rsqb7zcnij5r5ipfhr129j7skr5n9pyr388kjpqwh091952f3x1"; 15 - 16 - patches = [ 17 - ./gnu-install-dirs.patch 18 - ]; 19 - 20 - nativeBuildInputs = [ cmake ]; 21 - buildInputs = [ libllvm libxml2 ]; 22 - 23 - cmakeFlags = [ 24 - "-DLLVM_CONFIG_PATH=${libllvm.dev}/bin/llvm-config${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-native"}" 25 - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ 26 - "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" 27 - ]; 28 - 29 - # Musl's default stack size is too small for lld to be able to link Firefox. 30 - LDFLAGS = lib.optionalString stdenv.hostPlatform.isMusl "-Wl,-z,stack-size=2097152"; 31 - 32 - outputs = [ "out" "lib" "dev" ]; 33 - 34 - meta = llvm_meta // { 35 - homepage = "https://lld.llvm.org/"; 36 - description = "The LLVM linker (unwrapped)"; 37 - longDescription = '' 38 - LLD is a linker from the LLVM project that is a drop-in replacement for 39 - system linkers and runs much faster than them. It also provides features 40 - that are useful for toolchain developers. 41 - The linker supports ELF (Unix), PE/COFF (Windows), and Mach-O (macOS) 42 - in descending order of completeness. Internally, LLD consists 43 - of several different linkers. 44 - ''; 45 - }; 46 - }
-68
pkgs/development/compilers/llvm/7/lld/gnu-install-dirs.patch
··· 1 - diff --git a/CMakeLists.txt b/CMakeLists.txt 2 - index e2fbdbfbbb47..d601b231ebb8 100644 3 - --- a/CMakeLists.txt 4 - +++ b/CMakeLists.txt 5 - @@ -6,6 +6,8 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) 6 - set(CMAKE_INCLUDE_CURRENT_DIR ON) 7 - set(LLD_BUILT_STANDALONE TRUE) 8 - 9 - + include(GNUInstallDirs) 10 - + 11 - find_program(LLVM_CONFIG_PATH "llvm-config" DOC "Path to llvm-config binary") 12 - if(NOT LLVM_CONFIG_PATH) 13 - message(FATAL_ERROR "llvm-config not found: specify LLVM_CONFIG_PATH") 14 - @@ -203,7 +205,7 @@ include_directories(BEFORE 15 - 16 - if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) 17 - install(DIRECTORY include/ 18 - - DESTINATION include 19 - + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} 20 - FILES_MATCHING 21 - PATTERN "*.h" 22 - PATTERN ".svn" EXCLUDE 23 - diff --git a/cmake/modules/AddLLD.cmake b/cmake/modules/AddLLD.cmake 24 - index fa48b428d26b..e7967aad3ceb 100644 25 - --- a/cmake/modules/AddLLD.cmake 26 - +++ b/cmake/modules/AddLLD.cmake 27 - @@ -20,9 +20,9 @@ macro(add_lld_library name) 28 - install(TARGETS ${name} 29 - COMPONENT ${name} 30 - ${export_to_lldtargets} 31 - - LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} 32 - - ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} 33 - - RUNTIME DESTINATION bin) 34 - + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} 35 - + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} 36 - + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) 37 - 38 - if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES) 39 - add_llvm_install_targets(install-${name} 40 - @@ -54,7 +54,7 @@ macro(add_lld_tool name) 41 - 42 - install(TARGETS ${name} 43 - ${export_to_lldtargets} 44 - - RUNTIME DESTINATION bin 45 - + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 46 - COMPONENT ${name}) 47 - 48 - if(NOT CMAKE_CONFIGURATION_TYPES) 49 - @@ -69,5 +69,5 @@ endmacro() 50 - macro(add_lld_symlink name dest) 51 - add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE) 52 - # Always generate install targets 53 - - llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE) 54 - + llvm_install_symlink(${name} ${dest} ${CMAKE_INSTALL_FULL_BINDIR} ALWAYS_GENERATE) 55 - endmacro() 56 - diff --git a/tools/lld/CMakeLists.txt b/tools/lld/CMakeLists.txt 57 - index d8829493fc22..df748a0e749b 100644 58 - --- a/tools/lld/CMakeLists.txt 59 - +++ b/tools/lld/CMakeLists.txt 60 - @@ -16,7 +16,7 @@ target_link_libraries(lld 61 - ) 62 - 63 - install(TARGETS lld 64 - - RUNTIME DESTINATION bin) 65 - + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) 66 - 67 - if(NOT LLD_SYMLINKS_TO_CREATE) 68 - set(LLD_SYMLINKS_TO_CREATE lld-link ld.lld ld64.lld wasm-ld)
-95
pkgs/development/compilers/llvm/7/lldb/default.nix
··· 1 - { lib, stdenv, llvm_meta 2 - , fetch 3 - , cmake 4 - , zlib 5 - , ncurses 6 - , swig 7 - , which 8 - , libedit 9 - , libxml2 10 - , libllvm 11 - , libclang 12 - , perl 13 - , python3 14 - , version 15 - , darwin 16 - }: 17 - 18 - stdenv.mkDerivation rec { 19 - pname = "lldb"; 20 - inherit version; 21 - 22 - src = fetch "lldb" "0klsscg1sczc4nw2l53xggi969k361cng2sjjrfp3bv4g5x14s4v"; 23 - 24 - patches = [ 25 - ./gnu-install-dirs.patch 26 - ]; 27 - 28 - postPatch = '' 29 - # Fix up various paths that assume llvm and clang are installed in the same place 30 - sed -i 's,".*ClangConfig.cmake","${libclang.dev}/lib/cmake/clang/ClangConfig.cmake",' \ 31 - cmake/modules/LLDBStandalone.cmake 32 - sed -i 's,".*tools/clang/include","${libclang.dev}/include",' \ 33 - cmake/modules/LLDBStandalone.cmake 34 - sed -i 's,"$.LLVM_LIBRARY_DIR.",${libllvm.lib}/lib ${libclang.lib}/lib,' \ 35 - cmake/modules/LLDBStandalone.cmake 36 - sed -i -e 's,message(SEND_ERROR "Cannot find debugserver on system."),,' \ 37 - -e 's,string(STRIP ''${XCODE_DEV_DIR} XCODE_DEV_DIR),,' \ 38 - tools/debugserver/source/CMakeLists.txt 39 - 40 - # Fix /usr/bin references for sandboxed builds. 41 - patchShebangs scripts 42 - ''; 43 - 44 - outputs = [ "out" "lib" "dev" ]; 45 - 46 - nativeBuildInputs = [ 47 - cmake perl python3 which swig 48 - ]; 49 - 50 - buildInputs = [ 51 - ncurses zlib libedit libxml2 libllvm 52 - ] ++ lib.optionals stdenv.isDarwin [ 53 - darwin.libobjc 54 - darwin.apple_sdk.libs.xpc 55 - darwin.apple_sdk.frameworks.Foundation 56 - darwin.bootstrap_cmds 57 - darwin.apple_sdk.frameworks.Carbon 58 - darwin.apple_sdk.frameworks.Cocoa 59 - darwin.apple_sdk.frameworks.DebugSymbols 60 - ]; 61 - 62 - CXXFLAGS = "-fno-rtti"; 63 - hardeningDisable = [ "format" ]; 64 - 65 - env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-I${libxml2.dev}/include/libxml2"; 66 - 67 - cmakeFlags = [ 68 - "-DLLDB_INCLUDE_TESTS=${if doCheck then "YES" else "NO"}" 69 - "-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic 70 - "-DSKIP_DEBUGSERVER=ON" 71 - ] ++ lib.optionals doCheck [ 72 - "-DLLDB_TEST_C_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" 73 - "-DLLDB_TEST_CXX_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++" 74 - ]; 75 - 76 - doCheck = false; 77 - 78 - postInstall = '' 79 - mkdir -p $out/share/man/man1 80 - cp ../docs/lldb.1 $out/share/man/man1/ 81 - ''; 82 - 83 - meta = llvm_meta // { 84 - homepage = "https://lldb.llvm.org/"; 85 - description = "A next-generation high-performance debugger"; 86 - longDescription = '' 87 - LLDB is a next generation, high-performance debugger. It is built as a set 88 - of reusable components which highly leverage existing libraries in the 89 - larger LLVM Project, such as the Clang expression parser and LLVM 90 - disassembler. 91 - ''; 92 - # never built on aarch64-darwin since first introduction in nixpkgs 93 - broken = stdenv.isDarwin && stdenv.isAarch64; 94 - }; 95 - }
-76
pkgs/development/compilers/llvm/7/lldb/gnu-install-dirs.patch
··· 1 - diff --git a/CMakeLists.txt b/CMakeLists.txt 2 - index 00ddcdc1488f..af2aa238939a 100644 3 - --- a/CMakeLists.txt 4 - +++ b/CMakeLists.txt 5 - @@ -7,6 +7,8 @@ set(CMAKE_MODULE_PATH 6 - "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" 7 - ) 8 - 9 - +include(GNUInstallDirs) 10 - + 11 - include(LLDBStandalone) 12 - include(LLDBConfig) 13 - include(AddLLDB) 14 - diff --git a/cmake/modules/AddLLDB.cmake b/cmake/modules/AddLLDB.cmake 15 - index 129a5ef7500d..fb3fb3ce655c 100644 16 - --- a/cmake/modules/AddLLDB.cmake 17 - +++ b/cmake/modules/AddLLDB.cmake 18 - @@ -56,14 +56,14 @@ function(add_lldb_library name) 19 - endif() 20 - install(TARGETS ${name} 21 - COMPONENT ${name} 22 - - RUNTIME DESTINATION bin 23 - + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 24 - LIBRARY DESTINATION ${out_dir} 25 - ARCHIVE DESTINATION ${out_dir}) 26 - else() 27 - install(TARGETS ${name} 28 - COMPONENT ${name} 29 - - LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} 30 - - ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}) 31 - + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} 32 - + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) 33 - endif() 34 - if (NOT CMAKE_CONFIGURATION_TYPES) 35 - add_llvm_install_targets(install-${name} 36 - @@ -121,7 +121,7 @@ function(add_lldb_executable name) 37 - endif() 38 - 39 - if(ARG_GENERATE_INSTALL) 40 - - set(out_dir "bin") 41 - + set(out_dir "${CMAKE_INSTALL_BINDIR}") 42 - if (LLDB_BUILD_FRAMEWORK AND ARG_INCLUDE_IN_SUITE) 43 - set(out_dir ${LLDB_FRAMEWORK_INSTALL_DIR}/${LLDB_FRAMEWORK_RESOURCE_DIR}) 44 - endif() 45 - diff --git a/cmake/modules/LLDBConfig.cmake b/cmake/modules/LLDBConfig.cmake 46 - index dae6e365da38..ef272d5de5c0 100644 47 - --- a/cmake/modules/LLDBConfig.cmake 48 - +++ b/cmake/modules/LLDBConfig.cmake 49 - @@ -278,7 +278,7 @@ include_directories(BEFORE 50 - if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) 51 - install(DIRECTORY include/ 52 - COMPONENT lldb-headers 53 - - DESTINATION include 54 - + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} 55 - FILES_MATCHING 56 - PATTERN "*.h" 57 - PATTERN ".svn" EXCLUDE 58 - @@ -288,7 +288,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) 59 - 60 - install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/ 61 - COMPONENT lldb-headers 62 - - DESTINATION include 63 - + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} 64 - FILES_MATCHING 65 - PATTERN "*.h" 66 - PATTERN ".svn" EXCLUDE 67 - diff --git a/tools/intel-features/CMakeLists.txt b/tools/intel-features/CMakeLists.txt 68 - index b5316540fdf3..3c3c882d503f 100644 69 - --- a/tools/intel-features/CMakeLists.txt 70 - +++ b/tools/intel-features/CMakeLists.txt 71 - @@ -64,4 +64,4 @@ if (NOT LLDB_DISABLE_PYTHON AND LLDB_BUILD_INTEL_PT) 72 - endif() 73 - 74 - install(TARGETS lldbIntelFeatures 75 - - LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}) 76 - + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX})
-332
pkgs/development/compilers/llvm/7/llvm/default.nix
··· 1 - { lib, stdenv, llvm_meta 2 - , pkgsBuildBuild 3 - , fetch 4 - , fetchpatch 5 - , cmake 6 - , python3 7 - , libffi 8 - , enableGoldPlugin ? libbfd.hasPluginAPI 9 - , libbfd 10 - , libpfm 11 - , libxml2 12 - , ncurses 13 - , version 14 - , release_version 15 - , zlib 16 - , buildLlvmTools 17 - , debugVersion ? false 18 - , doCheck ? stdenv.isLinux && (!stdenv.isx86_32) 19 - && (stdenv.hostPlatform == stdenv.buildPlatform) 20 - , enableManpages ? false 21 - , enableSharedLibraries ? !stdenv.hostPlatform.isStatic 22 - # broken for Ampere eMAG 8180 (c2.large.arm on Packet) #56245 23 - # broken for the armv7l builder 24 - , enablePFM ? stdenv.isLinux && !stdenv.hostPlatform.isAarch 25 - , enablePolly ? false 26 - }: 27 - 28 - let 29 - inherit (lib) optional optionals optionalString; 30 - 31 - # Used when creating a versioned symlinks of libLLVM.dylib 32 - versionSuffixes = with lib; 33 - let parts = splitVersion release_version; in 34 - imap (i: _: concatStringsSep "." (take i parts)) parts; 35 - 36 - # Ordinarily we would just the `doCheck` and `checkDeps` functionality 37 - # `mkDerivation` gives us to manage our test dependencies (instead of breaking 38 - # out `doCheck` as a package level attribute). 39 - # 40 - # Unfortunately `lit` does not forward `$PYTHONPATH` to children processes, in 41 - # particular the children it uses to do feature detection. 42 - # 43 - # This means that python deps we add to `checkDeps` (which the python 44 - # interpreter is made aware of via `$PYTHONPATH` – populated by the python 45 - # setup hook) are not picked up by `lit` which causes it to skip tests. 46 - # 47 - # Adding `python3.withPackages (ps: [ ... ])` to `checkDeps` also doesn't work 48 - # because this package is shadowed in `$PATH` by the regular `python3` 49 - # package. 50 - # 51 - # So, we "manually" assemble one python derivation for the package to depend 52 - # on, taking into account whether checks are enabled or not: 53 - python = if doCheck then 54 - let 55 - checkDeps = ps: with ps; [ psutil ]; 56 - in python3.withPackages checkDeps 57 - else python3; 58 - 59 - in stdenv.mkDerivation (rec { 60 - pname = "llvm"; 61 - inherit version; 62 - 63 - src = fetch "llvm" "0r1p5didv4rkgxyvbkyz671xddg6i3dxvbpsi1xxipkla0l9pk0v"; 64 - polly_src = fetch "polly" "16qkns4ab4x0azrvhy4j7cncbyb2rrbdrqj87zphvqxm5pvm8m1h"; 65 - 66 - unpackPhase = '' 67 - unpackFile $src 68 - mv llvm-${version}* llvm 69 - sourceRoot=$PWD/llvm 70 - '' + optionalString enablePolly '' 71 - unpackFile $polly_src 72 - mv polly-* $sourceRoot/tools/polly 73 - ''; 74 - 75 - outputs = [ "out" "lib" "dev" "python" ]; 76 - 77 - nativeBuildInputs = [ cmake python ] 78 - ++ optional enableManpages python3.pkgs.sphinx; 79 - 80 - buildInputs = [ libxml2 libffi ] 81 - ++ optional enablePFM libpfm; # exegesis 82 - 83 - propagatedBuildInputs = [ ncurses zlib ]; 84 - 85 - patches = [ 86 - # backport, fix building rust crates with lto 87 - (fetchpatch { 88 - url = "https://github.com/llvm-mirror/llvm/commit/da1fb72bb305d6bc1f3899d541414146934bf80f.patch"; 89 - sha256 = "0p81gkhc1xhcx0hmnkwyhrn8x8l8fd24xgaj1whni29yga466dwc"; 90 - }) 91 - (fetchpatch { 92 - url = "https://github.com/llvm-mirror/llvm/commit/cc1f2a595ead516812a6c50398f0f3480ebe031f.patch"; 93 - sha256 = "0k6k1p5yisgwx417a67s7sr9930rqh1n0zv5jvply8vjjy4b3kf8"; 94 - }) 95 - 96 - # When cross-compiling we configure llvm-config-native with an approximation 97 - # of the flags used for the normal LLVM build. To avoid the need for building 98 - # a native libLLVM.so (which would fail) we force llvm-config to be linked 99 - # statically against the necessary LLVM components always. 100 - ../../llvm-config-link-static.patch 101 - 102 - ./gnu-install-dirs.patch 103 - 104 - # Fix invalid std::string(nullptr) for GCC 12 105 - (fetchpatch { 106 - name = "nvptx-gcc-12.patch"; 107 - url = "https://github.com/llvm/llvm-project/commit/99e64623ec9b31def9375753491cc6093c831809.patch"; 108 - sha256 = "0zjfjgavqzi2ypqwqnlvy6flyvdz8hi1anwv0ybwnm2zqixg7za3"; 109 - stripLen = 1; 110 - }) 111 - 112 - ../../llvm-7-musl.patch 113 - ] ++ lib.optionals enablePolly [ 114 - ./gnu-install-dirs-polly.patch 115 - # Add missing isl header includess required to build LLVM 7 + Polly with clang 16. 116 - (fetchpatch { 117 - name = "polly-ppcg-isl-headers.patch"; 118 - url = "https://repo.or.cz/ppcg.git/patch/098ba285306114dc71497f7b51c357f69c9b4472"; 119 - hash = "sha256-c9L30rDROYAMbUSuaK9U/ixyFMlH/Sa1n+VgLODzSCQ="; 120 - extraPrefix = "tools/polly/lib/External/ppcg/"; 121 - stripLen = 1; 122 - }) 123 - ]; 124 - 125 - postPatch = optionalString stdenv.isDarwin '' 126 - substituteInPlace cmake/modules/AddLLVM.cmake \ 127 - --replace 'set(_install_name_dir INSTALL_NAME_DIR "@rpath")' "set(_install_name_dir)" \ 128 - --replace 'set(_install_rpath "@loader_path/../''${CMAKE_INSTALL_LIBDIR}" ''${extra_libdir})' "" 129 - '' + '' 130 - # FileSystem permissions tests fail with various special bits 131 - substituteInPlace unittests/Support/CMakeLists.txt \ 132 - --replace "Path.cpp" "" 133 - rm unittests/Support/Path.cpp 134 - '' + optionalString stdenv.hostPlatform.isMusl '' 135 - patch -p1 -i ${../../TLI-musl.patch} 136 - substituteInPlace unittests/Support/CMakeLists.txt \ 137 - --replace "add_subdirectory(DynamicLibrary)" "" 138 - rm unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp 139 - '' + optionalString stdenv.hostPlatform.isAarch32 '' 140 - # skip failing X86 test cases on armv7l 141 - rm test/DebugInfo/X86/debug_addr.ll 142 - rm test/tools/llvm-dwarfdump/X86/debug_addr.s 143 - rm test/tools/llvm-dwarfdump/X86/debug_addr_address_size_mismatch.s 144 - rm test/tools/llvm-dwarfdump/X86/debug_addr_dwarf4.s 145 - rm test/tools/llvm-dwarfdump/X86/debug_addr_unsupported_version.s 146 - rm test/tools/llvm-dwarfdump/X86/debug_addr_version_mismatch.s 147 - '' + optionalString (stdenv.hostPlatform.system == "armv6l-linux") '' 148 - # Seems to require certain floating point hardware (NEON?) 149 - rm test/ExecutionEngine/frem.ll 150 - '' + '' 151 - patchShebangs test/BugPoint/compile-custom.ll.py 152 - '' + '' 153 - # Tweak tests to ignore namespace part of type to support 154 - # gcc-12: https://gcc.gnu.org/PR103598. 155 - # The change below mangles strings like: 156 - # CHECK-NEXT: Starting llvm::Function pass manager run. 157 - # to: 158 - # CHECK-NEXT: Starting {{.*}}Function pass manager run. 159 - for f in \ 160 - test/Other/new-pass-manager.ll \ 161 - test/Other/new-pm-defaults.ll \ 162 - test/Other/new-pm-lto-defaults.ll \ 163 - test/Other/new-pm-thinlto-defaults.ll \ 164 - test/Other/pass-pipeline-parsing.ll \ 165 - test/Transforms/Inline/cgscc-incremental-invalidate.ll \ 166 - test/Transforms/Inline/clear-analyses.ll \ 167 - test/Transforms/LoopUnroll/unroll-loop-invalidation.ll \ 168 - test/Transforms/SCCP/preserve-analysis.ll \ 169 - test/Transforms/SROA/dead-inst.ll \ 170 - test/tools/gold/X86/new-pm.ll \ 171 - ; do 172 - echo "PATCH: $f" 173 - substituteInPlace $f \ 174 - --replace 'Starting llvm::' 'Starting {{.*}}' \ 175 - --replace 'Finished llvm::' 'Finished {{.*}}' 176 - done 177 - ''; 178 - 179 - preConfigure = '' 180 - # Workaround for configure flags that need to have spaces 181 - cmakeFlagsArray+=( 182 - -DLLVM_LIT_ARGS='-svj''${NIX_BUILD_CORES} --no-progress-bar' 183 - ) 184 - ''; 185 - 186 - # hacky fix: created binaries need to be run before installation 187 - preBuild = '' 188 - mkdir -p $out/ 189 - ln -sv $PWD/lib $out 190 - ''; 191 - 192 - cmakeBuildType = if debugVersion then "Debug" else "Release"; 193 - 194 - cmakeFlags = with stdenv; let 195 - # These flags influence llvm-config's BuildVariables.inc in addition to the 196 - # general build. We need to make sure these are also passed via 197 - # CROSS_TOOLCHAIN_FLAGS_NATIVE when cross-compiling or llvm-config-native 198 - # will return different results from the cross llvm-config. 199 - # 200 - # Some flags don't need to be repassed because LLVM already does so (like 201 - # CMAKE_BUILD_TYPE), others are irrelevant to the result. 202 - flagsForLlvmConfig = [ 203 - "-DLLVM_INSTALL_CMAKE_DIR=${placeholder "dev"}/lib/cmake/llvm/" 204 - "-DLLVM_ENABLE_RTTI=ON" 205 - ] ++ optionals enableSharedLibraries [ 206 - "-DLLVM_LINK_LLVM_DYLIB=ON" 207 - ]; 208 - in flagsForLlvmConfig ++ [ 209 - "-DLLVM_INSTALL_UTILS=ON" # Needed by rustc 210 - "-DLLVM_BUILD_TESTS=${if doCheck then "ON" else "OFF"}" 211 - "-DLLVM_ENABLE_FFI=ON" 212 - "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}" 213 - "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}" 214 - "-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly" 215 - "-DLLVM_ENABLE_DUMP=ON" 216 - ] ++ optionals enableManpages [ 217 - "-DLLVM_BUILD_DOCS=ON" 218 - "-DLLVM_ENABLE_SPHINX=ON" 219 - "-DSPHINX_OUTPUT_MAN=ON" 220 - "-DSPHINX_OUTPUT_HTML=OFF" 221 - "-DSPHINX_WARNINGS_AS_ERRORS=OFF" 222 - ] ++ optionals (enableGoldPlugin) [ 223 - "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include" 224 - ] ++ optionals (isDarwin) [ 225 - "-DLLVM_ENABLE_LIBCXX=ON" 226 - "-DCAN_TARGET_i386=false" 227 - ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ 228 - "-DCMAKE_CROSSCOMPILING=True" 229 - "-DLLVM_TABLEGEN=${buildLlvmTools.llvm}/bin/llvm-tblgen" 230 - ( 231 - let 232 - nativeCC = pkgsBuildBuild.targetPackages.stdenv.cc; 233 - nativeBintools = nativeCC.bintools.bintools; 234 - nativeToolchainFlags = [ 235 - "-DCMAKE_C_COMPILER=${nativeCC}/bin/${nativeCC.targetPrefix}cc" 236 - "-DCMAKE_CXX_COMPILER=${nativeCC}/bin/${nativeCC.targetPrefix}c++" 237 - "-DCMAKE_AR=${nativeBintools}/bin/${nativeBintools.targetPrefix}ar" 238 - "-DCMAKE_STRIP=${nativeBintools}/bin/${nativeBintools.targetPrefix}strip" 239 - "-DCMAKE_RANLIB=${nativeBintools}/bin/${nativeBintools.targetPrefix}ranlib" 240 - ]; 241 - # We need to repass the custom GNUInstallDirs values, otherwise CMake 242 - # will choose them for us, leading to wrong results in llvm-config-native 243 - nativeInstallFlags = [ 244 - "-DCMAKE_INSTALL_PREFIX=${placeholder "out"}" 245 - "-DCMAKE_INSTALL_BINDIR=${placeholder "out"}/bin" 246 - "-DCMAKE_INSTALL_INCLUDEDIR=${placeholder "dev"}/include" 247 - "-DCMAKE_INSTALL_LIBDIR=${placeholder "lib"}/lib" 248 - "-DCMAKE_INSTALL_LIBEXECDIR=${placeholder "lib"}/libexec" 249 - ]; 250 - in "-DCROSS_TOOLCHAIN_FLAGS_NATIVE:list=" 251 - + lib.concatStringsSep ";" (lib.concatLists [ 252 - flagsForLlvmConfig 253 - nativeToolchainFlags 254 - nativeInstallFlags 255 - ]) 256 - ) 257 - ]; 258 - 259 - postBuild = '' 260 - rm -fR $out 261 - ''; 262 - 263 - preCheck = '' 264 - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/lib 265 - ''; 266 - 267 - postInstall = '' 268 - mkdir -p $python/share 269 - mv $out/share/opt-viewer $python/share/opt-viewer 270 - moveToOutput "bin/llvm-config*" "$dev" 271 - substituteInPlace "$dev/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ 272 - --replace "\''${_IMPORT_PREFIX}/lib/lib" "$lib/lib/lib" \ 273 - --replace "$out/bin/llvm-config" "$dev/bin/llvm-config" 274 - substituteInPlace "$dev/lib/cmake/llvm/LLVMConfig.cmake" \ 275 - --replace 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}")' 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}'"$lib"'")' 276 - '' 277 - + optionalString (stdenv.isDarwin && enableSharedLibraries) '' 278 - ${lib.concatMapStringsSep "\n" (v: '' 279 - ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${v}.dylib 280 - '') versionSuffixes} 281 - '' 282 - + optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' 283 - cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native 284 - ''; 285 - 286 - inherit doCheck; 287 - 288 - checkTarget = "check-all"; 289 - 290 - requiredSystemFeatures = [ "big-parallel" ]; 291 - meta = llvm_meta // { 292 - homepage = "https://llvm.org/"; 293 - description = "A collection of modular and reusable compiler and toolchain technologies"; 294 - longDescription = '' 295 - The LLVM Project is a collection of modular and reusable compiler and 296 - toolchain technologies. Despite its name, LLVM has little to do with 297 - traditional virtual machines. The name "LLVM" itself is not an acronym; it 298 - is the full name of the project. 299 - LLVM began as a research project at the University of Illinois, with the 300 - goal of providing a modern, SSA-based compilation strategy capable of 301 - supporting both static and dynamic compilation of arbitrary programming 302 - languages. Since then, LLVM has grown to be an umbrella project consisting 303 - of a number of subprojects, many of which are being used in production by 304 - a wide variety of commercial and open source projects as well as being 305 - widely used in academic research. Code in the LLVM project is licensed 306 - under the "Apache 2.0 License with LLVM exceptions". 307 - ''; 308 - }; 309 - } // lib.optionalAttrs enableManpages { 310 - pname = "llvm-manpages"; 311 - 312 - buildPhase = '' 313 - make docs-llvm-man 314 - ''; 315 - 316 - propagatedBuildInputs = []; 317 - 318 - installPhase = '' 319 - make -C docs install 320 - ''; 321 - 322 - postPatch = null; 323 - postInstall = null; 324 - 325 - outputs = [ "out" ]; 326 - 327 - doCheck = false; 328 - 329 - meta = llvm_meta // { 330 - description = "man pages for LLVM ${version}"; 331 - }; 332 - })
-106
pkgs/development/compilers/llvm/7/llvm/gnu-install-dirs-polly.patch
··· 1 - diff --git a/tools/polly/CMakeLists.txt b/tools/polly/CMakeLists.txt 2 - index 9939097f743e..8cc538da912a 100644 3 - --- a/tools/polly/CMakeLists.txt 4 - +++ b/tools/polly/CMakeLists.txt 5 - @@ -2,7 +2,11 @@ 6 - if (NOT DEFINED LLVM_MAIN_SRC_DIR) 7 - project(Polly) 8 - cmake_minimum_required(VERSION 3.4.3) 9 - +endif() 10 - + 11 - +include(GNUInstallDirs) 12 - 13 - +if (NOT DEFINED LLVM_MAIN_SRC_DIR) 14 - # Where is LLVM installed? 15 - find_package(LLVM CONFIG REQUIRED) 16 - set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${LLVM_CMAKE_DIR}) 17 - @@ -145,14 +149,14 @@ include_directories( 18 - 19 - if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) 20 - install(DIRECTORY include/ 21 - - DESTINATION include 22 - + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} 23 - FILES_MATCHING 24 - PATTERN "*.h" 25 - PATTERN ".svn" EXCLUDE 26 - ) 27 - 28 - install(DIRECTORY ${POLLY_BINARY_DIR}/include/ 29 - - DESTINATION include 30 - + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} 31 - FILES_MATCHING 32 - PATTERN "*.h" 33 - PATTERN "CMakeFiles" EXCLUDE 34 - diff --git a/tools/polly/cmake/CMakeLists.txt b/tools/polly/cmake/CMakeLists.txt 35 - index 969292cd6b00..d7aea77bdd20 100644 36 - --- a/tools/polly/cmake/CMakeLists.txt 37 - +++ b/tools/polly/cmake/CMakeLists.txt 38 - @@ -79,18 +79,18 @@ file(GENERATE 39 - 40 - # Generate PollyConfig.cmake for the install tree. 41 - unset(POLLY_EXPORTS) 42 - -set(POLLY_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") 43 - +set(POLLY_INSTALL_PREFIX "") 44 - set(POLLY_CONFIG_LLVM_CMAKE_DIR "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}") 45 - -set(POLLY_CONFIG_CMAKE_DIR "${POLLY_INSTALL_PREFIX}/${POLLY_INSTALL_PACKAGE_DIR}") 46 - -set(POLLY_CONFIG_LIBRARY_DIRS "${POLLY_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}") 47 - +set(POLLY_CONFIG_CMAKE_DIR "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_PREFIX}/${POLLY_INSTALL_PACKAGE_DIR}") 48 - +set(POLLY_CONFIG_LIBRARY_DIRS "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") 49 - if (POLLY_BUNDLED_ISL) 50 - set(POLLY_CONFIG_INCLUDE_DIRS 51 - - "${POLLY_INSTALL_PREFIX}/include" 52 - - "${POLLY_INSTALL_PREFIX}/include/polly" 53 - + "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}" 54 - + "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}/polly" 55 - ) 56 - else() 57 - set(POLLY_CONFIG_INCLUDE_DIRS 58 - - "${POLLY_INSTALL_PREFIX}/include" 59 - + "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_INCLUDEDIR}" 60 - ${ISL_INCLUDE_DIRS} 61 - ) 62 - endif() 63 - @@ -100,12 +100,12 @@ endif() 64 - foreach(tgt IN LISTS POLLY_CONFIG_EXPORTED_TARGETS) 65 - get_target_property(tgt_type ${tgt} TYPE) 66 - if (tgt_type STREQUAL "EXECUTABLE") 67 - - set(tgt_prefix "bin/") 68 - + set(tgt_prefix "${CMAKE_INSTALL_BINDIR}/") 69 - else() 70 - - set(tgt_prefix "lib/") 71 - + set(tgt_prefix "${CMAKE_INSTALL_LIBDIR}/") 72 - endif() 73 - 74 - - set(tgt_path "${CMAKE_INSTALL_PREFIX}/${tgt_prefix}$<TARGET_FILE_NAME:${tgt}>") 75 - + set(tgt_path "${tgt_prefix}$<TARGET_FILE_NAME:${tgt}>") 76 - file(RELATIVE_PATH tgt_path ${POLLY_CONFIG_CMAKE_DIR} ${tgt_path}) 77 - 78 - if (NOT tgt_type STREQUAL "INTERFACE_LIBRARY") 79 - diff --git a/tools/polly/cmake/polly_macros.cmake b/tools/polly/cmake/polly_macros.cmake 80 - index e48203871884..5bc8a2a52541 100644 81 - --- a/tools/polly/cmake/polly_macros.cmake 82 - +++ b/tools/polly/cmake/polly_macros.cmake 83 - @@ -44,8 +44,8 @@ macro(add_polly_library name) 84 - if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LLVMPolly") 85 - install(TARGETS ${name} 86 - EXPORT LLVMExports 87 - - LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} 88 - - ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}) 89 - + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} 90 - + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) 91 - endif() 92 - set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) 93 - endmacro(add_polly_library) 94 - diff --git a/tools/polly/lib/External/CMakeLists.txt b/tools/polly/lib/External/CMakeLists.txt 95 - index 8ffd984e542b..261cc19f3238 100644 96 - --- a/tools/polly/lib/External/CMakeLists.txt 97 - +++ b/tools/polly/lib/External/CMakeLists.txt 98 - @@ -274,7 +274,7 @@ if (POLLY_BUNDLED_ISL) 99 - install(DIRECTORY 100 - ${ISL_SOURCE_DIR}/include/ 101 - ${ISL_BINARY_DIR}/include/ 102 - - DESTINATION include/polly 103 - + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/polly 104 - FILES_MATCHING 105 - PATTERN "*.h" 106 - PATTERN "CMakeFiles" EXCLUDE
-386
pkgs/development/compilers/llvm/7/llvm/gnu-install-dirs.patch
··· 1 - diff --git a/CMakeLists.txt b/CMakeLists.txt 2 - index a3d3013cedcd..b298d6ef04af 100644 3 - --- a/CMakeLists.txt 4 - +++ b/CMakeLists.txt 5 - @@ -275,15 +275,21 @@ if (CMAKE_BUILD_TYPE AND 6 - message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") 7 - endif() 8 - 9 - +include(GNUInstallDirs) 10 - + 11 - set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" ) 12 - 13 - -set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')") 14 - +set(LLVM_TOOLS_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE STRING 15 - + "Path for binary subdirectory (defaults to 'bin')") 16 - mark_as_advanced(LLVM_TOOLS_INSTALL_DIR) 17 - 18 - set(LLVM_UTILS_INSTALL_DIR "${LLVM_TOOLS_INSTALL_DIR}" CACHE STRING 19 - "Path to install LLVM utilities (enabled by LLVM_INSTALL_UTILS=ON) (defaults to LLVM_TOOLS_INSTALL_DIR)") 20 - mark_as_advanced(LLVM_UTILS_INSTALL_DIR) 21 - 22 - +set(LLVM_INSTALL_CMAKE_DIR "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/cmake/llvm" CACHE STRING 23 - + "Path for CMake subdirectory (defaults to lib/cmake/llvm)" ) 24 - + 25 - # They are used as destination of target generators. 26 - set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin) 27 - set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) 28 - @@ -531,9 +537,9 @@ option (LLVM_ENABLE_SPHINX "Use Sphinx to generate llvm documentation." OFF) 29 - option (LLVM_ENABLE_OCAMLDOC "Build OCaml bindings documentation." ON) 30 - option (LLVM_ENABLE_BINDINGS "Build bindings." ON) 31 - 32 - -set(LLVM_INSTALL_DOXYGEN_HTML_DIR "share/doc/llvm/doxygen-html" 33 - +set(LLVM_INSTALL_DOXYGEN_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/doxygen-html" 34 - CACHE STRING "Doxygen-generated HTML documentation install directory") 35 - -set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "share/doc/llvm/ocaml-html" 36 - +set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/ocaml-html" 37 - CACHE STRING "OCamldoc-generated HTML documentation install directory") 38 - 39 - option (LLVM_BUILD_EXTERNAL_COMPILER_RT 40 - @@ -966,7 +972,7 @@ endif() 41 - 42 - if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) 43 - install(DIRECTORY include/llvm include/llvm-c 44 - - DESTINATION include 45 - + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} 46 - COMPONENT llvm-headers 47 - FILES_MATCHING 48 - PATTERN "*.def" 49 - @@ -978,7 +984,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) 50 - ) 51 - 52 - install(DIRECTORY ${LLVM_INCLUDE_DIR}/llvm ${LLVM_INCLUDE_DIR}/llvm-c 53 - - DESTINATION include 54 - + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} 55 - COMPONENT llvm-headers 56 - FILES_MATCHING 57 - PATTERN "*.def" 58 - diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake 59 - index c0f90ba7068d..d656156ff9c8 100644 60 - --- a/cmake/modules/AddLLVM.cmake 61 - +++ b/cmake/modules/AddLLVM.cmake 62 - @@ -638,11 +638,11 @@ macro(add_llvm_library name) 63 - else() 64 - if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LTO" OR 65 - (LLVM_LINK_LLVM_DYLIB AND ${name} STREQUAL "LLVM")) 66 - - set(install_dir lib${LLVM_LIBDIR_SUFFIX}) 67 - + set(install_dir ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) 68 - if(ARG_SHARED OR BUILD_SHARED_LIBS) 69 - if(WIN32 OR CYGWIN OR MINGW) 70 - set(install_type RUNTIME) 71 - - set(install_dir bin) 72 - + set(install_dir ${CMAKE_INSTALL_BINDIR}) 73 - else() 74 - set(install_type LIBRARY) 75 - endif() 76 - @@ -684,9 +684,9 @@ macro(add_llvm_loadable_module name) 77 - if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) 78 - if(WIN32 OR CYGWIN) 79 - # DLL platform 80 - - set(dlldir "bin") 81 - + set(dlldir "${CMAKE_INSTALL_BINDIR}") 82 - else() 83 - - set(dlldir "lib${LLVM_LIBDIR_SUFFIX}") 84 - + set(dlldir "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") 85 - endif() 86 - 87 - if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR 88 - @@ -698,7 +698,7 @@ macro(add_llvm_loadable_module name) 89 - install(TARGETS ${name} 90 - ${export_to_llvmexports} 91 - LIBRARY DESTINATION ${dlldir} 92 - - ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}) 93 - + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) 94 - endif() 95 - set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) 96 - endif() 97 - @@ -912,7 +912,7 @@ macro(add_llvm_example name) 98 - endif() 99 - add_llvm_executable(${name} ${ARGN}) 100 - if( LLVM_BUILD_EXAMPLES ) 101 - - install(TARGETS ${name} RUNTIME DESTINATION examples) 102 - + install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples) 103 - endif() 104 - set_target_properties(${name} PROPERTIES FOLDER "Examples") 105 - endmacro(add_llvm_example name) 106 - @@ -1430,7 +1430,7 @@ function(llvm_install_library_symlink name dest type) 107 - set(full_name ${CMAKE_${type}_LIBRARY_PREFIX}${name}${CMAKE_${type}_LIBRARY_SUFFIX}) 108 - set(full_dest ${CMAKE_${type}_LIBRARY_PREFIX}${dest}${CMAKE_${type}_LIBRARY_SUFFIX}) 109 - 110 - - set(output_dir lib${LLVM_LIBDIR_SUFFIX}) 111 - + set(output_dir ${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) 112 - if(WIN32 AND "${type}" STREQUAL "SHARED") 113 - set(output_dir bin) 114 - endif() 115 - @@ -1446,7 +1446,7 @@ function(llvm_install_library_symlink name dest type) 116 - endif() 117 - endfunction() 118 - 119 - -function(llvm_install_symlink name dest) 120 - +function(llvm_install_symlink name dest output_dir) 121 - cmake_parse_arguments(ARG "ALWAYS_GENERATE" "COMPONENT" "" ${ARGN}) 122 - foreach(path ${CMAKE_MODULE_PATH}) 123 - if(EXISTS ${path}/LLVMInstallSymlink.cmake) 124 - @@ -1469,7 +1469,7 @@ function(llvm_install_symlink name dest) 125 - set(full_dest ${dest}${CMAKE_EXECUTABLE_SUFFIX}) 126 - 127 - install(SCRIPT ${INSTALL_SYMLINK} 128 - - CODE "install_symlink(${full_name} ${full_dest} ${LLVM_TOOLS_INSTALL_DIR})" 129 - + CODE "install_symlink(${full_name} ${full_dest} ${output_dir})" 130 - COMPONENT ${component}) 131 - 132 - if (NOT CMAKE_CONFIGURATION_TYPES AND NOT ARG_ALWAYS_GENERATE) 133 - @@ -1551,7 +1551,8 @@ function(add_llvm_tool_symlink link_name target) 134 - endif() 135 - 136 - if ((TOOL_IS_TOOLCHAIN OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY) AND LLVM_BUILD_TOOLS) 137 - - llvm_install_symlink(${link_name} ${target}) 138 - + GNUInstallDirs_get_absolute_install_dir(output_dir LLVM_TOOLS_INSTALL_DIR) 139 - + llvm_install_symlink(${link_name} ${target} ${output_dir}) 140 - endif() 141 - endif() 142 - endfunction() 143 - @@ -1635,9 +1636,9 @@ function(llvm_setup_rpath name) 144 - 145 - if (APPLE) 146 - set(_install_name_dir INSTALL_NAME_DIR "@rpath") 147 - - set(_install_rpath "@loader_path/../lib" ${extra_libdir}) 148 - + set(_install_rpath "@loader_path/../${CMAKE_INSTALL_LIBDIR}" ${extra_libdir}) 149 - elseif(UNIX) 150 - - set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) 151 - + set(_install_rpath "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) 152 - if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)") 153 - set_property(TARGET ${name} APPEND_STRING PROPERTY 154 - LINK_FLAGS " -Wl,-z,origin ") 155 - diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake 156 - index 02bab6846376..eff26adb2efc 100644 157 - --- a/cmake/modules/AddOCaml.cmake 158 - +++ b/cmake/modules/AddOCaml.cmake 159 - @@ -140,9 +140,9 @@ function(add_ocaml_library name) 160 - endforeach() 161 - 162 - if( APPLE ) 163 - - set(ocaml_rpath "@executable_path/../../../lib${LLVM_LIBDIR_SUFFIX}") 164 - + set(ocaml_rpath "@executable_path/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") 165 - elseif( UNIX ) 166 - - set(ocaml_rpath "\\$ORIGIN/../../../lib${LLVM_LIBDIR_SUFFIX}") 167 - + set(ocaml_rpath "\\$ORIGIN/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") 168 - endif() 169 - list(APPEND ocaml_flags "-ldopt" "-Wl,-rpath,${ocaml_rpath}") 170 - 171 - diff --git a/cmake/modules/AddSphinxTarget.cmake b/cmake/modules/AddSphinxTarget.cmake 172 - index 22e3dcb776aa..ba77b9c195e2 100644 173 - --- a/cmake/modules/AddSphinxTarget.cmake 174 - +++ b/cmake/modules/AddSphinxTarget.cmake 175 - @@ -73,7 +73,7 @@ function (add_sphinx_target builder project) 176 - 177 - elseif (builder STREQUAL html) 178 - string(TOUPPER "${project}" project_upper) 179 - - set(${project_upper}_INSTALL_SPHINX_HTML_DIR "share/doc/${project}/html" 180 - + set(${project_upper}_INSTALL_SPHINX_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/html" 181 - CACHE STRING "HTML documentation install directory for ${project}") 182 - 183 - # '/.' indicates: copy the contents of the directory directly into 184 - diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt 185 - index 6c316a2f04fb..129c0995059c 100644 186 - --- a/cmake/modules/CMakeLists.txt 187 - +++ b/cmake/modules/CMakeLists.txt 188 - @@ -1,4 +1,4 @@ 189 - -set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm) 190 - +set(LLVM_INSTALL_PACKAGE_DIR ${LLVM_INSTALL_CMAKE_DIR} CACHE STRING "Path for CMake subdirectory (defaults to 'cmake/llvm')") 191 - set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}") 192 - 193 - # First for users who use an installed LLVM, create the LLVMExports.cmake file. 194 - @@ -90,11 +90,11 @@ foreach(p ${_count}) 195 - set(LLVM_CONFIG_CODE "${LLVM_CONFIG_CODE} 196 - get_filename_component(LLVM_INSTALL_PREFIX \"\${LLVM_INSTALL_PREFIX}\" PATH)") 197 - endforeach(p) 198 - -set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/include") 199 - -set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/lib\${LLVM_LIBDIR_SUFFIX}") 200 - +set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}") 201 - +set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\${LLVM_LIBDIR_SUFFIX}") 202 - set(LLVM_CONFIG_CMAKE_DIR "\${LLVM_INSTALL_PREFIX}/${LLVM_INSTALL_PACKAGE_DIR}") 203 - set(LLVM_CONFIG_BINARY_DIR "\${LLVM_INSTALL_PREFIX}") 204 - -set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/bin") 205 - +set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}") 206 - set(LLVM_CONFIG_EXPORTS_FILE "\${LLVM_CMAKE_DIR}/LLVMExports.cmake") 207 - set(LLVM_CONFIG_EXPORTS "${LLVM_EXPORTS}") 208 - configure_file( 209 - diff --git a/cmake/modules/LLVMInstallSymlink.cmake b/cmake/modules/LLVMInstallSymlink.cmake 210 - index 1a04de931ff7..1c5ea4200635 100644 211 - --- a/cmake/modules/LLVMInstallSymlink.cmake 212 - +++ b/cmake/modules/LLVMInstallSymlink.cmake 213 - @@ -10,7 +10,7 @@ function(install_symlink name target outdir) 214 - set(LINK_OR_COPY copy) 215 - endif() 216 - 217 - - set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}/") 218 - + set(bindir "${DESTDIR}${outdir}/") 219 - 220 - message("Creating ${name}") 221 - 222 - diff --git a/docs/CMake.rst b/docs/CMake.rst 223 - index cbcadc212498..a3da96546f43 100644 224 - --- a/docs/CMake.rst 225 - +++ b/docs/CMake.rst 226 - @@ -196,7 +196,7 @@ CMake manual, or execute ``cmake --help-variable VARIABLE_NAME``. 227 - **LLVM_LIBDIR_SUFFIX**:STRING 228 - Extra suffix to append to the directory where libraries are to be 229 - installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64`` 230 - - to install libraries to ``/usr/lib64``. 231 - + to install libraries to ``/usr/lib64``. See also ``CMAKE_INSTALL_LIBDIR``. 232 - 233 - **CMAKE_C_FLAGS**:STRING 234 - Extra flags to use when compiling C source files. 235 - @@ -473,8 +473,8 @@ LLVM-specific variables 236 - 237 - **LLVM_INSTALL_DOXYGEN_HTML_DIR**:STRING 238 - The path to install Doxygen-generated HTML documentation to. This path can 239 - - either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to 240 - - `share/doc/llvm/doxygen-html`. 241 - + either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to 242 - + `${CMAKE_INSTALL_DOCDIR}/${project}/doxygen-html`. 243 - 244 - **LLVM_ENABLE_SPHINX**:BOOL 245 - If specified, CMake will search for the ``sphinx-build`` executable and will make 246 - @@ -505,13 +505,33 @@ LLVM-specific variables 247 - 248 - **LLVM_INSTALL_SPHINX_HTML_DIR**:STRING 249 - The path to install Sphinx-generated HTML documentation to. This path can 250 - - either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to 251 - - `share/doc/llvm/html`. 252 - + either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to 253 - + `${CMAKE_INSTALL_DOCDIR}/${project}/html`. 254 - 255 - **LLVM_INSTALL_OCAMLDOC_HTML_DIR**:STRING 256 - The path to install OCamldoc-generated HTML documentation to. This path can 257 - - either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to 258 - - `share/doc/llvm/ocaml-html`. 259 - + either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to 260 - + `${CMAKE_INSTALL_DOCDIR}/${project}/ocaml-html`. 261 - + 262 - +**CMAKE_INSTALL_BINDIR**:STRING 263 - + The path to install binary tools, relative to the ``CMAKE_INSTALL_PREFIX``. 264 - + Defaults to `bin`. 265 - + 266 - +**CMAKE_INSTALL_LIBDIR**:STRING 267 - + The path to install libraries, relative to the ``CMAKE_INSTALL_PREFIX``. 268 - + Defaults to `lib`. 269 - + 270 - +**CMAKE_INSTALL_INCLUDEDIR**:STRING 271 - + The path to install header files, relative to the ``CMAKE_INSTALL_PREFIX``. 272 - + Defaults to `include`. 273 - + 274 - +**CMAKE_INSTALL_DOCDIR**:STRING 275 - + The path to install documentation, relative to the ``CMAKE_INSTALL_PREFIX``. 276 - + Defaults to `share/doc`. 277 - + 278 - +**CMAKE_INSTALL_MANDIR**:STRING 279 - + The path to install manpage files, relative to the ``CMAKE_INSTALL_PREFIX``. 280 - + Defaults to `share/man`. 281 - 282 - **LLVM_CREATE_XCODE_TOOLCHAIN**:BOOL 283 - OS X Only: If enabled CMake will generate a target named 284 - @@ -676,9 +696,11 @@ the ``cmake`` command or by setting it directly in ``ccmake`` or ``cmake-gui``). 285 - 286 - This file is available in two different locations. 287 - 288 - -* ``<INSTALL_PREFIX>/lib/cmake/llvm/LLVMConfig.cmake`` where 289 - - ``<INSTALL_PREFIX>`` is the install prefix of an installed version of LLVM. 290 - - On Linux typically this is ``/usr/lib/cmake/llvm/LLVMConfig.cmake``. 291 - +* ``<LLVM_INSTALL_PACKAGE_DIR>LLVMConfig.cmake`` where 292 - + ``<LLVM_INSTALL_PACKAGE_DIR>`` is the location where LLVM CMake modules are 293 - + installed as part of an installed version of LLVM. This is typically 294 - + ``cmake/llvm/`` within the lib directory. On Linux, this is typically 295 - + ``/usr/lib/cmake/llvm/LLVMConfig.cmake``. 296 - 297 - * ``<LLVM_BUILD_ROOT>/lib/cmake/llvm/LLVMConfig.cmake`` where 298 - ``<LLVM_BUILD_ROOT>`` is the root of the LLVM build tree. **Note: this is only 299 - diff --git a/include/llvm/CMakeLists.txt b/include/llvm/CMakeLists.txt 300 - index 1d5ca3ba92b0..026f5453c1da 100644 301 - --- a/include/llvm/CMakeLists.txt 302 - +++ b/include/llvm/CMakeLists.txt 303 - @@ -4,5 +4,5 @@ add_subdirectory(Support) 304 - # If we're doing an out-of-tree build, copy a module map for generated 305 - # header files into the build area. 306 - if (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") 307 - - configure_file(module.modulemap.build module.modulemap COPYONLY) 308 - + configure_file(module.modulemap.build ${LLVM_INCLUDE_DIR}/module.modulemap COPYONLY) 309 - endif (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") 310 - diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in 311 - index f201e1f7bff0..4582ed556a02 100644 312 - --- a/tools/llvm-config/BuildVariables.inc.in 313 - +++ b/tools/llvm-config/BuildVariables.inc.in 314 - @@ -24,6 +24,10 @@ 315 - #define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@" 316 - #define LLVM_BUILDMODE "@LLVM_BUILDMODE@" 317 - #define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@" 318 - +#define LLVM_INSTALL_BINDIR "@CMAKE_INSTALL_BINDIR@" 319 - +#define LLVM_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@" 320 - +#define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@" 321 - +#define LLVM_INSTALL_CMAKEDIR "@LLVM_INSTALL_CMAKE_DIR@" 322 - #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@" 323 - #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@" 324 - #define LLVM_BUILD_SYSTEM "@LLVM_BUILD_SYSTEM@" 325 - diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp 326 - index 892adc3b9dd8..cabe7fcc630f 100644 327 - --- a/tools/llvm-config/llvm-config.cpp 328 - +++ b/tools/llvm-config/llvm-config.cpp 329 - @@ -333,12 +333,26 @@ int main(int argc, char **argv) { 330 - ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include"); 331 - } else { 332 - ActivePrefix = CurrentExecPrefix; 333 - - ActiveIncludeDir = ActivePrefix + "/include"; 334 - - SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR)); 335 - - sys::fs::make_absolute(ActivePrefix, path); 336 - - ActiveBinDir = path.str(); 337 - - ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX; 338 - - ActiveCMakeDir = ActiveLibDir + "/cmake/llvm"; 339 - + { 340 - + SmallString<256> path(StringRef(LLVM_INSTALL_INCLUDEDIR)); 341 - + sys::fs::make_absolute(ActivePrefix, path); 342 - + ActiveIncludeDir = std::string(path.str()); 343 - + } 344 - + { 345 - + SmallString<256> path(StringRef(LLVM_INSTALL_BINDIR)); 346 - + sys::fs::make_absolute(ActivePrefix, path); 347 - + ActiveBinDir = std::string(path.str()); 348 - + } 349 - + { 350 - + SmallString<256> path(StringRef(LLVM_INSTALL_LIBDIR LLVM_LIBDIR_SUFFIX)); 351 - + sys::fs::make_absolute(ActivePrefix, path); 352 - + ActiveLibDir = std::string(path.str()); 353 - + } 354 - + { 355 - + SmallString<256> path(StringRef(LLVM_INSTALL_CMAKEDIR)); 356 - + sys::fs::make_absolute(ActivePrefix, path); 357 - + ActiveCMakeDir = std::string(path.str()); 358 - + } 359 - ActiveIncludeOption = "-I" + ActiveIncludeDir; 360 - } 361 - 362 - diff --git a/tools/lto/CMakeLists.txt b/tools/lto/CMakeLists.txt 363 - index 6e913519a809..85641eef721f 100644 364 - --- a/tools/lto/CMakeLists.txt 365 - +++ b/tools/lto/CMakeLists.txt 366 - @@ -19,7 +19,7 @@ set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/lto.exports) 367 - add_llvm_library(LTO SHARED ${SOURCES} DEPENDS intrinsics_gen) 368 - 369 - install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h 370 - - DESTINATION include/llvm-c 371 - + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm-c 372 - COMPONENT LTO) 373 - 374 - if (APPLE) 375 - diff --git a/tools/opt-viewer/CMakeLists.txt b/tools/opt-viewer/CMakeLists.txt 376 - index 19b606933082..27b9f71b3d79 100644 377 - --- a/tools/opt-viewer/CMakeLists.txt 378 - +++ b/tools/opt-viewer/CMakeLists.txt 379 - @@ -8,6 +8,6 @@ set (files 380 - 381 - foreach (file ${files}) 382 - install(PROGRAMS ${file} 383 - - DESTINATION share/opt-viewer 384 - + DESTINATION ${CMAKE_INSTALL_DATADIR}/opt-viewer 385 - COMPONENT opt-viewer) 386 - endforeach (file)
-37
pkgs/development/compilers/llvm/7/openmp/default.nix
··· 1 - { lib 2 - , stdenv 3 - , llvm_meta 4 - , fetch 5 - , cmake 6 - , llvm 7 - , targetLlvm 8 - , perl 9 - , version 10 - }: 11 - 12 - stdenv.mkDerivation { 13 - pname = "openmp"; 14 - inherit version; 15 - 16 - src = fetch "openmp" "1dg53wzsci2kra8lh1y0chh60h2l8h1by93br5spzvzlxshkmrqy"; 17 - 18 - nativeBuildInputs = [ cmake perl ]; 19 - buildInputs = [ 20 - (if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm) 21 - ]; 22 - 23 - meta = llvm_meta // { 24 - homepage = "https://openmp.llvm.org/"; 25 - description = "Support for the OpenMP language"; 26 - longDescription = '' 27 - The OpenMP subproject of LLVM contains the components required to build an 28 - executable OpenMP program that are outside the compiler itself. 29 - Contains the code for the runtime library against which code compiled by 30 - "clang -fopenmp" must be linked before it can run and the library that 31 - supports offload to target devices. 32 - ''; 33 - # "All of the code is dual licensed under the MIT license and the UIUC 34 - # License (a BSD-like license)": 35 - license = with lib.licenses; [ mit ncsa ]; 36 - }; 37 - }
-4
pkgs/test/default.nix
··· 63 63 64 64 # libcxxStdenv broken 65 65 # fix in https://github.com/NixOS/nixpkgs/pull/216273 66 - ] ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ 67 - # libcxx does not build for some reason on aarch64-linux 68 - (filterAttrs (n: _: n != "llvmPackages_7")) 69 66 ] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ 70 67 (filterAttrs (n: _: n != "llvmPackages_6")) 71 - (filterAttrs (n: _: n != "llvmPackages_7")) 72 68 (filterAttrs (n: _: n != "llvmPackages_8")) 73 69 (filterAttrs (n: _: n != "llvmPackages_9")) 74 70 (filterAttrs (n: _: n != "llvmPackages_10"))
+8 -1
pkgs/top-level/aliases.nix
··· 164 164 165 165 # these are for convenience, not for backward compat and shouldn't expire 166 166 clang6Stdenv = lowPrio llvmPackages_6.stdenv; 167 - clang7Stdenv = lowPrio llvmPackages_7.stdenv; 167 + clang7Stdenv = throw "clang7Stdenv has been removed from nixpkgs"; # Added 2023-11-19 168 168 clang8Stdenv = lowPrio llvmPackages_8.stdenv; 169 169 clang9Stdenv = lowPrio llvmPackages_9.stdenv; 170 170 clang10Stdenv = lowPrio llvmPackages_10.stdenv; ··· 174 174 clang14Stdenv = lowPrio llvmPackages_14.stdenv; 175 175 clang15Stdenv = lowPrio llvmPackages_15.stdenv; 176 176 clang16Stdenv = lowPrio llvmPackages_16.stdenv; 177 + 178 + clang-tools_7 = throw "clang-tools_7 has been removed from nixpkgs"; # Added 2023-11-19 179 + clang_7 = throw "clang_7 has been removed from nixpkgs"; # Added 2023-11-19 177 180 178 181 ### D ### 179 182 ··· 559 562 ''; 560 563 linux_latest_hardened = linuxPackages_latest_hardened; 561 564 565 + lld_7 = throw "lld_7 has been removed from nixpkgs"; # Added 2023-11-19 566 + lldb_7 = throw "lldb_7 has been removed from nixpkgs"; # Added 2023-11-19 567 + llvmPackages_7 = throw "llvmPackages_7 has been removed from nixpkgs"; # Added 2023-11-19 568 + llvm_7 = throw "llvm_7 has been removed from nixpkgs"; # Added 2023-11-19 562 569 563 570 lobster-two = google-fonts; # Added 2021-07-22 564 571 luxcorerender = throw "'luxcorerender' has been removed as it's unmaintained and broken in nixpkgs since a while ago"; # Added 2023-06-07
+1 -16
pkgs/top-level/all-packages.nix
··· 7236 7236 compass = callPackage ../development/tools/compass { }; 7237 7237 7238 7238 cone = callPackage ../development/compilers/cone { 7239 - llvmPackages = llvmPackages_7; 7239 + llvmPackages = llvmPackages_13; 7240 7240 }; 7241 7241 7242 7242 conda = callPackage ../tools/package-management/conda { }; ··· 15640 15640 15641 15641 clang = llvmPackages.clang; 15642 15642 clang_6 = llvmPackages_6.clang; 15643 - clang_7 = llvmPackages_7.clang; 15644 15643 clang_8 = llvmPackages_8.clang; 15645 15644 clang_9 = llvmPackages_9.clang; 15646 15645 clang_10 = llvmPackages_10.clang; ··· 15657 15656 15658 15657 clang-tools_6 = callPackage ../development/tools/clang-tools { 15659 15658 llvmPackages = llvmPackages_6; 15660 - }; 15661 - 15662 - clang-tools_7 = callPackage ../development/tools/clang-tools { 15663 - llvmPackages = llvmPackages_7; 15664 15659 }; 15665 15660 15666 15661 clang-tools_8 = callPackage ../development/tools/clang-tools { ··· 16592 16587 16593 16588 lld = llvmPackages.lld; 16594 16589 lld_6 = llvmPackages_6.lld; 16595 - lld_7 = llvmPackages_7.lld; 16596 16590 lld_8 = llvmPackages_8.lld; 16597 16591 lld_9 = llvmPackages_9.lld; 16598 16592 lld_10 = llvmPackages_10.lld; ··· 16605 16599 16606 16600 lldb = lldb_14; 16607 16601 lldb_6 = llvmPackages_6.lldb; 16608 - lldb_7 = llvmPackages_7.lldb; 16609 16602 lldb_8 = llvmPackages_8.lldb; 16610 16603 lldb_9 = llvmPackages_9.lldb; 16611 16604 lldb_10 = llvmPackages_10.lldb; ··· 16618 16611 16619 16612 llvm = llvmPackages.llvm; 16620 16613 llvm_6 = llvmPackages_6.llvm; 16621 - llvm_7 = llvmPackages_7.llvm; 16622 16614 llvm_8 = llvmPackages_8.llvm; 16623 16615 llvm_9 = llvmPackages_9.llvm; 16624 16616 llvm_10 = llvmPackages_10.llvm; ··· 16654 16646 buildLlvmTools = buildPackages.llvmPackages_6.tools; 16655 16647 targetLlvm = targetPackages.llvmPackages_6.llvm or llvmPackages_6.llvm; 16656 16648 targetLlvmLibraries = targetPackages.llvmPackages_6.libraries or llvmPackages_6.libraries; 16657 - }); 16658 - 16659 - llvmPackages_7 = recurseIntoAttrs (callPackage ../development/compilers/llvm/7 { 16660 - inherit (stdenvAdapters) overrideCC; 16661 - buildLlvmTools = buildPackages.llvmPackages_7.tools; 16662 - targetLlvm = targetPackages.llvmPackages_7.llvm or llvmPackages_7.llvm; 16663 - targetLlvmLibraries = targetPackages.llvmPackages_7.libraries or llvmPackages_7.libraries; 16664 16649 }); 16665 16650 16666 16651 llvmPackages_8 = recurseIntoAttrs (callPackage ../development/compilers/llvm/8 {