From 243616fc78d34336523fa814655dff5937aeac4c484d131529dd78e9af786caa Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Fri, 27 Mar 2020 15:29:58 +0000 Subject: [PATCH 1/2] Accepting request 789067 from home:alarrosa:branches:Virtualization - Add patch to fix missing include with Qt 5.15: * fix-missing-includes-with-qt-5.15.patch OBS-URL: https://build.opensuse.org/request/show/789067 OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=542 --- fix-missing-includes-with-qt-5.15.patch | 68 +++++++++++++++++++++++++ virtualbox.changes | 6 +++ virtualbox.spec | 3 ++ 3 files changed, 77 insertions(+) create mode 100644 fix-missing-includes-with-qt-5.15.patch diff --git a/fix-missing-includes-with-qt-5.15.patch b/fix-missing-includes-with-qt-5.15.patch new file mode 100644 index 0000000..138930c --- /dev/null +++ b/fix-missing-includes-with-qt-5.15.patch @@ -0,0 +1,68 @@ +Index: VirtualBox-6.1.4/src/VBox/Frontends/VirtualBox/src/globals/UIImageTools.cpp +=================================================================== +--- VirtualBox-6.1.4.orig/src/VBox/Frontends/VirtualBox/src/globals/UIImageTools.cpp ++++ VirtualBox-6.1.4/src/VBox/Frontends/VirtualBox/src/globals/UIImageTools.cpp +@@ -17,6 +17,7 @@ + + /* Qt includes: */ + #include ++#include + + /* GUI include */ + #include "UIImageTools.h" +Index: VirtualBox-6.1.4/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupBox.cpp +=================================================================== +--- VirtualBox-6.1.4.orig/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupBox.cpp ++++ VirtualBox-6.1.4/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupBox.cpp +@@ -19,6 +19,7 @@ + #include + #include + #include ++#include + #include + #include + #include +Index: VirtualBox-6.1.4/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupBox.h +=================================================================== +--- VirtualBox-6.1.4.orig/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupBox.h ++++ VirtualBox-6.1.4/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupBox.h +@@ -24,6 +24,7 @@ + /* Qt includes: */ + #include + #include ++#include + + /* GUI includes: */ + #include "UILibraryDefs.h" +@@ -34,7 +35,6 @@ class QIcon; + class QLabel; + class QMouseEvent; + class QObject; +-class QPainterPath; + class QPaintEvent; + class QResizeEvent; + class QString; +Index: VirtualBox-6.1.4/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp +=================================================================== +--- VirtualBox-6.1.4.orig/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp ++++ VirtualBox-6.1.4/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + #include + #include + #include +Index: VirtualBox-6.1.4/src/VBox/Frontends/VirtualBox/src/widgets/UIMenuToolBar.cpp +=================================================================== +--- VirtualBox-6.1.4.orig/src/VBox/Frontends/VirtualBox/src/widgets/UIMenuToolBar.cpp ++++ VirtualBox-6.1.4/src/VBox/Frontends/VirtualBox/src/widgets/UIMenuToolBar.cpp +@@ -19,6 +19,7 @@ + #include + #include + #include ++#include + #include + #include + diff --git a/virtualbox.changes b/virtualbox.changes index 07ca330..b1724ea 100644 --- a/virtualbox.changes +++ b/virtualbox.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Mar 27 09:32:21 UTC 2020 - Antonio Larrosa + +- Add patch to fix missing include with Qt 5.15: + * fix-missing-includes-with-qt-5.15.patch + ------------------------------------------------------------------- Tue Mar 24 01:51:36 UTC 2020 - Larry Finger diff --git a/virtualbox.spec b/virtualbox.spec index 9217de9..6702814 100644 --- a/virtualbox.spec +++ b/virtualbox.spec @@ -154,6 +154,8 @@ Patch134: fixes_for_5.5.patch Patch135: fixes_for_5.6.patch # Fis VBoxClient Crashes Patch136: VirtualBox-6.1.4-VBoxClient-vmsvga-x11-crash.patch +# Fix build for Qt 5.15 +Patch137: fix-missing-includes-with-qt-5.15.patch Patch999: virtualbox-fix-ui-background-color.patch # BuildRequires: LibVNCServer-devel @@ -460,6 +462,7 @@ as an "extpack" for VirtualBox. The implementation is licensed under GPL. %patch135 -p1 %endif %patch136 -p1 +%patch137 -p1 # make VB UI background colors look sane again %patch999 -p1 From d8ce0b3983a6c6f359e92fbf19bf3e1c72ac5570b8a85f3d267c2606e959d038 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Mon, 30 Mar 2020 04:53:46 +0000 Subject: [PATCH 2/2] 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 --- ...ox-6.1.4-VBoxClient-vmsvga-x11-crash.patch | 1 + fixes_for_gcc10.patch | 45 +++++++++++++++++++ vbox-fpie.diff | 18 +++++--- vbox-usb-warning.diff | 12 ++--- virtualbox-wrapper.sh | 30 +++++++------ virtualbox.changes | 8 ++++ virtualbox.spec | 3 ++ 7 files changed, 92 insertions(+), 25 deletions(-) create mode 100644 fixes_for_gcc10.patch diff --git a/VirtualBox-6.1.4-VBoxClient-vmsvga-x11-crash.patch b/VirtualBox-6.1.4-VBoxClient-vmsvga-x11-crash.patch index 4fb3e1a..bfb6a25 100644 --- a/VirtualBox-6.1.4-VBoxClient-vmsvga-x11-crash.patch +++ b/VirtualBox-6.1.4-VBoxClient-vmsvga-x11-crash.patch @@ -63,3 +63,4 @@ Index: VirtualBox-6.1.4/src/VBox/Additions/x11/VBoxClient/clipboard.cpp #ifdef VBOX_WITH_SHARED_CLIPBOARD_FUSE int rc2 = vboxClipboardFUSEStop(); + diff --git a/fixes_for_gcc10.patch b/fixes_for_gcc10.patch new file mode 100644 index 0000000..3431229 --- /dev/null +++ b/fixes_for_gcc10.patch @@ -0,0 +1,45 @@ +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) + diff --git a/vbox-fpie.diff b/vbox-fpie.diff index 1d1040c..4b6ec49 100644 --- a/vbox-fpie.diff +++ b/vbox-fpie.diff @@ -1,8 +1,16 @@ -Index: VirtualBox-5.1.4/Config.kmk +Index: VirtualBox-6.1.4/Config.kmk =================================================================== ---- VirtualBox-5.1.4.orig/Config.kmk -+++ VirtualBox-5.1.4/Config.kmk -@@ -4852,6 +4852,9 @@ TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS.darwi +--- VirtualBox-6.1.4.orig/Config.kmk ++++ VirtualBox-6.1.4/Config.kmk +@@ -2687,7 +2687,6 @@ else + 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))|' ) + endif +- + # YASM macros + ifndef DONT_USE_YASM + include $(KBUILD_PATH)/tools/YASM.kmk +@@ -5533,6 +5532,9 @@ TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS.darwi ifeq ($(KBUILD_TARGET),linux) # not necessary except USE_LIB_PCAP is defined in SUPR3HardenedMain.cpp # TEMPLATE_VBOXR3HARDENEDEXE_LIBS += cap @@ -12,7 +20,7 @@ Index: VirtualBox-5.1.4/Config.kmk endif ifeq ($(KBUILD_TARGET),win) # No CRT! TEMPLATE_VBOXR3HARDENEDEXE_SDKS = VBOX_NTDLL $(TEMPLATE_VBOXR3EXE_SDKS) -@@ -4871,8 +4874,8 @@ ifeq ($(KBUILD_TARGET),win) # No CRT! +@@ -5554,8 +5556,8 @@ ifeq ($(KBUILD_TARGET),win) # No CRT! TEMPLATE_VBOXR3HARDENEDEXE_LIBS.amd64 = $(NOT_SUCH_VARIABLE) else ifn1of ($(KBUILD_TARGET), os2 solaris) # We want to keep the RPATH on Solaris to be able to find libgcc_1/libstdc++ within $(VBOX_WITH_RUNPATH) diff --git a/vbox-usb-warning.diff b/vbox-usb-warning.diff index f598525..f33cd28 100644 --- a/vbox-usb-warning.diff +++ b/vbox-usb-warning.diff @@ -55,21 +55,21 @@ Index: VirtualBox-5.1.22/src/apps/VBoxUSB_DevRules/VBoxUSB_DevRules.cpp +#include + +int main(int argc, char *argv[]) +{ -+ QApplication app(argc, argv); -+ QMessageBox msgBox; ++ QApplication app(argc, argv); ++ QMessageBox msgBox; + QPushButton *myYesButton = msgBox.addButton("Enable", QMessageBox::YesRole); + QPushButton *myNoButton = msgBox.addButton("Disable", QMessageBox::NoRole); + msgBox.setWindowTitle(QObject::tr("USB Rules and Permissions !")); -+ msgBox.setText(QObject::tr("USB passthrough requires read/write access to USB devices. " ++ msgBox.setText(QObject::tr("USB passthrough requires read/write access to USB devices. " + "As a result, it opens a security hole.\n\n" + "Nonetheless, this feature is extremely useful and it may be worth the security risk. " + "Thus the code defaults to enabling it.\n\nIf you agree that the risk is acceptable, then click 'Enable'.\n" -+ "You will not be asked this question again when VB is updated. If you later change your mind, run 'rm ~/.vbox/*'\n\n" ++ "You should not be asked this question again when VB is updated. If you later change your mind, run 'rm ~/.config/virtualbox/*'\n\n" + "If you wish to disable USB passthrough to plug the security hole, then click 'Disable'. " + "You will be asked for the system password, and /etc/udev/rules.d/60-vboxdrv.rules will be changed.\n\n" -+ "These changes cannot be preserved through VB updates, thus this screen will be displayed again at that time.")); ++ "These changes may not be preserved through VB updates, thus this screen may be displayed again at that time.")); + msgBox.exec(); -+ app.quit(); ++ app.quit(); + if (msgBox.clickedButton() == myYesButton) + return 0; + return 1; diff --git a/virtualbox-wrapper.sh b/virtualbox-wrapper.sh index 76da593..94299ef 100644 --- a/virtualbox-wrapper.sh +++ b/virtualbox-wrapper.sh @@ -6,8 +6,8 @@ export QT_NO_KDE_INTEGRATION=1 # # Handle the issue regarding USB passthru # The following conditions apply: -# 1. If ~/.vbox/enable exists, the user accepts the security risk. -# 2. If ~/.vbox/disable exists, the user does not accept the risk. That file will contain the inode of /usr/lib/udev/rules.d/60-vboxdrv.rules. +# 1. If ~/.config/VirtualBox/enable exists, the user accepts the security risk. +# 2. If ~/.config/VirtualBox/disable exists, the user does not accept the risk. That file will contain the inode of /usr/lib/udev/rules.d/60-vboxdrv.rules. # When that changes, the VBoxUSB_DevRules will again be displayed as that means that VB has been reloaded. # devrules() @@ -15,38 +15,40 @@ devrules() /usr/lib/virtualbox/VBoxUSB_DevRules if [ $? -eq 0 ] ; then # User accepts the risk - touch ~/.vbox/enable - rm -f ~/.vbox/disable + touch ~/.config/VirtualBox/enable + rm -f ~/.config/VirtualBox/disable else # User declines the risk - save the inode - echo "" > ~/.vbox/disable - rm -f ~/.vbox/enable + echo "" > ~/.config/VirtualBox/disable + rm -f ~/.config/VirtualBox/enable fi } # Start of main routine # -# Ensure that ~/.vbox exists -mkdir -p ~/.vbox/ +# Ensure that ~/.config/VirtualBox exists +mkdir -p ~/.config/VirtualBox +# Originally, this information was in ~/.vbox. Remove any files found there +rm -rf ~/.vbox # Get the inode for /usr/lib/udev/rules.d/60-vboxdrv.rules INODE=$(stat /usr/lib/udev/rules.d/60-vboxdrv.rules | grep Inode | cut -d' ' -f3) -if [ ! -f ~/.vbox/enable ] && [ ! -f ~/.vbox/disable ] ; then +if [ ! -f ~/.config/VirtualBox/enable ] && [ ! -f ~/.config/VirtualBox/disable ] ; then # Neither file exists - find what the user wants devrules fi # Get the original Inode if it exists -if [ -f ~/.vbox/disable ] ; then - read LINE < ~/.vbox/disable +if [ -f ~/.config/VirtualBox/disable ] ; then + read LINE < ~/.config/VirtualBox/disable else LINE=" " fi # If user originally declined, make certain that /usr/lib/udev/rules.d/60-vboxdrv.rules has not been changed -if [ -f ~/.vbox/disable ] && [ "$LINE" != "$INODE" ] && [ "$LINE" != "" ] ; then +if [ -f ~/.config/VirtualBox/disable ] && [ "$LINE" != "$INODE" ] && [ "$LINE" != "" ] ; then # disable is selected and the Inode has changed - ask again devrules fi -if [ -f ~/.vbox/disable ] ; then - echo $INODE > ~/.vbox/disable +if [ -f ~/.config/VirtualBox/disable ] ; then + echo $INODE > ~/.config/VirtualBox/disable if [ "$LINE" != "$INODE" ] ; then if [ -f /usr/bin/kdesu ] ; then kdesu /sbin/vbox-fix-usb-rules.sh diff --git a/virtualbox.changes b/virtualbox.changes index b1724ea..34471cf 100644 --- a/virtualbox.changes +++ b/virtualbox.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Sun Mar 29 19:20:48 UTC 2020 - Larry Finger + +- 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. + ------------------------------------------------------------------- Fri Mar 27 09:32:21 UTC 2020 - Antonio Larrosa diff --git a/virtualbox.spec b/virtualbox.spec index 6702814..7a9d142 100644 --- a/virtualbox.spec +++ b/virtualbox.spec @@ -156,6 +156,8 @@ Patch135: fixes_for_5.6.patch Patch136: VirtualBox-6.1.4-VBoxClient-vmsvga-x11-crash.patch # Fix build for Qt 5.15 Patch137: fix-missing-includes-with-qt-5.15.patch +# Fix builds with GCC10 +Patch138: fixes_for_gcc10.patch Patch999: virtualbox-fix-ui-background-color.patch # BuildRequires: LibVNCServer-devel @@ -463,6 +465,7 @@ as an "extpack" for VirtualBox. The implementation is licensed under GPL. %endif %patch136 -p1 %patch137 -p1 +%patch138 -p1 # make VB UI background colors look sane again %patch999 -p1