diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index 33df804d5efe..2f3b2d8e3788 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -343,18 +343,11 @@ stdenv.mkDerivation { # compile, because it uses "#include_next " 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 diff --git a/pkgs/development/compilers/dmd/generic.nix b/pkgs/development/compilers/dmd/generic.nix index c1fb9abf77d7..3f8871df4f96 100644 --- a/pkgs/development/compilers/dmd/generic.nix +++ b/pkgs/development/compilers/dmd/generic.nix @@ -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 diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix index 89526fbda7f4..2d47b090b1a8 100644 --- a/pkgs/development/libraries/mesa/default.nix +++ b/pkgs/development/libraries/mesa/default.nix @@ -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 = { diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix index 42d7021f3452..a36005872500 100644 --- a/pkgs/misc/uboot/default.nix +++ b/pkgs/misc/uboot/default.nix @@ -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 diff --git a/pkgs/tools/misc/ipxe/default.nix b/pkgs/tools/misc/ipxe/default.nix index 65c88eac4e88..c3a0c5aa906d 100644 --- a/pkgs/tools/misc/ipxe/default.nix +++ b/pkgs/tools/misc/ipxe/default.nix @@ -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" ]; diff --git a/pkgs/tools/misc/wimboot/default.nix b/pkgs/tools/misc/wimboot/default.nix index 71f31c720d02..bc43d77bbfba 100644 --- a/pkgs/tools/misc/wimboot/default.nix +++ b/pkgs/tools/misc/wimboot/default.nix @@ -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" ];