summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2020-07-09 23:12:43 +0100
committerSergei Trofimovich <slyfox@gentoo.org>2020-07-09 23:12:43 +0100
commit321985403ccdeb8273aae67a86db2c8444baccef (patch)
tree335e686329e30500dcde7213e2d865b1593cabfc /sys-block
parentdev-python/virtualenv: keyworded 20.0.26 for ia64 (diff)
downloadgentoo-321985403ccdeb8273aae67a86db2c8444baccef.tar.gz
gentoo-321985403ccdeb8273aae67a86db2c8444baccef.tar.bz2
gentoo-321985403ccdeb8273aae67a86db2c8444baccef.zip
sys-block/libzbc: tweak for gcc-10
Reported-by: Toralf Förster Closes: https://bugs.gentoo.org/707808 Package-Manager: Portage-2.3.103, Repoman-2.3.23 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to 'sys-block')
-rw-r--r--sys-block/libzbc/files/libzbc-5.5.1-gcc-10.patch64
-rw-r--r--sys-block/libzbc/libzbc-5.5.1.ebuild1
2 files changed, 65 insertions, 0 deletions
diff --git a/sys-block/libzbc/files/libzbc-5.5.1-gcc-10.patch b/sys-block/libzbc/files/libzbc-5.5.1-gcc-10.patch
new file mode 100644
index 000000000000..78511bf521d2
--- /dev/null
+++ b/sys-block/libzbc/files/libzbc-5.5.1-gcc-10.patch
@@ -0,0 +1,64 @@
+https://github.com/hgst/libzbc/commit/1f3a63432bb5a4ca47a5839181c8f13512848b6c
+https://bugs.gentoo.org/707808
+
+From 1f3a63432bb5a4ca47a5839181c8f13512848b6c Mon Sep 17 00:00:00 2001
+From: Jan Engelhardt <jengelh@inai.de>
+Date: Mon, 16 Mar 2020 08:01:44 +0100
+Subject: [PATCH] build: avoid double definition of zbc_log_drv etc.
+
+When -fno-common is in use, what compiler writers are trying to make
+a standard, libzbc fails to build.
+
+$ make V=1
+Making all in .
+make[1]: Entering directory '~/libzbc'
+/bin/sh ./libtool --tag=CC --mode=link gcc -fPIC -fno-common -O2 -g -pthread -Wl,--version-script,./exports -release '5.8.5' -o libzbc.la -rpath /usr/lib lib/libzbc_la-zbc.lo lib/libzbc_la-zbc_block.lo lib/libzbc_la-zbc_sg.lo lib/libzbc_la-zbc_scsi.lo lib/libzbc_la-zbc_ata.lo lib/libzbc_la-zbc_fake.lo
+libtool: link: gcc -shared -fPIC -DPIC lib/.libs/libzbc_la-zbc.o lib/.libs/libzbc_la-zbc_block.o lib/.libs/libzbc_la-zbc_sg.o lib/.libs/libzbc_la-zbc_scsi.o lib/.libs/libzbc_la-zbc_ata.o lib/.libs/libzbc_la-zbc_fake.o -O2 -g -pthread -Wl,--version-script -Wl,./exports -pthread -Wl,-soname -Wl,libzbc-5.8.5.so -o .libs/libzbc-5.8.5.so
+/usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: lib/.libs/libzbc_la-zbc_block.o:~/libzbc/lib/zbc.h:269: multiple definition of `zbc_log_level'; lib/.libs/libzbc_la-zbc.o:~/libzbc/lib/zbc.h:269: first defined here
+/usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: lib/.libs/libzbc_la-zbc_block.o:~/libzbc/lib/zbc.h:195: multiple definition of `zbc_fake_drv'; lib/.libs/libzbc_la-zbc.o:~/libzbc/lib/zbc.h:195: first defined here
+
+References: https://bugzilla.suse.com/show_bug.cgi?id=1160244
+---
+ lib/zbc.h | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/lib/zbc.h b/lib/zbc.h
+index 7dec298..73d76db 100644
+--- a/lib/zbc.h
++++ b/lib/zbc.h
+@@ -177,22 +177,22 @@ static inline void zbc_set_errno(enum zbc_sk sk, enum zbc_asc_ascq asc_ascq)
+ /**
+ * Block device driver (requires kernel support).
+ */
+-struct zbc_drv zbc_block_drv;
++extern struct zbc_drv zbc_block_drv;
+
+ /**
+ * ZAC (ATA) device driver (uses SG_IO).
+ */
+-struct zbc_drv zbc_ata_drv;
++extern struct zbc_drv zbc_ata_drv;
+
+ /**
+ * ZBC (SCSI) device driver (uses SG_IO).
+ */
+-struct zbc_drv zbc_scsi_drv;
++extern struct zbc_drv zbc_scsi_drv;
+
+ /**
+ * ZBC emulation driver (file or block device).
+ */
+-struct zbc_drv zbc_fake_drv;
++extern struct zbc_drv zbc_fake_drv;
+
+ #define container_of(ptr, type, member) \
+ ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
+@@ -266,7 +266,7 @@ enum {
+ /**
+ * Library log level.
+ */
+-int zbc_log_level;
++extern int zbc_log_level;
+
+ #define zbc_print(stream,format,args...) \
+ do { \
diff --git a/sys-block/libzbc/libzbc-5.5.1.ebuild b/sys-block/libzbc/libzbc-5.5.1.ebuild
index 49ebb6a86d8e..6031d8048d7a 100644
--- a/sys-block/libzbc/libzbc-5.5.1.ebuild
+++ b/sys-block/libzbc/libzbc-5.5.1.ebuild
@@ -20,6 +20,7 @@ DEPEND="virtual/pkgconfig
PATCHES=(
"${FILESDIR}/libzbc-no-automagic-gtk-dep.patch"
+ "${FILESDIR}/${P}-gcc-10.patch"
)
src_prepare() {