diff options
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/llvm/git')
7 files changed, 114 insertions, 276 deletions
diff --git a/nixpkgs/pkgs/development/compilers/llvm/git/compiler-rt/default.nix b/nixpkgs/pkgs/development/compilers/llvm/git/compiler-rt/default.nix index 7b44a872adc4..51f4e95ef2b5 100644 --- a/nixpkgs/pkgs/development/compilers/llvm/git/compiler-rt/default.nix +++ b/nixpkgs/pkgs/development/compilers/llvm/git/compiler-rt/default.nix @@ -1,6 +1,6 @@ { lib, stdenv, llvm_meta, version , monorepoSrc, runCommand -, cmake, ninja, python3, xcbuild, libllvm, linuxHeaders, libcxxabi, libxcrypt +, cmake, ninja, python3, xcbuild, libllvm, linuxHeaders, libxcrypt , doFakeLibgcc ? stdenv.hostPlatform.isFreeBSD }: @@ -31,8 +31,7 @@ stdenv.mkDerivation { nativeBuildInputs = [ cmake ninja python3 libllvm.dev ] ++ lib.optional stdenv.isDarwin xcbuild.xcrun; buildInputs = - lib.optional (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isRiscV) linuxHeaders - ++ lib.optional stdenv.hostPlatform.isDarwin libcxxabi; + lib.optional (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isRiscV) linuxHeaders; env.NIX_CFLAGS_COMPILE = toString ([ "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0" diff --git a/nixpkgs/pkgs/development/compilers/llvm/git/default.nix b/nixpkgs/pkgs/development/compilers/llvm/git/default.nix index 1efaa0402fc7..6ebb2ea9fcc2 100644 --- a/nixpkgs/pkgs/development/compilers/llvm/git/default.nix +++ b/nixpkgs/pkgs/development/compilers/llvm/git/default.nix @@ -1,5 +1,5 @@ -{ lowPrio, newScope, pkgs, lib, stdenv, stdenvNoCC, cmake, ninja -, gccForLibs, preLibcCrossHeaders +{ lowPrio, newScope, pkgs, lib, stdenv, cmake, ninja +, preLibcCrossHeaders , libxml2, python3, fetchFromGitHub, overrideCC, wrapCCWith, wrapBintoolsWith , buildLlvmTools # tools, but from the previous stage, for cross , targetLlvmLibraries # libraries, but from the next stage, for cross @@ -25,7 +25,7 @@ # rev-version = /* human readable version; i.e. "unstable-2022-26-07" */; # sha256 = /* checksum for this release, can omit if specifying your own `monorepoSrc` */; # } -, officialRelease ? { version = "18.1.0-rc3"; sha256 = "sha256-qRzY2kTLeRxXQCSuVP592Awafm5wjVeFY60d6082mSc="; } +, officialRelease ? { version = "18.1.0-rc4"; sha256 = "sha256-fVpwewbjoPMPslIEZ+WAtaQ+YKc0XWGl8EbP/TbQb8o="; } # i.e.: # { # version = /* i.e. "15.0.0" */; @@ -134,7 +134,6 @@ in let cc = tools.clang-unwrapped; libcxx = targetLlvmLibraries.libcxx; extraPackages = [ - libcxx.cxxabi targetLlvmLibraries.compiler-rt ]; extraBuildCommands = mkExtraBuildCommands cc; @@ -199,7 +198,6 @@ in let libcxx = targetLlvmLibraries.libcxx; bintools = bintools'; extraPackages = [ - libcxx.cxxabi targetLlvmLibraries.compiler-rt ] ++ lib.optionals (!stdenv.targetPlatform.isWasm) [ targetLlvmLibraries.libunwind @@ -274,6 +272,12 @@ in let nixSupport.cc-cflags = [ "-fno-exceptions" ]; }); + # Has to be in tools despite mostly being a library, + # because we use a native helper executable from a + # non-cross build in cross builds. + libclc = callPackage ../common/libclc.nix { + inherit buildLlvmTools; + }; }); libraries = lib.makeExtensible (libraries: let @@ -303,45 +307,7 @@ in let libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang; - libcxxabi = let - # CMake will "require" a compiler capable of compiling C++ programs - # cxx-header's build does not actually use one so it doesn't really matter - # what stdenv we use here, as long as CMake is happy. - cxx-headers = callPackage ./libcxx { - inherit llvm_meta; - # Note that if we use the regular stdenv here we'll get cycle errors - # when attempting to use this compiler in the stdenv. - # - # The final stdenv pulls `cxx-headers` from the package set where - # hostPlatform *is* the target platform which means that `stdenv` at - # that point attempts to use this toolchain. - # - # So, we use `stdenv_` (the stdenv containing `clang` from this package - # set, defined below) to sidestep this issue. - # - # Because we only use `cxx-headers` in `libcxxabi` (which depends on the - # clang stdenv _anyways_), this is okay. - stdenv = stdenv_; - headersOnly = true; - }; - - # `libcxxabi` *doesn't* need a compiler with a working C++ stdlib but it - # *does* need a relatively modern C++ compiler (see: - # https://releases.llvm.org/15.0.0/projects/libcxx/docs/index.html#platform-and-compiler-support). - # - # So, we use the clang from this LLVM package set, like libc++ - # "boostrapping builds" do: - # https://releases.llvm.org/15.0.0/projects/libcxx/docs/BuildingLibcxx.html#bootstrapping-build - # - # We cannot use `clangNoLibcxx` because that contains `compiler-rt` which, - # on macOS, depends on `libcxxabi`, thus forming a cycle. - stdenv_ = overrideCC stdenv buildLlvmTools.clangNoCompilerRtWithLibc; - in callPackage ./libcxxabi { - stdenv = stdenv_; - inherit llvm_meta cxx-headers; - }; - - # Like `libcxxabi` above, `libcxx` requires a fairly modern C++ compiler, + # `libcxx` requires a fairly modern C++ compiler, # so: we use the clang from this LLVM package set instead of the regular # stdenv's compiler. libcxx = callPackage ./libcxx { diff --git a/nixpkgs/pkgs/development/compilers/llvm/git/libcxx/0001-darwin-10.12-mbstate_t-fix.patch b/nixpkgs/pkgs/development/compilers/llvm/git/libcxx/0001-darwin-10.12-mbstate_t-fix.patch index 0a2e8db07391..29942f8ed03d 100644 --- a/nixpkgs/pkgs/development/compilers/llvm/git/libcxx/0001-darwin-10.12-mbstate_t-fix.patch +++ b/nixpkgs/pkgs/development/compilers/llvm/git/libcxx/0001-darwin-10.12-mbstate_t-fix.patch @@ -9,13 +9,13 @@ removes space from https://github.com/macports/macports-ports/raw/acd8acb171f1658596ed1cf25da48d5b932e2d19/lang/llvm-17/files/0042-mbstate_t-not-defined.patch so it applies cleanly --- - include/__mbstate_t.h | 3 +++ + libcxx/include/__mbstate_t.h | 3 +++ 1 file changed, 3 insertions(+) -diff --git a/include/__mbstate_t.h b/include/__mbstate_t.h +diff --git a/libcxx/include/__mbstate_t.h b/libcxx/include/__mbstate_t.h index bfa6d61..5f51112 100644 ---- a/include/__mbstate_t.h -+++ b/include/__mbstate_t.h +--- a/libcxx/include/__mbstate_t.h ++++ b/libcxx/include/__mbstate_t.h @@ -42,6 +42,9 @@ #elif __has_include(<bits/types/mbstate_t.h>) # include <bits/types/mbstate_t.h> // works on most Unixes diff --git a/nixpkgs/pkgs/development/compilers/llvm/git/libcxx/default.nix b/nixpkgs/pkgs/development/compilers/llvm/git/libcxx/default.nix index 11f4c6fe5fd1..4e3404dbe194 100644 --- a/nixpkgs/pkgs/development/compilers/llvm/git/libcxx/default.nix +++ b/nixpkgs/pkgs/development/compilers/llvm/git/libcxx/default.nix @@ -1,57 +1,108 @@ { lib, stdenv, llvm_meta , monorepoSrc, runCommand, fetchpatch -, cmake, ninja, python3, fixDarwinDylibNames, version -, cxxabi ? if stdenv.hostPlatform.isFreeBSD then libcxxrt else libcxxabi -, libcxxabi, libcxxrt, libunwind +, cmake, lndir, ninja, python3, fixDarwinDylibNames, version +, cxxabi ? if stdenv.hostPlatform.isFreeBSD then libcxxrt else null +, libcxxrt, libunwind , enableShared ? !stdenv.hostPlatform.isStatic - -# If headersOnly is true, the resulting package would only include the headers. -# Use this to break the circular dependency between libcxx and libcxxabi. -# -# Some context: -# https://reviews.llvm.org/rG1687f2bbe2e2aaa092f942d4a97d41fad43eedfb -, headersOnly ? false }: +# external cxxabi is not supported on Darwin as the build will not link libcxx +# properly and not re-export the cxxabi symbols into libcxx +# https://github.com/NixOS/nixpkgs/issues/166205 +# https://github.com/NixOS/nixpkgs/issues/269548 +assert cxxabi == null || !stdenv.hostPlatform.isDarwin; let basename = "libcxx"; -in + cxxabiName = "lib${if cxxabi == null then "cxxabi" else cxxabi.libName}"; + runtimes = [ "libcxx" ] ++ lib.optional (cxxabi == null) "libcxxabi"; + + # Note: useLLVM is likely false for Darwin but true under pkgsLLVM + useLLVM = stdenv.hostPlatform.useLLVM or false; + + cxxabiCMakeFlags = lib.optionals (useLLVM && !stdenv.hostPlatform.isWasm) [ + "-DLIBCXXABI_USE_COMPILER_RT=ON" + "-DLIBCXXABI_USE_LLVM_UNWINDER=ON" + ] ++ lib.optionals (lib.versionAtLeast version "18" && !(useLLVM && !stdenv.hostPlatform.isWasm)) [ + "-DLIBCXXABI_USE_LLVM_UNWINDER=OFF" + ] ++ lib.optionals stdenv.hostPlatform.isWasm [ + "-DLIBCXXABI_ENABLE_THREADS=OFF" + "-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF" + ] ++ lib.optionals (!enableShared) [ + "-DLIBCXXABI_ENABLE_SHARED=OFF" + ]; + + cxxCMakeFlags = [ + "-DLIBCXX_CXX_ABI=${cxxabiName}" + ] ++ lib.optionals (cxxabi != null) [ + "-DLIBCXX_CXX_ABI_INCLUDE_PATHS=${lib.getDev cxxabi}/include" + ] ++ lib.optionals (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) [ + "-DLIBCXX_HAS_MUSL_LIBC=1" + ] ++ lib.optionals (lib.versionAtLeast version "18" && !useLLVM && stdenv.hostPlatform.libc == "glibc" && !stdenv.hostPlatform.isStatic) [ + "-DLIBCXX_ADDITIONAL_LIBRARIES=gcc_s" + ] ++ lib.optionals useLLVM [ + "-DLIBCXX_USE_COMPILER_RT=ON" + # There's precedent for this in llvm-project/libcxx/cmake/caches. + # In a monorepo build you might do the following in the libcxxabi build: + # -DLLVM_ENABLE_PROJECTS=libcxxabi;libunwinder + # -DLIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY=On + # libcxx appears to require unwind and doesn't pull it in via other means. + "-DLIBCXX_ADDITIONAL_LIBRARIES=unwind" + ] ++ lib.optionals stdenv.hostPlatform.isWasm [ + "-DLIBCXX_ENABLE_THREADS=OFF" + "-DLIBCXX_ENABLE_FILESYSTEM=OFF" + "-DLIBCXX_ENABLE_EXCEPTIONS=OFF" + ] ++ lib.optionals (!enableShared) [ + "-DLIBCXX_ENABLE_SHARED=OFF" + ]; -assert stdenv.isDarwin -> cxxabi.libName == "c++abi"; + cmakeFlags = [ + "-DLLVM_ENABLE_RUNTIMES=${lib.concatStringsSep ";" runtimes}" + ] ++ lib.optionals stdenv.hostPlatform.isWasm [ + "-DCMAKE_C_COMPILER_WORKS=ON" + "-DCMAKE_CXX_COMPILER_WORKS=ON" + "-DUNIX=ON" # Required otherwise libc++ fails to detect the correct linker + ] ++ cxxCMakeFlags + ++ lib.optionals (cxxabi == null) cxxabiCMakeFlags; + +in stdenv.mkDerivation rec { - pname = basename + lib.optionalString headersOnly "-headers"; - inherit version; + pname = basename; + inherit version cmakeFlags; - src = runCommand "${pname}-src-${version}" {} '' - mkdir -p "$out" - cp -r ${monorepoSrc}/cmake "$out" - cp -r ${monorepoSrc}/${basename} "$out" - mkdir -p "$out/libcxxabi" - cp -r ${monorepoSrc}/libcxxabi/include "$out/libcxxabi" + src = runCommand "${pname}-src-${version}" {} ('' mkdir -p "$out/llvm" + cp -r ${monorepoSrc}/cmake "$out" + cp -r ${monorepoSrc}/libcxx "$out" cp -r ${monorepoSrc}/llvm/cmake "$out/llvm" cp -r ${monorepoSrc}/llvm/utils "$out/llvm" cp -r ${monorepoSrc}/third-party "$out" cp -r ${monorepoSrc}/runtimes "$out" - ''; - - sourceRoot = "${src.name}/runtimes"; + '' + lib.optionalString (cxxabi == null) '' + cp -r ${monorepoSrc}/libcxxabi "$out" + ''); - outputs = [ "out" ] ++ lib.optional (!headersOnly) "dev"; - - prePatch = '' - cd ../${basename} - chmod -R u+w . - ''; + outputs = [ "out" "dev" ]; patches = lib.optionals (stdenv.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinMinVersion "10.13") [ # https://github.com/llvm/llvm-project/issues/64226 ./0001-darwin-10.12-mbstate_t-fix.patch + ] ++ lib.optionals (cxxabi == null && lib.versionAtLeast version "18") [ + # Allow building libcxxabi alone when using LLVM unwinder + (fetchpatch { + url = "https://github.com/llvm/llvm-project/commit/77610dd10454e87bb387040d2b51100a17ac5755.patch"; + revert = true; + hash = "sha256-jFbC3vBY3nKfjknJ7UzaPyoy0iSYdD3+jUmOFeOaVcA="; + }) + (fetchpatch { + url = "https://github.com/llvm/llvm-project/commit/48e5b5ea92674ded69b998cf35724d9012c0f57d.patch"; + revert = true; + hash = "sha256-WN63L4T3GxVozPZb6kx21AgNe4rwwSUOeeryIGsvQYY="; + }) ]; postPatch = '' - cd ../runtimes + cd runtimes ''; preConfigure = lib.optionalString stdenv.hostPlatform.isMusl '' @@ -59,52 +110,22 @@ stdenv.mkDerivation rec { ''; nativeBuildInputs = [ cmake ninja python3 ] - ++ lib.optional stdenv.isDarwin fixDarwinDylibNames; - - buildInputs = - lib.optionals (!headersOnly) [ cxxabi ] - ++ lib.optionals (stdenv.hostPlatform.useLLVM or false && !stdenv.hostPlatform.isWasm) [ libunwind ]; - - cmakeFlags = let - # See: https://libcxx.llvm.org/BuildingLibcxx.html#cmdoption-arg-libcxx-cxx-abi-string - libcxx_cxx_abi_opt = { - "c++abi" = "system-libcxxabi"; - "cxxrt" = "libcxxrt"; - }.${cxxabi.libName} or (throw "unknown cxxabi: ${cxxabi.libName} (${cxxabi.pname})"); - in [ - "-DLLVM_ENABLE_RUNTIMES=libcxx" - "-DLIBCXX_CXX_ABI=${if headersOnly then "none" else libcxx_cxx_abi_opt}" - ] ++ lib.optional (!headersOnly && cxxabi.libName == "c++abi") "-DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi.dev}/include/c++/v1" - ++ lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) "-DLIBCXX_HAS_MUSL_LIBC=1" - ++ lib.optionals (lib.versionAtLeast version "18" && !(stdenv.hostPlatform.useLLVM or false) && stdenv.hostPlatform.libc == "glibc" && !stdenv.hostPlatform.isStatic) [ - "-DLIBCXX_ADDITIONAL_LIBRARIES=gcc_s" - ] ++ lib.optionals (stdenv.hostPlatform.useLLVM or false) [ - "-DLIBCXX_USE_COMPILER_RT=ON" - # There's precedent for this in llvm-project/libcxx/cmake/caches. - # In a monorepo build you might do the following in the libcxxabi build: - # -DLLVM_ENABLE_PROJECTS=libcxxabi;libunwinder - # -DLIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY=On - # libcxx appears to require unwind and doesn't pull it in via other means. - "-DLIBCXX_ADDITIONAL_LIBRARIES=unwind" - ] ++ lib.optionals stdenv.hostPlatform.isWasm [ - "-DLIBCXX_ENABLE_THREADS=OFF" - "-DLIBCXX_ENABLE_FILESYSTEM=OFF" - "-DLIBCXX_ENABLE_EXCEPTIONS=OFF" - "-DUNIX=ON" # Required otherwise libc++ fails to detect the correct linker - ] ++ lib.optional (!enableShared) "-DLIBCXX_ENABLE_SHARED=OFF" - # If we're only building the headers we don't actually *need* a functioning - # C/C++ compiler: - ++ lib.optionals (headersOnly) [ - "-DCMAKE_C_COMPILER_WORKS=ON" - "-DCMAKE_CXX_COMPILER_WORKS=ON" - ]; - - ninjaFlags = lib.optional headersOnly "generate-cxx-headers"; - installTargets = lib.optional headersOnly "install-cxx-headers"; + ++ lib.optional stdenv.isDarwin fixDarwinDylibNames + ++ lib.optional (cxxabi != null) lndir; + + buildInputs = [ cxxabi ] + ++ lib.optionals (useLLVM && !stdenv.hostPlatform.isWasm) [ libunwind ]; + + # libc++.so is a linker script which expands to multiple libraries, + # libc++.so.1 and libc++abi.so or the external cxxabi. ld-wrapper doesn't + # support linker scripts so the external cxxabi needs to be symlinked in + postInstall = lib.optionalString (cxxabi != null) '' + lndir ${lib.getDev cxxabi}/include ''${!outputDev}/include/c++/v1 + lndir ${lib.getLib cxxabi}/lib ''${!outputLib}/lib + ''; passthru = { isLLVM = true; - inherit cxxabi; }; meta = llvm_meta // { diff --git a/nixpkgs/pkgs/development/compilers/llvm/git/libcxxabi/default.nix b/nixpkgs/pkgs/development/compilers/llvm/git/libcxxabi/default.nix deleted file mode 100644 index 8e1979654325..000000000000 --- a/nixpkgs/pkgs/development/compilers/llvm/git/libcxxabi/default.nix +++ /dev/null @@ -1,130 +0,0 @@ -{ lib, stdenv, llvm_meta, cmake, ninja, python3 -, monorepoSrc, runCommand, fetchpatch -, cxx-headers, libunwind, version -, enableShared ? !stdenv.hostPlatform.isStatic -}: - -stdenv.mkDerivation rec { - pname = "libcxxabi"; - inherit version; - - src = runCommand "${pname}-src-${version}" {} '' - mkdir -p "$out" - cp -r ${monorepoSrc}/cmake "$out" - cp -r ${monorepoSrc}/${pname} "$out" - mkdir -p "$out/libcxx/src" - cp -r ${monorepoSrc}/libcxx/cmake "$out/libcxx" - cp -r ${monorepoSrc}/libcxx/include "$out/libcxx" - cp -r ${monorepoSrc}/libcxx/src/include "$out/libcxx/src" - mkdir -p "$out/llvm" - cp -r ${monorepoSrc}/llvm/cmake "$out/llvm" - cp -r ${monorepoSrc}/llvm/utils "$out/llvm" - cp -r ${monorepoSrc}/runtimes "$out" - ''; - - sourceRoot = "${src.name}/runtimes"; - - outputs = [ "out" "dev" ]; - - postUnpack = lib.optionalString stdenv.isDarwin '' - export TRIPLE=x86_64-apple-darwin - ''; - - prePatch = '' - cd ../${pname} - chmod -R u+w . - ''; - - patches = [ - ./gnu-install-dirs.patch - - # https://reviews.llvm.org/D132298, Allow building libcxxabi alone - (fetchpatch { - url = "https://github.com/llvm/llvm-project/commit/e6a0800532bb409f6d1c62f3698bdd6994a877dc.patch"; - sha256 = "1xyjd56m4pfwq8p3xh6i8lhkk9kq15jaml7qbhxdf87z4jjkk63a"; - stripLen = 1; - }) - ] ++ lib.optionals (lib.versionAtLeast version "18") [ - # Allow building libcxxabi alone when using LLVM unwinder - (fetchpatch { - url = "https://github.com/llvm/llvm-project/commit/77610dd10454e87bb387040d2b51100a17ac5755.patch"; - stripLen = 1; - revert = true; - hash = "sha256-Jogx/cvTJ6fdyprTD1QzMIeRWcBlZZMWE/y9joOtVH0="; - }) - (fetchpatch { - url = "https://github.com/llvm/llvm-project/commit/48e5b5ea92674ded69b998cf35724d9012c0f57d.patch"; - stripLen = 1; - revert = true; - hash = "sha256-7VeBFjG7CnEMWn0hpBvyNOyhRfz50PnD3zyQNDhNChk="; - }) - ]; - - postPatch = '' - cd ../runtimes - ''; - - nativeBuildInputs = [ cmake ninja python3 ]; - buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.hostPlatform.isWasm) libunwind; - - cmakeFlags = [ - "-DLLVM_ENABLE_RUNTIMES=libcxxabi" - "-DLIBCXXABI_LIBCXX_INCLUDES=${cxx-headers}/include/c++/v1" - - # `libcxxabi`'s build does not need a toolchain with a c++ stdlib attached - # (we specify the headers it should use explicitly above). - # - # CMake however checks for this anyways; this flag tells it not to. See: - # https://github.com/llvm/llvm-project/blob/4bd3f3759259548e159aeba5c76efb9a0864e6fa/llvm/runtimes/CMakeLists.txt#L243 - "-DCMAKE_CXX_COMPILER_WORKS=ON" - ] ++ lib.optionals (lib.versionAtLeast version "18" && !(stdenv.hostPlatform.useLLVM or false && !stdenv.hostPlatform.isWasm)) [ - "-DLIBCXXABI_USE_LLVM_UNWINDER=OFF" - ] ++ lib.optionals (stdenv.hostPlatform.useLLVM or false && !stdenv.hostPlatform.isWasm) [ - "-DLLVM_ENABLE_LIBCXX=ON" - "-DLIBCXXABI_USE_LLVM_UNWINDER=ON" - # libcxxabi's CMake looks as though it treats -nostdlib++ as implying -nostdlib, - # but that does not appear to be the case for example when building - # pkgsLLVM.libcxxabi (which uses clangNoCompilerRtWithLibc). - "-DCMAKE_EXE_LINKER_FLAGS=-nostdlib" - "-DCMAKE_SHARED_LINKER_FLAGS=-nostdlib" - ] ++ lib.optionals stdenv.hostPlatform.isWasm [ - "-DCMAKE_C_COMPILER_WORKS=ON" - "-DCMAKE_CXX_COMPILER_WORKS=ON" - "-DLIBCXXABI_ENABLE_THREADS=OFF" - "-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF" - "-DUNIX=ON" - ] ++ lib.optionals (!enableShared) [ - "-DLIBCXXABI_ENABLE_SHARED=OFF" - ]; - - preInstall = lib.optionalString stdenv.isDarwin '' - for file in lib/*.dylib; do - # this should be done in CMake, but having trouble figuring out - # the magic combination of necessary CMake variables - # if you fancy a try, take a look at - # https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling - install_name_tool -id $out/$file $file - done - ''; - - postInstall = '' - mkdir -p "$dev/include" - install -m 644 ../../${pname}/include/${if stdenv.isDarwin then "*" else "cxxabi.h"} "$dev/include" - ''; - - passthru = { - libName = "c++abi"; - }; - - meta = llvm_meta // { - homepage = "https://libcxxabi.llvm.org/"; - description = "Provides C++ standard library support"; - longDescription = '' - libc++abi is a new implementation of low level support for a standard C++ library. - ''; - # "All of the code in libc++abi is dual licensed under the MIT license and - # the UIUC License (a BSD-like license)": - license = with lib.licenses; [ mit ncsa ]; - maintainers = llvm_meta.maintainers ++ [ lib.maintainers.vlstill ]; - }; -} diff --git a/nixpkgs/pkgs/development/compilers/llvm/git/libcxxabi/gnu-install-dirs.patch b/nixpkgs/pkgs/development/compilers/llvm/git/libcxxabi/gnu-install-dirs.patch deleted file mode 100644 index 51382fcefed2..000000000000 --- a/nixpkgs/pkgs/development/compilers/llvm/git/libcxxabi/gnu-install-dirs.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt -index f380fe6b6b92..a9656258c38e 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -188,7 +188,7 @@ set(LIBCXXABI_INSTALL_RUNTIME_DIR "${CMAKE_INSTALL_BINDIR}" CACHE STRING - if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) - set(LIBCXXABI_HEADER_DIR ${LLVM_BINARY_DIR}) - set(LIBCXXABI_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}) -- set(LIBCXXABI_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE STRING -+ set(LIBCXXABI_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE PATH - "Path where built libc++abi libraries should be installed.") - if(LIBCXX_LIBDIR_SUBDIR) - string(APPEND LIBCXXABI_LIBRARY_DIR /${LIBCXXABI_LIBDIR_SUBDIR}) -@@ -202,7 +202,7 @@ else() - set(LIBCXXABI_HEADER_DIR ${CMAKE_BINARY_DIR}) - set(LIBCXXABI_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXXABI_LIBDIR_SUFFIX}) - endif() -- set(LIBCXXABI_INSTALL_LIBRARY_DIR lib${LIBCXXABI_LIBDIR_SUFFIX} CACHE STRING -+ set(LIBCXXABI_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBCXXABI_LIBDIR_SUFFIX} CACHE PATH - "Path where built libc++abi libraries should be installed.") - endif() - diff --git a/nixpkgs/pkgs/development/compilers/llvm/git/llvm/default.nix b/nixpkgs/pkgs/development/compilers/llvm/git/llvm/default.nix index 6dc2b51aaf9a..b8715228ab1c 100644 --- a/nixpkgs/pkgs/development/compilers/llvm/git/llvm/default.nix +++ b/nixpkgs/pkgs/development/compilers/llvm/git/llvm/default.nix @@ -223,6 +223,10 @@ stdenv.mkDerivation (rec { --replace "PassBuilderCallbacksTest.cpp" "" rm unittests/IR/PassBuilderCallbacksTest.cpp rm test/tools/llvm-objcopy/ELF/mirror-permissions-unix.test + + # Fails in the presence of anti-virus software or other intrusion-detection software that + # modifies the atime when run. See #284056. + rm test/tools/llvm-objcopy/ELF/strip-preserve-atime.test '' + optionalString stdenv.hostPlatform.isMusl '' patch -p1 -i ${../../common/llvm/TLI-musl.patch} substituteInPlace unittests/Support/CMakeLists.txt \ |