summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorStelios Tsampas2024-01-25 22:38:13 +0200
committerStelios Tsampas2024-01-25 22:38:13 +0200
commita22765e8e322aa75648a5c8699f1f2b408a69486 (patch)
treefa76e4c90440208165d3bbf38f4dc784adc1e6bf /PKGBUILD
parent3854b705ba930b0e8ffb5a97ce081f0be3ff7946 (diff)
downloadaur-a22765e8e322aa75648a5c8699f1f2b408a69486.tar.gz
[dxvk,dxvk-nvapi,vkd3d-proton,d8vk] Infer march and mtune
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD15
1 files changed, 11 insertions, 4 deletions
diff --git a/PKGBUILD b/PKGBUILD
index ca159e41c2e0..71d57d917f7e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -33,8 +33,15 @@ prepare() {
# This overrides FLAGS from makepkg.conf, if you comment these you are on your own
# If you want the "best" possible optimizations for your system you can use
# `-march=native` and remove the `-mtune=core-avx2` option.
- export CFLAGS="-O2 -march=nocona -mtune=core-avx2 -pipe"
- export CXXFLAGS="-O2 -march=nocona -mtune=core-avx2 -pipe"
+
+ local -a split=($CFLAGS)
+ local -A flags
+ for opt in "${split[@]}"; do flags["${opt%%=*}"]="${opt##*=}"; done
+ local march="${flags["-march"]:-nocona}"
+ local mtune="${flags["-mtune"]:-core-avx2}"
+
+ export CFLAGS="-O2 -march="$march" -mtune="$mtune" -pipe"
+ export CXXFLAGS="-O2 -march="$march" -mtune="$mtune" -pipe"
export LDFLAGS="-Wl,-O1,--sort-common,--as-needed"
# These flags are taken from Proton
@@ -42,8 +49,8 @@ prepare() {
CXXFLAGS+=" -mfpmath=sse -fwrapv -fno-strict-aliasing -std=c++17"
LDFLAGS+=" -Wl,--file-alignment,4096"
- # If using -march=native and the CPU supports AVX, launching a d3d9
- # game can cause an Unhandled exception. The cause seems to be the
+ # If using -march= with a CPU that supports supports AVX, launching a 32bit
+ # d3d9 game can cause an Unhandled exception. The cause seems to be the
# combination of AVX instructions and tree vectorization (implied by O3),
# all tested archictures from sandybridge to haswell are affected.
# Disabling AVX (and AVX2 as a side-effect).