cc-wrapper: add (partial) support for clang -cc1
We need this for intel-compute-runtime, see #63705
This commit is contained in:
parent
8d1510abfb
commit
0b7494ed2b
@ -33,6 +33,7 @@ fi
|
|||||||
# GCC prints annoying warnings when they are not needed.
|
# GCC prints annoying warnings when they are not needed.
|
||||||
dontLink=0
|
dontLink=0
|
||||||
nonFlagArgs=0
|
nonFlagArgs=0
|
||||||
|
cc1=0
|
||||||
# shellcheck disable=SC2193
|
# shellcheck disable=SC2193
|
||||||
[[ "@prog@" = *++ ]] && isCpp=1 || isCpp=0
|
[[ "@prog@" = *++ ]] && isCpp=1 || isCpp=0
|
||||||
cppInclude=1
|
cppInclude=1
|
||||||
@ -68,6 +69,8 @@ while (( "$n" < "$nParams" )); do
|
|||||||
elif [[ "$p" != -?* ]]; then
|
elif [[ "$p" != -?* ]]; then
|
||||||
# A dash alone signifies standard input; it is not a flag
|
# A dash alone signifies standard input; it is not a flag
|
||||||
nonFlagArgs=1
|
nonFlagArgs=1
|
||||||
|
elif [ "$p" = -cc1 ]; then
|
||||||
|
cc1=1
|
||||||
fi
|
fi
|
||||||
n+=1
|
n+=1
|
||||||
done
|
done
|
||||||
@ -167,6 +170,14 @@ if [ "$*" = -v ]; then
|
|||||||
extraBefore=()
|
extraBefore=()
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# clang's -cc1 mode is not compatible with most options
|
||||||
|
# that we would pass. Rather than trying to pass only
|
||||||
|
# options that would work, let's just remove all of them.
|
||||||
|
if [ "$cc1" = 1 ]; then
|
||||||
|
extraAfter=()
|
||||||
|
extraBefore=()
|
||||||
|
fi
|
||||||
|
|
||||||
# Optionally print debug info.
|
# Optionally print debug info.
|
||||||
if (( "${NIX_DEBUG:-0}" >= 1 )); then
|
if (( "${NIX_DEBUG:-0}" >= 1 )); then
|
||||||
# Old bash workaround, see ld-wrapper for explanation.
|
# Old bash workaround, see ld-wrapper for explanation.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user