diff options
author | Someone Serge <sergei.kozlukov@aalto.fi> | 2024-01-10 23:23:05 +0000 |
---|---|---|
committer | Someone Serge <sergei.kozlukov@aalto.fi> | 2024-01-12 17:38:00 +0000 |
commit | 8eda4c36a50dab64377fe3d73a0e8dadb3eaac0e (patch) | |
tree | 316457c4ebcf0e9f33f23848e75f0574ab0de9ed /pkgs/build-support | |
parent | 210ce3840807a87b7e407fed6ce8ec04e6e318bc (diff) | |
download | nixlib-8eda4c36a50dab64377fe3d73a0e8dadb3eaac0e.tar nixlib-8eda4c36a50dab64377fe3d73a0e8dadb3eaac0e.tar.gz nixlib-8eda4c36a50dab64377fe3d73a0e8dadb3eaac0e.tar.bz2 nixlib-8eda4c36a50dab64377fe3d73a0e8dadb3eaac0e.tar.lz nixlib-8eda4c36a50dab64377fe3d73a0e8dadb3eaac0e.tar.xz nixlib-8eda4c36a50dab64377fe3d73a0e8dadb3eaac0e.tar.zst nixlib-8eda4c36a50dab64377fe3d73a0e8dadb3eaac0e.zip |
cc-wrapper: cxxStdlib: expose solib and package separately
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/cc-wrapper/default.nix | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index e07d46564654..0b25d70b14a2 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -110,6 +110,9 @@ let gccForLibs_solib = getLib gccForLibs + optionalString (targetPlatform != hostPlatform) "/${targetPlatform.config}"; + # Analogously to cc_solib and gccForLibs_solib + libcxx_solib = "${lib.getLib libcxx}/lib"; + # The following two functions, `isGccArchSupported` and # `isGccTuneSupported`, only handle those situations where a flag # (`-march` or `-mtune`) is accepted by one compiler but rejected @@ -270,14 +273,14 @@ stdenv.mkDerivation { givenGccForLibs = useGccForLibs && gccForLibs.langCC or false; in if (!givenLibcxx) && givenGccForLibs then - { kind = "libstdc++"; lib = gccForLibs; } + { kind = "libstdc++"; package = gccForLibs; solib = gccForLibs_solib; } else if givenLibcxx then - { kind = "libc++"; lib = libcxx; } + { kind = "libc++"; package = libcxx; solib = libcxx_solib;} else # We're probably using the `libstdc++` that came with our `gcc`. # TODO: this is maybe not always correct? # TODO: what happens when `nativeTools = true`? - { kind = "libstdc++"; lib = cc_solib; } + { kind = "libstdc++"; package = cc; solib = cc_solib; } ; emacsBufferSetup = pkgs: '' @@ -590,7 +593,7 @@ stdenv.mkDerivation { echo "$ccLDFlags" >> $out/nix-support/cc-ldflags echo "$ccCFlags" >> $out/nix-support/cc-cflags '' + optionalString (targetPlatform.isDarwin && (libcxx != null) && (cc.isClang or false)) '' - echo " -L${lib.getLib libcxx}/lib" >> $out/nix-support/cc-ldflags + echo " -L${libcxx_solib}" >> $out/nix-support/cc-ldflags '' ## |