Changeset 100472 in vbox for trunk/tools/kBuildTools
- Timestamp:
- Jul 10, 2023 3:53:11 PM (21 months ago)
- svn:sync-xref-src-repo-rev:
- 158227
- Location:
- trunk/tools/kBuildTools
- Files:
-
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/kBuildTools/VBoxXGccArm64Elf.kmk
r100426 r100472 1 1 # $Id$ 2 2 ## @file 3 # VBox kBuild Tool Config - GCC Cross compiler for Debian 4.0 AMD64.4 # 5 6 # 7 # Copyright (C) 20 13-2023 Oracle and/or its affiliates.3 # kBuild Tool Config - GCC v13.1.x, targeting baremetal ARM64 (for the UEFI firmware). 4 # 5 6 # 7 # Copyright (C) 2023 Oracle and/or its affiliates. 8 8 # 9 9 # This file is part of VirtualBox base platform packages, as … … 26 26 # 27 27 28 TOOL_VBoxXGccAmd64LinuxGnu := GCC Cross compiler for Debian 4.0. 29 30 # Tool Specific Properties: 31 ifndef TOOL_VBoxXGccAmd64LinuxGnu_PREFIX 32 TOOL_VBoxXGccAmd64LinuxGnu_PREFIX := x86_64-linux-gnu- 33 endif 34 ifndef PATH_TOOL_VBoxXGccAmd64LinuxGnu 35 PATH_TOOL_VBoxXGccAmd64LinuxGnu := $(lastword $(wildcard $(KBUILD_DEVTOOLS_HST)/x86_64-linux-gnu/*)) 36 ifeq ($(PATH_TOOL_VBoxXGccAmd64LinuxGnu),) 37 PATH_TOOL_VBoxXGccAmd64LinuxGnu := $(lastword $(sort $(wildcard $(KBUILD_DEVTOOLS_HST_ALT)/x86_64-linux-gnu/*))) 38 endif 39 endif 40 TOOL_VBoxXGccAmd64LinuxGnu_PREFIX := $(PATH_TOOL_VBoxXGccAmd64LinuxGnu)/usr/bin/$(TOOL_VBoxXGccAmd64LinuxGnu_PREFIX) 41 42 TOOL_VBoxXGccAmd64LinuxGnu_CC ?= $(TOOL_VBoxXGccAmd64LinuxGnu_PREFIX)gcc-4.1$(HOSTSUFF_EXE) 43 TOOL_VBoxXGccAmd64LinuxGnu_CXX ?= $(TOOL_VBoxXGccAmd64LinuxGnu_PREFIX)g++-4.1$(HOSTSUFF_EXE) 44 TOOL_VBoxXGccAmd64LinuxGnu_AS ?= $(TOOL_VBoxXGccAmd64LinuxGnu_PREFIX)gcc-4.1$(HOSTSUFF_EXE) 45 TOOL_VBoxXGccAmd64LinuxGnu_AR ?= $(TOOL_VBoxXGccAmd64LinuxGnu_PREFIX)ar$(HOSTSUFF_EXE) 46 TOOL_VBoxXGccAmd64LinuxGnu_LD ?= $(TOOL_VBoxXGccAmd64LinuxGnu_PREFIX)gcc-4.1$(HOSTSUFF_EXE) 47 TOOL_VBoxXGccAmd64LinuxGnu_LD_SYSMOD ?= $(TOOL_VBoxXGccAmd64LinuxGnu_PREFIX)ld$(HOSTSUFF_EXE) 48 49 TOOL_VBoxXGccAmd64LinuxGnu_LD_SONAME ?= -Wl,-soname=$(firstword $($(1)_SONAME.$(KBUILD_TARGET).$(KBUILD_TYPE)) $($(1)_SONAME.$(KBUILD_TARGET)) $($(1)_SONAME.$(KBUILD_TYPE)) $($(1)_SONAME) $(notdir $(2))) 50 TOOL_VBoxXGccAmd64LinuxGnu_LD_MAP ?= -Wl,-Map -Wl,$(1) 51 TOOL_VBoxXGccAmd64LinuxGnu_LD_SYSMOD_MAP ?= -Map $(1) 52 TOOL_VBoxXGccAmd64LinuxGnu_LDFLAGS.dll ?= -shared 53 TOOL_VBoxXGccAmd64LinuxGnu_LDFLAGS.sysmod ?= -r 54 55 ifdef SLKRUNS 56 TOOL_VBoxXGccAmd64LinuxGnu_CC += -fmessage-length=0 57 TOOL_VBoxXGccAmd64LinuxGnu_CXX += -fmessage-length=0 58 endif 59 60 # General Properties used by kBuild: 61 TOOL_VBoxXGccAmd64LinuxGnu_COBJSUFF ?= .o 62 TOOL_VBoxXGccAmd64LinuxGnu_CFLAGS ?= -g 63 TOOL_VBoxXGccAmd64LinuxGnu_CFLAGS.debug ?= -O0 64 TOOL_VBoxXGccAmd64LinuxGnu_CFLAGS.release ?= -O2 65 TOOL_VBoxXGccAmd64LinuxGnu_CFLAGS.profile ?= -O2 66 TOOL_VBoxXGccAmd64LinuxGnu_CINCS ?= 67 TOOL_VBoxXGccAmd64LinuxGnu_CDEFS ?= 68 69 TOOL_VBoxXGccAmd64LinuxGnu_CXXOBJSUFF ?= .o 70 TOOL_VBoxXGccAmd64LinuxGnu_CXXOBJSUFF ?= .o 71 TOOL_VBoxXGccAmd64LinuxGnu_CXXFLAGS ?= -g 72 TOOL_VBoxXGccAmd64LinuxGnu_CXXFLAGS.debug ?= -O0 73 TOOL_VBoxXGccAmd64LinuxGnu_CXXFLAGS.release ?= -O2 74 TOOL_VBoxXGccAmd64LinuxGnu_CXXFLAGS.profile ?= -O2 75 TOOL_VBoxXGccAmd64LinuxGnu_CXXINCS ?= 76 TOOL_VBoxXGccAmd64LinuxGnu_CXXDEFS ?= 77 78 TOOL_VBoxXGccAmd64LinuxGnu_ASFLAGS ?= -g -x assembler-with-cpp 79 TOOL_VBoxXGccAmd64LinuxGnu_ASOBJSUFF ?= .o 80 81 TOOL_VBoxXGccAmd64LinuxGnu_ARFLAGS ?= cr 82 TOOL_VBoxXGccAmd64LinuxGnu_ARLIBSUFF ?= .a 83 84 TOOL_VBoxXGccAmd64LinuxGnu_LDFLAGS ?= 85 TOOL_VBoxXGccAmd64LinuxGnu_LDFLAGS.debug ?= -g 86 TOOL_VBoxXGccAmd64LinuxGnu_LDFLAGS.release ?= -s 87 88 TOOL_VBoxXGccAmd64LinuxGnu_COMPILE_C_OUTPUT = 89 TOOL_VBoxXGccAmd64LinuxGnu_COMPILE_C_DEPEND = 90 TOOL_VBoxXGccAmd64LinuxGnu_COMPILE_C_DEPORD = 91 define TOOL_VBoxXGccAmd64LinuxGnu_COMPILE_C_CMDS 92 $(QUIET)$(TOOL_VBoxXGccAmd64LinuxGnu_CC) -c \ 93 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs)) \ 94 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP \ 95 -o $(obj) \ 28 TOOL_VBoxXGccArm64Elf := Generic GCC v13.1.x or later using the tools GCC and Binutils, targeting ARM64. 29 30 31 # 32 # Tool Specific Properties 33 # 34 ifndef PATH_TOOL_VBoxXGccArm64Elf 35 PATH_TOOL_VBoxXGccArm64Elf := $(firstfile $(rversortfiles $(qwildcard ,$(KBUILD_DEVTOOLS_HST)/gcc-aarch64/v13.1*/bin))) 36 ifeq ($(PATH_TOOL_VBoxXGccArm64Elf),) 37 PATH_TOOL_VBoxXGccArm64Elf := $(PATH_TOOL_VBoxXGccArm64Elf) 38 endif 39 ifeq ($(PATH_TOOL_VBoxXGccArm64Elf),) 40 $(error kBuild: PATH_TOOL_VBoxXGccArm64Elf cannot be determined!) 41 endif 42 else 43 # Resolve any fancy stuff once and for all. 44 PATH_TOOL_VBoxXGccArm64Elf := $(PATH_TOOL_VBoxXGccArm64Elf) 45 endif 46 47 48 # Tool Specific Properties 49 ifndef TOOL_VBoxXGccArm64Elf_PREFIX 50 TOOL_VBoxXGccArm64Elf_PREFIX := aarch64-elf- 51 endif 52 ifndef TOOL_VBoxXGccArm64Elf_SUFFIX 53 TOOL_VBoxXGccArm64Elf_SUFFIX := $(HOSTSUFF_EXE) 54 endif 55 56 TOOL_VBoxXGccArm64Elf_CC ?= $(PATH_TOOL_VBoxXGccArm64Elf)/$(TOOL_VBoxXGccArm64Elf_PREFIX)gcc$(TOOL_VBoxXGccArm64Elf_SUFFIX) 57 TOOL_VBoxXGccArm64Elf_CXX ?= $(PATH_TOOL_VBoxXGccArm64Elf)/$(TOOL_VBoxXGccArm64Elf_PREFIX)g++$(TOOL_VBoxXGccArm64Elf_SUFFIX) 58 TOOL_VBoxXGccArm64Elf_PCH ?= $(TOOL_VBoxXGccArm64Elf_CXX) 59 TOOL_VBoxXGccArm64Elf_AS ?= $(PATH_TOOL_VBoxXGccArm64Elf)/$(TOOL_VBoxXGccArm64Elf_PREFIX)gcc$(TOOL_VBoxXGccArm64Elf_SUFFIX) 60 TOOL_VBoxXGccArm64Elf_AR ?= $(PATH_TOOL_VBoxXGccArm64Elf)/$(TOOL_VBoxXGccArm64Elf_PREFIX)ar$(TOOL_VBoxXGccArm64Elf_SUFFIX) 61 TOOL_VBoxXGccArm64Elf_AR_IMP ?= $(ECHO) not supported! 62 TOOL_VBoxXGccArm64Elf_LD ?= $(PATH_TOOL_VBoxXGccArm64Elf)/$(TOOL_VBoxXGccArm64Elf_PREFIX)g++$(TOOL_VBoxXGccArm64Elf_SUFFIX) 63 TOOL_VBoxXGccArm64Elf_LD_SYSMOD ?= $(PATH_TOOL_VBoxXGccArm64Elf)/$(TOOL_VBoxXGccArm64Elf_PREFIX)ld$(TOOL_VBoxXGccArm64Elf_SUFFIX) 64 ifndef TOOL_VBoxXGccArm64Elf_LDFLAGS.$(KBUILD_TARGET) 65 TOOL_VBoxXGccArm64Elf_LDFLAGS.dll ?= -shared 66 else 67 TOOL_VBoxXGccArm64Elf_LDFLAGS.dll ?= $(TOOL_VBoxXGccArm64Elf_LDFLAGS.$(KBUILD_TARGET)) 68 endif 69 TOOL_VBoxXGccArm64Elf_LDFLAGS.sysmod ?= -r 70 TOOL_VBoxXGccArm64Elf_LD_SONAME ?= -Wl,-soname=$(firstword $($(1)_SONAME.$(KBUILD_TARGET).$(KBUILD_TYPE)) $($(1)_SONAME.$(KBUILD_TARGET)) $($(1)_SONAME.$(KBUILD_TYPE)) $($(1)_SONAME) $(notdir $(2))) 71 ifeq ($(KBUILD_TARGET),os2) 72 TOOL_VBoxXGccArm64Elf_LD_MAP ?= -Zmap=$(1) 73 TOOL_VBoxXGccArm64Elf_LD_SYSMOD_MAP ?= -Zmap=$(1) 74 else 75 TOOL_VBoxXGccArm64Elf_LD_MAP ?= 76 TOOL_VBoxXGccArm64Elf_LD_SYSMOD_MAP ?= 77 endif 78 TOOL_VBoxXGccArm64Elf_OBJCOPY ?= $(PATH_TOOL_VBoxXGccArm64Elf)/$(TOOL_VBoxXGccArm64Elf_PREFIX)objcopy$(TOOL_VBoxXGccArm64Elf_SUFFIX) 79 80 # General Properties used by kBuild 81 TOOL_VBoxXGccArm64Elf_COBJSUFF ?= .o 82 TOOL_VBoxXGccArm64Elf_CFLAGS ?= 83 TOOL_VBoxXGccArm64Elf_CFLAGS.debug ?= -g 84 TOOL_VBoxXGccArm64Elf_CFLAGS.profile ?= -O2 #-g -pg 85 TOOL_VBoxXGccArm64Elf_CFLAGS.release ?= -O2 86 TOOL_VBoxXGccArm64Elf_CINCS ?= 87 TOOL_VBoxXGccArm64Elf_CDEFS ?= 88 89 TOOL_VBoxXGccArm64Elf_CXXOBJSUFF ?= .o 90 TOOL_VBoxXGccArm64Elf_CXXFLAGS ?= 91 TOOL_VBoxXGccArm64Elf_CXXFLAGS.debug ?= -g 92 TOOL_VBoxXGccArm64Elf_CXXFLAGS.profile ?= -O2 #-g -pg 93 TOOL_VBoxXGccArm64Elf_CXXFLAGS.release ?= -O2 94 TOOL_VBoxXGccArm64Elf_CXXINCS ?= 95 TOOL_VBoxXGccArm64Elf_CXXDEFS ?= 96 97 TOOL_VBoxXGccArm64Elf_PCHOBJSUFF ?= .h.gch 98 TOOL_VBoxXGccArm64Elf_PCHFLAGS ?= $(TOOL_VBoxXGccArm64Elf_CXXFLAGS) 99 TOOL_VBoxXGccArm64Elf_PCHFLAGS.debug ?= $(TOOL_VBoxXGccArm64Elf_CXXFLAGS.debug) 100 TOOL_VBoxXGccArm64Elf_PCHFLAGS.profile ?= $(TOOL_VBoxXGccArm64Elf_CXXFLAGS.profile) 101 TOOL_VBoxXGccArm64Elf_PCHFLAGS.release ?= $(TOOL_VBoxXGccArm64Elf_CXXFLAGS.release) 102 TOOL_VBoxXGccArm64Elf_PCHINCS ?= $(TOOL_VBoxXGccArm64Elf_CXXINCS) 103 TOOL_VBoxXGccArm64Elf_PCHDEFS ?= $(TOOL_VBoxXGccArm64Elf_CXXDEFS) 104 105 TOOL_VBoxXGccArm64Elf_ASFLAGS ?= -x assembler-with-cpp 106 TOOL_VBoxXGccArm64Elf_ASFLAGS.debug ?= -g 107 TOOL_VBoxXGccArm64Elf_ASFLAGS.profile ?= -g 108 TOOL_VBoxXGccArm64Elf_ASOBJSUFF ?= .o 109 110 TOOL_VBoxXGccArm64Elf_ARFLAGS ?= cr 111 TOOL_VBoxXGccArm64Elf_ARLIBSUFF ?= .a 112 113 TOOL_VBoxXGccArm64Elf_LDFLAGS ?= 114 TOOL_VBoxXGccArm64Elf_LDFLAGS.debug ?= -g 115 TOOL_VBoxXGccArm64Elf_LDFLAGS.profile ?= -g 116 117 118 ## Compile C source. 119 # @param $(target) Normalized main target name. 120 # @param $(source) Source filename (relative). 121 # @param $(obj) Object file name. This shall be (re)created by the compilation. 122 # @param $(dep) Dependcy file. This shall be (re)created by the compilation. 123 # @param $(flags) Flags. 124 # @param $(defs) Definitions. No -D or something. 125 # @param $(incs) Includes. No -I or something. 126 # @param $(dirdep) Directory creation dependency. 127 # @param $(deps) Other dependencies. 128 # 129 # @param $(outbase) Output basename (full). Use this for list files and such. 130 # @param $(objsuff) Object suffix. 131 TOOL_VBoxXGccArm64Elf_COMPILE_C_DEPEND = 132 TOOL_VBoxXGccArm64Elf_COMPILE_C_DEPORD = 133 TOOL_VBoxXGccArm64Elf_COMPILE_C_OUTPUT = $(if-expr "$(use_objcache)" != "",$(outbase).i,) 134 TOOL_VBoxXGccArm64Elf_COMPILE_C_USES_KOBJCACHE = $(if-expr "$(use_objcache)" != "",1,) 135 define TOOL_VBoxXGccArm64Elf_COMPILE_C_CMDS 136 if "$(use_objcache)" != "" 137 $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\ 138 --kObjCache-cpp $(outbase).i\ 139 $(TOOL_VBoxXGccArm64Elf_CC) -E -o -\ 140 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\ 141 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ 142 $(abspath $(source))\ 143 --kObjCache-cc $(obj)\ 144 $(TOOL_VBoxXGccArm64Elf_CC) -c\ 145 $(flags) -fpreprocessed -x c\ 146 -o $(obj)\ 147 - 148 else 149 $(QUIET)$(TOOL_VBoxXGccArm64Elf_CC) -c\ 150 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\ 151 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ 152 -o $(obj)\ 96 153 $(abspath $(source)) 97 endef 98 99 TOOL_VBoxXGccAmd64LinuxGnu_COMPILE_CXX_OUTPUT = 100 TOOL_VBoxXGccAmd64LinuxGnu_COMPILE_CXX_DEPEND = 101 TOOL_VBoxXGccAmd64LinuxGnu_COMPILE_CXX_DEPORD = 102 define TOOL_VBoxXGccAmd64LinuxGnu_COMPILE_CXX_CMDS 103 $(QUIET)$(TOOL_VBoxXGccAmd64LinuxGnu_CXX) -c \ 104 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs)) \ 105 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP \ 106 -o $(obj) \ 154 endif 155 $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" 156 endef 157 158 159 ## Compile C++ source. 160 # @param $(target) Normalized main target name. 161 # @param $(source) Source filename (relative). 162 # @param $(obj) Object file name. This shall be (re)created by the compilation. 163 # @param $(dep) Dependcy file. This shall be (re)created by the compilation. 164 # @param $(flags) Flags. 165 # @param $(defs) Definitions. No -D or something. 166 # @param $(incs) Includes. No -I or something. 167 # @param $(dirdep) Directory creation dependency. 168 # @param $(deps) Other dependencies. 169 # @param $(outbase) Output basename (full). Use this for list files and such. 170 # @param $(objsuff) Object suffix. 171 TOOL_VBoxXGccArm64Elf_COMPILE_CXX_OUTPUT = $(if-expr "$(use_objcache)" != "",$(outbase).ii,) 172 TOOL_VBoxXGccArm64Elf_COMPILE_CXX_DEPEND = $($(target)_1_GCC_PCH_FILE) 173 TOOL_VBoxXGccArm64Elf_COMPILE_CXX_DEPORD = 174 TOOL_VBoxXGccArm64Elf_COMPILE_CXX_USES_KOBJCACHE = $(if-expr "$(use_objcache)" != "",1,) 175 define TOOL_VBoxXGccArm64Elf_COMPILE_CXX_CMDS 176 if "$(use_objcache)" != "" 177 $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\ 178 --kObjCache-cpp $(outbase).ii\ 179 $(TOOL_VBoxXGccArm64Elf_CXX) -E -o - $(if-expr defined($(target)_PCH_HDR)\ 180 ,-fpch-preprocess -Winvalid-pch -I$($(target)_1_GCC_PCH_DIR) -include $(basename $($(target)_1_GCC_PCH_FILE)),)\ 181 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\ 182 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ 183 $(abspath $(source))\ 184 --kObjCache-cc $(obj)\ 185 $(TOOL_VBoxXGccArm64Elf_CXX) -c\ 186 $(flags) -fpreprocessed $(if-expr defined($(target)_PCH_HDR),-fpch-preprocess,) -x c++\ 187 -o $(obj)\ 188 - 189 else 190 $(QUIET)$(TOOL_VBoxXGccArm64Elf_CXX) -c\ 191 $(flags) $(qaddprefix sh,-I, $($(target)_1_GCC_PCH_DIR) $(incs)) $(qaddprefix sh,-D, $(defs))\ 192 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ 193 -o $(obj) $(if-expr defined($(target)_PCH_HDR) \ 194 ,-Winvalid-pch -include $(basename $($(target)_1_GCC_PCH_FILE)),) \ 107 195 $(abspath $(source)) 108 endef 109 110 TOOL_VBoxXGccAmd64LinuxGnu_COMPILE_AS_OUTPUT = 111 TOOL_VBoxXGccAmd64LinuxGnu_COMPILE_AS_DEPEND = 112 TOOL_VBoxXGccAmd64LinuxGnu_COMPILE_AS_DEPORD = 113 define TOOL_VBoxXGccAmd64LinuxGnu_COMPILE_AS_CMDS 114 $(QUIET)$(TOOL_VBoxXGccAmd64LinuxGnu_AS) -c \ 115 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs)) \ 116 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP \ 117 -o $(obj) \ 196 endif 197 $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" 198 endef 199 200 201 ## Precompile C++ header. 202 # @param $(target) Normalized main target name. 203 # @param $(source) Source filename (relative). 204 # @param $(obj) Object file name. This shall be (re)created by the compilation. 205 # @param $(dep) Dependcy file. This shall be (re)created by the compilation. 206 # @param $(flags) Flags. 207 # @param $(defs) Definitions. No -D or something. 208 # @param $(incs) Includes. No -I or something. 209 # @param $(dirdep) Directory creation dependency. 210 # @param $(deps) Other dependencies. 211 # @param $(outbase) Output basename (full). Use this for list files and such. 212 # @param $(objsuff) Object suffix. 213 TOOL_VBoxXGccArm64Elf_COMPILE_PCH_OUTPUT = $($(target)_1_GCC_PCH_FILE) 214 TOOL_VBoxXGccArm64Elf_COMPILE_PCH_DEPEND = 215 TOOL_VBoxXGccArm64Elf_COMPILE_PCH_DEPORD = $($(target)_1_GCC_PCH_DIR) 216 define TOOL_VBoxXGccArm64Elf_COMPILE_PCH_CMDS 217 $(QUIET)$(TOOL_VBoxXGccArm64Elf_PCH) -c\ 218 $(flags) $(qaddprefix sh,-I, $($(target)_1_GCC_PCH_DIR) $(incs)) $(qaddprefix sh,-D, $(defs))\ 219 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ 220 -o $(obj)\ 118 221 $(abspath $(source)) 119 endef 120 121 TOOL_VBoxXGccAmd64LinuxGnu_LINK_LIBRARY_OUTPUT = $(out).ar-script 122 TOOL_VBoxXGccAmd64LinuxGnu_LINK_LIBRARY_DEPEND = $(othersrc) 123 TOOL_VBoxXGccAmd64LinuxGnu_LINK_LIBRARY_DEPORD = 124 define TOOL_VBoxXGccAmd64LinuxGnu_LINK_LIBRARY_CMDS 222 $(INSTALL) --hard-link-files-when-possible -m 0644 -- "$(obj)" "$($(target)_1_GCC_PCH_FILE)" 223 $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" 224 endef 225 226 227 ## Compile Assembly source. 228 # @param $(target) Normalized main target name. 229 # @param $(source) Source filename (relative). 230 # @param $(obj) Object file name. This shall be (re)created by the compilation. 231 # @param $(dep) Dependcy file. This shall be (re)created by the compilation. 232 # @param $(flags) Flags. 233 # @param $(defs) Definitions. No -D or something. 234 # @param $(incs) Includes. No -I or something. 235 # @param $(dirdep) Directory creation dependency. 236 # @param $(deps) Other dependencies. 237 # @param $(outbase) Output basename (full). Use this for list files and such. 238 # @param $(objsuff) Object suffix. 239 # 240 TOOL_VBoxXGccArm64Elf_COMPILE_AS_OUTPUT = 241 TOOL_VBoxXGccArm64Elf_COMPILE_AS_DEPEND = 242 TOOL_VBoxXGccArm64Elf_COMPILE_AS_DEPORD = 243 define TOOL_VBoxXGccArm64Elf_COMPILE_AS_CMDS 244 $(QUIET)$(TOOL_VBoxXGccArm64Elf_AS) -c\ 245 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\ 246 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ 247 -o $(obj)\ 248 $(abspath $(source)) 249 $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" 250 endef 251 252 253 ## Link library 254 # @param $(target) Normalized main target name. 255 # @param $(out) Library name. 256 # @param $(objs) Object files to put in the library. 257 # @param $(flags) Flags. 258 # @param $(dirdep) Directory creation dependency. 259 # @param $(deps) Other dependencies. 260 # @param $(othersrc) Unhandled sources. 261 # @param $(outbase) Output basename (full). Use this for list files and such. 262 TOOL_VBoxXGccArm64Elf_LINK_LIBRARY_OUTPUT = $(out).ar-script 263 TOOL_VBoxXGccArm64Elf_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).imp.a 264 TOOL_VBoxXGccArm64Elf_LINK_LIBRARY_DEPEND = $(othersrc) 265 TOOL_VBoxXGccArm64Elf_LINK_LIBRARY_DEPORD = 266 define TOOL_VBoxXGccArm64Elf_LINK_LIBRARY_CMDS 125 267 $(QUIET)$(APPEND) $(out).ar-script 'CREATE $(out)' 126 268 $(QUIET)$(APPEND) -n $(out).ar-script \ 127 $(foreach o,$(objs), 'ADDMOD $(o)') \ 128 $(foreach o,$(othersrc), 'ADDLIB $(o)') 269 $(foreach o,$(filter-out %.h.gch,$(objs)), 'ADDMOD $(o)') \ 270 $(foreach o,$(filter-out %.def %.imp %.dll,$(othersrc)), 'ADDLIB $(o)') 271 $(if $(filter %.def %.imp %.dll,$(othersrc))\ 272 ,$(TOOL_VBoxXGccArm64Elf_AR_IMP) -o $(outbase).imp.a $(filter %.def %.imp %.dll,$(othersrc))\ 273 $(NL)$(TAB)$(QUIET)$(APPEND) $(out).ar-script 'ADDLIB $(outbase).imp.a') 129 274 $(QUIET)$(APPEND) $(out).ar-script 'SAVE' 130 275 $(QUIET)$(APPEND) $(out).ar-script 'END' 131 $(QUIET)$(REDIRECT) -rti $(out).ar-script -- $(TOOL_VBoxXGccAmd64LinuxGnu_AR) -M 132 endef 133 134 TOOL_VBoxXGccAmd64LinuxGnu_LINK_PROGRAM_OUTPUT = $(outbase).map 135 TOOL_VBoxXGccAmd64LinuxGnu_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) 136 TOOL_VBoxXGccAmd64LinuxGnu_LINK_PROGRAM_DEPORD = 137 define TOOL_VBoxXGccAmd64LinuxGnu_LINK_PROGRAM_CMDS 138 $(QUIET)$(TOOL_VBoxXGccAmd64LinuxGnu_LD) $(flags) -o $(out) $(objs) \ 139 $(foreach p,$(libpath), -L$(p)) \ 140 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib))) \ 141 $(call TOOL_VBoxXGccAmd64LinuxGnu_LD_MAP,$(outbase).map) 142 endef 143 144 TOOL_VBoxXGccAmd64LinuxGnu_LINK_DLL_OUTPUT = $(outbase).map 145 TOOL_VBoxXGccAmd64LinuxGnu_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) 146 TOOL_VBoxXGccAmd64LinuxGnu_LINK_DLL_DEPORD = 147 define TOOL_VBoxXGccAmd64LinuxGnu_LINK_DLL_CMDS 148 $(QUIET)$(TOOL_VBoxXGccAmd64LinuxGnu_LD) $(TOOL_VBoxXGccAmd64LinuxGnu_LDFLAGS.dll) $(flags) -o $(out) \ 149 $(if $(filter-out win32 os2, $(KBUILD_TARGET)),$(call TOOL_VBoxXGccAmd64LinuxGnu_LD_SONAME,$(target),$(out))) \ 150 $(objs) \ 151 $(foreach p,$(libpath), -L$(p)) \ 152 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib))) \ 153 $(call TOOL_VBoxXGccAmd64LinuxGnu_LD_MAP,$(outbase).map) 154 endef 155 156 TOOL_VBoxXGccAmd64LinuxGnu_LINK_SYSMOD_OUTPUT = $(outbase).map 157 TOOL_VBoxXGccAmd64LinuxGnu_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) 158 TOOL_VBoxXGccAmd64LinuxGnu_LINK_SYSMOD_DEPORD = 159 define TOOL_VBoxXGccAmd64LinuxGnu_LINK_SYSMOD_CMDS 160 $(QUIET)$(TOOL_VBoxXGccAmd64LinuxGnu_LD_SYSMOD) $(TOOL_VBoxXGccAmd64LinuxGnu_LDFLAGS.sysmod) $(flags) -o $(out) $(objs) \ 161 $(foreach p,$(libpath), -L$(p)) \ 162 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib))) \ 163 $(call TOOL_VBoxXGccAmd64LinuxGnu_LD_SYSMOD_MAP,$(outbase).map) 164 endef 165 276 $(QUIET)$(REDIRECT) -rti $(out).ar-script -- $(TOOL_VBoxXGccArm64Elf_AR) -M 277 endef 278 279 280 ## Link program 281 # @param $(target) Normalized main target name. 282 # @param $(out) Program name. 283 # @param $(objs) Object files to link together. 284 # @param $(libs) Libraries to search. 285 # @param $(libpath) Library search paths. 286 # @param $(flags) Flags. 287 # @param $(dirdep) Directory creation dependency. 288 # @param $(deps) Other dependencies. 289 # @param $(othersrc) Unhandled sources. 290 # @param $(custom_pre) Custom step invoked before linking. 291 # @param $(custom_post) Custom step invoked after linking. 292 # @param $(outbase) Output basename (full). Use this for list files and such. 293 TOOL_VBoxXGccArm64Elf_LINK_PROGRAM_OUTPUT = 294 TOOL_VBoxXGccArm64Elf_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).map 295 TOOL_VBoxXGccArm64Elf_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).debug 296 TOOL_VBoxXGccArm64Elf_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug 297 TOOL_VBoxXGccArm64Elf_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\ 298 $(filter %.def, $(othersrc)) 299 TOOL_VBoxXGccArm64Elf_LINK_PROGRAM_DEPORD = 300 define TOOL_VBoxXGccArm64Elf_LINK_PROGRAM_CMDS 301 $(QUIET)$(TOOL_VBoxXGccArm64Elf_LD) $(flags) -o $(out) $(filter-out %.h.gch,$(objs))\ 302 $(filter %.def, $(othersrc))\ 303 $(foreach p,$(libpath), -L$(p))\ 304 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\ 305 $(call TOOL_VBoxXGccArm64Elf_LD_MAP,$(outbase).map) 306 ifeq ($(ld_debug),split) 307 $(QUIET)$(TOOL_VBoxXGccArm64Elf_OBJCOPY) --only-keep-debug $(out) $(outbase).debug 308 $(QUIET)$(CHMOD) a-x $(outbase).debug 309 $(QUIET)$(TOOL_VBoxXGccArm64Elf_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out) 310 endif 311 endef 312 313 314 ## Link DLL 315 # @param $(target) Normalized main target name. 316 # @param $(out) Program name. 317 # @param $(objs) Object files to link together. 318 # @param $(libs) Libraries to search. 319 # @param $(libpath) Library search paths. 320 # @param $(flags) Flags. 321 # @param $(dirdep) Directory creation dependency. 322 # @param $(deps) Other dependencies. 323 # @param $(othersrc) Unhandled sources. 324 # @param $(custom_pre) Custom step invoked before linking. 325 # @param $(custom_post) Custom step invoked after linking. 326 # @param $(outbase) Output basename (full). Use this for list files and such. 327 TOOL_VBoxXGccArm64Elf_LINK_DLL_OUTPUT = 328 TOOL_VBoxXGccArm64Elf_LINK_DLL_OUTPUT_MAYBE = $(outbase).map 329 TOOL_VBoxXGccArm64Elf_LINK_DLL_OUTPUT_DEBUG = $(outbase).debug 330 TOOL_VBoxXGccArm64Elf_LINK_DLL_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug 331 TOOL_VBoxXGccArm64Elf_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\ 332 $(filter %.def, $(othersrc)) 333 TOOL_VBoxXGccArm64Elf_LINK_DLL_DEPORD = 334 define TOOL_VBoxXGccArm64Elf_LINK_DLL_CMDS 335 $(QUIET)$(TOOL_VBoxXGccArm64Elf_LD) $(TOOL_VBoxXGccArm64Elf_LDFLAGS.dll) $(flags) -o $(out)\ 336 $(if $(filter-out win os2, $(KBUILD_TARGET)),$(call TOOL_VBoxXGccArm64Elf_LD_SONAME,$(target),$(out)))\ 337 $(filter-out %.h.gch,$(objs))\ 338 $(filter %.def, $(othersrc))\ 339 $(foreach p,$(libpath), -L$(p))\ 340 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\ 341 $(call TOOL_VBoxXGccArm64Elf_LD_MAP,$(outbase).map) 342 ifeq ($(ld_debug),split) 343 $(QUIET)$(TOOL_VBoxXGccArm64Elf_OBJCOPY) --only-keep-debug $(out) $(outbase).debug 344 $(QUIET)$(CHMOD) a-x $(outbase).debug 345 $(QUIET)$(TOOL_VBoxXGccArm64Elf_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out) 346 endif 347 endef 348 349 350 ## Link system module (windows aka driver, linux aka kernel module) 351 # @param $(target) Normalized main target name. 352 # @param $(out) System module name. 353 # @param $(objs) Object files to link together. 354 # @param $(libs) Libraries to search. 355 # @param $(libpath) Library search paths. 356 # @param $(flags) Flags. 357 # @param $(dirdep) Directory creation dependency. 358 # @param $(deps) Other dependencies. 359 # @param $(othersrc) Unhandled sources. 360 # @param $(custom_pre) Custom step invoked before linking. 361 # @param $(custom_post) Custom step invoked after linking. 362 # @param $(outbase) Output basename (full). Use this for list files and such. 363 TOOL_VBoxXGccArm64Elf_LINK_SYSMOD_OUTPUT = 364 TOOL_VBoxXGccArm64Elf_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).map 365 TOOL_VBoxXGccArm64Elf_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).debug 366 TOOL_VBoxXGccArm64Elf_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug 367 TOOL_VBoxXGccArm64Elf_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\ 368 $(filter %.def, $(othersrc)) 369 TOOL_VBoxXGccArm64Elf_LINK_SYSMOD_DEPORD = 370 define TOOL_VBoxXGccArm64Elf_LINK_SYSMOD_CMDS 371 $(QUIET)$(TOOL_VBoxXGccArm64Elf_LD_SYSMOD) $(TOOL_VBoxXGccArm64Elf_LDFLAGS.sysmod) $(flags) -o $(out) $(filter-out %.h.gch,$(objs))\ 372 $(filter %.def, $(othersrc))\ 373 $(foreach p,$(libpath), -L$(p))\ 374 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\ 375 $(call TOOL_VBoxXGccArm64Elf_LD_SYSMOD_MAP,$(outbase).map) 376 ifeq ($(ld_debug),split) 377 $(QUIET)$(TOOL_VBoxXGccArm64Elf_OBJCOPY) --only-keep-debug $(out) $(outbase).debug 378 $(QUIET)$(CHMOD) a-x $(outbase).debug 379 $(QUIET)$(TOOL_VBoxXGccArm64Elf_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out) 380 endif 381 endef 382 -
trunk/tools/kBuildTools/VBoxXGccArmNoneEabi.kmk
r100426 r100472 1 1 # $Id$ 2 2 ## @file 3 # VBox kBuild Tool Config - GCC Cross compiler for Debian 4.0 AMD64.4 # 5 6 # 7 # Copyright (C) 20 13-2023 Oracle and/or its affiliates.3 # kBuild Tool Config - GCC v13.1.x, targeting baremetal ARM (for the UEFI firmware). 4 # 5 6 # 7 # Copyright (C) 2023 Oracle and/or its affiliates. 8 8 # 9 9 # This file is part of VirtualBox base platform packages, as … … 26 26 # 27 27 28 TOOL_VBoxXGccAmd64LinuxGnu := GCC Cross compiler for Debian 4.0. 29 30 # Tool Specific Properties: 31 ifndef TOOL_VBoxXGccAmd64LinuxGnu_PREFIX 32 TOOL_VBoxXGccAmd64LinuxGnu_PREFIX := x86_64-linux-gnu- 33 endif 34 ifndef PATH_TOOL_VBoxXGccAmd64LinuxGnu 35 PATH_TOOL_VBoxXGccAmd64LinuxGnu := $(lastword $(wildcard $(KBUILD_DEVTOOLS_HST)/x86_64-linux-gnu/*)) 36 ifeq ($(PATH_TOOL_VBoxXGccAmd64LinuxGnu),) 37 PATH_TOOL_VBoxXGccAmd64LinuxGnu := $(lastword $(sort $(wildcard $(KBUILD_DEVTOOLS_HST_ALT)/x86_64-linux-gnu/*))) 38 endif 39 endif 40 TOOL_VBoxXGccAmd64LinuxGnu_PREFIX := $(PATH_TOOL_VBoxXGccAmd64LinuxGnu)/usr/bin/$(TOOL_VBoxXGccAmd64LinuxGnu_PREFIX) 41 42 TOOL_VBoxXGccAmd64LinuxGnu_CC ?= $(TOOL_VBoxXGccAmd64LinuxGnu_PREFIX)gcc-4.1$(HOSTSUFF_EXE) 43 TOOL_VBoxXGccAmd64LinuxGnu_CXX ?= $(TOOL_VBoxXGccAmd64LinuxGnu_PREFIX)g++-4.1$(HOSTSUFF_EXE) 44 TOOL_VBoxXGccAmd64LinuxGnu_AS ?= $(TOOL_VBoxXGccAmd64LinuxGnu_PREFIX)gcc-4.1$(HOSTSUFF_EXE) 45 TOOL_VBoxXGccAmd64LinuxGnu_AR ?= $(TOOL_VBoxXGccAmd64LinuxGnu_PREFIX)ar$(HOSTSUFF_EXE) 46 TOOL_VBoxXGccAmd64LinuxGnu_LD ?= $(TOOL_VBoxXGccAmd64LinuxGnu_PREFIX)gcc-4.1$(HOSTSUFF_EXE) 47 TOOL_VBoxXGccAmd64LinuxGnu_LD_SYSMOD ?= $(TOOL_VBoxXGccAmd64LinuxGnu_PREFIX)ld$(HOSTSUFF_EXE) 48 49 TOOL_VBoxXGccAmd64LinuxGnu_LD_SONAME ?= -Wl,-soname=$(firstword $($(1)_SONAME.$(KBUILD_TARGET).$(KBUILD_TYPE)) $($(1)_SONAME.$(KBUILD_TARGET)) $($(1)_SONAME.$(KBUILD_TYPE)) $($(1)_SONAME) $(notdir $(2))) 50 TOOL_VBoxXGccAmd64LinuxGnu_LD_MAP ?= -Wl,-Map -Wl,$(1) 51 TOOL_VBoxXGccAmd64LinuxGnu_LD_SYSMOD_MAP ?= -Map $(1) 52 TOOL_VBoxXGccAmd64LinuxGnu_LDFLAGS.dll ?= -shared 53 TOOL_VBoxXGccAmd64LinuxGnu_LDFLAGS.sysmod ?= -r 54 55 ifdef SLKRUNS 56 TOOL_VBoxXGccAmd64LinuxGnu_CC += -fmessage-length=0 57 TOOL_VBoxXGccAmd64LinuxGnu_CXX += -fmessage-length=0 58 endif 59 60 # General Properties used by kBuild: 61 TOOL_VBoxXGccAmd64LinuxGnu_COBJSUFF ?= .o 62 TOOL_VBoxXGccAmd64LinuxGnu_CFLAGS ?= -g 63 TOOL_VBoxXGccAmd64LinuxGnu_CFLAGS.debug ?= -O0 64 TOOL_VBoxXGccAmd64LinuxGnu_CFLAGS.release ?= -O2 65 TOOL_VBoxXGccAmd64LinuxGnu_CFLAGS.profile ?= -O2 66 TOOL_VBoxXGccAmd64LinuxGnu_CINCS ?= 67 TOOL_VBoxXGccAmd64LinuxGnu_CDEFS ?= 68 69 TOOL_VBoxXGccAmd64LinuxGnu_CXXOBJSUFF ?= .o 70 TOOL_VBoxXGccAmd64LinuxGnu_CXXOBJSUFF ?= .o 71 TOOL_VBoxXGccAmd64LinuxGnu_CXXFLAGS ?= -g 72 TOOL_VBoxXGccAmd64LinuxGnu_CXXFLAGS.debug ?= -O0 73 TOOL_VBoxXGccAmd64LinuxGnu_CXXFLAGS.release ?= -O2 74 TOOL_VBoxXGccAmd64LinuxGnu_CXXFLAGS.profile ?= -O2 75 TOOL_VBoxXGccAmd64LinuxGnu_CXXINCS ?= 76 TOOL_VBoxXGccAmd64LinuxGnu_CXXDEFS ?= 77 78 TOOL_VBoxXGccAmd64LinuxGnu_ASFLAGS ?= -g -x assembler-with-cpp 79 TOOL_VBoxXGccAmd64LinuxGnu_ASOBJSUFF ?= .o 80 81 TOOL_VBoxXGccAmd64LinuxGnu_ARFLAGS ?= cr 82 TOOL_VBoxXGccAmd64LinuxGnu_ARLIBSUFF ?= .a 83 84 TOOL_VBoxXGccAmd64LinuxGnu_LDFLAGS ?= 85 TOOL_VBoxXGccAmd64LinuxGnu_LDFLAGS.debug ?= -g 86 TOOL_VBoxXGccAmd64LinuxGnu_LDFLAGS.release ?= -s 87 88 TOOL_VBoxXGccAmd64LinuxGnu_COMPILE_C_OUTPUT = 89 TOOL_VBoxXGccAmd64LinuxGnu_COMPILE_C_DEPEND = 90 TOOL_VBoxXGccAmd64LinuxGnu_COMPILE_C_DEPORD = 91 define TOOL_VBoxXGccAmd64LinuxGnu_COMPILE_C_CMDS 92 $(QUIET)$(TOOL_VBoxXGccAmd64LinuxGnu_CC) -c \ 93 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs)) \ 94 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP \ 95 -o $(obj) \ 28 TOOL_VBoxXGccArmNoneEabi := Generic GCC v13.1.x or later using the tools GCC and Binutils, targeting ARM. 29 30 31 # 32 # Tool Specific Properties 33 # 34 ifndef PATH_TOOL_VBoxXGccArmNoneEabi 35 PATH_TOOL_VBoxXGccArmNoneEabi := $(firstfile $(rversortfiles $(qwildcard ,$(KBUILD_DEVTOOLS_HST)/gcc-arm-none-eabi/v13.1*/bin))) 36 ifeq ($(PATH_TOOL_VBoxXGccArmNoneEabi),) 37 PATH_TOOL_VBoxXGccArmNoneEabi := $(PATH_TOOL_VBoxXGccArmNoneEabi) 38 endif 39 ifeq ($(PATH_TOOL_VBoxXGccArmNoneEabi),) 40 $(error kBuild: PATH_TOOL_VBoxXGccArmNoneEabi cannot be determined!) 41 endif 42 else 43 # Resolve any fancy stuff once and for all. 44 PATH_TOOL_VBoxXGccArmNoneEabi := $(PATH_TOOL_VBoxXGccArmNoneEabi) 45 endif 46 47 48 # Tool Specific Properties 49 ifndef TOOL_VBoxXGccArmNoneEabi_PREFIX 50 TOOL_VBoxXGccArmNoneEabi_PREFIX := arm-none-eabi- 51 endif 52 ifndef TOOL_VBoxXGccArmNoneEabi_SUFFIX 53 TOOL_VBoxXGccArmNoneEabi_SUFFIX := $(HOSTSUFF_EXE) 54 endif 55 56 TOOL_VBoxXGccArmNoneEabi_CC ?= $(PATH_TOOL_VBoxXGccArmNoneEabi)/$(TOOL_VBoxXGccArmNoneEabi_PREFIX)gcc$(TOOL_VBoxXGccArmNoneEabi_SUFFIX) 57 TOOL_VBoxXGccArmNoneEabi_CXX ?= $(PATH_TOOL_VBoxXGccArmNoneEabi)/$(TOOL_VBoxXGccArmNoneEabi_PREFIX)g++$(TOOL_VBoxXGccArmNoneEabi_SUFFIX) 58 TOOL_VBoxXGccArmNoneEabi_PCH ?= $(TOOL_VBoxXGccArmNoneEabi_CXX) 59 TOOL_VBoxXGccArmNoneEabi_AS ?= $(PATH_TOOL_VBoxXGccArmNoneEabi)/$(TOOL_VBoxXGccArmNoneEabi_PREFIX)gcc$(TOOL_VBoxXGccArmNoneEabi_SUFFIX) 60 TOOL_VBoxXGccArmNoneEabi_AR ?= $(PATH_TOOL_VBoxXGccArmNoneEabi)/$(TOOL_VBoxXGccArmNoneEabi_PREFIX)ar$(TOOL_VBoxXGccArmNoneEabi_SUFFIX) 61 TOOL_VBoxXGccArmNoneEabi_AR_IMP ?= $(ECHO) not supported! 62 TOOL_VBoxXGccArmNoneEabi_LD ?= $(PATH_TOOL_VBoxXGccArmNoneEabi)/$(TOOL_VBoxXGccArmNoneEabi_PREFIX)g++$(TOOL_VBoxXGccArmNoneEabi_SUFFIX) 63 TOOL_VBoxXGccArmNoneEabi_LD_SYSMOD ?= $(PATH_TOOL_VBoxXGccArmNoneEabi)/$(TOOL_VBoxXGccArmNoneEabi_PREFIX)ld$(TOOL_VBoxXGccArmNoneEabi_SUFFIX) 64 ifndef TOOL_VBoxXGccArmNoneEabi_LDFLAGS.$(KBUILD_TARGET) 65 TOOL_VBoxXGccArmNoneEabi_LDFLAGS.dll ?= -shared 66 else 67 TOOL_VBoxXGccArmNoneEabi_LDFLAGS.dll ?= $(TOOL_VBoxXGccArmNoneEabi_LDFLAGS.$(KBUILD_TARGET)) 68 endif 69 TOOL_VBoxXGccArmNoneEabi_LDFLAGS.sysmod ?= -r 70 TOOL_VBoxXGccArmNoneEabi_LD_SONAME ?= -Wl,-soname=$(firstword $($(1)_SONAME.$(KBUILD_TARGET).$(KBUILD_TYPE)) $($(1)_SONAME.$(KBUILD_TARGET)) $($(1)_SONAME.$(KBUILD_TYPE)) $($(1)_SONAME) $(notdir $(2))) 71 ifeq ($(KBUILD_TARGET),os2) 72 TOOL_VBoxXGccArmNoneEabi_LD_MAP ?= -Zmap=$(1) 73 TOOL_VBoxXGccArmNoneEabi_LD_SYSMOD_MAP ?= -Zmap=$(1) 74 else 75 TOOL_VBoxXGccArmNoneEabi_LD_MAP ?= 76 TOOL_VBoxXGccArmNoneEabi_LD_SYSMOD_MAP ?= 77 endif 78 TOOL_VBoxXGccArmNoneEabi_OBJCOPY ?= $(PATH_TOOL_VBoxXGccArmNoneEabi)/$(TOOL_VBoxXGccArmNoneEabi_PREFIX)objcopy$(TOOL_VBoxXGccArmNoneEabi_SUFFIX) 79 80 # General Properties used by kBuild 81 TOOL_VBoxXGccArmNoneEabi_COBJSUFF ?= .o 82 TOOL_VBoxXGccArmNoneEabi_CFLAGS ?= 83 TOOL_VBoxXGccArmNoneEabi_CFLAGS.debug ?= -g 84 TOOL_VBoxXGccArmNoneEabi_CFLAGS.profile ?= -O2 #-g -pg 85 TOOL_VBoxXGccArmNoneEabi_CFLAGS.release ?= -O2 86 TOOL_VBoxXGccArmNoneEabi_CINCS ?= 87 TOOL_VBoxXGccArmNoneEabi_CDEFS ?= 88 89 TOOL_VBoxXGccArmNoneEabi_CXXOBJSUFF ?= .o 90 TOOL_VBoxXGccArmNoneEabi_CXXFLAGS ?= 91 TOOL_VBoxXGccArmNoneEabi_CXXFLAGS.debug ?= -g 92 TOOL_VBoxXGccArmNoneEabi_CXXFLAGS.profile ?= -O2 #-g -pg 93 TOOL_VBoxXGccArmNoneEabi_CXXFLAGS.release ?= -O2 94 TOOL_VBoxXGccArmNoneEabi_CXXINCS ?= 95 TOOL_VBoxXGccArmNoneEabi_CXXDEFS ?= 96 97 TOOL_VBoxXGccArmNoneEabi_PCHOBJSUFF ?= .h.gch 98 TOOL_VBoxXGccArmNoneEabi_PCHFLAGS ?= $(TOOL_VBoxXGccArmNoneEabi_CXXFLAGS) 99 TOOL_VBoxXGccArmNoneEabi_PCHFLAGS.debug ?= $(TOOL_VBoxXGccArmNoneEabi_CXXFLAGS.debug) 100 TOOL_VBoxXGccArmNoneEabi_PCHFLAGS.profile ?= $(TOOL_VBoxXGccArmNoneEabi_CXXFLAGS.profile) 101 TOOL_VBoxXGccArmNoneEabi_PCHFLAGS.release ?= $(TOOL_VBoxXGccArmNoneEabi_CXXFLAGS.release) 102 TOOL_VBoxXGccArmNoneEabi_PCHINCS ?= $(TOOL_VBoxXGccArmNoneEabi_CXXINCS) 103 TOOL_VBoxXGccArmNoneEabi_PCHDEFS ?= $(TOOL_VBoxXGccArmNoneEabi_CXXDEFS) 104 105 TOOL_VBoxXGccArmNoneEabi_ASFLAGS ?= -x assembler-with-cpp 106 TOOL_VBoxXGccArmNoneEabi_ASFLAGS.debug ?= -g 107 TOOL_VBoxXGccArmNoneEabi_ASFLAGS.profile ?= -g 108 TOOL_VBoxXGccArmNoneEabi_ASOBJSUFF ?= .o 109 110 TOOL_VBoxXGccArmNoneEabi_ARFLAGS ?= cr 111 TOOL_VBoxXGccArmNoneEabi_ARLIBSUFF ?= .a 112 113 TOOL_VBoxXGccArmNoneEabi_LDFLAGS ?= 114 TOOL_VBoxXGccArmNoneEabi_LDFLAGS.debug ?= -g 115 TOOL_VBoxXGccArmNoneEabi_LDFLAGS.profile ?= -g 116 117 118 ## Compile C source. 119 # @param $(target) Normalized main target name. 120 # @param $(source) Source filename (relative). 121 # @param $(obj) Object file name. This shall be (re)created by the compilation. 122 # @param $(dep) Dependcy file. This shall be (re)created by the compilation. 123 # @param $(flags) Flags. 124 # @param $(defs) Definitions. No -D or something. 125 # @param $(incs) Includes. No -I or something. 126 # @param $(dirdep) Directory creation dependency. 127 # @param $(deps) Other dependencies. 128 # 129 # @param $(outbase) Output basename (full). Use this for list files and such. 130 # @param $(objsuff) Object suffix. 131 TOOL_VBoxXGccArmNoneEabi_COMPILE_C_DEPEND = 132 TOOL_VBoxXGccArmNoneEabi_COMPILE_C_DEPORD = 133 TOOL_VBoxXGccArmNoneEabi_COMPILE_C_OUTPUT = $(if-expr "$(use_objcache)" != "",$(outbase).i,) 134 TOOL_VBoxXGccArmNoneEabi_COMPILE_C_USES_KOBJCACHE = $(if-expr "$(use_objcache)" != "",1,) 135 define TOOL_VBoxXGccArmNoneEabi_COMPILE_C_CMDS 136 if "$(use_objcache)" != "" 137 $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\ 138 --kObjCache-cpp $(outbase).i\ 139 $(TOOL_VBoxXGccArmNoneEabi_CC) -E -o -\ 140 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\ 141 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ 142 $(abspath $(source))\ 143 --kObjCache-cc $(obj)\ 144 $(TOOL_VBoxXGccArmNoneEabi_CC) -c\ 145 $(flags) -fpreprocessed -x c\ 146 -o $(obj)\ 147 - 148 else 149 $(QUIET)$(TOOL_VBoxXGccArmNoneEabi_CC) -c\ 150 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\ 151 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ 152 -o $(obj)\ 96 153 $(abspath $(source)) 97 endef 98 99 TOOL_VBoxXGccAmd64LinuxGnu_COMPILE_CXX_OUTPUT = 100 TOOL_VBoxXGccAmd64LinuxGnu_COMPILE_CXX_DEPEND = 101 TOOL_VBoxXGccAmd64LinuxGnu_COMPILE_CXX_DEPORD = 102 define TOOL_VBoxXGccAmd64LinuxGnu_COMPILE_CXX_CMDS 103 $(QUIET)$(TOOL_VBoxXGccAmd64LinuxGnu_CXX) -c \ 104 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs)) \ 105 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP \ 106 -o $(obj) \ 154 endif 155 $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" 156 endef 157 158 159 ## Compile C++ source. 160 # @param $(target) Normalized main target name. 161 # @param $(source) Source filename (relative). 162 # @param $(obj) Object file name. This shall be (re)created by the compilation. 163 # @param $(dep) Dependcy file. This shall be (re)created by the compilation. 164 # @param $(flags) Flags. 165 # @param $(defs) Definitions. No -D or something. 166 # @param $(incs) Includes. No -I or something. 167 # @param $(dirdep) Directory creation dependency. 168 # @param $(deps) Other dependencies. 169 # @param $(outbase) Output basename (full). Use this for list files and such. 170 # @param $(objsuff) Object suffix. 171 TOOL_VBoxXGccArmNoneEabi_COMPILE_CXX_OUTPUT = $(if-expr "$(use_objcache)" != "",$(outbase).ii,) 172 TOOL_VBoxXGccArmNoneEabi_COMPILE_CXX_DEPEND = $($(target)_1_GCC_PCH_FILE) 173 TOOL_VBoxXGccArmNoneEabi_COMPILE_CXX_DEPORD = 174 TOOL_VBoxXGccArmNoneEabi_COMPILE_CXX_USES_KOBJCACHE = $(if-expr "$(use_objcache)" != "",1,) 175 define TOOL_VBoxXGccArmNoneEabi_COMPILE_CXX_CMDS 176 if "$(use_objcache)" != "" 177 $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\ 178 --kObjCache-cpp $(outbase).ii\ 179 $(TOOL_VBoxXGccArmNoneEabi_CXX) -E -o - $(if-expr defined($(target)_PCH_HDR)\ 180 ,-fpch-preprocess -Winvalid-pch -I$($(target)_1_GCC_PCH_DIR) -include $(basename $($(target)_1_GCC_PCH_FILE)),)\ 181 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\ 182 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ 183 $(abspath $(source))\ 184 --kObjCache-cc $(obj)\ 185 $(TOOL_VBoxXGccArmNoneEabi_CXX) -c\ 186 $(flags) -fpreprocessed $(if-expr defined($(target)_PCH_HDR),-fpch-preprocess,) -x c++\ 187 -o $(obj)\ 188 - 189 else 190 $(QUIET)$(TOOL_VBoxXGccArmNoneEabi_CXX) -c\ 191 $(flags) $(qaddprefix sh,-I, $($(target)_1_GCC_PCH_DIR) $(incs)) $(qaddprefix sh,-D, $(defs))\ 192 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ 193 -o $(obj) $(if-expr defined($(target)_PCH_HDR) \ 194 ,-Winvalid-pch -include $(basename $($(target)_1_GCC_PCH_FILE)),) \ 107 195 $(abspath $(source)) 108 endef 109 110 TOOL_VBoxXGccAmd64LinuxGnu_COMPILE_AS_OUTPUT = 111 TOOL_VBoxXGccAmd64LinuxGnu_COMPILE_AS_DEPEND = 112 TOOL_VBoxXGccAmd64LinuxGnu_COMPILE_AS_DEPORD = 113 define TOOL_VBoxXGccAmd64LinuxGnu_COMPILE_AS_CMDS 114 $(QUIET)$(TOOL_VBoxXGccAmd64LinuxGnu_AS) -c \ 115 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs)) \ 116 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP \ 117 -o $(obj) \ 196 endif 197 $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" 198 endef 199 200 201 ## Precompile C++ header. 202 # @param $(target) Normalized main target name. 203 # @param $(source) Source filename (relative). 204 # @param $(obj) Object file name. This shall be (re)created by the compilation. 205 # @param $(dep) Dependcy file. This shall be (re)created by the compilation. 206 # @param $(flags) Flags. 207 # @param $(defs) Definitions. No -D or something. 208 # @param $(incs) Includes. No -I or something. 209 # @param $(dirdep) Directory creation dependency. 210 # @param $(deps) Other dependencies. 211 # @param $(outbase) Output basename (full). Use this for list files and such. 212 # @param $(objsuff) Object suffix. 213 TOOL_VBoxXGccArmNoneEabi_COMPILE_PCH_OUTPUT = $($(target)_1_GCC_PCH_FILE) 214 TOOL_VBoxXGccArmNoneEabi_COMPILE_PCH_DEPEND = 215 TOOL_VBoxXGccArmNoneEabi_COMPILE_PCH_DEPORD = $($(target)_1_GCC_PCH_DIR) 216 define TOOL_VBoxXGccArmNoneEabi_COMPILE_PCH_CMDS 217 $(QUIET)$(TOOL_VBoxXGccArmNoneEabi_PCH) -c\ 218 $(flags) $(qaddprefix sh,-I, $($(target)_1_GCC_PCH_DIR) $(incs)) $(qaddprefix sh,-D, $(defs))\ 219 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ 220 -o $(obj)\ 118 221 $(abspath $(source)) 119 endef 120 121 TOOL_VBoxXGccAmd64LinuxGnu_LINK_LIBRARY_OUTPUT = $(out).ar-script 122 TOOL_VBoxXGccAmd64LinuxGnu_LINK_LIBRARY_DEPEND = $(othersrc) 123 TOOL_VBoxXGccAmd64LinuxGnu_LINK_LIBRARY_DEPORD = 124 define TOOL_VBoxXGccAmd64LinuxGnu_LINK_LIBRARY_CMDS 222 $(INSTALL) --hard-link-files-when-possible -m 0644 -- "$(obj)" "$($(target)_1_GCC_PCH_FILE)" 223 $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" 224 endef 225 226 227 ## Compile Assembly source. 228 # @param $(target) Normalized main target name. 229 # @param $(source) Source filename (relative). 230 # @param $(obj) Object file name. This shall be (re)created by the compilation. 231 # @param $(dep) Dependcy file. This shall be (re)created by the compilation. 232 # @param $(flags) Flags. 233 # @param $(defs) Definitions. No -D or something. 234 # @param $(incs) Includes. No -I or something. 235 # @param $(dirdep) Directory creation dependency. 236 # @param $(deps) Other dependencies. 237 # @param $(outbase) Output basename (full). Use this for list files and such. 238 # @param $(objsuff) Object suffix. 239 # 240 TOOL_VBoxXGccArmNoneEabi_COMPILE_AS_OUTPUT = 241 TOOL_VBoxXGccArmNoneEabi_COMPILE_AS_DEPEND = 242 TOOL_VBoxXGccArmNoneEabi_COMPILE_AS_DEPORD = 243 define TOOL_VBoxXGccArmNoneEabi_COMPILE_AS_CMDS 244 $(QUIET)$(TOOL_VBoxXGccArmNoneEabi_AS) -c\ 245 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\ 246 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ 247 -o $(obj)\ 248 $(abspath $(source)) 249 $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" 250 endef 251 252 253 ## Link library 254 # @param $(target) Normalized main target name. 255 # @param $(out) Library name. 256 # @param $(objs) Object files to put in the library. 257 # @param $(flags) Flags. 258 # @param $(dirdep) Directory creation dependency. 259 # @param $(deps) Other dependencies. 260 # @param $(othersrc) Unhandled sources. 261 # @param $(outbase) Output basename (full). Use this for list files and such. 262 TOOL_VBoxXGccArmNoneEabi_LINK_LIBRARY_OUTPUT = $(out).ar-script 263 TOOL_VBoxXGccArmNoneEabi_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).imp.a 264 TOOL_VBoxXGccArmNoneEabi_LINK_LIBRARY_DEPEND = $(othersrc) 265 TOOL_VBoxXGccArmNoneEabi_LINK_LIBRARY_DEPORD = 266 define TOOL_VBoxXGccArmNoneEabi_LINK_LIBRARY_CMDS 125 267 $(QUIET)$(APPEND) $(out).ar-script 'CREATE $(out)' 126 268 $(QUIET)$(APPEND) -n $(out).ar-script \ 127 $(foreach o,$(objs), 'ADDMOD $(o)') \ 128 $(foreach o,$(othersrc), 'ADDLIB $(o)') 269 $(foreach o,$(filter-out %.h.gch,$(objs)), 'ADDMOD $(o)') \ 270 $(foreach o,$(filter-out %.def %.imp %.dll,$(othersrc)), 'ADDLIB $(o)') 271 $(if $(filter %.def %.imp %.dll,$(othersrc))\ 272 ,$(TOOL_VBoxXGccArmNoneEabi_AR_IMP) -o $(outbase).imp.a $(filter %.def %.imp %.dll,$(othersrc))\ 273 $(NL)$(TAB)$(QUIET)$(APPEND) $(out).ar-script 'ADDLIB $(outbase).imp.a') 129 274 $(QUIET)$(APPEND) $(out).ar-script 'SAVE' 130 275 $(QUIET)$(APPEND) $(out).ar-script 'END' 131 $(QUIET)$(REDIRECT) -rti $(out).ar-script -- $(TOOL_VBoxXGccAmd64LinuxGnu_AR) -M 132 endef 133 134 TOOL_VBoxXGccAmd64LinuxGnu_LINK_PROGRAM_OUTPUT = $(outbase).map 135 TOOL_VBoxXGccAmd64LinuxGnu_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) 136 TOOL_VBoxXGccAmd64LinuxGnu_LINK_PROGRAM_DEPORD = 137 define TOOL_VBoxXGccAmd64LinuxGnu_LINK_PROGRAM_CMDS 138 $(QUIET)$(TOOL_VBoxXGccAmd64LinuxGnu_LD) $(flags) -o $(out) $(objs) \ 139 $(foreach p,$(libpath), -L$(p)) \ 140 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib))) \ 141 $(call TOOL_VBoxXGccAmd64LinuxGnu_LD_MAP,$(outbase).map) 142 endef 143 144 TOOL_VBoxXGccAmd64LinuxGnu_LINK_DLL_OUTPUT = $(outbase).map 145 TOOL_VBoxXGccAmd64LinuxGnu_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) 146 TOOL_VBoxXGccAmd64LinuxGnu_LINK_DLL_DEPORD = 147 define TOOL_VBoxXGccAmd64LinuxGnu_LINK_DLL_CMDS 148 $(QUIET)$(TOOL_VBoxXGccAmd64LinuxGnu_LD) $(TOOL_VBoxXGccAmd64LinuxGnu_LDFLAGS.dll) $(flags) -o $(out) \ 149 $(if $(filter-out win32 os2, $(KBUILD_TARGET)),$(call TOOL_VBoxXGccAmd64LinuxGnu_LD_SONAME,$(target),$(out))) \ 150 $(objs) \ 151 $(foreach p,$(libpath), -L$(p)) \ 152 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib))) \ 153 $(call TOOL_VBoxXGccAmd64LinuxGnu_LD_MAP,$(outbase).map) 154 endef 155 156 TOOL_VBoxXGccAmd64LinuxGnu_LINK_SYSMOD_OUTPUT = $(outbase).map 157 TOOL_VBoxXGccAmd64LinuxGnu_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) 158 TOOL_VBoxXGccAmd64LinuxGnu_LINK_SYSMOD_DEPORD = 159 define TOOL_VBoxXGccAmd64LinuxGnu_LINK_SYSMOD_CMDS 160 $(QUIET)$(TOOL_VBoxXGccAmd64LinuxGnu_LD_SYSMOD) $(TOOL_VBoxXGccAmd64LinuxGnu_LDFLAGS.sysmod) $(flags) -o $(out) $(objs) \ 161 $(foreach p,$(libpath), -L$(p)) \ 162 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib))) \ 163 $(call TOOL_VBoxXGccAmd64LinuxGnu_LD_SYSMOD_MAP,$(outbase).map) 164 endef 165 276 $(QUIET)$(REDIRECT) -rti $(out).ar-script -- $(TOOL_VBoxXGccArmNoneEabi_AR) -M 277 endef 278 279 280 ## Link program 281 # @param $(target) Normalized main target name. 282 # @param $(out) Program name. 283 # @param $(objs) Object files to link together. 284 # @param $(libs) Libraries to search. 285 # @param $(libpath) Library search paths. 286 # @param $(flags) Flags. 287 # @param $(dirdep) Directory creation dependency. 288 # @param $(deps) Other dependencies. 289 # @param $(othersrc) Unhandled sources. 290 # @param $(custom_pre) Custom step invoked before linking. 291 # @param $(custom_post) Custom step invoked after linking. 292 # @param $(outbase) Output basename (full). Use this for list files and such. 293 TOOL_VBoxXGccArmNoneEabi_LINK_PROGRAM_OUTPUT = 294 TOOL_VBoxXGccArmNoneEabi_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).map 295 TOOL_VBoxXGccArmNoneEabi_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).debug 296 TOOL_VBoxXGccArmNoneEabi_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug 297 TOOL_VBoxXGccArmNoneEabi_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\ 298 $(filter %.def, $(othersrc)) 299 TOOL_VBoxXGccArmNoneEabi_LINK_PROGRAM_DEPORD = 300 define TOOL_VBoxXGccArmNoneEabi_LINK_PROGRAM_CMDS 301 $(QUIET)$(TOOL_VBoxXGccArmNoneEabi_LD) $(flags) -o $(out) $(filter-out %.h.gch,$(objs))\ 302 $(filter %.def, $(othersrc))\ 303 $(foreach p,$(libpath), -L$(p))\ 304 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\ 305 $(call TOOL_VBoxXGccArmNoneEabi_LD_MAP,$(outbase).map) 306 ifeq ($(ld_debug),split) 307 $(QUIET)$(TOOL_VBoxXGccArmNoneEabi_OBJCOPY) --only-keep-debug $(out) $(outbase).debug 308 $(QUIET)$(CHMOD) a-x $(outbase).debug 309 $(QUIET)$(TOOL_VBoxXGccArmNoneEabi_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out) 310 endif 311 endef 312 313 314 ## Link DLL 315 # @param $(target) Normalized main target name. 316 # @param $(out) Program name. 317 # @param $(objs) Object files to link together. 318 # @param $(libs) Libraries to search. 319 # @param $(libpath) Library search paths. 320 # @param $(flags) Flags. 321 # @param $(dirdep) Directory creation dependency. 322 # @param $(deps) Other dependencies. 323 # @param $(othersrc) Unhandled sources. 324 # @param $(custom_pre) Custom step invoked before linking. 325 # @param $(custom_post) Custom step invoked after linking. 326 # @param $(outbase) Output basename (full). Use this for list files and such. 327 TOOL_VBoxXGccArmNoneEabi_LINK_DLL_OUTPUT = 328 TOOL_VBoxXGccArmNoneEabi_LINK_DLL_OUTPUT_MAYBE = $(outbase).map 329 TOOL_VBoxXGccArmNoneEabi_LINK_DLL_OUTPUT_DEBUG = $(outbase).debug 330 TOOL_VBoxXGccArmNoneEabi_LINK_DLL_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug 331 TOOL_VBoxXGccArmNoneEabi_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\ 332 $(filter %.def, $(othersrc)) 333 TOOL_VBoxXGccArmNoneEabi_LINK_DLL_DEPORD = 334 define TOOL_VBoxXGccArmNoneEabi_LINK_DLL_CMDS 335 $(QUIET)$(TOOL_VBoxXGccArmNoneEabi_LD) $(TOOL_VBoxXGccArmNoneEabi_LDFLAGS.dll) $(flags) -o $(out)\ 336 $(if $(filter-out win os2, $(KBUILD_TARGET)),$(call TOOL_VBoxXGccArmNoneEabi_LD_SONAME,$(target),$(out)))\ 337 $(filter-out %.h.gch,$(objs))\ 338 $(filter %.def, $(othersrc))\ 339 $(foreach p,$(libpath), -L$(p))\ 340 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\ 341 $(call TOOL_VBoxXGccArmNoneEabi_LD_MAP,$(outbase).map) 342 ifeq ($(ld_debug),split) 343 $(QUIET)$(TOOL_VBoxXGccArmNoneEabi_OBJCOPY) --only-keep-debug $(out) $(outbase).debug 344 $(QUIET)$(CHMOD) a-x $(outbase).debug 345 $(QUIET)$(TOOL_VBoxXGccArmNoneEabi_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out) 346 endif 347 endef 348 349 350 ## Link system module (windows aka driver, linux aka kernel module) 351 # @param $(target) Normalized main target name. 352 # @param $(out) System module name. 353 # @param $(objs) Object files to link together. 354 # @param $(libs) Libraries to search. 355 # @param $(libpath) Library search paths. 356 # @param $(flags) Flags. 357 # @param $(dirdep) Directory creation dependency. 358 # @param $(deps) Other dependencies. 359 # @param $(othersrc) Unhandled sources. 360 # @param $(custom_pre) Custom step invoked before linking. 361 # @param $(custom_post) Custom step invoked after linking. 362 # @param $(outbase) Output basename (full). Use this for list files and such. 363 TOOL_VBoxXGccArmNoneEabi_LINK_SYSMOD_OUTPUT = 364 TOOL_VBoxXGccArmNoneEabi_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).map 365 TOOL_VBoxXGccArmNoneEabi_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).debug 366 TOOL_VBoxXGccArmNoneEabi_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug 367 TOOL_VBoxXGccArmNoneEabi_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\ 368 $(filter %.def, $(othersrc)) 369 TOOL_VBoxXGccArmNoneEabi_LINK_SYSMOD_DEPORD = 370 define TOOL_VBoxXGccArmNoneEabi_LINK_SYSMOD_CMDS 371 $(QUIET)$(TOOL_VBoxXGccArmNoneEabi_LD_SYSMOD) $(TOOL_VBoxXGccArmNoneEabi_LDFLAGS.sysmod) $(flags) -o $(out) $(filter-out %.h.gch,$(objs))\ 372 $(filter %.def, $(othersrc))\ 373 $(foreach p,$(libpath), -L$(p))\ 374 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\ 375 $(call TOOL_VBoxXGccArmNoneEabi_LD_SYSMOD_MAP,$(outbase).map) 376 ifeq ($(ld_debug),split) 377 $(QUIET)$(TOOL_VBoxXGccArmNoneEabi_OBJCOPY) --only-keep-debug $(out) $(outbase).debug 378 $(QUIET)$(CHMOD) a-x $(outbase).debug 379 $(QUIET)$(TOOL_VBoxXGccArmNoneEabi_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out) 380 endif 381 endef 382
Note:
See TracChangeset
for help on using the changeset viewer.