summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorStelios Tsampas2021-11-28 01:45:43 +0200
committerStelios Tsampas2021-11-28 01:45:43 +0200
commit23215595f080843371215a2ef7653b019aa96af9 (patch)
tree9fd9dc29fb4e044ed63f64d921acabd1b092d4be
parentf3daea86a4edb1d406e3ce8b6d637ce0972fa111 (diff)
downloadaur-23215595f080843371215a2ef7653b019aa96af9.tar.gz
cleanup: split c and cpp flags
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD81
-rw-r--r--vkd3d-proton-extraopts.patch4
3 files changed, 52 insertions, 39 deletions
diff --git a/.SRCINFO b/.SRCINFO
index e27ff7324490..e69c205bacd0 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = vkd3d-proton-mingw-git
pkgdesc = Fork of VKD3D. Development branches for Protons Direct3D 12 implementation
- pkgver = 2.4.r106.gcf4fb446
+ pkgver = 2.5.r81.g9c354936
pkgrel = 1
url = https://github.com/HansKristian-Work/vkd3d-proton
arch = x86_64
@@ -17,7 +17,7 @@ pkgbase = vkd3d-proton-mingw-git
depends = bash
provides = vkd3d-proton
provides = d3d12.dll
- provides = vkd3d-proton=2.4.r106.gcf4fb446
+ provides = vkd3d-proton=2.5.r81.g9c354936
conflicts = vkd3d-proton
conflicts = d3d12.dll
options = !lto
@@ -33,6 +33,6 @@ pkgbase = vkd3d-proton-mingw-git
sha256sums = SKIP
sha256sums = SKIP
sha256sums = 459d0de87abd6ea44ac71b4d7a005b6cfc9b2a75613ecda161223e95a22414d8
- sha256sums = 45463ed77fa97220da907d8db4e808ad0cfda744fb1bcdfc82898d9b3843c558
+ sha256sums = 8fc019d1dca8c52b6af96c40ff06a6c215aad3e713ae17be72c7422f1ba45634
pkgname = vkd3d-proton-mingw-git
diff --git a/PKGBUILD b/PKGBUILD
index 3f55155459ca..1b452987cfa9 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: loathingkernel <loathingkernel @at gmail .dot com>
pkgname=vkd3d-proton-mingw-git
-pkgver=2.4.r106.gcf4fb446
+pkgver=2.5.r81.g9c354936
pkgrel=1
pkgdesc='Fork of VKD3D. Development branches for Protons Direct3D 12 implementation'
arch=('x86_64')
@@ -20,12 +20,6 @@ source=(
"setup_vkd3d_proton"
"vkd3d-proton-extraopts.patch"
)
-sha256sums=('SKIP'
- 'SKIP'
- 'SKIP'
- 'SKIP'
- '459d0de87abd6ea44ac71b4d7a005b6cfc9b2a75613ecda161223e95a22414d8'
- '45463ed77fa97220da907d8db4e808ad0cfda744fb1bcdfc82898d9b3843c558')
pkgver() {
cd vkd3d-proton
@@ -46,29 +40,35 @@ prepare() {
git submodule update third_party/spirv-headers
popd
- # Export CFLAGS used by proton
- # -O2 is adjusted to -O3 since AVX is disabled
- # This overrides CFLAGS from makepkg.conf, if you comment these you are on your own
- # If you want the "best" possbile optimizations for your system you can use
+ # Filter known bad flags before applying optimizations
+ # Filter fstack-protector{ ,-all,-strong} flag for MingW.
+ # https://github.com/Joshua-Ashton/d9vk/issues/476
+ CFLAGS="${CFLAGS// -fstack-protector*([\-all|\-strong])/}"
+ CXXFLAGS="${CXXFLAGS// -fstack-protector*([\-all|\-strong])/}"
+ # Doesn't compile with these flags in MingW so remove them.
+ # They are also filtered in Wine PKGBUILDs so remove them
+ # for winelib versions too.
+ CFLAGS="${CFLAGS/ -fno-plt/}"
+ CXXFLAGS="${CXXFLAGS/ -fno-plt/}"
+ LDFLAGS="${LDFLAGS/,-z,now/}"
+ LDFLAGS="${LDFLAGS/,-z,relro/}"
+
+ # By default export FLAGS used by proton and ignore makepkg
+ # 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.
+ # `-O2` is adjusted to `-O3` since AVX is disabled
export CFLAGS="-O3 -march=nocona -mtune=core-avx2 -pipe"
export CXXFLAGS="-O3 -march=nocona -mtune=core-avx2 -pipe"
+ export LDFLAGS="-Wl,-O1,--sort-common,--as-needed"
# Uncomment to enable extra optimizations
# Patch crossfiles with extra optimizations from makepkg.conf
patch -p1 -i "$srcdir"/vkd3d-proton-extraopts.patch
- local vkd3d_cflags="$CFLAGS"
- local vkd3d_ldflags="$LDFLAGS"
- # Filter known bad flags before applying optimizations
- # Filter fstack-protector{ ,-all,-strong} flag for MingW.
- # https://github.com/Joshua-Ashton/d9vk/issues/476
- vkd3d_cflags="${vkd3d_cflags// -fstack-protector*([\-all|\-strong])/}"
- # Doesn't compile with these flags in MingW so remove them.
- # They are also filtered in Wine PKGBUILDs so remove them
- # for winelib versions too.
- vkd3d_cflags="${vkd3d_cflags/ -fno-plt/}"
- vkd3d_ldflags="${vkd3d_ldflags/,-z,now/}"
- vkd3d_ldflags="${vkd3d_ldflags/,-z,relro/}"
+ local cross_cflags="$CFLAGS"
+ local cross_cxxflags="$CXXFLAGS"
+ local cross_ldflags="$LDFLAGS"
+
# If using -march=native and the CPU supports AVX, launching a d3d9
# game can cause an Unhandled exception. The cause seems to be the
# combination of AVX instructions and tree vectorization (implied by O3),
@@ -81,19 +81,25 @@ prepare() {
# Relevant Wine issues
# https://bugs.winehq.org/show_bug.cgi?id=45289
# https://bugs.winehq.org/show_bug.cgi?id=43516
- vkd3d64_cflags="$vkd3d_cflags -mno-avx -mno-avx2"
- vkd3d32_cflags="$vkd3d_cflags -mno-avx -mno-avx2"
+ cross_cflags+=" -mno-avx -mno-avx2"
+ cross_cxxflags+=" -mno-avx -mno-avx2"
+
# These flags are taken from Proton, I don't know if there are issues with Arch wine.
- vkd3d64_cflags="$vkd3d_cflags -mfpmath=sse -fwrapv -fno-strict-aliasing -gdwarf-2 -gstrict-dwarf"
- vkd3d32_cflags="$vkd3d_cflags -mfpmath=sse -fwrapv -fno-strict-aliasing -gdwarf-2 -gstrict-dwarf"
- vkd3d_ldflags="$vkd3d_ldflags -Wl,--file-alignment,4096"
+ cross_cflags+=" -mfpmath=sse -fwrapv -fno-strict-aliasing -gdwarf-2 -gstrict-dwarf"
+ cross_cxxflags+=" -mfpmath=sse -fwrapv -fno-strict-aliasing -gdwarf-2 -gstrict-dwarf -std=c++17"
+ cross_ldflags+=" -Wl,--file-alignment,4096"
sed -i build-win64.txt \
- -e "s|@CARGS@|\'${vkd3d64_cflags// /\',\'}\'|g" \
- -e "s|@LDARGS@|\'${vkd3d_ldflags// /\',\'}\'|g"
+ -e "s|@CARGS@|\'${cross_cflags// /\',\'}\'|g" \
+ -e "s|@CXXARGS@|\'${cross_cxxflags// /\',\'}\'|g" \
+ -e "s|@LDARGS@|\'${cross_ldflags// /\',\'}\'|g"
+
+ cross_cflags+=" -mstackrealign"
+ cross_cxxflags+=" -mstackrealign"
sed -i build-win32.txt \
- -e "s|@CARGS@|\'${vkd3d32_cflags// /\',\'}\'|g" \
- -e "s|@LDARGS@|\'${vkd3d_ldflags// /\',\'}\'|g"
+ -e "s|@CARGS@|\'${cross_cflags// /\',\'}\'|g" \
+ -e "s|@CXXARGS@|\'${cross_cxxflags// /\',\'}\'|g" \
+ -e "s|@LDARGS@|\'${cross_ldflags// /\',\'}\'|g"
}
build() {
@@ -101,7 +107,7 @@ build() {
--prefix "/usr/share/vkd3d-proton/x64" \
--cross-file vkd3d-proton/build-win64.txt \
--bindir "" --libdir "" \
- --buildtype "release" \
+ --buildtype "plain" \
--strip \
-Denable_tests=false
ninja -C "build/x64" -v
@@ -110,7 +116,7 @@ build() {
--cross-file vkd3d-proton/build-win32.txt \
--prefix "/usr/share/vkd3d-proton/x86" \
--bindir "" --libdir "" \
- --buildtype "release" \
+ --buildtype "plain" \
--strip \
-Denable_tests=false
ninja -C "build/x86" -v
@@ -124,3 +130,10 @@ package() {
install -Dm 755 -t "$pkgdir/usr/bin" setup_vkd3d_proton
}
+sha256sums=('SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ '459d0de87abd6ea44ac71b4d7a005b6cfc9b2a75613ecda161223e95a22414d8'
+ '8fc019d1dca8c52b6af96c40ff06a6c215aad3e713ae17be72c7422f1ba45634')
+
diff --git a/vkd3d-proton-extraopts.patch b/vkd3d-proton-extraopts.patch
index d2eebde5bc1f..4e1e7430eac6 100644
--- a/vkd3d-proton-extraopts.patch
+++ b/vkd3d-proton-extraopts.patch
@@ -11,7 +11,7 @@ index c1f017a0..8fd09003 100644
-c_link_args = ['-static', '-static-libgcc']
-cpp_link_args = ['-static', '-static-libgcc', '-static-libstdc++']
+c_args=['-msse', '-msse2', @CARGS@]
-+cpp_args=['-msse', '-msse2', @CARGS@]
++cpp_args=['-msse', '-msse2', @CXXARGS@]
+c_link_args = ['-static', '-static-libgcc', @LDARGS@]
+cpp_link_args = ['-static', '-static-libgcc', '-static-libstdc++', @LDARGS@]
needs_exe_wrapper = true
@@ -28,7 +28,7 @@ index 8a241178..e3f619eb 100644
-c_link_args = ['-static', '-static-libgcc']
-cpp_link_args = ['-static', '-static-libgcc', '-static-libstdc++']
+c_args=[@CARGS@]
-+cpp_args=[@CARGS@]
++cpp_args=[@CXXARGS@]
+c_link_args = ['-static', '-static-libgcc', @LDARGS@]
+cpp_link_args = ['-static', '-static-libgcc', '-static-libstdc++', @LDARGS@]
needs_exe_wrapper = true