From 687decaa2d29d6bfe6a70ae528b2cbde59b6438d Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 15 May 2022 10:18:31 +0100 Subject: [PATCH] flasm: pull patch pending upstream inclusion for -fno-common toolchains Without the change build fails on upstream gcc-10 as: ld: unflasm.o:/build/source/unflasm.c:32: multiple definition of `swfVersion'; flasm.o:/build/source/flasm.c:36: first defined here --- pkgs/development/compilers/flasm/default.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/flasm/default.nix b/pkgs/development/compilers/flasm/default.nix index 9423f5e15df9..02ee36642397 100644 --- a/pkgs/development/compilers/flasm/default.nix +++ b/pkgs/development/compilers/flasm/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchzip, unzip, bison, flex, gperf, zlib }: +{ lib, stdenv, fetchzip, unzip, fetchpatch, bison, flex, gperf, zlib }: stdenv.mkDerivation rec { pname = "flasm"; @@ -10,6 +10,16 @@ stdenv.mkDerivation rec { stripRoot = false; }; + patches = [ + # Pull patch pending upstream inclusion for -fno-common toolchains: + # https://sourceforge.net/p/flasm/patches/2/ + (fetchpatch { + name = "fno-common.patch"; + url = "https://sourceforge.net/p/flasm/patches/2/attachment/0001-flasm-fix-build-on-gcc-10-fno-common.patch"; + sha256 = "0ic7k1mmyvhpnxam89dbg8i9bfzk70zslfdxgpmkszx097bj1hv6"; + }) + ]; + makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ]; nativeBuildInputs = [ unzip bison flex gperf ];