Skip to content
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
4 changes: 2 additions & 2 deletions pkgs/build-support/cc-wrapper/cc-wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ if [ "$NIX_ENFORCE_PURITY" = 1 -a -n "$NIX_STORE" ]; then
fi

if [[ "@prog@" = *++ ]]; then
if echo "$@" | grep -qvw -- -nostdlib; then
NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE $NIX_CXXSTDLIB_COMPILE"
if echo "$@" | grep -qv -- -nostdlib; then
NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE ${NIX_CXXSTDLIB_COMPILE-@default_cxx_stdlib_compile@}"
NIX_CFLAGS_LINK="$NIX_CFLAGS_LINK $NIX_CXXSTDLIB_LINK"
fi
fi
Expand Down
6 changes: 6 additions & 0 deletions pkgs/build-support/cc-wrapper/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,12 @@ stdenv.mkDerivation {

export real_cc=cc
export real_cxx=c++
export default_cxx_stdlib_compile="${
if stdenv.isLinux && !(cc.isGNU or false)
then "-isystem $(echo -n ${cc.gcc}/include/c++/*) -isystem $(echo -n ${cc.gcc}/include/c++/*)/$(${cc.gcc}/bin/gcc -dumpmachine)"
else ""
}"

if [ -e $ccPath/gcc ]; then
wrap gcc ${./cc-wrapper.sh} $ccPath/gcc
ln -s gcc $out/bin/cc
Expand Down