commit 00133fd99697ed571d97e93f333467e4b6b585e8
Author: Leigh Scott <leigh123linux(a)gmail.com>
Date: Wed Feb 5 18:02:36 2020 +0000
patch for gcc-10
gcc-10.patch | 54 ++++++++++++++++++++++++++++++++++++++++++++++
nvidia-settings-390xx.spec | 4 +++-
2 files changed, 57 insertions(+), 1 deletion(-)
---
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-390xx.spec b/nvidia-settings-390xx.spec
index 8dd0d9d..9689b3f 100644
--- a/nvidia-settings-390xx.spec
+++ b/nvidia-settings-390xx.spec
@@ -8,6 +8,8 @@ URL:
https://download.nvidia.com/XFree86/nvidia-settings/
Source0: %{url}/nvidia-settings-%{version}.tar.bz2
Source1: nvidia-settings-user.desktop
Source2: nvidia-settings.appdata.xml
+#
https://github.com/NVIDIA/nvidia-settings/pull/47
+Patch0: gcc-10.patch
ExclusiveArch: i686 x86_64 armv7hl
@@ -43,7 +45,7 @@ nvidia-settings is compatible with driver %{version}.
%prep
-%autosetup -n nvidia-settings-%{version}
+%autosetup -p1 -n nvidia-settings-%{version}
# We are building from source
rm -rf src/libXNVCtrl/libXNVCtrl.a