Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from Apr 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions pkgs/build-support/cc-wrapper/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
''
Expand Down
5 changes: 2 additions & 3 deletions pkgs/development/compilers/llvm/13/default.nix
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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.
Expand Down
3 changes: 0 additions & 3 deletions pkgs/development/compilers/llvm/rocm/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{ lib
, stdenv
, stdenv-tmpDropB
, callPackage
, overrideCC
, wrapCCWith
Expand Down Expand Up @@ -79,8 +78,6 @@ let

# Runtimes
runtimes = callPackage ./llvm.nix {
stdenv = stdenv-tmpDropB;

buildDocs = false;
buildMan = false;
buildTests = false;
Expand Down
3 changes: 0 additions & 3 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15545,9 +15545,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;
};
Expand Down