From 1d02b2cc9017250c58ad22db7d5aa114becbbac5 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Fri, 6 May 2022 09:01:17 +0100 Subject: [PATCH] ipmitool: fix build on -fno-common toolchains Without the change build fails on toolchains like clang-13 which switch to -fno-common by default: $ nix build --impure --expr 'with import ./. {}; ipmitool.override { stdenv = clang13Stdenv; }' ... ld: ../lib/.libs/libipmitool.a(ipmi_hpmfwupg.o):/build/ipmitool-1.8.18/lib/../include/ipmitool/ipmi_hpmfwupg.h:803: multiple definition of `gVersionInfo'; ipmitool.o:/build/ipmitool-1.8.18/src/../include/ipmitool/ipmi_hpmfwupg.h:803: first defined here Pull upstream fix to move definition to .c file. --- pkgs/tools/system/ipmitool/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/tools/system/ipmitool/default.nix b/pkgs/tools/system/ipmitool/default.nix index 2ad0d11f95f0..6020f1658e6a 100644 --- a/pkgs/tools/system/ipmitool/default.nix +++ b/pkgs/tools/system/ipmitool/default.nix @@ -24,6 +24,13 @@ stdenv.mkDerivation rec { url = "https://github.com/ipmitool/ipmitool/commit/e824c23316ae50beb7f7488f2055ac65e8b341f2.patch"; sha256 = "sha256-X7MnoX2fzByRpRY4p33xetT+V2aehlQ/qU+aeaqtTUY="; }) + # Pull upstream patch to support upstream gcc-10: + # https://github.com/ipmitool/ipmitool/pull/180 + (fetchpatch { + name = "fno-common.patch"; + url = "https://github.com/ipmitool/ipmitool/commit/51c7e0822f531469cf860dfa5d010c87b284b747.patch"; + sha256 = "sha256-5UszUdVw3s2S5RCm5Exq4mqDqiYcN62in1O5+TZu9YA="; + }) ]; buildInputs = [ openssl ];