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

build-support/cc-wrapper: revert "pass in non-existent --sysroot= to … #213185

Merged
merged 6 commits into from
Jan 29, 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
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