From: "James Le Cuirot" <chewi@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: games-engines/odamex/, games-engines/odamex/files/
Date: Mon, 18 Dec 2023 21:57:09 +0000 (UTC) [thread overview]
Message-ID: <1702936432.1e57cc70a7184fbf1d5be6a0df47bab5c59fa6d6.chewi@gentoo> (raw)
commit: 1e57cc70a7184fbf1d5be6a0df47bab5c59fa6d6
Author: Matoro Mahri <matoro_gentoo <AT> matoro <DOT> tk>
AuthorDate: Mon Dec 18 21:39:15 2023 +0000
Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Mon Dec 18 21:53:52 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1e57cc70
games-engines/odamex: add patch to fix ppc64 build
And tunes i386 SIMD options.
See: https://github.com/odamex/odamex/pull/928
Bug: https://bugs.gentoo.org/849866
Signed-off-by: Matoro Mahri <matoro_gentoo <AT> matoro.tk>
Closes: https://github.com/gentoo/gentoo/pull/34350
Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>
.../files/odamex-10.4.0-backport-pr928.patch | 66 ++++++++++++++++++++++
games-engines/odamex/odamex-10.4.0-r1.ebuild | 1 +
2 files changed, 67 insertions(+)
diff --git a/games-engines/odamex/files/odamex-10.4.0-backport-pr928.patch b/games-engines/odamex/files/odamex-10.4.0-backport-pr928.patch
new file mode 100644
index 000000000000..7d6871847814
--- /dev/null
+++ b/games-engines/odamex/files/odamex-10.4.0-backport-pr928.patch
@@ -0,0 +1,66 @@
+https://bugs.gentoo.org/849866
+https://github.com/odamex/odamex/pull/928
+
+From b952137ac487a6558e1796c86d8fd55b8b3c9025 Mon Sep 17 00:00:00 2001
+From: matoro <matoro@users.noreply.github.com>
+Date: Wed, 6 Dec 2023 01:01:29 -0500
+Subject: [PATCH] Fix auto-SIMD for i386+sse2, ppc+altivec
+
+Only Darwin ever used -faltivec, gcc uses -maltivec since at least 2007:
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30254#c1
+
+Similarly, recent versions of gcc define __APPLE_ALTIVEC__ for
+compatibility, so just unconditionally include altivec.h.
+
+Canonical way to enable specific extensions is e.g. -msse2, use that
+instead of optimizing for a specific CPU.
+
+Finally, cmake uses target_compile_options to add arbitrary flags.
+target_compile_definitions assumes you want a preprocessor definition,
+which was adding "-D-faltivec" to the command line which gcc doesn't
+like; this is what originally prompted this change.
+---
+ client/CMakeLists.txt | 11 +++++++----
+ client/src/r_drawt_altivec.cpp | 2 --
+ 2 files changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt
+index 646164916..56caf04f8 100644
+--- a/client/CMakeLists.txt
++++ b/client/CMakeLists.txt
+@@ -169,14 +169,17 @@ if(TARGET SDL2::SDL2 OR TARGET SDL::SDL)
+ message(STATUS "Default SIMD flags not touched for AMD64")
+ elseif(ODAMEX_TARGET_ARCH STREQUAL "i386")
+ if(NOT MSVC)
+- # Pentium M has SSE2.
+- target_compile_definitions(odamex PRIVATE -march=pentium-m)
++ target_compile_options(odamex PRIVATE -msse2)
+ else()
+- target_compile_definitions(odamex PRIVATE /arch:SSE2)
++ target_compile_options(odamex PRIVATE /arch:SSE2)
+ endif()
+ message(STATUS "Default SIMD flags set to SSE2")
+ elseif(ODAMEX_TARGET_ARCH MATCHES "ppc")
+- target_compile_definitions(odamex PRIVATE -faltivec)
++ if(APPLE)
++ target_compile_options(odamex PRIVATE -faltivec)
++ else()
++ target_compile_options(odamex PRIVATE -maltivec)
++ endif()
+ message(STATUS "Default SIMD flags set to AltiVec")
+ endif()
+ else()
+diff --git a/client/src/r_drawt_altivec.cpp b/client/src/r_drawt_altivec.cpp
+index eea758733..5a0cdf95e 100644
+--- a/client/src/r_drawt_altivec.cpp
++++ b/client/src/r_drawt_altivec.cpp
+@@ -36,9 +36,7 @@
+ #include "r_main.h"
+ #include "i_video.h"
+
+-#if !defined(__APPLE_ALTIVEC__)
+ #include <altivec.h>
+-#endif
+
+ #define ALTIVEC_ALIGNED(x) x __attribute__((aligned(16)))
+
diff --git a/games-engines/odamex/odamex-10.4.0-r1.ebuild b/games-engines/odamex/odamex-10.4.0-r1.ebuild
index cf946901e853..5a5077b6ca54 100644
--- a/games-engines/odamex/odamex-10.4.0-r1.ebuild
+++ b/games-engines/odamex/odamex-10.4.0-r1.ebuild
@@ -42,6 +42,7 @@ S="${WORKDIR}/${PN}-src-${PV}"
PATCHES=(
"${FILESDIR}"/${PN}-10.3.0-unbundle-fltk.patch
+ "${FILESDIR}"/${PN}-10.4.0-backport-pr928.patch
)
src_prepare() {
next reply other threads:[~2023-12-18 21:57 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-18 21:57 James Le Cuirot [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-03-19 23:04 [gentoo-commits] repo/gentoo:master commit in: games-engines/odamex/, games-engines/odamex/files/ James Le Cuirot
2023-07-02 20:49 James Le Cuirot
2023-05-14 14:26 James Le Cuirot
2022-03-20 13:32 James Le Cuirot
2022-03-04 22:49 James Le Cuirot
2021-05-29 14:54 James Le Cuirot
2020-08-25 21:57 James Le Cuirot
2020-08-25 21:57 James Le Cuirot
2020-04-08 22:46 James Le Cuirot
2019-09-07 14:33 James Le Cuirot
2019-09-07 14:33 James Le Cuirot
2018-10-14 18:35 Andreas Sturmlechner
2017-07-23 13:12 Michael Palimaka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1702936432.1e57cc70a7184fbf1d5be6a0df47bab5c59fa6d6.chewi@gentoo \
--to=chewi@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox