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
This commit is contained in:
linjiaxin 2021-07-30 06:37:04 +00:00 committed by Lin Jiaxin
parent fcaccbb840
commit 625176f910
2 changed files with 17 additions and 1 deletions

View File

@ -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 <linjiaxin5@huawei.com> - 4.2-2
- Fix failure caused by GCC upgrade to 10
* Sun Mar 29 2020 Wei Xiong <myeuler@163.com>
- Package init

11
gcc-10.patch Normal file
View File

@ -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();