1
0
forked from pool/virtualbox
virtualbox/fixes_for_gcc10.patch
Larry Finger d8ce0b3983 Accepting request 789598 from home:lwfinger:branches:Virtualization
- Fix build errors for gcc-10 (boo#1167897). File "fixes_for_gcc10.patch" is
  added.
- Convert /usr/bin/VirtualBox to use "~/.config/VirtualBox" instead "~/.vbox".
  This change was requested in boo#1167660.

OBS-URL: https://build.opensuse.org/request/show/789598
OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=543
2020-03-30 04:53:46 +00:00

46 lines
2.3 KiB
Diff

Index: VirtualBox-6.1.4/Config.kmk
===================================================================
--- VirtualBox-6.1.4.orig/Config.kmk
+++ VirtualBox-6.1.4/Config.kmk
@@ -2684,8 +2684,16 @@ else
# The reason for this hack is that the windows kmk_ash cannot deal with $((1+1)).
# Some versions of gcc (e.g. openSUSE11) return only major.minor on `gcc -dumpversion`.
# gcc-5 of openSUSE42.1 only returns the major version on `gcc -dumpversion`!
- VBOX_GCC_VERSION = $(shell ($(1) -dumpfullversion 2>/dev/null || $(1) -dumpversion) | \
- $(SED_EXT) 's|\([0-9]\)\.\{0,1\}\([0-9]\{0,1\}\)\.\{0,1\}\([0-9]\{0,1\}\).*|$$(int-add $$(int-mul 10000, \1), $$(int-mul 100, $$(firstword \2 0)), $$(firstword \3 0))|' )
+ #
+ # Check to make sure that the compiler has either -dumpfullversion or -dumpversion. gcc-10 has neither
+ RC = $(shell ($(1) -dumpfullversion 2>/dev/null || $(1) -dumpversion 2>/dev/null) ; echo $$?)
+ ifneq ($(RC),0)
+ # dump version commands not available - hardcode 10.0.1 for the moment
+ VBOX_GCC_VERSION = 100001
+ else
+ VBOX_GCC_VERSION = $(shell ($(1) -dumpfullversion 2>/dev/null || $(1) -dumpversion 2>/dev/null) | \
+ $(SED_EXT) 's|\([0-9]\)\.\{0,1\}\([0-9]\{0,1\}\)\.\{0,1\}\([0-9]\{0,1\}\).*|$$(int-add $$(int-mul 10000, \1), $$(int-mul 100, $$(firstword \2 0)), $$(firstword \3 0))|' )
+ endif
endif
# YASM macros
ifndef DONT_USE_YASM
Index: VirtualBox-6.1.4/include/iprt/formats/mach-o.h
===================================================================
--- VirtualBox-6.1.4.orig/include/iprt/formats/mach-o.h
+++ VirtualBox-6.1.4/include/iprt/formats/mach-o.h
@@ -38,7 +38,7 @@
/* cputype */
#define CPU_ARCH_MASK INT32_C(0xff000000)
#define CPU_ARCH_ABI64 INT32_C(0x01000000)
-#define CPU_TYPE_ANY INT32_C(-1)
+#define CPU_TYPE_ANY INT32_C(999)
#define CPU_TYPE_VAX INT32_C(1)
#define CPU_TYPE_MC680x0 INT32_C(6)
#define CPU_TYPE_X86 INT32_C(7)
@@ -53,7 +53,7 @@
#define CPU_TYPE_POWERPC64 (CPU_TYPE_POWERPC | CPU_ARCH_ABI64)
/* cpusubtype */
-#define CPU_SUBTYPE_MULTIPLE INT32_C(-1)
+#define CPU_SUBTYPE_MULTIPLE -1
#define CPU_SUBTYPE_LITTLE_ENDIAN INT32_C(0)
#define CPU_SUBTYPE_BIG_ENDIAN INT32_C(1)