Skip to content

Commit

Permalink
Merge pull request #213185 from trofi/revert-sysroot-hack
Browse files Browse the repository at this point in the history
build-support/cc-wrapper: revert "pass in non-existent --sysroot= to …
  • Loading branch information
trofi authored Jan 29, 2023
2 parents e043f89 + 3f9fe5c commit f54fac6
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 47 deletions.
7 changes: 0 additions & 7 deletions pkgs/build-support/cc-wrapper/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -343,18 +343,11 @@ stdenv.mkDerivation {
# compile, because it uses "#include_next <limits.h>" to find the
# limits.h file in ../includes-fixed. To remedy the problem,
# another -idirafter is necessary to add that directory again.
#
# We use --sysroot=/nix/store/does/not/exist to drop embedded default
# path to glibc headers gcc was built against. Without it -idirafter
# only appends to the list and outdated glibc headers end up being
# used. 'cc-cflags-before' is used to allow user's --sysroot= option
# to override our default.
+ optionalString (libc != null) (''
touch "$out/nix-support/libc-cflags"
touch "$out/nix-support/libc-ldflags"
echo "-B${libc_lib}${libc.libdir or "/lib/"}" >> $out/nix-support/libc-crt1-cflags
'' + optionalString (!(cc.langD or false)) ''
echo "--sysroot=/nix/store/does/not/exist" >> $out/nix-support/cc-cflags-before
echo "-idirafter ${libc_dev}${libc.incdir or "/include"}" >> $out/nix-support/libc-cflags
'' + optionalString (isGNU && (!(cc.langD or false))) ''
for dir in "${cc}"/lib/gcc/*/*/include-fixed; do
Expand Down
7 changes: 0 additions & 7 deletions pkgs/development/compilers/dmd/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,6 @@ stdenv.mkDerivation rec {
git
];

# Workaround cc-wrapper's --sysroot= value for `staging-next`: it
# breaks library lookup via RUNPATH:
# ld: warning: libm.so.6, needed by ./generated/linux/release/64/lib.so, not found (try using -rpath or -rpath-link)
# ld: /build/druntime/generated/linux/release/64/libdruntime.so: undefined reference to `log10@GLIBC_2.2.5'
# TODO(trofi): remove the workaround once cc-wrapper is fixed.
NIX_CFLAGS_COMPILE = [ "--sysroot=/" ];

buildInputs = [
curl
tzdata
Expand Down
4 changes: 0 additions & 4 deletions pkgs/development/libraries/mesa/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,6 @@ self = stdenv.mkDerivation {
NIX_CFLAGS_COMPILE = lib.optionals stdenv.isDarwin [ "-fno-common" ] ++ lib.optionals enableOpenCL [
"-UPIPE_SEARCH_DIR"
"-DPIPE_SEARCH_DIR=\"${placeholder "opencl"}/lib/gallium-pipe\""

# Work around regression from https://github.com/NixOS/nixpkgs/pull/210004
# TODO(trofi): remove
"--sysroot=/"
];

passthru = {
Expand Down
10 changes: 0 additions & 10 deletions pkgs/misc/uboot/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,6 @@ let

passAsFile = [ "extraConfig" ];

# Workaround '-idirafter' ordering bug in staging-next:
# https://github.com/NixOS/nixpkgs/pull/210004
# where libc '-idirafter' gets added after user's idirafter and
# breaks.
# TODO(trofi): remove it in staging once fixed in cc-wrapper.
preConfigure = ''
export NIX_CFLAGS_COMPILE_BEFORE_${lib.replaceStrings ["-" "."] ["_" "_"] buildPackages.stdenv.hostPlatform.config}=$(< ${buildPackages.stdenv.cc}/nix-support/libc-cflags)
export NIX_CFLAGS_COMPILE_BEFORE_${lib.replaceStrings ["-" "."] ["_" "_"] stdenv.hostPlatform.config}=$(< ${stdenv.cc}/nix-support/libc-cflags)
'';

configurePhase = ''
runHook preConfigure
Expand Down
10 changes: 0 additions & 10 deletions pkgs/tools/misc/ipxe/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,6 @@ stdenv.mkDerivation rec {
substituteInPlace src/util/genfsimg --replace " syslinux " " true "
''; # calling syslinux on a FAT image isn't going to work

# Workaround '-idirafter' ordering bug in staging-next:
# https://github.com/NixOS/nixpkgs/pull/210004
# where libc '-idirafter' gets added after user's idirafter and
# breaks.
# TODO(trofi): remove it in staging once fixed in cc-wrapper.
preConfigure = ''
export NIX_CFLAGS_COMPILE_BEFORE_${lib.replaceStrings ["-" "."] ["_" "_"] buildPackages.stdenv.hostPlatform.config}=$(< ${buildPackages.stdenv.cc}/nix-support/libc-cflags)
export NIX_CFLAGS_COMPILE_BEFORE_${lib.replaceStrings ["-" "."] ["_" "_"] stdenv.hostPlatform.config}=$(< ${stdenv.cc}/nix-support/libc-cflags)
'';

# not possible due to assembler code
hardeningDisable = [ "pic" "stackprotector" ];

Expand Down
9 changes: 0 additions & 9 deletions pkgs/tools/misc/wimboot/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,6 @@ stdenv.mkDerivation rec {

sourceRoot = "source/src";

# Workaround '-idirafter' ordering bug in staging-next:
# https://github.com/NixOS/nixpkgs/pull/210004
# where libc '-idirafter' gets added after user's idirafter and
# breaks.
# TODO(trofi): remove it in staging once fixed in cc-wrapper.
preConfigure = ''
export NIX_CFLAGS_COMPILE_BEFORE_${lib.replaceStrings ["-" "."] ["_" "_"] stdenv.hostPlatform.config}=$(< ${stdenv.cc}/nix-support/libc-cflags)
'';

buildInputs = [ libbfd zlib libiberty ];
makeFlags = [ "wimboot.x86_64.efi" ];

Expand Down

0 comments on commit f54fac6

Please sign in to comment.