VirtualBox

Ignore:
Timestamp:
Jan 8, 2016 9:19:45 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
104957
Message:

bs3kit: prepping makefiles, working around NASM dependency issue.

Location:
trunk/src/VBox/ValidationKit/bootsectors
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/bootsectors/Makefile.kmk

    r58593 r59300  
    2727SUB_DEPTH = ../../../..
    2828include $(KBUILD_PATH)/subheader.kmk
     29
     30
     31#
     32# Make sure our Config.kmk gets included when kmk is running from a parent directory.
     33#
     34ifndef VBOX_VALIDATIONKIT_CONFIG_KMK_INCLUDED
     35 include $(PATH_SUB_CURRENT)/Config.kmk
     36endif
     37
     38
     39#
     40# Include sub-makefile.
     41#
     42if defined(VBOX_WITH_OPEN_WATCOM) && "$(USER)" == "bird"
     43 if1of ($(KBUILD_TARGET), win) ## requires patched NASM.
     44  include $(PATH_SUB_CURRENT)/bs3kit/Makefile.kmk
     45 endif
     46endif
    2947
    3048
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk

    r59287 r59300  
    2929
    3030
    31 #
    32 # ----- Config.kmk: start -----
    33 #
    34 
    35 # The bs3kit source directory.
    36 VBOX_PATH_BS3KIT_SRC = $(VBOX_PATH_VALIDATIONKIT_SRC)/bootsectors/bs3kit
    37 
    38 # Boot Sector post-link tool used below.
     31
     32# Boot Sector post-link tool (used via the parent Config.kmk).
    3933BLDPROGS += VBoxBs3Linker
    4034VBoxBs3Linker_TEMPLATE = VBoxBldProg
    4135VBoxBs3Linker_SOURCES  = $(VBOX_PATH_BS3KIT_SRC)/VBoxBs3Linker.cpp
    4236
    43 # 64-bit relocation conversion tool
     37
     38# 64-bit relocation conversion tool (used via the parent Config.kmk).
    4439BLDPROGS += VBoxBs3ObjConverter
    4540VBoxBs3ObjConverter_TEMPLATE = VBoxBldProg
    4641VBoxBs3ObjConverter_SOURCES  = $(VBOX_PATH_BS3KIT_SRC)/VBoxBs3ObjConverter.cpp
    47 
    48 # Dummy CP "linker" tool.
    49 TOOL_VBoxBsCpLd = Dummy copy linker.
    50 TOOL_VBoxBsCpLd_LINK_MISCBIN_OUTPUT =
    51 TOOL_VBoxBsCpLd_LINK_MISCBIN_DEPEND =
    52 TOOL_VBoxBsCpLd_LINK_MISCBIN_DEPORD =
    53 define TOOL_VBoxBsCpLd_LINK_MISCBIN_CMDS
    54         $(CP) -- $(objs) $(othersrc) "$(out)"
    55 endef
    56 
    57 # Dummy exit 1 "linker" tool.
    58 TOOL_VBoxBsUnusedLd = Dummy unused linker.
    59 TOOL_VBoxBsUnusedLd_LINK_MISCBIN_OUTPUT =
    60 TOOL_VBoxBsUnusedLd_LINK_MISCBIN_DEPEND =
    61 TOOL_VBoxBsUnusedLd_LINK_MISCBIN_DEPORD =
    62 define TOOL_VBoxBsUnusedLd_LINK_MISCBIN_CMDS
    63         echo "cannot use this template for linking"
    64         exit 1
    65 endef
    66 
    67 #
    68 # ELF 64-bit compiler tool with object conversion.
    69 #
    70 # Mac needs cross compiler: sudo port install x86_64-elf-gcc
    71 #
    72 TOOL_Bs3Gcc64Elf64 := AMD64/ELF64 gcc/g++ (cross) compiler.
    73 ifeq ($(KBUILD_HOST),darwin)
    74  TOOL_Bs3Gcc64Elf64_CC  ?= x86_64-elf-gcc$(HOSTSUFF_EXE) -m64
    75  TOOL_Bs3Gcc64Elf64_CXX ?= x86_64-elf-g++$(HOSTSUFF_EXE) -m64
    76 else
    77  TOOL_Bs3Gcc64Elf64_CC  ?= gcc$(HOSTSUFF_EXE) -m64
    78  TOOL_Bs3Gcc64Elf64_CXX ?= g++$(HOSTSUFF_EXE) -m64
    79 endif
    80 ifdef SLKRUNS
    81  TOOL_Bs3Gcc64Elf64_CC  += -fmessage-length=0
    82  TOOL_Bs3Gcc64Elf64_CXX += -fmessage-length=0
    83 endif
    84 TOOL_Bs3Gcc64Elf64_COBJSUFF         ?= .o
    85 TOOL_Bs3Gcc64Elf64_CFLAGS           ?=
    86 TOOL_Bs3Gcc64Elf64_CFLAGS.debug     ?= -g
    87 TOOL_Bs3Gcc64Elf64_CFLAGS.profile   ?= -O2 #-g -pg
    88 TOOL_Bs3Gcc64Elf64_CFLAGS.release   ?= -O2
    89 TOOL_Bs3Gcc64Elf64_CINCS            ?=
    90 TOOL_Bs3Gcc64Elf64_CDEFS            ?=
    91 TOOL_Bs3Gcc64Elf64_COMPILE_C_DEPEND = $(VBoxBs3ObjConverter_1_TARGET)
    92 TOOL_Bs3Gcc64Elf64_COMPILE_C_DEPORD =
    93 TOOL_Bs3Gcc64Elf64_COMPILE_C_OUTPUT =
    94 define TOOL_Bs3Gcc64Elf64_COMPILE_C_CMDS
    95         $(QUIET)$(TOOL_Bs3Gcc64Elf64_CC) -c\
    96                 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
    97                 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
    98                 -o $(obj)\
    99                 $(abspath $(source))
    100         $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
    101         $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
    102 endef
    103 
    104 TOOL_Bs3Gcc64Elf64_CXXOBJSUFF       ?= .o
    105 TOOL_Bs3Gcc64Elf64_CXXOBJSUFF       ?= .o
    106 TOOL_Bs3Gcc64Elf64_CXXFLAGS         ?=
    107 TOOL_Bs3Gcc64Elf64_CXXFLAGS.debug   ?= -g0 # no debug info, thank you
    108 TOOL_Bs3Gcc64Elf64_CXXFLAGS.profile ?= -O2 #-g -pg
    109 TOOL_Bs3Gcc64Elf64_CXXFLAGS.release ?= -O2
    110 TOOL_Bs3Gcc64Elf64_CXXINCS          ?=
    111 TOOL_Bs3Gcc64Elf64_CXXDEFS          ?=
    112 TOOL_Bs3Gcc64Elf64_COMPILE_CXX_DEPEND = $(VBoxBs3ObjConverter_1_TARGET)
    113 TOOL_Bs3Gcc64Elf64_COMPILE_CXX_DEPORD =
    114 TOOL_Bs3Gcc64Elf64_COMPILE_CXX_OUTPUT =
    115 define TOOL_Bs3Gcc64Elf64_COMPILE_CXX_CMDS
    116         $(QUIET)$(TOOL_Bs3Gcc64Elf64_CXX) -c\
    117                 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
    118                 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
    119                 -o $(obj)\
    120                 $(abspath $(source))
    121         $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
    122         $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
    123 endef
    124 
    125 #
    126 # Visual C++ tool variant that runs the object converter afterwards.
    127 #
    128 TOOL_Bs3Vcc64 := Visual C++ 64-bit
    129 TOOL_Bs3Vcc64_CC  = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_CC)
    130 TOOL_Bs3Vcc64_CXX = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_CXX)
    131 TOOL_Bs3Vcc64_COBJSUFF                 = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COBJSUFF)
    132 TOOL_Bs3Vcc64_CFLAGS                   = $(filter-out -TC,$(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_CFLAGS)) -TP # compile as C++
    133 TOOL_Bs3Vcc64_CFLAGS.debug             =
    134 TOOL_Bs3Vcc64_CFLAGS.dbgopt            = -O1
    135 TOOL_Bs3Vcc64_CFLAGS.profile           = -O1
    136 TOOL_Bs3Vcc64_CFLAGS.release           = -O1
    137 TOOL_Bs3Vcc64_CINCS                    = $(PATH_TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_INC)
    138 TOOL_Bs3Vcc64_CDEFS                    =
    139 TOOL_Bs3Vcc64_COMPILE_C_DEPEND         = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_C_DEPEND) $(VBoxBs3ObjConverter_1_TARGET)
    140 TOOL_Bs3Vcc64_COMPILE_C_DEPORD         = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_C_DEPORD)
    141 TOOL_Bs3Vcc64_COMPILE_C_OUTPUT         = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_C_OUTPUT)
    142 TOOL_Bs3Vcc64_COMPILE_C_OUTPUT_MAYBE   = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_C_OUTPUT_MAYBE)
    143 define TOOL_Bs3Vcc64_COMPILE_C_CMDS
    144 $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_C_CMDS)
    145         $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
    146 endef
    147 
    148 TOOL_Bs3Vcc64_CXXOBJSUFF               = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_CXXOBJSUFF)
    149 TOOL_Bs3Vcc64_CXXFLAGS                 = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_CXXFLAGS)
    150 TOOL_Bs3Vcc64_CXXFLAGS.debug           =
    151 TOOL_Bs3Vcc64_CXXFLAGS.dbgopt          = -O1
    152 TOOL_Bs3Vcc64_CXXFLAGS.profile         = -O1
    153 TOOL_Bs3Vcc64_CXXFLAGS.release         = -O1
    154 TOOL_Bs3Vcc64_CXXINCS                  = $(PATH_TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_INC)
    155 TOOL_Bs3Vcc64_CXXDEFS                  =
    156 TOOL_Bs3Vcc64_COMPILE_CXX_DEPEND       = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_CXX_DEPEND) $(VBoxBs3ObjConverter_1_TARGET)
    157 TOOL_Bs3Vcc64_COMPILE_CXX_DEPORD       = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_CXX_DEPORD)
    158 TOOL_Bs3Vcc64_COMPILE_CXX_OUTPUT       = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_CXX_OUTPUT)
    159 TOOL_Bs3Vcc64_COMPILE_CXX_OUTPUT_MAYBE = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_CXX_OUTPUT_MAYBE)
    160 define TOOL_Bs3Vcc64_COMPILE_CXX_CMDS
    161 $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_CXX_CMDS)
    162         $(QUIET)$(VBoxBs3ObjConverter_1_TARGET)  "$(obj)"
    163 endef
    164 
    165 #
    166 # 32-bit OpenWatcom C/C++ tool variant that runs the object converter afterwards
    167 # to rename intrinsic functions so they don't clash with the 16-bit compiler.
    168 #
    169 TOOL_Bs3Ow32 := OpenWatcom C/C++ 32-bit with object convertsion
    170 TOOL_Bs3Ow32_CC  = $(TOOL_OPENWATCOM_CC)
    171 TOOL_Bs3Ow32_CXX = $(TOOL_OPENWATCOM_CXX)
    172 TOOL_Bs3Ow32_COBJSUFF                 = $(TOOL_OPENWATCOM_COBJSUFF)
    173 TOOL_Bs3Ow32_CFLAGS                   = $(TOOL_OPENWATCOM_CFLAGS)
    174 #       -adfs \ - This is too complicated and it doesn't support stubbing files (svn rename fun.h pain.h). Use kDepObj instead.
    175 #       -ad=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(dep)) \
    176 #       -adt=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(obj)) \
    177 #       -add=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(abspath $(source))) \
    178 #       -adhp=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(dir $(abspath $(source))))
    179 TOOL_Bs3Ow32_CFLAGS.debug             = $(TOOL_OPENWATCOM_CFLAGS.debug)
    180 TOOL_Bs3Ow32_CFLAGS.dbgopt            = $(TOOL_OPENWATCOM_CFLAGS.dbgopt)
    181 TOOL_Bs3Ow32_CFLAGS.profile           = $(TOOL_OPENWATCOM_CFLAGS.profile)
    182 TOOL_Bs3Ow32_CFLAGS.release           = $(TOOL_OPENWATCOM_CFLAGS.release)
    183 TOOL_Bs3Ow32_CINCS                    = $(TOOL_OPENWATCOM_CINCS)
    184 TOOL_Bs3Ow32_CDEFS                    =
    185 TOOL_Bs3Ow32_COMPILE_C_DEPEND         = $(TOOL_OPENWATCOM_COMPILE_C_DEPEND) $(VBoxBs3ObjConverter_1_TARGET)
    186 TOOL_Bs3Ow32_COMPILE_C_DEPORD         = $(TOOL_OPENWATCOM_COMPILE_C_DEPORD)
    187 TOOL_Bs3Ow32_COMPILE_C_OUTPUT         = $(TOOL_OPENWATCOM_COMPILE_C_OUTPUT)
    188 TOOL_Bs3Ow32_COMPILE_C_OUTPUT_MAYBE   = $(TOOL_OPENWATCOM_COMPILE_C_OUTPUT_MAYBE)
    189 define TOOL_Bs3Ow32_COMPILE_C_CMDS
    190 $(TOOL_OPENWATCOM_COMPILE_C_CMDS)
    191         $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
    192         $(QUIET)$(REDIRECT) -wo /dev/null -- $(KBUILD_BIN_PATH)/kDepObj$(HOSTSUFF_EXE) -s -f -q -o "$(dep)" -t "$(obj)" "$(obj)"
    193 endef
    194 
    195 TOOL_Bs3Ow32_CXXOBJSUFF               = $(TOOL_OPENWATCOM_CXXOBJSUFF)
    196 TOOL_Bs3Ow32_CXXFLAGS                 = $(TOOL_OPENWATCOM_CXXFLAGS) -ad=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(dep)) -adfs
    197 TOOL_Bs3Ow32_CXXFLAGS.debug           = $(TOOL_OPENWATCOM_CXXFLAGS.debug)
    198 TOOL_Bs3Ow32_CXXFLAGS.dbgopt          = $(TOOL_OPENWATCOM_CXXFLAGS.dbgopt)
    199 TOOL_Bs3Ow32_CXXFLAGS.profile         = $(TOOL_OPENWATCOM_CXXFLAGS.profile)
    200 TOOL_Bs3Ow32_CXXFLAGS.release         = $(TOOL_OPENWATCOM_CXXFLAGS.release)
    201 TOOL_Bs3Ow32_CXXINCS                  = $(TOOL_OPENWATCOM_CXXINCS)
    202 TOOL_Bs3Ow32_CXXDEFS                  =
    203 TOOL_Bs3Ow32_COMPILE_CXX_DEPEND       = $(TOOL_OPENWATCOM_COMPILE_CXX_DEPEND) $(VBoxBs3ObjConverter_1_TARGET)
    204 TOOL_Bs3Ow32_COMPILE_CXX_DEPORD       = $(TOOL_OPENWATCOM_COMPILE_CXX_DEPORD)
    205 TOOL_Bs3Ow32_COMPILE_CXX_OUTPUT       = $(TOOL_OPENWATCOM_COMPILE_CXX_OUTPUT)
    206 TOOL_Bs3Ow32_COMPILE_CXX_OUTPUT_MAYBE = $(TOOL_OPENWATCOM_COMPILE_CXX_OUTPUT_MAYBE)
    207 define TOOL_Bs3Ow32_COMPILE_CXX_CMDS
    208 $(TOOL_OPENWATCOM_COMPILE_CXX_CMDS)
    209         $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
    210         $(QUIET)$(REDIRECT) -wo /dev/null -- $(KBUILD_BIN_PATH)/kDepObj$(HOSTSUFF_EXE) -s -f -q -o "$(dep)" -t "$(obj)" "$(obj)"
    211 endef
    212 
    213 
    214 #
    215 # 16-bit OpenWatcom C/C++ tool variant that runs the object converter afterwards
    216 # to rename intrinsic functions so they don't clash with the 16-bit compiler.
    217 #
    218 TOOL_Bs3Ow16 := OpenWatcom C/C++ 16-bit with object convertsion
    219 TOOL_Bs3Ow16_CC  = $(TOOL_OPENWATCOM-16_CC)
    220 TOOL_Bs3Ow16_CXX = $(TOOL_OPENWATCOM-16_CXX)
    221 TOOL_Bs3Ow16_COBJSUFF                 = $(TOOL_OPENWATCOM-16_COBJSUFF)
    222 TOOL_Bs3Ow16_CFLAGS                   = $(TOOL_OPENWATCOM-16_CFLAGS)
    223 TOOL_Bs3Ow16_CFLAGS.debug             = $(TOOL_OPENWATCOM-16_CFLAGS.debug)
    224 TOOL_Bs3Ow16_CFLAGS.dbgopt            = $(TOOL_OPENWATCOM-16_CFLAGS.dbgopt)
    225 TOOL_Bs3Ow16_CFLAGS.profile           = $(TOOL_OPENWATCOM-16_CFLAGS.profile)
    226 TOOL_Bs3Ow16_CFLAGS.release           = $(TOOL_OPENWATCOM-16_CFLAGS.release)
    227 TOOL_Bs3Ow16_CINCS                    = $(TOOL_OPENWATCOM-16_CINCS)
    228 TOOL_Bs3Ow16_CDEFS                    =
    229 TOOL_Bs3Ow16_COMPILE_C_DEPEND         = $(TOOL_OPENWATCOM-16_COMPILE_C_DEPEND) $(VBoxBs3ObjConverter_1_TARGET)
    230 TOOL_Bs3Ow16_COMPILE_C_DEPORD         = $(TOOL_OPENWATCOM-16_COMPILE_C_DEPORD)
    231 TOOL_Bs3Ow16_COMPILE_C_OUTPUT         = $(TOOL_OPENWATCOM-16_COMPILE_C_OUTPUT)
    232 TOOL_Bs3Ow16_COMPILE_C_OUTPUT_MAYBE   = $(TOOL_OPENWATCOM-16_COMPILE_C_OUTPUT_MAYBE)
    233 define TOOL_Bs3Ow16_COMPILE_C_CMDS
    234 $(TOOL_OPENWATCOM-16_COMPILE_C_CMDS)
    235         $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
    236         $(QUIET)$(REDIRECT) -wo /dev/null -- $(KBUILD_BIN_PATH)/kDepObj$(HOSTSUFF_EXE) -s -f -q -o "$(dep)" -t "$(obj)" "$(obj)"
    237 endef
    238 
    239 TOOL_Bs3Ow16_CXXOBJSUFF               = $(TOOL_OPENWATCOM-16_CXXOBJSUFF)
    240 TOOL_Bs3Ow16_CXXFLAGS                 = $(TOOL_OPENWATCOM-16_CXXFLAGS)
    241 TOOL_Bs3Ow16_CXXFLAGS.debug           = $(TOOL_OPENWATCOM-16_CXXFLAGS.debug)
    242 TOOL_Bs3Ow16_CXXFLAGS.dbgopt          = $(TOOL_OPENWATCOM-16_CXXFLAGS.dbgopt)
    243 TOOL_Bs3Ow16_CXXFLAGS.profile         = $(TOOL_OPENWATCOM-16_CXXFLAGS.profile)
    244 TOOL_Bs3Ow16_CXXFLAGS.release         = $(TOOL_OPENWATCOM-16_CXXFLAGS.release)
    245 TOOL_Bs3Ow16_CXXINCS                  = $(TOOL_OPENWATCOM-16_CXXINCS)
    246 TOOL_Bs3Ow16_CXXDEFS                  =
    247 TOOL_Bs3Ow16_COMPILE_CXX_DEPEND       = $(TOOL_OPENWATCOM-16_COMPILE_CXX_DEPEND) $(VBoxBs3ObjConverter_1_TARGET)
    248 TOOL_Bs3Ow16_COMPILE_CXX_DEPORD       = $(TOOL_OPENWATCOM-16_COMPILE_CXX_DEPORD)
    249 TOOL_Bs3Ow16_COMPILE_CXX_OUTPUT       = $(TOOL_OPENWATCOM-16_COMPILE_CXX_OUTPUT)
    250 TOOL_Bs3Ow16_COMPILE_CXX_OUTPUT_MAYBE = $(TOOL_OPENWATCOM-16_COMPILE_CXX_OUTPUT_MAYBE)
    251 define TOOL_Bs3Ow16_COMPILE_CXX_CMDS
    252 $(TOOL_OPENWATCOM-16_COMPILE_CXX_CMDS)
    253         $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
    254         $(QUIET)$(REDIRECT) -wo /dev/null -- $(KBUILD_BIN_PATH)/kDepObj$(HOSTSUFF_EXE) -s -f -q -o "$(dep)" -t "$(obj)" "$(obj)"
    255 endef
    256 
    257 # Debug info format depends on what we use for 64-bit.
    258 if1of ($(KBUILD_HOST), win)
    259  BS3_OW_DBG_OPT   = -hc
    260  BS3_OW_DBG_LDOPT = codeview
    261 else
    262  BS3_OW_DBG_OPT   = -hd
    263  BS3_OW_DBG_LDOPT = dwarf
    264 endif
    265 
    266 #
    267 # BS3Kit template for assembly and 16-bit code.
    268 #
    269 # Note! Using -d1 as -d1+ and -d2 causes suboptimal code to be generated (strlen
    270 #       reloading string pointer argument all the time).
    271 # Note! Optimization options should come after debug stuff as -d2 for instance
    272 #       disables all optimziations.
    273 #
    274 # Compiler options explained:
    275 #       -nt=xxxx               Sets the text segment name.
    276 #       -nc=xxxx               Sets the text segment class name.
    277 #       -nd=xxxx               Sets the data segment name.
    278 #       -ecc                   Sets the default calling convension to __cdecl
    279 #                              Update: We don't use this in 16-bit code as it causes unfavorable reloading of DS before calling
    280 #                                      inlined functions (e.g. iprt/asm.h). Instead we use -ecw and __cdecl where needed.
    281 #       -ecw                   Sets the default calling convension to __watcall ()
    282 #       -q                     Quiet, no logos or stuff.
    283 #       -3                     Use 386 instruction set (16-bit only).
    284 #       -wx                    Maxium warning level.
    285 #       -zl                    Don't emit default library information.
    286 #       -zu                    Assume SS != DS.
    287 #       -mc                    Compact memory model, far data, small code.
    288 #       -mf                    Flat memory model (32-bit).
    289 #       -d1                    Debug info: Globals and line numbers.
    290 #       -s                     No stack overflow checks.
    291 #       -oa                    Relaxed aliasing constraints.
    292 #       -ob                    Branch prediction.
    293 #       -of                    Generate stack frames when needed.
    294 #       -oi                    Inline instrinsics functions.
    295 #       -ol                    Loop optimizations.
    296 #       -or                    Reorder for best pipeline.
    297 #       -os                    Favor size over speed.
    298 #
    299 TEMPLATE_VBoxBS3KitImg = Template for building BS3Kit test images.
    300 TEMPLATE_VBoxBS3KitImg_BLD_TRG      = os-agnostic
    301 TEMPLATE_VBoxBS3KitImg_BLD_TRG_ARCH = x86
    302 TEMPLATE_VBoxBS3KitImg_INST         = $(INST_VALIDATIONKIT)bootsectors/
    303 TEMPLATE_VBoxBS3KitImg_BINSUFF      = .img
    304 TEMPLATE_VBoxBS3KitImg_MODE         = 0644
    305 TEMPLATE_VBoxBS3KitImg_ASTOOL       = NASM
    306 TEMPLATE_VBoxBS3KitImg_ASFLAGS      = -f obj -g --allow-64bit-code-anywhere -w+orphan-labels
    307 TEMPLATE_VBoxBS3KitImg_ASDEFS       = ASM_FORMAT_OMF RT_NOINC_SEGMENTS __NASM__
    308 TEMPLATE_VBoxBS3KitImg_DEFS         = ARCH_BITS=16 IN_BS3KIT
    309 TEMPLATE_VBoxBS3KitImg_DEFS.debug   = BS3_STRICT
    310 TEMPLATE_VBoxBS3KitImg_ARTOOL       = OPENWATCOM-16
    311 TEMPLATE_VBoxBS3KitImg_CTOOL        = Bs3Ow16
    312 TEMPLATE_VBoxBS3KitImg_CXXTOOL      = Bs3Ow16
    313 TEMPLATE_VBoxBS3KitImg_CFLAGS       = \
    314         -nt=BS3TEXT16 -nd=BS3DATA16 -nc=BS3CODE16 -ecw -q -3 -wx -zl -zu -mc $(BS3_OW_DBG_OPT) -d1 -s -oa -ob -of -oi -ol -or -os
    315 TEMPLATE_VBoxBS3KitImg_CXXFLAGS     = \
    316         -nt=BS3TEXT16 -nd=BS3DATA16 -nc=BS3CODE16 -ecw -q -3 -wx -zl -zu -mc $(BS3_OW_DBG_OPT) -d1 -s -oa -ob -of -oi -ol -or -os
    317 TEMPLATE_VBoxBS3KitImg_INCS         = $(VBOX_PATH_BS3KIT_SRC) .
    318 TEMPLATE_VBoxBS3KitImg_LDTOOL       = OPENWATCOM-WL
    319 #       option quiet, nofarcalls\
    320 #       disable 1014, 1023, 2120, 1080
    321 
    322 # linker options:
    323 #      system dos:                 Link a 16-bit DOS binary.
    324 #      output raw ...:             Produce a raw DOS binary for loading at flat address 10000h.
    325 #                                  The following is for ordering segments.
    326 #      option start=_start:         The start symbol in bs3-first-xxx.asm.
    327 #      debug codeview/dwarf all:   Full debug information either in codeview or dwarf.
    328 #      option symfile:             Produce a separate symbol file with the debug info.
    329 #      option map:                 Produce a map file.
    330 #      option statics:             ?
    331 #      option verbose:             Verbose map file?
    332 #       option disable 1014:        Disable warning about
    333 #       option disable 1080:        Disable warning about
    334 #       option disable 1150:        Disable warning about
    335 #
    336 # Note! We're pushing DATA16 to 0x20000 because it's impossible to force wlink
    337 #       to give us a real-mode + GDT compatible alignment (0ffffff80h), i.e.
    338 #       real-mode address on the form 0fff8:0000.
    339 TEMPLATE_VBoxBS3KitImg_LDFLAGS  = system dos \
    340         debug $(BS3_OW_DBG_LDOPT) all \
    341         option quiet, map, statics, verbose, symfile, start=_start \
    342        disable 1014, 1080, 1150 \
    343         \
    344         output raw offset=0x10000 \
    345         order \
    346          clname BS3FLAT segaddr=0x0000 \
    347            segment BS3FLAT segaddr=0x0000 \
    348          clname BS3CODE16 segaddr=0x1000 \
    349           segment BS3TEXT16 \
    350           segment BS3TEXT16_END \
    351         clname BS3SYSTEM16 segaddr=0x2000 \
    352          segment BS3SYSTEM16 \
    353          clname FAR_DATA \
    354           segment BS3DATA16 segaddr=0x2700 \
    355           segment BS3DATA16CONST \
    356           segment BS3DATA16CONST2 \
    357           segment BS3DATA16_DATA \
    358           segment BS3DATA16_END \
    359           segment BS3DATA32 \
    360           segment BS3DATA32_CONST \
    361           segment BS3DATA32_CONST2 \
    362           segment BS3DATA32_DATA \
    363           segment DATA32 \
    364         clname BS3CODE32 \
    365           segment BS3TEXT32 \
    366           segment TEXT32 \
    367         clname CODE \
    368           segment BS3TEXT64 \
    369           segment TEXT64 \
    370           segment .text \
    371           segment .rdata \
    372         clname DATA \
    373           segment BS3DATA64 \
    374           segment DATA64 \
    375           segment .data \
    376           segment .pdata \
    377           segment .xdata \
    378 
    379 TEMPLATE_VBoxBS3KitImg_DEPS = \
    380         $(bs3-bootsector_1_TARGET) \
    381         $(VBoxBs3Linker_1_TARGET)
    382 TEMPLATE_VBoxBS3KitImg_POST_CMDS = $(if $(eq $(tool_do),LINK_LIBRARY)\
    383         ,,$(QUIET)$(MV_EXT) -f -- "$(out)" "$(out).tmp" \
    384         $$(NLTAB)$(QUIET)$(VBoxBs3Linker_1_TARGET) -o $(out) $(bs3-bootsector_1_TARGET) $(out).tmp \
    385         $$(NLTAB)$(QUIET)$(RM_EXT) -f -- "$(out).tmp")
    386 
    387 TEMPLATE_VBoxBS3KitImg_LIBS = \
    388         $(PATH_OBJ)/bs3kit-common-16/bs3kit-common-16.lib \
    389         $(PATH_OBJ)/bs3kit-common-32/bs3kit-common-32.lib \
    390         $(PATH_OBJ)/bs3kit-common-64-asm/bs3kit-common-64-asm.lib \
    391         $(PATH_OBJ)/bs3kit-common-64-c/bs3kit-common-64-c.lib \
    392        \
    393         $(PATH_OBJ)/bs3kit-rm/bs3kit-rm.lib \
    394         $(PATH_OBJ)/bs3kit-pe16/bs3kit-pe16.lib \
    395         $(PATH_OBJ)/bs3kit-pe32/bs3kit-pe32.lib \
    396         $(PATH_OBJ)/bs3kit-pev86/bs3kit-pev86.lib \
    397         $(PATH_OBJ)/bs3kit-pp16/bs3kit-pp16.lib \
    398         $(PATH_OBJ)/bs3kit-pp32/bs3kit-pp32.lib \
    399         $(PATH_OBJ)/bs3kit-ppv86/bs3kit-ppv86.lib \
    400         $(PATH_OBJ)/bs3kit-pae16/bs3kit-pae16.lib \
    401         $(PATH_OBJ)/bs3kit-pae32/bs3kit-pae32.lib \
    402         $(PATH_OBJ)/bs3kit-paev86/bs3kit-paev86.lib \
    403         $(PATH_OBJ)/bs3kit-lm16/bs3kit-lm16.lib \
    404         $(PATH_OBJ)/bs3kit-lm32/bs3kit-lm32.lib \
    405         $(PATH_OBJ)/bs3kit-lm64-asm/bs3kit-lm64-asm.lib \
    406         $(PATH_OBJ)/bs3kit-lm64-c/bs3kit-lm64-c.lib
    407 
    408 # BS3Kit template for 32-bit code.
    409 TEMPLATE_VBoxBS3KitImg32 = Template for building BS3Kit test images.
    410 TEMPLATE_VBoxBS3KitImg32_BLD_TRG      = os-agnostic
    411 TEMPLATE_VBoxBS3KitImg32_BLD_TRG_ARCH = x86
    412 TEMPLATE_VBoxBS3KitImg32_INSTTYPE     = none
    413 TEMPLATE_VBoxBS3KitImg32_ASTOOL       = NASM
    414 TEMPLATE_VBoxBS3KitImg32_ASFLAGS      = -f obj -g --allow-64bit-code-anywhere -w+orphan-labels
    415 TEMPLATE_VBoxBS3KitImg32_ASDEFS       = ASM_FORMAT_OMF RT_NOINC_SEGMENTS __NASM__
    416 TEMPLATE_VBoxBS3KitImg32_DEFS         = ARCH_BITS=32 IN_BS3KIT
    417 TEMPLATE_VBoxBS3KitImg32_DEFS.debug   = BS3_STRICT
    418 TEMPLATE_VBoxBS3KitImg32_ARTOOL       = OPENWATCOM
    419 TEMPLATE_VBoxBS3KitImg32_CTOOL        = Bs3Ow32
    420 TEMPLATE_VBoxBS3KitImg32_CXXTOOL      = Bs3Ow32
    421 TEMPLATE_VBoxBS3KitImg32_CFLAGS       = \
    422         -nt=BS3TEXT32 -nd=BS3DATA32 -nc=BS3CODE32 -ecc -q -wx -zl -mf $(BS3_OW_DBG_OPT) -d1 -s -oa -ob -of -oi -ol -or -os
    423 TEMPLATE_VBoxBS3KitImg32_CXXFLAGS     = \
    424         -nt=BS3TEXT32 -nd=BS3DATA32 -nc=BS3CODE32 -ecc -q -wx -zl -mf $(BS3_OW_DBG_OPT) -d1 -s -oa -ob -of -oi -ol -or -os
    425 TEMPLATE_VBoxBS3KitImg32_INCS         = $(VBOX_PATH_BS3KIT_SRC) .
    426 TEMPLATE_VBoxBS3KitImg32_LDTOOL       = VBoxBsUnusedLd
    427 
    428 # BS3Kit template for 64-bit code.
    429 TEMPLATE_VBoxBS3KitImg64 = Template for building BS3Kit test images.
    430 TEMPLATE_VBoxBS3KitImg64_BLD_TRG      = os-agnostic
    431 TEMPLATE_VBoxBS3KitImg64_BLD_TRG_ARCH = amd64
    432 TEMPLATE_VBoxBS3KitImg64_INSTTYPE     = none
    433 TEMPLATE_VBoxBS3KitImg64_ASTOOL       = NASM
    434 TEMPLATE_VBoxBS3KitImg64_ASFLAGS      = -f obj -g --allow-64bit-code-anywhere -w+orphan-labels
    435 TEMPLATE_VBoxBS3KitImg64_ASDEFS       = ASM_FORMAT_OMF RT_NOINC_SEGMENTS __NASM__
    436 TEMPLATE_VBoxBS3KitImg64_DEFS         = IN_BS3KIT ARCH_BITS=64
    437 TEMPLATE_VBoxBS3KitImg64_DEFS.debug   = BS3_STRICT
    438 TEMPLATE_VBoxBS3KitImg64_ARTOOL       = OPENWATCOM
    439 TEMPLATE_VBoxBS3KitImg64_INCS         = $(VBOX_PATH_BS3KIT_SRC) .
    440 if1of ($(KBUILD_HOST), win)
    441  TEMPLATE_VBoxBS3KitImg64_CTOOL      := Bs3Vcc64
    442  TEMPLATE_VBoxBS3KitImg64_CXXTOOL    := Bs3Vcc64
    443  TEMPLATE_VBoxBS3KitImg64_CFLAGS      = -Zi -O1 -Oi -GF -GS- -Gy -Gs65536
    444  TEMPLATE_VBoxBS3KitImg64_CXXFLAGS    = -Zi -O1 -Oi -GF -GS- -Gy -Gs65536
    445 else
    446  TEMPLATE_VBoxBS3KitImg64_CTOOL      := Bs3Gcc64Elf64
    447  TEMPLATE_VBoxBS3KitImg64_CXXTOOL    := Bs3Gcc64Elf64
    448  # Note! -mx32 would be exactly what we needed here, however it causes internal compiler errors with 4.8.4 on gentoo.
    449  TEMPLATE_VBoxBS3KitImg64_CFLAGS      = -m64 -maccumulate-outgoing-args -g -Os -fno-omit-frame-pointer $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_WARN_PEDANTIC_C)
    450  TEMPLATE_VBoxBS3KitImg64_CXXFLAGS    = -m64 -maccumulate-outgoing-args -g -Os -fno-omit-frame-pointer $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_WARN_PEDANTIC_CXX)
    451 endif
    452 TEMPLATE_VBoxBS3KitImg64_LDTOOL       = VBoxBsUnusedLd
    453 
    454 # BS3Kit template for the bootsector.
    455 TEMPLATE_VBoxBS3KitBS = Template for building BS3Kit test images.
    456 TEMPLATE_VBoxBS3KitBS_BLD_TRG         = os-agnostic
    457 TEMPLATE_VBoxBS3KitBS_BLD_TRG_ARCH    = x86
    458 TEMPLATE_VBoxBS3KitBS_INST            = $(INST_VALIDATIONKIT)bootsectors/
    459 TEMPLATE_VBoxBS3KitBS_INSTTYPE        = none
    460 TEMPLATE_VBoxBS3KitBS_BINSUFF         = .img
    461 TEMPLATE_VBoxBS3KitBS_MODE            = 0644
    462 TEMPLATE_VBoxBS3KitBS_ASTOOL          = YASM
    463 TEMPLATE_VBoxBS3KitBS_ASFLAGS         = -f bin --mapfile
    464 TEMPLATE_VBoxBS3KitBS_ASDEFS          = ASM_FORMAT_BIN RT_NOINC_SEGMENTS ARCH_BITS=16 __YASM__
    465 TEMPLATE_VBoxBS3KitBS_INCS            = $(VBOX_PATH_BS3KIT_SRC) .
    466 TEMPLATE_VBoxBS3KitBS_LDTOOL          = VBoxBsCpLd
    467 
    468 #
    469 # ----- Config.kmk: end -----
    470 #
    47142
    47243
     
    47546bs3-bootsector_TEMPLATE = VBoxBS3KitBS
    47647bs3-bootsector_SOURCES  = bs3-bootsector.asm
     48
    47749
    47850#
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