diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2018-07-07 11:42:03 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2018-07-07 11:42:03 +0100 |
commit | f70601e0934acd62f6c5d06c5ede4cc607179514 (patch) | |
tree | 0b337390375de04b950fc4b45edc0f895a4701a4 /games-emulation/zsnes | |
parent | b2be182d49eea46686b5cf2680d457df61e89dc4 (diff) |
gentoo resync : 07.07.2018
Diffstat (limited to 'games-emulation/zsnes')
-rw-r--r-- | games-emulation/zsnes/Manifest | 2 | ||||
-rw-r--r-- | games-emulation/zsnes/files/zsnes-1.51-stack-align-v2.patch | 56 | ||||
-rw-r--r-- | games-emulation/zsnes/zsnes-1.51-r7.ebuild | 122 |
3 files changed, 180 insertions, 0 deletions
diff --git a/games-emulation/zsnes/Manifest b/games-emulation/zsnes/Manifest index 77fa9154ffbf..c24684152b52 100644 --- a/games-emulation/zsnes/Manifest +++ b/games-emulation/zsnes/Manifest @@ -9,7 +9,9 @@ AUX zsnes-1.51-gcc47.patch 312 BLAKE2B 927c6179fbbcd3fb161b5b18e025090acce178eae AUX zsnes-1.51-libao-thread.patch 667 BLAKE2B 76bc0abf16f68c9752a727817cff209daa2c0c29f31e6045441e202083f47559cb50c1a6a998c12621a298fa3901bc1d52701b176b8fd594ca116f990d3c5208 SHA512 43c28d4539df5c8ea4d3d0415c65afec3eb9215971a5ff0532b3b147b2fa3f870aadf07eb1e643e986c39d56760c0292447d467418865826ddc8c7aea64cc005 AUX zsnes-1.51-libpng.patch 858 BLAKE2B f0ad46176cf5729d0a5be9e4307a28628e38c3d18043f0ff897dfd1cf901f0f9fb7ff80d25095fdaa9b6b1be52fe3c95f4e28b65042b4c4aad33a27125c7eb02 SHA512 2c25fb3294357a38ed8e119d4b4d60f7bd6f28724b2274a620465962e96e008f2a29273f46d4813e91b9128879218f401bb91b1a6df4c156b9ff7856b26657b0 AUX zsnes-1.51-libpng15.patch 510 BLAKE2B 6281a27c6029ee94947b282fe5c06a67e7670d3168d5f4ae90573d12e8e6d5c467a9691cdd161158f117e341466bc7a3e99d516b95624534773027279aba4f7a SHA512 4191987cad2f8dd7d7fd1d4f8f0c60de07059f18a60cb9bb94f1e5c35c06122032de9887762ebcf2d255f24c3e90aa5b4f6a7540a8e4dbdc4ce5f7d3b3e3b532 +AUX zsnes-1.51-stack-align-v2.patch 1451 BLAKE2B b4570fa9d614d516375f1b7d2a9b3b7c9bf432f453425d2ee3035e78d8d946355551044d712528907c3a1f29b3531034b5949224398801e04270df85ada5ab00 SHA512 c3be01f36973615c55c643d1d916742f8e3a34e9957b42d1d7224a99790713025bb154e5e8c2833fd1e8d26240c6251a70c8a9f36fefe661480077b1b06871c8 AUX zsnes-1.51-stack-align.patch 283 BLAKE2B 2ae8aaf28975f0f88ed77eafb3977706bd662215a7e286c32ce6a138993bda00c05012bc92bd106b6607d524990ccccf094e647c44a350babf3755c2dc6bf3a6 SHA512 543876c459d7448bb7707677de432dd0140320ab77752f1d9fbee4f58ea34158f1e223f46d5aa9e2858b902513a915517f27e86e51f2263f667a6baea608fb55 DIST zsnes151src.tar.bz2 1071712 BLAKE2B e942c699bd227942563deb23b105339aa9ffd8a5623200ca142a777508b4ebaf47859170016490f53a3af2bfb15293c17a99a7658e1f3f0afd7df8cd63200b9a SHA512 2cec9ad7762fc7a257c6b1d3e190b0ed53565dbafe42e1dee9eb182644392b7dd2c57faa846f63cd30ac079e5c05354d26ce0612d20481a1f54d760d62d95353 EBUILD zsnes-1.51-r6.ebuild 3198 BLAKE2B cf8d5505e5eef6c3d864cddc82dfd9af86ce32780c651536547994218e55658450ce8fb507126850ff16541fa342a6a99d13bf25d550d46072f07c338f8c14e0 SHA512 4a9a696fdfbc4f31c95fe5e81fd6a27b569771d8fe36b24a088594f0a36fbf13a6c30dc562e57a7e4842569b9b4a15a459f17bd24101f685160650232ccaddb6 +EBUILD zsnes-1.51-r7.ebuild 3173 BLAKE2B c0ae44e8340ddce0d6a7cd4e5f7ce56e7b6b0b142194874f0f3f1681fbb3eb9a92fa149f2ce7edbbebe6136b5940b2601c4be4be360f574c83644a1af97ad094 SHA512 e5acf4bce2632ff23550c37e0f27c602240e1f9ac3ef0287d81b4a35f80a33557728f9d4721d62985c19e64d9b392f8283edb58c22131c0ee74e6d78bbd94aac MISC metadata.xml 484 BLAKE2B ad2da7cec97ca32be7ae42000312cdebd1c5dc5fce4ccc6f99fd16e69208350a5e714201e0bc258e8d4eb980357fe2517cc9b177e3ad74507b44d31ecdc8fe27 SHA512 02318871d54bfa7d9c4ba2a64f3ed7c83bf45b04a5c66dda5659d935b943a2415e6eaad124ac34e3c4235ba57f21c1189b03fec4f622c19eec1873531727a622 diff --git a/games-emulation/zsnes/files/zsnes-1.51-stack-align-v2.patch b/games-emulation/zsnes/files/zsnes-1.51-stack-align-v2.patch new file mode 100644 index 000000000000..35613a953596 --- /dev/null +++ b/games-emulation/zsnes/files/zsnes-1.51-stack-align-v2.patch @@ -0,0 +1,56 @@ +zsnes call C initialization code from assembler. + +Example backtrace: + + Thread 1 "zsnes" received signal SIGSEGV, Segmentation fault. + => 0xf7550275 <+37>: vmovdqa (%esp),%xmm1 + ... + #13 0x5699ef82 in InitSound () at linux/audio.c:336 + #14 0x569a25af in initwinvideo () at linux/sdllink.c:1080 + #15 0x5699fc13 in initvideo () at linux/sdllink.c:1298 + #16 0x56f9d5bc in regptwa () + #17 0x56a34b50 in SA1tableG () + #18 0x56f84788 in selcB800 () + ... + +Call to 'initwinvideo' (first C function) looks like that: + NEWSYM InitPreGame ; Executes before starting/continuing a game + mov byte[pressed+1],2 + pushad + call Start60HZ + %ifdef __OPENGL__ + call drawscreenwin + %endif + call initwinvideo + +Note: pushad / call does not 16-byte maintain stack alignment +and breaks i386 ABI. + +We apply realignment attribute to all functions noticed by users. +Bug: https://bugs.gentoo.org/503138 +--- src/linux/sdllink.c.old ++++ src/linux/sdllink.c +@@ -773,11 +773,11 @@ BOOL InitInput() + { + InitJoystickInput(); + return TRUE; + } + +-int startgame() ++int __attribute__((force_align_arg_pointer)) startgame() + { + static bool ranonce = false; + int status; + + if (!ranonce) +--- a/linux/sdllink.c ++++ b/linux/sdllink.c +@@ -897,7 +897,7 @@ bool OGLModeCheck() + return(cvidmode > 4); + } + +-void initwinvideo(void) ++void __attribute__((force_align_arg_pointer)) initwinvideo(void) + { + DWORD newmode = 0; + diff --git a/games-emulation/zsnes/zsnes-1.51-r7.ebuild b/games-emulation/zsnes/zsnes-1.51-r7.ebuild new file mode 100644 index 000000000000..9613a4888e85 --- /dev/null +++ b/games-emulation/zsnes/zsnes-1.51-r7.ebuild @@ -0,0 +1,122 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +inherit autotools desktop flag-o-matic toolchain-funcs pax-utils + +DESCRIPTION="SNES (Super Nintendo) emulator that uses x86 assembly" +HOMEPAGE="http://www.zsnes.com/ http://ipherswipsite.com/zsnes/" +SRC_URI="mirror://sourceforge/zsnes/${PN}${PV//./}src.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd ~amd64-linux ~x86-linux" +IUSE="ao custom-cflags +debug opengl pax_kernel png" + +RDEPEND=" + media-libs/libsdl[sound,video,abi_x86_32(-)] + >=sys-libs/zlib-1.2.3-r1[abi_x86_32(-)] + ao? ( media-libs/libao[abi_x86_32(-)] ) + debug? ( sys-libs/ncurses:0=[abi_x86_32(-)] ) + opengl? ( virtual/opengl[abi_x86_32(-)] ) + png? ( media-libs/libpng:0=[abi_x86_32(-)] ) +" +DEPEND="${RDEPEND} + dev-lang/nasm + debug? ( virtual/pkgconfig ) +" + +S="${WORKDIR}/${PN}_${PV//./_}/src" + +PATCHES=( + # Fixing compilation without libpng installed + "${FILESDIR}"/${P}-libpng.patch + + # Fix bug #186111 + # Fix bug #214697 + # Fix bug #170108 + # Fix bug #260247 + "${FILESDIR}"/${P}-archopt-july-23-update.patch + "${FILESDIR}"/${P}-gcc43.patch + "${FILESDIR}"/${P}-libao-thread.patch + "${FILESDIR}"/${P}-depbuild.patch + "${FILESDIR}"/${P}-CC-quotes.patch + + # Fix compability with libpng15 wrt #378735 + "${FILESDIR}"/${P}-libpng15.patch + + # Fix buffer overwrite #257963 + "${FILESDIR}"/${P}-buffer.patch + # Fix gcc47 compile #419635 + "${FILESDIR}"/${P}-gcc47.patch + # Fix stack alignment issue #503138 + "${FILESDIR}"/${P}-stack-align-v2.patch + + "${FILESDIR}"/${P}-cross-compile.patch + "${FILESDIR}"/${P}-arch.patch +) + +src_prepare() { + default + + # The sdl detection logic uses AC_PROG_PATH instead of + # AC_PROG_TOOL, so force the var to get set the way we + # need for things to work correctly. + tc-is-cross-compiler && export ac_cv_path_SDL_CONFIG=${CHOST}-sdl-config + + sed -i -e '67i#define OF(x) x' zip/zunzip.h || die + + # Remove hardcoded CFLAGS and LDFLAGS + sed -i \ + -e '/^CFLAGS=.*local/s:-pipe.*:-Wall -I.":' \ + -e '/^LDFLAGS=.*local/d' \ + -e '/\w*CFLAGS=.*fomit/s:-O3.*$STRIP::' \ + -e '/lncurses/s:-lncurses:`pkg-config ncurses --libs`:' \ + -e '/lcurses/s:-lcurses:`pkg-config ncurses --libs`:' \ + configure.in || die + sed -i \ + -e 's/configure.in/configure.ac/' \ + Makefile.in || die + mv configure.in configure.ac || die + eautoreconf +} + +src_configure() { + tc-export CC + export BUILD_CXX=$(tc-getBUILD_CXX) + export NFLAGS=-O1 + use amd64 && multilib_toolchain_setup x86 + use custom-cflags || strip-flags + + append-cppflags -U_FORTIFY_SOURCE #257963 + + econf \ + $(use_enable ao libao) \ + $(use_enable debug debugger) \ + $(use_enable png libpng) \ + $(use_enable opengl) \ + --disable-debug \ + --disable-cpucheck +} + +src_compile() { + emake makefile.dep + emake +} + +src_install() { + dobin zsnes + if use pax_kernel; then + pax-mark m "${D}""${GAMES_BINDIR}"/zsnes || die + fi + + newman linux/zsnes.1 zsnes.6 + + dodoc \ + ../docs/{readme.1st,authors.txt,srcinfo.txt,stdards.txt,support.txt,thanks.txt,todo.txt,README.LINUX} \ + ../docs/readme.txt/* + HTML_DOCS="../docs/readme.htm/*" einstalldocs + + make_desktop_entry zsnes ZSNES + newicon icons/48x48x32.png ${PN}.png +} |