VirtualBox

source: vbox/trunk/src/VBox/ValidationKit/bootsectors/Config.kmk@ 60539

Last change on this file since 60539 was 60539, checked in by vboxsync, 9 years ago

bs3kit: Updates.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 36.2 KB
Line 
1# $Id: Config.kmk 60539 2016-04-18 14:09:39Z vboxsync $
2## @file
3# kBuild Configuration file for VirtualBox Boot Sector Kit 3.
4#
5
6#
7# Copyright (C) 2010-2016 Oracle Corporation
8#
9# This file is part of VirtualBox Open Source Edition (OSE), as
10# available from http://www.virtualbox.org. This file is free software;
11# you can redistribute it and/or modify it under the terms of the GNU
12# General Public License (GPL) as published by the Free Software
13# Foundation, in version 2 as it comes in the "COPYING" file of the
14# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16#
17# The contents of this file may alternatively be used under the terms
18# of the Common Development and Distribution License Version 1.0
19# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20# VirtualBox OSE distribution, in which case the provisions of the
21# CDDL are applicable instead of those of the GPL.
22#
23# You may elect to license modified versions of this file under the
24# terms and conditions of either the GPL or the CDDL or both.
25#
26
27VBOX_BOOTSECTORS_CONFIG_KMK_INCLUDED = 1
28
29# Include the parent configure file.
30ifndef VBOX_VALIDATIONKIT_CONFIG_KMK_INCLUDED
31 include $(PATH_ROOT)/src/VBox/ValidationKit/Config.kmk
32endif
33
34# Add our 32-bit and 64-bit C properties.
35KBUILD_COMPILE_CATEGTORIES += C32 C64
36PROPS_TOOLS += C32TOOL C64TOOL
37PROPS_SINGLE += C32TOOL C64TOOL C32OBJSUFF C64OBJSUFF
38PROPS_ACCUMULATE_R += C32FLAGS C64FLAGS C32DEFS C64DEFS
39PROPS_ACCUMULATE_L += C32INCS C64INCS
40
41if 0 # Adding as few as possible new properties.
42KBUILD_COMPILE_CATEGTORIES += C16
43PROPS_TOOLS += C16TOOL
44PROPS_SINGLE += C16TOOL C16OBJSUFF
45PROPS_ACCUMULATE_R += C16FLAGS C16DEFS
46PROPS_ACCUMULATE_L += C16INCS
47endif
48
49# Add noarch to the architectures list (will be there by default in a new kBuild).
50KBUILD_ARCHES += noarch
51
52
53# The bs3kit source directory.
54VBOX_PATH_BS3KIT_SRC = $(VBOX_PATH_VALIDATIONKIT_SRC)/bootsectors/bs3kit
55
56
57# The 16-bit code & data segment classes.
58if 1
59BS3KIT_CLASS_CODE16 = CODE
60BS3KIT_SEGNM_DATA16 =
61BS3KIT_CLASS_DATA16 = DATA
62BS3KIT_GRPNM_DATA16 = DGROUP
63BS3KIT_CLASS_BSS16 = BSS
64else
65BS3KIT_CLASS_CODE16 = BS3CLASS16CODE
66BS3KIT_SEGNM_DATA16 = BS3DATA16
67BS3KIT_CLASS_DATA16 = FAR_DATA
68BS3KIT_GRPNM_DATA16 = BS3DATA16_GROUP
69BS3KIT_CLASS_BSS16 = ???
70endif
71
72
73##
74# Macro for generating near-call aliases for zero or more 16-bit C functions.
75# @param 1 The target name.
76# @param 2 List of functions.
77BS3KIT_FN_GEN_NEARSTUBS = $(foreach fn,$2,$(evalcall2 def_Bs3KitGenNearStubSource,$1,$(fn)))
78define def_Bs3KitGenNearStubSource
79$1_SOURCES += $$($1_0_OUTDIR)/near-call-to-$2_f16.asm
80$1_CLEAN += $$($1_0_OUTDIR)/near-call-to-$2_f16.asm
81$$$$($1_0_OUTDIR)/near-call-to-$2_f16.asm: | $$$$(dir $$$$@)
82 $(QUIET)$(APPEND) -tn $$@ \
83 '%include "bs3kit.mac"' \
84 'BS3_BEGIN_TEXT16' \
85 ' extern _$2_f16' \
86 'BS3_BEGIN_TEXT16_NEARSTUBS' \
87 'BS3_GLOBAL_NAME_EX _$2_c16, function, 6' \
88 ' pop ax' \
89 ' push cs' \
90 ' push ax' \
91 ' jmp _$2_f16 wrt CGROUP16'
92endef
93
94
95#
96# Tools Tools Tools
97# Tools Tools Tools
98# Tools Tools Tools
99#
100
101# Dummy CP "linker" tool.
102TOOL_VBoxBsCpLd = Dummy copy linker.
103TOOL_VBoxBsCpLd_LINK_MISCBIN_OUTPUT =
104TOOL_VBoxBsCpLd_LINK_MISCBIN_DEPEND =
105TOOL_VBoxBsCpLd_LINK_MISCBIN_DEPORD =
106define TOOL_VBoxBsCpLd_LINK_MISCBIN_CMDS
107 $(CP) -- $(objs) $(othersrc) "$(out)"
108endef
109
110# Dummy exit 1 "linker" tool.
111TOOL_VBoxBsUnusedLd = Dummy unused linker.
112TOOL_VBoxBsUnusedLd_LINK_MISCBIN_OUTPUT =
113TOOL_VBoxBsUnusedLd_LINK_MISCBIN_DEPEND =
114TOOL_VBoxBsUnusedLd_LINK_MISCBIN_DEPORD =
115define TOOL_VBoxBsUnusedLd_LINK_MISCBIN_CMDS
116 echo "cannot use this template for linking"
117 exit 1
118endef
119
120# NASM tool with dependency workarounds (change dir to force consistent results; add -MP).
121# Requires http://permalink.gmane.org/gmane.comp.lang.nasm.devel/3704 to work.
122include $(KBUILD_PATH)/tools/NASM.kmk
123TOOL_VBoxNasm = Our version of the NASM tool
124ifndef TOOL_VBoxNasm_PATH
125 TOOL_VBoxNasm_PATH := $(firstword $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST)/nasm/v*.*)))
126 if "$(TOOL_VBoxNasm_PATH)" == "" && "$(KBUILD_DEVTOOLS_HST_ALT)" != ""
127 TOOL_VBoxNasm_PATH := $(firstword $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST_ALT)/nasm/v*.*)))
128 endif
129endif
130ifneq ($(TOOL_VBoxNasm_PATH),)
131 TOOL_VBoxNasm_AS ?= $(TOOL_VBoxNasm_PATH)/nasm$(HOSTSUFF_EXE)
132else
133 TOOL_VBoxNasm_AS ?= nasm$(HOSTSUFF_EXE)
134endif
135TOOL_VBoxNasm_ASFLAGS ?= $(TOOL_NASM_ASFLAGS)
136TOOL_VBoxNasm_COMPILE_AS_OUTPUT = $(outbase).lst
137TOOL_VBoxNasm_COMPILE_AS_DEPEND = $(VBoxBs3ObjConverter_1_TARGET)
138TOOL_VBoxNasm_COMPILE_AS_DEPORD =
139define TOOL_VBoxNasm_COMPILE_AS_CMDS
140 $(QUIET)$(REDIRECT) -C $(PATH_OUT_BASE) -- $(TOOL_VBoxNasm_AS)\
141 $(flags) $(addsuffix /,$(addprefix -i, $(incs))) $(addprefix -D, $(defs))\
142 -l $(outbase).lst\
143 -o $(obj)\
144 $(abspath $(source))
145 $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
146 $(QUIET)$(REDIRECT) -C $(PATH_OUT_BASE) -wo $(dep) -- $(TOOL_VBoxNasm_AS)\
147 $(flags) $(addsuffix /,$(addprefix -i, $(incs))) $(addprefix -D, $(defs))\
148 -l $(outbase).lst\
149 -o $(obj)\
150 $(abspath $(source)) \
151 -M -MP
152endef
153
154# Dropped by the time 2.12 rc7 got out. Just struggling rebuilding nasm.
155if "$(KBUILD_TARGET)" == "darwin"
156 BS3KIT_NASM_allow_64_bit = --allow-64-bit
157endif
158
159#
160# ELF 64-bit compiler tool with object conversion.
161#
162# Mac needs cross compiler: sudo port install x86_64-elf-gcc
163#
164TOOL_Bs3Gcc64Elf64 := AMD64/ELF64 gcc/g++ (cross) compiler.
165ifeq ($(KBUILD_HOST),darwin)
166 TOOL_Bs3Gcc64Elf64_CC ?= x86_64-elf-gcc$(HOSTSUFF_EXE) -m64
167 TOOL_Bs3Gcc64Elf64_CXX ?= x86_64-elf-g++$(HOSTSUFF_EXE) -m64
168else
169 TOOL_Bs3Gcc64Elf64_CC ?= gcc$(HOSTSUFF_EXE) -m64
170 TOOL_Bs3Gcc64Elf64_CXX ?= g++$(HOSTSUFF_EXE) -m64
171endif
172ifdef SLKRUNS
173 TOOL_Bs3Gcc64Elf64_CC += -fmessage-length=0
174 TOOL_Bs3Gcc64Elf64_CXX += -fmessage-length=0
175endif
176TOOL_Bs3Gcc64Elf64_COBJSUFF = .o64
177TOOL_Bs3Gcc64Elf64_CFLAGS = -x c
178TOOL_Bs3Gcc64Elf64_CFLAGS.debug = -g
179TOOL_Bs3Gcc64Elf64_CFLAGS.profile = -O2 #-g -pg
180TOOL_Bs3Gcc64Elf64_CFLAGS.release = -O2
181TOOL_Bs3Gcc64Elf64_CINCS =
182TOOL_Bs3Gcc64Elf64_CDEFS =
183TOOL_Bs3Gcc64Elf64_COMPILE_C_DEPEND = $(VBoxBs3ObjConverter_1_TARGET)
184TOOL_Bs3Gcc64Elf64_COMPILE_C_DEPORD =
185TOOL_Bs3Gcc64Elf64_COMPILE_C_OUTPUT =
186TOOL_Bs3Gcc64Elf64_COMPILE_C_OUTPUT_MAYBE = $(obj).orignal
187define TOOL_Bs3Gcc64Elf64_COMPILE_C_CMDS
188 $(QUIET)$(TOOL_Bs3Gcc64Elf64_CC) -c\
189 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
190 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
191 -o $(obj)\
192 $(abspath $(source))
193 $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
194 $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
195endef
196
197TOOL_Bs3Gcc64Elf64_C64OBJSUFF = $(TOOL_Bs3Gcc64Elf64_COBJSUFF)
198TOOL_Bs3Gcc64Elf64_C64FLAGS = $(TOOL_Bs3Gcc64Elf64_CFLAGS)
199TOOL_Bs3Gcc64Elf64_C64FLAGS.debug = $(TOOL_Bs3Gcc64Elf64_CFLAGS.debug)
200TOOL_Bs3Gcc64Elf64_C64FLAGS.profile = $(TOOL_Bs3Gcc64Elf64_CFLAGS.profile)
201TOOL_Bs3Gcc64Elf64_C64FLAGS.release = $(TOOL_Bs3Gcc64Elf64_CFLAGS.release)
202TOOL_Bs3Gcc64Elf64_C64INCS = $(TOOL_Bs3Gcc64Elf64_CINCS)
203TOOL_Bs3Gcc64Elf64_C64DEFS = $(TOOL_Bs3Gcc64Elf64_CDEFS)
204TOOL_Bs3Gcc64Elf64_COMPILE_C64_DEPEND = $(TOOL_Bs3Gcc64Elf64_COMPILE_C_DEPEND)
205TOOL_Bs3Gcc64Elf64_COMPILE_C64_DEPORD = $(TOOL_Bs3Gcc64Elf64_COMPILE_C_DEPORD)
206TOOL_Bs3Gcc64Elf64_COMPILE_C64_OUTPUT = $(TOOL_Bs3Gcc64Elf64_COMPILE_C_OUTPUT)
207TOOL_Bs3Gcc64Elf64_COMPILE_C64_OUTPUT_MAYBE = $(TOOL_Bs3Gcc64Elf64_COMPILE_C_OUTPUT_MAYBE)
208define TOOL_Bs3Gcc64Elf64_COMPILE_C64_CMDS
209$(TOOL_Bs3Gcc64Elf64_COMPILE_C_CMDS)
210endef
211
212TOOL_Bs3Gcc64Elf64_CXXOBJSUFF ?= .o
213TOOL_Bs3Gcc64Elf64_CXXFLAGS ?=
214TOOL_Bs3Gcc64Elf64_CXXFLAGS.debug ?= -g0 # no debug info, thank you
215TOOL_Bs3Gcc64Elf64_CXXFLAGS.profile ?= -O2 #-g -pg
216TOOL_Bs3Gcc64Elf64_CXXFLAGS.release ?= -O2
217TOOL_Bs3Gcc64Elf64_CXXINCS ?=
218TOOL_Bs3Gcc64Elf64_CXXDEFS ?=
219TOOL_Bs3Gcc64Elf64_COMPILE_CXX_DEPEND = $(VBoxBs3ObjConverter_1_TARGET)
220TOOL_Bs3Gcc64Elf64_COMPILE_CXX_DEPORD =
221TOOL_Bs3Gcc64Elf64_COMPILE_CXX_OUTPUT =
222TOOL_Bs3Gcc64Elf64_COMPILE_CXX_OUTPUT_MAYBE = $(obj).orignal
223define TOOL_Bs3Gcc64Elf64_COMPILE_CXX_CMDS
224 $(QUIET)$(TOOL_Bs3Gcc64Elf64_CXX) -c\
225 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
226 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
227 -o $(obj)\
228 $(abspath $(source))
229 $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
230 $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
231endef
232
233#
234# Visual C++ tool variant that runs the object converter afterwards.
235#
236TOOL_Bs3Vcc64 := Visual C++ 64-bit
237TOOL_Bs3Vcc64_CC = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_CC)
238TOOL_Bs3Vcc64_CXX = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_CXX)
239TOOL_Bs3Vcc64_COBJSUFF = .o64
240TOOL_Bs3Vcc64_CFLAGS = $(filter-out -TC,$(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_CFLAGS)) -TC
241TOOL_Bs3Vcc64_CFLAGS.debug =
242TOOL_Bs3Vcc64_CFLAGS.dbgopt = -O1
243TOOL_Bs3Vcc64_CFLAGS.profile = -O1
244TOOL_Bs3Vcc64_CFLAGS.release = -O1
245TOOL_Bs3Vcc64_CINCS = $(PATH_TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_INC)
246TOOL_Bs3Vcc64_CDEFS =
247TOOL_Bs3Vcc64_COMPILE_C_DEPEND = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_C_DEPEND) $(VBoxBs3ObjConverter_1_TARGET)
248TOOL_Bs3Vcc64_COMPILE_C_DEPORD = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_C_DEPORD)
249TOOL_Bs3Vcc64_COMPILE_C_OUTPUT = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_C_OUTPUT)
250TOOL_Bs3Vcc64_COMPILE_C_OUTPUT_MAYBE = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_C_OUTPUT_MAYBE) $(obj).orignal
251define TOOL_Bs3Vcc64_COMPILE_C_CMDS
252$(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_C_CMDS)
253 $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
254endef
255
256TOOL_Bs3Vcc64_C64OBJSUFF = $(TOOL_Bs3Vcc64_COBJSUFF)
257TOOL_Bs3Vcc64_C64FLAGS = $(TOOL_Bs3Vcc64_CFLAGS)
258TOOL_Bs3Vcc64_C64FLAGS.debug = $(TOOL_Bs3Vcc64_CFLAGS.debug)
259TOOL_Bs3Vcc64_C64FLAGS.dbgopt = $(TOOL_Bs3Vcc64_CFLAGS.dbgopt)
260TOOL_Bs3Vcc64_C64FLAGS.profile = $(TOOL_Bs3Vcc64_CFLAGS.profile)
261TOOL_Bs3Vcc64_C64FLAGS.release = $(TOOL_Bs3Vcc64_CFLAGS.release)
262TOOL_Bs3Vcc64_C64INCS = $(TOOL_Bs3Vcc64_CINCS)
263TOOL_Bs3Vcc64_C64DEFS = $(TOOL_Bs3Vcc64_CDEFS)
264TOOL_Bs3Vcc64_COMPILE_C64_DEPEND = $(TOOL_Bs3Vcc64_COMPILE_C_DEPEND)
265TOOL_Bs3Vcc64_COMPILE_C64_DEPORD = $(TOOL_Bs3Vcc64_COMPILE_C_DEPORD)
266TOOL_Bs3Vcc64_COMPILE_C64_OUTPUT = $(TOOL_Bs3Vcc64_COMPILE_C_OUTPUT)
267TOOL_Bs3Vcc64_COMPILE_C64_OUTPUT_MAYBE = $(TOOL_Bs3Vcc64_COMPILE_C_OUTPUT_MAYBE)
268define TOOL_Bs3Vcc64_COMPILE_C64_CMDS
269$(TOOL_Bs3Vcc64_COMPILE_C_CMDS)
270endef
271
272TOOL_Bs3Vcc64_CXXOBJSUFF = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_CXXOBJSUFF)
273TOOL_Bs3Vcc64_CXXFLAGS = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_CXXFLAGS) -TP
274TOOL_Bs3Vcc64_CXXFLAGS.debug =
275TOOL_Bs3Vcc64_CXXFLAGS.dbgopt = -O1
276TOOL_Bs3Vcc64_CXXFLAGS.profile = -O1
277TOOL_Bs3Vcc64_CXXFLAGS.release = -O1
278TOOL_Bs3Vcc64_CXXINCS = $(PATH_TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_INC)
279TOOL_Bs3Vcc64_CXXDEFS =
280TOOL_Bs3Vcc64_COMPILE_CXX_DEPEND = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_CXX_DEPEND) $(VBoxBs3ObjConverter_1_TARGET)
281TOOL_Bs3Vcc64_COMPILE_CXX_DEPORD = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_CXX_DEPORD)
282TOOL_Bs3Vcc64_COMPILE_CXX_OUTPUT = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_CXX_OUTPUT)
283TOOL_Bs3Vcc64_COMPILE_CXX_OUTPUT_MAYBE = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_CXX_OUTPUT_MAYBE) $(obj).orignal
284define TOOL_Bs3Vcc64_COMPILE_CXX_CMDS
285$(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_CXX_CMDS)
286 $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
287endef
288
289#
290# 32-bit OpenWatcom C/C++ tool variant that runs the object converter afterwards
291# to rename intrinsic functions so they don't clash with the 16-bit compiler.
292#
293TOOL_Bs3Ow32 := OpenWatcom C/C++ 32-bit with object convertsion
294TOOL_Bs3Ow32_CC = $(TOOL_OPENWATCOM_CC)
295TOOL_Bs3Ow32_CXX = $(TOOL_OPENWATCOM_CXX)
296TOOL_Bs3Ow32_COBJSUFF = .o32
297TOOL_Bs3Ow32_CFLAGS = $(TOOL_OPENWATCOM_CFLAGS)
298# -adfs \ - This is too complicated and it doesn't support stubbing files (svn rename fun.h pain.h). Use kDepObj instead.
299# -ad=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(dep)) \
300# -adt=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(obj)) \
301# -add=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(abspath $(source))) \
302# -adhp=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(dir $(abspath $(source))))
303TOOL_Bs3Ow32_CFLAGS.debug = $(TOOL_OPENWATCOM_CFLAGS.debug)
304TOOL_Bs3Ow32_CFLAGS.dbgopt = $(TOOL_OPENWATCOM_CFLAGS.dbgopt)
305TOOL_Bs3Ow32_CFLAGS.profile = $(TOOL_OPENWATCOM_CFLAGS.profile)
306TOOL_Bs3Ow32_CFLAGS.release = $(TOOL_OPENWATCOM_CFLAGS.release)
307TOOL_Bs3Ow32_CINCS = $(TOOL_OPENWATCOM_CINCS)
308TOOL_Bs3Ow32_CDEFS =
309TOOL_Bs3Ow32_COMPILE_C_DEPEND = $(TOOL_OPENWATCOM_COMPILE_C_DEPEND) $(VBoxBs3ObjConverter_1_TARGET)
310TOOL_Bs3Ow32_COMPILE_C_DEPORD = $(TOOL_OPENWATCOM_COMPILE_C_DEPORD)
311TOOL_Bs3Ow32_COMPILE_C_OUTPUT = $(TOOL_OPENWATCOM_COMPILE_C_OUTPUT)
312TOOL_Bs3Ow32_COMPILE_C_OUTPUT_MAYBE = $(TOOL_OPENWATCOM_COMPILE_C_OUTPUT_MAYBE) $(obj).orignal
313define TOOL_Bs3Ow32_COMPILE_C_CMDS
314$(TOOL_OPENWATCOM_COMPILE_C_CMDS)
315 $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
316 $(QUIET)$(REDIRECT) -wo /dev/null -- $(KBUILD_BIN_PATH)/kDepObj$(HOSTSUFF_EXE) -s -f -q -o "$(dep)" -t "$(obj)" "$(obj)"
317endef
318
319TOOL_Bs3Ow32_C32OBJSUFF = $(TOOL_Bs3Ow32_COBJSUFF)
320TOOL_Bs3Ow32_C32FLAGS = $(TOOL_Bs3Ow32_CFLAGS)
321TOOL_Bs3Ow32_C32FLAGS.debug = $(TOOL_Bs3Ow32_CFLAGS.debug)
322TOOL_Bs3Ow32_C32FLAGS.dbgopt = $(TOOL_Bs3Ow32_CFLAGS.dbgopt)
323TOOL_Bs3Ow32_C32FLAGS.profile = $(TOOL_Bs3Ow32_CFLAGS.profile)
324TOOL_Bs3Ow32_C32FLAGS.release = $(TOOL_Bs3Ow32_CFLAGS.release)
325TOOL_Bs3Ow32_C32INCS = $(TOOL_Bs3Ow32_CINCS)
326TOOL_Bs3Ow32_C32DEFS =
327TOOL_Bs3Ow32_COMPILE_C32_DEPEND = $(TOOL_Bs3Ow32_COMPILE_C_DEPEND)
328TOOL_Bs3Ow32_COMPILE_C32_DEPORD = $(TOOL_Bs3Ow32_COMPILE_C_DEPORD)
329TOOL_Bs3Ow32_COMPILE_C32_OUTPUT = $(TOOL_Bs3Ow32_COMPILE_C_OUTPUT)
330TOOL_Bs3Ow32_COMPILE_C32_OUTPUT_MAYBE = $(TOOL_Bs3Ow32_COMPILE_C_OUTPUT_MAYBE)
331define TOOL_Bs3Ow32_COMPILE_C32_CMDS
332$(TOOL_Bs3Ow32_COMPILE_C_CMDS)
333endef
334
335TOOL_Bs3Ow32_CXXOBJSUFF = $(TOOL_OPENWATCOM_CXXOBJSUFF)
336TOOL_Bs3Ow32_CXXFLAGS = $(TOOL_OPENWATCOM_CXXFLAGS) -ad=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(dep)) -adfs
337TOOL_Bs3Ow32_CXXFLAGS.debug = $(TOOL_OPENWATCOM_CXXFLAGS.debug)
338TOOL_Bs3Ow32_CXXFLAGS.dbgopt = $(TOOL_OPENWATCOM_CXXFLAGS.dbgopt)
339TOOL_Bs3Ow32_CXXFLAGS.profile = $(TOOL_OPENWATCOM_CXXFLAGS.profile)
340TOOL_Bs3Ow32_CXXFLAGS.release = $(TOOL_OPENWATCOM_CXXFLAGS.release)
341TOOL_Bs3Ow32_CXXINCS = $(TOOL_OPENWATCOM_CXXINCS)
342TOOL_Bs3Ow32_CXXDEFS =
343TOOL_Bs3Ow32_COMPILE_CXX_DEPEND = $(TOOL_OPENWATCOM_COMPILE_CXX_DEPEND) $(VBoxBs3ObjConverter_1_TARGET)
344TOOL_Bs3Ow32_COMPILE_CXX_DEPORD = $(TOOL_OPENWATCOM_COMPILE_CXX_DEPORD)
345TOOL_Bs3Ow32_COMPILE_CXX_OUTPUT = $(TOOL_OPENWATCOM_COMPILE_CXX_OUTPUT)
346TOOL_Bs3Ow32_COMPILE_CXX_OUTPUT_MAYBE = $(TOOL_OPENWATCOM_COMPILE_CXX_OUTPUT_MAYBE) $(obj).orignal
347define TOOL_Bs3Ow32_COMPILE_CXX_CMDS
348$(TOOL_OPENWATCOM_COMPILE_CXX_CMDS)
349 $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
350 $(QUIET)$(REDIRECT) -wo /dev/null -- $(KBUILD_BIN_PATH)/kDepObj$(HOSTSUFF_EXE) -s -f -q -o "$(dep)" -t "$(obj)" "$(obj)"
351endef
352
353
354#
355# 16-bit OpenWatcom C/C++ tool variant that runs the object converter afterwards
356# to rename intrinsic functions so they don't clash with the 16-bit compiler.
357#
358TOOL_Bs3Ow16 := OpenWatcom C/C++ 16-bit with object convertsion
359TOOL_Bs3Ow16_CC = $(TOOL_OPENWATCOM-16_CC)
360TOOL_Bs3Ow16_CXX = $(TOOL_OPENWATCOM-16_CXX)
361TOOL_Bs3Ow16_COBJSUFF = .o16
362TOOL_Bs3Ow16_CFLAGS = $(TOOL_OPENWATCOM-16_CFLAGS)
363TOOL_Bs3Ow16_CFLAGS.debug = $(TOOL_OPENWATCOM-16_CFLAGS.debug)
364TOOL_Bs3Ow16_CFLAGS.dbgopt = $(TOOL_OPENWATCOM-16_CFLAGS.dbgopt)
365TOOL_Bs3Ow16_CFLAGS.profile = $(TOOL_OPENWATCOM-16_CFLAGS.profile)
366TOOL_Bs3Ow16_CFLAGS.release = $(TOOL_OPENWATCOM-16_CFLAGS.release)
367TOOL_Bs3Ow16_CINCS = $(TOOL_OPENWATCOM-16_CINCS)
368TOOL_Bs3Ow16_CDEFS =
369TOOL_Bs3Ow16_COMPILE_C_DEPEND = $(TOOL_OPENWATCOM-16_COMPILE_C_DEPEND) $(VBoxBs3ObjConverter_1_TARGET)
370TOOL_Bs3Ow16_COMPILE_C_DEPORD = $(TOOL_OPENWATCOM-16_COMPILE_C_DEPORD)
371TOOL_Bs3Ow16_COMPILE_C_OUTPUT = $(TOOL_OPENWATCOM-16_COMPILE_C_OUTPUT)
372TOOL_Bs3Ow16_COMPILE_C_OUTPUT_MAYBE = $(TOOL_OPENWATCOM-16_COMPILE_C_OUTPUT_MAYBE)
373define TOOL_Bs3Ow16_COMPILE_C_CMDS
374$(TOOL_OPENWATCOM-16_COMPILE_C_CMDS)
375 $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
376 $(QUIET)$(REDIRECT) -wo /dev/null -- $(KBUILD_BIN_PATH)/kDepObj$(HOSTSUFF_EXE) -s -f -q -o "$(dep)" -t "$(obj)" "$(obj)"
377endef
378
379TOOL_Bs3Ow16_C16OBJSUFF = $(TOOL_Bs3Ow16_C16OBJSUFF)
380TOOL_Bs3Ow16_C16FLAGS = $(TOOL_Bs3Ow16_C16FLAGS)
381TOOL_Bs3Ow16_C16FLAGS.debug = $(TOOL_Bs3Ow16_C16FLAGS.debug)
382TOOL_Bs3Ow16_C16FLAGS.dbgopt = $(TOOL_Bs3Ow16_C16FLAGS.dbgopt)
383TOOL_Bs3Ow16_C16FLAGS.profile = $(TOOL_Bs3Ow16_C16FLAGS.profile)
384TOOL_Bs3Ow16_C16FLAGS.release = $(TOOL_Bs3Ow16_C16FLAGS.release)
385TOOL_Bs3Ow16_C16INCS = $(TOOL_Bs3Ow16_C16INCS)
386TOOL_Bs3Ow16_C16DEFS = $(TOOL_Bs3Ow16_C16DEFS)
387TOOL_Bs3Ow16_COMPILE_C16_DEPEND = $(TOOL_Bs3Ow16_COMPILE_C16_DEPEND)
388TOOL_Bs3Ow16_COMPILE_C16_DEPORD = $(TOOL_Bs3Ow16_COMPILE_C16_DEPORD)
389TOOL_Bs3Ow16_COMPILE_C16_OUTPUT = $(TOOL_Bs3Ow16_COMPILE_C16_OUTPUT)
390TOOL_Bs3Ow16_COMPILE_C16_OUTPUT_MAYBE = $(TOOL_Bs3Ow16_COMPILE_C16_OUTPUT_MAYBE)
391define TOOL_Bs3Ow16_COMPILE_C16_CMDS
392$(TOOL_Bs3Ow16_COMPILE_C_CMDS)
393endef
394
395TOOL_Bs3Ow16_CXXOBJSUFF = $(TOOL_OPENWATCOM-16_CXXOBJSUFF)
396TOOL_Bs3Ow16_CXXFLAGS = $(TOOL_OPENWATCOM-16_CXXFLAGS)
397TOOL_Bs3Ow16_CXXFLAGS.debug = $(TOOL_OPENWATCOM-16_CXXFLAGS.debug)
398TOOL_Bs3Ow16_CXXFLAGS.dbgopt = $(TOOL_OPENWATCOM-16_CXXFLAGS.dbgopt)
399TOOL_Bs3Ow16_CXXFLAGS.profile = $(TOOL_OPENWATCOM-16_CXXFLAGS.profile)
400TOOL_Bs3Ow16_CXXFLAGS.release = $(TOOL_OPENWATCOM-16_CXXFLAGS.release)
401TOOL_Bs3Ow16_CXXINCS = $(TOOL_OPENWATCOM-16_CXXINCS)
402TOOL_Bs3Ow16_CXXDEFS =
403TOOL_Bs3Ow16_COMPILE_CXX_DEPEND = $(TOOL_OPENWATCOM-16_COMPILE_CXX_DEPEND) $(VBoxBs3ObjConverter_1_TARGET)
404TOOL_Bs3Ow16_COMPILE_CXX_DEPORD = $(TOOL_OPENWATCOM-16_COMPILE_CXX_DEPORD)
405TOOL_Bs3Ow16_COMPILE_CXX_OUTPUT = $(TOOL_OPENWATCOM-16_COMPILE_CXX_OUTPUT)
406TOOL_Bs3Ow16_COMPILE_CXX_OUTPUT_MAYBE = $(TOOL_OPENWATCOM-16_COMPILE_CXX_OUTPUT_MAYBE)
407define TOOL_Bs3Ow16_COMPILE_CXX_CMDS
408$(TOOL_OPENWATCOM-16_COMPILE_CXX_CMDS)
409 $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
410 $(QUIET)$(REDIRECT) -wo /dev/null -- $(KBUILD_BIN_PATH)/kDepObj$(HOSTSUFF_EXE) -s -f -q -o "$(dep)" -t "$(obj)" "$(obj)"
411endef
412
413# Debug info format depends on what we use for 64-bit.
414if1of ($(KBUILD_HOST), win)
415 BS3_OW_DBG_OPT = -hc -d1+
416 #BS3_OW_DBG_OPT = -hd -d1+
417 BS3_OW_DBG_LDOPT = codeview
418else
419 BS3_OW_DBG_OPT = -hd -d1+
420 BS3_OW_DBG_LDOPT = dwarf
421endif
422
423#
424# Source handlers for .c16, .c32 and .c64
425#
426define VBoxBs3KitImgSrcHandler_16bit_c
427local type := C
428 $(kb-src-one 2)
429endef
430
431C32TOOL = Bs3Ow32
432define VBoxBs3KitImgSrcHandler_32bit_c
433local type := C32
434 $(kb-src-one 2)
435endef
436
437define VBoxBs3KitImgSrcHandler_64bit_c
438local type := C64
439 $(kb-src-one 2)
440endef
441
442
443#
444# BS3Kit template for assembly and 16-bit code.
445#
446# Note! Using -d1 as -d1+ and -d2 causes suboptimal code to be generated (strlen
447# reloading string pointer argument all the time).
448# Update! -d1+ is required for line number information in code living in include
449# files and any DWARF stuff at all. So, we'll ignore poor code quality.
450# Note! Optimization options should come after debug stuff as -d2 for instance
451# disables all optimziations.
452# Note! We use BS3CLASS16CODE because of wdis code detection heuristics requires the class
453# of a code segment to be exactly 'CODE', or ending with 'CODE' or 'TEXT' (more
454# recent wdis have a -c=<clsnm> option, but not the one we currently use ).
455#
456#
457# Compiler options explained:
458# -nt=xxxx Sets the text segment name.
459# -nc=xxxx Sets the text segment class name.
460# -nd=xxxx Sets the data segment name.
461# -ecc Sets the default calling convension to __cdecl
462# Update: We don't use this in 16-bit code as it causes unfavorable reloading of DS before calling
463# inlined functions (e.g. iprt/asm.h). Instead we use -ecw and __cdecl where needed.
464# Update: With -zdp the DS reloading is gone. Code is slightly larger, but seems to cure stability
465# issues in bs3CpuBasic2_RaiseXcpt1 (workers ending up with default calling convention).
466# -ecw Sets the default calling convension to __watcall ()
467# -q Quiet, no logos or stuff.
468# -0 Use 8086 instruction set (16-bit only).
469# -3 Use 386 instruction set (16-bit only).
470# -wx Maxium warning level.
471# -zl Don't emit default library information.
472# -zdp DS pegged to BS3DATA16_GROUP/DGROUP.
473# -zu Assume SS != DS.
474# -mc Compact memory model, far data, small code.
475# -mf Flat memory model (32-bit).
476# -d+ Enabled better /dVAR=XXX parsing, using space as delimiter instead of alpha-numerical/whatever.
477# -d1 Debug info: Globals and line numbers.
478# -s No stack overflow checks.
479# -oa Relaxed aliasing constraints.
480# -ob Branch prediction.
481# -of Generate stack frames when needed.
482# -oi Inline instrinsics functions.
483# -ol Loop optimizations.
484# -or Reorder for best pipeline.
485# -os Favor size over speed.
486#
487TEMPLATE_VBoxBS3KitImg = Template for building BS3Kit test images.
488TEMPLATE_VBoxBS3KitImg_BLD_TRG = os-agnostic
489TEMPLATE_VBoxBS3KitImg_BLD_TRG_ARCH = noarch
490TEMPLATE_VBoxBS3KitImg_INST = $(INST_VALIDATIONKIT)bootsectors/
491TEMPLATE_VBoxBS3KitImg_BINSUFF = .img
492TEMPLATE_VBoxBS3KitImg_MODE = 0644
493TEMPLATE_VBoxBS3KitImg_SRC_HANDLERS = \
494 .c16:VBoxBs3KitImgSrcHandler_16bit_c \
495 .c32:VBoxBs3KitImgSrcHandler_32bit_c \
496 .c64:VBoxBs3KitImgSrcHandler_64bit_c
497TEMPLATE_VBoxBS3KitImg_ASOBJSUFF = .o16
498TEMPLATE_VBoxBS3KitImg_ASTOOL = VBoxNasm
499TEMPLATE_VBoxBS3KitImg_ASFLAGS = -f obj -g $(BS3KIT_NASM_allow_64_bit) -w+orphan-labels
500TEMPLATE_VBoxBS3KitImg_ASDEFS = ASM_FORMAT_OMF RT_NOINC_SEGMENTS __NASM__ ARCH_BITS=16 RT_ARCH_X86 \
501 BS3CLASS16CODE=$(BS3KIT_CLASS_CODE16) BS3KIT_CLASS_DATA16=$(BS3KIT_CLASS_DATA16) \
502 BS3KIT_GRPNM_DATA16=$(BS3KIT_GRPNM_DATA16) BS3KIT_CLASS_BSS16=$(BS3KIT_CLASS_BSS16)
503TEMPLATE_VBoxBS3KitImg_DEFS = IN_BS3KIT
504TEMPLATE_VBoxBS3KitImg_DEFS.debug = BS3_STRICT
505
506TEMPLATE_VBoxBS3KitImg_ARTOOL = OPENWATCOM-16
507
508TEMPLATE_VBoxBS3KitImg_CTOOL = Bs3Ow16
509TEMPLATE_VBoxBS3KitImg_CXXTOOL = Bs3Ow16
510TEMPLATE_VBoxBS3KitImg_CFLAGS = $(if $(BS3KIT_SEGNM_DATA16),-nd=$(BS3KIT_SEGNM_DATA16),) \
511 -nt=BS3TEXT16 -nc=$(BS3KIT_CLASS_CODE16) -ecc -q -0 -wx -zl -zdp -zu -mc $(BS3_OW_DBG_OPT) -s -oa -ob -of -oi -ol -or -os -d+
512TEMPLATE_VBoxBS3KitImg_CXXFLAGS = $(if $(BS3KIT_SEGNM_DATA16),-nd=$(BS3KIT_SEGNM_DATA16),) \
513 -nt=BS3TEXT16 -nc=$(BS3KIT_CLASS_CODE16) -ecc -q -0 -wx -zl -zdp -zu -mc $(BS3_OW_DBG_OPT) -s -oa -ob -of -oi -ol -or -os -d+
514TEMPLATE_VBoxBS3KitImg_CDEFS = ARCH_BITS=16 RT_ARCH_X86
515
516TEMPLATE_VBoxBS3KitImg_TOOL = $(NO_SUCH_VARIABLE)
517TEMPLATE_VBoxBS3KitImg_C16TOOL = $(TEMPLATE_VBoxBS3KitImg_CTOOL)
518TEMPLATE_VBoxBS3KitImg_C16FLAGS = $(TEMPLATE_VBoxBS3KitImg_CFLAGS)
519TEMPLATE_VBoxBS3KitImg_C16DEFS = $(TEMPLATE_VBoxBS3KitImg_CDEFS)
520TEMPLATE_VBoxBS3KitImg_C32TOOL := Bs3Ow32
521TEMPLATE_VBoxBS3KitImg_C32FLAGS = $(TEMPLATE_VBoxBS3KitImg32_CFLAGS)
522TEMPLATE_VBoxBS3KitImg_C32DEFS = ARCH_BITS=32 RT_ARCH_X86
523TEMPLATE_VBoxBS3KitImg_C64TOOL = $(TEMPLATE_VBoxBS3KitImg64_CTOOL)
524TEMPLATE_VBoxBS3KitImg_C64FLAGS = $(TEMPLATE_VBoxBS3KitImg64_CFLAGS)
525TEMPLATE_VBoxBS3KitImg_C64DEFS = ARCH_BITS=64 RT_ARCH_AMD64
526
527TEMPLATE_VBoxBS3KitImg_INCS = $(VBOX_PATH_BS3KIT_SRC) .
528TEMPLATE_VBoxBS3KitImg_LDTOOL = OPENWATCOM-WL
529# option quiet, nofarcalls\
530# disable 1014, 1023, 2120, 1080
531
532# linker options:
533# system dos: Link a 16-bit DOS binary.
534# output raw ...: Produce a raw DOS binary for loading at flat address 10000h.
535# The following is for ordering segments.
536# option start=_start: The start symbol in bs3-first-xxx.asm.
537# debug codeview/dwarf all: Full debug information either in codeview or dwarf.
538# option symfile: Produce a separate symbol file with the debug info.
539# option map: Produce a map file.
540# option statics: ?
541# option verbose: Verbose map file?
542# option disable 1014: Disable warning about
543# option disable 1080: Disable warning about
544# option disable 1150: Disable warning about
545#
546# Note! We're pushing DATA16 to 0x20000 because it's impossible to force wlink
547# to give us a real-mode + GDT compatible alignment (0ffffff80h), i.e.
548# real-mode address on the form 0fff8:0000.
549TEMPLATE_VBoxBS3KitImg_LDFLAGS = system dos \
550 debug $(BS3_OW_DBG_LDOPT) all \
551 option quiet, map, statics, verbose, symfile, start=_start \
552 disable 1014, 1080, 1150 \
553 \
554 output raw offset=0x10000 \
555 order \
556 clname BS3FLAT segaddr=0x0000 \
557 segment BS3FLAT segaddr=0x0000 \
558 clname $(BS3KIT_CLASS_CODE16) segaddr=0x1000 \
559 segment BS3TEXT16 \
560 segment BS3TEXT16_NEARSTUBS \
561 segment BS3TEXT16_FARSTUBS \
562 segment BS3TEXT16_END \
563 clname BS3SYSTEM16 segaddr=0x2000 \
564 segment BS3SYSTEM16 \
565$(if-expr "$(BS3KIT_SEGNM_DATA16)" == "", \
566 clname DATA \
567 segment BS3DATA16 segaddr=0x2900 \
568 segment BS3DATA16_DATA \
569 segment DATA \
570 segment _DATA \
571 segment BS3DATA16CONST \
572 segment CONST \
573 segment BS3DATA16CONST2 \
574 segment CONST2 \
575 segment STRINGS \
576 segment BS3DATA16_END \
577 clname BSS \
578 segment BSS \
579 segment _BSS \
580 segment BS3DATA16_END \
581 clname FAR_DATA \
582 segment FAR_DATA \
583, \
584 clname FAR_DATA \
585 segment BS3DATA16 segaddr=0x2900 \
586 segment FAR_DATA \
587 segment BS3DATA16CONST \
588 segment BS3DATA16CONST2 \
589 segment BS3DATA16_DATA \
590 segment BS3DATA16_END \
591) \
592 segment BS3DATA32 \
593 segment BS3DATA32CONST \
594 segment BS3DATA32CONST2 \
595 segment BS3DATA32_DATA \
596 segment BS3DATA32_BSS \
597 segment BS3DATA32_END \
598 \
599 segment BS3DATA64 \
600 segment BS3DATA64CONST \
601 segment BS3DATA64_BSS \
602 segment BS3DATA64_END \
603 clname BS3CLASS16RMCODE \
604 segment BS3RMCODE16_START \
605 segment BS3RMCODE16 \
606 segment BS3RMCODE16_END \
607 clname BS3CLASS16X0CODE \
608 segment BS3X0CODE16_START \
609 segment BS3X0CODE16 \
610 segment BS3X0CODE16_END \
611 clname BS3CLASS16X1CODE \
612 segment BS3X1CODE16_START \
613 segment BS3X1CODE16 \
614 segment BS3X1CODE16_END \
615 clname BS3CLASS32CODE \
616 segment BS3TEXT32_START \
617 segment BS3TEXT32 \
618 segment BS3TEXT32_END \
619 clname BS3CLASS64CODE \
620 segment BS3TEXT64_START \
621 segment BS3TEXT64 \
622 segment BS3TEXT64_END
623
624TEMPLATE_VBoxBS3KitImg_LNK_DEPS = \
625 $(bs3-bootsector_1_TARGET) \
626 $(VBoxBs3Linker_1_TARGET)
627TEMPLATE_VBoxBS3KitImg_POST_CMDS = $(if $(eq $(tool_do),LINK_LIBRARY)\
628 ,,$(QUIET)$(MV_EXT) -f -- "$(out)" "$(out).tmp" \
629 $$(NLTAB)$(QUIET)$(VBoxBs3Linker_1_TARGET) -o $(out) $(bs3-bootsector_1_TARGET) $(out).tmp \
630 $$(NLTAB)$(QUIET)$(RM_EXT) -f -- "$(out).tmp")
631
632TEMPLATE_VBoxBS3KitImg_LIBS = \
633 $(PATH_OBJ)/bs3kit-common-16/bs3kit-common-16.lib \
634 $(PATH_OBJ)/bs3kit-common-32/bs3kit-common-32.lib \
635 $(PATH_OBJ)/bs3kit-common-64/bs3kit-common-64.lib \
636 \
637 $(PATH_OBJ)/bs3kit-rm/bs3kit-rm.lib \
638 $(PATH_OBJ)/bs3kit-pe16/bs3kit-pe16.lib \
639 $(PATH_OBJ)/bs3kit-pe16_32/bs3kit-pe16_32.lib \
640 $(PATH_OBJ)/bs3kit-pe16_v86/bs3kit-pe16_v86.lib \
641 $(PATH_OBJ)/bs3kit-pe32/bs3kit-pe32.lib \
642 $(PATH_OBJ)/bs3kit-pe32_16/bs3kit-pe32_16.lib \
643 $(PATH_OBJ)/bs3kit-pev86/bs3kit-pev86.lib \
644 $(PATH_OBJ)/bs3kit-pp16/bs3kit-pp16.lib \
645 $(PATH_OBJ)/bs3kit-pp16_32/bs3kit-pp16_32.lib \
646 $(PATH_OBJ)/bs3kit-pp16_v86/bs3kit-pp16_v86.lib \
647 $(PATH_OBJ)/bs3kit-pp32/bs3kit-pp32.lib \
648 $(PATH_OBJ)/bs3kit-pp32_16/bs3kit-pp32_16.lib \
649 $(PATH_OBJ)/bs3kit-ppv86/bs3kit-ppv86.lib \
650 $(PATH_OBJ)/bs3kit-pae16/bs3kit-pae16.lib \
651 $(PATH_OBJ)/bs3kit-pae16_32/bs3kit-pae16_32.lib \
652 $(PATH_OBJ)/bs3kit-pae16_v86/bs3kit-pae16_v86.lib \
653 $(PATH_OBJ)/bs3kit-pae32/bs3kit-pae32.lib \
654 $(PATH_OBJ)/bs3kit-pae32_16/bs3kit-pae32_16.lib \
655 $(PATH_OBJ)/bs3kit-paev86/bs3kit-paev86.lib \
656 $(PATH_OBJ)/bs3kit-lm16/bs3kit-lm16.lib \
657 $(PATH_OBJ)/bs3kit-lm32/bs3kit-lm32.lib \
658 $(PATH_OBJ)/bs3kit-lm64/bs3kit-lm64.lib
659
660# BS3Kit template for 32-bit code.
661TEMPLATE_VBoxBS3KitImg32 = Template for building BS3Kit test images.
662TEMPLATE_VBoxBS3KitImg32_BLD_TRG = os-agnostic
663TEMPLATE_VBoxBS3KitImg32_BLD_TRG_ARCH = x86
664TEMPLATE_VBoxBS3KitImg32_INSTTYPE = none
665TEMPLATE_VBoxBS3KitImg32_ASTOOL = VBoxNasm
666TEMPLATE_VBoxBS3KitImg32_ASOBJSUFF = .o32
667TEMPLATE_VBoxBS3KitImg32_ASFLAGS = -f obj -g $(BS3KIT_NASM_allow_64_bit) -w+orphan-labels
668TEMPLATE_VBoxBS3KitImg32_ASDEFS = ASM_FORMAT_OMF RT_NOINC_SEGMENTS __NASM__ \
669 BS3CLASS16CODE=$(BS3KIT_CLASS_CODE16) BS3KIT_CLASS_DATA16=$(BS3KIT_CLASS_DATA16) \
670 BS3KIT_GRPNM_DATA16=$(BS3KIT_GRPNM_DATA16) BS3KIT_CLASS_BSS16=$(BS3KIT_CLASS_BSS16)
671TEMPLATE_VBoxBS3KitImg32_DEFS = ARCH_BITS=32 IN_BS3KIT
672TEMPLATE_VBoxBS3KitImg32_DEFS.debug = BS3_STRICT
673TEMPLATE_VBoxBS3KitImg32_ARTOOL = OPENWATCOM
674TEMPLATE_VBoxBS3KitImg32_CTOOL = Bs3Ow32
675TEMPLATE_VBoxBS3KitImg32_CXXTOOL = Bs3Ow32
676TEMPLATE_VBoxBS3KitImg32_CFLAGS = \
677 -nt=BS3TEXT32 -nd=BS3DATA32 -nc=BS3CLASS32CODE -ecc -q -wx -zl -mf $(BS3_OW_DBG_OPT) -s -oa -ob -of -oi -ol -or -os -d+
678TEMPLATE_VBoxBS3KitImg32_CXXFLAGS = \
679 -nt=BS3TEXT32 -nd=BS3DATA32 -nc=BS3CLASS32CODE -ecc -q -wx -zl -mf $(BS3_OW_DBG_OPT) -s -oa -ob -of -oi -ol -or -os -d+
680TEMPLATE_VBoxBS3KitImg32_INCS = $(VBOX_PATH_BS3KIT_SRC) .
681TEMPLATE_VBoxBS3KitImg32_LDTOOL = VBoxBsUnusedLd
682
683# BS3Kit template for 64-bit code.
684TEMPLATE_VBoxBS3KitImg64 = Template for building BS3Kit test images.
685TEMPLATE_VBoxBS3KitImg64_BLD_TRG = os-agnostic
686TEMPLATE_VBoxBS3KitImg64_BLD_TRG_ARCH = amd64
687TEMPLATE_VBoxBS3KitImg64_INSTTYPE = none
688TEMPLATE_VBoxBS3KitImg64_ASTOOL = VBoxNasm
689TEMPLATE_VBoxBS3KitImg64_ASOBJSUFF = .o64
690TEMPLATE_VBoxBS3KitImg64_ASFLAGS = -f obj -g $(BS3KIT_NASM_allow_64_bit) -w+orphan-labels
691TEMPLATE_VBoxBS3KitImg64_ASDEFS = ASM_FORMAT_OMF ASM_CALL64_MSC RT_NOINC_SEGMENTS __NASM__ \
692 BS3CLASS16CODE=$(BS3KIT_CLASS_CODE16) BS3KIT_CLASS_DATA16=$(BS3KIT_CLASS_DATA16) \
693 BS3KIT_GRPNM_DATA16=$(BS3KIT_GRPNM_DATA16) BS3KIT_CLASS_BSS16=$(BS3KIT_CLASS_BSS16)
694TEMPLATE_VBoxBS3KitImg64_DEFS = IN_BS3KIT ARCH_BITS=64
695TEMPLATE_VBoxBS3KitImg64_DEFS.debug = BS3_STRICT
696TEMPLATE_VBoxBS3KitImg64_ARTOOL = OPENWATCOM
697TEMPLATE_VBoxBS3KitImg64_INCS = $(VBOX_PATH_BS3KIT_SRC) .
698if1of ($(KBUILD_HOST), win)
699 ifndef TOOL_VCC100AMD64 # For win.x86 builds.
700 include $(KBUILD_PATH)/tools/$(VBOX_VCC_TOOL_STEM)AMD64.kmk
701 endif
702 TEMPLATE_VBoxBS3KitImg64_CTOOL := Bs3Vcc64
703 TEMPLATE_VBoxBS3KitImg64_CXXTOOL := Bs3Vcc64
704 TEMPLATE_VBoxBS3KitImg64_CFLAGS = -Z7 -O1 -Oi -GF -GS- -Gy- -Gs65536
705 TEMPLATE_VBoxBS3KitImg64_CXXFLAGS = -Z7 -O1 -Oi -GF -GS- -Gy- -Gs65536
706else
707 TEMPLATE_VBoxBS3KitImg64_CTOOL := Bs3Gcc64Elf64
708 TEMPLATE_VBoxBS3KitImg64_CXXTOOL := Bs3Gcc64Elf64
709 # Note! -mx32 would be exactly what we needed here, however it causes internal compiler errors with 4.8.4 on gentoo.
710 TEMPLATE_VBoxBS3KitImg64_CFLAGS = -m64 -maccumulate-outgoing-args -g -Os -fno-omit-frame-pointer $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_WARN_PEDANTIC_C)
711 TEMPLATE_VBoxBS3KitImg64_CXXFLAGS = -m64 -maccumulate-outgoing-args -g -Os -fno-omit-frame-pointer $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_WARN_PEDANTIC_CXX)
712endif
713TEMPLATE_VBoxBS3KitImg64_LDTOOL = VBoxBsUnusedLd
714
715# BS3Kit template for the bootsector.
716TEMPLATE_VBoxBS3KitBS = Template for building BS3Kit test images.
717TEMPLATE_VBoxBS3KitBS_BLD_TRG = os-agnostic
718TEMPLATE_VBoxBS3KitBS_BLD_TRG_ARCH = x86
719TEMPLATE_VBoxBS3KitBS_INST = $(INST_VALIDATIONKIT)bootsectors/
720TEMPLATE_VBoxBS3KitBS_INSTTYPE = none
721TEMPLATE_VBoxBS3KitBS_BINSUFF = .img
722TEMPLATE_VBoxBS3KitBS_MODE = 0644
723TEMPLATE_VBoxBS3KitBS_ASTOOL = YASM
724TEMPLATE_VBoxBS3KitBS_ASFLAGS = -f bin --mapfile
725TEMPLATE_VBoxBS3KitBS_ASDEFS = ASM_FORMAT_BIN RT_NOINC_SEGMENTS ARCH_BITS=16 __YASM__ \
726 BS3CLASS16CODE=$(BS3KIT_CLASS_CODE16) BS3KIT_CLASS_DATA16=$(BS3KIT_CLASS_DATA16) \
727 BS3KIT_GRPNM_DATA16=$(BS3KIT_GRPNM_DATA16) BS3KIT_CLASS_BSS16=$(BS3KIT_CLASS_BSS16)
728TEMPLATE_VBoxBS3KitBS_INCS = $(VBOX_PATH_BS3KIT_SRC) .
729TEMPLATE_VBoxBS3KitBS_LDTOOL = VBoxBsCpLd
730
731
732
733#
734# Extends VBoxBS3KitImg
735# User must starts SOURCES with: $(VBOX_PATH_BS3KIT_SRC)/bs3-first-dosexe.asm
736## disable 1014, 1080, 1150
737#
738TEMPLATE_VBoxBS3KitUtil = Utility using bs3kit code.
739TEMPLATE_VBoxBS3KitUtil_EXTENDS = VBoxBS3KitImg
740TEMPLATE_VBoxBS3KitUtil_BINSUFF = .exe
741TEMPLATE_VBoxBS3KitUtil_DEFS = $(TEMPLATE_VBoxBS3KitImg_DEFS) BS3_IS_DOS_EXE
742TEMPLATE_VBoxBS3KitUtil_CFLAGS = $(filter-out -zl,$(TEMPLATE_VBoxBS3KitImg_CFLAGS))
743TEMPLATE_VBoxBS3KitUtil_CXXFLAGS = $(filter-out -zl,$(TEMPLATE_VBoxBS3KitImg_CXXFLAGS))
744TEMPLATE_VBoxBS3KitUtil_LDFLAGS = system dos \
745 debug $(BS3_OW_DBG_LDOPT) all \
746 option quiet, map, statics, verbose, symfile \
747 disable 1080 \
748 order \
749 clname $(BS3KIT_CLASS_CODE16) \
750 segment BEGTEXT \
751 segment BS3TEXT16 \
752 segment _TEXT \
753 segment BS3TEXT16_NEARSTUBS \
754 segment BS3TEXT16_FARSTUBS \
755 segment BS3TEXT16_END \
756 clname BS3SYSTEM16 \
757 segment BS3SYSTEM16 \
758 \
759 clname BEGDATA \
760 segment _NULL \
761 segment _AFTERNULL \
762 clname DATA \
763$(if-expr "$(BS3KIT_SEGNM_DATA16)" == "", \
764 segment BS3DATA16 \
765 segment BS3DATA16CONST \
766 segment CONST \
767 segment BS3DATA16CONST2 \
768 segment CONST2 \
769,\
770 segment CONST \
771 segment CONST2 \
772) \
773 segment _DATA \
774 segment XIB \
775 segment XI \
776 segment XIE \
777 segment YIB \
778 segment YI \
779 segment YIE \
780 segment STRINGS \
781$(if-expr "$(BS3KIT_SEGNM_DATA16)" == "", \
782 segment BS3DATA16_DATA \
783,) \
784 segment DATA \
785 clname BSS \
786 segment _BSS \
787 segment BSS \
788 segment BS3DATA16_END \
789 clname STACK \
790 segment STACK \
791 \
792 clname FAR_DATA \
793$(if-expr "$(BS3KIT_SEGNM_DATA16)" != "", \
794 segment BS3DATA16 \
795 segment BS3DATA16_DATA \
796 segment BS3DATA16CONST \
797 segment BS3DATA16CONST2 \
798 segment FAR_DATA \
799 segment BS3DATA16_END \
800,\
801 segment FAR_DATA \
802)\
803 segment BS3DATA32 \
804 segment BS3DATA32CONST \
805 segment BS3DATA32CONST2 \
806 segment BS3DATA32_DATA \
807 segment BS3DATA32_BSS \
808 segment BS3DATA32_END \
809 \
810 segment BS3DATA64 \
811 segment BS3DATA64CONST \
812 segment BS3DATA64_BSS \
813 segment BS3DATA64_END \
814 clname BS3CLASS16RMCODE \
815 segment BS3RMCODE16_START \
816 segment BS3RMCODE16 \
817 segment BS3RMCODE16_END \
818 clname BS3CLASS16X0CODE \
819 segment BS3X0CODE16_START \
820 segment BS3X0CODE16 \
821 segment BS3X0CODE16_END \
822 clname BS3CLASS16X1CODE \
823 segment BS3X1CODE16_START \
824 segment BS3X1CODE16 \
825 segment BS3X1CODE16_END \
826 clname BS3CLASS32CODE \
827 segment BS3TEXT32 \
828 segment BS3TEXT32_END \
829 clname BS3CLASS64CODE \
830 segment BS3TEXT64 \
831 segment BS3TEXT64_END
832# clname BS3FLAT segaddr=0x0000 \
833# segment BS3FLAT segaddr=0x0000
834
835TEMPLATE_VBoxBS3KitUtil_LNK_DEPS = $(NO_SUCH_VARIABLE)
836TEMPLATE_VBoxBS3KitUtil_POST_CMDS = $(NO_SUCH_VARIABLE)
837
Note: See TracBrowser for help on using the repository browser.

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