VirtualBox

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

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

bs3kit/Config.kmk: gcc fixes.

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