Merge #225846: cc-wrapper: deunify clang/gcc handling of -B

...into staging
This commit is contained in:
Vladimír Čunát 2023-04-16 09:59:32 +02:00
commit f2186222c6
No known key found for this signature in database
GPG Key ID: E747DF1F9575A3AA
4 changed files with 3 additions and 11 deletions

View File

@ -51,7 +51,6 @@
# the derivation at which the `-B` and `-L` flags added by `useCcForLibs` will point
, gccForLibs ? if useCcForLibs then cc else null
, tmpDropB ? false # temporary hack; see PR #225846
}:
with lib;
@ -335,7 +334,7 @@ stdenv.mkDerivation {
##
## GCC libs for non-GCC support
##
+ optionalString (useGccForLibs && !tmpDropB) ''
+ optionalString (useGccForLibs && isClang) ''
echo "-B${gccForLibs}/lib/gcc/${targetPlatform.config}/${gccForLibs.version}" >> $out/nix-support/cc-cflags
''

View File

@ -1,5 +1,4 @@
{ lowPrio, newScope, pkgs, lib, stdenv, cmake
, stdenv-tmpDropB
, gccForLibs, preLibcCrossHeaders
, libxml2, python3, isl, fetchFromGitHub, overrideCC, wrapCCWith, wrapBintoolsWith
, buildLlvmTools # tools, but from the previous stage, for cross
@ -237,14 +236,14 @@ let
inherit llvm_meta;
stdenv = if stdenv.hostPlatform.useLLVM or false
then overrideCC stdenv buildLlvmTools.clangNoCompilerRtWithLibc
else stdenv-tmpDropB;
else stdenv;
};
compiler-rt-no-libc = callPackage ./compiler-rt {
inherit llvm_meta;
stdenv = if stdenv.hostPlatform.useLLVM or false
then overrideCC stdenv buildLlvmTools.clangNoCompilerRt
else stdenv-tmpDropB;
else stdenv;
};
# N.B. condition is safe because without useLLVM both are the same.

View File

@ -1,6 +1,5 @@
{ lib
, stdenv
, stdenv-tmpDropB
, callPackage
, overrideCC
, wrapCCWith
@ -79,8 +78,6 @@ let
# Runtimes
runtimes = callPackage ./llvm.nix {
stdenv = stdenv-tmpDropB;
buildDocs = false;
buildMan = false;
buildTests = false;

View File

@ -15563,9 +15563,6 @@ with pkgs;
llvmPackages_rocm = recurseIntoAttrs (callPackage ../development/compilers/llvm/rocm { });
# temporary hack; see PR #225846
stdenv-tmpDropB = overrideCC stdenv (wrapCCWith { tmpDropB = true; inherit (stdenv.cc) cc; });
lorri = callPackage ../tools/misc/lorri {
inherit (darwin.apple_sdk.frameworks) CoreServices Security;
};