Make cosmocc -Wl,--version do the right thing

Our `cosmocc` wrapper script will now report the linker version, the
same way as the `cc` command. The `fatcosmocc` command won't do this
because we wouldn't want programs to parse out the path of the amd64
linker command and use it explicitly.

Fixes #917
This commit is contained in:
Justine Tunney 2023-10-31 18:20:28 -07:00
parent f86ffa1a25
commit a699cda5c8
No known key found for this signature in database
GPG key ID: BE714B4575D6E328

View file

@ -227,8 +227,7 @@ for x; do
continue
fi
if [ x"$x" = x"-" ] || # is an argument
[ x"$x" = x"${x#-*}" ] || # !startswith(x, "-")
[ x"$x" = x"-Wl,--version" ]; then
[ x"$x" = x"${x#-*}" ]; then # !startswith(x, "-")
GOT_SOME=1
elif [ x"$x" = x"-static-libstdc++" ]; then
continue
@ -294,6 +293,8 @@ for x; do
elif [ x"$x" = x"-dumpversion" ]; then
echo $GCC_VERSION
exit 0
elif [ x"$x" = x"-Wl,--version" ]; then
GOT_SOME=1
fi
set -- "$@" "$x"
done