1From 8458abb357cd981f55d730ec2d74459a3042e571 Mon Sep 17 00:00:00 2001 2From: Fabrice Fontaine <fontaine.fabrice@gmail.com> 3Date: Tue, 6 Oct 2020 21:52:20 +0200 4Subject: [PATCH] fix build with gcc 10 5 6Define variables in header files as extern to avoid the following build failure 7with gcc 10 (which defaults to -fno-common): 8 9/home/giuliobenetti/autobuild/run/instance-3/output-1/host/bin/arm-buildroot-linux-gnueabihf-ld: 10/home/giuliobenetti/autobuild/run/instance-3/output-1/build/xvisor-0.3.0/build/drivers/mmc/core/mmc.o:/home/giuliobenetti/autobuild/run/instance-3/output-1/build/xvisor-0.3.0/drivers/mmc/core/core.h:67: 11multiple definition of `sdio_func_type'; 12/home/giuliobenetti/autobuild/run/instance-3/output-1/build/xvisor-0.3.0/build/drivers/mmc/core/core.o:/home/giuliobenetti/autobuild/run/instance-3/output-1/build/xvisor-0.3.0/drivers/mmc/core/core.h:67: 13first defined here 14 15Fixes: 16 - http://autobuild.buildroot.org/results/b6070c0721b33824e71833ce53423979980aa598 17 18Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> 19[Upstream status: https://github.com/xvisor/xvisor/pull/125] 20--- 21 drivers/mmc/core/core.h | 2 +- 22 emulators/display/drawfn.h | 10 +++++----- 23 2 files changed, 6 insertions(+), 6 deletions(-) 24 25diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h 26index d75d135a..e2ca3141 100644 27--- a/drivers/mmc/core/core.h 28+++ b/drivers/mmc/core/core.h 29@@ -64,7 +64,7 @@ int mmc_go_idle(struct mmc_host *host); 30 * Note: Must be called with host->lock held. 31 */ 32 extern struct vmm_bus sdio_bus_type; 33-struct vmm_device_type sdio_func_type; 34+extern struct vmm_device_type sdio_func_type; 35 36 int __sdio_attach(struct mmc_host *host); 37 38diff --git a/emulators/display/drawfn.h b/emulators/display/drawfn.h 39index f9163cff..385deaf6 100644 40--- a/emulators/display/drawfn.h 41+++ b/emulators/display/drawfn.h 42@@ -69,14 +69,14 @@ typedef void (*drawfn)(struct vmm_surface *, 43 DRAWFN_ORDER_MAX * \ 44 DRAWFN_FORMAT_MAX) 45 46-drawfn drawfn_surface_fntable_8[DRAWFN_FNTABLE_SIZE]; 47+extern drawfn drawfn_surface_fntable_8[DRAWFN_FNTABLE_SIZE]; 48 49-drawfn drawfn_surface_fntable_15[DRAWFN_FNTABLE_SIZE]; 50+extern drawfn drawfn_surface_fntable_15[DRAWFN_FNTABLE_SIZE]; 51 52-drawfn drawfn_surface_fntable_16[DRAWFN_FNTABLE_SIZE]; 53+extern drawfn drawfn_surface_fntable_16[DRAWFN_FNTABLE_SIZE]; 54 55-drawfn drawfn_surface_fntable_24[DRAWFN_FNTABLE_SIZE]; 56+extern drawfn drawfn_surface_fntable_24[DRAWFN_FNTABLE_SIZE]; 57 58-drawfn drawfn_surface_fntable_32[DRAWFN_FNTABLE_SIZE]; 59+extern drawfn drawfn_surface_fntable_32[DRAWFN_FNTABLE_SIZE]; 60 61 #endif 62-- 632.28.0 64 65