VirtualBox

Changeset 100472 in vbox for trunk/tools/kBuildTools


Ignore:
Timestamp:
Jul 10, 2023 3:53:11 PM (21 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
158227
Message:

tools: Add gcc cross compile toolchains for baremetal arm and arm64 in order to build UEFI images for arm on linux.amd64, bugref:10400

Location:
trunk/tools/kBuildTools
Files:
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/tools/kBuildTools/VBoxXGccArm64Elf.kmk

    r100426 r100472  
    11# $Id$
    22## @file
    3 # VBox kBuild Tool Config - GCC Cross compiler for Debian 4.0 AMD64.
    4 #
    5 
    6 #
    7 # Copyright (C) 2013-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.
    88#
    99# This file is part of VirtualBox base platform packages, as
     
    2626#
    2727
    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) \
     28TOOL_VBoxXGccArm64Elf := Generic GCC v13.1.x or later using the tools GCC and Binutils, targeting ARM64.
     29
     30
     31#
     32# Tool Specific Properties
     33#
     34ifndef 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
     42else
     43 # Resolve any fancy stuff once and for all.
     44 PATH_TOOL_VBoxXGccArm64Elf := $(PATH_TOOL_VBoxXGccArm64Elf)
     45endif
     46
     47
     48# Tool Specific Properties
     49ifndef TOOL_VBoxXGccArm64Elf_PREFIX
     50 TOOL_VBoxXGccArm64Elf_PREFIX := aarch64-elf-
     51endif
     52ifndef TOOL_VBoxXGccArm64Elf_SUFFIX
     53 TOOL_VBoxXGccArm64Elf_SUFFIX := $(HOSTSUFF_EXE)
     54endif
     55
     56TOOL_VBoxXGccArm64Elf_CC        ?= $(PATH_TOOL_VBoxXGccArm64Elf)/$(TOOL_VBoxXGccArm64Elf_PREFIX)gcc$(TOOL_VBoxXGccArm64Elf_SUFFIX)
     57TOOL_VBoxXGccArm64Elf_CXX       ?= $(PATH_TOOL_VBoxXGccArm64Elf)/$(TOOL_VBoxXGccArm64Elf_PREFIX)g++$(TOOL_VBoxXGccArm64Elf_SUFFIX)
     58TOOL_VBoxXGccArm64Elf_PCH       ?= $(TOOL_VBoxXGccArm64Elf_CXX)
     59TOOL_VBoxXGccArm64Elf_AS        ?= $(PATH_TOOL_VBoxXGccArm64Elf)/$(TOOL_VBoxXGccArm64Elf_PREFIX)gcc$(TOOL_VBoxXGccArm64Elf_SUFFIX)
     60TOOL_VBoxXGccArm64Elf_AR        ?= $(PATH_TOOL_VBoxXGccArm64Elf)/$(TOOL_VBoxXGccArm64Elf_PREFIX)ar$(TOOL_VBoxXGccArm64Elf_SUFFIX)
     61TOOL_VBoxXGccArm64Elf_AR_IMP    ?= $(ECHO) not supported!
     62TOOL_VBoxXGccArm64Elf_LD        ?= $(PATH_TOOL_VBoxXGccArm64Elf)/$(TOOL_VBoxXGccArm64Elf_PREFIX)g++$(TOOL_VBoxXGccArm64Elf_SUFFIX)
     63TOOL_VBoxXGccArm64Elf_LD_SYSMOD ?= $(PATH_TOOL_VBoxXGccArm64Elf)/$(TOOL_VBoxXGccArm64Elf_PREFIX)ld$(TOOL_VBoxXGccArm64Elf_SUFFIX)
     64ifndef TOOL_VBoxXGccArm64Elf_LDFLAGS.$(KBUILD_TARGET)
     65 TOOL_VBoxXGccArm64Elf_LDFLAGS.dll   ?= -shared
     66else
     67 TOOL_VBoxXGccArm64Elf_LDFLAGS.dll   ?= $(TOOL_VBoxXGccArm64Elf_LDFLAGS.$(KBUILD_TARGET))
     68endif
     69TOOL_VBoxXGccArm64Elf_LDFLAGS.sysmod ?= -r
     70TOOL_VBoxXGccArm64Elf_LD_SONAME      ?= -Wl,-soname=$(firstword $($(1)_SONAME.$(KBUILD_TARGET).$(KBUILD_TYPE)) $($(1)_SONAME.$(KBUILD_TARGET)) $($(1)_SONAME.$(KBUILD_TYPE)) $($(1)_SONAME) $(notdir $(2)))
     71ifeq ($(KBUILD_TARGET),os2)
     72 TOOL_VBoxXGccArm64Elf_LD_MAP        ?= -Zmap=$(1)
     73 TOOL_VBoxXGccArm64Elf_LD_SYSMOD_MAP ?= -Zmap=$(1)
     74else
     75 TOOL_VBoxXGccArm64Elf_LD_MAP        ?=
     76 TOOL_VBoxXGccArm64Elf_LD_SYSMOD_MAP ?=
     77endif
     78TOOL_VBoxXGccArm64Elf_OBJCOPY ?= $(PATH_TOOL_VBoxXGccArm64Elf)/$(TOOL_VBoxXGccArm64Elf_PREFIX)objcopy$(TOOL_VBoxXGccArm64Elf_SUFFIX)
     79
     80# General Properties used by kBuild
     81TOOL_VBoxXGccArm64Elf_COBJSUFF         ?= .o
     82TOOL_VBoxXGccArm64Elf_CFLAGS           ?=
     83TOOL_VBoxXGccArm64Elf_CFLAGS.debug     ?= -g
     84TOOL_VBoxXGccArm64Elf_CFLAGS.profile   ?= -O2 #-g -pg
     85TOOL_VBoxXGccArm64Elf_CFLAGS.release   ?= -O2
     86TOOL_VBoxXGccArm64Elf_CINCS            ?=
     87TOOL_VBoxXGccArm64Elf_CDEFS            ?=
     88
     89TOOL_VBoxXGccArm64Elf_CXXOBJSUFF       ?= .o
     90TOOL_VBoxXGccArm64Elf_CXXFLAGS         ?=
     91TOOL_VBoxXGccArm64Elf_CXXFLAGS.debug   ?= -g
     92TOOL_VBoxXGccArm64Elf_CXXFLAGS.profile ?= -O2 #-g -pg
     93TOOL_VBoxXGccArm64Elf_CXXFLAGS.release ?= -O2
     94TOOL_VBoxXGccArm64Elf_CXXINCS          ?=
     95TOOL_VBoxXGccArm64Elf_CXXDEFS          ?=
     96
     97TOOL_VBoxXGccArm64Elf_PCHOBJSUFF       ?= .h.gch
     98TOOL_VBoxXGccArm64Elf_PCHFLAGS         ?= $(TOOL_VBoxXGccArm64Elf_CXXFLAGS)
     99TOOL_VBoxXGccArm64Elf_PCHFLAGS.debug   ?= $(TOOL_VBoxXGccArm64Elf_CXXFLAGS.debug)
     100TOOL_VBoxXGccArm64Elf_PCHFLAGS.profile ?= $(TOOL_VBoxXGccArm64Elf_CXXFLAGS.profile)
     101TOOL_VBoxXGccArm64Elf_PCHFLAGS.release ?= $(TOOL_VBoxXGccArm64Elf_CXXFLAGS.release)
     102TOOL_VBoxXGccArm64Elf_PCHINCS          ?= $(TOOL_VBoxXGccArm64Elf_CXXINCS)
     103TOOL_VBoxXGccArm64Elf_PCHDEFS          ?= $(TOOL_VBoxXGccArm64Elf_CXXDEFS)
     104
     105TOOL_VBoxXGccArm64Elf_ASFLAGS          ?= -x assembler-with-cpp
     106TOOL_VBoxXGccArm64Elf_ASFLAGS.debug    ?= -g
     107TOOL_VBoxXGccArm64Elf_ASFLAGS.profile  ?= -g
     108TOOL_VBoxXGccArm64Elf_ASOBJSUFF        ?= .o
     109
     110TOOL_VBoxXGccArm64Elf_ARFLAGS          ?= cr
     111TOOL_VBoxXGccArm64Elf_ARLIBSUFF        ?= .a
     112
     113TOOL_VBoxXGccArm64Elf_LDFLAGS          ?=
     114TOOL_VBoxXGccArm64Elf_LDFLAGS.debug    ?= -g
     115TOOL_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.
     131TOOL_VBoxXGccArm64Elf_COMPILE_C_DEPEND =
     132TOOL_VBoxXGccArm64Elf_COMPILE_C_DEPORD =
     133TOOL_VBoxXGccArm64Elf_COMPILE_C_OUTPUT         = $(if-expr "$(use_objcache)" != "",$(outbase).i,)
     134TOOL_VBoxXGccArm64Elf_COMPILE_C_USES_KOBJCACHE = $(if-expr "$(use_objcache)" != "",1,)
     135define TOOL_VBoxXGccArm64Elf_COMPILE_C_CMDS
     136if "$(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                -
     148else
     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)\
    96153                $(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) \
     154endif
     155        $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
     156endef
     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.
     171TOOL_VBoxXGccArm64Elf_COMPILE_CXX_OUTPUT         = $(if-expr "$(use_objcache)" != "",$(outbase).ii,)
     172TOOL_VBoxXGccArm64Elf_COMPILE_CXX_DEPEND         = $($(target)_1_GCC_PCH_FILE)
     173TOOL_VBoxXGccArm64Elf_COMPILE_CXX_DEPORD         =
     174TOOL_VBoxXGccArm64Elf_COMPILE_CXX_USES_KOBJCACHE = $(if-expr "$(use_objcache)" != "",1,)
     175define TOOL_VBoxXGccArm64Elf_COMPILE_CXX_CMDS
     176if "$(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                -
     189else
     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)),) \
    107195                $(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) \
     196endif
     197        $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
     198endef
     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.
     213TOOL_VBoxXGccArm64Elf_COMPILE_PCH_OUTPUT = $($(target)_1_GCC_PCH_FILE)
     214TOOL_VBoxXGccArm64Elf_COMPILE_PCH_DEPEND =
     215TOOL_VBoxXGccArm64Elf_COMPILE_PCH_DEPORD = $($(target)_1_GCC_PCH_DIR)
     216define 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)\
    118221                $(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):" ""
     224endef
     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#
     240TOOL_VBoxXGccArm64Elf_COMPILE_AS_OUTPUT =
     241TOOL_VBoxXGccArm64Elf_COMPILE_AS_DEPEND =
     242TOOL_VBoxXGccArm64Elf_COMPILE_AS_DEPORD =
     243define 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):" ""
     250endef
     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.
     262TOOL_VBoxXGccArm64Elf_LINK_LIBRARY_OUTPUT = $(out).ar-script
     263TOOL_VBoxXGccArm64Elf_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).imp.a
     264TOOL_VBoxXGccArm64Elf_LINK_LIBRARY_DEPEND = $(othersrc)
     265TOOL_VBoxXGccArm64Elf_LINK_LIBRARY_DEPORD =
     266define TOOL_VBoxXGccArm64Elf_LINK_LIBRARY_CMDS
    125267        $(QUIET)$(APPEND) $(out).ar-script 'CREATE $(out)'
    126268        $(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')
    129274        $(QUIET)$(APPEND) $(out).ar-script 'SAVE'
    130275        $(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
     277endef
     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.
     293TOOL_VBoxXGccArm64Elf_LINK_PROGRAM_OUTPUT =
     294TOOL_VBoxXGccArm64Elf_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).map
     295TOOL_VBoxXGccArm64Elf_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).debug
     296TOOL_VBoxXGccArm64Elf_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
     297TOOL_VBoxXGccArm64Elf_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
     298                $(filter %.def, $(othersrc))
     299TOOL_VBoxXGccArm64Elf_LINK_PROGRAM_DEPORD =
     300define 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
     311endef
     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.
     327TOOL_VBoxXGccArm64Elf_LINK_DLL_OUTPUT =
     328TOOL_VBoxXGccArm64Elf_LINK_DLL_OUTPUT_MAYBE = $(outbase).map
     329TOOL_VBoxXGccArm64Elf_LINK_DLL_OUTPUT_DEBUG = $(outbase).debug
     330TOOL_VBoxXGccArm64Elf_LINK_DLL_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
     331TOOL_VBoxXGccArm64Elf_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
     332                $(filter %.def, $(othersrc))
     333TOOL_VBoxXGccArm64Elf_LINK_DLL_DEPORD =
     334define 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
     347endef
     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.
     363TOOL_VBoxXGccArm64Elf_LINK_SYSMOD_OUTPUT =
     364TOOL_VBoxXGccArm64Elf_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).map
     365TOOL_VBoxXGccArm64Elf_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).debug
     366TOOL_VBoxXGccArm64Elf_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
     367TOOL_VBoxXGccArm64Elf_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
     368                $(filter %.def, $(othersrc))
     369TOOL_VBoxXGccArm64Elf_LINK_SYSMOD_DEPORD =
     370define 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
     381endef
     382
  • trunk/tools/kBuildTools/VBoxXGccArmNoneEabi.kmk

    r100426 r100472  
    11# $Id$
    22## @file
    3 # VBox kBuild Tool Config - GCC Cross compiler for Debian 4.0 AMD64.
    4 #
    5 
    6 #
    7 # Copyright (C) 2013-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.
    88#
    99# This file is part of VirtualBox base platform packages, as
     
    2626#
    2727
    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) \
     28TOOL_VBoxXGccArmNoneEabi := Generic GCC v13.1.x or later using the tools GCC and Binutils, targeting ARM.
     29
     30
     31#
     32# Tool Specific Properties
     33#
     34ifndef 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
     42else
     43 # Resolve any fancy stuff once and for all.
     44 PATH_TOOL_VBoxXGccArmNoneEabi := $(PATH_TOOL_VBoxXGccArmNoneEabi)
     45endif
     46
     47
     48# Tool Specific Properties
     49ifndef TOOL_VBoxXGccArmNoneEabi_PREFIX
     50 TOOL_VBoxXGccArmNoneEabi_PREFIX := arm-none-eabi-
     51endif
     52ifndef TOOL_VBoxXGccArmNoneEabi_SUFFIX
     53 TOOL_VBoxXGccArmNoneEabi_SUFFIX := $(HOSTSUFF_EXE)
     54endif
     55
     56TOOL_VBoxXGccArmNoneEabi_CC        ?= $(PATH_TOOL_VBoxXGccArmNoneEabi)/$(TOOL_VBoxXGccArmNoneEabi_PREFIX)gcc$(TOOL_VBoxXGccArmNoneEabi_SUFFIX)
     57TOOL_VBoxXGccArmNoneEabi_CXX       ?= $(PATH_TOOL_VBoxXGccArmNoneEabi)/$(TOOL_VBoxXGccArmNoneEabi_PREFIX)g++$(TOOL_VBoxXGccArmNoneEabi_SUFFIX)
     58TOOL_VBoxXGccArmNoneEabi_PCH       ?= $(TOOL_VBoxXGccArmNoneEabi_CXX)
     59TOOL_VBoxXGccArmNoneEabi_AS        ?= $(PATH_TOOL_VBoxXGccArmNoneEabi)/$(TOOL_VBoxXGccArmNoneEabi_PREFIX)gcc$(TOOL_VBoxXGccArmNoneEabi_SUFFIX)
     60TOOL_VBoxXGccArmNoneEabi_AR        ?= $(PATH_TOOL_VBoxXGccArmNoneEabi)/$(TOOL_VBoxXGccArmNoneEabi_PREFIX)ar$(TOOL_VBoxXGccArmNoneEabi_SUFFIX)
     61TOOL_VBoxXGccArmNoneEabi_AR_IMP    ?= $(ECHO) not supported!
     62TOOL_VBoxXGccArmNoneEabi_LD        ?= $(PATH_TOOL_VBoxXGccArmNoneEabi)/$(TOOL_VBoxXGccArmNoneEabi_PREFIX)g++$(TOOL_VBoxXGccArmNoneEabi_SUFFIX)
     63TOOL_VBoxXGccArmNoneEabi_LD_SYSMOD ?= $(PATH_TOOL_VBoxXGccArmNoneEabi)/$(TOOL_VBoxXGccArmNoneEabi_PREFIX)ld$(TOOL_VBoxXGccArmNoneEabi_SUFFIX)
     64ifndef TOOL_VBoxXGccArmNoneEabi_LDFLAGS.$(KBUILD_TARGET)
     65 TOOL_VBoxXGccArmNoneEabi_LDFLAGS.dll   ?= -shared
     66else
     67 TOOL_VBoxXGccArmNoneEabi_LDFLAGS.dll   ?= $(TOOL_VBoxXGccArmNoneEabi_LDFLAGS.$(KBUILD_TARGET))
     68endif
     69TOOL_VBoxXGccArmNoneEabi_LDFLAGS.sysmod ?= -r
     70TOOL_VBoxXGccArmNoneEabi_LD_SONAME      ?= -Wl,-soname=$(firstword $($(1)_SONAME.$(KBUILD_TARGET).$(KBUILD_TYPE)) $($(1)_SONAME.$(KBUILD_TARGET)) $($(1)_SONAME.$(KBUILD_TYPE)) $($(1)_SONAME) $(notdir $(2)))
     71ifeq ($(KBUILD_TARGET),os2)
     72 TOOL_VBoxXGccArmNoneEabi_LD_MAP        ?= -Zmap=$(1)
     73 TOOL_VBoxXGccArmNoneEabi_LD_SYSMOD_MAP ?= -Zmap=$(1)
     74else
     75 TOOL_VBoxXGccArmNoneEabi_LD_MAP        ?=
     76 TOOL_VBoxXGccArmNoneEabi_LD_SYSMOD_MAP ?=
     77endif
     78TOOL_VBoxXGccArmNoneEabi_OBJCOPY ?= $(PATH_TOOL_VBoxXGccArmNoneEabi)/$(TOOL_VBoxXGccArmNoneEabi_PREFIX)objcopy$(TOOL_VBoxXGccArmNoneEabi_SUFFIX)
     79
     80# General Properties used by kBuild
     81TOOL_VBoxXGccArmNoneEabi_COBJSUFF         ?= .o
     82TOOL_VBoxXGccArmNoneEabi_CFLAGS           ?=
     83TOOL_VBoxXGccArmNoneEabi_CFLAGS.debug     ?= -g
     84TOOL_VBoxXGccArmNoneEabi_CFLAGS.profile   ?= -O2 #-g -pg
     85TOOL_VBoxXGccArmNoneEabi_CFLAGS.release   ?= -O2
     86TOOL_VBoxXGccArmNoneEabi_CINCS            ?=
     87TOOL_VBoxXGccArmNoneEabi_CDEFS            ?=
     88
     89TOOL_VBoxXGccArmNoneEabi_CXXOBJSUFF       ?= .o
     90TOOL_VBoxXGccArmNoneEabi_CXXFLAGS         ?=
     91TOOL_VBoxXGccArmNoneEabi_CXXFLAGS.debug   ?= -g
     92TOOL_VBoxXGccArmNoneEabi_CXXFLAGS.profile ?= -O2 #-g -pg
     93TOOL_VBoxXGccArmNoneEabi_CXXFLAGS.release ?= -O2
     94TOOL_VBoxXGccArmNoneEabi_CXXINCS          ?=
     95TOOL_VBoxXGccArmNoneEabi_CXXDEFS          ?=
     96
     97TOOL_VBoxXGccArmNoneEabi_PCHOBJSUFF       ?= .h.gch
     98TOOL_VBoxXGccArmNoneEabi_PCHFLAGS         ?= $(TOOL_VBoxXGccArmNoneEabi_CXXFLAGS)
     99TOOL_VBoxXGccArmNoneEabi_PCHFLAGS.debug   ?= $(TOOL_VBoxXGccArmNoneEabi_CXXFLAGS.debug)
     100TOOL_VBoxXGccArmNoneEabi_PCHFLAGS.profile ?= $(TOOL_VBoxXGccArmNoneEabi_CXXFLAGS.profile)
     101TOOL_VBoxXGccArmNoneEabi_PCHFLAGS.release ?= $(TOOL_VBoxXGccArmNoneEabi_CXXFLAGS.release)
     102TOOL_VBoxXGccArmNoneEabi_PCHINCS          ?= $(TOOL_VBoxXGccArmNoneEabi_CXXINCS)
     103TOOL_VBoxXGccArmNoneEabi_PCHDEFS          ?= $(TOOL_VBoxXGccArmNoneEabi_CXXDEFS)
     104
     105TOOL_VBoxXGccArmNoneEabi_ASFLAGS          ?= -x assembler-with-cpp
     106TOOL_VBoxXGccArmNoneEabi_ASFLAGS.debug    ?= -g
     107TOOL_VBoxXGccArmNoneEabi_ASFLAGS.profile  ?= -g
     108TOOL_VBoxXGccArmNoneEabi_ASOBJSUFF        ?= .o
     109
     110TOOL_VBoxXGccArmNoneEabi_ARFLAGS          ?= cr
     111TOOL_VBoxXGccArmNoneEabi_ARLIBSUFF        ?= .a
     112
     113TOOL_VBoxXGccArmNoneEabi_LDFLAGS          ?=
     114TOOL_VBoxXGccArmNoneEabi_LDFLAGS.debug    ?= -g
     115TOOL_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.
     131TOOL_VBoxXGccArmNoneEabi_COMPILE_C_DEPEND =
     132TOOL_VBoxXGccArmNoneEabi_COMPILE_C_DEPORD =
     133TOOL_VBoxXGccArmNoneEabi_COMPILE_C_OUTPUT         = $(if-expr "$(use_objcache)" != "",$(outbase).i,)
     134TOOL_VBoxXGccArmNoneEabi_COMPILE_C_USES_KOBJCACHE = $(if-expr "$(use_objcache)" != "",1,)
     135define TOOL_VBoxXGccArmNoneEabi_COMPILE_C_CMDS
     136if "$(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                -
     148else
     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)\
    96153                $(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) \
     154endif
     155        $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
     156endef
     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.
     171TOOL_VBoxXGccArmNoneEabi_COMPILE_CXX_OUTPUT         = $(if-expr "$(use_objcache)" != "",$(outbase).ii,)
     172TOOL_VBoxXGccArmNoneEabi_COMPILE_CXX_DEPEND         = $($(target)_1_GCC_PCH_FILE)
     173TOOL_VBoxXGccArmNoneEabi_COMPILE_CXX_DEPORD         =
     174TOOL_VBoxXGccArmNoneEabi_COMPILE_CXX_USES_KOBJCACHE = $(if-expr "$(use_objcache)" != "",1,)
     175define TOOL_VBoxXGccArmNoneEabi_COMPILE_CXX_CMDS
     176if "$(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                -
     189else
     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)),) \
    107195                $(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) \
     196endif
     197        $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
     198endef
     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.
     213TOOL_VBoxXGccArmNoneEabi_COMPILE_PCH_OUTPUT = $($(target)_1_GCC_PCH_FILE)
     214TOOL_VBoxXGccArmNoneEabi_COMPILE_PCH_DEPEND =
     215TOOL_VBoxXGccArmNoneEabi_COMPILE_PCH_DEPORD = $($(target)_1_GCC_PCH_DIR)
     216define 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)\
    118221                $(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):" ""
     224endef
     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#
     240TOOL_VBoxXGccArmNoneEabi_COMPILE_AS_OUTPUT =
     241TOOL_VBoxXGccArmNoneEabi_COMPILE_AS_DEPEND =
     242TOOL_VBoxXGccArmNoneEabi_COMPILE_AS_DEPORD =
     243define 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):" ""
     250endef
     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.
     262TOOL_VBoxXGccArmNoneEabi_LINK_LIBRARY_OUTPUT = $(out).ar-script
     263TOOL_VBoxXGccArmNoneEabi_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).imp.a
     264TOOL_VBoxXGccArmNoneEabi_LINK_LIBRARY_DEPEND = $(othersrc)
     265TOOL_VBoxXGccArmNoneEabi_LINK_LIBRARY_DEPORD =
     266define TOOL_VBoxXGccArmNoneEabi_LINK_LIBRARY_CMDS
    125267        $(QUIET)$(APPEND) $(out).ar-script 'CREATE $(out)'
    126268        $(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')
    129274        $(QUIET)$(APPEND) $(out).ar-script 'SAVE'
    130275        $(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
     277endef
     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.
     293TOOL_VBoxXGccArmNoneEabi_LINK_PROGRAM_OUTPUT =
     294TOOL_VBoxXGccArmNoneEabi_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).map
     295TOOL_VBoxXGccArmNoneEabi_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).debug
     296TOOL_VBoxXGccArmNoneEabi_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
     297TOOL_VBoxXGccArmNoneEabi_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
     298                $(filter %.def, $(othersrc))
     299TOOL_VBoxXGccArmNoneEabi_LINK_PROGRAM_DEPORD =
     300define 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
     311endef
     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.
     327TOOL_VBoxXGccArmNoneEabi_LINK_DLL_OUTPUT =
     328TOOL_VBoxXGccArmNoneEabi_LINK_DLL_OUTPUT_MAYBE = $(outbase).map
     329TOOL_VBoxXGccArmNoneEabi_LINK_DLL_OUTPUT_DEBUG = $(outbase).debug
     330TOOL_VBoxXGccArmNoneEabi_LINK_DLL_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
     331TOOL_VBoxXGccArmNoneEabi_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
     332                $(filter %.def, $(othersrc))
     333TOOL_VBoxXGccArmNoneEabi_LINK_DLL_DEPORD =
     334define 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
     347endef
     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.
     363TOOL_VBoxXGccArmNoneEabi_LINK_SYSMOD_OUTPUT =
     364TOOL_VBoxXGccArmNoneEabi_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).map
     365TOOL_VBoxXGccArmNoneEabi_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).debug
     366TOOL_VBoxXGccArmNoneEabi_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
     367TOOL_VBoxXGccArmNoneEabi_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
     368                $(filter %.def, $(othersrc))
     369TOOL_VBoxXGccArmNoneEabi_LINK_SYSMOD_DEPORD =
     370define 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
     381endef
     382
Note: See TracChangeset for help on using the changeset viewer.

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