VirtualBox

Changeset 83033 in vbox for trunk/src/VBox/Installer/darwin


Ignore:
Timestamp:
Feb 10, 2020 1:40:54 PM (5 years ago)
Author:
vboxsync
Message:

/Config.kmk,/Makefile.kmk,Installer/darwin,FE/QT,SUPHard: Eliminated the symlinks under Resources/VirtualBoxVM.app to avoid confusing codesign and notarization. bugref:9466
Note! Best to do a clean build on mac (or at a minimum rm -Rf out/darwin.amd64/*/dist/VirtualBox.app/Contents/Frameworks/ out/darwin.amd64/*/dist/VirtualBox.app/Contents/plugins/).

  • SUPHard: Added new location SUPSECMAIN_FLAGS_LOC_OSX_HLP_APP (darwin only) for indicating a helper application and that hardened dylib and the rest of VirtualBox isn't in the executable directory.
  • SUPHard: Added a corresponding internal path ID kSupID_AppMacHelper (darwin only) for finding VirtualBoxVM for verification now that it is no longer in the main app binary directory.
  • /Config.kmk: Run install_name_tool after linking Qt binaries on darwin fix the Qt import paths (@executable_path/../Frameworks/ doesn't work for VirtualBoxVM any more).
  • /Makefile.kmk: Run install_name_tool during installation of Qt frameworks and plugins to use @rpath in non-hardened builds and the absolute paths in hardened ones (latter done by Installer/darwin/Makefile.kmk previously).
  • FE/Qt,Installer/darwin: Adjustments and path hacks.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/darwin/Makefile.kmk

    r82996 r83033  
    361361
    362362VBOX_DI_VBAPP_PROGS_HARDENED = \
    363         MacOS/VirtualBoxVM \
     363        Resources/VirtualBoxVM.app/Contents/MacOS/VirtualBoxVM \
    364364        MacOS/VBoxHeadless \
    365365        MacOS/VBoxNetDHCP \
     
    414414endif
    415415ifdef VBOX_WITH_HARDENING
    416  VBOX_DI_VBAPP_DYLIBS += $(addsuffix .dylib,$(VBOX_DI_VBAPP_PROGS_HARDENED))
     416 VBOX_DI_VBAPP_DYLIBS += $(addprefix MacOS/,$(addsuffix .dylib,$(notdir $(VBOX_DI_VBAPP_PROGS_HARDENED))))
    417417endif
    418418ifdef VBOX_WITH_HDDPARALLELS_INSTALL
     
    522522
    523523VBOX_DI_VBAPP_SYMLINKS = \
    524         Resources/VirtualBoxVM.app/Contents/MacOS=>../../../MacOS/ \
    525         Resources/VirtualBoxVM.app/Contents/plugins=>../../../plugins/ \
    526         Resources/VirtualBoxVM.app/Contents/Frameworks=>../../../Frameworks/ \
    527524        Resources/vmstarter.app/Contents/MacOS=>../../../MacOS/ \
    528525        $(foreach qtmod, $(VBOX_QT_MOD_NAMES) \
     
    684681        $(foreach prog, $(VBOX_DI_VBAPP_PROGS) $(VBOX_DI_VBAPP_PROGS_HARDENED) \
    685682                ,$(INSTALL) -m 0755 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(prog)           $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(prog)$(NLTAB))
    686 #ifdef VBOX_WITH_HARDENING - disabled temporarily
    687 if 1
    688         @# We cannot use @executable_path together with setuid binaries, dyld gets upset about it. So, fix Qt libs and users.
    689         $(foreach qtmod, $(VBOX_QT_MOD_NAMES) \
    690                 ,install_name_tool -id /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/$(VBOX_QT_VERSION_MAJOR)/$(qtmod) \
    691                         $(VBOX_PATH_VBOX_APP_TMP)/Contents/Frameworks/$(qtmod).framework/Versions/$(VBOX_QT_VERSION_MAJOR)/$(qtmod)$(NLTAB) )
    692         $(foreach f, \
    693                 $(VBOX_DI_VBAPP_DYLIBS) \
    694                 $(VBOX_DI_VBAPP_DYLIBS.$(KBUILD_TARGET_ARCH)) \
    695                 $(VBOX_DI_VBAPP_PROGS) \
    696                 $(VBOX_DI_VBAPP_PROGS_HARDENED) \
    697                 ,install_name_tool \
    698                         $(foreach qtmod, $(VBOX_QT_MOD_NAMES), \
    699                                 -change           @executable_path/../Frameworks/$(qtmod).framework/Versions/$(VBOX_QT_VERSION_MAJOR)/$(qtmod) \
    700                                 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/$(VBOX_QT_VERSION_MAJOR)/$(qtmod) \
    701                                 -change               $(VBOX_PATH_QT)/Frameworks/$(qtmod).framework/Versions/$(VBOX_QT_VERSION_MAJOR)/$(qtmod) \
    702                                 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/$(VBOX_QT_VERSION_MAJOR)/$(qtmod) \
    703                                 -change                           $(PATH_SDK_QT)/$(qtmod).framework/Versions/$(VBOX_QT_VERSION_MAJOR)/$(qtmod) \
    704                                 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/$(VBOX_QT_VERSION_MAJOR)/$(qtmod) \
    705                                 -change                                          $(qtmod).framework/Versions/$(VBOX_QT_VERSION_MAJOR)/$(qtmod) \
    706                                 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/$(VBOX_QT_VERSION_MAJOR)/$(qtmod) \
    707                                 ) \
    708                         $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(f)$(NLTAB) )
    709 endif
    710683ifdef VBOX_UNATTENDED_TEMPLATES
    711684# Unattended installation template scripts.
     
    780753        sudo chmod u+s $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/VBoxNetAdpCtl
    781754ifdef VBOX_WITH_HARDENING
    782         sudo chmod u+s \
    783                 $(foreach bin,VBoxHeadless VirtualBoxVM VBoxNetDHCP VBoxNetNAT,\
    784                         $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/$(bin))
     755        sudo chmod u+s $(foreach bin,$(VBOX_DI_VBAPP_PROGS_HARDENED),$(VBOX_PATH_VBOX_APP_TMP)/Contents/$(bin))
     756endif
     757if 0 # Handy for testing the app bundle w/o having to reinstall all the time (just untar it into -C /Applications/)
     758        $(RM) -f -- "$(PATH_OUT)/VirtualBox.app.tar.gz"
     759        tar -czf "$(PATH_OUT)/VirtualBox.app.tar.gz" -C "$(VBOX_PATH_VBOX_APP_TMP)/.." VirtualBox.app
    785760endif
    786761        @# Do keyword replacement in the package info and description files.
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette