fix build error with gcc 10

This commit is contained in:
eaglegai 2021-07-30 11:20:08 +08:00
parent a5f5eef930
commit 67216573f2
2 changed files with 46 additions and 1 deletions

View File

@ -0,0 +1,38 @@
From c3939dac2c060651361fc71516806f9ab8c38901 Mon Sep 17 00:00:00 2001
From: Vaclav Dolezal <vdolezal@redhat.com>
Date: Thu, 23 Jan 2020 11:26:32 +0100
Subject: [PATCH] hpmfwupg: move variable definition to .c file
Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
---
include/ipmitool/ipmi_hpmfwupg.h | 2 +-
lib/ipmi_hpmfwupg.c | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/ipmitool/ipmi_hpmfwupg.h b/include/ipmitool/ipmi_hpmfwupg.h
index de65292b..07f597be 100644
--- a/include/ipmitool/ipmi_hpmfwupg.h
+++ b/include/ipmitool/ipmi_hpmfwupg.h
@@ -800,7 +800,7 @@ typedef struct _VERSIONINFO {
char descString[HPMFWUPG_DESC_STRING_LENGTH + 1];
}VERSIONINFO, *PVERSIONINFO;
-VERSIONINFO gVersionInfo[HPMFWUPG_COMPONENT_ID_MAX];
+extern VERSIONINFO gVersionInfo[HPMFWUPG_COMPONENT_ID_MAX];
#define TARGET_VER (0x01)
#define ROLLBACK_VER (0x02)
diff --git a/lib/ipmi_hpmfwupg.c b/lib/ipmi_hpmfwupg.c
index 4aa8cecd..d63d2c15 100644
--- a/lib/ipmi_hpmfwupg.c
+++ b/lib/ipmi_hpmfwupg.c
@@ -50,6 +50,8 @@
extern int verbose;
+VERSIONINFO gVersionInfo[HPMFWUPG_COMPONENT_ID_MAX];
+
int HpmfwupgUpgrade(struct ipmi_intf *intf, char *imageFilename,
int activate, int, int);
int HpmfwupgValidateImageIntegrity(struct HpmfwupgUpgradeCtx *pFwupgCtx);

View File

@ -1,6 +1,6 @@
Name: ipmitool
Version: 1.8.18
Release: 15
Release: 16
Summary: Utility for IPMI control
License: BSD
URL: http://ipmitool.sourceforge.net/
@ -41,6 +41,7 @@ Patch6022: ipmitool-CVE-2020-5208-Fix-buffer-overflow-in-ipmi_get_session_
Patch6023: ipmitool-CVE-2020-5208-Fix-buffer-overflow.patch
Patch6024: ipmitool-CVE-2020-5208-Fix-buffer-overflows-in-get_lan_param_select.patch
Patch6025: ipmitool-CVE-2020-5208-Fix-id_string-buffer-overflows.patch
Patch6026: fix-variable-definition-error-with-gcc-10.patch
BuildRequires: openssl-devel readline-devel ncurses-devel git
%{?systemd_requires}
@ -131,6 +132,12 @@ install -Dm 755 contrib/bmc-snmp-proxy %{buildroot}%{_libexecdir}/bmc-sn
%{_mandir}/man8/ipmievd.8*
%changelog
* Fri Jul 30 2021 gaihuiying <gaihuiying1@huawei.com> - 1.8.18-16
- Type:bugfix
- Id:NA
- SUG:NA
- DESC:fix build error with gcc 10
* Tue Dec 15 2020 xihaochen <xihaochen@huawei.com> - 1.8.18-15
- Type:requirement
- Id:NA