commit 6a8c9a761896033ac0982666642b6a06013c7b94
Author: Leigh Scott <leigh123linux(a)gmail.com>
Date: Thu Jan 30 17:45:58 2020 +0000
Add gcc-10 build fix
gcc-10.patch | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++
nvidia-settings.spec | 9 +++++++--
2 files changed, 61 insertions(+), 2 deletions(-)
---
diff --git a/gcc-10.patch b/gcc-10.patch
new file mode 100644
index 0000000..26c5548
--- /dev/null
+++ b/gcc-10.patch
@@ -0,0 +1,54 @@
+From 292dcc6c02e615e73791f67cdf76b5d191657822 Mon Sep 17 00:00:00 2001
+From: Jeroen Roovers <jer(a)gentoo.org>
+Date: Mon, 27 Jan 2020 20:49:20 +0100
+Subject: [PATCH] ctkvdpau: Fix CFLAGS=-fno-common
+
+GCC 10 will enable -fno-common by default[0], which causes the linker to
+fail like this [1], even for older GCC versions for which it is
+explicitly enabled:
+
+```
+/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld:
+./gtk3/ctkvdpau.o:/home/jer/portage/x11-drivers/nvidia-drivers-440.44-r1/work/nvidia-settings-440.44/src/gtk+-2.x/ctkvdpau.h:70:
+multiple definition of `VDPAUDeviceFunctions';
+./gtk3/ctkwindow.o:/home/jer/portage/x11-drivers/nvidia-drivers-440.44-r1/work/nvidia-settings-440.44/src/gtk+-2.x/ctkvdpau.h:70:
+first defined here
+
+```
+
+Fix this by declaring VDPAUDeviceFunctions as extern and by defining it
+explicitly.
+
+[0]
https://gcc.gnu.org/gcc-10/porting_to.html#common
+[1]
https://bugs.gentoo.org/706742
+---
+ src/gtk+-2.x/ctkvdpau.c | 2 ++
+ src/gtk+-2.x/ctkvdpau.h | 2 +-
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/gtk+-2.x/ctkvdpau.c b/src/gtk+-2.x/ctkvdpau.c
+index 2f120f0..315243f 100644
+--- a/src/gtk+-2.x/ctkvdpau.c
++++ b/src/gtk+-2.x/ctkvdpau.c
+@@ -103,6 +103,8 @@ const gchar* __video_mixer_parameter_help =
+ const gchar* __video_mixer_attribute_help =
+ "This shows the video mixer attributes and any applicable ranges.";
+
++struct VDPAUDeviceImpl VDPAUDeviceFunctions;
++
+ static int queryOutputSurface(CtkVDPAU *ctk_vdpau, VdpDevice device,
+ VdpGetProcAddress *getProcAddress);
+
+diff --git a/src/gtk+-2.x/ctkvdpau.h b/src/gtk+-2.x/ctkvdpau.h
+index ec58d36..ffff839 100644
+--- a/src/gtk+-2.x/ctkvdpau.h
++++ b/src/gtk+-2.x/ctkvdpau.h
+@@ -46,7 +46,7 @@ G_BEGIN_DECLS
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), CTK_TYPE_VDPAU, CtkVDPAUClass))
+
+
+-struct VDPAUDeviceImpl {
++extern struct VDPAUDeviceImpl {
+
+ VdpGetErrorString *GetErrorString;
+ VdpGetProcAddress *GetProcAddress;
diff --git a/nvidia-settings.spec b/nvidia-settings.spec
index 745b01a..688122c 100644
--- a/nvidia-settings.spec
+++ b/nvidia-settings.spec
@@ -1,7 +1,7 @@
Name: nvidia-settings
Epoch: 3
Version: 440.44
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Configure the NVIDIA graphics driver
License: GPLv2+
@@ -9,6 +9,8 @@ URL:
https://download.nvidia.com/XFree86/nvidia-settings/
Source0: %{url}/nvidia-settings-%{version}.tar.bz2
Source1: %{name}-user.desktop
Source2: %{name}.appdata.xml
+#
https://github.com/NVIDIA/nvidia-settings/pull/47
+Patch0: gcc-10.patch
ExclusiveArch: x86_64
@@ -42,7 +44,7 @@ nvidia-settings is compatible with driver %{version}.
%prep
-%setup -q
+%autosetup -p1
# We are building from source
rm -rf src/libXNVCtrl/libXNVCtrl.a
@@ -122,6 +124,9 @@ appstream-util validate-relax --nonet
%{buildroot}%{_datadir}/appdata/%{name}.ap
%changelog
+* Thu Jan 30 2020 Leigh Scott <leigh123linux(a)gmail.com> - 3:440.44-2
+- Add gcc-10 build fix
+
* Wed Dec 11 2019 Leigh Scott <leigh123linux(a)googlemail.com> - 3:440.44-1
- Update to 440.44 release