Skip to content

Commit b0a55eb

Browse files
committed
do not include already parsed, space-separated -I/-L/-Wl,* flags
Signed-off-by: Harmen Stoppels <me@harmenstoppels.nl>
1 parent 5334747 commit b0a55eb

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

cc.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -956,13 +956,16 @@ case "$mode" in
956956
eval "_frandom_seed_input=\${SPACK_${comp}_HAS_FRANDOM_SEED:-}"
957957
if [ -n "$_frandom_seed_input" ]; then
958958
_frandom_seed_input=""
959-
for arg in "$@"; do
959+
setsep other_args_list
960+
[ "$sep" != " " ] && IFS="$sep"
961+
for arg in $other_args_list; do
960962
case "$arg" in
961963
-frandom-seed=*) _frandom_seed_input=; break ;;
962964
-*|*.o|*.so|*.dylib|*.a) ;;
963965
*) _frandom_seed_input="${_frandom_seed_input}${arg}" ;;
964966
esac
965967
done
968+
unset IFS
966969
if [ -n "$_frandom_seed_input" ]; then
967970
append full_command_list "-frandom-seed=$_frandom_seed_input"
968971
fi

test/run.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1029,10 +1029,15 @@ test_frandom_seed_filters_args() {
10291029
wrapper_environment
10301030
SPACK_CC_HAS_FRANDOM_SEED=1; export SPACK_CC_HAS_FRANDOM_SEED
10311031

1032-
# cc mode: -frandom-seed should contain only source files, concatenated
1032+
# cc mode: -frandom-seed should contain only source files, concatenated.
1033+
# Includes space-separated path flags to verify their values do not leak.
10331034
_out=$(dump_args cc '-c
10341035
-O2
10351036
-I/some/include
1037+
-isystem
1038+
/some/sys
1039+
-L
1040+
/some/lib
10361041
hello.c
10371042
world.c
10381043
foo.o

0 commit comments

Comments
 (0)