From d4656e1edf78b77f904e259c3e1f3d39c262fb4e Mon Sep 17 00:00:00 2001 From: weidong Date: Tue, 3 Aug 2021 15:59:34 +0800 Subject: [PATCH] Fix link failuer with gcc-10 --- partclone-0.3.12-gcc10.patch | 56 ++++++++++++++++++++++++++++++++++++ partclone.spec | 11 +++++-- 2 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 partclone-0.3.12-gcc10.patch diff --git a/partclone-0.3.12-gcc10.patch b/partclone-0.3.12-gcc10.patch new file mode 100644 index 0000000..fbc2790 --- /dev/null +++ b/partclone-0.3.12-gcc10.patch @@ -0,0 +1,56 @@ +From 7638e1937083f6da076e5c469c14acc32f65ba49 Mon Sep 17 00:00:00 2001 +From: Robert Scheck +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 + 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; diff --git a/partclone.spec b/partclone.spec index 88c44f8..ff0883c 100644 --- a/partclone.spec +++ b/partclone.spec @@ -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 - 0.3.12-3 +- Fix link failuer with gcc-10 + * Fri Nov 6 2020 weidong - 0.3.12-2 - Modify buildrequires