From 96bbe339d47d4bc78cc9eaf0845734f80fe2d56b Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sun, 2 May 2021 14:00:37 -0400 Subject: [PATCH] Revert "cc-wrapper: -nostdlib does not imply -nostdinc++" This made C++ standard headers passed to be passed when C compiler is executed, which is not a correct fix. This reverts commit 54c7a0f42287f63c2db8086a8ad46ac981364378. --- pkgs/build-support/cc-wrapper/cc-wrapper.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/build-support/cc-wrapper/cc-wrapper.sh b/pkgs/build-support/cc-wrapper/cc-wrapper.sh index b402893100b0..d08fd24cd2d6 100644 --- a/pkgs/build-support/cc-wrapper/cc-wrapper.sh +++ b/pkgs/build-support/cc-wrapper/cc-wrapper.sh @@ -132,13 +132,12 @@ if [ "$NIX_ENFORCE_NO_NATIVE_@suffixSalt@" = 1 ]; then fi if [[ "$isCpp" = 1 ]]; then + if [[ "$cppInclude" = 1 ]]; then + NIX_CFLAGS_COMPILE_@suffixSalt@+=" $NIX_CXXSTDLIB_COMPILE_@suffixSalt@" + fi NIX_CFLAGS_LINK_@suffixSalt@+=" $NIX_CXXSTDLIB_LINK_@suffixSalt@" fi -if [[ "$cppInclude" = 1 ]]; then - NIX_CFLAGS_COMPILE_@suffixSalt@+=" $NIX_CXXSTDLIB_COMPILE_@suffixSalt@" -fi - source @out@/nix-support/add-hardening.sh # Add the flags for the C compiler proper.