From 1e42f67d82d82bb095721f05d3f70ae95502a3a6 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 22 May 2022 15:18:43 +0100 Subject: [PATCH] mupen64plus: pull upstream fix for -fno-common toolchains Without the change build fails on upstream gcc-10 as: ld: _obj/device/r4300/x86_64/dynarec.o (symbol from plugin): in function `dyna_jump': (.text+0x0): multiple definition of `g_r4300_opcodes'; _obj/device/r4300/cached_interp.o (symbol from plugin):(.text+0x0): first defined here --- .../emulators/mupen64plus/default.nix | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/emulators/mupen64plus/default.nix b/pkgs/applications/emulators/mupen64plus/default.nix index f5d17d9d3951..82908a166d46 100644 --- a/pkgs/applications/emulators/mupen64plus/default.nix +++ b/pkgs/applications/emulators/mupen64plus/default.nix @@ -1,4 +1,4 @@ -{lib, stdenv, fetchurl, boost, dash, freetype, libpng, pkg-config, SDL, which, zlib, nasm }: +{lib, stdenv, fetchurl, fetchpatch, boost, dash, freetype, libpng, pkg-config, SDL, which, zlib, nasm }: stdenv.mkDerivation rec { pname = "mupen64plus"; @@ -9,6 +9,19 @@ stdenv.mkDerivation rec { sha256 = "1a21n4gqdvag6krwcjm5bnyw5phrlxw6m0mk73jy53iq03f3s96m"; }; + patches = [ + # Pull upstream fix for -fno-common toolchains: + # https://github.com/mupen64plus/mupen64plus-core/pull/736 + (fetchpatch { + name = "fno-common.patch"; + url = "https://github.com/mupen64plus/mupen64plus-core/commit/39975200ad4926cfc79c96609b64696289065502.patch"; + sha256 = "0kdshp9xdkharn3d1g1pvxhh761pa1v5w07iq0wf9l380r2m6gbv"; + # a/something -> a/source/mupen64plus-core/something + stripLen = 1; + extraPrefix = "source/mupen64plus-core/"; + }) + ]; + nativeBuildInputs = [ pkg-config nasm ]; buildInputs = [ boost dash freetype libpng SDL which zlib ];