Skip to content

Commit 07500a6

Browse files
committed
disallow -pie + -shared in the same invocation
this is the big one. we have a wrapper-based workaround, spread across numerous files. -pie is for executables, and -shared is for libraries, so you can see why this breaks.
1 parent bd66288 commit 07500a6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

share/toolchain/shim

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,17 @@ if [ "$(uname)" != Darwin ]; then
2020
set -a
2121
eval "$("$pkgx" +llvm.org)"
2222

23+
if printf "%s\n" "$@" | grep -qxF -- '-shared'; then
24+
has_shared=1
25+
fi
26+
2327
filtered_args=()
2428
for arg in "$@"; do
29+
# -shared and -pie conflict. libs aren't executables, so accept the -shared
30+
if [ "$arg" = "-pie" ] && [ "$has_shared" = "1" ]; then
31+
continue
32+
fi
33+
2534
if [ "$arg" != -Werror ]; then
2635
filtered_args+=("$arg")
2736
fi

0 commit comments

Comments
 (0)