From 385704a028fd942d3ea5cee99e23b2dff6c3f8ba Mon Sep 17 00:00:00 2001 From: songmingliang Date: Fri, 22 Apr 2022 18:25:41 +0800 Subject: [PATCH] use extern in header files when declaring global variables --- ...rasdaemon-avoid-multiple-definitions.patch | 24 +++++++++++++++++++ rasdaemon.spec | 13 +++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 1001-rasdaemon-avoid-multiple-definitions.patch diff --git a/1001-rasdaemon-avoid-multiple-definitions.patch b/1001-rasdaemon-avoid-multiple-definitions.patch new file mode 100644 index 0000000..109587b --- /dev/null +++ b/1001-rasdaemon-avoid-multiple-definitions.patch @@ -0,0 +1,24 @@ +commit fd982af0a307edc5d3e56011d2e045015b1efd4b +Author: Mauro Carvalho Chehab +Date: Mon Mar 30 01:22:24 2020 +0200 + + ras-record.h: define an external var as such + + Otherwise, newer versions of gcc will produce multiple symbols, + causing link breakages. + + Signed-off-by: Mauro Carvalho Chehab + +diff --git a/ras-record.h b/ras-record.h +index 5311c67caf44..0d2a481c23dd 100644 +--- a/ras-record.h ++++ b/ras-record.h +@@ -25,7 +25,7 @@ + + extern long user_hz; + +-struct ras_events *ras; ++extern struct ras_events *ras; + + struct ras_mc_event { + char timestamp[64]; diff --git a/rasdaemon.spec b/rasdaemon.spec index d4cf19d..49f41b9 100644 --- a/rasdaemon.spec +++ b/rasdaemon.spec @@ -1,6 +1,7 @@ +%define anolis_release .0.1 Name: rasdaemon Version: 0.6.1 -Release: 12%{?dist} +Release: 12%{anolis_release}%{?dist} Summary: Utility to receive RAS error tracings Group: Applications/System License: GPLv2 @@ -45,6 +46,11 @@ Patch18: b497a3d6a39d402c41065e9284d49114b97e3bfe.patch Patch19: ce6e7864f11f709c4f803828fbc8e507d115d03b.patch Patch20: a8c776ed94f68ae31d7b5f74e19545698898c13c.patch +# Begin: Anolis customized patches +# Backport from fc32 to fix FTBFS on gcc10 +Patch1001: 1001-rasdaemon-avoid-multiple-definitions.patch +# End: Anolis customized patches + %description %{name} is a RAS (Reliability, Availability and Serviceability) logging tool. It currently records memory errors, using the EDAC tracing events. @@ -78,6 +84,8 @@ an utility for reporting current error counts from the EDAC sysfs files. %patch19 -p1 %patch20 -p1 +%patch1001 -p1 + # The tarball is locked in time the first time aclocal was ran and will keep # requiring an older version of automake autoreconf -vfi @@ -107,6 +115,9 @@ rm INSTALL %{buildroot}/usr/include/*.h %{_sysconfdir}/ras/dimm_labels.d %changelog +* Fri Apr 22 2022 Weitao Zhou - 0.6.1-12.0.1 +- use extern in header files when declaring global variables for compatible gcc10 build + * Tue Oct 12 2021 Aristeu Rozanski 0.6.1-12 - Adding missing bits from b497a3d6a39d402c41065e9284d49114b97e3bfe [1923254] -- Gitee