Fix -Xaarch64 in cosmocc

It's now possible to pass flags like -Xaarch64-march=armv8.2-a+dotprod
so that cosmocc will use newer ARM ISAs. For AMD64 there's another one
worth mentioning, which looks like this: -Xx86_64-mssse3
This commit is contained in:
Justine Tunney 2024-01-04 07:16:36 -08:00
parent 3864f78b88
commit 873069fcd7
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
3 changed files with 93 additions and 1 deletions

View file

@ -134,6 +134,13 @@ kinds of codebases using `cosmocc` which is just a convenient wrapper
around the cross compilers, which would be a better choice to use in
this type of circumstance.
## Usage
By default, all the code you compile will use the baseline of the X86_64
and AARCH64, which is K8 and ARMv8.0. You can pass architecture specific
flags to use newer ISAs by using the `-Xx86_64` and `-Xaarch64` prefixes
like `-Xx86_64-mssse3` and `-Xaarch64-march=armv8.2-a+dotprod`.
## Troubleshooting
Your `cosmocc` compiler runs a number commands under the hood. If

View file

@ -185,7 +185,7 @@ for x; do
continue
elif [ x"$x" != x"${x#-Xaarch64}" ]; then
x=${x#-Xaarch64}
FLAGS_aarch64="$FLAGS_aarch64 $x"
FLAGS_AARCH64="$FLAGS_AARCH64 $x"
continue
elif [ x"$x" = x"-dumpversion" ]; then
echo $GCC_VERSION