Skip to content

Commit ac3acd9

Browse files
committed
cc-wrapper: add optional temporary hack for -B
This fixes parts in llvmPackages_{13,rocm} e.g. build .clang for testing. Longterm mass-rebuild fix should come in PR #225846
1 parent 4d4fee1 commit ac3acd9

4 files changed

Lines changed: 12 additions & 2 deletions

File tree

pkgs/build-support/cc-wrapper/default.nix

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252

5353
# the derivation at which the `-B` and `-L` flags added by `useCcForLibs` will point
5454
, gccForLibs ? if useCcForLibs then cc else null
55+
, tmpDropB ? false # temporary hack; see PR #225846
5556
}:
5657

5758
with lib;
@@ -335,9 +336,11 @@ stdenv.mkDerivation {
335336
##
336337
## GCC libs for non-GCC support
337338
##
338-
+ optionalString useGccForLibs ''
339+
+ optionalString (useGccForLibs && !tmpDropB) ''
339340
340341
echo "-B${gccForLibs}/lib/gcc/${targetPlatform.config}/${gccForLibs.version}" >> $out/nix-support/cc-cflags
342+
''
343+
+ optionalString useGccForLibs ''
341344
echo "-L${gccForLibs}/lib/gcc/${targetPlatform.config}/${gccForLibs.version}" >> $out/nix-support/cc-ldflags
342345
echo "-L${gccForLibs.lib}/${targetPlatform.config}/lib" >> $out/nix-support/cc-ldflags
343346
''

pkgs/development/compilers/llvm/13/default.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{ lowPrio, newScope, pkgs, lib, stdenv, cmake
2+
, stdenv-tmpDropB
23
, gccForLibs, preLibcCrossHeaders
34
, libxml2, python3, isl, fetchFromGitHub, overrideCC, wrapCCWith, wrapBintoolsWith
45
, buildLlvmTools # tools, but from the previous stage, for cross
@@ -243,7 +244,7 @@ let
243244
inherit llvm_meta;
244245
stdenv = if stdenv.hostPlatform.useLLVM or false
245246
then overrideCC stdenv buildLlvmTools.clangNoCompilerRt
246-
else stdenv;
247+
else stdenv-tmpDropB;
247248
};
248249

249250
# N.B. condition is safe because without useLLVM both are the same.

pkgs/development/compilers/llvm/rocm/default.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{ lib
22
, stdenv
3+
, stdenv-tmpDropB
34
, callPackage
45
, overrideCC
56
, wrapCCWith
@@ -78,6 +79,8 @@ let
7879

7980
# Runtimes
8081
runtimes = callPackage ./llvm.nix {
82+
stdenv = stdenv-tmpDropB;
83+
8184
buildDocs = false;
8285
buildMan = false;
8386
buildTests = false;

pkgs/top-level/all-packages.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15558,6 +15558,9 @@ with pkgs;
1555815558

1555915559
llvmPackages_rocm = recurseIntoAttrs (callPackage ../development/compilers/llvm/rocm { });
1556015560

15561+
# temporary hack; see PR #225846
15562+
stdenv-tmpDropB = overrideCC stdenv (wrapCCWith { tmpDropB = true; inherit (stdenv.cc) cc; });
15563+
1556115564
lorri = callPackage ../tools/misc/lorri {
1556215565
inherit (darwin.apple_sdk.frameworks) CoreServices Security;
1556315566
};

0 commit comments

Comments
 (0)