VirtualBox

Changeset 105160 in vbox


Ignore:
Timestamp:
Jul 5, 2024 12:02:04 PM (5 months ago)
Author:
vboxsync
Message:

*.kmk,bldprogs/VBoxPeSetVersion: Created a unit for setting the PE version so it can more easily be controlled per target. This is helpful with the two GINA targets in the additions, since using NT 3.51 instead of NT 3.1 as minimum avoids trouble with some AV heuristics.

Location:
trunk
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/Config.kmk

    r105147 r105160  
    22002200
    22012201USES += dtrace
    2202 USES.win += vboximportchecker
     2202USES.win += vboximportchecker vboxsetpeversion
    22032203
    22042204
     
    86488648 # in the binaries are set to 5.2.  The Visual C++ 2019 linker defaults to 6.0.
    86498649 # HACK ALERT! Double expansion of $$(NLTAB).
    8650  TEMPLATE_VBoxGuestR3ExeBase_USES.win                      = $(TEMPLATE_VBoxR3StaticBase_USES.win) vboximportchecker
     8650 TEMPLATE_VBoxGuestR3ExeBase_USES.win                      = $(TEMPLATE_VBoxR3StaticBase_USES.win) vboximportchecker vboxsetpeversion
    86518651 TEMPLATE_VBoxGuestR3ExeBase_VBOX_IMPORT_CHECKER.win.x86   = nt31
    86528652 TEMPLATE_VBoxGuestR3ExeBase_VBOX_IMPORT_CHECKER.win.amd64 = xp64
    8653  TEMPLATE_VBoxGuestR3ExeBase_POST_CMDS.win.x86   = $(if $(eq $(tool_do),LINK_LIBRARY),,$(VBOX_PE_SET_VERSION) $(out)$$(NLTAB)$(TEMPLATE_$(TEMPLATE_VBoxGuestR3ExeBase_EXTENDS)_POST_CMDS))
    8654  TEMPLATE_VBoxGuestR3ExeBase_LNK_DEPS.win.x86    = $(if $(eq $(tool_do),LINK_LIBRARY),,$(VBOX_PE_SET_VERSION))
    8655  TEMPLATE_VBoxGuestR3ExeBase_POST_CMDS.win.amd64 = $(if $(eq $(tool_do),LINK_LIBRARY),,$(VBOX_PE_SET_VERSION) $(out)$$(NLTAB)$(TEMPLATE_$(TEMPLATE_VBoxGuestR3ExeBase_EXTENDS)_POST_CMDS))
    8656  TEMPLATE_VBoxGuestR3ExeBase_LNK_DEPS.win.amd64  = $(if $(eq $(tool_do),LINK_LIBRARY),,$(VBOX_PE_SET_VERSION))
     8653 TEMPLATE_VBoxGuestR3ExeBase_VBOX_SET_PE_VERSION.win.x86   = default
     8654 TEMPLATE_VBoxGuestR3ExeBase_VBOX_SET_PE_VERSION.win.amd64 = default
    86578655 ifdef VBOX_WITH_NOCRT_STATIC
    86588656  TEMPLATE_VBoxGuestR3ExeBase_LDFLAGS.win.x86   = $(TEMPLATE_$(TEMPLATE_VBoxGuestR3ExeBase_EXTENDS)_LDFLAGS.win.x86) -NoOptIData
     
    88088806TEMPLATE_VBoxGuestR3DllMinW2K_EXTENDS  = VBoxGuestR3Dll
    88098807TEMPLATE_VBoxGuestR3DllMinW2K_VBOX_IMPORT_CHECKER.win.x86 = w2k
     8808TEMPLATE_VBoxGuestR3DllMinW2K_VBOX_SET_PE_VERSION.win.x86 = w2k
    88108809ifeq ($(KBUILD_TARGET),win)
    88118810 ifdef VBOX_WITH_NOCRT_STATIC
     
    88148813  TEMPLATE_VBoxGuestR3DllMinW2K_LDFLAGS.win.x86 = $(filter-out -NoOptIData -Section:.bss$(COMMA)RW!K,$(TEMPLATE_VBoxGuestR3Dll_LDFLAGS.win.x86))
    88158814 endif
    8816  TEMPLATE_VBoxGuestR3DllMinW2K_POST_CMDS.win.x86 = $(subst $(VBOX_PE_SET_VERSION), $(VBOX_PE_SET_VERSION) --w2k,$(TEMPLATE_VBoxGuestR3Dll_POST_CMDS.win.x86))
    88178815endif
    88188816
     
    88248822TEMPLATE_VBoxGuestR3DllMinVista_VBOX_IMPORT_CHECKER.win.x86   = vista
    88258823TEMPLATE_VBoxGuestR3DllMinVista_VBOX_IMPORT_CHECKER.win.amd64 = vista
     8824TEMPLATE_VBoxGuestR3DllMinVista_VBOX_SET_PE_VERSION.win.x86   = vista
     8825TEMPLATE_VBoxGuestR3DllMinVista_VBOX_SET_PE_VERSION.win.amd64 = vista
    88268826ifeq ($(KBUILD_TARGET),win)
    88278827 ifdef VBOX_WITH_NOCRT_STATIC
     
    88308830  TEMPLATE_VBoxGuestR3DllMinVista_LDFLAGS.win.x86 = $(filter-out -NoOptIData -Section:.bss$(COMMA)RW!K,$(TEMPLATE_VBoxGuestR3Dll_LDFLAGS.win.x86))
    88318831 endif
    8832  TEMPLATE_VBoxGuestR3DllMinVista_POST_CMDS.win.x86   = $(subst $(VBOX_PE_SET_VERSION), $(VBOX_PE_SET_VERSION) --vista,$(TEMPLATE_VBoxGuestR3Dll_POST_CMDS.win.x86))
    8833  TEMPLATE_VBoxGuestR3DllMinVista_POST_CMDS.win.amd64 = $(subst $(VBOX_PE_SET_VERSION), $(VBOX_PE_SET_VERSION) --vista,$(TEMPLATE_VBoxGuestR3Dll_POST_CMDS.win.amd64))
    88348832endif
    88358833
     
    88778875TEMPLATE_NewerVccVBoxGuestR3DllMinVista = NewerVccVBoxGuestR3Dll with the newer Visual C++ version (2013 or later).
    88788876TEMPLATE_NewerVccVBoxGuestR3DllMinVista_EXTENDS := NewerVccVBoxGuestR3Dll
     8877TEMPLATE_NewerVccVBoxGuestR3DllMinVista_VBOX_SET_PE_VERSION.win.x86   := vista
     8878TEMPLATE_NewerVccVBoxGuestR3DllMinVista_VBOX_SET_PE_VERSION.win.amd64 := vista
    88798879ifeq ($(KBUILD_TARGET),win)
    88808880 ifdef VBOX_WITH_NOCRT_STATIC
     
    88838883  TEMPLATE_NewerVccVBoxGuestR3DllMinVista_LDFLAGS.win.x86 = $(filter-out -NoOptIData -Section:.bss$(COMMA)RW!K,$(TEMPLATE_NewerVccVBoxGuestR3Dll_LDFLAGS.win.x86))
    88848884 endif
    8885  TEMPLATE_NewerVccVBoxGuestR3DllMinVista_POST_CMDS.win.x86   = $(subst $(VBOX_PE_SET_VERSION), $(VBOX_PE_SET_VERSION) --vista,$(TEMPLATE_NewerVccVBoxGuestR3Dll_POST_CMDS.win.x86))
    8886  TEMPLATE_NewerVccVBoxGuestR3DllMinVista_POST_CMDS.win.amd64 = $(subst $(VBOX_PE_SET_VERSION), $(VBOX_PE_SET_VERSION) --vista,$(TEMPLATE_NewerVccVBoxGuestR3Dll_POST_CMDS.win.amd64))
    88878885endif
    88888886
  • trunk/src/VBox/Additions/3D/Config.kmk

    r104004 r105160  
    157157TEMPLATE_VBoxMesa3DGuestR3DllMinVista_VBOX_IMPORT_CHECKER.win.x86   := vista
    158158TEMPLATE_VBoxMesa3DGuestR3DllMinVista_VBOX_IMPORT_CHECKER.win.amd64 := vista
     159TEMPLATE_VBoxMesa3DGuestR3DllMinVista_VBOX_SET_PE_VERSION.win.x86   := vista
     160TEMPLATE_VBoxMesa3DGuestR3DllMinVista_VBOX_SET_PE_VERSION.win.amd64 := vista
    159161ifeq ($(KBUILD_TARGET),win)
    160162 TEMPLATE_VBoxMesa3DGuestR3DllMinVista_LDFLAGS.win.x86    = $(filter-out -Section:.bss$(COMMA)RW!K,$(TEMPLATE_VBoxMesa3DGuestR3Dll_LDFLAGS.win.x86))
    161  TEMPLATE_VBoxMesa3DGuestR3DllMinVista_POST_CMDS.win.x86  = $(subst $(VBOX_PE_SET_VERSION), $(VBOX_PE_SET_VERSION) --vista,$(TEMPLATE_VBoxMesa3DGuestR3Dll_POST_CMDS.win.x86))
    162  TEMPLATE_VBoxMesa3DGuestR3DllMinVista_POST_CMDS.win.amd64 = $(if $(eq $(tool_do),LINK_LIBRARY),,$(VBOX_PE_SET_VERSION) --vista $(out)$$(NLTAB)$(TEMPLATE_VBoxMesa3DGuestR3Dll_POST_CMDS.win.amd64))
    163  TEMPLATE_VBoxMesa3DGuestR3DllMinVista_LNK_DEPS.win.amd64 = $(if $(eq $(tool_do),LINK_LIBRARY),,$(VBOX_PE_SET_VERSION)) $(TEMPLATE_VBoxMesa3DGuestR3Dll_LNK_DEPS.win.amd64)
    164163endif
    165164
  • trunk/src/VBox/Additions/WINNT/VBoxGINA/Makefile.kmk

    r98416 r105160  
    4242        $(VBOX_LIB_VBGL_R3)
    4343VBoxGINA_VBOX_IMPORT_CHECKER.win.x86 = nt4 # GINA was introduced with nt351, but we don't have exports for that yet.
     44VBoxGINA_VBOX_SET_PE_VERSION.win.x86 = nt351
    4445
    4546# Include testcase(s).
  • trunk/src/VBox/Additions/WINNT/VBoxGINA/testcase/Makefile.kmk

    r98103 r105160  
    1 # $Id $
     1# $Id$
    22## @file
    33# Sub-Makefile for GINA test cases.
     
    3333tstVBoxGINA_SOURCES  = \
    3434        tstVBoxGINA.cpp
     35tstVBoxGINA_VBOX_SET_PE_VERSION.win.x86 = nt351
    3536
    3637include $(FILE_KBUILD_SUB_FOOTER)
  • trunk/src/VBox/ValidationKit/Config.kmk

    r98435 r105160  
    115115endif
    116116TEMPLATE_VBoxValidationKitR3_LDFLAGS.win.x86 += -NoOptIData
    117 TEMPLATE_VBoxValidationKitR3_POST_CMDS.win.x86   = $(if $(eq $(tool_do),LINK_LIBRARY),,$(VBOX_PE_SET_VERSION) $(out)$$(NLTAB))$(TEMPLATE_VBoxValidationKitR3Base_POST_CMDS.win.x86)$$(NLTAB)
    118 TEMPLATE_VBoxValidationKitR3_POST_CMDS.win.amd64 = $(if $(eq $(tool_do),LINK_LIBRARY),,$(VBOX_PE_SET_VERSION) $(out)$$(NLTAB))$(TEMPLATE_VBoxValidationKitR3Base_POST_CMDS.win.amd64)$$(NLTAB)
    119 TEMPLATE_VBoxValidationKitR3_LNK_DEPS.win.x86    = $(if $(eq $(tool_do),LINK_LIBRARY),,$(VBOX_PE_SET_VERSION)) $(TEMPLATE_VBoxValidationKitR3Base_LNK_DEPS.win.x86)
    120 TEMPLATE_VBoxValidationKitR3_LNK_DEPS.win.amd64  = $(if $(eq $(tool_do),LINK_LIBRARY),,$(VBOX_PE_SET_VERSION)) $(TEMPLATE_VBoxValidationKitR3Base_LNK_DEPS.win.amd64)
    121 
    122 #TODO: TEMPLATE_VBoxValidationKitR3_EXTENDS = VBoxGuestR3Exe
     117
     118TEMPLATE_VBoxValidationKitR3_USES.win += vboxsetpeversion
     119TEMPLATE_VBoxValidationKitR3_VBOX_SET_PE_VERSION.win.x86   = nt31
     120TEMPLATE_VBoxValidationKitR3_VBOX_SET_PE_VERSION.win.amd64 = xp64
    123121
    124122TEMPLATE_VBoxValidationKitR3_USES.win += vboximportchecker
    125123TEMPLATE_VBoxValidationKitR3_VBOX_IMPORT_CHECKER.win.x86   = nt31
    126124TEMPLATE_VBoxValidationKitR3_VBOX_IMPORT_CHECKER.win.amd64 = xp64
     125#TODO: TEMPLATE_VBoxValidationKitR3_EXTENDS = VBoxGuestR3Exe
    127126
    128127
  • trunk/src/bldprogs/VBoxPeSetVersion.cpp

    r105153 r105160  
    497497                else
    498498                {
    499                     if (strcmp(psz, "nt31") == 0)
     499                    if (strcmp(psz, "default") == 0)
     500                        uNtVersion = 0;
     501                    else if (strcmp(psz, "nt31") == 0)
    500502                        uNtVersion = MK_VER(3,10);
    501503                    else if (strcmp(psz, "nt350") == 0)
     
    509511                    else if (strcmp(psz, "xp") == 0)
    510512                        uNtVersion = MK_VER(5,1);
    511                     else if (strcmp(psz, "w2k3") == 0)
     513                    else if (strcmp(psz, "w2k3") == 0 || strcmp(psz, "xp64") == 0)
    512514                        uNtVersion = MK_VER(5,2);
    513515                    else if (strcmp(psz, "vista") == 0)
  • trunk/tools/kBuildUnits/vboxsetpeversion.kmk

    r105131 r105160  
    11# $Id$
    22## @file
    3 # VBox import checker unit.
     3# VBox PE version setter unit.
    44#
    55
    66#
    7 # Copyright (C) 2017-2023 Oracle and/or its affiliates.
     7# Copyright (C) 2017-2024 Oracle and/or its affiliates.
    88#
    99# This file is part of VirtualBox base platform packages, as
     
    2626#
    2727
    28 UNIT_vboximportchecker = bldRTLdrCheckImports
     28UNIT_vboxsetpeversion = VBoxPeSetVersion
    2929
    3030# Add our property.
    31 PROPS_SINGLE          += VBOX_IMPORT_CHECKER
    32 PROPS_SINGLE_LNK      += VBOX_IMPORT_CHECKER
    33 PROPS_PROGRAMS_SINGLE += VBOX_IMPORT_CHECKER
    34 PROPS_DLLS_SINGLE     += VBOX_IMPORT_CHECKER
    35 PROPS_SYSMODS_SINGLE  += VBOX_IMPORT_CHECKER
     31PROPS_SINGLE          += VBOX_SET_PE_VERSION
     32PROPS_SINGLE_LNK      += VBOX_SET_PE_VERSION
     33PROPS_PROGRAMS_SINGLE += VBOX_SET_PE_VERSION
     34PROPS_DLLS_SINGLE     += VBOX_SET_PE_VERSION
     35PROPS_SYSMODS_SINGLE  += VBOX_SET_PE_VERSION
    3636
    3737# Helper for expanding certain variables while assigning.
    38 define def_unit_vboximportchecker_internal_expand_twice
    39  $(target)_POST_CMDS += $$(if-expr "$$(tool_do)" != "LINK_LIBRARY",$$(NLTAB)$$(VBOX_RTLDRCHECKIMPORTS) -q -p "$$(KBUILD_DEVTOOLS)/$(bld_trg).$(bld_trg_arch)/exports/$$($(target)_2_VBOX_IMPORT_CHECKER)" $$(out),)
     38define def_unit_vboxsetpeversion_internal_expand_twice
     39 $(target)_POST_CMDS += $$(NLTAB)$$(VBOX_PE_SET_VERSION) $$(addprefix --,$$($(target)_2_VBOX_SET_PE_VERSION)) "$$(out)"
    4040endef
    4141
    42 define def_unit_vboximportchecker_target_pre
    43  # Do not apply to ASAN builds as it requires newere DLLs.
    44  ifneq ($(KBUILD_TYPE),asan)
     42define def_unit_vboxsetpeversion_target_pre
    4543
    46   # Set pass 2 variable (simpler) and act on it.
    47   $(target)_2_VBOX_IMPORT_CHECKER := $(evalcall def_fn_prop_get_first_defined,VBOX_IMPORT_CHECKER)
    48   ifdef $(target)_2_VBOX_IMPORT_CHECKER
    49    $(target)_LNK_ORDERDEPS += $(VBOX_RTLDRCHECKIMPORTS)
    50    $(eval $(def_unit_vboximportchecker_internal_expand_twice))
     44 # Set pass 2 variable (simpler) and act on it.
     45 $(target)_2_VBOX_SET_PE_VERSION := $(evalcall def_fn_prop_get_first_defined,VBOX_SET_PE_VERSION)
     46 ifdef $(target)_2_VBOX_SET_PE_VERSION
     47  ifneq ($(tool_do),LINK_LIBRARY)
     48   $(target)_LNK_ORDERDEPS += $(VBOX_PE_SET_VERSION)
     49   $(eval $(def_unit_vboxsetpeversion_internal_expand_twice))
    5150  endif
    52 
    5351 endif
    5452
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