lol

Merge staging-next into staging

authored by

github-actions[bot] and committed by
GitHub
b18e90bf 1f74f987

+3073 -21
+18 -12
pkgs/applications/networking/instant-messengers/telegram/tdesktop/default.nix
··· 2 2 , pkg-config, cmake, ninja, python3, wrapGAppsHook, wrapQtAppsHook, removeReferencesTo 3 3 , qtbase, qtimageformats, gtk3, libsForQt5, enchant2, lz4, xxHash 4 4 , dee, ffmpeg, openalSoft, minizip, libopus, alsaLib, libpulseaudio, range-v3 5 - , tl-expected, hunspell, glibmm, webkitgtk 5 + , tl-expected, hunspell, glibmm, webkitgtk, libtgvoip 6 6 # Transitive dependencies: 7 7 , pcre, xorg, util-linux, libselinux, libsepol, epoxy 8 8 , at-spi2-core, libXtst, libthai, libdatrie 9 - , xdg-utils 9 + , xdg-utils, libsysprof-capture, libpsl, brotli 10 10 }: 11 11 12 12 with lib; ··· 20 20 21 21 let 22 22 tg_owt = callPackage ./tg_owt.nix {}; 23 - webviewPatch = fetchpatch { 24 - url = "https://raw.githubusercontent.com/archlinux/svntogit-community/013eff77a13b6c2629a04e07a4d09dbe60c8ca48/trunk/fix-webview-includes.patch"; 25 - sha256 = "0112zaysf3f02dd4bgqc5hwg66h1bfj8r4yjzb06sfi0pl9vl96l"; 26 - }; 27 - 28 23 in mkDerivation rec { 29 24 pname = "telegram-desktop"; 30 - version = "2.7.4"; 25 + version = "2.7.5"; 31 26 32 27 # Telegram-Desktop with submodules 33 28 src = fetchurl { 34 29 url = "https://github.com/telegramdesktop/tdesktop/releases/download/v${version}/tdesktop-${version}-full.tar.gz"; 35 - sha256 = "1cigqvxa8lp79y7sp2w2izmmikxaxzrq9bh5ns3cy16z985nyllp"; 30 + sha256 = "sha256-9GxBw5ii9Musjq7D3KMf/P5BA4h690EgXRbhynHwO98="; 36 31 }; 37 32 33 + patches = [ 34 + # fixes issue with ffmpeg>=4.4 crashes, hasn't been upstreamed yet 35 + (fetchpatch { 36 + url = "https://raw.githubusercontent.com/gentoo/gentoo/1c91884873968997be4b0c954169d04dc839f1db/net-im/telegram-desktop/files/tdesktop-2.7.4-voice-crash.patch"; 37 + sha256 = "sha256-inLXcP70yJlkkmdeXlc3HRL7Vt+Sf00LLJG33gwBKdY="; 38 + }) 39 + (fetchpatch { 40 + url = "https://raw.githubusercontent.com/gentoo/gentoo/1c91884873968997be4b0c954169d04dc839f1db/net-im/telegram-desktop/files/tdesktop-2.7.4-voice-ffmpeg44.patch"; 41 + sha256 = "sha256-p57LipNf7BDhVvNKRuicVqx0vU6IBL/Cvr5BAfLF4Hs="; 42 + }) 43 + ]; 44 + 38 45 postPatch = '' 39 46 substituteInPlace Telegram/lib_spellcheck/spellcheck/platform/linux/linux_enchant.cpp \ 40 47 --replace '"libenchant-2.so.2"' '"${enchant2}/lib/libenchant-2.so.2"' 41 48 substituteInPlace Telegram/CMakeLists.txt \ 42 49 --replace '"''${TDESKTOP_LAUNCHER_BASENAME}.appdata.xml"' '"''${TDESKTOP_LAUNCHER_BASENAME}.metainfo.xml"' 43 - patch -d Telegram/lib_webview -p1 < "${webviewPatch}" 44 50 ''; 45 51 46 52 # We want to run wrapProgram manually (with additional parameters) ··· 53 59 qtbase qtimageformats gtk3 libsForQt5.kwayland libsForQt5.libdbusmenu enchant2 lz4 xxHash 54 60 dee ffmpeg openalSoft minizip libopus alsaLib libpulseaudio range-v3 55 61 tl-expected hunspell glibmm webkitgtk 56 - tg_owt 62 + tg_owt libtgvoip 57 63 # Transitive dependencies: 58 64 pcre xorg.libpthreadstubs xorg.libXdmcp util-linux libselinux libsepol epoxy 59 - at-spi2-core libXtst libthai libdatrie 65 + at-spi2-core libXtst libthai libdatrie libsysprof-capture libpsl brotli 60 66 ]; 61 67 62 68 cmakeFlags = [
+3 -3
pkgs/applications/version-management/git-and-tools/gh/default.nix
··· 2 2 3 3 buildGoModule rec { 4 4 pname = "gh"; 5 - version = "1.10.3"; 5 + version = "1.11.0"; 6 6 7 7 src = fetchFromGitHub { 8 8 owner = "cli"; 9 9 repo = "cli"; 10 10 rev = "v${version}"; 11 - sha256 = "sha256-hwqnINygXycd9W6tPjXsRcGbdTyULGL31aRl5NUxGtc="; 11 + sha256 = "sha256-rUGhKiTB5uVMbW0HdOEvubGkWh1ARUXCnGR7ezmsT3g="; 12 12 }; 13 13 14 - vendorSha256 = "sha256-acFN/StOMu8RSN/wvJsf4vSnjsmRnkrjuDb9cDMnXRs="; 14 + vendorSha256 = "sha256-ndsjmY/UCFyegm8yP7BopYMh5eZ8/fftWfxW4r5los0="; 15 15 16 16 nativeBuildInputs = [ installShellFiles ]; 17 17
+29
pkgs/development/compilers/llvm/git/bintools/default.nix
··· 1 + { runCommand, stdenv, llvm, lld, version }: 2 + 3 + let 4 + prefix = 5 + if stdenv.hostPlatform != stdenv.targetPlatform 6 + then "${stdenv.targetPlatform.config}-" 7 + else ""; 8 + in runCommand "llvm-binutils-${version}" { preferLocalBuild = true; } '' 9 + mkdir -p $out/bin 10 + for prog in ${lld}/bin/*; do 11 + ln -s $prog $out/bin/${prefix}$(basename $prog) 12 + done 13 + for prog in ${llvm}/bin/*; do 14 + ln -sf $prog $out/bin/${prefix}$(basename $prog) 15 + done 16 + 17 + ln -s ${llvm}/bin/llvm-ar $out/bin/${prefix}ar 18 + ln -s ${llvm}/bin/llvm-as $out/bin/${prefix}as 19 + ln -s ${llvm}/bin/llvm-dwp $out/bin/${prefix}dwp 20 + ln -s ${llvm}/bin/llvm-nm $out/bin/${prefix}nm 21 + ln -s ${llvm}/bin/llvm-objcopy $out/bin/${prefix}objcopy 22 + ln -s ${llvm}/bin/llvm-objdump $out/bin/${prefix}objdump 23 + ln -s ${llvm}/bin/llvm-ranlib $out/bin/${prefix}ranlib 24 + ln -s ${llvm}/bin/llvm-readelf $out/bin/${prefix}readelf 25 + ln -s ${llvm}/bin/llvm-size $out/bin/${prefix}size 26 + ln -s ${llvm}/bin/llvm-strip $out/bin/${prefix}strip 27 + 28 + ln -s ${lld}/bin/lld $out/bin/${prefix}ld 29 + ''
+123
pkgs/development/compilers/llvm/git/clang/default.nix
··· 1 + { lib, stdenv, llvm_meta, src, cmake, libxml2, libllvm, version, python3 2 + , buildLlvmTools 3 + , fixDarwinDylibNames 4 + , enableManpages ? false 5 + }: 6 + 7 + let 8 + self = stdenv.mkDerivation ({ 9 + pname = "clang"; 10 + inherit version; 11 + 12 + inherit src; 13 + sourceRoot = "source/clang"; 14 + 15 + nativeBuildInputs = [ cmake python3 ] 16 + ++ lib.optional enableManpages python3.pkgs.sphinx 17 + ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; 18 + 19 + buildInputs = [ libxml2 libllvm ]; 20 + 21 + cmakeFlags = [ 22 + "-DCMAKE_CXX_FLAGS=-std=c++14" 23 + "-DCLANGD_BUILD_XPC=OFF" 24 + "-DLLVM_CONFIG_PATH=${libllvm.dev}/bin/llvm-config${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-native"}" 25 + ] ++ lib.optionals enableManpages [ 26 + "-DCLANG_INCLUDE_DOCS=ON" 27 + "-DLLVM_ENABLE_SPHINX=ON" 28 + "-DSPHINX_OUTPUT_MAN=ON" 29 + "-DSPHINX_OUTPUT_HTML=OFF" 30 + "-DSPHINX_WARNINGS_AS_ERRORS=OFF" 31 + ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ 32 + "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" 33 + "-DCLANG_TABLEGEN=${buildLlvmTools.libclang.dev}/bin/clang-tblgen" 34 + ]; 35 + 36 + patches = [ 37 + ./purity.patch 38 + # https://reviews.llvm.org/D51899 39 + ./gnu-install-dirs.patch 40 + ]; 41 + 42 + postPatch = '' 43 + sed -i -e 's/DriverArgs.hasArg(options::OPT_nostdlibinc)/true/' \ 44 + -e 's/Args.hasArg(options::OPT_nostdlibinc)/true/' \ 45 + lib/Driver/ToolChains/*.cpp 46 + 47 + # Patch for standalone doc building 48 + sed -i '1s,^,find_package(Sphinx REQUIRED)\n,' docs/CMakeLists.txt 49 + '' + lib.optionalString stdenv.hostPlatform.isMusl '' 50 + sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp 51 + ''; 52 + 53 + outputs = [ "out" "lib" "dev" "python" ]; 54 + 55 + # Clang expects to find LLVMgold in its own prefix 56 + postInstall = '' 57 + if [ -e ${libllvm.lib}/lib/LLVMgold.so ]; then 58 + ln -sv ${libllvm.lib}/lib/LLVMgold.so $lib/lib 59 + fi 60 + 61 + ln -sv $out/bin/clang $out/bin/cpp 62 + 63 + # Move libclang to 'lib' output 64 + moveToOutput "lib/libclang.*" "$lib" 65 + moveToOutput "lib/libclang-cpp.*" "$lib" 66 + substituteInPlace $out/lib/cmake/clang/ClangTargets-release.cmake \ 67 + --replace "\''${_IMPORT_PREFIX}/lib/libclang." "$lib/lib/libclang." \ 68 + --replace "\''${_IMPORT_PREFIX}/lib/libclang-cpp." "$lib/lib/libclang-cpp." 69 + 70 + mkdir -p $python/bin $python/share/clang/ 71 + mv $out/bin/{git-clang-format,scan-view} $python/bin 72 + if [ -e $out/bin/set-xcode-analyzer ]; then 73 + mv $out/bin/set-xcode-analyzer $python/bin 74 + fi 75 + mv $out/share/clang/*.py $python/share/clang 76 + rm $out/bin/c-index-test 77 + 78 + mkdir -p $dev/bin 79 + cp bin/clang-tblgen $dev/bin 80 + ''; 81 + 82 + passthru = { 83 + isClang = true; 84 + inherit libllvm; 85 + }; 86 + 87 + meta = llvm_meta // { 88 + homepage = "https://clang.llvm.org/"; 89 + description = "A C language family frontend for LLVM"; 90 + longDescription = '' 91 + The Clang project provides a language front-end and tooling 92 + infrastructure for languages in the C language family (C, C++, Objective 93 + C/C++, OpenCL, CUDA, and RenderScript) for the LLVM project. 94 + It aims to deliver amazingly fast compiles, extremely useful error and 95 + warning messages and to provide a platform for building great source 96 + level tools. The Clang Static Analyzer and clang-tidy are tools that 97 + automatically find bugs in your code, and are great examples of the sort 98 + of tools that can be built using the Clang frontend as a library to 99 + parse C/C++ code. 100 + ''; 101 + }; 102 + } // lib.optionalAttrs enableManpages { 103 + pname = "clang-manpages"; 104 + 105 + buildPhase = '' 106 + make docs-clang-man 107 + ''; 108 + 109 + installPhase = '' 110 + mkdir -p $out/share/man/man1 111 + # Manually install clang manpage 112 + cp docs/man/*.1 $out/share/man/man1/ 113 + ''; 114 + 115 + outputs = [ "out" ]; 116 + 117 + doCheck = false; 118 + 119 + meta = llvm_meta // { 120 + description = "man page for Clang ${version}"; 121 + }; 122 + }); 123 + in self
+235
pkgs/development/compilers/llvm/git/clang/gnu-install-dirs.patch
··· 1 + diff --git a/CMakeLists.txt b/CMakeLists.txt 2 + index 9e74014134a0..976e6a1757fd 100644 3 + --- a/CMakeLists.txt 4 + +++ b/CMakeLists.txt 5 + @@ -5,6 +5,8 @@ cmake_minimum_required(VERSION 3.13.4) 6 + if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) 7 + project(Clang) 8 + 9 + + include(GNUInstallDirs) 10 + + 11 + set(CMAKE_CXX_STANDARD 14 CACHE STRING "C++ standard to conform to") 12 + set(CMAKE_CXX_STANDARD_REQUIRED YES) 13 + set(CMAKE_CXX_EXTENSIONS NO) 14 + @@ -416,7 +418,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 + COMPONENT clang-headers 21 + FILES_MATCHING 22 + PATTERN "*.def" 23 + @@ -425,7 +427,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 + COMPONENT clang-headers 30 + FILES_MATCHING 31 + PATTERN "CMakeFiles" EXCLUDE 32 + @@ -445,7 +447,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) 33 + 34 + add_custom_target(bash-autocomplete DEPENDS utils/bash-autocomplete.sh) 35 + install(PROGRAMS utils/bash-autocomplete.sh 36 + - DESTINATION share/clang 37 + + DESTINATION ${CMAKE_INSTALL_DATADIR}/clang 38 + COMPONENT bash-autocomplete) 39 + if(NOT LLVM_ENABLE_IDE) 40 + add_llvm_install_targets(install-bash-autocomplete 41 + diff --git a/cmake/modules/AddClang.cmake b/cmake/modules/AddClang.cmake 42 + index 704278a0e93b..d25c8d325c71 100644 43 + --- a/cmake/modules/AddClang.cmake 44 + +++ b/cmake/modules/AddClang.cmake 45 + @@ -123,9 +123,9 @@ macro(add_clang_library name) 46 + install(TARGETS ${lib} 47 + COMPONENT ${lib} 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 (NOT LLVM_ENABLE_IDE) 57 + add_llvm_install_targets(install-${lib} 58 + @@ -170,7 +170,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 LLVM_ENABLE_IDE) 67 + @@ -185,7 +185,7 @@ 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 + 75 + function(clang_target_link_libraries target type) 76 + diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt 77 + index b2c0ce8dd4a0..19e5443d8c25 100644 78 + --- a/lib/Headers/CMakeLists.txt 79 + +++ b/lib/Headers/CMakeLists.txt 80 + @@ -215,7 +215,7 @@ set_target_properties(clang-resource-headers PROPERTIES 81 + FOLDER "Misc" 82 + RUNTIME_OUTPUT_DIRECTORY "${output_dir}") 83 + 84 + -set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) 85 + +set(header_install_dir ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) 86 + 87 + install( 88 + FILES ${files} ${generated_files} 89 + diff --git a/tools/c-index-test/CMakeLists.txt b/tools/c-index-test/CMakeLists.txt 90 + index ceef4b08637c..8efad5520ca4 100644 91 + --- a/tools/c-index-test/CMakeLists.txt 92 + +++ b/tools/c-index-test/CMakeLists.txt 93 + @@ -54,7 +54,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) 94 + set_property(TARGET c-index-test APPEND PROPERTY INSTALL_RPATH 95 + "@executable_path/../../lib") 96 + else() 97 + - set(INSTALL_DESTINATION bin) 98 + + set(INSTALL_DESTINATION ${CMAKE_INSTALL_BINDIR}) 99 + endif() 100 + 101 + install(TARGETS c-index-test 102 + diff --git a/tools/clang-format/CMakeLists.txt b/tools/clang-format/CMakeLists.txt 103 + index 35ecdb11253c..d77d75de0094 100644 104 + --- a/tools/clang-format/CMakeLists.txt 105 + +++ b/tools/clang-format/CMakeLists.txt 106 + @@ -21,20 +21,20 @@ if( LLVM_LIB_FUZZING_ENGINE OR LLVM_USE_SANITIZE_COVERAGE ) 107 + endif() 108 + 109 + install(PROGRAMS clang-format-bbedit.applescript 110 + - DESTINATION share/clang 111 + + DESTINATION ${CMAKE_INSTALL_DATADIR}/clang 112 + COMPONENT clang-format) 113 + install(PROGRAMS clang-format-diff.py 114 + - DESTINATION share/clang 115 + + DESTINATION ${CMAKE_INSTALL_DATADIR}/clang 116 + COMPONENT clang-format) 117 + install(PROGRAMS clang-format-sublime.py 118 + - DESTINATION share/clang 119 + + DESTINATION ${CMAKE_INSTALL_DATADIR}/clang 120 + COMPONENT clang-format) 121 + install(PROGRAMS clang-format.el 122 + - DESTINATION share/clang 123 + + DESTINATION ${CMAKE_INSTALL_DATADIR}/clang 124 + COMPONENT clang-format) 125 + install(PROGRAMS clang-format.py 126 + - DESTINATION share/clang 127 + + DESTINATION ${CMAKE_INSTALL_DATADIR}/clang 128 + COMPONENT clang-format) 129 + install(PROGRAMS git-clang-format 130 + - DESTINATION bin 131 + + DESTINATION ${CMAKE_INSTALL_BINDIR} 132 + COMPONENT clang-format) 133 + diff --git a/tools/clang-rename/CMakeLists.txt b/tools/clang-rename/CMakeLists.txt 134 + index cda8e29ec5b1..0134d8ccd70b 100644 135 + --- a/tools/clang-rename/CMakeLists.txt 136 + +++ b/tools/clang-rename/CMakeLists.txt 137 + @@ -19,8 +19,8 @@ clang_target_link_libraries(clang-rename 138 + ) 139 + 140 + install(PROGRAMS clang-rename.py 141 + - DESTINATION share/clang 142 + + DESTINATION ${CMAKE_INSTALL_DATADIR}/clang 143 + COMPONENT clang-rename) 144 + install(PROGRAMS clang-rename.el 145 + - DESTINATION share/clang 146 + + DESTINATION ${CMAKE_INSTALL_DATADIR}/clang 147 + COMPONENT clang-rename) 148 + diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt 149 + index 51ff2e7e1565..1ed5f8a079a1 100644 150 + --- a/tools/libclang/CMakeLists.txt 151 + +++ b/tools/libclang/CMakeLists.txt 152 + @@ -166,7 +166,7 @@ endif() 153 + if(INTERNAL_INSTALL_PREFIX) 154 + set(LIBCLANG_HEADERS_INSTALL_DESTINATION "${INTERNAL_INSTALL_PREFIX}/include") 155 + else() 156 + - set(LIBCLANG_HEADERS_INSTALL_DESTINATION include) 157 + + set(LIBCLANG_HEADERS_INSTALL_DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) 158 + endif() 159 + 160 + install(DIRECTORY ../../include/clang-c 161 + @@ -196,7 +196,7 @@ foreach(PythonVersion ${CLANG_PYTHON_BINDINGS_VERSIONS}) 162 + COMPONENT 163 + libclang-python-bindings 164 + DESTINATION 165 + - "lib${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages") 166 + + "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages") 167 + endforeach() 168 + if(NOT LLVM_ENABLE_IDE) 169 + add_custom_target(libclang-python-bindings) 170 + diff --git a/tools/scan-build/CMakeLists.txt b/tools/scan-build/CMakeLists.txt 171 + index ec0702d76f18..d25d982f51da 100644 172 + --- a/tools/scan-build/CMakeLists.txt 173 + +++ b/tools/scan-build/CMakeLists.txt 174 + @@ -47,7 +47,7 @@ if(CLANG_INSTALL_SCANBUILD) 175 + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile}) 176 + list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile}) 177 + install(PROGRAMS bin/${BinFile} 178 + - DESTINATION bin 179 + + DESTINATION ${CMAKE_INSTALL_BINDIR} 180 + COMPONENT scan-build) 181 + endforeach() 182 + 183 + @@ -61,7 +61,7 @@ if(CLANG_INSTALL_SCANBUILD) 184 + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/libexec/${LibexecFile}) 185 + list(APPEND Depends ${CMAKE_BINARY_DIR}/libexec/${LibexecFile}) 186 + install(PROGRAMS libexec/${LibexecFile} 187 + - DESTINATION libexec 188 + + DESTINATION ${CMAKE_INSTALL_LIBEXECDIR} 189 + COMPONENT scan-build) 190 + endforeach() 191 + 192 + @@ -89,7 +89,7 @@ if(CLANG_INSTALL_SCANBUILD) 193 + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/share/scan-build/${ShareFile}) 194 + list(APPEND Depends ${CMAKE_BINARY_DIR}/share/scan-build/${ShareFile}) 195 + install(FILES share/scan-build/${ShareFile} 196 + - DESTINATION share/scan-build 197 + + DESTINATION ${CMAKE_INSTALL_DATADIR}/scan-build 198 + COMPONENT scan-build) 199 + endforeach() 200 + 201 + diff --git a/tools/scan-view/CMakeLists.txt b/tools/scan-view/CMakeLists.txt 202 + index dd3d33439299..fea19c12ce70 100644 203 + --- a/tools/scan-view/CMakeLists.txt 204 + +++ b/tools/scan-view/CMakeLists.txt 205 + @@ -19,7 +19,7 @@ if(CLANG_INSTALL_SCANVIEW) 206 + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile}) 207 + list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile}) 208 + install(PROGRAMS bin/${BinFile} 209 + - DESTINATION bin 210 + + DESTINATION ${CMAKE_INSTALL_BINDIR} 211 + COMPONENT scan-view) 212 + endforeach() 213 + 214 + @@ -33,7 +33,7 @@ if(CLANG_INSTALL_SCANVIEW) 215 + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/share/${ShareFile}) 216 + list(APPEND Depends ${CMAKE_BINARY_DIR}/share/scan-view/${ShareFile}) 217 + install(FILES share/${ShareFile} 218 + - DESTINATION share/scan-view 219 + + DESTINATION ${CMAKE_INSTALL_DATADIR}/scan-view 220 + COMPONENT scan-view) 221 + endforeach() 222 + 223 + diff --git a/utils/hmaptool/CMakeLists.txt b/utils/hmaptool/CMakeLists.txt 224 + index 62f2de0cb15c..6aa66825b6ec 100644 225 + --- a/utils/hmaptool/CMakeLists.txt 226 + +++ b/utils/hmaptool/CMakeLists.txt 227 + @@ -10,7 +10,7 @@ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/${CLANG_HM 228 + 229 + list(APPEND Depends ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/${CLANG_HMAPTOOL}) 230 + install(PROGRAMS ${CLANG_HMAPTOOL} 231 + - DESTINATION bin 232 + + DESTINATION ${CMAKE_INSTALL_BINDIR} 233 + COMPONENT hmaptool) 234 + 235 + add_custom_target(hmaptool ALL DEPENDS ${Depends})
+28
pkgs/development/compilers/llvm/git/clang/purity.patch
··· 1 + From 4add81bba40dcec62c4ea4481be8e35ac53e89d8 Mon Sep 17 00:00:00 2001 2 + From: Will Dietz <w@wdtz.org> 3 + Date: Thu, 18 May 2017 11:56:12 -0500 4 + Subject: [PATCH] "purity" patch for 5.0 5 + 6 + --- 7 + lib/Driver/ToolChains/Gnu.cpp | 7 ------- 8 + 1 file changed, 7 deletions(-) 9 + 10 + diff --git a/lib/Driver/ToolChains/Gnu.cpp b/lib/Driver/ToolChains/Gnu.cpp 11 + index fe3c0191bb..c6a482bece 100644 12 + --- a/lib/Driver/ToolChains/Gnu.cpp 13 + +++ b/lib/Driver/ToolChains/Gnu.cpp 14 + @@ -487,12 +487,6 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, 15 + if (!IsStatic) { 16 + if (Args.hasArg(options::OPT_rdynamic)) 17 + CmdArgs.push_back("-export-dynamic"); 18 + - 19 + - if (!Args.hasArg(options::OPT_shared) && !IsStaticPIE) { 20 + - CmdArgs.push_back("-dynamic-linker"); 21 + - CmdArgs.push_back(Args.MakeArgString(Twine(D.DyldPrefix) + 22 + - ToolChain.getDynamicLinker(Args))); 23 + - } 24 + } 25 + 26 + CmdArgs.push_back("-o"); 27 + -- 28 + 2.11.0
+23
pkgs/development/compilers/llvm/git/compiler-rt/X86-support-extension.patch
··· 1 + diff --git a/lib/builtins/CMakeLists.txt b/lib/builtins/CMakeLists.txt 2 + index 3a66dd9c3fb..7efc85d9f9f 100644 3 + --- a/lib/builtins/CMakeLists.txt 4 + +++ b/lib/builtins/CMakeLists.txt 5 + @@ -301,6 +301,10 @@ if (NOT MSVC) 6 + i386/umoddi3.S 7 + ) 8 + 9 + + set(i486_SOURCES ${i386_SOURCES}) 10 + + set(i586_SOURCES ${i386_SOURCES}) 11 + + set(i686_SOURCES ${i386_SOURCES}) 12 + + 13 + if (WIN32) 14 + set(i386_SOURCES 15 + ${i386_SOURCES} 16 + @@ -608,6 +612,7 @@ else () 17 + endif() 18 + 19 + foreach (arch ${BUILTIN_SUPPORTED_ARCH}) 20 + + message("arch: ${arch}") 21 + if (CAN_TARGET_${arch}) 22 + # For ARM archs, exclude any VFP builtins if VFP is not supported 23 + if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7m|armv7em)$")
+32
pkgs/development/compilers/llvm/git/compiler-rt/armv7l.patch
··· 1 + diff -ur compiler-rt-10.0.0.src/cmake/builtin-config-ix.cmake compiler-rt-10.0.0.src-patched/cmake/builtin-config-ix.cmake 2 + --- compiler-rt-10.0.0.src/cmake/builtin-config-ix.cmake 2020-03-24 00:01:02.000000000 +0900 3 + +++ compiler-rt-10.0.0.src-patched/cmake/builtin-config-ix.cmake 2020-05-10 03:42:00.883450706 +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-10.0.0.src/lib/builtins/CMakeLists.txt compiler-rt-10.0.0.src-patched/lib/builtins/CMakeLists.txt 14 + --- compiler-rt-10.0.0.src/lib/builtins/CMakeLists.txt 2020-03-24 00:01:02.000000000 +0900 15 + +++ compiler-rt-10.0.0.src-patched/lib/builtins/CMakeLists.txt 2020-05-10 03:44:49.468579650 +0900 16 + @@ -474,6 +474,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 + @@ -595,7 +596,7 @@ 25 + foreach (arch ${BUILTIN_SUPPORTED_ARCH}) 26 + if (CAN_TARGET_${arch}) 27 + # For ARM archs, exclude any VFP builtins if VFP is not supported 28 + - if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7m|armv7em)$") 29 + + if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7l|armv7m|armv7em)$") 30 + string(REPLACE ";" " " _TARGET_${arch}_CFLAGS "${TARGET_${arch}_CFLAGS}") 31 + check_compile_definition(__VFP_FP__ "${CMAKE_C_FLAGS} ${_TARGET_${arch}_CFLAGS}" COMPILER_RT_HAS_${arch}_VFP) 32 + if(NOT COMPILER_RT_HAS_${arch}_VFP)
+33
pkgs/development/compilers/llvm/git/compiler-rt/codesign.patch
··· 1 + From 3dec5f3475a26aeb4678627795c4b67c6b7b4785 Mon Sep 17 00:00:00 2001 2 + From: Will Dietz <w@wdtz.org> 3 + Date: Tue, 19 Sep 2017 13:13:06 -0500 4 + Subject: [PATCH] remove codesign use on Apple, disable ios sim testing that 5 + needs it 6 + 7 + --- 8 + cmake/Modules/AddCompilerRT.cmake | 8 ------ 9 + test/asan/CMakeLists.txt | 52 --------------------------------------- 10 + test/tsan/CMakeLists.txt | 47 ----------------------------------- 11 + 3 files changed, 107 deletions(-) 12 + 13 + diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake 14 + index bc5fb9ff7..b64eb4246 100644 15 + --- a/cmake/Modules/AddCompilerRT.cmake 16 + +++ b/cmake/Modules/AddCompilerRT.cmake 17 + @@ -210,14 +210,6 @@ function(add_compiler_rt_runtime name type) 18 + set_target_properties(${libname} PROPERTIES IMPORT_PREFIX "") 19 + set_target_properties(${libname} PROPERTIES IMPORT_SUFFIX ".lib") 20 + endif() 21 + - if(APPLE) 22 + - # Ad-hoc sign the dylibs 23 + - add_custom_command(TARGET ${libname} 24 + - POST_BUILD 25 + - COMMAND codesign --sign - $<TARGET_FILE:${libname}> 26 + - WORKING_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR} 27 + - ) 28 + - endif() 29 + endif() 30 + install(TARGETS ${libname} 31 + ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR} 32 + 2.14.1 33 +
+113
pkgs/development/compilers/llvm/git/compiler-rt/default.nix
··· 1 + { lib, stdenv, llvm_meta, version, src, cmake, python3, llvm, libcxxabi }: 2 + 3 + let 4 + 5 + useLLVM = stdenv.hostPlatform.useLLVM or false; 6 + bareMetal = stdenv.hostPlatform.parsed.kernel.name == "none"; 7 + haveLibc = stdenv.cc.libc != null; 8 + inherit (stdenv.hostPlatform) isMusl; 9 + 10 + in 11 + 12 + stdenv.mkDerivation { 13 + pname = "compiler-rt" + lib.optionalString (haveLibc) "-libc"; 14 + inherit version; 15 + 16 + inherit src; 17 + sourceRoot = "source/compiler-rt"; 18 + 19 + nativeBuildInputs = [ cmake python3 llvm.dev ]; 20 + buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi; 21 + 22 + NIX_CFLAGS_COMPILE = [ 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 + "-DCOMPILER_RT_BUILD_PROFILE=OFF" 35 + ] ++ lib.optionals ((useLLVM || bareMetal) && !haveLibc) [ 36 + "-DCMAKE_C_COMPILER_WORKS=ON" 37 + "-DCMAKE_CXX_COMPILER_WORKS=ON" 38 + "-DCOMPILER_RT_BAREMETAL_BUILD=ON" 39 + "-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}" 40 + ] ++ lib.optionals (useLLVM && !haveLibc) [ 41 + "-DCMAKE_C_FLAGS=-nodefaultlibs" 42 + ] ++ lib.optionals (useLLVM) [ 43 + "-DCOMPILER_RT_BUILD_BUILTINS=ON" 44 + #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program 45 + "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY" 46 + ] ++ lib.optionals (bareMetal) [ 47 + "-DCOMPILER_RT_OS_DIR=baremetal" 48 + ] ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ 49 + "-DDARWIN_macosx_OVERRIDE_SDK_VERSION=ON" 50 + "-DDARWIN_osx_ARCHS=${stdenv.hostPlatform.darwinArch}" 51 + "-DDARWIN_osx_BUILTIN_ARCHS=${stdenv.hostPlatform.darwinArch}" 52 + ]; 53 + 54 + outputs = [ "out" "dev" ]; 55 + 56 + patches = [ 57 + ./codesign.patch # Revert compiler-rt commit that makes codesign mandatory 58 + ./X86-support-extension.patch # Add support for i486 i586 i686 by reusing i386 config 59 + ./gnu-install-dirs.patch 60 + # ld-wrapper dislikes `-rpath-link //nix/store`, so we normalize away the 61 + # extra `/`. 62 + ./normalize-var.patch 63 + ]# ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch 64 + ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch; 65 + 66 + # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks 67 + # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra 68 + # can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd 69 + # get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by 70 + # a flag and turn the flag off during the stdenv build. 71 + postPatch = lib.optionalString (!stdenv.isDarwin) '' 72 + substituteInPlace cmake/builtin-config-ix.cmake \ 73 + --replace 'set(X86 i386)' 'set(X86 i386 i486 i586 i686)' 74 + '' + lib.optionalString stdenv.isDarwin '' 75 + substituteInPlace cmake/builtin-config-ix.cmake \ 76 + --replace 'set(ARM64 arm64 arm64e)' 'set(ARM64)' 77 + substituteInPlace cmake/config-ix.cmake \ 78 + --replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)' 79 + '' + lib.optionalString (useLLVM) '' 80 + substituteInPlace lib/builtins/int_util.c \ 81 + --replace "#include <stdlib.h>" "" 82 + substituteInPlace lib/builtins/clear_cache.c \ 83 + --replace "#include <assert.h>" "" 84 + substituteInPlace lib/builtins/cpu_model.c \ 85 + --replace "#include <assert.h>" "" 86 + ''; 87 + 88 + # Hack around weird upsream RPATH bug 89 + postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) '' 90 + ln -s "$out/lib"/*/* "$out/lib" 91 + '' + lib.optionalString (useLLVM) '' 92 + ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbegin.o 93 + ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtend.o 94 + ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o 95 + ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o 96 + ''; 97 + 98 + meta = llvm_meta // { 99 + homepage = "https://compiler-rt.llvm.org/"; 100 + description = "Compiler runtime libraries"; 101 + longDescription = '' 102 + The compiler-rt project provides highly tuned implementations of the 103 + low-level code generator support routines like "__fixunsdfdi" and other 104 + calls generated when a target doesn't have a short sequence of native 105 + instructions to implement a core IR operation. It also provides 106 + implementations of run-time libraries for dynamic testing tools such as 107 + AddressSanitizer, ThreadSanitizer, MemorySanitizer, and DataFlowSanitizer. 108 + ''; 109 + # "All of the code in the compiler-rt project is dual licensed under the MIT 110 + # license and the UIUC License (a BSD-like license)": 111 + license = with lib.licenses; [ mit ncsa ]; 112 + }; 113 + }
+129
pkgs/development/compilers/llvm/git/compiler-rt/gnu-install-dirs.patch
··· 1 + diff --git a/CMakeLists.txt b/CMakeLists.txt 2 + index b44ad2c2118e..d42f5664d448 100644 3 + --- a/CMakeLists.txt 4 + +++ b/CMakeLists.txt 5 + @@ -8,6 +8,7 @@ cmake_minimum_required(VERSION 3.13.4) 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 361538a58e47..f0d8d9ab80f1 100644 15 + --- a/cmake/Modules/AddCompilerRT.cmake 16 + +++ b/cmake/Modules/AddCompilerRT.cmake 17 + @@ -495,7 +495,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 + @@ -512,7 +512,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 456a8dcda59f..7a09e74c7c79 100644 37 + --- a/cmake/Modules/CompilerRTDarwinUtils.cmake 38 + +++ b/cmake/Modules/CompilerRTDarwinUtils.cmake 39 + @@ -508,7 +508,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 f61d487e93a0..f1f46fb9599c 100644 50 + --- a/cmake/Modules/CompilerRTUtils.cmake 51 + +++ b/cmake/Modules/CompilerRTUtils.cmake 52 + @@ -378,7 +378,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}/lib/${target} PARENT_SCOPE) 57 + + set(${install_dir} ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_LIBDIR}/${target} 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 1edab43e7c0d..1aac6b73ff82 100644 63 + --- a/cmake/base-config-ix.cmake 64 + +++ b/cmake/base-config-ix.cmake 65 + @@ -65,11 +65,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 + @@ -97,7 +97,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 b00e8caa1ddd..0fe64e4862c9 100644 91 + --- a/include/CMakeLists.txt 92 + +++ b/include/CMakeLists.txt 93 + @@ -69,22 +69,22 @@ 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 fuzzer headers. 100 + install(FILES ${FUZZER_HEADERS} 101 + COMPONENT compiler-rt-headers 102 + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ 103 + - DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/fuzzer) 104 + + DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/fuzzer) 105 + # Install xray headers. 106 + install(FILES ${XRAY_HEADERS} 107 + COMPONENT compiler-rt-headers 108 + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ 109 + - DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/xray) 110 + + DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/xray) 111 + # Install profile headers. 112 + install(FILES ${PROFILE_HEADERS} 113 + COMPONENT compiler-rt-headers 114 + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ 115 + - DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/profile) 116 + + DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/profile) 117 + 118 + if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDEs. 119 + add_custom_target(install-compiler-rt-headers 120 + diff --git a/lib/dfsan/CMakeLists.txt b/lib/dfsan/CMakeLists.txt 121 + index a29de8deff1b..d39ff01613d2 100644 122 + --- a/lib/dfsan/CMakeLists.txt 123 + +++ b/lib/dfsan/CMakeLists.txt 124 + @@ -57,4 +57,4 @@ add_custom_command(OUTPUT ${dfsan_abilist_filename} 125 + DEPENDS done_abilist.txt libc_ubuntu1404_abilist.txt) 126 + add_dependencies(dfsan dfsan_abilist) 127 + install(FILES ${dfsan_abilist_filename} 128 + - DESTINATION ${COMPILER_RT_INSTALL_PATH}/share) 129 + + DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_DATADIR})
+16
pkgs/development/compilers/llvm/git/compiler-rt/normalize-var.patch
··· 1 + diff --git a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake 2 + index f1f46fb9599c..6f19e69507ba 100644 3 + --- a/cmake/Modules/CompilerRTUtils.cmake 4 + +++ b/cmake/Modules/CompilerRTUtils.cmake 5 + @@ -302,8 +302,9 @@ macro(load_llvm_config) 6 + # Get some LLVM variables from LLVMConfig. 7 + include("${LLVM_CMAKE_PATH}/LLVMConfig.cmake") 8 + 9 + - set(LLVM_LIBRARY_OUTPUT_INTDIR 10 + - ${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) 11 + + get_filename_component(LLVM_LIBRARY_OUTPUT_INTDIR 12 + + ${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX} 13 + + REALPATH) 14 + endif() 15 + endmacro() 16 +
+412
pkgs/development/compilers/llvm/git/compiler-rt/sanitizers-nongnu.patch
··· 1 + From f7a253f8f85d0f49df6b73996737a3e84ac64236 Mon Sep 17 00:00:00 2001 2 + From: Will Dietz <w@wdtz.org> 3 + Date: Mon, 24 Sep 2018 11:17:25 -0500 4 + Subject: [PATCH] Ported to 7.0, taken from gentoo-musl project. 5 + 6 + ------ 7 + Ported to compiler-rt-sanitizers-5.0.0. Taken from 8 + 9 + https://gist.githubusercontent.com/pwaller/2337f3290f12634cad3e3730cff0a6c1/raw/83c87a8585e2f9662494db5662e5361beb093c26/nongnu.patch 10 + Signed-off-by: Jory A. Pratt <anarchy@gentoo.org> 11 + 12 + Taken from gentoo-musl project, with a few additional minor fixes. 13 + --- 14 + lib/asan/asan_linux.cc | 4 +- 15 + lib/interception/interception_linux.cc | 2 +- 16 + lib/interception/interception_linux.h | 2 +- 17 + lib/msan/msan_linux.cc | 2 +- 18 + lib/sanitizer_common/sanitizer_allocator.cc | 2 +- 19 + .../sanitizer_common_interceptors_ioctl.inc | 4 +- 20 + .../sanitizer_common_syscalls.inc | 2 +- 21 + lib/sanitizer_common/sanitizer_linux.cc | 8 +++- 22 + .../sanitizer_linux_libcdep.cc | 10 ++--- 23 + lib/sanitizer_common/sanitizer_platform.h | 6 +++ 24 + .../sanitizer_platform_interceptors.h | 4 +- 25 + .../sanitizer_platform_limits_posix.cc | 37 +++++++++++-------- 26 + lib/tsan/rtl/tsan_platform_linux.cc | 2 +- 27 + 13 files changed, 51 insertions(+), 34 deletions(-) 28 + 29 + diff --git a/lib/asan/asan_linux.cc b/lib/asan/asan_linux.cc 30 + index 625f32d40..73cf77aca 100644 31 + --- a/lib/asan/asan_linux.cc 32 + +++ b/lib/asan/asan_linux.cc 33 + @@ -46,7 +46,7 @@ 34 + #include <link.h> 35 + #endif 36 + 37 + -#if SANITIZER_ANDROID || SANITIZER_FREEBSD || SANITIZER_SOLARIS 38 + +#if SANITIZER_ANDROID || SANITIZER_FREEBSD || SANITIZER_SOLARIS || SANITIZER_NONGNU 39 + #include <ucontext.h> 40 + extern "C" void* _DYNAMIC; 41 + #elif SANITIZER_NETBSD 42 + @@ -139,7 +139,7 @@ void AsanApplyToGlobals(globals_op_fptr op, const void *needle) { 43 + UNIMPLEMENTED(); 44 + } 45 + 46 + -#if SANITIZER_ANDROID 47 + +#if SANITIZER_ANDROID || SANITIZER_NONGNU 48 + // FIXME: should we do anything for Android? 49 + void AsanCheckDynamicRTPrereqs() {} 50 + void AsanCheckIncompatibleRT() {} 51 + diff --git a/lib/interception/interception_linux.cc b/lib/interception/interception_linux.cc 52 + index 26bfcd8f6..529b234f7 100644 53 + --- a/lib/interception/interception_linux.cc 54 + +++ b/lib/interception/interception_linux.cc 55 + @@ -43,7 +43,7 @@ bool GetRealFunctionAddress(const char *func_name, uptr *func_addr, 56 + } 57 + 58 + // Android and Solaris do not have dlvsym 59 + -#if !SANITIZER_ANDROID && !SANITIZER_SOLARIS && !SANITIZER_OPENBSD 60 + +#if !SANITIZER_ANDROID && !SANITIZER_SOLARIS && !SANITIZER_OPENBSD && !SANITIZER_NONGNU 61 + void *GetFuncAddrVer(const char *func_name, const char *ver) { 62 + return dlvsym(RTLD_NEXT, func_name, ver); 63 + } 64 + diff --git a/lib/interception/interception_linux.h b/lib/interception/interception_linux.h 65 + index 942c25609..24a4d5080 100644 66 + --- a/lib/interception/interception_linux.h 67 + +++ b/lib/interception/interception_linux.h 68 + @@ -36,7 +36,7 @@ void *GetFuncAddrVer(const char *func_name, const char *ver); 69 + (::__interception::uptr) & WRAP(func)) 70 + 71 + // Android, Solaris and OpenBSD do not have dlvsym 72 + -#if !SANITIZER_ANDROID && !SANITIZER_SOLARIS && !SANITIZER_OPENBSD 73 + +#if !SANITIZER_ANDROID && !SANITIZER_SOLARIS && !SANITIZER_OPENBSD && !SANITIZER_NONGNU 74 + #define INTERCEPT_FUNCTION_VER_LINUX_OR_FREEBSD(func, symver) \ 75 + (::__interception::real_##func = (func##_f)( \ 76 + unsigned long)::__interception::GetFuncAddrVer(#func, symver)) 77 + diff --git a/lib/msan/msan_linux.cc b/lib/msan/msan_linux.cc 78 + index 385a650c4..6e30a8ce9 100644 79 + --- a/lib/msan/msan_linux.cc 80 + +++ b/lib/msan/msan_linux.cc 81 + @@ -13,7 +13,7 @@ 82 + //===----------------------------------------------------------------------===// 83 + 84 + #include "sanitizer_common/sanitizer_platform.h" 85 + -#if SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD 86 + +#if SANITIZER_FREEBSD || (SANITIZER_LINUX && !SANITIZER_NONGNU) || SANITIZER_NETBSD 87 + 88 + #include "msan.h" 89 + #include "msan_report.h" 90 + diff --git a/lib/sanitizer_common/sanitizer_allocator.cc b/lib/sanitizer_common/sanitizer_allocator.cc 91 + index 6bfd5e5ee..048f6154f 100644 92 + --- a/lib/sanitizer_common/sanitizer_allocator.cc 93 + +++ b/lib/sanitizer_common/sanitizer_allocator.cc 94 + @@ -27,7 +27,7 @@ const char *SecondaryAllocatorName = "LargeMmapAllocator"; 95 + 96 + // ThreadSanitizer for Go uses libc malloc/free. 97 + #if SANITIZER_GO || defined(SANITIZER_USE_MALLOC) 98 + -# if SANITIZER_LINUX && !SANITIZER_ANDROID 99 + +# if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU 100 + extern "C" void *__libc_malloc(uptr size); 101 + # if !SANITIZER_GO 102 + extern "C" void *__libc_memalign(uptr alignment, uptr size); 103 + diff --git a/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc b/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc 104 + index 2d633c173..b6eb23116 100644 105 + --- a/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc 106 + +++ b/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc 107 + @@ -104,7 +104,7 @@ static void ioctl_table_fill() { 108 + _(SIOCGETVIFCNT, WRITE, struct_sioc_vif_req_sz); 109 + #endif 110 + 111 + -#if SANITIZER_LINUX 112 + +#if SANITIZER_LINUX && !SANITIZER_NONGNU 113 + // Conflicting request ids. 114 + // _(CDROMAUDIOBUFSIZ, NONE, 0); 115 + // _(SNDCTL_TMR_CONTINUE, NONE, 0); 116 + @@ -365,7 +365,7 @@ static void ioctl_table_fill() { 117 + _(VT_WAITACTIVE, NONE, 0); 118 + #endif 119 + 120 + -#if SANITIZER_LINUX && !SANITIZER_ANDROID 121 + +#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU 122 + // _(SIOCDEVPLIP, WRITE, struct_ifreq_sz); // the same as EQL_ENSLAVE 123 + _(CYGETDEFTHRESH, WRITE, sizeof(int)); 124 + _(CYGETDEFTIMEOUT, WRITE, sizeof(int)); 125 + diff --git a/lib/sanitizer_common/sanitizer_common_syscalls.inc b/lib/sanitizer_common/sanitizer_common_syscalls.inc 126 + index 469c8eb7e..24f87867d 100644 127 + --- a/lib/sanitizer_common/sanitizer_common_syscalls.inc 128 + +++ b/lib/sanitizer_common/sanitizer_common_syscalls.inc 129 + @@ -2038,7 +2038,7 @@ POST_SYSCALL(setrlimit)(long res, long resource, void *rlim) { 130 + } 131 + } 132 + 133 + -#if !SANITIZER_ANDROID 134 + +#if !SANITIZER_ANDROID && !SANITIZER_NONGNU 135 + PRE_SYSCALL(prlimit64)(long pid, long resource, const void *new_rlim, 136 + void *old_rlim) { 137 + if (new_rlim) PRE_READ(new_rlim, struct_rlimit64_sz); 138 + diff --git a/lib/sanitizer_common/sanitizer_linux.cc b/lib/sanitizer_common/sanitizer_linux.cc 139 + index 96d6c1eff..9e2b7fb9d 100644 140 + --- a/lib/sanitizer_common/sanitizer_linux.cc 141 + +++ b/lib/sanitizer_common/sanitizer_linux.cc 142 + @@ -541,13 +541,13 @@ const char *GetEnv(const char *name) { 143 + #endif 144 + } 145 + 146 + -#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD && !SANITIZER_OPENBSD 147 + +#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD && !SANITIZER_OPENBSD && !SANITIZER_NONGNU 148 + extern "C" { 149 + SANITIZER_WEAK_ATTRIBUTE extern void *__libc_stack_end; 150 + } 151 + #endif 152 + 153 + -#if !SANITIZER_GO && !SANITIZER_FREEBSD && !SANITIZER_NETBSD && \ 154 + +#if (!SANITIZER_GO || SANITIZER_NONGNU) && !SANITIZER_FREEBSD && !SANITIZER_NETBSD && \ 155 + !SANITIZER_OPENBSD 156 + static void ReadNullSepFileToArray(const char *path, char ***arr, 157 + int arr_size) { 158 + @@ -590,6 +590,10 @@ static void GetArgsAndEnv(char ***argv, char ***envp) { 159 + #elif SANITIZER_NETBSD 160 + *argv = __ps_strings->ps_argvstr; 161 + *envp = __ps_strings->ps_envstr; 162 + +#elif SANITIZER_NONGNU 163 + + static const int kMaxArgv = 2000, kMaxEnvp = 2000; 164 + + ReadNullSepFileToArray("/proc/self/cmdline", argv, kMaxArgv); 165 + + ReadNullSepFileToArray("/proc/self/environ", envp, kMaxEnvp); 166 + #else // SANITIZER_FREEBSD 167 + #if !SANITIZER_GO 168 + if (&__libc_stack_end) { 169 + diff --git a/lib/sanitizer_common/sanitizer_linux_libcdep.cc b/lib/sanitizer_common/sanitizer_linux_libcdep.cc 170 + index 4962ff832..438f94dbe 100644 171 + --- a/lib/sanitizer_common/sanitizer_linux_libcdep.cc 172 + +++ b/lib/sanitizer_common/sanitizer_linux_libcdep.cc 173 + @@ -179,7 +179,7 @@ __attribute__((unused)) static bool GetLibcVersion(int *major, int *minor, 174 + } 175 + 176 + #if !SANITIZER_FREEBSD && !SANITIZER_ANDROID && !SANITIZER_GO && \ 177 + - !SANITIZER_NETBSD && !SANITIZER_OPENBSD && !SANITIZER_SOLARIS 178 + + !SANITIZER_NETBSD && !SANITIZER_OPENBSD && !SANITIZER_SOLARIS && !SANITIZER_NONGNU 179 + static uptr g_tls_size; 180 + 181 + #ifdef __i386__ 182 + @@ -261,7 +261,7 @@ void InitTlsSize() { } 183 + #if (defined(__x86_64__) || defined(__i386__) || defined(__mips__) || \ 184 + defined(__aarch64__) || defined(__powerpc64__) || defined(__s390__) || \ 185 + defined(__arm__)) && \ 186 + - SANITIZER_LINUX && !SANITIZER_ANDROID 187 + + SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU 188 + // sizeof(struct pthread) from glibc. 189 + static atomic_uintptr_t thread_descriptor_size; 190 + 191 + @@ -426,7 +426,7 @@ int GetSizeFromHdr(struct dl_phdr_info *info, size_t size, void *data) { 192 + 193 + #if !SANITIZER_GO 194 + static void GetTls(uptr *addr, uptr *size) { 195 + -#if SANITIZER_LINUX && !SANITIZER_ANDROID 196 + +#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU 197 + # if defined(__x86_64__) || defined(__i386__) || defined(__s390__) 198 + *addr = ThreadSelf(); 199 + *size = GetTlsSize(); 200 + @@ -470,7 +470,7 @@ static void GetTls(uptr *addr, uptr *size) { 201 + #elif SANITIZER_OPENBSD 202 + *addr = 0; 203 + *size = 0; 204 + -#elif SANITIZER_ANDROID 205 + +#elif SANITIZER_ANDROID || SANITIZER_NONGNU 206 + *addr = 0; 207 + *size = 0; 208 + #elif SANITIZER_SOLARIS 209 + @@ -486,7 +486,7 @@ static void GetTls(uptr *addr, uptr *size) { 210 + #if !SANITIZER_GO 211 + uptr GetTlsSize() { 212 + #if SANITIZER_FREEBSD || SANITIZER_ANDROID || SANITIZER_NETBSD || \ 213 + - SANITIZER_OPENBSD || SANITIZER_SOLARIS 214 + + SANITIZER_OPENBSD || SANITIZER_SOLARIS || SANITIZER_NONGNU 215 + uptr addr, size; 216 + GetTls(&addr, &size); 217 + return size; 218 + diff --git a/lib/sanitizer_common/sanitizer_platform.h b/lib/sanitizer_common/sanitizer_platform.h 219 + index d81e25580..e10680ac8 100644 220 + --- a/lib/sanitizer_common/sanitizer_platform.h 221 + +++ b/lib/sanitizer_common/sanitizer_platform.h 222 + @@ -208,6 +208,12 @@ 223 + # define SANITIZER_SOLARIS32 0 224 + #endif 225 + 226 + +#if defined(__linux__) && !defined(__GLIBC__) 227 + +# define SANITIZER_NONGNU 1 228 + +#else 229 + +# define SANITIZER_NONGNU 0 230 + +#endif 231 + + 232 + #if defined(__myriad2__) 233 + # define SANITIZER_MYRIAD2 1 234 + #else 235 + diff --git a/lib/sanitizer_common/sanitizer_platform_interceptors.h b/lib/sanitizer_common/sanitizer_platform_interceptors.h 236 + index f95539a73..6c53b3415 100644 237 + --- a/lib/sanitizer_common/sanitizer_platform_interceptors.h 238 + +++ b/lib/sanitizer_common/sanitizer_platform_interceptors.h 239 + @@ -39,7 +39,7 @@ 240 + # include "sanitizer_platform_limits_solaris.h" 241 + #endif 242 + 243 + -#if SANITIZER_LINUX && !SANITIZER_ANDROID 244 + +#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU 245 + # define SI_LINUX_NOT_ANDROID 1 246 + #else 247 + # define SI_LINUX_NOT_ANDROID 0 248 + @@ -322,7 +322,7 @@ 249 + #define SANITIZER_INTERCEPT_ETHER_R (SI_FREEBSD || SI_LINUX_NOT_ANDROID) 250 + #define SANITIZER_INTERCEPT_SHMCTL \ 251 + (SI_NETBSD || SI_OPENBSD || SI_SOLARIS || \ 252 + - ((SI_FREEBSD || SI_LINUX_NOT_ANDROID) && \ 253 + + ((SI_FREEBSD || SI_LINUX_NOT_ANDROID || SANITIZER_NONGNU) && \ 254 + SANITIZER_WORDSIZE == 64)) // NOLINT 255 + #define SANITIZER_INTERCEPT_RANDOM_R SI_LINUX_NOT_ANDROID 256 + #define SANITIZER_INTERCEPT_PTHREAD_ATTR_GET SI_POSIX 257 + diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc 258 + index 54da635d7..2f6ff69c3 100644 259 + --- a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc 260 + +++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc 261 + @@ -14,6 +14,9 @@ 262 + 263 + #include "sanitizer_platform.h" 264 + 265 + +// Workaround musl <--> linux conflicting definition of 'struct sysinfo' 266 + +#define _LINUX_SYSINFO_H 267 + + 268 + #if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_MAC 269 + // Tests in this file assume that off_t-dependent data structures match the 270 + // libc ABI. For example, struct dirent here is what readdir() function (as 271 + @@ -138,12 +141,14 @@ typedef struct user_fpregs elf_fpregset_t; 272 + 273 + #if SANITIZER_LINUX && !SANITIZER_ANDROID 274 + #include <glob.h> 275 + -#include <obstack.h> 276 + +# if !SANITIZER_NONGNU 277 + +# include <obstack.h> 278 + +# endif 279 + #include <mqueue.h> 280 + -#include <net/if_ppp.h> 281 + -#include <netax25/ax25.h> 282 + -#include <netipx/ipx.h> 283 + -#include <netrom/netrom.h> 284 + +#include <linux/if_ppp.h> 285 + +#include <linux/ax25.h> 286 + +#include <linux/ipx.h> 287 + +#include <linux/netrom.h> 288 + #if HAVE_RPC_XDR_H 289 + # include <rpc/xdr.h> 290 + #elif HAVE_TIRPC_RPC_XDR_H 291 + @@ -251,7 +256,7 @@ namespace __sanitizer { 292 + unsigned struct_itimerspec_sz = sizeof(struct itimerspec); 293 + #endif // SANITIZER_LINUX || SANITIZER_FREEBSD 294 + 295 + -#if SANITIZER_LINUX && !SANITIZER_ANDROID 296 + +#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU 297 + // Use pre-computed size of struct ustat to avoid <sys/ustat.h> which 298 + // has been removed from glibc 2.28. 299 + #if defined(__aarch64__) || defined(__s390x__) || defined (__mips64) \ 300 + @@ -322,7 +327,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(ElfW(Phdr)); 301 + unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr); 302 + #endif 303 + 304 + -#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID 305 + +#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID && !SANITIZER_NONGNU 306 + int glob_nomatch = GLOB_NOMATCH; 307 + int glob_altdirfunc = GLOB_ALTDIRFUNC; 308 + #endif 309 + @@ -416,7 +421,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr); 310 + unsigned struct_termios_sz = sizeof(struct termios); 311 + unsigned struct_winsize_sz = sizeof(struct winsize); 312 + 313 + -#if SANITIZER_LINUX 314 + +#if SANITIZER_LINUX && !SANITIZER_NONGNU 315 + unsigned struct_arpreq_sz = sizeof(struct arpreq); 316 + unsigned struct_cdrom_msf_sz = sizeof(struct cdrom_msf); 317 + unsigned struct_cdrom_multisession_sz = sizeof(struct cdrom_multisession); 318 + @@ -466,7 +471,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr); 319 + unsigned struct_vt_mode_sz = sizeof(struct vt_mode); 320 + #endif // SANITIZER_LINUX || SANITIZER_FREEBSD 321 + 322 + -#if SANITIZER_LINUX && !SANITIZER_ANDROID 323 + +#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU 324 + unsigned struct_ax25_parms_struct_sz = sizeof(struct ax25_parms_struct); 325 + unsigned struct_cyclades_monitor_sz = sizeof(struct cyclades_monitor); 326 + #if EV_VERSION > (0x010000) 327 + @@ -834,7 +839,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr); 328 + unsigned IOCTL_VT_WAITACTIVE = VT_WAITACTIVE; 329 + #endif // SANITIZER_LINUX || SANITIZER_FREEBSD 330 + 331 + -#if SANITIZER_LINUX && !SANITIZER_ANDROID 332 + +#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU 333 + unsigned IOCTL_CYGETDEFTHRESH = CYGETDEFTHRESH; 334 + unsigned IOCTL_CYGETDEFTIMEOUT = CYGETDEFTIMEOUT; 335 + unsigned IOCTL_CYGETMON = CYGETMON; 336 + @@ -989,7 +994,7 @@ CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_phdr); 337 + CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_phnum); 338 + #endif // SANITIZER_LINUX || SANITIZER_FREEBSD 339 + 340 + -#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID 341 + +#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID && !SANITIZER_NONGNU 342 + CHECK_TYPE_SIZE(glob_t); 343 + CHECK_SIZE_AND_OFFSET(glob_t, gl_pathc); 344 + CHECK_SIZE_AND_OFFSET(glob_t, gl_pathv); 345 + @@ -1023,6 +1028,7 @@ CHECK_TYPE_SIZE(iovec); 346 + CHECK_SIZE_AND_OFFSET(iovec, iov_base); 347 + CHECK_SIZE_AND_OFFSET(iovec, iov_len); 348 + 349 + +#if !SANITIZER_NONGNU 350 + CHECK_TYPE_SIZE(msghdr); 351 + CHECK_SIZE_AND_OFFSET(msghdr, msg_name); 352 + CHECK_SIZE_AND_OFFSET(msghdr, msg_namelen); 353 + @@ -1036,6 +1042,7 @@ CHECK_TYPE_SIZE(cmsghdr); 354 + CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_len); 355 + CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_level); 356 + CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_type); 357 + +#endif 358 + 359 + #ifndef __GLIBC_PREREQ 360 + #define __GLIBC_PREREQ(x, y) 0 361 + @@ -1145,7 +1152,7 @@ CHECK_SIZE_AND_OFFSET(mntent, mnt_passno); 362 + 363 + CHECK_TYPE_SIZE(ether_addr); 364 + 365 + -#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID 366 + +#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID && !SANITIZER_NONGNU 367 + CHECK_TYPE_SIZE(ipc_perm); 368 + # if SANITIZER_FREEBSD 369 + CHECK_SIZE_AND_OFFSET(ipc_perm, key); 370 + @@ -1206,7 +1213,7 @@ CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_dstaddr); 371 + CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_data); 372 + #endif 373 + 374 + -#if SANITIZER_LINUX 375 + +#if SANITIZER_LINUX && !SANITIZER_NONGNU 376 + COMPILER_CHECK(sizeof(__sanitizer_mallinfo) == sizeof(struct mallinfo)); 377 + #endif 378 + 379 + @@ -1256,7 +1263,7 @@ COMPILER_CHECK(__sanitizer_XDR_DECODE == XDR_DECODE); 380 + COMPILER_CHECK(__sanitizer_XDR_FREE == XDR_FREE); 381 + #endif 382 + 383 + -#if SANITIZER_LINUX && !SANITIZER_ANDROID 384 + +#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU 385 + COMPILER_CHECK(sizeof(__sanitizer_FILE) <= sizeof(FILE)); 386 + CHECK_SIZE_AND_OFFSET(FILE, _flags); 387 + CHECK_SIZE_AND_OFFSET(FILE, _IO_read_ptr); 388 + @@ -1275,7 +1282,7 @@ CHECK_SIZE_AND_OFFSET(FILE, _chain); 389 + CHECK_SIZE_AND_OFFSET(FILE, _fileno); 390 + #endif 391 + 392 + -#if SANITIZER_LINUX && !SANITIZER_ANDROID 393 + +#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU 394 + COMPILER_CHECK(sizeof(__sanitizer__obstack_chunk) <= sizeof(_obstack_chunk)); 395 + CHECK_SIZE_AND_OFFSET(_obstack_chunk, limit); 396 + CHECK_SIZE_AND_OFFSET(_obstack_chunk, prev); 397 + diff --git a/lib/tsan/rtl/tsan_platform_linux.cc b/lib/tsan/rtl/tsan_platform_linux.cc 398 + index de989b780..51a97b554 100644 399 + --- a/lib/tsan/rtl/tsan_platform_linux.cc 400 + +++ b/lib/tsan/rtl/tsan_platform_linux.cc 401 + @@ -294,7 +294,7 @@ void InitializePlatform() { 402 + // This is required to properly "close" the fds, because we do not see internal 403 + // closes within glibc. The code is a pure hack. 404 + int ExtractResolvFDs(void *state, int *fds, int nfd) { 405 + -#if SANITIZER_LINUX && !SANITIZER_ANDROID 406 + +#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU 407 + int cnt = 0; 408 + struct __res_state *statp = (struct __res_state*)state; 409 + for (int i = 0; i < MAXNS && cnt < nfd; i++) { 410 + -- 411 + 2.19.0 412 +
+268
pkgs/development/compilers/llvm/git/default.nix
··· 1 + { lowPrio, newScope, pkgs, lib, stdenv, cmake 2 + , gccForLibs, preLibcCrossHeaders 3 + , libxml2, python3, isl, fetchFromGitHub, overrideCC, wrapCCWith, wrapBintoolsWith 4 + , buildLlvmTools # tools, but from the previous stage, for cross 5 + , targetLlvmLibraries # libraries, but from the next stage, for cross 6 + # This is the default binutils, but with *this* version of LLD rather 7 + # than the default LLVM verion's, if LLD is the choice. We use these for 8 + # the `useLLVM` bootstrapping below. 9 + , bootBintoolsNoLibc ? 10 + if stdenv.targetPlatform.linker == "lld" 11 + then null 12 + else pkgs.bintoolsNoLibc 13 + , bootBintools ? 14 + if stdenv.targetPlatform.linker == "lld" 15 + then null 16 + else pkgs.bintools 17 + , darwin 18 + }: 19 + 20 + let 21 + release_version = "12.0.0"; 22 + candidate = ""; # empty or "rcN" 23 + dash-candidate = lib.optionalString (candidate != "") "-${candidate}"; 24 + version = "${release_version}${dash-candidate}"; # differentiating these (variables) is important for RCs 25 + targetConfig = stdenv.targetPlatform.config; 26 + 27 + src = fetchFromGitHub { 28 + owner = "llvm"; 29 + repo = "llvm-project"; 30 + rev = "llvmorg-${version}"; 31 + sha256 = "07jz8pywc2qqa1srdnqg5p2y4lx3ki1inpigarzgxc3j20r4gb58"; 32 + }; 33 + 34 + llvm_meta = { 35 + license = lib.licenses.ncsa; 36 + maintainers = with lib.maintainers; [ lovek323 raskin dtzWill primeos ]; 37 + platforms = lib.platforms.all; 38 + }; 39 + 40 + tools = lib.makeExtensible (tools: let 41 + callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version src buildLlvmTools; }); 42 + mkExtraBuildCommands0 = cc: '' 43 + rsrc="$out/resource-root" 44 + mkdir "$rsrc" 45 + ln -s "${cc.lib}/lib/clang/${release_version}/include" "$rsrc" 46 + echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags 47 + ''; 48 + mkExtraBuildCommands = cc: mkExtraBuildCommands0 cc + '' 49 + ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" 50 + ln -s "${targetLlvmLibraries.compiler-rt.out}/share" "$rsrc/share" 51 + ''; 52 + 53 + bintoolsNoLibc' = 54 + if bootBintoolsNoLibc == null 55 + then tools.bintoolsNoLibc 56 + else bootBintoolsNoLibc; 57 + bintools' = 58 + if bootBintools == null 59 + then tools.bintools 60 + else bootBintools; 61 + 62 + in { 63 + 64 + libllvm = callPackage ./llvm { 65 + inherit llvm_meta; 66 + }; 67 + 68 + # `llvm` historically had the binaries. When choosing an output explicitly, 69 + # we need to reintroduce `outputUnspecified` to get the expected behavior e.g. of lib.get* 70 + llvm = tools.libllvm.out // { outputUnspecified = true; }; 71 + 72 + libclang = callPackage ./clang { 73 + inherit llvm_meta; 74 + }; 75 + 76 + clang-unwrapped = tools.libclang.out // { outputUnspecified = true; }; 77 + 78 + # disabled until recommonmark supports sphinx 3 79 + #Llvm-manpages = lowPrio (tools.libllvm.override { 80 + # enableManpages = true; 81 + # python3 = pkgs.python3; # don't use python-boot 82 + #}); 83 + 84 + clang-manpages = lowPrio (tools.libclang.override { 85 + enableManpages = true; 86 + python3 = pkgs.python3; # don't use python-boot 87 + }); 88 + 89 + # disabled until recommonmark supports sphinx 3 90 + # lldb-manpages = lowPrio (tools.lldb.override { 91 + # enableManpages = true; 92 + # python3 = pkgs.python3; # don't use python-boot 93 + # }); 94 + 95 + clang = if stdenv.cc.isGNU then tools.libstdcxxClang else tools.libcxxClang; 96 + 97 + libstdcxxClang = wrapCCWith rec { 98 + cc = tools.clang-unwrapped; 99 + # libstdcxx is taken from gcc in an ad-hoc way in cc-wrapper. 100 + libcxx = null; 101 + extraPackages = [ 102 + targetLlvmLibraries.compiler-rt 103 + ]; 104 + extraBuildCommands = mkExtraBuildCommands cc; 105 + }; 106 + 107 + libcxxClang = wrapCCWith rec { 108 + cc = tools.clang-unwrapped; 109 + libcxx = targetLlvmLibraries.libcxx; 110 + extraPackages = [ 111 + targetLlvmLibraries.libcxxabi 112 + targetLlvmLibraries.compiler-rt 113 + ]; 114 + extraBuildCommands = mkExtraBuildCommands cc; 115 + }; 116 + 117 + lld = callPackage ./lld { 118 + inherit llvm_meta; 119 + }; 120 + 121 + lldb = callPackage ./lldb { 122 + inherit llvm_meta; 123 + inherit (darwin) libobjc bootstrap_cmds; 124 + inherit (darwin.apple_sdk.libs) xpc; 125 + inherit (darwin.apple_sdk.frameworks) Foundation Carbon Cocoa; 126 + }; 127 + 128 + # Below, is the LLVM bootstrapping logic. It handles building a 129 + # fully LLVM toolchain from scratch. No GCC toolchain should be 130 + # pulled in. As a consequence, it is very quick to build different 131 + # targets provided by LLVM and we can also build for what GCC 132 + # doesn’t support like LLVM. Probably we should move to some other 133 + # file. 134 + 135 + bintools-unwrapped = callPackage ./bintools {}; 136 + 137 + bintoolsNoLibc = wrapBintoolsWith { 138 + bintools = tools.bintools-unwrapped; 139 + libc = preLibcCrossHeaders; 140 + }; 141 + 142 + bintools = wrapBintoolsWith { 143 + bintools = tools.bintools-unwrapped; 144 + }; 145 + 146 + clangUseLLVM = wrapCCWith rec { 147 + cc = tools.clang-unwrapped; 148 + libcxx = targetLlvmLibraries.libcxx; 149 + bintools = bintools'; 150 + extraPackages = [ 151 + targetLlvmLibraries.libcxxabi 152 + targetLlvmLibraries.compiler-rt 153 + ] ++ lib.optionals (!stdenv.targetPlatform.isWasm) [ 154 + targetLlvmLibraries.libunwind 155 + ]; 156 + extraBuildCommands = '' 157 + echo "-rtlib=compiler-rt -Wno-unused-command-line-argument" >> $out/nix-support/cc-cflags 158 + echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags 159 + '' + lib.optionalString (!stdenv.targetPlatform.isWasm) '' 160 + echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags 161 + '' + lib.optionalString (!stdenv.targetPlatform.isWasm && stdenv.targetPlatform.useLLVM or false) '' 162 + echo "-lunwind" >> $out/nix-support/cc-ldflags 163 + '' + lib.optionalString stdenv.targetPlatform.isWasm '' 164 + echo "-fno-exceptions" >> $out/nix-support/cc-cflags 165 + '' + mkExtraBuildCommands cc; 166 + }; 167 + 168 + clangNoLibcxx = wrapCCWith rec { 169 + cc = tools.clang-unwrapped; 170 + libcxx = null; 171 + bintools = bintools'; 172 + extraPackages = [ 173 + targetLlvmLibraries.compiler-rt 174 + ]; 175 + extraBuildCommands = '' 176 + echo "-rtlib=compiler-rt" >> $out/nix-support/cc-cflags 177 + echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags 178 + echo "-nostdlib++" >> $out/nix-support/cc-cflags 179 + '' + mkExtraBuildCommands cc; 180 + }; 181 + 182 + clangNoLibc = wrapCCWith rec { 183 + cc = tools.clang-unwrapped; 184 + libcxx = null; 185 + bintools = bintoolsNoLibc'; 186 + extraPackages = [ 187 + targetLlvmLibraries.compiler-rt 188 + ]; 189 + extraBuildCommands = '' 190 + echo "-rtlib=compiler-rt" >> $out/nix-support/cc-cflags 191 + echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags 192 + '' + mkExtraBuildCommands cc; 193 + }; 194 + 195 + clangNoCompilerRt = wrapCCWith rec { 196 + cc = tools.clang-unwrapped; 197 + libcxx = null; 198 + bintools = bintoolsNoLibc'; 199 + extraPackages = [ ]; 200 + extraBuildCommands = '' 201 + echo "-nostartfiles" >> $out/nix-support/cc-cflags 202 + '' + mkExtraBuildCommands0 cc; 203 + }; 204 + 205 + clangNoCompilerRtWithLibc = wrapCCWith rec { 206 + cc = tools.clang-unwrapped; 207 + libcxx = null; 208 + bintools = bintools'; 209 + extraPackages = [ ]; 210 + extraBuildCommands = mkExtraBuildCommands0 cc; 211 + }; 212 + 213 + }); 214 + 215 + libraries = lib.makeExtensible (libraries: let 216 + callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version src; }); 217 + in { 218 + 219 + compiler-rt-libc = callPackage ./compiler-rt { 220 + inherit llvm_meta; 221 + stdenv = if stdenv.hostPlatform.useLLVM or false 222 + then overrideCC stdenv buildLlvmTools.clangNoCompilerRtWithLibc 223 + else stdenv; 224 + }; 225 + 226 + compiler-rt-no-libc = callPackage ./compiler-rt { 227 + inherit llvm_meta; 228 + stdenv = if stdenv.hostPlatform.useLLVM or false 229 + then overrideCC stdenv buildLlvmTools.clangNoCompilerRt 230 + else stdenv; 231 + }; 232 + 233 + # N.B. condition is safe because without useLLVM both are the same. 234 + compiler-rt = if stdenv.hostPlatform.isAndroid 235 + then libraries.compiler-rt-libc 236 + else libraries.compiler-rt-no-libc; 237 + 238 + stdenv = overrideCC stdenv buildLlvmTools.clang; 239 + 240 + libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang; 241 + 242 + libcxx = callPackage ./libcxx { 243 + inherit llvm_meta; 244 + stdenv = if stdenv.hostPlatform.useLLVM or false 245 + then overrideCC stdenv buildLlvmTools.clangNoLibcxx 246 + else stdenv; 247 + }; 248 + 249 + libcxxabi = callPackage ./libcxxabi { 250 + inherit llvm_meta; 251 + stdenv = if stdenv.hostPlatform.useLLVM or false 252 + then overrideCC stdenv buildLlvmTools.clangNoLibcxx 253 + else stdenv; 254 + }; 255 + 256 + libunwind = callPackage ./libunwind { 257 + inherit llvm_meta; 258 + stdenv = if stdenv.hostPlatform.useLLVM or false 259 + then overrideCC stdenv buildLlvmTools.clangNoLibcxx 260 + else stdenv; 261 + }; 262 + 263 + openmp = callPackage ./openmp { 264 + inherit llvm_meta; 265 + }; 266 + }); 267 + 268 + in { inherit tools libraries; } // libraries // tools
+54
pkgs/development/compilers/llvm/git/libcxx/default.nix
··· 1 + { lib, stdenv, llvm_meta, src, cmake, python3, libcxxabi, fixDarwinDylibNames, version 2 + , enableShared ? !stdenv.hostPlatform.isStatic 3 + }: 4 + 5 + stdenv.mkDerivation rec { 6 + pname = "libcxx"; 7 + inherit version; 8 + 9 + inherit src; 10 + sourceRoot = "source/${pname}"; 11 + 12 + outputs = [ "out" "dev" ]; 13 + 14 + patches = [ 15 + ./gnu-install-dirs.patch 16 + ] ++ lib.optionals stdenv.hostPlatform.isMusl [ 17 + ../../libcxx-0001-musl-hacks.patch 18 + ]; 19 + 20 + preConfigure = lib.optionalString stdenv.hostPlatform.isMusl '' 21 + patchShebangs utils/cat_files.py 22 + ''; 23 + 24 + nativeBuildInputs = [ cmake python3 ] 25 + ++ lib.optional stdenv.isDarwin fixDarwinDylibNames; 26 + 27 + buildInputs = [ libcxxabi ]; 28 + 29 + cmakeFlags = [ 30 + "-DLIBCXX_CXX_ABI=libcxxabi" 31 + ] ++ lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) "-DLIBCXX_HAS_MUSL_LIBC=1" 32 + ++ lib.optional (stdenv.hostPlatform.useLLVM or false) "-DLIBCXX_USE_COMPILER_RT=ON" 33 + ++ lib.optional stdenv.hostPlatform.isWasm [ 34 + "-DLIBCXX_ENABLE_THREADS=OFF" 35 + "-DLIBCXX_ENABLE_FILESYSTEM=OFF" 36 + "-DLIBCXX_ENABLE_EXCEPTIONS=OFF" 37 + ] ++ lib.optional (!enableShared) "-DLIBCXX_ENABLE_SHARED=OFF"; 38 + 39 + passthru = { 40 + isLLVM = true; 41 + }; 42 + 43 + meta = llvm_meta // { 44 + homepage = "https://libcxx.llvm.org/"; 45 + description = "C++ standard library"; 46 + longDescription = '' 47 + libc++ is an implementation of the C++ standard library, targeting C++11, 48 + C++14 and above. 49 + ''; 50 + # "All of the code in libc++ is dual licensed under the MIT license and the 51 + # UIUC License (a BSD-like license)": 52 + license = with lib.licenses; [ mit ncsa ]; 53 + }; 54 + }
+100
pkgs/development/compilers/llvm/git/libcxx/gnu-install-dirs.patch
··· 1 + diff --git a/CMakeLists.txt b/CMakeLists.txt 2 + index 9bf1a02f0908..612cd4aab76c 100644 3 + --- a/CMakeLists.txt 4 + +++ b/CMakeLists.txt 5 + @@ -28,6 +28,8 @@ set(LIBCXX_BINARY_INCLUDE_DIR "${LIBCXX_BINARY_DIR}/include/c++build") 6 + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR LIBCXX_STANDALONE_BUILD) 7 + project(libcxx CXX C) 8 + 9 + + include(GNUInstallDirs) 10 + + 11 + set(PACKAGE_NAME libcxx) 12 + set(PACKAGE_VERSION 12.0.0) 13 + set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") 14 + @@ -402,7 +404,7 @@ endif () 15 + if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) 16 + set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) 17 + set(LIBCXX_HEADER_DIR ${LLVM_BINARY_DIR}) 18 + - set(LIBCXX_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) 19 + + set(LIBCXX_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) 20 + if(LIBCXX_LIBDIR_SUBDIR) 21 + string(APPEND LIBCXX_LIBRARY_DIR /${LIBCXX_LIBDIR_SUBDIR}) 22 + string(APPEND LIBCXX_INSTALL_LIBRARY_DIR /${LIBCXX_LIBDIR_SUBDIR}) 23 + @@ -410,11 +412,11 @@ if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) 24 + elseif(LLVM_LIBRARY_OUTPUT_INTDIR) 25 + set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) 26 + set(LIBCXX_HEADER_DIR ${LLVM_BINARY_DIR}) 27 + - set(LIBCXX_INSTALL_LIBRARY_DIR lib${LIBCXX_LIBDIR_SUFFIX}) 28 + + set(LIBCXX_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX}) 29 + else() 30 + set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX}) 31 + set(LIBCXX_HEADER_DIR ${CMAKE_BINARY_DIR}) 32 + - set(LIBCXX_INSTALL_LIBRARY_DIR lib${LIBCXX_LIBDIR_SUFFIX}) 33 + + set(LIBCXX_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX}) 34 + endif() 35 + 36 + file(MAKE_DIRECTORY "${LIBCXX_BINARY_INCLUDE_DIR}") 37 + diff --git a/cmake/Modules/HandleLibCXXABI.cmake b/cmake/Modules/HandleLibCXXABI.cmake 38 + index 5d2764e870e9..bb1ec5de6ca2 100644 39 + --- a/cmake/Modules/HandleLibCXXABI.cmake 40 + +++ b/cmake/Modules/HandleLibCXXABI.cmake 41 + @@ -63,7 +63,7 @@ macro(setup_abi_lib abidefines abishared abistatic abifiles abidirs) 42 + 43 + if (LIBCXX_INSTALL_HEADERS) 44 + install(FILES "${LIBCXX_BINARY_INCLUDE_DIR}/${fpath}" 45 + - DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1/${dstdir} 46 + + DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1/${dstdir} 47 + COMPONENT cxx-headers 48 + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ 49 + ) 50 + diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt 51 + index 29a317b8ae9a..4747263cfd1b 100644 52 + --- a/include/CMakeLists.txt 53 + +++ b/include/CMakeLists.txt 54 + @@ -252,7 +252,7 @@ if (LIBCXX_INSTALL_HEADERS) 55 + foreach(file ${files}) 56 + get_filename_component(dir ${file} DIRECTORY) 57 + install(FILES ${file} 58 + - DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1/${dir} 59 + + DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1/${dir} 60 + COMPONENT cxx-headers 61 + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ 62 + ) 63 + @@ -260,7 +260,7 @@ if (LIBCXX_INSTALL_HEADERS) 64 + 65 + # Install the generated header as __config. 66 + install(FILES ${LIBCXX_BINARY_DIR}/__generated_config 67 + - DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1 68 + + DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1 69 + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ 70 + RENAME __config 71 + COMPONENT cxx-headers) 72 + diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt 73 + index 9965104cb5b2..9b55dbb1d822 100644 74 + --- a/src/CMakeLists.txt 75 + +++ b/src/CMakeLists.txt 76 + @@ -352,21 +352,21 @@ if (LIBCXX_INSTALL_SHARED_LIBRARY) 77 + install(TARGETS cxx_shared 78 + ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx 79 + LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx 80 + - RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}bin COMPONENT cxx) 81 + + RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_BINDIR} COMPONENT cxx) 82 + endif() 83 + 84 + if (LIBCXX_INSTALL_STATIC_LIBRARY) 85 + install(TARGETS cxx_static 86 + ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx 87 + LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx 88 + - RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}bin COMPONENT cxx) 89 + + RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_BINDIR} COMPONENT cxx) 90 + endif() 91 + 92 + if(LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY) 93 + install(TARGETS cxx_experimental 94 + LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx 95 + ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx 96 + - RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}bin COMPONENT cxx) 97 + + RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_BINDIR} COMPONENT cxx) 98 + endif() 99 + 100 + # NOTE: This install command must go after the cxx install command otherwise
+73
pkgs/development/compilers/llvm/git/libcxxabi/default.nix
··· 1 + { lib, stdenv, llvm_meta, cmake, python3, src, libunwind, version 2 + , enableShared ? !stdenv.hostPlatform.isStatic 3 + }: 4 + 5 + stdenv.mkDerivation rec { 6 + pname = "libcxxabi"; 7 + inherit version; 8 + 9 + inherit src; 10 + sourceRoot = "source/${pname}"; 11 + 12 + outputs = [ "out" "dev" ]; 13 + 14 + postUnpack = lib.optionalString stdenv.isDarwin '' 15 + export TRIPLE=x86_64-apple-darwin 16 + '' + lib.optionalString stdenv.hostPlatform.isMusl '' 17 + patch -p1 -d libcxx -i ${../../libcxx-0001-musl-hacks.patch} 18 + '' + lib.optionalString stdenv.hostPlatform.isWasm '' 19 + patch -p1 -d llvm -i ${./wasm.patch} 20 + ''; 21 + 22 + patches = [ 23 + ./gnu-install-dirs.patch 24 + ]; 25 + 26 + nativeBuildInputs = [ cmake python3 ]; 27 + buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm) libunwind; 28 + 29 + cmakeFlags = lib.optionals (stdenv.hostPlatform.useLLVM or false) [ 30 + "-DLLVM_ENABLE_LIBCXX=ON" 31 + "-DLIBCXXABI_USE_LLVM_UNWINDER=ON" 32 + ] ++ lib.optionals stdenv.hostPlatform.isWasm [ 33 + "-DLIBCXXABI_ENABLE_THREADS=OFF" 34 + "-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF" 35 + ] ++ lib.optionals (!enableShared) [ 36 + "-DLIBCXXABI_ENABLE_SHARED=OFF" 37 + ]; 38 + 39 + installPhase = if stdenv.isDarwin 40 + then '' 41 + for file in lib/*.dylib; do 42 + # this should be done in CMake, but having trouble figuring out 43 + # the magic combination of necessary CMake variables 44 + # if you fancy a try, take a look at 45 + # https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling 46 + install_name_tool -id $out/$file $file 47 + done 48 + make install 49 + install -d 755 $out/include 50 + install -m 644 ../include/*.h $out/include 51 + '' 52 + else '' 53 + install -d -m 755 $out/include $out/lib 54 + install -m 644 lib/libc++abi.a $out/lib 55 + install -m 644 ../include/cxxabi.h $out/include 56 + '' + lib.optionalString enableShared '' 57 + install -m 644 lib/libc++abi.so.1.0 $out/lib 58 + ln -s libc++abi.so.1.0 $out/lib/libc++abi.so 59 + ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1 60 + ''; 61 + 62 + meta = llvm_meta // { 63 + homepage = "https://libcxxabi.llvm.org/"; 64 + description = "Provides C++ standard library support"; 65 + longDescription = '' 66 + libc++abi is a new implementation of low level support for a standard C++ library. 67 + ''; 68 + # "All of the code in libc++abi is dual licensed under the MIT license and 69 + # the UIUC License (a BSD-like license)": 70 + license = with lib.licenses; [ mit ncsa ]; 71 + maintainers = llvm_meta.maintainers ++ [ lib.maintainers.vlstill ]; 72 + }; 73 + }
+34
pkgs/development/compilers/llvm/git/libcxxabi/gnu-install-dirs.patch
··· 1 + diff --git a/CMakeLists.txt b/CMakeLists.txt 2 + index 426c855288fc..a9812a994f53 100644 3 + --- a/CMakeLists.txt 4 + +++ b/CMakeLists.txt 5 + @@ -27,6 +27,8 @@ set(LIBCXXABI_LIBCXX_PATH "${CMAKE_CURRENT_LIST_DIR}/../libcxx" CACHE PATH 6 + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR LIBCXXABI_STANDALONE_BUILD) 7 + project(libcxxabi CXX C) 8 + 9 + + include(GNUInstallDirs) 10 + + 11 + set(PACKAGE_NAME libcxxabi) 12 + set(PACKAGE_VERSION 11.0.0) 13 + set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") 14 + @@ -180,17 +182,17 @@ set(CMAKE_MODULE_PATH 15 + 16 + if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) 17 + set(LIBCXXABI_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) 18 + - set(LIBCXXABI_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) 19 + + set(LIBCXXABI_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) 20 + if(LIBCXX_LIBDIR_SUBDIR) 21 + string(APPEND LIBCXXABI_LIBRARY_DIR /${LIBCXXABI_LIBDIR_SUBDIR}) 22 + string(APPEND LIBCXXABI_INSTALL_LIBRARY_DIR /${LIBCXXABI_LIBDIR_SUBDIR}) 23 + endif() 24 + elseif(LLVM_LIBRARY_OUTPUT_INTDIR) 25 + set(LIBCXXABI_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) 26 + - set(LIBCXXABI_INSTALL_LIBRARY_DIR lib${LIBCXXABI_LIBDIR_SUFFIX}) 27 + + set(LIBCXXABI_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBCXXABI_LIBDIR_SUFFIX}) 28 + else() 29 + set(LIBCXXABI_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXXABI_LIBDIR_SUFFIX}) 30 + - set(LIBCXXABI_INSTALL_LIBRARY_DIR lib${LIBCXXABI_LIBDIR_SUFFIX}) 31 + + set(LIBCXXABI_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBCXXABI_LIBDIR_SUFFIX}) 32 + endif() 33 + 34 + set(LIBCXXABI_INSTALL_PREFIX "" CACHE STRING "Define libc++abi destination prefix.")
+16
pkgs/development/compilers/llvm/git/libcxxabi/wasm.patch
··· 1 + diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake 2 + index 15497d405e0..33f7f18193a 100644 3 + --- a/cmake/modules/HandleLLVMOptions.cmake 4 + +++ b/cmake/modules/HandleLLVMOptions.cmake 5 + @@ -127,7 +127,10 @@ else(WIN32) 6 + set(LLVM_HAVE_LINK_VERSION_SCRIPT 1) 7 + endif() 8 + else(FUCHSIA OR UNIX) 9 + - MESSAGE(SEND_ERROR "Unable to determine platform") 10 + + if(${CMAKE_SYSTEM_NAME} MATCHES "Wasi") 11 + + else() 12 + + MESSAGE(SEND_ERROR "Unable to determine platform") 13 + + endif() 14 + endif(FUCHSIA OR UNIX) 15 + endif(WIN32) 16 +
+33
pkgs/development/compilers/llvm/git/libunwind/default.nix
··· 1 + { lib, stdenv, llvm_meta, version, src, cmake 2 + , enableShared ? !stdenv.hostPlatform.isStatic 3 + }: 4 + 5 + stdenv.mkDerivation rec { 6 + pname = "libunwind"; 7 + inherit version; 8 + 9 + inherit src; 10 + sourceRoot = "source/${pname}"; 11 + 12 + patches = [ 13 + ./gnu-install-dirs.patch 14 + ]; 15 + 16 + outputs = [ "out" "dev" ]; 17 + 18 + nativeBuildInputs = [ cmake ]; 19 + 20 + cmakeFlags = lib.optional (!enableShared) "-DLIBUNWIND_ENABLE_SHARED=OFF"; 21 + 22 + meta = llvm_meta // { 23 + # Details: https://github.com/llvm/llvm-project/blob/main/libunwind/docs/index.rst 24 + homepage = "https://clang.llvm.org/docs/Toolchain.html#unwind-library"; 25 + description = "LLVM's unwinder library"; 26 + longDescription = '' 27 + The unwind library provides a family of _Unwind_* functions implementing 28 + the language-neutral stack unwinding portion of the Itanium C++ ABI (Level 29 + I). It is a dependency of the C++ ABI library, and sometimes is a 30 + dependency of other runtimes. 31 + ''; 32 + }; 33 + }
+34
pkgs/development/compilers/llvm/git/libunwind/gnu-install-dirs.patch
··· 1 + diff --git a/CMakeLists.txt b/CMakeLists.txt 2 + index 48cb8e004e08..fec8144fb95a 100644 3 + --- a/CMakeLists.txt 4 + +++ b/CMakeLists.txt 5 + @@ -23,6 +23,8 @@ set(LIBUNWIND_LIBCXX_PATH "${CMAKE_CURRENT_LIST_DIR}/../libcxx" CACHE PATH 6 + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR LIBUNWIND_STANDALONE_BUILD) 7 + project(libunwind LANGUAGES C CXX ASM) 8 + 9 + + include(GNUInstallDirs) 10 + + 11 + set(PACKAGE_NAME libunwind) 12 + set(PACKAGE_VERSION 12.0.0) 13 + set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") 14 + @@ -115,17 +117,17 @@ set(CMAKE_MODULE_PATH 15 + 16 + if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) 17 + set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) 18 + - set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) 19 + + set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) 20 + if(LIBCXX_LIBDIR_SUBDIR) 21 + string(APPEND LIBUNWIND_LIBRARY_DIR /${LIBUNWIND_LIBDIR_SUBDIR}) 22 + string(APPEND LIBUNWIND_INSTALL_LIBRARY_DIR /${LIBUNWIND_LIBDIR_SUBDIR}) 23 + endif() 24 + elseif(LLVM_LIBRARY_OUTPUT_INTDIR) 25 + set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) 26 + - set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LIBUNWIND_LIBDIR_SUFFIX}) 27 + + set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBUNWIND_LIBDIR_SUFFIX}) 28 + else() 29 + set(LIBUNWIND_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBUNWIND_LIBDIR_SUFFIX}) 30 + - set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LIBUNWIND_LIBDIR_SUFFIX}) 31 + + set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBUNWIND_LIBDIR_SUFFIX}) 32 + endif() 33 + 34 + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBUNWIND_LIBRARY_DIR})
+44
pkgs/development/compilers/llvm/git/lld/default.nix
··· 1 + { lib, stdenv, llvm_meta 2 + , buildLlvmTools 3 + , src 4 + , cmake 5 + , libxml2 6 + , libllvm 7 + , version 8 + }: 9 + 10 + stdenv.mkDerivation rec { 11 + pname = "lld"; 12 + inherit version; 13 + 14 + inherit src; 15 + sourceRoot = "source/${pname}"; 16 + 17 + patches = [ 18 + ./gnu-install-dirs.patch 19 + ]; 20 + 21 + nativeBuildInputs = [ cmake ]; 22 + buildInputs = [ libllvm libxml2 ]; 23 + 24 + cmakeFlags = [ 25 + "-DLLVM_CONFIG_PATH=${libllvm.dev}/bin/llvm-config${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-native"}" 26 + ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ 27 + "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" 28 + ]; 29 + 30 + outputs = [ "out" "lib" "dev" ]; 31 + 32 + meta = llvm_meta // { 33 + homepage = "https://lld.llvm.org/"; 34 + description = "The LLVM linker"; 35 + longDescription = '' 36 + LLD is a linker from the LLVM project that is a drop-in replacement for 37 + system linkers and runs much faster than them. It also provides features 38 + that are useful for toolchain developers. 39 + The linker supports ELF (Unix), PE/COFF (Windows), Mach-O (macOS), and 40 + WebAssembly in descending order of completeness. Internally, LLD consists 41 + of several different linkers. 42 + ''; 43 + }; 44 + }
+68
pkgs/development/compilers/llvm/git/lld/gnu-install-dirs.patch
··· 1 + diff --git a/CMakeLists.txt b/CMakeLists.txt 2 + index d4e561b50d8f..cfa5bdd79c2a 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 + @@ -179,7 +181,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 + ) 23 + diff --git a/cmake/modules/AddLLD.cmake b/cmake/modules/AddLLD.cmake 24 + index 23df41312403..d62372c88de7 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 5cff736ff57f..64e775c771b9 100644 58 + --- a/tools/lld/CMakeLists.txt 59 + +++ b/tools/lld/CMakeLists.txt 60 + @@ -21,7 +21,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
+131
pkgs/development/compilers/llvm/git/lldb/default.nix
··· 1 + { lib, stdenv, llvm_meta 2 + , runCommand 3 + , src 4 + , cmake 5 + , zlib 6 + , ncurses 7 + , swig 8 + , which 9 + , libedit 10 + , libxml2 11 + , libllvm 12 + , libclang 13 + , python3 14 + , version 15 + , libobjc 16 + , xpc 17 + , Foundation 18 + , bootstrap_cmds 19 + , Carbon 20 + , Cocoa 21 + , lit 22 + , enableManpages ? false 23 + }: 24 + 25 + stdenv.mkDerivation (rec { 26 + pname = "lldb"; 27 + inherit version; 28 + 29 + inherit src; 30 + sourceRoot = "source/${pname}"; 31 + 32 + patches = [ 33 + ./procfs.patch 34 + (runCommand "resource-dir.patch" { 35 + clangLibDir = "${libclang.lib}/lib"; 36 + } '' 37 + substitute '${./resource-dir.patch}' "$out" --subst-var clangLibDir 38 + '') 39 + ./gnu-install-dirs.patch 40 + ]; 41 + 42 + outputs = [ "out" "lib" "dev" ]; 43 + 44 + nativeBuildInputs = [ 45 + cmake python3 which swig lit 46 + ] ++ lib.optionals enableManpages [ 47 + python3.pkgs.sphinx python3.pkgs.recommonmark 48 + ]; 49 + 50 + buildInputs = [ 51 + ncurses 52 + zlib 53 + libedit 54 + libxml2 55 + libllvm 56 + ] 57 + ++ lib.optionals stdenv.isDarwin [ 58 + libobjc 59 + xpc 60 + Foundation 61 + bootstrap_cmds 62 + Carbon 63 + Cocoa 64 + ]; 65 + 66 + hardeningDisable = [ "format" ]; 67 + 68 + cmakeFlags = [ 69 + "-DLLDB_INCLUDE_TESTS=${if doCheck then "YES" else "NO"}" 70 + "-DLLVM_ENABLE_RTTI=OFF" 71 + "-DClang_DIR=${libclang.dev}/lib/cmake" 72 + "-DLLVM_EXTERNAL_LIT=${lit}/bin/lit" 73 + ] ++ lib.optionals stdenv.isDarwin [ 74 + "-DLLDB_USE_SYSTEM_DEBUGSERVER=ON" 75 + ] ++ lib.optionals (!stdenv.isDarwin) [ 76 + "-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic 77 + ] ++ lib.optionals enableManpages [ 78 + "-DLLVM_ENABLE_SPHINX=ON" 79 + "-DSPHINX_OUTPUT_MAN=ON" 80 + "-DSPHINX_OUTPUT_HTML=OFF" 81 + ] ++ lib.optionals doCheck [ 82 + "-DLLDB_TEST_C_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" 83 + "-DLLDB_TEST_CXX_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++" 84 + ]; 85 + 86 + doCheck = false; 87 + 88 + postInstall = '' 89 + # Editor support 90 + # vscode: 91 + install -D ../tools/lldb-vscode/package.json $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/package.json 92 + mkdir -p $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin 93 + ln -s $out/bin/lldb-vscode $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin 94 + ''; 95 + 96 + meta = llvm_meta // { 97 + homepage = "https://lldb.llvm.org/"; 98 + description = "A next-generation high-performance debugger"; 99 + longDescription = '' 100 + LLDB is a next generation, high-performance debugger. It is built as a set 101 + of reusable components which highly leverage existing libraries in the 102 + larger LLVM Project, such as the Clang expression parser and LLVM 103 + disassembler. 104 + ''; 105 + }; 106 + } // lib.optionalAttrs enableManpages { 107 + pname = "lldb-manpages"; 108 + 109 + buildPhase = '' 110 + make docs-lldb-man 111 + ''; 112 + 113 + propagatedBuildInputs = []; 114 + 115 + # manually install lldb man page 116 + installPhase = '' 117 + mkdir -p $out/share/man/man1 118 + install docs/man/lldb.1 -t $out/share/man/man1/ 119 + ''; 120 + 121 + postPatch = null; 122 + postInstall = null; 123 + 124 + outputs = [ "out" ]; 125 + 126 + doCheck = false; 127 + 128 + meta = llvm_meta // { 129 + description = "man pages for LLDB ${version}"; 130 + }; 131 + })
+65
pkgs/development/compilers/llvm/git/lldb/gnu-install-dirs.patch
··· 1 + diff --git a/CMakeLists.txt b/CMakeLists.txt 2 + index b5633e21c56a..f2f1035e9238 100644 3 + --- a/CMakeLists.txt 4 + +++ b/CMakeLists.txt 5 + @@ -10,6 +10,8 @@ set(CMAKE_MODULE_PATH 6 + # If we are not building as part of LLVM, build LLDB as a standalone project, 7 + # using LLVM as an external library. 8 + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) 9 + + include(GNUInstallDirs) 10 + + 11 + project(lldb) 12 + include(LLDBStandalone) 13 + 14 + diff --git a/cmake/modules/AddLLDB.cmake b/cmake/modules/AddLLDB.cmake 15 + index 4ed5c647c5d2..89f96e710d55 100644 16 + --- a/cmake/modules/AddLLDB.cmake 17 + +++ b/cmake/modules/AddLLDB.cmake 18 + @@ -107,13 +107,13 @@ function(add_lldb_library name) 19 + endif() 20 + 21 + if(PARAM_SHARED) 22 + - set(install_dest lib${LLVM_LIBDIR_SUFFIX}) 23 + + set(install_dest ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) 24 + if(PARAM_INSTALL_PREFIX) 25 + set(install_dest ${PARAM_INSTALL_PREFIX}) 26 + endif() 27 + # RUNTIME is relevant for DLL platforms, FRAMEWORK for macOS 28 + install(TARGETS ${name} COMPONENT ${name} 29 + - RUNTIME DESTINATION bin 30 + + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 31 + LIBRARY DESTINATION ${install_dest} 32 + ARCHIVE DESTINATION ${install_dest} 33 + FRAMEWORK DESTINATION ${install_dest}) 34 + diff --git a/cmake/modules/LLDBConfig.cmake b/cmake/modules/LLDBConfig.cmake 35 + index 2fdf1502d055..37364341ff8b 100644 36 + --- a/cmake/modules/LLDBConfig.cmake 37 + +++ b/cmake/modules/LLDBConfig.cmake 38 + @@ -225,7 +225,7 @@ include_directories(BEFORE 39 + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) 40 + install(DIRECTORY include/ 41 + COMPONENT lldb-headers 42 + - DESTINATION include 43 + + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} 44 + FILES_MATCHING 45 + PATTERN "*.h" 46 + PATTERN ".cmake" EXCLUDE 47 + @@ -233,7 +233,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) 48 + 49 + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/ 50 + COMPONENT lldb-headers 51 + - DESTINATION include 52 + + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} 53 + FILES_MATCHING 54 + PATTERN "*.h" 55 + PATTERN ".cmake" EXCLUDE 56 + diff --git a/tools/intel-features/CMakeLists.txt b/tools/intel-features/CMakeLists.txt 57 + index 734167e51bc5..f95761b5df58 100644 58 + --- a/tools/intel-features/CMakeLists.txt 59 + +++ b/tools/intel-features/CMakeLists.txt 60 + @@ -65,4 +65,4 @@ if (LLDB_ENABLE_PYTHON AND LLDB_BUILD_INTEL_PT) 61 + endif() 62 + 63 + install(TARGETS lldbIntelFeatures 64 + - LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}) 65 + + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX})
+31
pkgs/development/compilers/llvm/git/lldb/procfs.patch
··· 1 + --- a/source/Plugins/Process/Linux/Procfs.h 2 + +++ b/source/Plugins/Process/Linux/Procfs.h 3 + @@ -11,21 +11,12 @@ 4 + // sys/procfs.h on Android/Linux for all supported architectures. 5 + 6 + #include <sys/ptrace.h> 7 + +#include <asm/ptrace.h> 8 + 9 + -#ifdef __ANDROID__ 10 + -#if defined(__arm64__) || defined(__aarch64__) 11 + -typedef unsigned long elf_greg_t; 12 + -typedef elf_greg_t 13 + - elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))]; 14 + -typedef struct user_fpsimd_state elf_fpregset_t; 15 + -#ifndef NT_FPREGSET 16 + -#define NT_FPREGSET NT_PRFPREG 17 + -#endif // NT_FPREGSET 18 + -#elif defined(__mips__) 19 + -#ifndef NT_FPREGSET 20 + -#define NT_FPREGSET NT_PRFPREG 21 + -#endif // NT_FPREGSET 22 + -#endif 23 + -#else // __ANDROID__ 24 + +#if !defined(__GLIBC__) && defined(__powerpc__) 25 + +#define pt_regs musl_pt_regs 26 + +#include <sys/procfs.h> 27 + +#undef pt_regs 28 + +#else 29 + #include <sys/procfs.h> 30 + -#endif // __ANDROID__ 31 + +#endif
+13
pkgs/development/compilers/llvm/git/lldb/resource-dir.patch
··· 1 + diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake 2 + index 37364341ff8b..7f74c1a3e257 100644 3 + --- a/cmake/modules/LLDBConfig.cmake 4 + +++ b/cmake/modules/LLDBConfig.cmake 5 + @@ -257,7 +257,7 @@ if (NOT TARGET clang-resource-headers) 6 + # Iterate over the possible places where the external resource directory 7 + # could be and pick the first that exists. 8 + foreach(CANDIDATE "${Clang_DIR}/../.." "${LLVM_DIR}" "${LLVM_LIBRARY_DIRS}" 9 + - "${LLVM_BUILD_LIBRARY_DIR}" 10 + + "${LLVM_BUILD_LIBRARY_DIR}" "@clangLibDir@" 11 + "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}") 12 + # Build the resource directory path by appending 'clang/<version number>'. 13 + set(CANDIDATE_RESOURCE_DIR "${CANDIDATE}/clang/${LLDB_CLANG_RESOURCE_DIR_NAME}")
+220
pkgs/development/compilers/llvm/git/llvm/default.nix
··· 1 + { lib, stdenv, llvm_meta 2 + , pkgsBuildBuild 3 + , src 4 + , fetchpatch 5 + , cmake 6 + , python3 7 + , libffi 8 + , libbfd 9 + , libpfm 10 + , libxml2 11 + , ncurses 12 + , version 13 + , release_version 14 + , zlib 15 + , buildLlvmTools 16 + , debugVersion ? false 17 + , enableManpages ? false 18 + , enableSharedLibraries ? !stdenv.hostPlatform.isStatic 19 + , enablePFM ? !(stdenv.isDarwin 20 + || stdenv.isAarch64 # broken for Ampere eMAG 8180 (c2.large.arm on Packet) #56245 21 + || stdenv.isAarch32 # broken for the armv7l builder 22 + ) 23 + , enablePolly ? false 24 + }: 25 + 26 + let 27 + inherit (lib) optional optionals optionalString; 28 + 29 + # Used when creating a version-suffixed symlink of libLLVM.dylib 30 + shortVersion = with lib; 31 + concatStringsSep "." (take 1 (splitString "." release_version)); 32 + 33 + in stdenv.mkDerivation (rec { 34 + pname = "llvm"; 35 + inherit version; 36 + 37 + inherit src; 38 + sourceRoot = "source/${pname}"; 39 + 40 + outputs = [ "out" "lib" "dev" "python" ]; 41 + 42 + nativeBuildInputs = [ cmake python3 ] 43 + ++ optionals enableManpages [ python3.pkgs.sphinx python3.pkgs.recommonmark ]; 44 + 45 + buildInputs = [ libxml2 libffi ] 46 + ++ optional enablePFM libpfm; # exegesis 47 + 48 + propagatedBuildInputs = [ ncurses zlib ]; 49 + 50 + patches = [ 51 + ./gnu-install-dirs.patch 52 + # On older CPUs (e.g. Hydra/wendy) we'd be getting an error in this test. 53 + (fetchpatch { 54 + name = "uops-CMOV16rm-noreg.diff"; 55 + url = "https://github.com/llvm/llvm-project/commit/9e9f991ac033.diff"; 56 + sha256 = "sha256:12s8vr6ibri8b48h2z38f3afhwam10arfiqfy4yg37bmc054p5hi"; 57 + stripLen = 1; 58 + }) 59 + ] ++ lib.optional enablePolly ./gnu-install-dirs-polly.patch; 60 + 61 + postPatch = optionalString stdenv.isDarwin '' 62 + substituteInPlace cmake/modules/AddLLVM.cmake \ 63 + --replace 'set(_install_name_dir INSTALL_NAME_DIR "@rpath")' "set(_install_name_dir)" \ 64 + --replace 'set(_install_rpath "@loader_path/../''${CMAKE_INSTALL_LIBDIR}''${LLVM_LIBDIR_SUFFIX}" ''${extra_libdir})' "" 65 + '' 66 + # Patch llvm-config to return correct library path based on --link-{shared,static}. 67 + + optionalString (enableSharedLibraries) '' 68 + substitute '${./outputs.patch}' ./outputs.patch --subst-var lib 69 + patch -p1 < ./outputs.patch 70 + '' + '' 71 + # FileSystem permissions tests fail with various special bits 72 + substituteInPlace unittests/Support/CMakeLists.txt \ 73 + --replace "Path.cpp" "" 74 + rm unittests/Support/Path.cpp 75 + substituteInPlace unittests/IR/CMakeLists.txt \ 76 + --replace "PassBuilderCallbacksTest.cpp" "" 77 + rm unittests/IR/PassBuilderCallbacksTest.cpp 78 + '' + optionalString stdenv.hostPlatform.isMusl '' 79 + patch -p1 -i ${../../TLI-musl.patch} 80 + substituteInPlace unittests/Support/CMakeLists.txt \ 81 + --replace "add_subdirectory(DynamicLibrary)" "" 82 + rm unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp 83 + # valgrind unhappy with musl or glibc, but fails w/musl only 84 + rm test/CodeGen/AArch64/wineh4.mir 85 + '' + optionalString stdenv.hostPlatform.isAarch32 '' 86 + # skip failing X86 test cases on 32-bit ARM 87 + rm test/DebugInfo/X86/convert-debugloc.ll 88 + rm test/DebugInfo/X86/convert-inlined.ll 89 + rm test/DebugInfo/X86/convert-linked.ll 90 + rm test/tools/dsymutil/X86/op-convert.test 91 + '' + optionalString (stdenv.hostPlatform.system == "armv6l-linux") '' 92 + # Seems to require certain floating point hardware (NEON?) 93 + rm test/ExecutionEngine/frem.ll 94 + '' + '' 95 + patchShebangs test/BugPoint/compile-custom.ll.py 96 + ''; 97 + 98 + # hacky fix: created binaries need to be run before installation 99 + preBuild = '' 100 + mkdir -p $out/ 101 + ln -sv $PWD/lib $out 102 + ''; 103 + 104 + # E.g. mesa.drivers use the build-id as a cache key (see #93946): 105 + LDFLAGS = optionalString (enableSharedLibraries && !stdenv.isDarwin) "-Wl,--build-id=sha1"; 106 + 107 + cmakeFlags = with stdenv; [ 108 + "-DLLVM_INSTALL_CMAKE_DIR=${placeholder "dev"}/lib/cmake/llvm/" 109 + "-DCMAKE_BUILD_TYPE=${if debugVersion then "Debug" else "Release"}" 110 + "-DLLVM_INSTALL_UTILS=ON" # Needed by rustc 111 + "-DLLVM_BUILD_TESTS=ON" 112 + "-DLLVM_ENABLE_FFI=ON" 113 + "-DLLVM_ENABLE_RTTI=ON" 114 + "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}" 115 + "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}" 116 + "-DLLVM_ENABLE_DUMP=ON" 117 + ] ++ optionals enableSharedLibraries [ 118 + "-DLLVM_LINK_LLVM_DYLIB=ON" 119 + ] ++ optionals enableManpages [ 120 + "-DLLVM_BUILD_DOCS=ON" 121 + "-DLLVM_ENABLE_SPHINX=ON" 122 + "-DSPHINX_OUTPUT_MAN=ON" 123 + "-DSPHINX_OUTPUT_HTML=OFF" 124 + "-DSPHINX_WARNINGS_AS_ERRORS=OFF" 125 + ] ++ optionals (!isDarwin) [ 126 + "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include" 127 + ] ++ optionals isDarwin [ 128 + "-DLLVM_ENABLE_LIBCXX=ON" 129 + "-DCAN_TARGET_i386=false" 130 + ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ 131 + "-DCMAKE_CROSSCOMPILING=True" 132 + "-DLLVM_TABLEGEN=${buildLlvmTools.llvm}/bin/llvm-tblgen" 133 + ( 134 + let 135 + nativeCC = pkgsBuildBuild.targetPackages.stdenv.cc; 136 + nativeBintools = nativeCC.bintools.bintools; 137 + nativeToolchainFlags = [ 138 + "-DCMAKE_C_COMPILER=${nativeCC}/bin/${nativeCC.targetPrefix}cc" 139 + "-DCMAKE_CXX_COMPILER=${nativeCC}/bin/${nativeCC.targetPrefix}c++" 140 + "-DCMAKE_AR=${nativeBintools}/bin/${nativeBintools.targetPrefix}ar" 141 + "-DCMAKE_STRIP=${nativeBintools}/bin/${nativeBintools.targetPrefix}strip" 142 + "-DCMAKE_RANLIB=${nativeBintools}/bin/${nativeBintools.targetPrefix}ranlib" 143 + ]; 144 + in "-DCROSS_TOOLCHAIN_FLAGS_NATIVE:list=${lib.concatStringsSep ";" nativeToolchainFlags}" 145 + ) 146 + ]; 147 + 148 + postBuild = '' 149 + rm -fR $out 150 + ''; 151 + 152 + preCheck = '' 153 + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/lib 154 + ''; 155 + 156 + postInstall = '' 157 + mkdir -p $python/share 158 + mv $out/share/opt-viewer $python/share/opt-viewer 159 + moveToOutput "bin/llvm-config*" "$dev" 160 + substituteInPlace "$dev/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ 161 + --replace "\''${_IMPORT_PREFIX}/lib/lib" "$lib/lib/lib" \ 162 + --replace "$out/bin/llvm-config" "$dev/bin/llvm-config" 163 + substituteInPlace "$dev/lib/cmake/llvm/LLVMConfig.cmake" \ 164 + --replace 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}")' 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}'"$lib"'")' 165 + '' 166 + + optionalString (stdenv.isDarwin && enableSharedLibraries) '' 167 + ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${shortVersion}.dylib 168 + ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib 169 + '' 170 + + optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' 171 + cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native 172 + ''; 173 + 174 + doCheck = stdenv.isLinux && (!stdenv.isx86_32) && (!stdenv.hostPlatform.isMusl); 175 + 176 + checkTarget = "check-all"; 177 + 178 + requiredSystemFeatures = [ "big-parallel" ]; 179 + meta = llvm_meta // { 180 + homepage = "https://llvm.org/"; 181 + description = "A collection of modular and reusable compiler and toolchain technologies"; 182 + longDescription = '' 183 + The LLVM Project is a collection of modular and reusable compiler and 184 + toolchain technologies. Despite its name, LLVM has little to do with 185 + traditional virtual machines. The name "LLVM" itself is not an acronym; it 186 + is the full name of the project. 187 + LLVM began as a research project at the University of Illinois, with the 188 + goal of providing a modern, SSA-based compilation strategy capable of 189 + supporting both static and dynamic compilation of arbitrary programming 190 + languages. Since then, LLVM has grown to be an umbrella project consisting 191 + of a number of subprojects, many of which are being used in production by 192 + a wide variety of commercial and open source projects as well as being 193 + widely used in academic research. Code in the LLVM project is licensed 194 + under the "Apache 2.0 License with LLVM exceptions". 195 + ''; 196 + }; 197 + } // lib.optionalAttrs enableManpages { 198 + pname = "llvm-manpages"; 199 + 200 + buildPhase = '' 201 + make docs-llvm-man 202 + ''; 203 + 204 + propagatedBuildInputs = []; 205 + 206 + installPhase = '' 207 + make -C docs install 208 + ''; 209 + 210 + postPatch = null; 211 + postInstall = null; 212 + 213 + outputs = [ "out" ]; 214 + 215 + doCheck = false; 216 + 217 + meta = llvm_meta // { 218 + description = "man pages for LLVM ${version}"; 219 + }; 220 + })
+105
pkgs/development/compilers/llvm/git/llvm/gnu-install-dirs-polly.patch
··· 1 + diff --git a/tools/polly/CMakeLists.txt b/tools/polly/CMakeLists.txt 2 + index ca7c04c565bb..6ed5db5dd4f8 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.13.4) 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 + @@ -122,13 +126,13 @@ 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 + ) 26 + 27 + install(DIRECTORY ${POLLY_BINARY_DIR}/include/ 28 + - DESTINATION include 29 + + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} 30 + FILES_MATCHING 31 + PATTERN "*.h" 32 + PATTERN "CMakeFiles" EXCLUDE 33 + diff --git a/tools/polly/cmake/CMakeLists.txt b/tools/polly/cmake/CMakeLists.txt 34 + index 7cc129ba2e90..137be25e4b80 100644 35 + --- a/tools/polly/cmake/CMakeLists.txt 36 + +++ b/tools/polly/cmake/CMakeLists.txt 37 + @@ -79,18 +79,18 @@ file(GENERATE 38 + 39 + # Generate PollyConfig.cmake for the install tree. 40 + unset(POLLY_EXPORTS) 41 + -set(POLLY_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") 42 + +set(POLLY_INSTALL_PREFIX "") 43 + set(POLLY_CONFIG_LLVM_CMAKE_DIR "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}") 44 + -set(POLLY_CONFIG_CMAKE_DIR "${POLLY_INSTALL_PREFIX}/${POLLY_INSTALL_PACKAGE_DIR}") 45 + -set(POLLY_CONFIG_LIBRARY_DIRS "${POLLY_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}") 46 + +set(POLLY_CONFIG_CMAKE_DIR "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_PREFIX}/${POLLY_INSTALL_PACKAGE_DIR}") 47 + +set(POLLY_CONFIG_LIBRARY_DIRS "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") 48 + if (POLLY_BUNDLED_ISL) 49 + set(POLLY_CONFIG_INCLUDE_DIRS 50 + - "${POLLY_INSTALL_PREFIX}/include" 51 + - "${POLLY_INSTALL_PREFIX}/include/polly" 52 + + "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}" 53 + + "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}/polly" 54 + ) 55 + else() 56 + set(POLLY_CONFIG_INCLUDE_DIRS 57 + - "${POLLY_INSTALL_PREFIX}/include" 58 + + "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_INCLUDEDIR}" 59 + ${ISL_INCLUDE_DIRS} 60 + ) 61 + endif() 62 + @@ -100,12 +100,12 @@ endif() 63 + foreach(tgt IN LISTS POLLY_CONFIG_EXPORTED_TARGETS) 64 + get_target_property(tgt_type ${tgt} TYPE) 65 + if (tgt_type STREQUAL "EXECUTABLE") 66 + - set(tgt_prefix "bin/") 67 + + set(tgt_prefix "${CMAKE_INSTALL_BINDIR}/") 68 + else() 69 + - set(tgt_prefix "lib/") 70 + + set(tgt_prefix "${CMAKE_INSTALL_LIBDIR}/") 71 + endif() 72 + 73 + - set(tgt_path "${CMAKE_INSTALL_PREFIX}/${tgt_prefix}$<TARGET_FILE_NAME:${tgt}>") 74 + + set(tgt_path "${tgt_prefix}$<TARGET_FILE_NAME:${tgt}>") 75 + file(RELATIVE_PATH tgt_path ${POLLY_CONFIG_CMAKE_DIR} ${tgt_path}) 76 + 77 + if (NOT tgt_type STREQUAL "INTERFACE_LIBRARY") 78 + diff --git a/tools/polly/cmake/polly_macros.cmake b/tools/polly/cmake/polly_macros.cmake 79 + index 518a09b45a42..bd9d6f5542ad 100644 80 + --- a/tools/polly/cmake/polly_macros.cmake 81 + +++ b/tools/polly/cmake/polly_macros.cmake 82 + @@ -44,8 +44,8 @@ macro(add_polly_library name) 83 + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LLVMPolly") 84 + install(TARGETS ${name} 85 + EXPORT LLVMExports 86 + - LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} 87 + - ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}) 88 + + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} 89 + + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) 90 + endif() 91 + set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) 92 + endmacro(add_polly_library) 93 + diff --git a/tools/polly/lib/External/CMakeLists.txt b/tools/polly/lib/External/CMakeLists.txt 94 + index 8991094d92c7..178d8ad606bb 100644 95 + --- a/tools/polly/lib/External/CMakeLists.txt 96 + +++ b/tools/polly/lib/External/CMakeLists.txt 97 + @@ -275,7 +275,7 @@ if (POLLY_BUNDLED_ISL) 98 + install(DIRECTORY 99 + ${ISL_SOURCE_DIR}/include/ 100 + ${ISL_BINARY_DIR}/include/ 101 + - DESTINATION include/polly 102 + + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/polly 103 + FILES_MATCHING 104 + PATTERN "*.h" 105 + PATTERN "CMakeFiles" EXCLUDE
+417
pkgs/development/compilers/llvm/git/llvm/gnu-install-dirs.patch
··· 1 + diff --git a/CMakeLists.txt b/CMakeLists.txt 2 + index 277d0fe54d7b..af69c8be8745 100644 3 + --- a/CMakeLists.txt 4 + +++ b/CMakeLists.txt 5 + @@ -256,15 +256,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 + @@ -567,9 +573,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 + @@ -1027,7 +1033,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 + @@ -1038,7 +1044,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 + @@ -1052,13 +1058,13 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) 59 + 60 + if (LLVM_INSTALL_MODULEMAPS) 61 + install(DIRECTORY include/llvm include/llvm-c 62 + - DESTINATION include 63 + + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} 64 + COMPONENT llvm-headers 65 + FILES_MATCHING 66 + PATTERN "module.modulemap" 67 + ) 68 + install(FILES include/llvm/module.install.modulemap 69 + - DESTINATION include/llvm 70 + + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm 71 + COMPONENT llvm-headers 72 + RENAME "module.extern.modulemap" 73 + ) 74 + diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake 75 + index 97c9980c7de3..409e8b615f75 100644 76 + --- a/cmake/modules/AddLLVM.cmake 77 + +++ b/cmake/modules/AddLLVM.cmake 78 + @@ -804,9 +804,9 @@ macro(add_llvm_library name) 79 + 80 + install(TARGETS ${name} 81 + ${export_to_llvmexports} 82 + - LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} 83 + - ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} 84 + - RUNTIME DESTINATION bin COMPONENT ${name}) 85 + + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} 86 + + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} 87 + + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ${name}) 88 + 89 + if (NOT LLVM_ENABLE_IDE) 90 + add_llvm_install_targets(install-${name} 91 + @@ -1022,7 +1022,7 @@ function(process_llvm_pass_plugins) 92 + "set(LLVM_STATIC_EXTENSIONS ${LLVM_STATIC_EXTENSIONS})") 93 + install(FILES 94 + ${llvm_cmake_builddir}/LLVMConfigExtensions.cmake 95 + - DESTINATION ${LLVM_INSTALL_PACKAGE_DIR} 96 + + DESTINATION ${LLVM_INSTALL_CMAKE_DIR} 97 + COMPONENT cmake-exports) 98 + 99 + set(ExtensionDef "${LLVM_BINARY_DIR}/include/llvm/Support/Extension.def") 100 + @@ -1242,7 +1242,7 @@ macro(add_llvm_example name) 101 + endif() 102 + add_llvm_executable(${name} ${ARGN}) 103 + if( LLVM_BUILD_EXAMPLES ) 104 + - install(TARGETS ${name} RUNTIME DESTINATION examples) 105 + + install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples) 106 + endif() 107 + set_target_properties(${name} PROPERTIES FOLDER "Examples") 108 + endmacro(add_llvm_example name) 109 + @@ -1854,7 +1854,7 @@ function(llvm_install_library_symlink name dest type) 110 + set(full_name ${CMAKE_${type}_LIBRARY_PREFIX}${name}${CMAKE_${type}_LIBRARY_SUFFIX}) 111 + set(full_dest ${CMAKE_${type}_LIBRARY_PREFIX}${dest}${CMAKE_${type}_LIBRARY_SUFFIX}) 112 + 113 + - set(output_dir lib${LLVM_LIBDIR_SUFFIX}) 114 + + set(output_dir ${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) 115 + if(WIN32 AND "${type}" STREQUAL "SHARED") 116 + set(output_dir bin) 117 + endif() 118 + @@ -1871,7 +1871,7 @@ function(llvm_install_library_symlink name dest type) 119 + endif() 120 + endfunction() 121 + 122 + -function(llvm_install_symlink name dest) 123 + +function(llvm_install_symlink name dest output_dir) 124 + cmake_parse_arguments(ARG "ALWAYS_GENERATE" "COMPONENT" "" ${ARGN}) 125 + foreach(path ${CMAKE_MODULE_PATH}) 126 + if(EXISTS ${path}/LLVMInstallSymlink.cmake) 127 + @@ -1894,7 +1894,7 @@ function(llvm_install_symlink name dest) 128 + set(full_dest ${dest}${CMAKE_EXECUTABLE_SUFFIX}) 129 + 130 + install(SCRIPT ${INSTALL_SYMLINK} 131 + - CODE "install_symlink(${full_name} ${full_dest} ${LLVM_TOOLS_INSTALL_DIR})" 132 + + CODE "install_symlink(${full_name} ${full_dest} ${output_dir})" 133 + COMPONENT ${component}) 134 + 135 + if (NOT LLVM_ENABLE_IDE AND NOT ARG_ALWAYS_GENERATE) 136 + @@ -1977,7 +1977,8 @@ function(add_llvm_tool_symlink link_name target) 137 + endif() 138 + 139 + if ((TOOL_IS_TOOLCHAIN OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY) AND LLVM_BUILD_TOOLS) 140 + - llvm_install_symlink(${link_name} ${target}) 141 + + GNUInstallDirs_get_absolute_install_dir(output_dir LLVM_TOOLS_INSTALL_DIR) 142 + + llvm_install_symlink(${link_name} ${target} ${output_dir}) 143 + endif() 144 + endif() 145 + endfunction() 146 + @@ -2100,9 +2101,9 @@ function(llvm_setup_rpath name) 147 + 148 + if (APPLE) 149 + set(_install_name_dir INSTALL_NAME_DIR "@rpath") 150 + - set(_install_rpath "@loader_path/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) 151 + + set(_install_rpath "@loader_path/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) 152 + elseif(UNIX) 153 + - set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) 154 + + set(_install_rpath "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) 155 + if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)") 156 + set_property(TARGET ${name} APPEND_STRING PROPERTY 157 + LINK_FLAGS " -Wl,-z,origin ") 158 + diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake 159 + index 554046b20edf..4d1ad980641e 100644 160 + --- a/cmake/modules/AddOCaml.cmake 161 + +++ b/cmake/modules/AddOCaml.cmake 162 + @@ -144,9 +144,9 @@ function(add_ocaml_library name) 163 + endforeach() 164 + 165 + if( APPLE ) 166 + - set(ocaml_rpath "@executable_path/../../../lib${LLVM_LIBDIR_SUFFIX}") 167 + + set(ocaml_rpath "@executable_path/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") 168 + elseif( UNIX ) 169 + - set(ocaml_rpath "\\$ORIGIN/../../../lib${LLVM_LIBDIR_SUFFIX}") 170 + + set(ocaml_rpath "\\$ORIGIN/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") 171 + endif() 172 + list(APPEND ocaml_flags "-ldopt" "-Wl,-rpath,${ocaml_rpath}") 173 + 174 + diff --git a/cmake/modules/AddSphinxTarget.cmake b/cmake/modules/AddSphinxTarget.cmake 175 + index e80c3b5c1cac..482f6d715ef5 100644 176 + --- a/cmake/modules/AddSphinxTarget.cmake 177 + +++ b/cmake/modules/AddSphinxTarget.cmake 178 + @@ -90,7 +90,7 @@ function (add_sphinx_target builder project) 179 + endif() 180 + elseif (builder STREQUAL html) 181 + string(TOUPPER "${project}" project_upper) 182 + - set(${project_upper}_INSTALL_SPHINX_HTML_DIR "share/doc/${project}/html" 183 + + set(${project_upper}_INSTALL_SPHINX_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/html" 184 + CACHE STRING "HTML documentation install directory for ${project}") 185 + 186 + # '/.' indicates: copy the contents of the directory directly into 187 + diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt 188 + index 505dc9a29d70..36e6c63af3f4 100644 189 + --- a/cmake/modules/CMakeLists.txt 190 + +++ b/cmake/modules/CMakeLists.txt 191 + @@ -1,4 +1,4 @@ 192 + -set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm) 193 + +set(LLVM_INSTALL_PACKAGE_DIR ${LLVM_INSTALL_CMAKE_DIR} CACHE STRING "Path for CMake subdirectory (defaults to 'cmake/llvm')") 194 + set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}") 195 + 196 + # First for users who use an installed LLVM, create the LLVMExports.cmake file. 197 + @@ -107,13 +107,13 @@ foreach(p ${_count}) 198 + set(LLVM_CONFIG_CODE "${LLVM_CONFIG_CODE} 199 + get_filename_component(LLVM_INSTALL_PREFIX \"\${LLVM_INSTALL_PREFIX}\" PATH)") 200 + endforeach(p) 201 + -set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/include") 202 + +set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}") 203 + set(LLVM_CONFIG_INCLUDE_DIR "${LLVM_CONFIG_INCLUDE_DIRS}") 204 + set(LLVM_CONFIG_MAIN_INCLUDE_DIR "${LLVM_CONFIG_INCLUDE_DIRS}") 205 + -set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/lib\${LLVM_LIBDIR_SUFFIX}") 206 + +set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\${LLVM_LIBDIR_SUFFIX}") 207 + set(LLVM_CONFIG_CMAKE_DIR "\${LLVM_INSTALL_PREFIX}/${LLVM_INSTALL_PACKAGE_DIR}") 208 + set(LLVM_CONFIG_BINARY_DIR "\${LLVM_INSTALL_PREFIX}") 209 + -set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/bin") 210 + +set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}") 211 + 212 + # Generate a default location for lit 213 + if (LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS) 214 + diff --git a/cmake/modules/LLVMInstallSymlink.cmake b/cmake/modules/LLVMInstallSymlink.cmake 215 + index 09fed8085c23..aa79f192abf0 100644 216 + --- a/cmake/modules/LLVMInstallSymlink.cmake 217 + +++ b/cmake/modules/LLVMInstallSymlink.cmake 218 + @@ -10,7 +10,7 @@ function(install_symlink name target outdir) 219 + set(LINK_OR_COPY copy) 220 + endif() 221 + 222 + - set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}/") 223 + + set(bindir "${DESTDIR}${outdir}/") 224 + 225 + message(STATUS "Creating ${name}") 226 + 227 + diff --git a/docs/CMake.rst b/docs/CMake.rst 228 + index bb821b417ad9..6a528f7c2ad3 100644 229 + --- a/docs/CMake.rst 230 + +++ b/docs/CMake.rst 231 + @@ -196,7 +196,7 @@ CMake manual, or execute ``cmake --help-variable VARIABLE_NAME``. 232 + **LLVM_LIBDIR_SUFFIX**:STRING 233 + Extra suffix to append to the directory where libraries are to be 234 + installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64`` 235 + - to install libraries to ``/usr/lib64``. 236 + + to install libraries to ``/usr/lib64``. See also ``CMAKE_INSTALL_LIBDIR``. 237 + 238 + **CMAKE_C_FLAGS**:STRING 239 + Extra flags to use when compiling C source files. 240 + @@ -550,8 +550,8 @@ LLVM-specific variables 241 + 242 + **LLVM_INSTALL_DOXYGEN_HTML_DIR**:STRING 243 + The path to install Doxygen-generated HTML documentation to. This path can 244 + - either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to 245 + - `share/doc/llvm/doxygen-html`. 246 + + either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to 247 + + `${CMAKE_INSTALL_DOCDIR}/${project}/doxygen-html`. 248 + 249 + **LLVM_ENABLE_SPHINX**:BOOL 250 + If specified, CMake will search for the ``sphinx-build`` executable and will make 251 + @@ -582,13 +582,33 @@ LLVM-specific variables 252 + 253 + **LLVM_INSTALL_SPHINX_HTML_DIR**:STRING 254 + The path to install Sphinx-generated HTML documentation to. This path can 255 + - either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to 256 + - `share/doc/llvm/html`. 257 + + either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to 258 + + `${CMAKE_INSTALL_DOCDIR}/${project}/html`. 259 + 260 + **LLVM_INSTALL_OCAMLDOC_HTML_DIR**:STRING 261 + The path to install OCamldoc-generated HTML documentation to. This path can 262 + - either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to 263 + - `share/doc/llvm/ocaml-html`. 264 + + either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to 265 + + `${CMAKE_INSTALL_DOCDIR}/${project}/ocaml-html`. 266 + + 267 + +**CMAKE_INSTALL_BINDIR**:STRING 268 + + The path to install binary tools, relative to the ``CMAKE_INSTALL_PREFIX``. 269 + + Defaults to `bin`. 270 + + 271 + +**CMAKE_INSTALL_LIBDIR**:STRING 272 + + The path to install libraries, relative to the ``CMAKE_INSTALL_PREFIX``. 273 + + Defaults to `lib`. 274 + + 275 + +**CMAKE_INSTALL_INCLUDEDIR**:STRING 276 + + The path to install header files, relative to the ``CMAKE_INSTALL_PREFIX``. 277 + + Defaults to `include`. 278 + + 279 + +**CMAKE_INSTALL_DOCDIR**:STRING 280 + + The path to install documentation, relative to the ``CMAKE_INSTALL_PREFIX``. 281 + + Defaults to `share/doc`. 282 + + 283 + +**CMAKE_INSTALL_MANDIR**:STRING 284 + + The path to install manpage files, relative to the ``CMAKE_INSTALL_PREFIX``. 285 + + Defaults to `share/man`. 286 + 287 + **LLVM_CREATE_XCODE_TOOLCHAIN**:BOOL 288 + macOS Only: If enabled CMake will generate a target named 289 + @@ -786,9 +806,11 @@ the ``cmake`` command or by setting it directly in ``ccmake`` or ``cmake-gui``). 290 + 291 + This file is available in two different locations. 292 + 293 + -* ``<INSTALL_PREFIX>/lib/cmake/llvm/LLVMConfig.cmake`` where 294 + - ``<INSTALL_PREFIX>`` is the install prefix of an installed version of LLVM. 295 + - On Linux typically this is ``/usr/lib/cmake/llvm/LLVMConfig.cmake``. 296 + +* ``<LLVM_INSTALL_PACKAGE_DIR>LLVMConfig.cmake`` where 297 + + ``<LLVM_INSTALL_PACKAGE_DIR>`` is the location where LLVM CMake modules are 298 + + installed as part of an installed version of LLVM. This is typically 299 + + ``cmake/llvm/`` within the lib directory. On Linux, this is typically 300 + + ``/usr/lib/cmake/llvm/LLVMConfig.cmake``. 301 + 302 + * ``<LLVM_BUILD_ROOT>/lib/cmake/llvm/LLVMConfig.cmake`` where 303 + ``<LLVM_BUILD_ROOT>`` is the root of the LLVM build tree. **Note: this is only 304 + diff --git a/examples/Bye/CMakeLists.txt b/examples/Bye/CMakeLists.txt 305 + index bb96edb4b4bf..678c22fb43c8 100644 306 + --- a/examples/Bye/CMakeLists.txt 307 + +++ b/examples/Bye/CMakeLists.txt 308 + @@ -14,6 +14,6 @@ if (NOT WIN32) 309 + BUILDTREE_ONLY 310 + ) 311 + 312 + - install(TARGETS ${name} RUNTIME DESTINATION examples) 313 + + install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples) 314 + set_target_properties(${name} PROPERTIES FOLDER "Examples") 315 + endif() 316 + diff --git a/include/llvm/CMakeLists.txt b/include/llvm/CMakeLists.txt 317 + index b46319f24fc8..2feabd1954e4 100644 318 + --- a/include/llvm/CMakeLists.txt 319 + +++ b/include/llvm/CMakeLists.txt 320 + @@ -5,5 +5,5 @@ add_subdirectory(Frontend) 321 + # If we're doing an out-of-tree build, copy a module map for generated 322 + # header files into the build area. 323 + if (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") 324 + - configure_file(module.modulemap.build module.modulemap COPYONLY) 325 + + configure_file(module.modulemap.build ${LLVM_INCLUDE_DIR}/module.modulemap COPYONLY) 326 + endif (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") 327 + diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in 328 + index ebe5b73a5c65..70c497be12f5 100644 329 + --- a/tools/llvm-config/BuildVariables.inc.in 330 + +++ b/tools/llvm-config/BuildVariables.inc.in 331 + @@ -23,6 +23,10 @@ 332 + #define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@" 333 + #define LLVM_BUILDMODE "@LLVM_BUILDMODE@" 334 + #define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@" 335 + +#define LLVM_INSTALL_BINDIR "@CMAKE_INSTALL_BINDIR@" 336 + +#define LLVM_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@" 337 + +#define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@" 338 + +#define LLVM_INSTALL_CMAKEDIR "@LLVM_INSTALL_CMAKE_DIR@" 339 + #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@" 340 + #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@" 341 + #define LLVM_BUILD_SYSTEM "@LLVM_BUILD_SYSTEM@" 342 + diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp 343 + index 1a2f04552d13..44fa7d3eec6b 100644 344 + --- a/tools/llvm-config/llvm-config.cpp 345 + +++ b/tools/llvm-config/llvm-config.cpp 346 + @@ -357,12 +357,26 @@ int main(int argc, char **argv) { 347 + ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include"); 348 + } else { 349 + ActivePrefix = CurrentExecPrefix; 350 + - ActiveIncludeDir = ActivePrefix + "/include"; 351 + - SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR)); 352 + - sys::fs::make_absolute(ActivePrefix, path); 353 + - ActiveBinDir = std::string(path.str()); 354 + - ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX; 355 + - ActiveCMakeDir = ActiveLibDir + "/cmake/llvm"; 356 + + { 357 + + SmallString<256> path(StringRef(LLVM_INSTALL_INCLUDEDIR)); 358 + + sys::fs::make_absolute(ActivePrefix, path); 359 + + ActiveIncludeDir = std::string(path.str()); 360 + + } 361 + + { 362 + + SmallString<256> path(StringRef(LLVM_INSTALL_BINDIR)); 363 + + sys::fs::make_absolute(ActivePrefix, path); 364 + + ActiveBinDir = std::string(path.str()); 365 + + } 366 + + { 367 + + SmallString<256> path(StringRef(LLVM_INSTALL_LIBDIR LLVM_LIBDIR_SUFFIX)); 368 + + sys::fs::make_absolute(ActivePrefix, path); 369 + + ActiveLibDir = std::string(path.str()); 370 + + } 371 + + { 372 + + SmallString<256> path(StringRef(LLVM_INSTALL_CMAKEDIR)); 373 + + sys::fs::make_absolute(ActivePrefix, path); 374 + + ActiveCMakeDir = std::string(path.str()); 375 + + } 376 + ActiveIncludeOption = "-I" + ActiveIncludeDir; 377 + } 378 + 379 + diff --git a/tools/lto/CMakeLists.txt b/tools/lto/CMakeLists.txt 380 + index 2963f97cad88..69d66c9c9ca1 100644 381 + --- a/tools/lto/CMakeLists.txt 382 + +++ b/tools/lto/CMakeLists.txt 383 + @@ -25,7 +25,7 @@ add_llvm_library(LTO SHARED INSTALL_WITH_TOOLCHAIN ${SOURCES} DEPENDS 384 + intrinsics_gen) 385 + 386 + install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h 387 + - DESTINATION include/llvm-c 388 + + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm-c 389 + COMPONENT LTO) 390 + 391 + if (APPLE) 392 + diff --git a/tools/opt-viewer/CMakeLists.txt b/tools/opt-viewer/CMakeLists.txt 393 + index ead73ec13a8f..250362021f17 100644 394 + --- a/tools/opt-viewer/CMakeLists.txt 395 + +++ b/tools/opt-viewer/CMakeLists.txt 396 + @@ -8,7 +8,7 @@ set (files 397 + 398 + foreach (file ${files}) 399 + install(PROGRAMS ${file} 400 + - DESTINATION share/opt-viewer 401 + + DESTINATION ${CMAKE_INSTALL_DATADIR}/opt-viewer 402 + COMPONENT opt-viewer) 403 + endforeach (file) 404 + 405 + diff --git a/tools/remarks-shlib/CMakeLists.txt b/tools/remarks-shlib/CMakeLists.txt 406 + index 865436247270..ce1daa62f6ab 100644 407 + --- a/tools/remarks-shlib/CMakeLists.txt 408 + +++ b/tools/remarks-shlib/CMakeLists.txt 409 + @@ -19,7 +19,7 @@ if(LLVM_ENABLE_PIC) 410 + endif() 411 + 412 + install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/Remarks.h 413 + - DESTINATION include/llvm-c 414 + + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm-c 415 + COMPONENT Remarks) 416 + 417 + if (APPLE)
+26
pkgs/development/compilers/llvm/git/llvm/outputs.patch
··· 1 + diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp 2 + index 94d426b..37f7794 100644 3 + --- a/tools/llvm-config/llvm-config.cpp 4 + +++ b/tools/llvm-config/llvm-config.cpp 5 + @@ -333,6 +333,21 @@ int main(int argc, char **argv) { 6 + ActiveIncludeOption = "-I" + ActiveIncludeDir; 7 + } 8 + 9 + + /// Nix-specific multiple-output handling: override ActiveLibDir if --link-shared 10 + + if (!IsInDevelopmentTree) { 11 + + bool WantShared = true; 12 + + for (int i = 1; i < argc; ++i) { 13 + + StringRef Arg = argv[i]; 14 + + if (Arg == "--link-shared") 15 + + WantShared = true; 16 + + else if (Arg == "--link-static") 17 + + WantShared = false; // the last one wins 18 + + } 19 + + 20 + + if (WantShared) 21 + + ActiveLibDir = std::string("@lib@") + "/lib" + LLVM_LIBDIR_SUFFIX; 22 + + } 23 + + 24 + /// We only use `shared library` mode in cases where the static library form 25 + /// of the components provided are not available; note however that this is 26 + /// skipped if we're run from within the build dir. However, once installed,
+35
pkgs/development/compilers/llvm/git/openmp/default.nix
··· 1 + { lib 2 + , stdenv 3 + , llvm_meta 4 + , src 5 + , cmake 6 + , llvm 7 + , perl 8 + , version 9 + }: 10 + 11 + stdenv.mkDerivation rec { 12 + pname = "openmp"; 13 + inherit version; 14 + 15 + inherit src; 16 + sourceRoot = "source/${pname}"; 17 + 18 + nativeBuildInputs = [ cmake perl ]; 19 + buildInputs = [ llvm ]; 20 + 21 + meta = llvm_meta // { 22 + homepage = "https://openmp.llvm.org/"; 23 + description = "Support for the OpenMP language"; 24 + longDescription = '' 25 + The OpenMP subproject of LLVM contains the components required to build an 26 + executable OpenMP program that are outside the compiler itself. 27 + Contains the code for the runtime library against which code compiled by 28 + "clang -fopenmp" must be linked before it can run and the library that 29 + supports offload to target devices. 30 + ''; 31 + # "All of the code is dual licensed under the MIT license and the UIUC 32 + # License (a BSD-like license)": 33 + license = with lib.licenses; [ mit ncsa ]; 34 + }; 35 + }
+2 -2
pkgs/development/libraries/libck/default.nix
··· 2 2 3 3 stdenv.mkDerivation rec { 4 4 pname = "ck"; 5 - version = "0.7.0"; 5 + version = "0.7.1"; 6 6 7 7 src = fetchFromGitHub { 8 8 owner = "concurrencykit"; 9 9 repo = pname; 10 10 rev = version; 11 - sha256 = "1w7g0y1n7jslca693fb8sanlfi1biq956dw6avdx6pf3c2s7l9jd"; 11 + sha256 = "sha256-HUC+8Vd0koAmumRZ8gS5u6LVa7fUfkIYRaxVv6/7Hgg="; 12 12 }; 13 13 14 14 dontDisableStatic = true;
+2 -2
pkgs/development/libraries/mesa/default.nix
··· 31 31 let 32 32 # Release calendar: https://www.mesa3d.org/release-calendar.html 33 33 # Release frequency: https://www.mesa3d.org/releasing.html#schedule 34 - version = "21.1.1"; 34 + version = "21.1.2"; 35 35 branch = versions.major version; 36 36 37 37 self = stdenv.mkDerivation { ··· 45 45 "ftp://ftp.freedesktop.org/pub/mesa/${version}/mesa-${version}.tar.xz" 46 46 "ftp://ftp.freedesktop.org/pub/mesa/older-versions/${branch}.x/${version}/mesa-${version}.tar.xz" 47 47 ]; 48 - sha256 = "1lldnf307w6j0d874544f1dinn0gnnp1ds2xph8qjkh5g6imxhpf"; 48 + sha256 = "0pw2wba4q66rhdx0hpimvxmrl7k2vv315gmmk17kl7snc0vvdd13"; 49 49 }; 50 50 51 51 prePatch = "patchShebangs .";
+7
pkgs/development/libraries/polkit/default.nix
··· 34 34 url = "https://gitlab.freedesktop.org/polkit/polkit/commit/5dd4e22efd05d55833c4634b56e473812b5acbf2.patch"; 35 35 sha256 = "17lv7xj5ksa27iv4zpm4zwd4iy8zbwjj4ximslfq3sasiz9kxhlp"; 36 36 }) 37 + (fetchpatch { 38 + # https://www.openwall.com/lists/oss-security/2021/06/03/1 39 + # https://gitlab.freedesktop.org/polkit/polkit/-/merge_requests/79 40 + name = "CVE-2021-3560.patch"; 41 + url = "https://gitlab.freedesktop.org/polkit/polkit/-/commit/a04d13affe0fa53ff618e07aa8f57f4c0e3b9b81.patch"; 42 + sha256 = "157ddsizgr290jsb8fpafrc37gc1qw5pdvl351vnn3pzhqs7n6f4"; 43 + }) 37 44 ] ++ lib.optionals stdenv.hostPlatform.isMusl [ 38 45 # Make netgroup support optional (musl does not have it) 39 46 # Upstream MR: https://gitlab.freedesktop.org/polkit/polkit/merge_requests/10
+47
pkgs/development/python-modules/click-option-group/default.nix
··· 1 + { lib 2 + , buildPythonPackage 3 + , pythonOlder 4 + , fetchFromGitHub 5 + , click 6 + , pytestCheckHook 7 + }: 8 + 9 + buildPythonPackage rec { 10 + pname = "click-option-group"; 11 + version = "0.5.3"; 12 + format = "setuptools"; 13 + disabled = pythonOlder "3.6"; 14 + 15 + src = fetchFromGitHub { 16 + owner = "click-contrib"; 17 + repo = pname; 18 + rev = "v${version}"; 19 + sha256 = "1w0692s8fabncpggpwl2d4dfqjjlmcia271rrb8hcz0r6nvw98ak"; 20 + }; 21 + 22 + propagatedBuildInputs = [ 23 + click 24 + ]; 25 + 26 + checkInputs = [ 27 + pytestCheckHook 28 + ]; 29 + 30 + pythonImportsCheck = [ 31 + "click_option_group" 32 + ]; 33 + 34 + meta = with lib; { 35 + description = "Option groups missing in Click"; 36 + longDescription = '' 37 + Option groups are convenient mechanism for logical structuring 38 + CLI, also it allows you to set the specific behavior and set the 39 + relationship among grouped options (mutually exclusive options 40 + for example). Moreover, argparse stdlib package contains this 41 + functionality out of the box. 42 + ''; 43 + homepage = "https://github.com/click-contrib/click-option-group"; 44 + license = licenses.bsd3; 45 + maintainers = with maintainers; [ hexa ]; 46 + }; 47 + }
+2 -2
pkgs/misc/drivers/epson-alc1100/default.nix
··· 13 13 inherit version; 14 14 15 15 src = fetchurl { 16 - url = "http://a1227.g.akamai.net/f/1227/40484/7d/download.ebz.epson.net/dsc/f/01/00/01/58/65/cd71929d2bf41ebf7e96f68fa9f1279556545ef1/Epson-ALC1100-filter-1.2.tar.gz"; 17 - sha256 = "0q0bf4dfm4v69l7xg6sgkh7rwb0h77i8j9kplq1dfkd208g7y81p"; 16 + url = "https://download3.ebz.epson.net/dsc/f/03/00/11/33/07/4027e99517b5c388d444b8444d719b4b77f7e9db/Epson-ALC1100-filter-1.2.tar.gz"; 17 + sha256 = "1dfw75a3kj2aa4iicvlk9kz3jarrsikpnpd4cdpw79scfc5mwm2p"; 18 18 }; 19 19 20 20 patches = [ ./cups-data-dir.patch ./ppd.patch ];
+2
pkgs/servers/matrix-synapse/tools/default.nix
··· 1 1 { callPackage }: 2 2 { 3 3 rust-synapse-compress-state = callPackage ./rust-synapse-compress-state.nix { }; 4 + 5 + synadm = callPackage ./synadm.nix { }; 4 6 }
+41
pkgs/servers/matrix-synapse/tools/synadm.nix
··· 1 + { lib 2 + , python3Packages 3 + }: 4 + 5 + with python3Packages; buildPythonApplication rec { 6 + pname = "synadm"; 7 + version = "0.29"; 8 + format = "setuptools"; 9 + 10 + src = fetchPypi { 11 + inherit pname version; 12 + sha256 = "1vy30nwsns4jnv0s5i9jpyplxpclgwyw0gldpywv4z3fljs0lzik"; 13 + }; 14 + 15 + propagatedBuildInputs = [ 16 + click 17 + click-option-group 18 + tabulate 19 + pyyaml 20 + requests 21 + ]; 22 + 23 + checkPhase = '' 24 + runHook preCheck 25 + export HOME=$TMPDIR 26 + $out/bin/synadm -h > /dev/null 27 + runHook postCheck 28 + ''; 29 + 30 + meta = with lib; { 31 + description = "Command line admin tool for Synapse"; 32 + longDescription = '' 33 + A CLI tool to help admins of Matrix Synapse homeservers 34 + conveniently issue commands available via its admin API's 35 + (matrix-org/synapse@master/docs/admin_api) 36 + ''; 37 + homepage = "https://github.com/JOJ0/synadm"; 38 + license = licenses.gpl3Plus; 39 + maintainers = with maintainers; [ hexa ]; 40 + }; 41 + }
+7
pkgs/top-level/aliases.nix
··· 1072 1072 sddm 1073 1073 ; 1074 1074 1075 + # LLVM packages for (integration) testing that should not be used inside Nixpkgs: 1076 + llvmPackages_git = recurseIntoAttrs (callPackage ../development/compilers/llvm/git { 1077 + inherit (stdenvAdapters) overrideCC; 1078 + buildLlvmTools = buildPackages.llvmPackages_git.tools; 1079 + targetLlvmLibraries = targetPackages.llvmPackages_git.libraries; 1080 + }); 1081 + 1075 1082 })
+2
pkgs/top-level/python-packages.nix
··· 1417 1417 1418 1418 click-log = callPackage ../development/python-modules/click-log { }; 1419 1419 1420 + click-option-group = callPackage ../development/python-modules/click-option-group { }; 1421 + 1420 1422 click-plugins = callPackage ../development/python-modules/click-plugins { }; 1421 1423 1422 1424 click-spinner = callPackage ../development/python-modules/click-spinner { };