fix FTBFS with gcc-10
authorAndreas Beckmann <anbe@debian.org>
Fri, 24 Jul 2020 12:23:13 +0000 (13:23 +0100)
committerAndreas Beckmann <anbe@debian.org>
Fri, 24 Jul 2020 12:23:13 +0000 (13:23 +0100)
Bug-Debian: https://bugs.debian.org/957058

gcc-10 defaults to -fno-common
see https://gcc.gnu.org/gcc-10/porting_to.html

Gbp-Pq: Name gcc-10.patch

src/bbconfig.h
src/bbsecondary.c
src/bbsecondary.h
src/switch/switching.c
src/switch/switching.h

index 13c95176c850ace33d029308a9a427de403052af..2a38d5bc537207898767ed02d0cb8ab51fb5a667 100644 (file)
@@ -103,7 +103,7 @@ enum bb_pm_method {
     PM_VGASWITCHEROO,
     PM_METHODS_COUNT /* not a method but a marker for the end */
 };
-const char *bb_pm_method_string[PM_METHODS_COUNT];
+extern const char *bb_pm_method_string[PM_METHODS_COUNT];
 
 /* String buffer size */
 #define BUFFER_SIZE 1024
index c88d91b49ced5919fef3579dda1288e11502b5af..14d5104af0a67bd0eb3f9da74be80efc40a435f9 100644 (file)
@@ -37,6 +37,9 @@
 #include "pci.h"
 #include "module.h"
 
+/* PCI Bus ID of the discrete video card */
+struct pci_bus_id *pci_bus_id_discrete;
+
 /**
  * Substitutes DRIVER in the passed path
  * @param x_conf_file A path to be processed
index ba6e8843953f306b4149d5c78a08fad50898ff41..7b5628e03420562a3668d87469c4a7a6092cbecd 100644 (file)
@@ -21,7 +21,7 @@
 #pragma once
 
 /* PCI Bus ID of the discrete video card */
-struct pci_bus_id *pci_bus_id_discrete;
+extern struct pci_bus_id *pci_bus_id_discrete;
 
 /// Start the X server by fork-exec, turn card on if needed.
 bool start_secondary(bool);
index 7ed716e1cc4cda782f22ffd6d7540bd9b557c5db..48721224d971c5a5247e4a6148e209ce5bdabba0 100644 (file)
@@ -31,6 +31,8 @@ struct switching_method switching_methods[SWITCHERS_COUNT] = {
           switcheroo_on, switcheroo_off}
 };
 
+struct switching_method *switcher = NULL;
+
 /**
  * Enumerates through available switching methods and try a method
  * 
index e0a54bce48ade9b4f647355e8846445f0364ec97..4e7b03ad673db86250e320543c6ea67a622658a0 100644 (file)
@@ -60,10 +60,10 @@ void switcheroo_off(void);
 
 /* number of switchers as defined in switching.c */
 #define SWITCHERS_COUNT 2
-struct switching_method switching_methods[SWITCHERS_COUNT];
+extern struct switching_method switching_methods[SWITCHERS_COUNT];
 
 /* A switching method that can be used or NULL if none */
-struct switching_method *switcher;
+extern struct switching_method *switcher;
 
 struct switching_method *switcher_detect(const char *name, struct switch_info);
 enum switch_state switch_status(void);