0001-fix-build-with-gcc-10.patch 2.5 KB

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