diff options
author | a-n-n-a-l-e-e <150648636+a-n-n-a-l-e-e@users.noreply.github.com> | 2024-03-11 03:53:37 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-11 03:53:37 -0700 |
commit | ce789e7e35e7cf72f5424f35d1b8b3ffcedd9226 (patch) | |
tree | 96f7a1f5689c5866d9250f142402c2b67ec38ed7 /pkgs/development/tools | |
parent | b2211920487890748920fcc83f9b769494bfa2d6 (diff) |
llvmPackages_{12,13,14,15,16,17,git}.{libcxx,libcxxabi}: merge libcxxabi into libcxx (#292043)
- merge libcxxabi into libcxx for LLVM 12, 13, 14, 15, 16, 17, and git. - remove the link time workaround `-lc++ -lc++abi` from 58 packages as it is no longer required. - fixes https://github.com/NixOS/nixpkgs/issues/166205 - provides alternative fixes for. https://github.com/NixOS/nixpkgs/issues/269548 https://github.com/NixOS/nix/issues/9640 - pkgsCross.x86_64-freebsd builds work again This change can be represented in 3 stages 1. merge libcxxabi into libcxx -- files: pkgs/development/compilers/llvm/[12, git]/{libcxx, libcxxabi} 2. update stdenv to account for merge -- files: stdenv.{adapters, cc.wrapper, darwin} 3. remove all references to libcxxabi outside of llvm (about 58 packages modified) ### merging libcxxabi into libcxx - take the union of the libcxxabi and libcxx cmake flags - eliminate the libcxx-headers-only package - it was only needed to break libcxx <-> libcxxabi circular dependency - libcxx.cxxabi is removed. external cxxabi (freebsd) will symlink headers / libs into libcxx. - darwin will re-export the libcxxabi symbols into libcxx so linking `-lc++` is sufficient. - linux/freebsd `libc++.so` is a linker script `LINK(libc++.so.1, -lc++abi)` making `-lc++` sufficient. - libcxx/default.nix [12, 17] are identical except for patches and `LIBCXX_ADDITIONAL_LIBRARIES` (only used in 16+) - git/libcxx/defaul.nix does not link with -nostdlib when useLLVM is true so flag is removed. this is not much different than before as libcxxabi used -nostdlib where libcxx did not, so libc was linked in anyway. ### stdenv changes - darwin bootstrap, remove references to libcxxabi and cxxabi - cc-wrapper: remove c++ link workaround when libcxx.cxxabi doesn't exist (still exists for LLVM pre 12) - adapter: update overrideLibcxx to account for a pkgs.stdenv that only has libcxx ### 58 package updates - remove `NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}` as no longer needed - swift, nodejs_v8 remove libcxxabi references in the clang override https://github.com/NixOS/nixpkgs/pull/292043
Diffstat (limited to 'pkgs/development/tools')
14 files changed, 5 insertions, 65 deletions
diff --git a/pkgs/development/tools/analysis/flow/default.nix b/pkgs/development/tools/analysis/flow/default.nix index dc7edb5c79bd1..a4ad13b3a51c8 100644 --- a/pkgs/development/tools/analysis/flow/default.nix +++ b/pkgs/development/tools/analysis/flow/default.nix @@ -17,11 +17,6 @@ stdenv.mkDerivation rec { makeFlags = [ "FLOW_RELEASE=1" ]; - # Work around https://github.com/NixOS/nixpkgs/issues/166205. - env = lib.optionalAttrs stdenv.cc.isClang { - NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}"; - }; - installPhase = '' install -Dm755 bin/flow $out/bin/flow install -Dm644 resources/shell/bash-completion $out/share/bash-completion/completions/flow diff --git a/pkgs/development/tools/bpf-linker/default.nix b/pkgs/development/tools/bpf-linker/default.nix index 8c5cb8863e3d3..49780a7772e43 100644 --- a/pkgs/development/tools/bpf-linker/default.nix +++ b/pkgs/development/tools/bpf-linker/default.nix @@ -31,11 +31,6 @@ rustPlatform.buildRustPackage rec { # rust-src and `-Z build-std=core` are required to properly run the tests doCheck = false; - # Work around https://github.com/NixOS/nixpkgs/issues/166205. - env = lib.optionalAttrs stdenv.cc.isClang { - NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}"; - }; - meta = with lib; { description = "Simple BPF static linker"; homepage = "https://github.com/aya-rs/bpf-linker"; diff --git a/pkgs/development/tools/build-managers/bazel/bazel_7/cpp-test.nix b/pkgs/development/tools/build-managers/bazel/bazel_7/cpp-test.nix index 15854d5242832..1761358c263e6 100644 --- a/pkgs/development/tools/build-managers/bazel/bazel_7/cpp-test.nix +++ b/pkgs/development/tools/build-managers/bazel/bazel_7/cpp-test.nix @@ -73,11 +73,6 @@ let '' + lib.optionalString (stdenv.isDarwin) '' --cxxopt=-x --cxxopt=c++ \ --host_cxxopt=-x --host_cxxopt=c++ \ - '' + lib.optionalString (stdenv.cc.isClang && stdenv ? cc.libcxx.cxxabi.libName) '' - --linkopt=-Wl,-l${stdenv.cc.libcxx.cxxabi.libName} \ - --linkopt=-L${stdenv.cc.libcxx.cxxabi}/lib \ - --host_linkopt=-Wl,-l${stdenv.cc.libcxx.cxxabi.libName} \ - --host_linkopt=-L${stdenv.cc.libcxx.cxxabi}/lib \ '' + lib.optionalString (stdenv.isDarwin && Foundation != null) '' --linkopt=-Wl,-F${Foundation}/Library/Frameworks \ --linkopt=-L${darwin.libobjc}/lib \ diff --git a/pkgs/development/tools/build-managers/bazel/bazel_7/default.nix b/pkgs/development/tools/build-managers/bazel/bazel_7/default.nix index b3b161db42f5a..92f4a52e028ac 100644 --- a/pkgs/development/tools/build-managers/bazel/bazel_7/default.nix +++ b/pkgs/development/tools/build-managers/bazel/bazel_7/default.nix @@ -258,8 +258,6 @@ stdenv.mkDerivation rec { postPatch = let - # Workaround for https://github.com/NixOS/nixpkgs/issues/166205 - nixpkgs166205ldflag = lib.optionalString stdenv.cc.isClang "-l${stdenv.cc.libcxx.cxxabi.libName}"; darwinPatches = '' bazelLinkFlags () { eval set -- "$NIX_LDFLAGS" @@ -274,7 +272,7 @@ stdenv.mkDerivation rec { # Framework search paths aren't added by bintools hook # https://github.com/NixOS/nixpkgs/pull/41914 - export NIX_LDFLAGS+=" -F${CoreFoundation}/Library/Frameworks -F${CoreServices}/Library/Frameworks -F${Foundation}/Library/Frameworks -F${IOKit}/Library/Frameworks ${nixpkgs166205ldflag}" + export NIX_LDFLAGS+=" -F${CoreFoundation}/Library/Frameworks -F${CoreServices}/Library/Frameworks -F${Foundation}/Library/Frameworks -F${IOKit}/Library/Frameworks" # libcxx includes aren't added by libcxx hook # https://github.com/NixOS/nixpkgs/pull/41589 diff --git a/pkgs/development/tools/build-managers/bazel/bazel_7/protobuf-test.nix b/pkgs/development/tools/build-managers/bazel/bazel_7/protobuf-test.nix index d50de32d4a3e8..6658c0d5b0ed5 100644 --- a/pkgs/development/tools/build-managers/bazel/bazel_7/protobuf-test.nix +++ b/pkgs/development/tools/build-managers/bazel/bazel_7/protobuf-test.nix @@ -157,11 +157,6 @@ let --javabase='@local_jdk//:jdk' \ '' + lib.optionalString (stdenv.isDarwin) '' --cxxopt=-x --cxxopt=c++ --host_cxxopt=-x --host_cxxopt=c++ \ - '' + lib.optionalString (stdenv.cc.isClang && stdenv ? cc.libcxx.cxxabi.libName) '' - --linkopt=-Wl,-l${stdenv.cc.libcxx.cxxabi.libName} \ - --linkopt=-L${stdenv.cc.libcxx.cxxabi}/lib \ - --host_linkopt=-Wl,-l${stdenv.cc.libcxx.cxxabi.libName} \ - --host_linkopt=-L${stdenv.cc.libcxx.cxxabi}/lib \ '' + '' ''; diff --git a/pkgs/development/tools/build-managers/sbt/scala-native.nix b/pkgs/development/tools/build-managers/sbt/scala-native.nix index caa9feebb5196..5dc5cf7eb3e05 100644 --- a/pkgs/development/tools/build-managers/sbt/scala-native.nix +++ b/pkgs/development/tools/build-managers/sbt/scala-native.nix @@ -7,8 +7,8 @@ sbt.overrideAttrs(previousAttrs: { wrapProgram $out/bin/sbt \ --set CLANG_PATH "${llvmPackages.clang}/bin/clang" \ --set CLANGPP_PATH "${llvmPackages.clang}/bin/clang" \ - --set CPATH "${lib.makeSearchPathOutput "dev" "include" [ re2 zlib boehmgc libunwind llvmPackages.libcxxabi llvmPackages.libcxx ]}/c++/v1" \ - --set LIBRARY_PATH "${lib.makeLibraryPath [ re2 zlib boehmgc libunwind llvmPackages.libcxxabi llvmPackages.libcxx ]}" \ - --set NIX_CFLAGS_LINK "-lc++abi -lc++" + --set CPATH "${lib.makeSearchPathOutput "dev" "include" [ re2 zlib boehmgc libunwind llvmPackages.libcxx ]}/c++/v1" \ + --set LIBRARY_PATH "${lib.makeLibraryPath [ re2 zlib boehmgc libunwind llvmPackages.libcxx ]}" \ + --set NIX_CFLAGS_LINK "-lc++" ''; }) diff --git a/pkgs/development/tools/cbfmt/default.nix b/pkgs/development/tools/cbfmt/default.nix index 17340d7a7a760..193847ae5f0e1 100644 --- a/pkgs/development/tools/cbfmt/default.nix +++ b/pkgs/development/tools/cbfmt/default.nix @@ -13,9 +13,6 @@ rustPlatform.buildRustPackage rec { cargoSha256 = "sha256-6oZCpjQ8t/QLFhEtF7td8KGI/kFE04pg7OELutsrJKo="; - # Work around https://github.com/NixOS/nixpkgs/issues/166205. - env = lib.optionalAttrs stdenv.cc.isClang { NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}"; }; - passthru.tests.version = testers.testVersion { package = cbfmt; }; diff --git a/pkgs/development/tools/dump_syms/default.nix b/pkgs/development/tools/dump_syms/default.nix index e9b92fd117d8a..9f6c95ee5265f 100644 --- a/pkgs/development/tools/dump_syms/default.nix +++ b/pkgs/development/tools/dump_syms/default.nix @@ -31,11 +31,6 @@ rustPlatform.buildRustPackage { cargoSha256 = "sha256-I5CfrLWVTUwOtZrje3eATFen5u9MEH79Rk30ZNhaG98="; - # Workaround for https://github.com/nixos/nixpkgs/issues/166205 - env = lib.optionalAttrs stdenv.cc.isClang { - NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}"; - }; - nativeBuildInputs = [ pkg-config ]; diff --git a/pkgs/development/tools/language-servers/beancount-language-server/default.nix b/pkgs/development/tools/language-servers/beancount-language-server/default.nix index 844bc89567d06..096ec26f690f4 100644 --- a/pkgs/development/tools/language-servers/beancount-language-server/default.nix +++ b/pkgs/development/tools/language-servers/beancount-language-server/default.nix @@ -17,11 +17,6 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-NMSNCURSO1iIWHH27FI5Y0q7+Ghds8VSxRGBOp+fH6A="; - # Workaround for https://github.com/NixOS/nixpkgs/issues/166205 - env = lib.optionalAttrs (stdenv.cc.libcxx != null) { - NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}"; - }; - doInstallCheck = true; postInstallCheck = '' $out/bin/beancount-language-server --help > /dev/null diff --git a/pkgs/development/tools/language-servers/lua-language-server/default.nix b/pkgs/development/tools/language-servers/lua-language-server/default.nix index e56d3240cafbe..7491968b1b5a9 100644 --- a/pkgs/development/tools/language-servers/lua-language-server/default.nix +++ b/pkgs/development/tools/language-servers/lua-language-server/default.nix @@ -43,11 +43,6 @@ stdenv.mkDerivation (finalAttrs: { -e '/cxx_/s,$cc,clang++,' ''; - # Work around https://github.com/NixOS/nixpkgs/issues/166205. - env = lib.optionalAttrs stdenv.cc.isClang { - NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}"; - }; - ninjaFlags = [ "-fcompile/ninja/${if stdenv.isDarwin then "macos" else "linux"}.ninja" ]; diff --git a/pkgs/development/tools/misc/topiary/default.nix b/pkgs/development/tools/misc/topiary/default.nix index cb4f3884d79fd..610deb178c104 100644 --- a/pkgs/development/tools/misc/topiary/default.nix +++ b/pkgs/development/tools/misc/topiary/default.nix @@ -35,12 +35,7 @@ rustPlatform.buildRustPackage rec { cargoBuildFlags = [ "-p" "topiary-cli" ]; cargoTestFlags = cargoBuildFlags; - env = { - TOPIARY_LANGUAGE_DIR = "${placeholder "out"}/share/queries"; - } // lib.optionalAttrs stdenv.cc.isClang { - # Work around https://github.com/NixOS/nixpkgs/issues/166205. - NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}"; - }; + env.TOPIARY_LANGUAGE_DIR = "${placeholder "out"}/share/queries"; postInstall = '' install -Dm444 queries/* -t $out/share/queries diff --git a/pkgs/development/tools/ocaml/opam/default.nix b/pkgs/development/tools/ocaml/opam/default.nix index 4f85fc52343a6..a60b12667fa7b 100644 --- a/pkgs/development/tools/ocaml/opam/default.nix +++ b/pkgs/development/tools/ocaml/opam/default.nix @@ -122,11 +122,6 @@ in stdenv.mkDerivation { outputs = [ "out" "installer" ]; setOutputFlags = false; - # Work around https://github.com/NixOS/nixpkgs/issues/166205. - env = lib.optionalAttrs stdenv.cc.isClang { - NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}"; - }; - # change argv0 to "opam" as a workaround for # https://github.com/ocaml/opam/issues/2142 postInstall = '' diff --git a/pkgs/development/tools/ocaml/opam/opam.nix.pl b/pkgs/development/tools/ocaml/opam/opam.nix.pl index 77c574cb93218..412a1a30e70d1 100755 --- a/pkgs/development/tools/ocaml/opam/opam.nix.pl +++ b/pkgs/development/tools/ocaml/opam/opam.nix.pl @@ -112,11 +112,6 @@ print <<'EOF'; outputs = [ "out" "installer" ]; setOutputFlags = false; - # Work around https://github.com/NixOS/nixpkgs/issues/166205. - env = lib.optionalAttrs stdenv.cc.isClang { - NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}"; - }; - # change argv0 to "opam" as a workaround for # https://github.com/ocaml/opam/issues/2142 postInstall = '' diff --git a/pkgs/development/tools/rust-code-analysis/default.nix b/pkgs/development/tools/rust-code-analysis/default.nix index eaf87a1908f9d..d558752d04e5f 100644 --- a/pkgs/development/tools/rust-code-analysis/default.nix +++ b/pkgs/development/tools/rust-code-analysis/default.nix @@ -12,11 +12,6 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-axrtFZQOm1/UUBq1CDFkaZCks1mWoLWmfajDfsqSBmY="; - # Work around https://github.com/NixOS/nixpkgs/issues/166205. - env = lib.optionalAttrs stdenv.cc.isClang { - NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}"; - }; - meta = with lib; { description = "Analyze and collect metrics on source code"; homepage = "https://github.com/mozilla/rust-code-analysis"; |