Skip to content

Commit

Permalink
linux: workaround ld wrapper issue
Browse files Browse the repository at this point in the history
The ld wrapper leads to the following linking error on x86_64, when
building pkgsLLVM.linux_latest:

x86_64-unknown-linux-gnu-ld: error: ../arch/x86/boot/setup.ld:15: unable to move location counter (0x204) backward to 0x1ef for section '.bstext'
  • Loading branch information
blitz committed Oct 9, 2024
1 parent 5d5b473 commit d150576
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkgs/os-specific/linux/kernel/manual-config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,12 @@ stdenv.mkDerivation ((drvAttrs config stdenv.hostPlatform.linux-kernel kernelPat
makeFlags = [
"O=$(buildRoot)"
"CC=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc"
"LD=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}ld"
"LD=${if stdenv.isx86_64 && stdenv.cc.bintools.isLLVM
then
# The wrapper for ld.lld breaks linking the kernel. We use the unwrapped linker as workaround. See:
# https://github.com/NixOS/nixpkgs/issues/321667
stdenv.cc.bintools.bintools
else stdenv.cc}/bin/${stdenv.cc.targetPrefix}ld"
"AR=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}ar"
"NM=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}nm"
"STRIP=${stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}strip"
Expand Down

0 comments on commit d150576

Please sign in to comment.