xref: /rk3399_ARM-atf/make_helpers/toolchain.mk (revision 138a326cef1eb22cd893b93bb8f664f6be9d5cce)
1#
2# Copyright (c) 2023-2025, Arm Limited and Contributors. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
7#
8# TF-A uses three toolchains:
9#
10#   - The host toolchain (`host`) for building native tools
11#   - The AArch32 toolchain (`aarch32`) for building Arm AArch32 images
12#   - The AArch64 toolchain (`aarch64`) for building Arm AArch64 images
13#
14# In the main Makefile only one of the two Arm toolchains is enabled in any
15# given build, but individual tools and libraries may need access to both.
16#
17
18ifndef toolchain-mk
19        toolchain-mk := $(lastword $(MAKEFILE_LIST))
20
21        include $(dir $(toolchain-mk))utilities.mk
22
23        #
24        # Make assigns generic default values to `CC`, `CPP`, `AS`, etc. if they
25        # are not explicitly assigned values by the user. These are usually okay
26        # for very simple programs when building for the host system, but we
27        # need greater control over the toolchain flow.
28        #
29        # Therefore, we undefine these built-in variables if they have default
30        # values, so that we can provide our own default values later instead.
31        #
32
33        ifeq ($(origin CC),default)
34                undefine CC
35        endif
36
37        ifeq ($(origin CPP),default)
38                undefine CPP
39        endif
40
41        ifeq ($(origin AS),default)
42                undefine AS
43        endif
44
45        ifeq ($(origin AR),default)
46                undefine AR
47        endif
48
49        ifeq ($(origin LD),default)
50                undefine LD
51        endif
52
53        #
54        # The full list of toolchains supported by TF-A.
55        #
56        # Each of these toolchains defines a file of the same name in the
57        # `toolchains` directory, which must configure the following variables:
58        #
59        #   - <toolchain>-name
60        #
61        #     A human-readable name for the toolchain,
62        #
63        # Additionally, for every tool class, it must also define:
64        #
65        #   - <toolchain>-<tool-class>-parameter
66        #
67        #     The command line or environment variable used to set the tool for
68        #     for the given tool class.
69        #
70        #   - <toolchain>-<tool-class>-default-id
71        #
72        #     The default tool identifier used if the tool for the given tool
73        #     class cannot be identified.
74        #
75        #   - <toolchain>-<tool-class>-default
76        #
77        #     The default commands to try, in the order defined, for the given
78        #     tool class if the user does not explicitly provide one, and if the
79        #     command could not be derived from the C compiler.
80        #
81
82        toolchains := host # Used for host targets
83        toolchains += aarch32 # Used for AArch32 targets
84        toolchains += aarch64 # Used for AArch64 targets
85        toolchains += rk3399-m0 # Used for RK3399 Cortex-M0 targets
86
87        include $(toolchains:%=$(dir $(toolchain-mk))toolchains/%.mk)
88
89        #
90        # Configure tool classes that we recognize.
91        #
92        # In the context of this build system, a tool class identifies a
93        # specific role or type of tool in the toolchain.
94        #
95
96        toolchain-tool-classes := cc
97        toolchain-tool-class-name-cc := C compiler
98
99        toolchain-tool-classes += cpp
100        toolchain-tool-class-name-cpp := C preprocessor
101
102        toolchain-tool-classes += as
103        toolchain-tool-class-name-as := assembler
104
105        toolchain-tool-classes += ld
106        toolchain-tool-class-name-ld := linker
107
108        toolchain-tool-classes += oc
109        toolchain-tool-class-name-oc := object copier
110
111        toolchain-tool-classes += od
112        toolchain-tool-class-name-od := object dumper
113
114        toolchain-tool-classes += ar
115        toolchain-tool-class-name-ar := archiver
116
117        toolchain-tool-classes += dtc
118        toolchain-tool-class-name-dtc := device tree compiler
119
120        toolchain-tool-classes += poetry
121        toolchain-tool-class-name-poetry := Python Poetry package manager
122
123        #
124        # Configure tools that we recognize.
125        #
126        # Here we declare the list of specific toolchain tools that we know how
127        # to interact with. We don't organize these into tool classes yet - that
128        # happens further down.
129        #
130
131        # Arm® Compiler for Embedded
132        toolchain-tools := arm-clang
133        toolchain-tool-name-arm-clang := Arm® Compiler for Embedded `armclang`
134
135        toolchain-tools += arm-link
136        toolchain-tool-name-arm-link := Arm® Compiler for Embedded `armlink`
137
138        toolchain-tools += arm-ar
139        toolchain-tool-name-arm-ar := Arm® Compiler for Embedded `armar`
140
141        toolchain-tools += arm-fromelf
142        toolchain-tool-name-arm-fromelf := Arm® Compiler for Embedded `fromelf`
143
144        # LLVM Project
145        toolchain-tools += llvm-clang
146        toolchain-tool-name-llvm-clang := LLVM Clang (`clang`)
147
148        toolchain-tools += llvm-lld
149        toolchain-tool-name-llvm-lld := LLVM LLD (`lld`)
150
151        toolchain-tools += llvm-objcopy
152        toolchain-tool-name-llvm-objcopy := LLVM `llvm-objcopy`
153
154        toolchain-tools += llvm-objdump
155        toolchain-tool-name-llvm-objdump := LLVM `llvm-objdump`
156
157        toolchain-tools += llvm-ar
158        toolchain-tool-name-llvm-ar := LLVM `llvm-ar`
159
160        # GNU Compiler Collection & GNU Binary Utilities
161        toolchain-tools += gnu-gcc
162        toolchain-tool-name-gnu-gcc := GNU GCC (`gcc`)
163
164        toolchain-tools += gnu-ld
165        toolchain-tool-name-gnu-ld := GNU LD (`ld.bfd`)
166
167        toolchain-tools += gnu-objcopy
168        toolchain-tool-name-gnu-objcopy := GNU `objcopy`
169
170        toolchain-tools += gnu-objdump
171        toolchain-tool-name-gnu-objdump := GNU `objdump`
172
173        toolchain-tools += gnu-ar
174        toolchain-tool-name-gnu-ar := GNU `ar`
175
176        # Other tools
177        toolchain-tools += generic-dtc
178        toolchain-tool-name-generic-dtc := Device Tree Compiler (`dtc`)
179
180        toolchain-tools += generic-poetry
181        toolchain-tool-name-generic-poetry := Poetry (`poetry`)
182
183        #
184        # Assign tools to tool classes.
185        #
186        # Multifunctional tools, i.e. tools which can perform multiple roles in
187        # a toolchain, may be specified in multiple tool class lists. For
188        # example, a C compiler which can also perform the role of a linker may
189        # be placed in both `toolchain-tools-cc` and `toolchain-tools-ld`.
190        #
191
192        # C-related tools
193        toolchain-tools-cc := arm-clang llvm-clang gnu-gcc # C compilers
194        toolchain-tools-cpp := arm-clang llvm-clang gnu-gcc # C preprocessors
195
196        # Assembly-related tools
197        toolchain-tools-as := arm-clang llvm-clang gnu-gcc # Assemblers
198
199        # Linking and object-handling tools
200        toolchain-tools-ld := arm-clang arm-link llvm-clang llvm-lld gnu-gcc gnu-ld # Linkers
201        toolchain-tools-oc := arm-fromelf llvm-objcopy gnu-objcopy # Object copiers
202        toolchain-tools-od := arm-fromelf llvm-objdump gnu-objdump # Object dumpers
203        toolchain-tools-ar := arm-ar llvm-ar gnu-ar # Archivers
204
205        # Other tools
206        toolchain-tools-dtc := generic-dtc # Device tree compilers
207        toolchain-tools-poetry := generic-poetry # Python Poetry package manager
208
209        #
210        # Helper functions to identify toolchain tools.
211        #
212        # The functions defined in this section return a tool identifier when
213        # given a path to a binary. We generally check a help or version string
214        # to more reliably identify tools than by looking at the path alone
215        # (e.g. `gcc` on macOS is actually Apple Clang).
216        #
217        # Each tool-guessing function (`toolchain-guess-tool-$(tool)`) takes a
218        # single argument giving the path to the tool to guess, and returns a
219        # non-empty value if the tool corresponds to the tool identifier
220        # `$(tool)`:
221        #
222        #     $(call toolchain-guess-tool-llvm-clang,aarch64-none-elf-gcc) # <empty>
223        #     $(call toolchain-guess-tool-gnu-gcc,aarch64-none-elf-gcc) # <non-empty>
224        #
225        # The `toolchain-guess-tool` function tries to find the corresponding tool
226        # identifier for a tool given its path. It takes two arguments:
227        #
228        #   - $(1): a list of candidate tool identifiers to check
229        #   - $(2): the path to the tool to identify
230        #
231        # If any of the guess functions corresponding to candidate tool
232        # identifiers return a non-empty value then the tool identifier of the
233        # first function to do so is returned:
234        #
235        #     $(call toolchain-guess-tool,gnu-gcc llvm-clang,armclang) # <empty>
236        #     $(call toolchain-guess-tool,gnu-gcc llvm-clang,clang-14) # llvm-clang
237        #     $(call toolchain-guess-tool,gnu-gcc llvm-clang,aarch64-none-elf-gcc-12) # gnu-gcc
238        #
239        # Tools are checked in the order that they are provided, and the first
240        # match is returned.
241        #
242
243        # Arm Compiler for Embedded
244        toolchain-guess-tool-arm-clang = $(shell $(1) --version 2>&1 </dev/null | grep -o "Tool: armclang")
245        toolchain-guess-tool-arm-link = $(shell $(1) --help 2>&1 </dev/null | grep -o "Tool: armlink")
246        toolchain-guess-tool-arm-fromelf = $(shell $(1) --help 2>&1 </dev/null | grep -o "Tool: fromelf")
247        toolchain-guess-tool-arm-ar = $(shell $(1) --version 2>&1 </dev/null | grep -o "Tool: armar")
248
249        # LLVM Project
250        toolchain-guess-tool-llvm-clang = $(shell $(1) -v 2>&1 </dev/null | grep -o "clang version")
251        toolchain-guess-tool-llvm-lld = $(shell $(1) --help 2>&1 </dev/null | grep -o "OVERVIEW: lld")
252        toolchain-guess-tool-llvm-objcopy = $(shell $(1) --help 2>&1 </dev/null | grep -o "llvm-objcopy tool")
253        toolchain-guess-tool-llvm-objdump = $(shell $(1) --help 2>&1 </dev/null | grep -o "llvm object file dumper")
254        toolchain-guess-tool-llvm-ar = $(shell $(1) --help 2>&1 </dev/null | grep -o "LLVM Archiver")
255
256        # GNU Compiler Collection & GNU Binary Utilities
257        toolchain-guess-tool-gnu-gcc = $(shell $(1) -v 2>&1 </dev/null | grep -o "gcc version")
258        toolchain-guess-tool-gnu-ld = $(shell $(1) -v 2>&1 </dev/null | grep -o "GNU ld")
259        toolchain-guess-tool-gnu-objcopy = $(shell $(1) --version 2>&1 </dev/null | grep -o "GNU objcopy")
260        toolchain-guess-tool-gnu-objdump = $(shell $(1) --version 2>&1 </dev/null | grep -o "GNU objdump")
261        toolchain-guess-tool-gnu-ar = $(shell $(1) --version 2>&1 </dev/null | grep -o "GNU ar")
262
263        # Other tools
264        toolchain-guess-tool-generic-dtc = $(shell $(1) --version 2>&1 </dev/null | grep -o "Version: DTC")
265        toolchain-guess-tool-generic-poetry = $(shell $(1) --version 2>&1 </dev/null)
266
267        toolchain-guess-tool = $(if $(2),$(firstword $(foreach candidate,$(1),$\
268                $(if $(call toolchain-guess-tool-$(candidate),$(2)),$(candidate)))))
269
270        #
271        # Get the index of the first valid tool path in a shell command.
272        #
273        # To support compiler wrappers like `ccache`, we need to be able to
274        # robustly identify which part of a shell command is the wrapper and
275        # which part is the wrapped.
276        #
277        # To do this, we iterate through each shell word in the string, query it
278        # to see if it is one the tools we would expect to see, and return its
279        # index.
280        #
281        #   - $(1): A list of candidate tool identifiers to check.
282        #   - $(2): The shell command to parse.
283        #
284
285        toolchain-tool-program-index = $\
286                $(call with,p:candidates p:command,$(1),$(2),$\
287                        $$(firstword $$(call shell-map,$\
288                                toolchain-tool-program-index.map,$\
289                                $$(command))))
290
291        toolchain-tool-program-index.map = $(and $\
292                $(call which,$(1)),$\
293                $(call toolchain-guess-tool,$(candidates),$\
294                        $(call shell-quote,$(1))),$\
295                $(2))
296
297        #
298        # Strip any program wrappers from a tool's shell command.
299        #
300        # This function removes any program wrappers, like `ccache`, from the
301        # shell command of a tool.
302        #
303        #   - $(1): A list of candidate tool identifiers to check.
304        #   - $(2): The shell command to parse.
305        #
306
307        toolchain-tool-program = $(call shell-slice,$(2),$\
308                $(call toolchain-tool-program-index,$(1),$(2)))
309
310        #
311        # Extract the program wrapper from a tool's shell command.
312        #
313        # This function returns any program wrappers, like `ccache`, from the
314        # shell command of a tool.
315        #
316        #   - $(1): A list of candidate tool identifiers to check.
317        #   - $(2): The shell command to parse.
318        #
319
320        toolchain-tool-wrapper = $(call shell-slice,$(2),1,$\
321                $(call toolchain-tool-program-index,$(1),$(2)))
322
323        #
324        # Warn the user that a tool could not be identified.
325        #
326        # Parameters:
327        #
328        # - $1: The toolchain that the tool belongs to.
329        # - $2: The tool class that the tool belongs to.
330        #
331
332        define toolchain-warn-unrecognized
333                $(warning )
334                $(warning The configured $($(1)-name) $(toolchain-tool-class-name-$(2)) could not be identified:)
335                $(warning )
336                $(warning $(space)   $($(1)-$(2)) ($($(1)-$(2)-origin)))
337
338                $(warning )
339                $(warning The following tools are supported:)
340                $(warning )
341
342                $(foreach tool,$(toolchain-tools-$(2)), \
343                        $(warning $(space) - $(toolchain-tool-name-$(tool))))
344
345                $(warning )
346                $(warning The build system will treat this $(toolchain-tool-class-name-$(2)) as $(toolchain-tool-name-$($(1)-$(2)-default-id)).)
347                $(warning )
348        endef
349
350        #
351        # Locate and identify tools belonging to each toolchain.
352        #
353        # Each tool class in each toolchain receives a variable of the form
354        # `$(toolchain)-$(tool)` giving the associated path to the program. For
355        # example:
356        #
357        #   - `aarch64-ld` gives the linker for the AArch64 toolchain,
358        #   - `aarch32-oc` gives the object copier for the AArch32 toolchain, and
359        #   - `host-cc` gives the C compiler for the host toolchain.
360        #
361        # For each of these variables, if no program path is explicitly provided
362        # by the parent Makefile then the C compiler is queried (if supported)
363        # for its location.
364        #
365        # If the C compiler cannot provide the location (or the tool class *is*
366        # the C compiler), then it is assigned a default value specific for that
367        # toolchain.
368        #
369
370        toolchain-from-parameter = $($($(1)-$(2)-parameter))
371
372        toolchain-from-cc-arm-clang-cpp = $(1)
373        toolchain-from-cc-arm-clang-as = $(1)
374        toolchain-from-cc-arm-clang-ld = # Fall back to `$(toolchain)-ld-default`
375        toolchain-from-cc-arm-clang-oc = # Fall back to `$(toolchain)-oc-default`
376        toolchain-from-cc-arm-clang-od = # Fall back to `$(toolchain)-od-default`
377        toolchain-from-cc-arm-clang-ar = # Fall back to `$(toolchain)-ar-default`
378
379        toolchain-from-cc-llvm-clang-cpp = $(1)
380        toolchain-from-cc-llvm-clang-as = $(1)
381        toolchain-from-cc-llvm-clang-ld = $(1)
382        toolchain-from-cc-llvm-clang-oc = $(shell $(1) --print-prog-name llvm-objcopy 2>/dev/null)
383        toolchain-from-cc-llvm-clang-od = $(shell $(1) --print-prog-name llvm-objdump 2>/dev/null)
384        toolchain-from-cc-llvm-clang-ar = $(shell $(1) --print-prog-name llvm-ar 2>/dev/null)
385
386        toolchain-from-cc-gnu-gcc-cpp = $(1)
387        toolchain-from-cc-gnu-gcc-as = $(1)
388        toolchain-from-cc-gnu-gcc-ld = $(1)
389        toolchain-from-cc-gnu-gcc-oc = $(shell $(1) --print-prog-name objcopy 2>/dev/null)
390        toolchain-from-cc-gnu-gcc-od = $(shell $(1) --print-prog-name objdump 2>/dev/null)
391        toolchain-from-cc-gnu-gcc-ar = $(shell $(1) --print-prog-name ar 2>/dev/null)
392
393        toolchain-from-cc = $(and $(filter-out cc,$(2)),$($(1)-cc),$\
394                $(call toolchain-from-cc-$($(1)-cc-id)-$(2),$($(1)-cc)))
395
396        toolchain-from-default = $(firstword $\
397                $(foreach candidate,$($(1)-$(2)-default),$\
398                        $(if $(call which,$(candidate)),$(candidate))) $\
399                $($(1)-$(2)-default))
400
401        #
402        # Compiler configuration for the correct ARCH
403        #
404
405        target-arch-aarch32-arm-clang := arm-arm-none-eabi
406        target-arch-aarch64-arm-clang := aarch64-arm-none-eabi
407        target-arch-aarch32-llvm-clang := arm-arm-none-eabi
408        target-arch-aarch64-llvm-clang := aarch64-arm-none-elf
409
410        target-flag-aarch32-arm-clang := -target $(target-arch-aarch32-arm-clang)
411        target-flag-aarch64-arm-clang := -target $(target-arch-aarch64-arm-clang)
412        target-flag-aarch32-llvm-clang := -target $(target-arch-aarch32-llvm-clang)
413        target-flag-aarch64-llvm-clang := -target $(target-arch-aarch64-llvm-clang)
414
415        # Prefixes a linker flag appropriately for the linker in use.
416        #
417        # Parameters:
418        #   - $1: A linker flag
419        #
420
421        toolchain-ld-prefix-gnu-gcc = $(addprefix -Xlinker ,$(1))
422        toolchain-ld-prefix-gnu-ld = $(1)
423        toolchain-ld-prefix-llvm-clang = $(addprefix -Xlinker ,$(1))
424        toolchain-ld-prefix-llvm-lld = $(1)
425        toolchain-ld-prefix-arm-clang = $(addprefix -Xlinker ,$(1))
426        toolchain-ld-prefix-arm-link = $(1)
427
428        #
429        # Discover whether a linker supports any given option (passed in $(2))
430        # Depending on which linker is in use and how exactly it is used (via a
431        # wrapper or not) the discovery process is different for each one
432        #
433        # Parameters:
434        #   - $1: The ARCH prefix of the toolchain (eg TF-A's or the native one)
435        #   - $2: The flag to test
436        # Returns the option with the wrapper's prefix (-Xlinker) if necessary
437        #
438        # Optionally works with lists of options, although granularity will be
439        # lost
440        #
441
442        # shorthand for the below helpers, assuming we're building TF-A
443        toolchain-ld-option = $(call toolchain-ld-option-$($(1)-ld-id),$(1),$(2))
444        toolchain-ld-option-gnu-gcc = $(if $\
445                $(shell $($(1)-ld) $(call toolchain-ld-prefix-gnu-gcc,$(2)) -Xlinker --help >/dev/null 2>&1 && echo 1),$\
446                $(call toolchain-ld-prefix-gnu-gcc,$(2)))
447        toolchain-ld-option-gnu-ld = $(shell $($(1)-ld) $(2) --help >/dev/null 2>&1 && $\
448                echo $(call escape-shell,$(2)))
449
450        toolchain-ld-option-llvm-clang = $(shell $($(1)-ld) $(target-flag-$(1)-llvm-clang) $\
451                $(call toolchain-ld-prefix-llvm-clang,$(2)) -Xlinker --help >/dev/null 2>&1 && $\
452                echo $(call escape-shell,$(call toolchain-ld-prefix-llvm-clang,$(2))))
453        toolchain-ld-option-llvm-lld = $(shell $($(1)-ld) $(2) --help >/dev/null 2>&1 && $\
454                echo $(call escape-shell,$(2)))
455
456        toolchain-ld-option-arm-clang = $(shell $($(1)-ld) $(target-flag-$(1)-arm-clang) $\
457                $(call toolchain-ld-prefix-arm-clang,$(2)) -Xlinker --help >/dev/null 2>&1 && $\
458                echo $(call escape-shell,$(call toolchain-ld-prefix-arm-clang,$(2))))
459        toolchain-ld-option-arm-link = $(shell $($(1)-ld) $(2) --help >/dev/null 2>&1 && $\
460                echo $(call escape-shell,$(2)))
461
462        #
463        # Configure a toolchain.
464        #
465        # Parameters:
466        #
467        #   - $1: The toolchain to configure.
468        #
469        # This function iterates over all tool classes and configures them for
470        # the provided toolchain. Toolchain tools are initialized lazily and
471        # on-demand based on the first read of the tool path or identifier
472        # variables.
473        #
474
475        define toolchain-configure
476                $$(foreach tool-class,$$(toolchain-tool-classes), \
477                        $$(eval $$(call toolchain-configure-tool,$1,$$(tool-class))))
478        endef
479
480        #
481        # Configure a specific tool within a toolchain.
482        #
483        # Parameters:
484        #
485        #   - $1: The toolchain to configure.
486        #   - $2: The tool class to configure.
487        #
488
489        define toolchain-configure-tool
490                $1-$2-configure = $\
491                        $$(eval $$(call toolchain-determine-tool,$1,$2))
492
493                #
494                # When either of the following variables are read for the first
495                # time, the appropriate tool is determined and *both* variables
496                # are overwritten with their final values.
497                #
498
499                $1-$2 = $$($1-$2-configure)$$($1-$2)
500                $1-$2-id = $$($1-$2-configure)$$($1-$2-id)
501        endef
502
503        #
504        # Determines and identifies a tool.
505        #
506        # Parameters:
507        #
508        #   - $1: The toolchain identifier.
509        #   - $2: The tool class.
510        #
511        # Tool identification happens by reading the designated tool parameter
512        # to get the user-specified command for the tool (e.g. `CC` or `LD`). If
513        # no tool parameter is defined then try to derive the tool from the C
514        # compiler.
515        #
516        # If all else fails, fall back to the default command defined by the
517        # toolchain makefile.
518        #
519
520        define toolchain-determine-tool
521                #
522                # Try to determine the tool command by:
523                #
524                #   1. Using the user-specified value (if one is provided).
525                #   2. Otherwise, inferring a reasonable default by:
526                #      a. Querying the C compiler, if available.
527                #      b. Falling back to a hard-coded default, if specified.
528                #      c. Giving up, and erroring out if the tool is mandatory.
529                #
530
531                $1-$2-from-parameter = $$(call toolchain-from-parameter,$1,$2)
532                $1-$2-from-cc = $$(call toolchain-from-cc,$1,$2)
533                $1-$2-from-default = $$(call toolchain-from-default,$1,$2)
534
535                ifneq ($$($1-$2-from-parameter),)
536                        $1-$2-from := $$($1-$2-from-parameter)
537                        $1-$2-origin := via `$$($1-$2-parameter)` parameter
538                else ifneq ($$($1-$2-from-cc),)
539                        $1-$2-from := $$($1-$2-from-cc)
540                        $1-$2-origin := inferred from C compiler
541                else ifneq ($$($1-$2-from-default),)
542                        $1-$2-from := $$($1-$2-from-default)
543                        $1-$2-origin := default
544                endif
545
546                #
547                # Sanitize the command for the shell by either escaping the
548                # entire string if it's a program name/path, or by expanding and
549                # escaping each shell word.
550                #
551
552                $1-$2 := $$(call shell-program,$$($1-$2-from))
553
554                $$(if $$(or $$($1-$2),$$($1-$2-optional)),,$\
555                        $$(error no $$($1-name) $$(toolchain-tool-class-name-$2) configured))
556
557                $1-$2-id := $$(if $$($1-$2),$$(or $\
558                        $$(call toolchain-guess-tool,$$\
559                                $$(toolchain-tools-$2),$$($1-$2)),$\
560                        $$(call toolchain-warn-unrecognized,$1,$2)$\
561                                $$($1-$2-default-id)))
562
563                $1-$2-program := $$(call toolchain-tool-program,$\
564                        $$($1-$2-id),$$($1-$2))
565                $1-$2-wrapper := $$(call toolchain-tool-wrapper,$\
566                        $$($1-$2-id),$$($1-$2))
567        endef
568
569        $(foreach toolchain,$(toolchains), \
570                $(eval $(call toolchain-configure,$(toolchain))))
571endif
572