VirtualBox

Changeset 62232 in vbox


Ignore:
Timestamp:
Jul 13, 2016 7:42:20 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
108744
Message:

VMM: Try convince the microsoft linker to pick the right version of structures where we hide stuff using unions (VMCPU, VM, ++). Looks like it takes the last occurence.

Location:
trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/vm.h

    r62171 r62232  
    138138     * @remarks This comes first as it allows the use of 8-bit immediates for the
    139139     *          first 64 bytes of the structure, reducing code size a wee bit. */
    140     union
     140#ifdef ___IEMInternal_h /* For PDB hacking. */
     141    union VMCPUUNIONIEMFULL
     142#else
     143    union VMCPUUNIONIEMSTUB
     144#endif
    141145    {
    142146#ifdef ___IEMInternal_h
     
    147151
    148152    /** HM part. */
    149     union
     153    union VMCPUUNIONHM
    150154    {
    151155#ifdef ___HMInternal_h
     
    156160
    157161    /** EM part. */
    158     union
     162    union VMCPUUNIONEM
    159163    {
    160164#ifdef ___EMInternal_h
     
    165169
    166170    /** TRPM part. */
    167     union
     171    union VMCPUUNIONTRPM
    168172    {
    169173#ifdef ___TRPMInternal_h
     
    174178
    175179    /** TM part. */
    176     union
     180    union VMCPUUNIONTM
    177181    {
    178182#ifdef ___TMInternal_h
     
    183187
    184188    /** VMM part. */
    185     union
     189    union VMCPUUNIONVMM
    186190    {
    187191#ifdef ___VMMInternal_h
     
    192196
    193197    /** PDM part. */
    194     union
     198    union VMCPUUNIONPDM
    195199    {
    196200#ifdef ___PDMInternal_h
     
    201205
    202206    /** IOM part. */
    203     union
     207    union VMCPUUNIONIOM
    204208    {
    205209#ifdef ___IOMInternal_h
     
    211215    /** DBGF part.
    212216     * @todo Combine this with other tiny structures. */
    213     union
     217    union VMCPUUNIONDBGF
    214218    {
    215219#ifdef ___DBGFInternal_h
     
    220224
    221225    /** GIM part. */
    222     union
     226    union VMCPUUNIONGIM
    223227    {
    224228#ifdef ___GIMInternal_h
     
    229233
    230234    /** APIC part. */
    231     union
     235    union VMCPUUNIONAPIC
    232236    {
    233237#ifdef ___APICInternal_h
     
    253257
    254258    /** PGM part. */
    255     union
     259    union VMCPUUNIONPGM
    256260    {
    257261#ifdef ___PGMInternal_h
     
    262266
    263267    /** CPUM part. */
    264     union
     268    union VMCPUUNIONCPUM
    265269    {
    266270#ifdef ___CPUMInternal_h
  • trunk/src/VBox/VMM/Makefile.kmk

    r62147 r62232  
    341341$(call VBOX_SET_VER_INFO_DLL,VBoxVMM,VirtualBox VMM) # Version info / description.
    342342
     343if "$(KBUILD_TARGET)" == "win" && !defined(VBOX_ONLY_EXTPACKS_USE_IMPLIBS)
     344 #
     345 # Debug type info hack for VMCPU, VM and similar.
     346 #
     347 # The microsoft linker seems to be using the last occurence of the structures
     348 # when writing the module PDB file.  So, we put the fully complete structures
     349 # in a library which is at the end of the library list.
     350 #
     351 VBoxVMM_LIBS    += $(VBoxVMMPdbTypeHack_1_TARGET)
     352 VBoxVMM_LDFLAGS += /Export:PdbTypeHack
     353
     354 LIBRARIES += VBoxVMMPdbTypeHack
     355 VBoxVMMPdbTypeHack_TEMPLATE = VBoxR3DllNoPic
     356 VBoxVMMPdbTypeHack_SOURCES  = VMMAll/AllPdbTypeHack.cpp
     357 VBoxVMMPdbTypeHack_DEFS     = $(VBoxVMM_DEFS)
     358 VBoxVMMPdbTypeHack_INCS     = $(VBoxVMM_INCS)
     359
     360endif
     361
    343362
    344363if defined(VBOX_WITH_RAW_MODE) && $(intersects $(VBOX_LDR_FMT32), pe lx)
     
    548567 endif
    549568
    550  # the very last one.
    551  VMMRC_SOURCES += VMMRC/VMMRC99.asm
     569 # The very last one.
     570 VMMRC_SOURCES += \
     571        VMMRC/VMMRC99.asm
    552572
    553573 VMMRC/VMMRCDeps.cpp_CXXFLAGS.win = -Oi- -TC ## @todo rename VMMRCDeps.cpp to .c
     
    558578  VMMRC_VMMAll/IEMAll.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
    559579 endif
     580
     581 if "$(KBUILD_TARGET)" == "win"
     582  # Debug type info hack for VMCPU, VM and similar.  See VBoxVMM for details.
     583  VMMRC_LIBS    += $(VMMRCPdbTypeHack_1_TARGET)
     584  VMMRC_LDFLAGS += /Export:PdbTypeHack
     585
     586  LIBRARIES += VMMRCPdbTypeHack
     587  VMMRCPdbTypeHack_TEMPLATE       = $(VMMRC_TEMPLATE)
     588  VMMRCPdbTypeHack_SOURCES        = VMMAll/AllPdbTypeHack.cpp
     589  VMMRCPdbTypeHack_DEFS           = $(VMMRC_DEFS)
     590  VMMRCPdbTypeHack_DEFS.win       = $(VMMRC_DEFS.win)
     591  VMMRCPdbTypeHack_DEFS.win.x86   = $(VMMRC_DEFS.win.x86)
     592  VMMRCPdbTypeHack_DEFS.win.amd64 = $(VMMRC_DEFS.win.amd64)
     593  VMMRCPdbTypeHack_INCS           = $(VMMRC_INCS)
     594 endif
     595
    560596endif # VBOX_WITH_RAW_MODE && !VBOX_ONLY_EXTPACKS
    561597
     
    699735  VMMR0_VMMAll/IEMAll.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
    700736 endif
     737
     738 if "$(KBUILD_TARGET)" == "win"
     739  # Debug type info hack for VMCPU, VM and similar.  See VBoxVMM for details.
     740  VMMR0_LIBS    += $(VMMR0PdbTypeHack_1_TARGET)
     741  VMMR0_LDFLAGS += /Export:PdbTypeHack
     742
     743  LIBRARIES += VMMR0PdbTypeHack
     744  VMMR0PdbTypeHack_TEMPLATE       = $(VMMR0_TEMPLATE)
     745  VMMR0PdbTypeHack_SOURCES        = VMMAll/AllPdbTypeHack.cpp
     746  VMMR0PdbTypeHack_DEFS           = $(VMMR0_DEFS)
     747  VMMR0PdbTypeHack_DEFS.win       = $(VMMR0_DEFS.win)
     748  VMMR0PdbTypeHack_DEFS.win.x86   = $(VMMR0_DEFS.win.x86)
     749  VMMR0PdbTypeHack_DEFS.win.amd64 = $(VMMR0_DEFS.win.amd64)
     750  VMMR0PdbTypeHack_INCS           = $(VMMR0_INCS)
     751 endif
     752
    701753endif # !VBOX_ONLY_EXTPACKS
    702754
Note: See TracChangeset for help on using the changeset viewer.

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