From ab1cd370a670d98cffb357be1ec79c59f5538add Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Thu, 6 Aug 2020 18:36:55 +0100 Subject: [PATCH] Fix configure check for symbol versioning with GCC 10 (rhbz #1862745) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel P. Berrangé --- ...-configure-fix-symver-support-checks.patch | 66 +++++++++++++++++++ libgphoto2.spec | 12 +++- 2 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 0001-configure-fix-symver-support-checks.patch diff --git a/0001-configure-fix-symver-support-checks.patch b/0001-configure-fix-symver-support-checks.patch new file mode 100644 index 0000000..7455d53 --- /dev/null +++ b/0001-configure-fix-symver-support-checks.patch @@ -0,0 +1,66 @@ +From be61c7fd7d60f57dcc07e6a7c5d3d49938546b61 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ferenc=20W=C3=A1gner?= +Date: Sat, 18 Jul 2020 12:35:30 +0200 +Subject: [PATCH] configure: fix symver support checks + +The versioned test symbols must be external, so move them into the +prologue, otherwise GCC 9.3 (at least) reports "Error: invalid attempt +to declare external version name as default in symbol `f@@VER2'". +Also suppress warnings about missing prototypes and return +statements for these test functions. +--- + configure.ac | 11 ++++++----- + libgphoto2_port/configure.ac | 11 ++++++----- + 2 files changed, 12 insertions(+), 10 deletions(-) + +diff --git a/configure.ac b/configure.ac +index f73c81d88..51d1e18b3 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -259,13 +259,14 @@ AC_SYS_LARGEFILE + + AC_MSG_CHECKING([for asm .symver support]) + AC_COMPILE_IFELSE([dnl +- AC_LANG_PROGRAM([[]],[[ +- int f1() { } +- int f2() { } ++ AC_LANG_PROGRAM([[ ++ void f1(void); ++ void f1() {} ++ void f2(void); ++ void f2() {} + asm(".symver f1, f@VER1"); + asm(".symver f2, f@@VER2"); +- int main(int argc, char **argv) { } +- ]])dnl ++ ]],[])dnl + ],[ + AC_DEFINE([HAVE_ASM_SYMVERS],1,[Define if there is asm .symver support.]) + VERSIONMAPLDFLAGS="-Wl,--version-script=\$(srcdir)/libgphoto2.ver" +diff --git a/libgphoto2_port/configure.ac b/libgphoto2_port/configure.ac +index 6af8bd914..a8546aa36 100644 +--- a/libgphoto2_port/configure.ac ++++ b/libgphoto2_port/configure.ac +@@ -165,13 +165,14 @@ AC_CHECK_LIB([regex],[regexec]) + + AC_MSG_CHECKING([for asm .symver support]) + AC_COMPILE_IFELSE([dnl +- AC_LANG_PROGRAM([[]],[[ +- int f1() { } +- int f2() { } ++ AC_LANG_PROGRAM([[ ++ void f1(void); ++ void f1() {} ++ void f2(void); ++ void f2() {} + asm(".symver f1, f@VER1"); + asm(".symver f2, f@@VER2"); +- int main(int argc, char **argv) { } +- ]])dnl ++ ]],[])dnl + ],[ + AC_DEFINE([HAVE_ASM_SYMVERS],1,[Define if there is asm .symver support.]) + VERSIONMAPLDFLAGS="-Wl,--version-script=\$(srcdir)/libgphoto2_port.ver" +-- +2.26.2 + diff --git a/libgphoto2.spec b/libgphoto2.spec index aa1a5cf..48f5094 100644 --- a/libgphoto2.spec +++ b/libgphoto2.spec @@ -5,7 +5,7 @@ Name: libgphoto2 Version: 2.5.24 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Library for accessing digital cameras # GPLV2+ for the main lib (due to exif.c) and most plugins, some plugins GPLv2 License: GPLv2+ and GPLv2 @@ -14,6 +14,7 @@ URL: http://www.gphoto.org/ Source0: http://downloads.sourceforge.net/gphoto/%{name}-%{version}.tar.bz2 Patch1: gphoto2-pkgcfg.patch Patch2: gphoto2-device-return.patch +Patch3: 0001-configure-fix-symver-support-checks.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -37,6 +38,9 @@ BuildRequires: pkgconfig(libusb-1.0) Requires: lockdev # ----------------------------------- +# Temporarily required for patch3 +BuildRequires: autoconf automake libtool gettext-devel + %description libgphoto2 is a library that can be used by applications to access various digital cameras. libgphoto2 itself is not a GUI application, @@ -65,6 +69,9 @@ for f in AUTHORS ChangeLog COPYING libgphoto2_port/AUTHORS libgphoto2_port/COPYI done %build +# Temporarily required for patch3 +autoreconf -if + %configure \ udevscriptdir='%{udevdir}' \ --with-drivers=all \ @@ -145,6 +152,9 @@ rm -rf %{buildroot}%{_datadir}/libgphoto2_port/*/vcamera/ %{_mandir}/man3/%{name}_port.3* %changelog +* Thu Aug 6 2020 Daniel P. Berrangé - 2.5.24-4 +- Fix configure check for symbol versioning with GCC 10 (rhbz #1862745) + * Tue Jul 28 2020 Fedora Release Engineering - 2.5.24-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild