diff options
author | V3n3RiX <venerix@koprulu.sector> | 2024-03-21 07:00:13 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2024-03-21 07:00:13 +0000 |
commit | 3faa6ebe0068b432ee5a9390c47ceca068ea7fe9 (patch) | |
tree | c571245b455a9a5dd80022270c5ac943532620b9 /games-emulation/sameboy-jg | |
parent | ee93fbc2bb111cf895ae00cc1877c68f0eafaf2a (diff) |
gentoo auto-resync : 21:03:2024 - 07:00:13
Diffstat (limited to 'games-emulation/sameboy-jg')
-rw-r--r-- | games-emulation/sameboy-jg/Manifest | 4 | ||||
-rw-r--r-- | games-emulation/sameboy-jg/files/sameboy-jg-0.16.2-strict-aliasing.patch | 115 | ||||
-rw-r--r-- | games-emulation/sameboy-jg/sameboy-jg-0.16.2-r1.ebuild (renamed from games-emulation/sameboy-jg/sameboy-jg-0.15.8.ebuild) | 5 |
3 files changed, 122 insertions, 2 deletions
diff --git a/games-emulation/sameboy-jg/Manifest b/games-emulation/sameboy-jg/Manifest index c51824630c9d..8db851a821ee 100644 --- a/games-emulation/sameboy-jg/Manifest +++ b/games-emulation/sameboy-jg/Manifest @@ -1,6 +1,6 @@ -DIST sameboy-0.15.8.tar.bz2 3002961 BLAKE2B 5eacbc82d8c93ee85b774c554b3d3750088e8a4219d5b04daa9e6db0c70923ef823befc12831382a27ee007f117fddcfe35ff3549d7684b8587db9ffc486ccd6 SHA512 9074dfcbf400fe51e605ef0200f6ea8483650d605ab19177089c0e60f9996c15f265c5dec5fd0e6651392c9a9515e8380499e00bac837bb645220cd6ffa9c870 +AUX sameboy-jg-0.16.2-strict-aliasing.patch 3956 BLAKE2B ed3b15eaf554b4fc327fa00ad246e1ed36483a6c7f5a2daad5065fc7250aea00dc14d0250ff5f116528a43ea303e9b668ce45c8cf199949e90baece31cf3c100 SHA512 478ec132acb18bb7941495d96ae0e49f58800fabdfcfb19ff25bd087047794f2082f0b5fb32d8b55b8dd33a532b65424e26cd6933212f7e116b723cdc3605da2 DIST sameboy-0.16.2.tar.bz2 3556441 BLAKE2B 0972cb8ba200d8ac95a3d66e3b671c1adeeea71eebb4202b1985f7f72edebd42886aac48040bf034dab8d93fd52d15165551ee8dfaf6870a59ca7f574fc99e0f SHA512 bd456e248ec2d6ea0e8b017b705c829c6a94b1f7fe734769a86774c4b6983278cc5b4d61fdf8164844545bbd250b3c4f1fe725046ac7edb301268291d907f39f -EBUILD sameboy-jg-0.15.8.ebuild 987 BLAKE2B 2dcce119bf6ad54ef4977b6053679c4587404de366365f5f8b929b543b4b6aa6a59f11d2be70252df5d81cbf7009ab1afa00236bc616d4e83b565f7199d66eb6 SHA512 130951e3bb86eea3730ebebefdad1527dce767f3dc38789f446954aa3ecacedae1cdc911c5e43f86f3c8947cc9b8ccefc32f9378af04a3936330a09591daa8be +EBUILD sameboy-jg-0.16.2-r1.ebuild 1076 BLAKE2B e123afc0f7bec0ebb94d3d19b2d8c3733a31d1707241920c02b2322c53eb8724053e9bbc16e7614de13645da43339dfd912d7ffe6d201c497205ab8dca08079e SHA512 aca06a2716140a4f62d920f043872f39c25af39f6a5cb9b112180dc41b89bd098519fb58083c9d3ed9124ce57abd43d53938538922d0a520bfa2c773a082a853 EBUILD sameboy-jg-0.16.2.ebuild 987 BLAKE2B 2dcce119bf6ad54ef4977b6053679c4587404de366365f5f8b929b543b4b6aa6a59f11d2be70252df5d81cbf7009ab1afa00236bc616d4e83b565f7199d66eb6 SHA512 130951e3bb86eea3730ebebefdad1527dce767f3dc38789f446954aa3ecacedae1cdc911c5e43f86f3c8947cc9b8ccefc32f9378af04a3936330a09591daa8be EBUILD sameboy-jg-9999.ebuild 987 BLAKE2B 2dcce119bf6ad54ef4977b6053679c4587404de366365f5f8b929b543b4b6aa6a59f11d2be70252df5d81cbf7009ab1afa00236bc616d4e83b565f7199d66eb6 SHA512 130951e3bb86eea3730ebebefdad1527dce767f3dc38789f446954aa3ecacedae1cdc911c5e43f86f3c8947cc9b8ccefc32f9378af04a3936330a09591daa8be MISC metadata.xml 725 BLAKE2B 77295d1bcc5ed31dfc5d162fc2f88e03954fa5552e6ccb688e286c82c68a427edda2717509b3503325d79b5c1ffebc943e4f5ad4da4f24e6d9b9e9dd66b69fb5 SHA512 1c37d417d50220e6201719509c9f66be97d13482846a111728e1020fec3215f55309a48b63d1a13ff66d9c9976783cc767b6124d8888dc3792de7bdccb1d71af diff --git a/games-emulation/sameboy-jg/files/sameboy-jg-0.16.2-strict-aliasing.patch b/games-emulation/sameboy-jg/files/sameboy-jg-0.16.2-strict-aliasing.patch new file mode 100644 index 000000000000..f1c82ef78ea6 --- /dev/null +++ b/games-emulation/sameboy-jg/files/sameboy-jg-0.16.2-strict-aliasing.patch @@ -0,0 +1,115 @@ +https://bugs.gentoo.org/926077 +https://github.com/LIJI32/SameBoy/pull/593 +https://gitlab.com/jgemu/sameboy/-/merge_requests/50 +https://gitlab.com/jgemu/sameboy/-/commit/6a283f65cc4b9ee4896942afde745fa67e612fd3 +https://gitlab.com/jgemu/sameboy/-/commit/9067678fe0160fe5c2f10a7f6271f8293d5150d1 + +From 6a283f65cc4b9ee4896942afde745fa67e612fd3 Mon Sep 17 00:00:00 2001 +From: Lior Halphon <LIJI32@gmail.com> +Date: Sat, 9 Mar 2024 11:08:01 -0800 +Subject: [PATCH 1/2] Avoid strict aliasing violations. Closes #593 + +Backported from: + +https://github.com/LIJI32/SameBoy/commit/8739da61c013e20e1cc94f0619c622a65c713408 +--- + Core/apu.c | 4 ++-- + Core/apu.h | 11 +++++++++++ + Makefile | 2 +- + 3 files changed, 14 insertions(+), 3 deletions(-) + +diff --git a/Core/apu.c b/Core/apu.c +index e621e82a..0f0ed16b 100644 +--- a/Core/apu.c ++++ b/Core/apu.c +@@ -100,7 +100,7 @@ static void update_sample(GB_gameboy_t *gb, GB_channel_t index, int8_t value, un + output.left = output.right = 0; + } + +- if (*(uint32_t *)&(gb->apu_output.current_sample[index]) != *(uint32_t *)&output) { ++ if (gb->apu_output.current_sample[index].packed != output.packed) { + refresh_channel(gb, index, cycles_offset); + gb->apu_output.current_sample[index] = output; + } +@@ -131,7 +131,7 @@ static void update_sample(GB_gameboy_t *gb, GB_channel_t index, int8_t value, un + if (likely(!gb->apu_output.channel_muted[index])) { + output = (GB_sample_t){(0xF - value * 2) * left_volume, (0xF - value * 2) * right_volume}; + } +- if (*(uint32_t *)&(gb->apu_output.current_sample[index]) != *(uint32_t *)&output) { ++ if (gb->apu_output.current_sample[index].packed != output.packed) { + refresh_channel(gb, index, cycles_offset); + gb->apu_output.current_sample[index] = output; + } +diff --git a/Core/apu.h b/Core/apu.h +index c8700c80..15b54a87 100644 +--- a/Core/apu.h ++++ b/Core/apu.h +@@ -25,11 +25,22 @@ + + /* APU ticks are 2MHz, triggered by an internal APU clock. */ + ++#ifdef GB_INTERNAL ++typedef union ++{ ++ struct { ++ int16_t left; ++ int16_t right; ++ }; ++ uint32_t packed; ++} GB_sample_t; ++#else + typedef struct + { + int16_t left; + int16_t right; + } GB_sample_t; ++#endif + + typedef struct + { +diff --git a/Makefile b/Makefile +index c25f38b2..bc239893 100644 +--- a/Makefile ++++ b/Makefile +@@ -164,7 +164,7 @@ endif + + # These must come before the -Wno- flags + WARNINGS += -Werror -Wall -Wno-unknown-warning -Wno-unknown-warning-option -Wno-missing-braces +-WARNINGS += -Wno-nonnull -Wno-unused-result -Wno-strict-aliasing -Wno-multichar -Wno-int-in-bool-context -Wno-format-truncation ++WARNINGS += -Wno-nonnull -Wno-unused-result -Wno-multichar -Wno-int-in-bool-context -Wno-format-truncation + + # Only add this flag if the compiler supports it + ifeq ($(shell $(CC) -x c -c $(NULL) -o $(NULL) -Werror -Wpartial-availability 2> $(NULL); echo $$?),0) +-- +GitLab + + +From 9067678fe0160fe5c2f10a7f6271f8293d5150d1 Mon Sep 17 00:00:00 2001 +From: orbea <orbea@riseup.net> +Date: Sat, 9 Mar 2024 11:08:57 -0800 +Subject: [PATCH 2/2] build: remove -Wno-strict-aliasing + add + -Wno-missing-braces + +Upstream also uses -Wno-missing-braces + +See: https://github.com/LIJI32/SameBoy/pull/597 +--- + jollygood/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/jollygood/Makefile b/jollygood/Makefile +index a0bd24b3..b1c22384 100644 +--- a/jollygood/Makefile ++++ b/jollygood/Makefile +@@ -17,7 +17,7 @@ FLAGS_PB12 := -Os -std=c99 + DEFS := -D_GNU_SOURCE -DGB_INTERNAL -DGB_DISABLE_REWIND -DGB_DISABLE_DEBUGGER \ + -DGB_VERSION=\"$(VERSION)\" + +-WARNINGS := -Wall -Wno-strict-aliasing -Wno-multichar -Wno-unused-result ++WARNINGS := -Wall -Wno-missing-braces -Wno-multichar -Wno-unused-result + WARNINGS_PB12 := -Wall -Wextra -Wshadow + + # Only relative include paths are used in sameboy +-- +GitLab + diff --git a/games-emulation/sameboy-jg/sameboy-jg-0.15.8.ebuild b/games-emulation/sameboy-jg/sameboy-jg-0.16.2-r1.ebuild index c41503e9640a..e417d12d3618 100644 --- a/games-emulation/sameboy-jg/sameboy-jg-0.15.8.ebuild +++ b/games-emulation/sameboy-jg/sameboy-jg-0.16.2-r1.ebuild @@ -33,6 +33,11 @@ BDEPEND=" virtual/pkgconfig " +PATCHES=( + # https://bugs.gentoo.org/926077 + "${FILESDIR}"/${P}-strict-aliasing.patch +) + src_compile() { emake -C jollygood \ CC="$(tc-getCC)" \ |