!9 Fix link failuer with gcc-10

From: @weidongkl
Reviewed-by: @ruebb
Signed-off-by: @ruebb
This commit is contained in:
openeuler-ci-bot 2021-08-16 11:13:01 +00:00 committed by Gitee
commit 665b010d3d
2 changed files with 65 additions and 2 deletions

View File

@ -0,0 +1,56 @@
From 7638e1937083f6da076e5c469c14acc32f65ba49 Mon Sep 17 00:00:00 2001
From: Robert Scheck <robert@fedoraproject.org>
Date: Sun, 2 Feb 2020 23:13:06 +0100
Subject: [PATCH] Declare variables as extern in headers (fixes #136)
GCC 10 compatibility as per https://gcc.gnu.org/gcc-10/porting_to.html
See also:
- https://github.com/Thomas-Tsai/partclone/issues/136
- https://github.com/Thomas-Tsai/partclone/pull/137
---
src/partclone.c | 1 +
src/partclone.h | 4 ++--
src/xfsclone.c | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/partclone.c b/src/partclone.c
index 98365043..e264cbb1 100644
--- a/src/partclone.c
+++ b/src/partclone.c
@@ -55,6 +55,7 @@
FILE* msg = NULL;
+unsigned long long rescue_write_size;
#ifdef HAVE_LIBNCURSESW
#include <ncurses.h>
WINDOW *log_win;
diff --git a/src/partclone.h b/src/partclone.h
index 5188e290..3dc2ef1b 100644
--- a/src/partclone.h
+++ b/src/partclone.h
@@ -80,8 +80,8 @@ const char* get_exec_name();
#undef crc32
#endif
-char *EXECNAME;
-unsigned long long rescue_write_size;
+extern char *EXECNAME;
+extern unsigned long long rescue_write_size;
/**
* option
diff --git a/src/xfsclone.c b/src/xfsclone.c
index 522431ab..6f807e90 100644
--- a/src/xfsclone.c
+++ b/src/xfsclone.c
@@ -24,7 +24,7 @@
#undef crc32
int source_fd = -1;
int first_residue;
-progress_bar prog;
+extern progress_bar prog;
unsigned long long checked;
unsigned long long total_block;
int bitmap_done = 0;

View File

@ -4,7 +4,7 @@
Summary: Utility to clone and restore a partition
Name: partclone
Version: 0.3.12
Release: 2
Release: 3
# Partclone itself is GPLv2+ but uses other source codes, breakdown:
# GPLv3+: fail-mbr/fail-mbr.S
# GPLv2 and GPLv2+: src/btrfs*
@ -17,6 +17,7 @@ Release: 2
License: GPL+ and GPLv2 and GPLv2+ and GPLv3+ and LGPLv2 and LGPLv2+
URL: http://partclone.org/
Source0: https://github.com/Thomas-Tsai/partclone/archive/%{version}/%{name}-%{version}.tar.gz
Patch0: partclone-0.3.12-gcc10.patch
BuildRequires: gcc
BuildRequires: libuuid-devel
BuildRequires: fuse-devel
@ -41,7 +42,7 @@ and is designed for higher compatibility of the file system by using existing
libraries, e.g. e2fslibs is used to read and write the ext2 partition.
%prep
%setup -q
%autosetup -p1
autoreconf -i -f
%build
@ -66,6 +67,9 @@ autoreconf -i -f
--enable-minix \
--enable-ncursesw \
--enable-fs-test
# https://forum.slitaz.org/topic/parclone-needs-to-be-rebuilded
sed -i 's|exit 1|exit 0|' fail-mbr/compile-mbr.sh
%make_build
%install
@ -115,6 +119,9 @@ make check || (cat tests/test-suite.log; exit 1)
%{_mandir}/man8/%{name}*.8*
%changelog
* Tue Aug 3 2021 weidong <weidong@uniontech.com> - 0.3.12-3
- Fix link failuer with gcc-10
* Fri Nov 6 2020 weidong <weidong@uniontech.com> - 0.3.12-2
- Modify buildrequires