VirtualBox

source: vbox/trunk/tools/kBuildTools/VBoxXClang.kmk

Last change on this file was 108719, checked in by vboxsync, 5 weeks ago

tools,Devices/EFI/Firmware: Switch to a clang based cross compile toolchain for arm32 and arm64 UEFI images like we have on Windows, bugref:10874 bugref:4643

Using clang has several advantages:

  • It is far easier to build so updating the toolchain should be much simpler
  • A single toolchain can support multiple targets, no need to have two different toolchains for arm32 and arm64
  • The toolchain can be used for cross compilation (the current toolchain supports x86,amd64,arm32,arm64 and riscv...)
  • As clang is already used for the firmware images shipped in a release the resulting images compiled locally are much more close to what is built on the buildbox

The only downside is that the clang toolchain is a bit on the heavy side, even if stripped down. OTOH we only need a single toolchain opossed
to the two we had before.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 16.6 KB
Line 
1# $Id: VBoxXClang.kmk 108719 2025-03-24 15:26:59Z vboxsync $
2## @file
3# kBuild Tool Config - clang 20.x cross compiler, for various targets.
4#
5
6#
7# Copyright (C) 2025 Oracle and/or its affiliates.
8#
9# This file is part of VirtualBox base platform packages, as
10# available from https://www.virtualbox.org.
11#
12# This program is free software; you can redistribute it and/or
13# modify it under the terms of the GNU General Public License
14# as published by the Free Software Foundation, in version 3 of the
15# License.
16#
17# This program is distributed in the hope that it will be useful, but
18# WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20# General Public License for more details.
21#
22# You should have received a copy of the GNU General Public License
23# along with this program; if not, see <https://www.gnu.org/licenses>.
24#
25# SPDX-License-Identifier: GPL-3.0-only
26#
27
28TOOL_VBoxXClang := Generic clang build supporting C/C++ and ld.lld.
29
30
31#
32# Tool Specific Properties
33#
34ifndef PATH_TOOL_VBoxXClang
35 PATH_TOOL_VBoxXClang := $(firstfile $(rversortfiles $(qwildcard ,$(KBUILD_DEVTOOLS_HST)/clang/v20.*/bin)))
36 ifeq ($(PATH_TOOL_VBoxXClang),)
37 PATH_TOOL_VBoxXClang := $(PATH_TOOL_VBoxXClang)
38 endif
39 ifeq ($(PATH_TOOL_VBoxXClang),)
40 $(error kBuild: PATH_TOOL_VBoxXClang cannot be determined!)
41 endif
42else
43 # Resolve any fancy stuff once and for all.
44 PATH_TOOL_VBoxXClang := $(PATH_TOOL_VBoxXClang)
45endif
46
47
48# Tool Specific Properties
49ifndef TOOL_VBoxXClang_PREFIX
50 TOOL_VBoxXClang_PREFIX :=
51endif
52ifndef TOOL_VBoxXClang_SUFFIX
53 TOOL_VBoxXClang_SUFFIX := $(HOSTSUFF_EXE)
54endif
55
56TOOL_VBoxXClang_PREFIX2 ?= $(TOOL_VBoxXClang_PREFIX)llvm-
57TOOL_VBoxXClang_CC ?= $(PATH_TOOL_VBoxXClang)/$(TOOL_VBoxXClang_PREFIX)clang$(TOOL_VBoxXClang_SUFFIX)
58TOOL_VBoxXClang_CXX ?= $(PATH_TOOL_VBoxXClang)/$(TOOL_VBoxXClang_PREFIX)clang++$(TOOL_VBoxXClang_SUFFIX)
59TOOL_VBoxXClang_PCH ?= $(TOOL_VBoxXClang_CXX)
60TOOL_VBoxXClang_AS ?= $(PATH_TOOL_VBoxXClang)/$(TOOL_VBoxXClang_PREFIX)clang$(TOOL_VBoxXClang_SUFFIX)
61TOOL_VBoxXClang_AR ?= $(PATH_TOOL_VBoxXClang)/$(TOOL_VBoxXClang_PREFIX)llvm-ar$(TOOL_VBoxXClang_SUFFIX)
62TOOL_VBoxXClang_AR_IMP ?= $(ECHO) not supported!
63TOOL_VBoxXClang_LD ?= $(PATH_TOOL_VBoxXClang)/$(TOOL_VBoxXClang_PREFIX)clang++$(TOOL_VBoxXClang_SUFFIX)
64TOOL_VBoxXClang_LD_SYSMOD ?= $(PATH_TOOL_VBoxXClang)/$(TOOL_VBoxXClang_PREFIX)lld$(TOOL_VBoxXClang_SUFFIX)
65ifndef TOOL_VBoxXClang_LDFLAGS.$(KBUILD_TARGET)
66 TOOL_VBoxXClang_LDFLAGS.dll ?= -shared
67else
68 TOOL_VBoxXClang_LDFLAGS.dll ?= $(TOOL_VBoxXClang_LDFLAGS.$(KBUILD_TARGET))
69endif
70TOOL_VBoxXClang_LDFLAGS.sysmod ?= -r
71TOOL_VBoxXClang_LD_SONAME ?= -Wl,-soname=$(firstword $($(1)_SONAME.$(KBUILD_TARGET).$(KBUILD_TYPE)) $($(1)_SONAME.$(KBUILD_TARGET)) $($(1)_SONAME.$(KBUILD_TYPE)) $($(1)_SONAME) $(notdir $(2)))
72ifeq ($(KBUILD_TARGET),os2)
73 TOOL_VBoxXClang_LD_MAP ?= -Zmap=$(1)
74 TOOL_VBoxXClang_LD_SYSMOD_MAP ?= -Zmap=$(1)
75else
76 TOOL_VBoxXClang_LD_MAP ?=
77 TOOL_VBoxXClang_LD_SYSMOD_MAP ?=
78endif
79TOOL_VBoxXClang_OBJCOPY ?= $(PATH_TOOL_VBoxXClang)/$(TOOL_VBoxXClang_PREFIX)llvm-objcopy$(TOOL_VBoxXClang_SUFFIX)
80
81# General Properties used by kBuild
82TOOL_VBoxXClang_COBJSUFF ?= .o
83TOOL_VBoxXClang_CFLAGS ?=
84TOOL_VBoxXClang_CFLAGS.debug ?= -g
85TOOL_VBoxXClang_CFLAGS.profile ?= -O2 #-g -pg
86TOOL_VBoxXClang_CFLAGS.release ?= -O2
87TOOL_VBoxXClang_CINCS ?=
88TOOL_VBoxXClang_CDEFS ?=
89
90TOOL_VBoxXClang_CXXOBJSUFF ?= .o
91TOOL_VBoxXClang_CXXFLAGS ?=
92TOOL_VBoxXClang_CXXFLAGS.debug ?= -g
93TOOL_VBoxXClang_CXXFLAGS.profile ?= -O2 #-g -pg
94TOOL_VBoxXClang_CXXFLAGS.release ?= -O2
95TOOL_VBoxXClang_CXXINCS ?=
96TOOL_VBoxXClang_CXXDEFS ?=
97
98TOOL_VBoxXClang_PCHOBJSUFF ?= .h.gch
99TOOL_VBoxXClang_PCHFLAGS ?= $(TOOL_VBoxXClang_CXXFLAGS)
100TOOL_VBoxXClang_PCHFLAGS.debug ?= $(TOOL_VBoxXClang_CXXFLAGS.debug)
101TOOL_VBoxXClang_PCHFLAGS.profile ?= $(TOOL_VBoxXClang_CXXFLAGS.profile)
102TOOL_VBoxXClang_PCHFLAGS.release ?= $(TOOL_VBoxXClang_CXXFLAGS.release)
103TOOL_VBoxXClang_PCHINCS ?= $(TOOL_VBoxXClang_CXXINCS)
104TOOL_VBoxXClang_PCHDEFS ?= $(TOOL_VBoxXClang_CXXDEFS)
105
106TOOL_VBoxXClang_ASFLAGS ?=
107TOOL_VBoxXClang_ASFLAGS.debug ?= -g
108TOOL_VBoxXClang_ASFLAGS.profile ?= -g
109TOOL_VBoxXClang_ASOBJSUFF ?= .o
110
111TOOL_VBoxXClang_ARFLAGS ?= cr
112TOOL_VBoxXClang_ARLIBSUFF ?= .a
113
114TOOL_VBoxXClang_LDFLAGS ?=
115TOOL_VBoxXClang_LDFLAGS.debug ?= -g
116TOOL_VBoxXClang_LDFLAGS.profile ?= -g
117
118
119## Compile C source.
120# @param $(target) Normalized main target name.
121# @param $(source) Source filename (relative).
122# @param $(obj) Object file name. This shall be (re)created by the compilation.
123# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
124# @param $(flags) Flags.
125# @param $(defs) Definitions. No -D or something.
126# @param $(incs) Includes. No -I or something.
127# @param $(dirdep) Directory creation dependency.
128# @param $(deps) Other dependencies.
129#
130# @param $(outbase) Output basename (full). Use this for list files and such.
131# @param $(objsuff) Object suffix.
132TOOL_VBoxXClang_COMPILE_C_DEPEND =
133TOOL_VBoxXClang_COMPILE_C_DEPORD =
134TOOL_VBoxXClang_COMPILE_C_OUTPUT = $(if-expr "$(use_objcache)" != "",$(outbase).i,)
135TOOL_VBoxXClang_COMPILE_C_USES_KOBJCACHE = $(if-expr "$(use_objcache)" != "",1,)
136define TOOL_VBoxXClang_COMPILE_C_CMDS
137 if "$(use_objcache)" != ""
138 $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\
139 --kObjCache-cpp $(outbase).i\
140 $(TOOL_VBoxXClang_CC) -E -o -\
141 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
142 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
143 $(abspath $(source))\
144 --kObjCache-cc $(obj)\
145 $(TOOL_VBoxXClang_CC) -c\
146 $(flags) -fpreprocessed -x c\
147 -o $(obj)\
148 -
149 else
150 $(QUIET)$(TOOL_VBoxXClang_CC) -c\
151 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
152 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
153 -o $(obj)\
154 $(abspath $(source))
155 endif
156 $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
157endef
158
159
160## Compile C++ source.
161# @param $(target) Normalized main target name.
162# @param $(source) Source filename (relative).
163# @param $(obj) Object file name. This shall be (re)created by the compilation.
164# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
165# @param $(flags) Flags.
166# @param $(defs) Definitions. No -D or something.
167# @param $(incs) Includes. No -I or something.
168# @param $(dirdep) Directory creation dependency.
169# @param $(deps) Other dependencies.
170# @param $(outbase) Output basename (full). Use this for list files and such.
171# @param $(objsuff) Object suffix.
172TOOL_VBoxXClang_COMPILE_CXX_OUTPUT = $(if-expr "$(use_objcache)" != "",$(outbase).ii,)
173TOOL_VBoxXClang_COMPILE_CXX_DEPEND = $($(target)_1_GCC_PCH_FILE)
174TOOL_VBoxXClang_COMPILE_CXX_DEPORD =
175TOOL_VBoxXClang_COMPILE_CXX_USES_KOBJCACHE = $(if-expr "$(use_objcache)" != "",1,)
176define TOOL_VBoxXClang_COMPILE_CXX_CMDS
177 if "$(use_objcache)" != ""
178 $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\
179 --kObjCache-cpp $(outbase).ii\
180 $(TOOL_VBoxXClang_CXX) -E -o - $(if-expr defined($(target)_PCH_HDR)\
181 ,-fpch-preprocess -Winvalid-pch -I$($(target)_1_GCC_PCH_DIR) -include $(basename $($(target)_1_GCC_PCH_FILE)),)\
182 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
183 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
184 $(abspath $(source))\
185 --kObjCache-cc $(obj)\
186 $(TOOL_VBoxXClang_CXX) -c\
187 $(flags) -fpreprocessed $(if-expr defined($(target)_PCH_HDR),-fpch-preprocess,) -x c++\
188 -o $(obj)\
189 -
190 else
191 $(QUIET)$(TOOL_VBoxXClang_CXX) -c\
192 $(flags) $(qaddprefix sh,-I, $($(target)_1_GCC_PCH_DIR) $(incs)) $(qaddprefix sh,-D, $(defs))\
193 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
194 -o $(obj) $(if-expr defined($(target)_PCH_HDR) \
195 ,-Winvalid-pch -include $(basename $($(target)_1_GCC_PCH_FILE)),) \
196 $(abspath $(source))
197 endif
198 $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
199endef
200
201
202## Precompile C++ header.
203# @param $(target) Normalized main target name.
204# @param $(source) Source filename (relative).
205# @param $(obj) Object file name. This shall be (re)created by the compilation.
206# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
207# @param $(flags) Flags.
208# @param $(defs) Definitions. No -D or something.
209# @param $(incs) Includes. No -I or something.
210# @param $(dirdep) Directory creation dependency.
211# @param $(deps) Other dependencies.
212# @param $(outbase) Output basename (full). Use this for list files and such.
213# @param $(objsuff) Object suffix.
214TOOL_VBoxXClang_COMPILE_PCH_OUTPUT = $($(target)_1_GCC_PCH_FILE)
215TOOL_VBoxXClang_COMPILE_PCH_DEPEND =
216TOOL_VBoxXClang_COMPILE_PCH_DEPORD = $($(target)_1_GCC_PCH_DIR)
217define TOOL_VBoxXClang_COMPILE_PCH_CMDS
218 $(QUIET)$(TOOL_VBoxXClang_PCH) -c\
219 $(flags) $(qaddprefix sh,-I, $($(target)_1_GCC_PCH_DIR) $(incs)) $(qaddprefix sh,-D, $(defs))\
220 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
221 -o $(obj)\
222 $(abspath $(source))
223 $(INSTALL) --hard-link-files-when-possible -m 0644 -- "$(obj)" "$($(target)_1_GCC_PCH_FILE)"
224 $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
225endef
226
227
228## Compile Assembly source.
229# @param $(target) Normalized main target name.
230# @param $(source) Source filename (relative).
231# @param $(obj) Object file name. This shall be (re)created by the compilation.
232# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
233# @param $(flags) Flags.
234# @param $(defs) Definitions. No -D or something.
235# @param $(incs) Includes. No -I or something.
236# @param $(dirdep) Directory creation dependency.
237# @param $(deps) Other dependencies.
238# @param $(outbase) Output basename (full). Use this for list files and such.
239# @param $(objsuff) Object suffix.
240#
241TOOL_VBoxXClang_COMPILE_AS_OUTPUT =
242TOOL_VBoxXClang_COMPILE_AS_DEPEND =
243TOOL_VBoxXClang_COMPILE_AS_DEPORD =
244define TOOL_VBoxXClang_COMPILE_AS_CMDS
245 $(QUIET)$(TOOL_VBoxXClang_AS) -c\
246 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
247 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
248 -o $(obj)\
249 $(abspath $(source))
250 $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
251endef
252
253
254## Link library
255# @param $(target) Normalized main target name.
256# @param $(out) Library name.
257# @param $(objs) Object files to put in the library.
258# @param $(flags) Flags.
259# @param $(dirdep) Directory creation dependency.
260# @param $(deps) Other dependencies.
261# @param $(othersrc) Unhandled sources.
262# @param $(outbase) Output basename (full). Use this for list files and such.
263TOOL_VBoxXClang_LINK_LIBRARY_OUTPUT = $(out).ar-script
264TOOL_VBoxXClang_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).imp.a
265TOOL_VBoxXClang_LINK_LIBRARY_DEPEND = $(othersrc)
266TOOL_VBoxXClang_LINK_LIBRARY_DEPORD =
267define TOOL_VBoxXClang_LINK_LIBRARY_CMDS
268 $(QUIET)$(APPEND) $(out).ar-script 'CREATE $(out)'
269 $(QUIET)$(APPEND) -n $(out).ar-script \
270 $(foreach o,$(filter-out %.h.gch,$(objs)), 'ADDMOD $(o)') \
271 $(foreach o,$(filter-out %.def %.imp %.dll,$(othersrc)), 'ADDLIB $(o)')
272 $(if $(filter %.def %.imp %.dll,$(othersrc))\
273 ,$(TOOL_VBoxXClang_AR_IMP) -o $(outbase).imp.a $(filter %.def %.imp %.dll,$(othersrc))\
274 $(NL)$(TAB)$(QUIET)$(APPEND) $(out).ar-script 'ADDLIB $(outbase).imp.a')
275 $(QUIET)$(APPEND) $(out).ar-script 'SAVE'
276 $(QUIET)$(APPEND) $(out).ar-script 'END'
277 $(QUIET)$(REDIRECT) -rti $(out).ar-script -- $(TOOL_VBoxXClang_AR) -M
278endef
279
280
281## Link program
282# @param $(target) Normalized main target name.
283# @param $(out) Program name.
284# @param $(objs) Object files to link together.
285# @param $(libs) Libraries to search.
286# @param $(libpath) Library search paths.
287# @param $(flags) Flags.
288# @param $(dirdep) Directory creation dependency.
289# @param $(deps) Other dependencies.
290# @param $(othersrc) Unhandled sources.
291# @param $(custom_pre) Custom step invoked before linking.
292# @param $(custom_post) Custom step invoked after linking.
293# @param $(outbase) Output basename (full). Use this for list files and such.
294TOOL_VBoxXClang_LINK_PROGRAM_OUTPUT =
295TOOL_VBoxXClang_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).map
296TOOL_VBoxXClang_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).debug
297TOOL_VBoxXClang_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
298TOOL_VBoxXClang_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) \
299 $(filter %.def, $(othersrc))
300TOOL_VBoxXClang_LINK_PROGRAM_DEPORD =
301define TOOL_VBoxXClang_LINK_PROGRAM_CMDS
302 $(QUIET)$(TOOL_VBoxXClang_LD) $(flags) -o $(out) $(filter-out %.h.gch,$(objs))\
303 $(filter %.def, $(othersrc))\
304 $(foreach p,$(libpath), -L$(p))\
305 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib))) \
306 $(call TOOL_VBoxXClang_LD_MAP,$(outbase).map)
307 ifeq ($(ld_debug),split)
308 $(QUIET)$(TOOL_VBoxXClang_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
309 $(QUIET)$(CHMOD) a-x $(outbase).debug
310 $(QUIET)$(TOOL_VBoxXClang_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
311 endif
312endef
313
314
315## Link DLL
316# @param $(target) Normalized main target name.
317# @param $(out) Program name.
318# @param $(objs) Object files to link together.
319# @param $(libs) Libraries to search.
320# @param $(libpath) Library search paths.
321# @param $(flags) Flags.
322# @param $(dirdep) Directory creation dependency.
323# @param $(deps) Other dependencies.
324# @param $(othersrc) Unhandled sources.
325# @param $(custom_pre) Custom step invoked before linking.
326# @param $(custom_post) Custom step invoked after linking.
327# @param $(outbase) Output basename (full). Use this for list files and such.
328TOOL_VBoxXClang_LINK_DLL_OUTPUT =
329TOOL_VBoxXClang_LINK_DLL_OUTPUT_MAYBE = $(outbase).map
330TOOL_VBoxXClang_LINK_DLL_OUTPUT_DEBUG = $(outbase).debug
331TOOL_VBoxXClang_LINK_DLL_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
332TOOL_VBoxXClang_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) \
333 $(filter %.def, $(othersrc))
334TOOL_VBoxXClang_LINK_DLL_DEPORD =
335define TOOL_VBoxXClang_LINK_DLL_CMDS
336 $(QUIET)$(TOOL_VBoxXClang_LD) $(TOOL_VBoxXClang_LDFLAGS.dll) $(flags) -o $(out)\
337 $(if $(filter-out win os2, $(KBUILD_TARGET)),$(call TOOL_VBoxXClang_LD_SONAME,$(target),$(out)))\
338 $(filter-out %.h.gch,$(objs))\
339 $(filter %.def, $(othersrc))\
340 $(foreach p,$(libpath), -L$(p))\
341 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib))) \
342 $(call TOOL_VBoxXClang_LD_MAP,$(outbase).map)
343 ifeq ($(ld_debug),split)
344 $(QUIET)$(TOOL_VBoxXClang_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
345 $(QUIET)$(CHMOD) a-x $(outbase).debug
346 $(QUIET)$(TOOL_VBoxXClang_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
347 endif
348endef
349
350
351## Link system module (windows aka driver, linux aka kernel module)
352# @param $(target) Normalized main target name.
353# @param $(out) System module name.
354# @param $(objs) Object files to link together.
355# @param $(libs) Libraries to search.
356# @param $(libpath) Library search paths.
357# @param $(flags) Flags.
358# @param $(dirdep) Directory creation dependency.
359# @param $(deps) Other dependencies.
360# @param $(othersrc) Unhandled sources.
361# @param $(custom_pre) Custom step invoked before linking.
362# @param $(custom_post) Custom step invoked after linking.
363# @param $(outbase) Output basename (full). Use this for list files and such.
364TOOL_VBoxXClang_LINK_SYSMOD_OUTPUT =
365TOOL_VBoxXClang_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).map
366TOOL_VBoxXClang_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).debug
367TOOL_VBoxXClang_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
368TOOL_VBoxXClang_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) \
369 $(filter %.def, $(othersrc))
370TOOL_VBoxXClang_LINK_SYSMOD_DEPORD =
371define TOOL_VBoxXClang_LINK_SYSMOD_CMDS
372 $(QUIET)$(TOOL_VBoxXClang_LD_SYSMOD) $(TOOL_VBoxXClang_LDFLAGS.sysmod) $(flags) -o $(out) $(filter-out %.h.gch,$(objs)) \
373 $(filter %.def, $(othersrc))\
374 $(foreach p,$(libpath), -L$(p))\
375 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
376 $(call TOOL_VBoxXClang_LD_SYSMOD_MAP,$(outbase).map)
377 ifeq ($(ld_debug),split)
378 $(QUIET)$(TOOL_VBoxXClang_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
379 $(QUIET)$(CHMOD) a-x $(outbase).debug
380 $(QUIET)$(TOOL_VBoxXClang_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
381 endif
382endef
383
Note: See TracBrowser for help on using the repository browser.

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