cc-wrapper: -nostdlib does not imply -nostdinc++
The check for including the C++ standard library headers was nested inside the check for linking with the C++ standard library. As a result, the `-nostdlib` flag incorrectly implied `-nostdinc++`, which made it virtually impossible to partially link C++ objects.
This commit is contained in:
parent
ad6e13fcfb
commit
54c7a0f422
|
@ -132,12 +132,13 @@ 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.
|
||||
|
|
Loading…
Reference in New Issue