From 625176f910ea4ba578fed0950f62ef2cb15ae4f7 Mon Sep 17 00:00:00 2001 From: linjiaxin Date: Fri, 30 Jul 2021 06:37:04 +0000 Subject: [PATCH] fix build error due to gcc 10 error: /usr/bin/ld: fping-socket4.o:/home/abuild/rpmbuild/BUILD/fping-4.2/src/fping.h:14: multiple definition of `random_data_flag'; fping-fping.o:/home/abuild/rpmbuild/BUILD/fping-4.2/src/fping.h:14: first defined here --- fping.spec | 7 ++++++- gcc-10.patch | 11 +++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 gcc-10.patch diff --git a/fping.spec b/fping.spec index 768eed4..fe7dac4 100644 --- a/fping.spec +++ b/fping.spec @@ -2,11 +2,12 @@ Name: fping Version: 4.2 -Release: 1 +Release: 2 Summary: fping is a program to send ICMP echo probes to network hosts License: BSD like URL: http://www.fping.org/ Source0: http://www.fping.org/dist/%{name}-%{version}.tar.gz +Patch0: gcc-10.patch BuildRequires: gcc @@ -15,6 +16,7 @@ fping is a program to send ICMP echo probes to network hosts, similar to ping, b %prep %setup -q -n %{name}-%{version}/ +%patch0 -p1 %build %configure @@ -37,6 +39,9 @@ fping is a program to send ICMP echo probes to network hosts, similar to ping, b %{_mandir}/* %changelog +* Fri Jul 30 2021 linjiaxin5 - 4.2-2 +- Fix failure caused by GCC upgrade to 10 + * Sun Mar 29 2020 Wei Xiong - Package init diff --git a/gcc-10.patch b/gcc-10.patch new file mode 100644 index 0000000..4f49a4d --- /dev/null +++ b/gcc-10.patch @@ -0,0 +1,11 @@ +--- a/src/fping.h 2021-08-03 15:44:55.282990658 +0800 ++++ b/src/fping.h 2021-08-03 15:45:15.519338280 +0800 +@@ -11,7 +11,7 @@ + void crash_and_burn( char *message ); + void errno_crash_and_burn( char *message ); + int in_cksum( unsigned short *p, int n ); +-int random_data_flag; ++extern int random_data_flag; + + /* socket.c */ + int open_ping_socket_ipv4();