llvmPackages_15: copy from `llvmPackages_git`

+2192
+29
pkgs/development/compilers/llvm/15/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 + ''
+133
pkgs/development/compilers/llvm/15/clang/default.nix
··· 1 + { lib, stdenv, llvm_meta 2 + , monorepoSrc, runCommand 3 + , substituteAll, cmake, libxml2, libllvm, version, python3 4 + , buildLlvmTools 5 + , fixDarwinDylibNames 6 + , enableManpages ? false 7 + }: 8 + 9 + let 10 + self = stdenv.mkDerivation (rec { 11 + pname = "clang"; 12 + inherit version; 13 + 14 + src = runCommand "${pname}-src-${version}" {} '' 15 + mkdir -p "$out" 16 + cp -r ${monorepoSrc}/cmake "$out" 17 + cp -r ${monorepoSrc}/${pname} "$out" 18 + cp -r ${monorepoSrc}/clang-tools-extra "$out" 19 + ''; 20 + 21 + sourceRoot = "${src.name}/${pname}"; 22 + 23 + nativeBuildInputs = [ cmake python3 ] 24 + ++ lib.optional enableManpages python3.pkgs.sphinx 25 + ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; 26 + 27 + buildInputs = [ libxml2 libllvm ]; 28 + 29 + cmakeFlags = [ 30 + "-DCLANG_INSTALL_PACKAGE_DIR=${placeholder "dev"}/lib/cmake/clang" 31 + "-DCMAKE_CXX_FLAGS=-std=c++14" 32 + "-DCLANGD_BUILD_XPC=OFF" 33 + "-DLLVM_ENABLE_RTTI=ON" 34 + ] ++ lib.optionals enableManpages [ 35 + "-DCLANG_INCLUDE_DOCS=ON" 36 + "-DLLVM_ENABLE_SPHINX=ON" 37 + "-DSPHINX_OUTPUT_MAN=ON" 38 + "-DSPHINX_OUTPUT_HTML=OFF" 39 + "-DSPHINX_WARNINGS_AS_ERRORS=OFF" 40 + ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ 41 + "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" 42 + "-DCLANG_TABLEGEN=${buildLlvmTools.libclang.dev}/bin/clang-tblgen" 43 + ]; 44 + 45 + patches = [ 46 + ./purity.patch 47 + # https://reviews.llvm.org/D51899 48 + ./gnu-install-dirs.patch 49 + (substituteAll { 50 + src = ../../clang-11-12-LLVMgold-path.patch; 51 + libllvmLibdir = "${libllvm.lib}/lib"; 52 + }) 53 + ]; 54 + 55 + postPatch = '' 56 + (cd tools && ln -s ../../clang-tools-extra extra) 57 + 58 + sed -i -e 's/DriverArgs.hasArg(options::OPT_nostdlibinc)/true/' \ 59 + -e 's/Args.hasArg(options::OPT_nostdlibinc)/true/' \ 60 + lib/Driver/ToolChains/*.cpp 61 + 62 + # Patch for standalone doc building 63 + sed -i '1s,^,find_package(Sphinx REQUIRED)\n,' docs/CMakeLists.txt 64 + '' + lib.optionalString stdenv.hostPlatform.isMusl '' 65 + sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp 66 + ''; 67 + 68 + outputs = [ "out" "lib" "dev" "python" ]; 69 + 70 + postInstall = '' 71 + ln -sv $out/bin/clang $out/bin/cpp 72 + 73 + # Move libclang to 'lib' output 74 + moveToOutput "lib/libclang.*" "$lib" 75 + moveToOutput "lib/libclang-cpp.*" "$lib" 76 + substituteInPlace $dev/lib/cmake/clang/ClangTargets-release.cmake \ 77 + --replace "\''${_IMPORT_PREFIX}/lib/libclang." "$lib/lib/libclang." \ 78 + --replace "\''${_IMPORT_PREFIX}/lib/libclang-cpp." "$lib/lib/libclang-cpp." 79 + 80 + mkdir -p $python/bin $python/share/clang/ 81 + mv $out/bin/{git-clang-format,scan-view} $python/bin 82 + if [ -e $out/bin/set-xcode-analyzer ]; then 83 + mv $out/bin/set-xcode-analyzer $python/bin 84 + fi 85 + mv $out/share/clang/*.py $python/share/clang 86 + rm $out/bin/c-index-test 87 + 88 + mkdir -p $dev/bin 89 + cp bin/clang-tblgen $dev/bin 90 + ''; 91 + 92 + passthru = { 93 + isClang = true; 94 + inherit libllvm; 95 + }; 96 + 97 + meta = llvm_meta // { 98 + homepage = "https://clang.llvm.org/"; 99 + description = "A C language family frontend for LLVM"; 100 + longDescription = '' 101 + The Clang project provides a language front-end and tooling 102 + infrastructure for languages in the C language family (C, C++, Objective 103 + C/C++, OpenCL, CUDA, and RenderScript) for the LLVM project. 104 + It aims to deliver amazingly fast compiles, extremely useful error and 105 + warning messages and to provide a platform for building great source 106 + level tools. The Clang Static Analyzer and clang-tidy are tools that 107 + automatically find bugs in your code, and are great examples of the sort 108 + of tools that can be built using the Clang frontend as a library to 109 + parse C/C++ code. 110 + ''; 111 + }; 112 + } // lib.optionalAttrs enableManpages { 113 + pname = "clang-manpages"; 114 + 115 + buildPhase = '' 116 + make docs-clang-man 117 + ''; 118 + 119 + installPhase = '' 120 + mkdir -p $out/share/man/man1 121 + # Manually install clang manpage 122 + cp docs/man/*.1 $out/share/man/man1/ 123 + ''; 124 + 125 + outputs = [ "out" ]; 126 + 127 + doCheck = false; 128 + 129 + meta = llvm_meta // { 130 + description = "man page for Clang ${version}"; 131 + }; 132 + }); 133 + in self
+105
pkgs/development/compilers/llvm/15/clang/gnu-install-dirs.patch
··· 1 + diff --git a/CMakeLists.txt b/CMakeLists.txt 2 + index c27beec313d7..480f13e73c9f 100644 3 + --- a/CMakeLists.txt 4 + +++ b/CMakeLists.txt 5 + @@ -78,15 +78,17 @@ if(CLANG_BUILT_STANDALONE) 6 + if (NOT LLVM_CONFIG_FOUND) 7 + # Pull values from LLVMConfig.cmake. We can drop this once the llvm-config 8 + # path is removed. 9 + - set(MAIN_INCLUDE_DIR "${LLVM_INCLUDE_DIR}") 10 + + set(INCLUDE_DIRS ${LLVM_INCLUDE_DIRS}) 11 + set(LLVM_OBJ_DIR "${LLVM_BINARY_DIR}") 12 + # N.B. this is just a default value, the CACHE PATHs below can be overriden. 13 + set(MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm") 14 + set(TOOLS_BINARY_DIR "${LLVM_TOOLS_BINARY_DIR}") 15 + set(LIBRARY_DIR "${LLVM_LIBRARY_DIR}") 16 + + else() 17 + + set(INCLUDE_DIRS "${LLVM_BINARY_DIR}/include" "${MAIN_INCLUDE_DIR}") 18 + endif() 19 + 20 + - set(LLVM_MAIN_INCLUDE_DIR "${MAIN_INCLUDE_DIR}" CACHE PATH "Path to llvm/include") 21 + + set(LLVM_INCLUDE_DIRS ${INCLUDE_DIRS} CACHE PATH "Path to llvm/include and any other header dirs needed") 22 + set(LLVM_BINARY_DIR "${LLVM_OBJ_ROOT}" CACHE PATH "Path to LLVM build tree") 23 + set(LLVM_MAIN_SRC_DIR "${MAIN_SRC_DIR}" CACHE PATH "Path to LLVM source tree") 24 + set(LLVM_TOOLS_BINARY_DIR "${TOOLS_BINARY_DIR}" CACHE PATH "Path to llvm/bin") 25 + @@ -128,7 +130,7 @@ if(CLANG_BUILT_STANDALONE) 26 + set(LLVM_INCLUDE_TESTS ON) 27 + endif() 28 + 29 + - include_directories("${LLVM_BINARY_DIR}/include" "${LLVM_MAIN_INCLUDE_DIR}") 30 + + include_directories(${LLVM_INCLUDE_DIRS}) 31 + link_directories("${LLVM_LIBRARY_DIR}") 32 + 33 + set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) 34 + diff --git a/cmake/modules/AddClang.cmake b/cmake/modules/AddClang.cmake 35 + index 21ac332e4f5f..b16c314bd1e2 100644 36 + --- a/cmake/modules/AddClang.cmake 37 + +++ b/cmake/modules/AddClang.cmake 38 + @@ -119,8 +119,8 @@ macro(add_clang_library name) 39 + install(TARGETS ${lib} 40 + COMPONENT ${lib} 41 + ${export_to_clangtargets} 42 + - LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} 43 + - ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} 44 + + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" 45 + + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" 46 + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") 47 + 48 + if (NOT LLVM_ENABLE_IDE) 49 + diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt 50 + index 6e2060991b92..b9bc930d26b8 100644 51 + --- a/lib/Headers/CMakeLists.txt 52 + +++ b/lib/Headers/CMakeLists.txt 53 + @@ -420,7 +420,7 @@ add_header_target("openmp-resource-headers" ${openmp_wrapper_files}) 54 + add_header_target("windows-resource-headers" ${windows_only_files}) 55 + add_header_target("utility-resource-headers" ${utility_files}) 56 + 57 + -set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) 58 + +set(header_install_dir ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) 59 + 60 + ############################################################# 61 + # Install rules for the catch-all clang-resource-headers target 62 + diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt 63 + index 8d95d0900e8c..ebc70ff7526d 100644 64 + --- a/tools/libclang/CMakeLists.txt 65 + +++ b/tools/libclang/CMakeLists.txt 66 + @@ -180,7 +180,7 @@ foreach(PythonVersion ${CLANG_PYTHON_BINDINGS_VERSIONS}) 67 + COMPONENT 68 + libclang-python-bindings 69 + DESTINATION 70 + - "lib${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages") 71 + + "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages") 72 + endforeach() 73 + if(NOT LLVM_ENABLE_IDE) 74 + add_custom_target(libclang-python-bindings) 75 + diff --git a/tools/scan-build-py/CMakeLists.txt b/tools/scan-build-py/CMakeLists.txt 76 + index 061dc7ef4dd9..adc54b2edc32 100644 77 + --- a/tools/scan-build-py/CMakeLists.txt 78 + +++ b/tools/scan-build-py/CMakeLists.txt 79 + @@ -88,7 +88,7 @@ foreach(lib ${LibScanbuild}) 80 + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/${lib}) 81 + list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/${lib}) 82 + install(PROGRAMS lib/libscanbuild/${lib} 83 + - DESTINATION lib/libscanbuild 84 + + DESTINATION "${CMAKE_INSTALL_LIBDIR}/libscanbuild" 85 + COMPONENT scan-build-py) 86 + endforeach() 87 + 88 + @@ -106,7 +106,7 @@ foreach(resource ${LibScanbuildResources}) 89 + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/resources/${resource}) 90 + list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources/${resource}) 91 + install(PROGRAMS lib/libscanbuild/resources/${resource} 92 + - DESTINATION lib/libscanbuild/resources 93 + + DESTINATION "${CMAKE_INSTALL_LIBDIR}/libscanbuild/resources" 94 + COMPONENT scan-build-py) 95 + endforeach() 96 + 97 + @@ -122,7 +122,7 @@ foreach(lib ${LibEar}) 98 + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libear/${lib}) 99 + list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libear/${lib}) 100 + install(PROGRAMS lib/libear/${lib} 101 + - DESTINATION lib/libear 102 + + DESTINATION "${CMAKE_INSTALL_LIBDIR}/libear" 103 + COMPONENT scan-build-py) 104 + endforeach() 105 +
+29
pkgs/development/compilers/llvm/15/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,13 +487,7 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, 15 + } else { 16 + if (Args.hasArg(options::OPT_rdynamic)) 17 + CmdArgs.push_back("-export-dynamic"); 18 + 19 + - if (!Args.hasArg(options::OPT_shared) && !IsStaticPIE && 20 + - !Args.hasArg(options::OPT_r)) { 21 + - CmdArgs.push_back("-dynamic-linker"); 22 + - CmdArgs.push_back(Args.MakeArgString(Twine(D.DyldPrefix) + 23 + - ToolChain.getDynamicLinker(Args))); 24 + - } 25 + } 26 + 27 + CmdArgs.push_back("-o"); 28 + -- 29 + 2.11.0
+21
pkgs/development/compilers/llvm/15/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 + @@ -348,4 +348,8 @@ if (NOT MSVC) 6 + 7 + + set(i486_SOURCES ${i386_SOURCES}) 8 + + set(i586_SOURCES ${i386_SOURCES}) 9 + + set(i686_SOURCES ${i386_SOURCES}) 10 + + 11 + if (WIN32) 12 + set(i386_SOURCES 13 + ${i386_SOURCES} 14 + @@ -723,6 +723,7 @@ else () 15 + endif() 16 + 17 + foreach (arch ${BUILTIN_SUPPORTED_ARCH}) 18 + + message("arch: ${arch}") 19 + if (CAN_TARGET_${arch}) 20 + # For ARM archs, exclude any VFP builtins if VFP is not supported 21 + if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7m|armv7em)$")
+32
pkgs/development/compilers/llvm/15/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/15/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 bc69ec95c419..9f100fdcec2f 100644 15 + --- a/cmake/Modules/AddCompilerRT.cmake 16 + +++ b/cmake/Modules/AddCompilerRT.cmake 17 + @@ -366,14 +366,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_OUTPUT_LIBRARY_DIR} 27 + - ) 28 + - endif() 29 + endif() 30 + 31 + set(parent_target_arg) 32 + 2.14.1 33 +
+71
pkgs/development/compilers/llvm/15/compiler-rt/darwin-targetconditionals.patch
··· 1 + diff --git a/lib/sanitizer_common/sanitizer_mac.cpp b/lib/sanitizer_common/sanitizer_mac.cpp 2 + --- a/lib/sanitizer_common/sanitizer_mac.cpp 3 + +++ b/lib/sanitizer_common/sanitizer_mac.cpp 4 + @@ -613,9 +613,15 @@ HandleSignalMode GetHandleSignalMode(int signum) { 5 + // Offset example: 6 + // XNU 17 -- macOS 10.13 -- iOS 11 -- tvOS 11 -- watchOS 4 7 + constexpr u16 GetOSMajorKernelOffset() { 8 + - if (TARGET_OS_OSX) return 4; 9 + - if (TARGET_OS_IOS || TARGET_OS_TV) return 6; 10 + - if (TARGET_OS_WATCH) return 13; 11 + +#if TARGET_OS_OSX 12 + + return 4; 13 + +#endif 14 + +#if TARGET_OS_IOS || TARGET_OS_TV 15 + + return 6; 16 + +#endif 17 + +#if TARGET_OS_WATCH 18 + + return 13; 19 + +#endif 20 + } 21 + 22 + using VersStr = char[64]; 23 + @@ -627,13 +633,13 @@ static uptr ApproximateOSVersionViaKernelVersion(VersStr vers) { 24 + u16 os_major = kernel_major - offset; 25 + 26 + const char *format = "%d.0"; 27 + - if (TARGET_OS_OSX) { 28 + - if (os_major >= 16) { // macOS 11+ 29 + - os_major -= 5; 30 + - } else { // macOS 10.15 and below 31 + - format = "10.%d"; 32 + - } 33 + +#if TARGET_OS_OSX 34 + + if (os_major >= 16) { // macOS 11+ 35 + + os_major -= 5; 36 + + } else { // macOS 10.15 and below 37 + + format = "10.%d"; 38 + } 39 + +#endif 40 + return internal_snprintf(vers, sizeof(VersStr), format, os_major); 41 + } 42 + 43 + @@ -681,15 +687,14 @@ void ParseVersion(const char *vers, u16 *major, u16 *minor) { 44 + // Aligned versions example: 45 + // macOS 10.15 -- iOS 13 -- tvOS 13 -- watchOS 6 46 + static void MapToMacos(u16 *major, u16 *minor) { 47 + - if (TARGET_OS_OSX) 48 + - return; 49 + - 50 + - if (TARGET_OS_IOS || TARGET_OS_TV) 51 + +#if !TARGET_OS_OSX 52 + +#if TARGET_OS_IOS || TARGET_OS_TV 53 + *major += 2; 54 + - else if (TARGET_OS_WATCH) 55 + +#elif TARGET_OS_WATCH 56 + *major += 9; 57 + - else 58 + +#else 59 + UNREACHABLE("unsupported platform"); 60 + +#endif 61 + 62 + if (*major >= 16) { // macOS 11+ 63 + *major -= 5; 64 + @@ -697,6 +702,7 @@ static void MapToMacos(u16 *major, u16 *minor) { 65 + *minor = *major; 66 + *major = 10; 67 + } 68 + +#endif 69 + } 70 + 71 + static MacosVersion GetMacosAlignedVersionInternal() {
+127
pkgs/development/compilers/llvm/15/compiler-rt/default.nix
··· 1 + { lib, stdenv, llvm_meta, version 2 + , monorepoSrc, runCommand 3 + , cmake, python3, libllvm, libcxxabi, libxcrypt 4 + }: 5 + 6 + let 7 + 8 + useLLVM = stdenv.hostPlatform.useLLVM or false; 9 + bareMetal = stdenv.hostPlatform.parsed.kernel.name == "none"; 10 + haveLibc = stdenv.cc.libc != null; 11 + inherit (stdenv.hostPlatform) isMusl; 12 + 13 + baseName = "compiler-rt"; 14 + 15 + src = runCommand "${baseName}-src-${version}" {} '' 16 + mkdir -p "$out" 17 + cp -r ${monorepoSrc}/cmake "$out" 18 + cp -r ${monorepoSrc}/${baseName} "$out" 19 + ''; 20 + in 21 + 22 + stdenv.mkDerivation { 23 + pname = baseName + lib.optionalString (haveLibc) "-libc"; 24 + inherit version; 25 + 26 + inherit src; 27 + sourceRoot = "${src.name}/${baseName}"; 28 + 29 + nativeBuildInputs = [ cmake python3 libllvm.dev ]; 30 + buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi; 31 + 32 + NIX_CFLAGS_COMPILE = [ 33 + "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0" 34 + ]; 35 + 36 + cmakeFlags = [ 37 + "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" 38 + "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}" 39 + "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}" 40 + ] ++ lib.optionals (haveLibc && !isMusl) [ 41 + "-DSANITIZER_COMMON_CFLAGS=-I${libxcrypt}/include" 42 + ] ++ lib.optionals (useLLVM || bareMetal || isMusl) [ 43 + "-DCOMPILER_RT_BUILD_SANITIZERS=OFF" 44 + "-DCOMPILER_RT_BUILD_XRAY=OFF" 45 + "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF" 46 + "-DCOMPILER_RT_BUILD_PROFILE=OFF" 47 + "-DCOMPILER_RT_BUILD_MEMPROF=OFF" 48 + "-DCOMPILER_RT_BUILD_ORC=OFF" # may be possible to build with musl if necessary 49 + ] ++ lib.optionals ((useLLVM && !haveLibc) || bareMetal) [ 50 + "-DCMAKE_C_COMPILER_WORKS=ON" 51 + "-DCMAKE_CXX_COMPILER_WORKS=ON" 52 + "-DCOMPILER_RT_BAREMETAL_BUILD=ON" 53 + "-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}" 54 + ] ++ lib.optionals (useLLVM && !haveLibc) [ 55 + "-DCMAKE_C_FLAGS=-nodefaultlibs" 56 + ] ++ lib.optionals (useLLVM) [ 57 + "-DCOMPILER_RT_BUILD_BUILTINS=ON" 58 + #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program 59 + "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY" 60 + ] ++ lib.optionals (bareMetal) [ 61 + "-DCOMPILER_RT_OS_DIR=baremetal" 62 + ] ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ 63 + "-DDARWIN_macosx_OVERRIDE_SDK_VERSION=ON" 64 + "-DDARWIN_osx_ARCHS=${stdenv.hostPlatform.darwinArch}" 65 + "-DDARWIN_osx_BUILTIN_ARCHS=${stdenv.hostPlatform.darwinArch}" 66 + ]; 67 + 68 + outputs = [ "out" "dev" ]; 69 + 70 + patches = [ 71 + ./X86-support-extension.patch # Add support for i486 i586 i686 by reusing i386 config 72 + ./gnu-install-dirs.patch 73 + # ld-wrapper dislikes `-rpath-link //nix/store`, so we normalize away the 74 + # extra `/`. 75 + ./normalize-var.patch 76 + ] # Prevent a compilation error on darwin 77 + ++ lib.optional stdenv.hostPlatform.isDarwin ./darwin-targetconditionals.patch 78 + ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch; 79 + 80 + # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks 81 + # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra 82 + # can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd 83 + # get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by 84 + # a flag and turn the flag off during the stdenv build. 85 + postPatch = lib.optionalString (!stdenv.isDarwin) '' 86 + substituteInPlace cmake/builtin-config-ix.cmake \ 87 + --replace 'set(X86 i386)' 'set(X86 i386 i486 i586 i686)' 88 + '' + lib.optionalString stdenv.isDarwin '' 89 + substituteInPlace cmake/builtin-config-ix.cmake \ 90 + --replace 'set(ARM64 arm64 arm64e)' 'set(ARM64)' 91 + substituteInPlace cmake/config-ix.cmake \ 92 + --replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)' 93 + '' + lib.optionalString (useLLVM) '' 94 + substituteInPlace lib/builtins/int_util.c \ 95 + --replace "#include <stdlib.h>" "" 96 + substituteInPlace lib/builtins/clear_cache.c \ 97 + --replace "#include <assert.h>" "" 98 + substituteInPlace lib/builtins/cpu_model.c \ 99 + --replace "#include <assert.h>" "" 100 + ''; 101 + 102 + # Hack around weird upsream RPATH bug 103 + postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) '' 104 + ln -s "$out/lib"/*/* "$out/lib" 105 + '' + lib.optionalString (useLLVM) '' 106 + ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbegin.o 107 + ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtend.o 108 + ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o 109 + ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o 110 + ''; 111 + 112 + meta = llvm_meta // { 113 + homepage = "https://compiler-rt.llvm.org/"; 114 + description = "Compiler runtime libraries"; 115 + longDescription = '' 116 + The compiler-rt project provides highly tuned implementations of the 117 + low-level code generator support routines like "__fixunsdfdi" and other 118 + calls generated when a target doesn't have a short sequence of native 119 + instructions to implement a core IR operation. It also provides 120 + implementations of run-time libraries for dynamic testing tools such as 121 + AddressSanitizer, ThreadSanitizer, MemorySanitizer, and DataFlowSanitizer. 122 + ''; 123 + # "All of the code in the compiler-rt project is dual licensed under the MIT 124 + # license and the UIUC License (a BSD-like license)": 125 + license = with lib.licenses; [ mit ncsa ]; 126 + }; 127 + }
+20
pkgs/development/compilers/llvm/15/compiler-rt/gnu-install-dirs.patch
··· 1 + diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake 2 + index 8a6219568b3f..30ee68a47ccf 100644 3 + --- a/cmake/base-config-ix.cmake 4 + +++ b/cmake/base-config-ix.cmake 5 + @@ -100,13 +100,13 @@ endif() 6 + if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) 7 + set(COMPILER_RT_OUTPUT_LIBRARY_DIR 8 + ${COMPILER_RT_OUTPUT_DIR}/lib) 9 + - extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" lib) 10 + + extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" "${CMAKE_INSTALL_LIBDIR}") 11 + set(COMPILER_RT_INSTALL_LIBRARY_DIR "${default_install_path}" CACHE PATH 12 + "Path where built compiler-rt libraries should be installed.") 13 + else(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) 14 + set(COMPILER_RT_OUTPUT_LIBRARY_DIR 15 + ${COMPILER_RT_OUTPUT_DIR}/lib/${COMPILER_RT_OS_DIR}) 16 + - extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" "lib/${COMPILER_RT_OS_DIR}") 17 + + extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" "${CMAKE_INSTALL_LIBDIR}/${COMPILER_RT_OS_DIR}") 18 + set(COMPILER_RT_INSTALL_LIBRARY_DIR "${default_install_path}" CACHE PATH 19 + "Path where built compiler-rt libraries should be installed.") 20 + endif()
+16
pkgs/development/compilers/llvm/15/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 +
+280
pkgs/development/compilers/llvm/15/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 = "14.0.6"; 22 + candidate = ""; # empty or "rcN" 23 + dash-candidate = lib.optionalString (candidate != "") "-${candidate}"; 24 + rev = ""; # When using a Git commit 25 + rev-version = ""; # When using a Git commit 26 + version = if rev != "" then rev-version else "${release_version}${dash-candidate}"; 27 + targetConfig = stdenv.targetPlatform.config; 28 + 29 + monorepoSrc = fetchFromGitHub { 30 + owner = "llvm"; 31 + repo = "llvm-project"; 32 + rev = if rev != "" then rev else "llvmorg-${version}"; 33 + sha256 = "sha256-vffu4HilvYwtzwgq+NlS26m65DGbp6OSSne2aje1yJE="; 34 + }; 35 + 36 + llvm_meta = { 37 + license = lib.licenses.ncsa; 38 + maintainers = with lib.maintainers; [ lovek323 raskin dtzWill primeos ]; 39 + platforms = lib.platforms.all; 40 + }; 41 + 42 + tools = lib.makeExtensible (tools: let 43 + callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version monorepoSrc buildLlvmTools; }); 44 + mkExtraBuildCommands0 = cc: '' 45 + rsrc="$out/resource-root" 46 + mkdir "$rsrc" 47 + ln -s "${cc.lib}/lib/clang/${release_version}/include" "$rsrc" 48 + echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags 49 + ''; 50 + mkExtraBuildCommands = cc: mkExtraBuildCommands0 cc + '' 51 + ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" 52 + ln -s "${targetLlvmLibraries.compiler-rt.out}/share" "$rsrc/share" 53 + ''; 54 + 55 + bintoolsNoLibc' = 56 + if bootBintoolsNoLibc == null 57 + then tools.bintoolsNoLibc 58 + else bootBintoolsNoLibc; 59 + bintools' = 60 + if bootBintools == null 61 + then tools.bintools 62 + else bootBintools; 63 + 64 + in { 65 + 66 + libllvm = callPackage ./llvm { 67 + inherit llvm_meta; 68 + }; 69 + 70 + # `llvm` historically had the binaries. When choosing an output explicitly, 71 + # we need to reintroduce `outputSpecified` to get the expected behavior e.g. of lib.get* 72 + llvm = tools.libllvm.out // { outputSpecified = false; }; 73 + 74 + libclang = callPackage ./clang { 75 + inherit llvm_meta; 76 + }; 77 + 78 + clang-unwrapped = tools.libclang.out // { outputSpecified = false; }; 79 + 80 + llvm-manpages = lowPrio (tools.libllvm.override { 81 + enableManpages = true; 82 + python3 = pkgs.python3; # don't use python-boot 83 + }); 84 + 85 + clang-manpages = lowPrio (tools.libclang.override { 86 + enableManpages = true; 87 + python3 = pkgs.python3; # don't use python-boot 88 + }); 89 + 90 + # TODO: lldb/docs/index.rst:155:toctree contains reference to nonexisting document 'design/structureddataplugins' 91 + # lldb-manpages = lowPrio (tools.lldb.override { 92 + # enableManpages = true; 93 + # python3 = pkgs.python3; # don't use python-boot 94 + # }); 95 + 96 + # pick clang appropriate for package set we are targeting 97 + clang = 98 + /**/ if stdenv.targetPlatform.useLLVM or false then tools.clangUseLLVM 99 + else if (pkgs.targetPackages.stdenv or stdenv).cc.isGNU then tools.libstdcxxClang 100 + else tools.libcxxClang; 101 + 102 + libstdcxxClang = wrapCCWith rec { 103 + cc = tools.clang-unwrapped; 104 + # libstdcxx is taken from gcc in an ad-hoc way in cc-wrapper. 105 + libcxx = null; 106 + extraPackages = [ 107 + targetLlvmLibraries.compiler-rt 108 + ]; 109 + extraBuildCommands = mkExtraBuildCommands cc; 110 + }; 111 + 112 + libcxxClang = wrapCCWith rec { 113 + cc = tools.clang-unwrapped; 114 + libcxx = targetLlvmLibraries.libcxx; 115 + extraPackages = [ 116 + targetLlvmLibraries.libcxxabi 117 + targetLlvmLibraries.compiler-rt 118 + ]; 119 + extraBuildCommands = mkExtraBuildCommands cc; 120 + }; 121 + 122 + lld = callPackage ./lld { 123 + inherit llvm_meta; 124 + }; 125 + 126 + lldb = callPackage ./lldb { 127 + inherit llvm_meta; 128 + inherit (darwin) libobjc bootstrap_cmds; 129 + inherit (darwin.apple_sdk.libs) xpc; 130 + inherit (darwin.apple_sdk.frameworks) Foundation Carbon Cocoa; 131 + }; 132 + 133 + # Below, is the LLVM bootstrapping logic. It handles building a 134 + # fully LLVM toolchain from scratch. No GCC toolchain should be 135 + # pulled in. As a consequence, it is very quick to build different 136 + # targets provided by LLVM and we can also build for what GCC 137 + # doesn’t support like LLVM. Probably we should move to some other 138 + # file. 139 + 140 + bintools-unwrapped = callPackage ./bintools {}; 141 + 142 + bintoolsNoLibc = wrapBintoolsWith { 143 + bintools = tools.bintools-unwrapped; 144 + libc = preLibcCrossHeaders; 145 + }; 146 + 147 + bintools = wrapBintoolsWith { 148 + bintools = tools.bintools-unwrapped; 149 + }; 150 + 151 + clangUseLLVM = wrapCCWith rec { 152 + cc = tools.clang-unwrapped; 153 + libcxx = targetLlvmLibraries.libcxx; 154 + bintools = bintools'; 155 + extraPackages = [ 156 + targetLlvmLibraries.libcxxabi 157 + targetLlvmLibraries.compiler-rt 158 + ] ++ lib.optionals (!stdenv.targetPlatform.isWasm) [ 159 + targetLlvmLibraries.libunwind 160 + ]; 161 + extraBuildCommands = mkExtraBuildCommands cc; 162 + nixSupport.cc-cflags = 163 + [ "-rtlib=compiler-rt" 164 + "-Wno-unused-command-line-argument" 165 + "-B${targetLlvmLibraries.compiler-rt}/lib" 166 + ] 167 + ++ lib.optional (!stdenv.targetPlatform.isWasm) "--unwindlib=libunwind" 168 + ++ lib.optional 169 + (!stdenv.targetPlatform.isWasm && stdenv.targetPlatform.useLLVM or false) 170 + "-lunwind" 171 + ++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions"; 172 + }; 173 + 174 + clangNoLibcxx = wrapCCWith rec { 175 + cc = tools.clang-unwrapped; 176 + libcxx = null; 177 + bintools = bintools'; 178 + extraPackages = [ 179 + targetLlvmLibraries.compiler-rt 180 + ]; 181 + extraBuildCommands = mkExtraBuildCommands cc; 182 + nixSupport.cc-cflags = [ 183 + "-rtlib=compiler-rt" 184 + "-B${targetLlvmLibraries.compiler-rt}/lib" 185 + "-nostdlib++" 186 + ]; 187 + }; 188 + 189 + clangNoLibc = wrapCCWith rec { 190 + cc = tools.clang-unwrapped; 191 + libcxx = null; 192 + bintools = bintoolsNoLibc'; 193 + extraPackages = [ 194 + targetLlvmLibraries.compiler-rt 195 + ]; 196 + extraBuildCommands = mkExtraBuildCommands cc; 197 + nixSupport.cc-cflags = [ 198 + "-rtlib=compiler-rt" 199 + "-B${targetLlvmLibraries.compiler-rt}/lib" 200 + ]; 201 + }; 202 + 203 + clangNoCompilerRt = wrapCCWith rec { 204 + cc = tools.clang-unwrapped; 205 + libcxx = null; 206 + bintools = bintoolsNoLibc'; 207 + extraPackages = [ ]; 208 + extraBuildCommands = mkExtraBuildCommands0 cc; 209 + nixSupport.cc-cflags = [ "-nostartfiles" ]; 210 + }; 211 + 212 + clangNoCompilerRtWithLibc = wrapCCWith rec { 213 + cc = tools.clang-unwrapped; 214 + libcxx = null; 215 + bintools = bintools'; 216 + extraPackages = [ ]; 217 + extraBuildCommands = mkExtraBuildCommands0 cc; 218 + }; 219 + 220 + }); 221 + 222 + libraries = lib.makeExtensible (libraries: let 223 + callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version monorepoSrc; }); 224 + in { 225 + 226 + compiler-rt-libc = callPackage ./compiler-rt { 227 + inherit llvm_meta; 228 + stdenv = if stdenv.hostPlatform.useLLVM or false 229 + then overrideCC stdenv buildLlvmTools.clangNoCompilerRtWithLibc 230 + else stdenv; 231 + }; 232 + 233 + compiler-rt-no-libc = callPackage ./compiler-rt { 234 + inherit llvm_meta; 235 + stdenv = if stdenv.hostPlatform.useLLVM or false 236 + then overrideCC stdenv buildLlvmTools.clangNoCompilerRt 237 + else stdenv; 238 + }; 239 + 240 + # N.B. condition is safe because without useLLVM both are the same. 241 + compiler-rt = if stdenv.hostPlatform.isAndroid 242 + then libraries.compiler-rt-libc 243 + else libraries.compiler-rt-no-libc; 244 + 245 + stdenv = overrideCC stdenv buildLlvmTools.clang; 246 + 247 + libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang; 248 + 249 + libcxx = callPackage ./libcxx { 250 + inherit llvm_meta; 251 + stdenv = if stdenv.hostPlatform.useLLVM or false 252 + then overrideCC stdenv buildLlvmTools.clangNoLibcxx 253 + else stdenv; 254 + }; 255 + 256 + libcxxabi = let 257 + stdenv_ = if stdenv.hostPlatform.useLLVM or false 258 + then overrideCC stdenv buildLlvmTools.clangNoLibcxx 259 + else stdenv; 260 + cxx-headers = callPackage ./libcxx { 261 + inherit llvm_meta; 262 + stdenv = stdenv_; 263 + headersOnly = true; 264 + }; 265 + in callPackage ./libcxxabi { 266 + stdenv = stdenv_; 267 + inherit llvm_meta cxx-headers; 268 + }; 269 + 270 + libunwind = callPackage ./libunwind { 271 + inherit llvm_meta; 272 + stdenv = overrideCC stdenv buildLlvmTools.clangNoLibcxx; 273 + }; 274 + 275 + openmp = callPackage ./openmp { 276 + inherit llvm_meta; 277 + }; 278 + }); 279 + 280 + in { inherit tools libraries release_version; } // libraries // tools
+94
pkgs/development/compilers/llvm/15/libcxx/default.nix
··· 1 + { lib, stdenv, llvm_meta 2 + , monorepoSrc, runCommand 3 + , cmake, python3, fixDarwinDylibNames, version 4 + , libcxxabi 5 + , enableShared ? !stdenv.hostPlatform.isStatic 6 + 7 + # If headersOnly is true, the resulting package would only include the headers. 8 + # Use this to break the circular dependency between libcxx and libcxxabi. 9 + # 10 + # Some context: 11 + # https://reviews.llvm.org/rG1687f2bbe2e2aaa092f942d4a97d41fad43eedfb 12 + , headersOnly ? false 13 + }: 14 + 15 + let 16 + basename = "libcxx"; 17 + in 18 + 19 + stdenv.mkDerivation rec { 20 + pname = basename + lib.optionalString headersOnly "-headers"; 21 + inherit version; 22 + 23 + src = runCommand "${pname}-src-${version}" {} '' 24 + mkdir -p "$out" 25 + cp -r ${monorepoSrc}/cmake "$out" 26 + cp -r ${monorepoSrc}/${basename} "$out" 27 + mkdir -p "$out/libcxxabi" 28 + cp -r ${monorepoSrc}/libcxxabi/include "$out/libcxxabi" 29 + mkdir -p "$out/llvm" 30 + cp -r ${monorepoSrc}/llvm/cmake "$out/llvm" 31 + cp -r ${monorepoSrc}/llvm/utils "$out/llvm" 32 + cp -r ${monorepoSrc}/third-party "$out" 33 + cp -r ${monorepoSrc}/runtimes "$out" 34 + ''; 35 + 36 + sourceRoot = "${src.name}/runtimes"; 37 + 38 + outputs = [ "out" ] ++ lib.optional (!headersOnly) "dev"; 39 + 40 + prePatch = '' 41 + cd ../${basename} 42 + chmod -R u+w . 43 + ''; 44 + 45 + patches = [ 46 + ./gnu-install-dirs.patch 47 + ] ++ lib.optionals stdenv.hostPlatform.isMusl [ 48 + ../../libcxx-0001-musl-hacks.patch 49 + ]; 50 + 51 + postPatch = '' 52 + cd ../runtimes 53 + ''; 54 + 55 + preConfigure = lib.optionalString stdenv.hostPlatform.isMusl '' 56 + patchShebangs utils/cat_files.py 57 + ''; 58 + 59 + nativeBuildInputs = [ cmake python3 ] 60 + ++ lib.optional stdenv.isDarwin fixDarwinDylibNames; 61 + 62 + buildInputs = lib.optionals (!headersOnly) [ libcxxabi ]; 63 + 64 + cmakeFlags = [ 65 + "-DLLVM_ENABLE_RUNTIMES=libcxx" 66 + "-DLIBCXX_CXX_ABI=${lib.optionalString (!headersOnly) "system-"}libcxxabi" 67 + ] ++ lib.optional (!headersOnly) "-DLIBCXX_CXX_ABI_INCLUDE_PATHS=${libcxxabi.dev}/include/c++/v1" 68 + ++ lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) "-DLIBCXX_HAS_MUSL_LIBC=1" 69 + ++ lib.optional (stdenv.hostPlatform.useLLVM or false) "-DLIBCXX_USE_COMPILER_RT=ON" 70 + ++ lib.optionals stdenv.hostPlatform.isWasm [ 71 + "-DLIBCXX_ENABLE_THREADS=OFF" 72 + "-DLIBCXX_ENABLE_FILESYSTEM=OFF" 73 + "-DLIBCXX_ENABLE_EXCEPTIONS=OFF" 74 + ] ++ lib.optional (!enableShared) "-DLIBCXX_ENABLE_SHARED=OFF"; 75 + 76 + buildFlags = lib.optional headersOnly "generate-cxx-headers"; 77 + installTargets = lib.optional headersOnly "install-cxx-headers"; 78 + 79 + passthru = { 80 + isLLVM = true; 81 + }; 82 + 83 + meta = llvm_meta // { 84 + homepage = "https://libcxx.llvm.org/"; 85 + description = "C++ standard library"; 86 + longDescription = '' 87 + libc++ is an implementation of the C++ standard library, targeting C++11, 88 + C++14 and above. 89 + ''; 90 + # "All of the code in libc++ is dual licensed under the MIT license and the 91 + # UIUC License (a BSD-like license)": 92 + license = with lib.licenses; [ mit ncsa ]; 93 + }; 94 + }
+22
pkgs/development/compilers/llvm/15/libcxx/gnu-install-dirs.patch
··· 1 + diff --git a/CMakeLists.txt b/CMakeLists.txt 2 + index 74eff2002fc9..c935d10878bb 100644 3 + --- a/CMakeLists.txt 4 + +++ b/CMakeLists.txt 5 + @@ -419,7 +419,7 @@ if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) 6 + set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}) 7 + set(LIBCXX_GENERATED_INCLUDE_DIR "${LLVM_BINARY_DIR}/include/c++/v1") 8 + set(LIBCXX_GENERATED_INCLUDE_TARGET_DIR "${LLVM_BINARY_DIR}/include/${LLVM_DEFAULT_TARGET_TRIPLE}/c++/v1") 9 + - set(LIBCXX_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE PATH 10 + + set(LIBCXX_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE PATH 11 + "Path where built libc++ libraries should be installed.") 12 + set(LIBCXX_INSTALL_INCLUDE_TARGET_DIR "${CMAKE_INSTALL_INCLUDEDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++/v1" CACHE PATH 13 + "Path where target-specific libc++ headers should be installed.") 14 + @@ -436,7 +436,7 @@ else() 15 + set(LIBCXX_GENERATED_INCLUDE_DIR "${CMAKE_BINARY_DIR}/include/c++/v1") 16 + endif() 17 + set(LIBCXX_GENERATED_INCLUDE_TARGET_DIR "${LIBCXX_GENERATED_INCLUDE_DIR}") 18 + - set(LIBCXX_INSTALL_LIBRARY_DIR lib${LIBCXX_LIBDIR_SUFFIX} CACHE PATH 19 + + set(LIBCXX_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX} CACHE PATH 20 + "Path where built libc++ libraries should be installed.") 21 + set(LIBCXX_INSTALL_INCLUDE_TARGET_DIR "${LIBCXX_INSTALL_INCLUDE_DIR}" CACHE PATH 22 + "Path where target-specific libc++ headers should be installed.")
+97
pkgs/development/compilers/llvm/15/libcxxabi/default.nix
··· 1 + { lib, stdenv, llvm_meta, cmake, python3 2 + , monorepoSrc, runCommand, fetchpatch 3 + , cxx-headers, libunwind, version 4 + , enableShared ? !stdenv.hostPlatform.isStatic 5 + }: 6 + 7 + stdenv.mkDerivation rec { 8 + pname = "libcxxabi"; 9 + inherit version; 10 + 11 + src = runCommand "${pname}-src-${version}" {} '' 12 + mkdir -p "$out" 13 + cp -r ${monorepoSrc}/cmake "$out" 14 + cp -r ${monorepoSrc}/${pname} "$out" 15 + mkdir -p "$out/libcxx/src" 16 + cp -r ${monorepoSrc}/libcxx/cmake "$out/libcxx" 17 + cp -r ${monorepoSrc}/libcxx/include "$out/libcxx" 18 + cp -r ${monorepoSrc}/libcxx/src/include "$out/libcxx/src" 19 + mkdir -p "$out/llvm" 20 + cp -r ${monorepoSrc}/llvm/cmake "$out/llvm" 21 + cp -r ${monorepoSrc}/llvm/utils "$out/llvm" 22 + cp -r ${monorepoSrc}/runtimes "$out" 23 + ''; 24 + 25 + sourceRoot = "${src.name}/runtimes"; 26 + 27 + outputs = [ "out" "dev" ]; 28 + 29 + postUnpack = lib.optionalString stdenv.isDarwin '' 30 + export TRIPLE=x86_64-apple-darwin 31 + '' + lib.optionalString stdenv.hostPlatform.isWasm '' 32 + patch -p1 -d llvm -i ${./wasm.patch} 33 + ''; 34 + 35 + prePatch = '' 36 + cd ../${pname} 37 + chmod -R u+w . 38 + ''; 39 + 40 + patches = [ 41 + ./gnu-install-dirs.patch 42 + 43 + # https://reviews.llvm.org/D132298, Allow building libcxxabi alone 44 + (fetchpatch { 45 + url = "https://github.com/llvm/llvm-project/commit/e6a0800532bb409f6d1c62f3698bdd6994a877dc.patch"; 46 + sha256 = "1xyjd56m4pfwq8p3xh6i8lhkk9kq15jaml7qbhxdf87z4jjkk63a"; 47 + stripLen = 1; 48 + }) 49 + ]; 50 + 51 + postPatch = '' 52 + cd ../runtimes 53 + ''; 54 + 55 + nativeBuildInputs = [ cmake python3 ]; 56 + buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm) libunwind; 57 + 58 + cmakeFlags = [ 59 + "-DLLVM_ENABLE_RUNTIMES=libcxxabi" 60 + "-DLIBCXXABI_LIBCXX_INCLUDES=${cxx-headers}/include/c++/v1" 61 + ] ++ lib.optionals (stdenv.hostPlatform.useLLVM or false) [ 62 + "-DLLVM_ENABLE_LIBCXX=ON" 63 + "-DLIBCXXABI_USE_LLVM_UNWINDER=ON" 64 + ] ++ lib.optionals stdenv.hostPlatform.isWasm [ 65 + "-DLIBCXXABI_ENABLE_THREADS=OFF" 66 + "-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF" 67 + ] ++ lib.optionals (!enableShared) [ 68 + "-DLIBCXXABI_ENABLE_SHARED=OFF" 69 + ]; 70 + 71 + preInstall = lib.optionalString stdenv.isDarwin '' 72 + for file in lib/*.dylib; do 73 + # this should be done in CMake, but having trouble figuring out 74 + # the magic combination of necessary CMake variables 75 + # if you fancy a try, take a look at 76 + # https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling 77 + install_name_tool -id $out/$file $file 78 + done 79 + ''; 80 + 81 + postInstall = '' 82 + mkdir -p "$dev/include" 83 + install -m 644 ../../${pname}/include/${if stdenv.isDarwin then "*" else "cxxabi.h"} "$dev/include" 84 + ''; 85 + 86 + meta = llvm_meta // { 87 + homepage = "https://libcxxabi.llvm.org/"; 88 + description = "Provides C++ standard library support"; 89 + longDescription = '' 90 + libc++abi is a new implementation of low level support for a standard C++ library. 91 + ''; 92 + # "All of the code in libc++abi is dual licensed under the MIT license and 93 + # the UIUC License (a BSD-like license)": 94 + license = with lib.licenses; [ mit ncsa ]; 95 + maintainers = llvm_meta.maintainers ++ [ lib.maintainers.vlstill ]; 96 + }; 97 + }
+22
pkgs/development/compilers/llvm/15/libcxxabi/gnu-install-dirs.patch
··· 1 + diff --git a/CMakeLists.txt b/CMakeLists.txt 2 + index b8326d08d23a..a1e36f713161 100644 3 + --- a/CMakeLists.txt 4 + +++ b/CMakeLists.txt 5 + @@ -187,7 +187,7 @@ set(LIBCXXABI_INSTALL_RUNTIME_DIR "${CMAKE_INSTALL_BINDIR}" CACHE PATH 6 + if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) 7 + set(LIBCXXABI_HEADER_DIR ${LLVM_BINARY_DIR}) 8 + set(LIBCXXABI_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}) 9 + - set(LIBCXXABI_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE PATH 10 + + set(LIBCXXABI_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE PATH 11 + "Path where built libc++abi libraries should be installed.") 12 + if(LIBCXX_LIBDIR_SUBDIR) 13 + string(APPEND LIBCXXABI_LIBRARY_DIR /${LIBCXXABI_LIBDIR_SUBDIR}) 14 + @@ -201,7 +201,7 @@ else() 15 + set(LIBCXXABI_HEADER_DIR ${CMAKE_BINARY_DIR}) 16 + set(LIBCXXABI_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXXABI_LIBDIR_SUFFIX}) 17 + endif() 18 + - set(LIBCXXABI_INSTALL_LIBRARY_DIR lib${LIBCXXABI_LIBDIR_SUFFIX} CACHE PATH 19 + + set(LIBCXXABI_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBCXXABI_LIBDIR_SUFFIX} CACHE PATH 20 + "Path where built libc++abi libraries should be installed.") 21 + endif() 22 +
+16
pkgs/development/compilers/llvm/15/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 +
+61
pkgs/development/compilers/llvm/15/libunwind/default.nix
··· 1 + { lib, stdenv, llvm_meta, version 2 + , monorepoSrc, runCommand 3 + , cmake 4 + , python3 5 + , enableShared ? !stdenv.hostPlatform.isStatic 6 + }: 7 + 8 + stdenv.mkDerivation rec { 9 + pname = "libunwind"; 10 + inherit version; 11 + 12 + # I am not so comfortable giving libc++ and friends the whole monorepo as 13 + # requested, so I filter it to what is needed. 14 + src = runCommand "${pname}-src-${version}" {} '' 15 + mkdir -p "$out" 16 + cp -r ${monorepoSrc}/cmake "$out" 17 + cp -r ${monorepoSrc}/${pname} "$out" 18 + mkdir -p "$out/libcxx" 19 + cp -r ${monorepoSrc}/libcxx/cmake "$out/libcxx" 20 + cp -r ${monorepoSrc}/libcxx/utils "$out/libcxx" 21 + mkdir -p "$out/llvm" 22 + cp -r ${monorepoSrc}/llvm/cmake "$out/llvm" 23 + cp -r ${monorepoSrc}/llvm/utils "$out/llvm" 24 + cp -r ${monorepoSrc}/runtimes "$out" 25 + ''; 26 + 27 + sourceRoot = "${src.name}/runtimes"; 28 + 29 + prePatch = '' 30 + cd ../${pname} 31 + chmod -R u+w . 32 + ''; 33 + 34 + patches = [ 35 + ./gnu-install-dirs.patch 36 + ]; 37 + 38 + postPatch = '' 39 + cd ../runtimes 40 + ''; 41 + 42 + outputs = [ "out" "dev" ]; 43 + 44 + nativeBuildInputs = [ cmake python3 ]; 45 + 46 + cmakeFlags = [ 47 + "-DLLVM_ENABLE_RUNTIMES=libunwind" 48 + ] ++ lib.optional (!enableShared) "-DLIBUNWIND_ENABLE_SHARED=OFF"; 49 + 50 + meta = llvm_meta // { 51 + # Details: https://github.com/llvm/llvm-project/blob/main/libunwind/docs/index.rst 52 + homepage = "https://clang.llvm.org/docs/Toolchain.html#unwind-library"; 53 + description = "LLVM's unwinder library"; 54 + longDescription = '' 55 + The unwind library provides a family of _Unwind_* functions implementing 56 + the language-neutral stack unwinding portion of the Itanium C++ ABI (Level 57 + I). It is a dependency of the C++ ABI library, and sometimes is a 58 + dependency of other runtimes. 59 + ''; 60 + }; 61 + }
+22
pkgs/development/compilers/llvm/15/libunwind/gnu-install-dirs.patch
··· 1 + diff --git a/CMakeLists.txt b/CMakeLists.txt 2 + index 5a06805f05f1..86a50329e6a8 100644 3 + --- a/CMakeLists.txt 4 + +++ b/CMakeLists.txt 5 + @@ -117,7 +117,7 @@ set(LIBUNWIND_INSTALL_RUNTIME_DIR "${CMAKE_INSTALL_BINDIR}" CACHE PATH 6 + 7 + if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) 8 + set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}) 9 + - set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE PATH 10 + + set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE PATH 11 + "Path where built libunwind libraries should be installed.") 12 + if(LIBCXX_LIBDIR_SUBDIR) 13 + string(APPEND LIBUNWIND_LIBRARY_DIR /${LIBUNWIND_LIBDIR_SUBDIR}) 14 + @@ -129,7 +129,7 @@ else() 15 + else() 16 + set(LIBUNWIND_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBUNWIND_LIBDIR_SUFFIX}) 17 + endif() 18 + - set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LIBUNWIND_LIBDIR_SUFFIX} CACHE PATH 19 + + set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBUNWIND_LIBDIR_SUFFIX} CACHE PATH 20 + "Path where built libunwind libraries should be installed.") 21 + endif() 22 +
+53
pkgs/development/compilers/llvm/15/lld/default.nix
··· 1 + { lib, stdenv, llvm_meta 2 + , buildLlvmTools 3 + , monorepoSrc, runCommand 4 + , cmake 5 + , libxml2 6 + , libllvm 7 + , version 8 + }: 9 + 10 + stdenv.mkDerivation rec { 11 + pname = "lld"; 12 + inherit version; 13 + 14 + # Blank llvm dir just so relative path works 15 + src = runCommand "${pname}-src-${version}" {} '' 16 + mkdir -p "$out" 17 + cp -r ${monorepoSrc}/cmake "$out" 18 + cp -r ${monorepoSrc}/${pname} "$out" 19 + mkdir -p "$out/libunwind" 20 + cp -r ${monorepoSrc}/libunwind/include "$out/libunwind" 21 + mkdir -p "$out/llvm" 22 + ''; 23 + 24 + sourceRoot = "${src.name}/${pname}"; 25 + 26 + patches = [ 27 + ./gnu-install-dirs.patch 28 + ]; 29 + 30 + nativeBuildInputs = [ cmake ]; 31 + buildInputs = [ libllvm libxml2 ]; 32 + 33 + cmakeFlags = [ 34 + "-DLLD_INSTALL_PACKAGE_DIR=${placeholder "dev"}/lib/cmake/lld" 35 + ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ 36 + "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" 37 + ]; 38 + 39 + outputs = [ "out" "lib" "dev" ]; 40 + 41 + meta = llvm_meta // { 42 + homepage = "https://lld.llvm.org/"; 43 + description = "The LLVM linker (unwrapped)"; 44 + longDescription = '' 45 + LLD is a linker from the LLVM project that is a drop-in replacement for 46 + system linkers and runs much faster than them. It also provides features 47 + that are useful for toolchain developers. 48 + The linker supports ELF (Unix), PE/COFF (Windows), Mach-O (macOS), and 49 + WebAssembly in descending order of completeness. Internally, LLD consists 50 + of several different linkers. 51 + ''; 52 + }; 53 + }
+46
pkgs/development/compilers/llvm/15/lld/gnu-install-dirs.patch
··· 1 + diff --git a/CMakeLists.txt b/CMakeLists.txt 2 + index dcc649629a4b..58dca54642e4 100644 3 + --- a/CMakeLists.txt 4 + +++ b/CMakeLists.txt 5 + @@ -70,13 +70,15 @@ if(LLD_BUILT_STANDALONE) 6 + if (NOT LLVM_CONFIG_FOUND) 7 + # Pull values from LLVMConfig.cmake. We can drop this once the llvm-config 8 + # path is removed. 9 + - set(MAIN_INCLUDE_DIR "${LLVM_INCLUDE_DIR}") 10 + + set(INCLUDE_DIRS ${LLVM_INCLUDE_DIRS}) 11 + set(LLVM_OBJ_DIR "${LLVM_BINARY_DIR}") 12 + # N.B. this is just a default value, the CACHE PATHs below can be overridden. 13 + set(MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm") 14 + + else() 15 + + set(INCLUDE_DIRS "${LLVM_BINARY_DIR}/include" "${MAIN_INCLUDE_DIR}") 16 + endif() 17 + 18 + - set(LLVM_MAIN_INCLUDE_DIR "${MAIN_INCLUDE_DIR}" CACHE PATH "Path to llvm/include") 19 + + set(LLVM_INCLUDE_DIRS ${INCLUDE_DIRS} CACHE PATH "Path to llvm/include and any other header dirs needed") 20 + set(LLVM_BINARY_DIR "${LLVM_OBJ_ROOT}" CACHE PATH "Path to LLVM build tree") 21 + set(LLVM_MAIN_SRC_DIR "${MAIN_SRC_DIR}" CACHE PATH "Path to LLVM source tree") 22 + 23 + @@ -95,7 +97,7 @@ if(LLD_BUILT_STANDALONE) 24 + 25 + set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}") 26 + 27 + - include_directories("${LLVM_BINARY_DIR}/include" ${LLVM_INCLUDE_DIRS}) 28 + + include_directories(${LLVM_INCLUDE_DIRS}) 29 + link_directories(${LLVM_LIBRARY_DIRS}) 30 + 31 + if(LLVM_INCLUDE_TESTS) 32 + diff --git a/cmake/modules/AddLLD.cmake b/cmake/modules/AddLLD.cmake 33 + index d3924f7243d4..42a7cd62281c 100644 34 + --- a/cmake/modules/AddLLD.cmake 35 + +++ b/cmake/modules/AddLLD.cmake 36 + @@ -18,8 +18,8 @@ macro(add_lld_library name) 37 + install(TARGETS ${name} 38 + COMPONENT ${name} 39 + ${export_to_lldtargets} 40 + - LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} 41 + - ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} 42 + + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" 43 + + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" 44 + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") 45 + 46 + if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES)
+145
pkgs/development/compilers/llvm/15/lldb/default.nix
··· 1 + { lib, stdenv, llvm_meta 2 + , runCommand 3 + , monorepoSrc 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 + , makeWrapper 23 + , enableManpages ? false 24 + , lua5_3 25 + }: 26 + 27 + stdenv.mkDerivation (rec { 28 + pname = "lldb"; 29 + inherit version; 30 + 31 + src = runCommand "${pname}-src-${version}" {} '' 32 + mkdir -p "$out" 33 + cp -r ${monorepoSrc}/cmake "$out" 34 + cp -r ${monorepoSrc}/${pname} "$out" 35 + ''; 36 + 37 + sourceRoot = "${src.name}/${pname}"; 38 + 39 + patches = [ 40 + ./procfs.patch 41 + (runCommand "resource-dir.patch" { 42 + clangLibDir = "${libclang.lib}/lib"; 43 + } '' 44 + substitute '${./resource-dir.patch}' "$out" --subst-var clangLibDir 45 + '') 46 + ./gnu-install-dirs.patch 47 + ]; 48 + 49 + outputs = [ "out" "lib" "dev" ]; 50 + 51 + nativeBuildInputs = [ 52 + cmake python3 which swig lit makeWrapper lua5_3 53 + ] ++ lib.optionals enableManpages [ 54 + python3.pkgs.sphinx python3.pkgs.recommonmark 55 + ]; 56 + 57 + buildInputs = [ 58 + ncurses 59 + zlib 60 + libedit 61 + libxml2 62 + libllvm 63 + ] ++ lib.optionals stdenv.isDarwin [ 64 + libobjc 65 + xpc 66 + Foundation 67 + bootstrap_cmds 68 + Carbon 69 + Cocoa 70 + ]; 71 + 72 + hardeningDisable = [ "format" ]; 73 + 74 + cmakeFlags = [ 75 + "-DLLDB_INCLUDE_TESTS=${if doCheck then "YES" else "NO"}" 76 + "-DLLVM_ENABLE_RTTI=OFF" 77 + "-DClang_DIR=${libclang.dev}/lib/cmake" 78 + "-DLLVM_EXTERNAL_LIT=${lit}/bin/lit" 79 + ] ++ lib.optionals stdenv.isDarwin [ 80 + "-DLLDB_USE_SYSTEM_DEBUGSERVER=ON" 81 + ] ++ lib.optionals (!stdenv.isDarwin) [ 82 + "-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic 83 + ] ++ lib.optionals enableManpages [ 84 + "-DLLVM_ENABLE_SPHINX=ON" 85 + "-DSPHINX_OUTPUT_MAN=ON" 86 + "-DSPHINX_OUTPUT_HTML=OFF" 87 + ] ++ lib.optionals doCheck [ 88 + "-DLLDB_TEST_C_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" 89 + "-DLLDB_TEST_CXX_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++" 90 + ]; 91 + 92 + doCheck = false; 93 + 94 + installCheckPhase = '' 95 + if [ ! -e "$lib/${python3.sitePackages}/lldb/_lldb.so" ] ; then 96 + return 1; 97 + fi 98 + ''; 99 + 100 + postInstall = '' 101 + wrapProgram $out/bin/lldb --prefix PYTHONPATH : $lib/${python3.sitePackages}/ 102 + 103 + # Editor support 104 + # vscode: 105 + install -D ../tools/lldb-vscode/package.json $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/package.json 106 + mkdir -p $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin 107 + ln -s $out/bin/lldb-vscode $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin 108 + ''; 109 + 110 + meta = llvm_meta // { 111 + homepage = "https://lldb.llvm.org/"; 112 + description = "A next-generation high-performance debugger"; 113 + longDescription = '' 114 + LLDB is a next generation, high-performance debugger. It is built as a set 115 + of reusable components which highly leverage existing libraries in the 116 + larger LLVM Project, such as the Clang expression parser and LLVM 117 + disassembler. 118 + ''; 119 + }; 120 + } // lib.optionalAttrs enableManpages { 121 + pname = "lldb-manpages"; 122 + 123 + buildPhase = '' 124 + make docs-lldb-man 125 + ''; 126 + 127 + propagatedBuildInputs = []; 128 + 129 + # manually install lldb man page 130 + installPhase = '' 131 + mkdir -p $out/share/man/man1 132 + install docs/man/lldb.1 -t $out/share/man/man1/ 133 + ''; 134 + 135 + postPatch = null; 136 + postInstall = null; 137 + 138 + outputs = [ "out" ]; 139 + 140 + doCheck = false; 141 + 142 + meta = llvm_meta // { 143 + description = "man pages for LLDB ${version}"; 144 + }; 145 + })
+23
pkgs/development/compilers/llvm/15/lldb/gnu-install-dirs.patch
··· 1 + diff --git a/cmake/modules/AddLLDB.cmake b/cmake/modules/AddLLDB.cmake 2 + index 3291a7c808e1..b27d27ce6a87 100644 3 + --- a/cmake/modules/AddLLDB.cmake 4 + +++ b/cmake/modules/AddLLDB.cmake 5 + @@ -109,7 +109,7 @@ function(add_lldb_library name) 6 + endif() 7 + 8 + if(PARAM_SHARED) 9 + - set(install_dest lib${LLVM_LIBDIR_SUFFIX}) 10 + + set(install_dest ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) 11 + if(PARAM_INSTALL_PREFIX) 12 + set(install_dest ${PARAM_INSTALL_PREFIX}) 13 + endif() 14 + diff --git a/tools/intel-features/CMakeLists.txt b/tools/intel-features/CMakeLists.txt 15 + index 7d48491ec89a..c04543585588 100644 16 + --- a/tools/intel-features/CMakeLists.txt 17 + +++ b/tools/intel-features/CMakeLists.txt 18 + @@ -30,4 +30,4 @@ add_lldb_library(lldbIntelFeatures SHARED 19 + ) 20 + 21 + install(TARGETS lldbIntelFeatures 22 + - LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}) 23 + + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX})
+40
pkgs/development/compilers/llvm/15/lldb/procfs.patch
··· 1 + --- a/source/Plugins/Process/Linux/Procfs.h 2 + +++ b/source/Plugins/Process/Linux/Procfs.h 3 + @@ -10,6 +10,7 @@ 4 + // sys/procfs.h on Android/Linux for all supported architectures. 5 + 6 + #include <sys/ptrace.h> 7 + +#include <asm/ptrace.h> 8 + 9 + #include "lldb/lldb-types.h" 10 + 11 + @@ -17,23 +18,13 @@ 12 + 13 + #include <vector> 14 + 15 + -#ifdef __ANDROID__ 16 + -#if defined(__arm64__) || defined(__aarch64__) 17 + -typedef unsigned long elf_greg_t; 18 + -typedef elf_greg_t 19 + - elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))]; 20 + -typedef struct user_fpsimd_state elf_fpregset_t; 21 + -#ifndef NT_FPREGSET 22 + -#define NT_FPREGSET NT_PRFPREG 23 + -#endif // NT_FPREGSET 24 + -#elif defined(__mips__) 25 + -#ifndef NT_FPREGSET 26 + -#define NT_FPREGSET NT_PRFPREG 27 + -#endif // NT_FPREGSET 28 + -#endif 29 + -#else // __ANDROID__ 30 + +#if !defined(__GLIBC__) && defined(__powerpc__) 31 + +#define pt_regs musl_pt_regs 32 + +#include <sys/procfs.h> 33 + +#undef pt_regs 34 + +#else 35 + #include <sys/procfs.h> 36 + -#endif // __ANDROID__ 37 + +#endif 38 + 39 + namespace lldb_private { 40 + namespace process_linux {
+13
pkgs/development/compilers/llvm/15/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}")
+267
pkgs/development/compilers/llvm/15/llvm/default.nix
··· 1 + { lib, stdenv, llvm_meta 2 + , pkgsBuildBuild 3 + , monorepoSrc 4 + , runCommand 5 + , fetchpatch 6 + , cmake 7 + , python3 8 + , libffi 9 + , libbfd 10 + , libpfm 11 + , libxml2 12 + , ncurses 13 + , version 14 + , release_version 15 + , zlib 16 + , which 17 + , buildLlvmTools 18 + , debugVersion ? false 19 + , enableManpages ? false 20 + , enableSharedLibraries ? !stdenv.hostPlatform.isStatic 21 + , enablePFM ? !(stdenv.isDarwin 22 + || stdenv.isAarch64 # broken for Ampere eMAG 8180 (c2.large.arm on Packet) #56245 23 + || stdenv.isAarch32 # broken for the armv7l builder 24 + ) 25 + , enablePolly ? false 26 + } @args: 27 + 28 + let 29 + inherit (lib) optional optionals optionalString; 30 + 31 + # Used when creating a version-suffixed symlink of libLLVM.dylib 32 + shortVersion = with lib; 33 + concatStringsSep "." (take 1 (splitString "." release_version)); 34 + 35 + in stdenv.mkDerivation (rec { 36 + pname = "llvm"; 37 + inherit version; 38 + 39 + src = runCommand "${pname}-src-${version}" {} ('' 40 + mkdir -p "$out" 41 + cp -r ${monorepoSrc}/cmake "$out" 42 + cp -r ${monorepoSrc}/${pname} "$out" 43 + cp -r ${monorepoSrc}/third-party "$out" 44 + '' + lib.optionalString enablePolly '' 45 + cp -r ${monorepoSrc}/polly "$out/llvm/tools" 46 + ''); 47 + 48 + sourceRoot = "${src.name}/${pname}"; 49 + 50 + outputs = [ "out" "lib" "dev" "python" ]; 51 + 52 + nativeBuildInputs = [ cmake python3 ] 53 + ++ optionals enableManpages [ python3.pkgs.sphinx python3.pkgs.recommonmark ]; 54 + 55 + buildInputs = [ libxml2 libffi ] 56 + ++ optional enablePFM libpfm; # exegesis 57 + 58 + propagatedBuildInputs = [ ncurses zlib ]; 59 + 60 + checkInputs = [ which ]; 61 + 62 + patches = [ 63 + ./gnu-install-dirs.patch 64 + ] ++ lib.optional enablePolly ./gnu-install-dirs-polly.patch; 65 + 66 + postPatch = optionalString stdenv.isDarwin '' 67 + substituteInPlace cmake/modules/AddLLVM.cmake \ 68 + --replace 'set(_install_name_dir INSTALL_NAME_DIR "@rpath")' "set(_install_name_dir)" \ 69 + --replace 'set(_install_rpath "@loader_path/../''${CMAKE_INSTALL_LIBDIR}''${LLVM_LIBDIR_SUFFIX}" ''${extra_libdir})' "" 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 + rm test/tools/llvm-objcopy/ELF/mirror-permissions-unix.test 79 + '' + optionalString stdenv.hostPlatform.isMusl '' 80 + patch -p1 -i ${../../TLI-musl.patch} 81 + substituteInPlace unittests/Support/CMakeLists.txt \ 82 + --replace "add_subdirectory(DynamicLibrary)" "" 83 + rm unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp 84 + # valgrind unhappy with musl or glibc, but fails w/musl only 85 + rm test/CodeGen/AArch64/wineh4.mir 86 + '' + optionalString stdenv.hostPlatform.isAarch32 '' 87 + # skip failing X86 test cases on 32-bit ARM 88 + rm test/DebugInfo/X86/convert-debugloc.ll 89 + rm test/DebugInfo/X86/convert-inlined.ll 90 + rm test/DebugInfo/X86/convert-linked.ll 91 + rm test/tools/dsymutil/X86/op-convert.test 92 + rm test/tools/gold/X86/split-dwarf.ll 93 + rm test/tools/llvm-dwarfdump/X86/prettyprint_types.s 94 + rm test/tools/llvm-dwarfdump/X86/simplified-template-names.s 95 + '' + optionalString (stdenv.hostPlatform.system == "armv6l-linux") '' 96 + # Seems to require certain floating point hardware (NEON?) 97 + rm test/ExecutionEngine/frem.ll 98 + '' + '' 99 + patchShebangs test/BugPoint/compile-custom.ll.py 100 + ''; 101 + 102 + preConfigure = '' 103 + # Workaround for configure flags that need to have spaces 104 + cmakeFlagsArray+=( 105 + -DLLVM_LIT_ARGS='-svj''${NIX_BUILD_CORES} --no-progress-bar' 106 + ) 107 + ''; 108 + 109 + # hacky fix: created binaries need to be run before installation 110 + preBuild = '' 111 + mkdir -p $out/ 112 + ln -sv $PWD/lib $out 113 + ''; 114 + 115 + # E.g. mesa.drivers use the build-id as a cache key (see #93946): 116 + LDFLAGS = optionalString (enableSharedLibraries && !stdenv.isDarwin) "-Wl,--build-id=sha1"; 117 + 118 + cmakeFlags = with stdenv; let 119 + # These flags influence llvm-config's BuildVariables.inc in addition to the 120 + # general build. We need to make sure these are also passed via 121 + # CROSS_TOOLCHAIN_FLAGS_NATIVE when cross-compiling or llvm-config-native 122 + # will return different results from the cross llvm-config. 123 + # 124 + # Some flags don't need to be repassed because LLVM already does so (like 125 + # CMAKE_BUILD_TYPE), others are irrelevant to the result. 126 + flagsForLlvmConfig = [ 127 + "-DLLVM_INSTALL_PACKAGE_DIR=${placeholder "dev"}/lib/cmake/llvm" 128 + "-DLLVM_ENABLE_RTTI=ON" 129 + ] ++ optionals enableSharedLibraries [ 130 + "-DLLVM_LINK_LLVM_DYLIB=ON" 131 + ]; 132 + in flagsForLlvmConfig ++ [ 133 + "-DCMAKE_BUILD_TYPE=${if debugVersion then "Debug" else "Release"}" 134 + "-DLLVM_INSTALL_UTILS=ON" # Needed by rustc 135 + "-DLLVM_BUILD_TESTS=${if doCheck then "ON" else "OFF"}" 136 + "-DLLVM_ENABLE_FFI=ON" 137 + "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}" 138 + "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}" 139 + "-DLLVM_ENABLE_DUMP=ON" 140 + ] ++ optionals stdenv.hostPlatform.isStatic [ 141 + # Disables building of shared libs, -fPIC is still injected by cc-wrapper 142 + "-DLLVM_ENABLE_PIC=OFF" 143 + "-DLLVM_BUILD_STATIC=ON" 144 + # libxml2 needs to be disabled because the LLVM build system ignores its .la 145 + # file and doesn't link zlib as well. 146 + # https://github.com/ClangBuiltLinux/tc-build/issues/150#issuecomment-845418812 147 + "-DLLVM_ENABLE_LIBXML2=OFF" 148 + ] ++ optionals enableManpages [ 149 + "-DLLVM_BUILD_DOCS=ON" 150 + "-DLLVM_ENABLE_SPHINX=ON" 151 + "-DSPHINX_OUTPUT_MAN=ON" 152 + "-DSPHINX_OUTPUT_HTML=OFF" 153 + "-DSPHINX_WARNINGS_AS_ERRORS=OFF" 154 + ] ++ optionals (!isDarwin) [ 155 + "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include" 156 + ] ++ optionals isDarwin [ 157 + "-DLLVM_ENABLE_LIBCXX=ON" 158 + "-DCAN_TARGET_i386=false" 159 + ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ 160 + "-DCMAKE_CROSSCOMPILING=True" 161 + "-DLLVM_TABLEGEN=${buildLlvmTools.llvm}/bin/llvm-tblgen" 162 + ( 163 + let 164 + nativeCC = pkgsBuildBuild.targetPackages.stdenv.cc; 165 + nativeBintools = nativeCC.bintools.bintools; 166 + nativeToolchainFlags = [ 167 + "-DCMAKE_C_COMPILER=${nativeCC}/bin/${nativeCC.targetPrefix}cc" 168 + "-DCMAKE_CXX_COMPILER=${nativeCC}/bin/${nativeCC.targetPrefix}c++" 169 + "-DCMAKE_AR=${nativeBintools}/bin/${nativeBintools.targetPrefix}ar" 170 + "-DCMAKE_STRIP=${nativeBintools}/bin/${nativeBintools.targetPrefix}strip" 171 + "-DCMAKE_RANLIB=${nativeBintools}/bin/${nativeBintools.targetPrefix}ranlib" 172 + ]; 173 + # We need to repass the custom GNUInstallDirs values, otherwise CMake 174 + # will choose them for us, leading to wrong results in llvm-config-native 175 + nativeInstallFlags = [ 176 + "-DCMAKE_INSTALL_PREFIX=${placeholder "out"}" 177 + "-DCMAKE_INSTALL_BINDIR=${placeholder "out"}/bin" 178 + "-DCMAKE_INSTALL_INCLUDEDIR=${placeholder "dev"}/include" 179 + "-DCMAKE_INSTALL_LIBDIR=${placeholder "lib"}/lib" 180 + "-DCMAKE_INSTALL_LIBEXECDIR=${placeholder "lib"}/libexec" 181 + ]; 182 + in "-DCROSS_TOOLCHAIN_FLAGS_NATIVE:list=" 183 + + lib.concatStringsSep ";" (lib.concatLists [ 184 + flagsForLlvmConfig 185 + nativeToolchainFlags 186 + nativeInstallFlags 187 + ]) 188 + ) 189 + ]; 190 + 191 + postBuild = '' 192 + rm -fR $out 193 + ''; 194 + 195 + preCheck = '' 196 + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/lib 197 + ''; 198 + 199 + postInstall = '' 200 + mkdir -p $python/share 201 + mv $out/share/opt-viewer $python/share/opt-viewer 202 + moveToOutput "bin/llvm-config*" "$dev" 203 + substituteInPlace "$dev/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ 204 + --replace "\''${_IMPORT_PREFIX}/lib/lib" "$lib/lib/lib" \ 205 + --replace "$out/bin/llvm-config" "$dev/bin/llvm-config" 206 + substituteInPlace "$dev/lib/cmake/llvm/LLVMConfig.cmake" \ 207 + --replace 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}")' 'set(LLVM_BINARY_DIR "'"$lib"'")' 208 + '' 209 + + optionalString (stdenv.isDarwin && enableSharedLibraries) '' 210 + ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${shortVersion}.dylib 211 + ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib 212 + '' 213 + + optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' 214 + cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native 215 + ''; 216 + 217 + doCheck = stdenv.isLinux && (!stdenv.isx86_32) && (!stdenv.hostPlatform.isMusl) 218 + && (stdenv.hostPlatform == stdenv.buildPlatform); 219 + 220 + checkTarget = "check-all"; 221 + 222 + # For the update script: 223 + passthru.monorepoSrc = monorepoSrc; 224 + 225 + requiredSystemFeatures = [ "big-parallel" ]; 226 + meta = llvm_meta // { 227 + homepage = "https://llvm.org/"; 228 + description = "A collection of modular and reusable compiler and toolchain technologies"; 229 + longDescription = '' 230 + The LLVM Project is a collection of modular and reusable compiler and 231 + toolchain technologies. Despite its name, LLVM has little to do with 232 + traditional virtual machines. The name "LLVM" itself is not an acronym; it 233 + is the full name of the project. 234 + LLVM began as a research project at the University of Illinois, with the 235 + goal of providing a modern, SSA-based compilation strategy capable of 236 + supporting both static and dynamic compilation of arbitrary programming 237 + languages. Since then, LLVM has grown to be an umbrella project consisting 238 + of a number of subprojects, many of which are being used in production by 239 + a wide variety of commercial and open source projects as well as being 240 + widely used in academic research. Code in the LLVM project is licensed 241 + under the "Apache 2.0 License with LLVM exceptions". 242 + ''; 243 + }; 244 + } // lib.optionalAttrs enableManpages { 245 + pname = "llvm-manpages"; 246 + 247 + buildPhase = '' 248 + make docs-llvm-man 249 + ''; 250 + 251 + propagatedBuildInputs = []; 252 + 253 + installPhase = '' 254 + make -C docs install 255 + ''; 256 + 257 + postPatch = null; 258 + postInstall = null; 259 + 260 + outputs = [ "out" ]; 261 + 262 + doCheck = false; 263 + 264 + meta = llvm_meta // { 265 + description = "man pages for LLVM ${version}"; 266 + }; 267 + })
+102
pkgs/development/compilers/llvm/15/llvm/gnu-install-dirs-polly.patch
··· 1 + diff --git a/tools/polly/CMakeLists.txt b/tools/polly/CMakeLists.txt 2 + index ca7c04c565bb..6a6155806ffa 100644 3 + --- a/tools/polly/CMakeLists.txt 4 + +++ b/tools/polly/CMakeLists.txt 5 + @@ -3,6 +3,8 @@ if (NOT DEFINED LLVM_MAIN_SRC_DIR) 6 + project(Polly) 7 + cmake_minimum_required(VERSION 3.13.4) 8 + 9 + + include(GNUInstallDirs) 10 + + 11 + # Where is LLVM installed? 12 + find_package(LLVM CONFIG REQUIRED) 13 + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${LLVM_CMAKE_DIR}) 14 + @@ -122,13 +124,13 @@ include_directories( 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 + 24 + install(DIRECTORY ${POLLY_BINARY_DIR}/include/ 25 + - DESTINATION include 26 + + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} 27 + FILES_MATCHING 28 + PATTERN "*.h" 29 + PATTERN "CMakeFiles" EXCLUDE 30 + diff --git a/tools/polly/cmake/CMakeLists.txt b/tools/polly/cmake/CMakeLists.txt 31 + index 7cc129ba2e90..137be25e4b80 100644 32 + --- a/tools/polly/cmake/CMakeLists.txt 33 + +++ b/tools/polly/cmake/CMakeLists.txt 34 + @@ -79,18 +79,18 @@ file(GENERATE 35 + 36 + # Generate PollyConfig.cmake for the install tree. 37 + unset(POLLY_EXPORTS) 38 + -set(POLLY_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") 39 + +set(POLLY_INSTALL_PREFIX "") 40 + set(POLLY_CONFIG_LLVM_CMAKE_DIR "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}") 41 + -set(POLLY_CONFIG_CMAKE_DIR "${POLLY_INSTALL_PREFIX}/${POLLY_INSTALL_PACKAGE_DIR}") 42 + -set(POLLY_CONFIG_LIBRARY_DIRS "${POLLY_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}") 43 + +set(POLLY_CONFIG_CMAKE_DIR "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_PREFIX}/${POLLY_INSTALL_PACKAGE_DIR}") 44 + +set(POLLY_CONFIG_LIBRARY_DIRS "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") 45 + if (POLLY_BUNDLED_ISL) 46 + set(POLLY_CONFIG_INCLUDE_DIRS 47 + - "${POLLY_INSTALL_PREFIX}/include" 48 + - "${POLLY_INSTALL_PREFIX}/include/polly" 49 + + "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}" 50 + + "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}/polly" 51 + ) 52 + else() 53 + set(POLLY_CONFIG_INCLUDE_DIRS 54 + - "${POLLY_INSTALL_PREFIX}/include" 55 + + "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_INCLUDEDIR}" 56 + ${ISL_INCLUDE_DIRS} 57 + ) 58 + endif() 59 + @@ -100,12 +100,12 @@ endif() 60 + foreach(tgt IN LISTS POLLY_CONFIG_EXPORTED_TARGETS) 61 + get_target_property(tgt_type ${tgt} TYPE) 62 + if (tgt_type STREQUAL "EXECUTABLE") 63 + - set(tgt_prefix "bin/") 64 + + set(tgt_prefix "${CMAKE_INSTALL_BINDIR}/") 65 + else() 66 + - set(tgt_prefix "lib/") 67 + + set(tgt_prefix "${CMAKE_INSTALL_LIBDIR}/") 68 + endif() 69 + 70 + - set(tgt_path "${CMAKE_INSTALL_PREFIX}/${tgt_prefix}$<TARGET_FILE_NAME:${tgt}>") 71 + + set(tgt_path "${tgt_prefix}$<TARGET_FILE_NAME:${tgt}>") 72 + file(RELATIVE_PATH tgt_path ${POLLY_CONFIG_CMAKE_DIR} ${tgt_path}) 73 + 74 + if (NOT tgt_type STREQUAL "INTERFACE_LIBRARY") 75 + diff --git a/tools/polly/cmake/polly_macros.cmake b/tools/polly/cmake/polly_macros.cmake 76 + index 518a09b45a42..bd9d6f5542ad 100644 77 + --- a/tools/polly/cmake/polly_macros.cmake 78 + +++ b/tools/polly/cmake/polly_macros.cmake 79 + @@ -44,8 +44,8 @@ macro(add_polly_library name) 80 + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LLVMPolly") 81 + install(TARGETS ${name} 82 + EXPORT LLVMExports 83 + - LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} 84 + - ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}) 85 + + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} 86 + + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) 87 + endif() 88 + set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) 89 + endmacro(add_polly_library) 90 + diff --git a/tools/polly/lib/External/CMakeLists.txt b/tools/polly/lib/External/CMakeLists.txt 91 + index e3a5683fccdc..293b482eb28a 100644 92 + --- a/tools/polly/lib/External/CMakeLists.txt 93 + +++ b/tools/polly/lib/External/CMakeLists.txt 94 + @@ -290,7 +290,7 @@ if (POLLY_BUNDLED_ISL) 95 + install(DIRECTORY 96 + ${ISL_SOURCE_DIR}/include/ 97 + ${ISL_BINARY_DIR}/include/ 98 + - DESTINATION include/polly 99 + + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/polly 100 + FILES_MATCHING 101 + PATTERN "*.h" 102 + PATTERN "CMakeFiles" EXCLUDE
+138
pkgs/development/compilers/llvm/15/llvm/gnu-install-dirs.patch
··· 1 + diff --git a/CMakeLists.txt b/CMakeLists.txt 2 + index 45399dc0537e..5d946e9e6583 100644 3 + --- a/CMakeLists.txt 4 + +++ b/CMakeLists.txt 5 + @@ -942,7 +942,7 @@ if (NOT TENSORFLOW_AOT_PATH STREQUAL "") 6 + add_subdirectory(${TENSORFLOW_AOT_PATH}/xla_aot_runtime_src 7 + ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/tf_runtime) 8 + install(TARGETS tf_xla_runtime EXPORT LLVMExports 9 + - ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT tf_xla_runtime) 10 + + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} COMPONENT tf_xla_runtime) 11 + set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS tf_xla_runtime) 12 + # Once we add more modules, we should handle this more automatically. 13 + if (DEFINED LLVM_OVERRIDE_MODEL_HEADER_INLINERSIZEMODEL) 14 + diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake 15 + index 057431208322..56f0dcb258da 100644 16 + --- a/cmake/modules/AddLLVM.cmake 17 + +++ b/cmake/modules/AddLLVM.cmake 18 + @@ -844,8 +844,8 @@ macro(add_llvm_library name) 19 + get_target_export_arg(${name} LLVM export_to_llvmexports ${umbrella}) 20 + install(TARGETS ${name} 21 + ${export_to_llvmexports} 22 + - LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} 23 + - ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} 24 + + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" COMPONENT ${name} 25 + + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" COMPONENT ${name} 26 + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT ${name}) 27 + 28 + if (NOT LLVM_ENABLE_IDE) 29 + @@ -2007,7 +2007,7 @@ function(llvm_install_library_symlink name dest type) 30 + set(full_name ${CMAKE_${type}_LIBRARY_PREFIX}${name}${CMAKE_${type}_LIBRARY_SUFFIX}) 31 + set(full_dest ${CMAKE_${type}_LIBRARY_PREFIX}${dest}${CMAKE_${type}_LIBRARY_SUFFIX}) 32 + 33 + - set(output_dir lib${LLVM_LIBDIR_SUFFIX}) 34 + + set(output_dir ${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) 35 + if(WIN32 AND "${type}" STREQUAL "SHARED") 36 + set(output_dir "${CMAKE_INSTALL_BINDIR}") 37 + endif() 38 + @@ -2271,15 +2271,15 @@ function(llvm_setup_rpath name) 39 + 40 + if (APPLE) 41 + set(_install_name_dir INSTALL_NAME_DIR "@rpath") 42 + - set(_install_rpath "@loader_path/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) 43 + + set(_install_rpath "@loader_path/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) 44 + elseif(${CMAKE_SYSTEM_NAME} MATCHES "AIX" AND BUILD_SHARED_LIBS) 45 + # $ORIGIN is not interpreted at link time by aix ld. 46 + # Since BUILD_SHARED_LIBS is only recommended for use by developers, 47 + # hardcode the rpath to build/install lib dir first in this mode. 48 + # FIXME: update this when there is better solution. 49 + - set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) 50 + + set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) 51 + elseif(UNIX) 52 + - set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) 53 + + set(_install_rpath "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) 54 + if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)") 55 + set_property(TARGET ${name} APPEND_STRING PROPERTY 56 + LINK_FLAGS " -Wl,-z,origin ") 57 + diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake 58 + index 891c9e6d618c..8d963f3b0069 100644 59 + --- a/cmake/modules/AddOCaml.cmake 60 + +++ b/cmake/modules/AddOCaml.cmake 61 + @@ -147,9 +147,9 @@ function(add_ocaml_library name) 62 + endforeach() 63 + 64 + if( APPLE ) 65 + - set(ocaml_rpath "@executable_path/../../../lib${LLVM_LIBDIR_SUFFIX}") 66 + + set(ocaml_rpath "@executable_path/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") 67 + elseif( UNIX ) 68 + - set(ocaml_rpath "\\$ORIGIN/../../../lib${LLVM_LIBDIR_SUFFIX}") 69 + + set(ocaml_rpath "\\$ORIGIN/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") 70 + endif() 71 + list(APPEND ocaml_flags "-ldopt" "-Wl,-rpath,${ocaml_rpath}") 72 + 73 + diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt 74 + index d4b0ab959148..26ed981fd09f 100644 75 + --- a/cmake/modules/CMakeLists.txt 76 + +++ b/cmake/modules/CMakeLists.txt 77 + @@ -128,7 +128,7 @@ set(LLVM_CONFIG_INCLUDE_DIRS 78 + ) 79 + list(REMOVE_DUPLICATES LLVM_CONFIG_INCLUDE_DIRS) 80 + 81 + -extend_path(LLVM_CONFIG_LIBRARY_DIR "\${LLVM_INSTALL_PREFIX}" "lib\${LLVM_LIBDIR_SUFFIX}") 82 + +extend_path(LLVM_CONFIG_LIBRARY_DIR "\${LLVM_INSTALL_PREFIX}" "${CMAKE_INSTALL_LIBDIR}\${LLVM_LIBDIR_SUFFIX}") 83 + set(LLVM_CONFIG_LIBRARY_DIRS 84 + "${LLVM_CONFIG_LIBRARY_DIR}" 85 + # FIXME: Should there be other entries here? 86 + diff --git a/docs/CMake.rst b/docs/CMake.rst 87 + index 879b7b231d4c..9c31d14e8950 100644 88 + --- a/docs/CMake.rst 89 + +++ b/docs/CMake.rst 90 + @@ -250,7 +250,7 @@ description is in `LLVM-related variables`_ below. 91 + **LLVM_LIBDIR_SUFFIX**:STRING 92 + Extra suffix to append to the directory where libraries are to be 93 + installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64`` 94 + - to install libraries to ``/usr/lib64``. 95 + + to install libraries to ``/usr/lib64``. See also ``CMAKE_INSTALL_LIBDIR``. 96 + 97 + **LLVM_PARALLEL_{COMPILE,LINK}_JOBS**:STRING 98 + Building the llvm toolchain can use a lot of resources, particularly 99 + @@ -284,6 +284,10 @@ manual, or execute ``cmake --help-variable VARIABLE_NAME``. 100 + The path to install executables, relative to the *CMAKE_INSTALL_PREFIX*. 101 + Defaults to "bin". 102 + 103 + +**CMAKE_INSTALL_LIBDIR**:PATH 104 + + The path to install libraries, relative to the *CMAKE_INSTALL_PREFIX*. 105 + + Defaults to "lib". 106 + + 107 + **CMAKE_INSTALL_INCLUDEDIR**:PATH 108 + The path to install header files, relative to the *CMAKE_INSTALL_PREFIX*. 109 + Defaults to "include". 110 + diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in 111 + index 370005cd8d7d..7e790bc52111 100644 112 + --- a/tools/llvm-config/BuildVariables.inc.in 113 + +++ b/tools/llvm-config/BuildVariables.inc.in 114 + @@ -23,6 +23,7 @@ 115 + #define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@" 116 + #define LLVM_BUILDMODE "@LLVM_BUILDMODE@" 117 + #define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@" 118 + +#define LLVM_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@" 119 + #define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@" 120 + #define LLVM_INSTALL_PACKAGE_DIR "@LLVM_INSTALL_PACKAGE_DIR@" 121 + #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@" 122 + diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp 123 + index 2c6c55f89d38..f6d2068a0827 100644 124 + --- a/tools/llvm-config/llvm-config.cpp 125 + +++ b/tools/llvm-config/llvm-config.cpp 126 + @@ -369,7 +369,11 @@ int main(int argc, char **argv) { 127 + sys::fs::make_absolute(ActivePrefix, Path); 128 + ActiveBinDir = std::string(Path.str()); 129 + } 130 + - ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX; 131 + + { 132 + + SmallString<256> Path(LLVM_INSTALL_LIBDIR LLVM_LIBDIR_SUFFIX); 133 + + sys::fs::make_absolute(ActivePrefix, Path); 134 + + ActiveLibDir = std::string(Path.str()); 135 + + } 136 + { 137 + SmallString<256> Path(LLVM_INSTALL_PACKAGE_DIR); 138 + sys::fs::make_absolute(ActivePrefix, Path);
+67
pkgs/development/compilers/llvm/15/openmp/default.nix
··· 1 + { lib 2 + , stdenv 3 + , llvm_meta 4 + , monorepoSrc 5 + , runCommand 6 + , cmake 7 + , llvm 8 + , lit 9 + , clang-unwrapped 10 + , perl 11 + , pkg-config 12 + , version 13 + }: 14 + 15 + stdenv.mkDerivation rec { 16 + pname = "openmp"; 17 + inherit version; 18 + 19 + src = runCommand "${pname}-src-${version}" {} '' 20 + mkdir -p "$out" 21 + cp -r ${monorepoSrc}/cmake "$out" 22 + cp -r ${monorepoSrc}/${pname} "$out" 23 + ''; 24 + 25 + sourceRoot = "${src.name}/${pname}"; 26 + 27 + patches = [ 28 + ./fix-find-tool.patch 29 + ./gnu-install-dirs.patch 30 + ./run-lit-directly.patch 31 + ]; 32 + 33 + outputs = [ "out" "dev" ]; 34 + 35 + nativeBuildInputs = [ cmake perl pkg-config lit ]; 36 + buildInputs = [ llvm ]; 37 + 38 + # Unsup:Pass:XFail:Fail 39 + # 26:267:16:8 40 + doCheck = false; 41 + checkTarget = "check-openmp"; 42 + 43 + preCheck = '' 44 + patchShebangs ../tools/archer/tests/deflake.bash 45 + ''; 46 + 47 + cmakeFlags = [ 48 + "-DCLANG_TOOL=${clang-unwrapped}/bin/clang" 49 + "-DOPT_TOOL=${llvm}/bin/opt" 50 + "-DLINK_TOOL=${llvm}/bin/llvm-link" 51 + ]; 52 + 53 + meta = llvm_meta // { 54 + homepage = "https://openmp.llvm.org/"; 55 + description = "Support for the OpenMP language"; 56 + longDescription = '' 57 + The OpenMP subproject of LLVM contains the components required to build an 58 + executable OpenMP program that are outside the compiler itself. 59 + Contains the code for the runtime library against which code compiled by 60 + "clang -fopenmp" must be linked before it can run and the library that 61 + supports offload to target devices. 62 + ''; 63 + # "All of the code is dual licensed under the MIT license and the UIUC 64 + # License (a BSD-like license)": 65 + license = with lib.licenses; [ mit ncsa ]; 66 + }; 67 + }
+18
pkgs/development/compilers/llvm/15/openmp/fix-find-tool.patch
··· 1 + diff --git a/libomptarget/DeviceRTL/CMakeLists.txt b/libomptarget/DeviceRTL/CMakeLists.txt 2 + index ce66214822a2..6ab7b33c95da 100644 3 + --- a/libomptarget/DeviceRTL/CMakeLists.txt 4 + +++ b/libomptarget/DeviceRTL/CMakeLists.txt 5 + @@ -27,10 +27,10 @@ endif() 6 + if (LLVM_DIR) 7 + # Builds that use pre-installed LLVM have LLVM_DIR set. 8 + # A standalone or LLVM_ENABLE_RUNTIMES=openmp build takes this route 9 + - find_program(CLANG_TOOL clang PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH) 10 + + find_program(CLANG_TOOL clang PATHS ${LLVM_TOOLS_BINARY_DIR}) 11 + find_program(LINK_TOOL llvm-link PATHS ${LLVM_TOOLS_BINARY_DIR} 12 + - NO_DEFAULT_PATH) 13 + - find_program(OPT_TOOL opt PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH) 14 + + ) 15 + + find_program(OPT_TOOL opt PATHS ${LLVM_TOOLS_BINARY_DIR}) 16 + if ((NOT CLANG_TOOL) OR (NOT LINK_TOOL) OR (NOT OPT_TOOL)) 17 + libomptarget_say("Not building DeviceRTL. Missing clang: ${CLANG_TOOL}, llvm-link: ${LINK_TOOL} or opt: ${OPT_TOOL}") 18 + return()
+22
pkgs/development/compilers/llvm/15/openmp/gnu-install-dirs.patch
··· 1 + diff --git a/CMakeLists.txt b/CMakeLists.txt 2 + index b6ddbe90516d..311ab1d50e7f 100644 3 + --- a/CMakeLists.txt 4 + +++ b/CMakeLists.txt 5 + @@ -29,7 +29,7 @@ if (OPENMP_STANDALONE_BUILD) 6 + set(OPENMP_LIBDIR_SUFFIX "" CACHE STRING 7 + "Suffix of lib installation directory, e.g. 64 => lib64") 8 + # Do not use OPENMP_LIBDIR_SUFFIX directly, use OPENMP_INSTALL_LIBDIR. 9 + - set(OPENMP_INSTALL_LIBDIR "lib${OPENMP_LIBDIR_SUFFIX}") 10 + + set(OPENMP_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}${OPENMP_LIBDIR_SUFFIX}") 11 + 12 + # Group test settings. 13 + set(OPENMP_TEST_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING 14 + @@ -40,7 +40,7 @@ if (OPENMP_STANDALONE_BUILD) 15 + else() 16 + set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR}) 17 + # If building in tree, we honor the same install suffix LLVM uses. 18 + - set(OPENMP_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}") 19 + + set(OPENMP_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}") 20 + 21 + if (NOT MSVC) 22 + set(OPENMP_TEST_C_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang)
+12
pkgs/development/compilers/llvm/15/openmp/run-lit-directly.patch
··· 1 + diff --git a/cmake/OpenMPTesting.cmake b/cmake/OpenMPTesting.cmake 2 + --- a/cmake/OpenMPTesting.cmake 3 + +++ b/cmake/OpenMPTesting.cmake 4 + @@ -185,7 +185,7 @@ function(add_openmp_testsuite target comment) 5 + if (${OPENMP_STANDALONE_BUILD}) 6 + set(LIT_ARGS ${OPENMP_LIT_ARGS} ${ARG_ARGS}) 7 + add_custom_target(${target} 8 + - COMMAND ${PYTHON_EXECUTABLE} ${OPENMP_LLVM_LIT_EXECUTABLE} ${LIT_ARGS} ${ARG_UNPARSED_ARGUMENTS} 9 + + COMMAND ${OPENMP_LLVM_LIT_EXECUTABLE} ${LIT_ARGS} ${ARG_UNPARSED_ARGUMENTS} 10 + COMMENT ${comment} 11 + DEPENDS ${ARG_DEPENDS} 12 + USES_TERMINAL
+16
pkgs/top-level/all-packages.nix
··· 13983 13983 clang_12 = llvmPackages_12.clang; 13984 13984 clang_13 = llvmPackages_13.clang; 13985 13985 clang_14 = llvmPackages_14.clang; 13986 + clang_15 = llvmPackages_15.clang; 13986 13987 13987 13988 clang-tools = callPackage ../development/tools/clang-tools { 13988 13989 llvmPackages = llvmPackages_latest; ··· 14026 14027 14027 14028 clang-tools_14 = callPackage ../development/tools/clang-tools { 14028 14029 llvmPackages = llvmPackages_14; 14030 + }; 14031 + 14032 + clang-tools_15 = callPackage ../development/tools/clang-tools { 14033 + llvmPackages = llvmPackages_15; 14029 14034 }; 14030 14035 14031 14036 clang-analyzer = callPackage ../development/tools/analysis/clang-analyzer { ··· 15010 15015 lld_12 = llvmPackages_12.lld; 15011 15016 lld_13 = llvmPackages_13.lld; 15012 15017 lld_14 = llvmPackages_14.lld; 15018 + lld_15 = llvmPackages_15.lld; 15013 15019 15014 15020 lldb = llvmPackages_latest.lldb; 15015 15021 lldb_5 = llvmPackages_5.lldb; ··· 15022 15028 lldb_12 = llvmPackages_12.lldb; 15023 15029 lldb_13 = llvmPackages_13.lldb; 15024 15030 lldb_14 = llvmPackages_14.lldb; 15031 + lldb_15 = llvmPackages_15.lldb; 15025 15032 15026 15033 llvm = llvmPackages.llvm; 15027 15034 llvm_5 = llvmPackages_5.llvm; ··· 15034 15041 llvm_12 = llvmPackages_12.llvm; 15035 15042 llvm_13 = llvmPackages_13.llvm; 15036 15043 llvm_14 = llvmPackages_14.llvm; 15044 + llvm_15 = llvmPackages_15.llvm; 15037 15045 15038 15046 libllvm = llvmPackages.libllvm; 15039 15047 llvm-manpages = llvmPackages.llvm-manpages; ··· 15126 15134 buildLlvmTools = buildPackages.llvmPackages_14.tools; 15127 15135 targetLlvmLibraries = targetPackages.llvmPackages_14.libraries or llvmPackages_14.libraries; 15128 15136 targetLlvm = targetPackages.llvmPackages_14.llvm or llvmPackages_14.llvm; 15137 + })); 15138 + 15139 + llvmPackages_15 = recurseIntoAttrs (callPackage ../development/compilers/llvm/15 ({ 15140 + inherit (stdenvAdapters) overrideCC; 15141 + buildLlvmTools = buildPackages.llvmPackages_15.tools; 15142 + targetLlvmLibraries = targetPackages.llvmPackages_15.libraries or llvmPackages_15.libraries; 15143 + } // lib.optionalAttrs (stdenv.hostPlatform.isi686 && stdenv.hostPlatform == stdenv.buildPlatform && buildPackages.stdenv.cc.isGNU) { 15144 + stdenv = gcc7Stdenv; 15129 15145 })); 15130 15146 15131 15147 llvmPackages_latest = llvmPackages_14;