From 758ccb802d4f2a5fe55ec936a21ad4ae8cbd7b4f Mon Sep 17 00:00:00 2001 From: Chris Kay Date: Fri, 8 Mar 2024 16:08:31 +0000 Subject: [PATCH 1/5] build: remove `MAKE_BUILD_STRINGS` function This function causes the build message to be generated and compiled in two different ways, with one way done inside `build_macros.mk` and the other done inside `windows.mk`, mostly because it's done by generating the C file on the command line. We can instead replace this whole build message generation sequence with a simple standard C compilation command and a normal C file. Change-Id: I8bc136380c9585ddeec9a11154ee39ef70526f81 Signed-off-by: Chris Kay --- Makefile | 11 ++++++++++- bl1/bl1_main.c | 3 ++- bl2/bl2_main.c | 5 +++-- bl2u/bl2u_main.c | 5 +++-- bl31/bl31_main.c | 5 +++-- bl32/sp_min/sp_min_main.c | 5 +++-- bl32/tsp/tsp_ffa_main.c | 5 +++-- bl32/tsp/tsp_main.c | 3 ++- common/bl_common.c | 6 +++--- include/common/bl_common.h | 4 +--- include/common/build_message.h | 14 ++++++++++++++ make_helpers/build_macros.mk | 18 +----------------- make_helpers/windows.mk | 12 ------------ plat/arm/board/fvp_r/fvp_r_bl1_main.c | 6 +++--- plat/arm/board/morello/morello_image_load.c | 3 ++- plat/imx/common/imx_sip_handler.c | 5 +++-- services/std_svc/rmmd/trp/trp_main.c | 5 +++-- 17 files changed, 59 insertions(+), 56 deletions(-) create mode 100644 include/common/build_message.h diff --git a/Makefile b/Makefile index 6b1f47cf3..29027746c 100644 --- a/Makefile +++ b/Makefile @@ -372,6 +372,15 @@ endif ################################################################################ include lib/compiler-rt/compiler-rt.mk +# Allow overriding the timestamp, for example for reproducible builds, or to +# synchronize timestamps across multiple projects. +# This must be set to a C string (including quotes where applicable). +BUILD_MESSAGE_TIMESTAMP ?= __TIME__", "__DATE__ + +DEFINES += -DBUILD_MESSAGE_TIMESTAMP='$(BUILD_MESSAGE_TIMESTAMP)' +DEFINES += -DBUILD_MESSAGE_VERSION_STRING='"$(VERSION_STRING)"' +DEFINES += -DBUILD_MESSAGE_VERSION='"$(VERSION)"' + BL_COMMON_SOURCES += common/bl_common.c \ common/tf_log.c \ common/${ARCH}/debug.S \ @@ -1682,7 +1691,7 @@ else endif #(UNIX_MK) romlib.bin: libraries FORCE - ${Q}${MAKE} PLAT_DIR=${PLAT_DIR} BUILD_PLAT=${BUILD_PLAT} ENABLE_BTI=${ENABLE_BTI} ARM_ARCH_MINOR=${ARM_ARCH_MINOR} INCLUDES='${INCLUDES}' DEFINES='${DEFINES}' --no-print-directory -C ${ROMLIBPATH} all + ${Q}${MAKE} PLAT_DIR=${PLAT_DIR} BUILD_PLAT=${BUILD_PLAT} ENABLE_BTI=${ENABLE_BTI} ARM_ARCH_MINOR=${ARM_ARCH_MINOR} INCLUDES=$(call escape-shell,$(INCLUDES)) DEFINES=$(call escape-shell,$(DEFINES)) --no-print-directory -C ${ROMLIBPATH} all memmap: all ifdef UNIX_MK diff --git a/bl1/bl1_main.c b/bl1/bl1_main.c index 1dfdc459b..9f19b4a47 100644 --- a/bl1/bl1_main.c +++ b/bl1/bl1_main.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -73,7 +74,7 @@ void bl1_main(void) /* Announce our arrival */ NOTICE(FIRMWARE_WELCOME_STR); - NOTICE("BL1: %s\n", version_string); + NOTICE("BL1: %s\n", build_version_string); NOTICE("BL1: %s\n", build_message); INFO("BL1: RAM %p - %p\n", (void *)BL1_RAM_BASE, (void *)BL1_RAM_LIMIT); diff --git a/bl2/bl2_main.c b/bl2/bl2_main.c index 923a554fb..4c68f076a 100644 --- a/bl2/bl2_main.c +++ b/bl2/bl2_main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2023, Arm Limited and Contributors. All rights reserved. + * Copyright (c) 2013-2024, Arm Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -92,7 +93,7 @@ void bl2_main(void) PMF_CAPTURE_TIMESTAMP(bl_svc, BL2_ENTRY, PMF_CACHE_MAINT); #endif - NOTICE("BL2: %s\n", version_string); + NOTICE("BL2: %s\n", build_version_string); NOTICE("BL2: %s\n", build_message); /* Perform remaining generic architectural setup in S-EL1 */ diff --git a/bl2u/bl2u_main.c b/bl2u/bl2u_main.c index fcb73b9c7..cd13defea 100644 --- a/bl2u/bl2u_main.c +++ b/bl2u/bl2u_main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2020, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2015-2024, Arm Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -27,7 +28,7 @@ ******************************************************************************/ void bl2u_main(void) { - NOTICE("BL2U: %s\n", version_string); + NOTICE("BL2U: %s\n", build_version_string); NOTICE("BL2U: %s\n", build_message); #if SCP_BL2U_BASE diff --git a/bl31/bl31_main.c b/bl31/bl31_main.c index 98078171d..cae9b140f 100644 --- a/bl31/bl31_main.c +++ b/bl31/bl31_main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2023, Arm Limited and Contributors. All rights reserved. + * Copyright (c) 2013-2024, Arm Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -128,7 +129,7 @@ void bl31_main(void) /* Init per-world context registers for non-secure world */ manage_extensions_nonsecure_per_world(); - NOTICE("BL31: %s\n", version_string); + NOTICE("BL31: %s\n", build_version_string); NOTICE("BL31: %s\n", build_message); #if FEATURE_DETECTION diff --git a/bl32/sp_min/sp_min_main.c b/bl32/sp_min/sp_min_main.c index 26cf2079d..61feaeca5 100644 --- a/bl32/sp_min/sp_min_main.c +++ b/bl32/sp_min/sp_min_main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2023, Arm Limited and Contributors. All rights reserved. + * Copyright (c) 2016-2024, Arm Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -175,7 +176,7 @@ uintptr_t get_arm_std_svc_args(unsigned int svc_mask) *****************************************************************************/ void sp_min_main(void) { - NOTICE("SP_MIN: %s\n", version_string); + NOTICE("SP_MIN: %s\n", build_version_string); NOTICE("SP_MIN: %s\n", build_message); /* Perform the SP_MIN platform setup */ diff --git a/bl32/tsp/tsp_ffa_main.c b/bl32/tsp/tsp_ffa_main.c index 1c8c68f03..8273060bd 100644 --- a/bl32/tsp/tsp_ffa_main.c +++ b/bl32/tsp/tsp_ffa_main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2022, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2013-2024, Arm Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -14,6 +14,7 @@ #include #include #include +#include #include #include "ffa_helpers.h" #include @@ -554,7 +555,7 @@ uint64_t tsp_main(void) { smc_args_t smc_args = {0}; - NOTICE("TSP: %s\n", version_string); + NOTICE("TSP: %s\n", build_version_string); NOTICE("TSP: %s\n", build_message); INFO("TSP: Total memory base : 0x%lx\n", (unsigned long) BL32_BASE); INFO("TSP: Total memory size : 0x%lx bytes\n", BL32_TOTAL_SIZE); diff --git a/bl32/tsp/tsp_main.c b/bl32/tsp/tsp_main.c index 805575a21..ae38d6904 100644 --- a/bl32/tsp/tsp_main.c +++ b/bl32/tsp/tsp_main.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -27,7 +28,7 @@ ******************************************************************************/ uint64_t tsp_main(void) { - NOTICE("TSP: %s\n", version_string); + NOTICE("TSP: %s\n", build_version_string); NOTICE("TSP: %s\n", build_message); INFO("TSP: Total memory base : 0x%lx\n", (unsigned long) BL32_BASE); INFO("TSP: Total memory size : 0x%lx bytes\n", BL32_TOTAL_SIZE); diff --git a/common/bl_common.c b/common/bl_common.c index 8fce02fba..fe4de0ae7 100644 --- a/common/bl_common.c +++ b/common/bl_common.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2022, Arm Limited and Contributors. All rights reserved. + * Copyright (c) 2013-2024, Arm Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -275,6 +276,5 @@ void print_entry_point_info(const entry_point_info_t *ep_info) */ const char *get_version(void) { - extern const char version[]; - return version; + return build_version; } diff --git a/include/common/bl_common.h b/include/common/bl_common.h index 4c8a17c5b..647ae853b 100644 --- a/include/common/bl_common.h +++ b/include/common/bl_common.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2022, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2013-2024, Arm Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -180,8 +180,6 @@ int load_auth_image(unsigned int image_id, image_info_t *image_data); void dyn_disable_auth(void); #endif -extern const char build_message[]; -extern const char version_string[]; const char *get_version(void); void print_entry_point_info(const entry_point_info_t *ep_info); diff --git a/include/common/build_message.h b/include/common/build_message.h new file mode 100644 index 000000000..b7c2f7245 --- /dev/null +++ b/include/common/build_message.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2024, Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef BUILD_MESSAGE_H +#define BUILD_MESSAGE_H + +static const char build_message[] = "Built : " BUILD_MESSAGE_TIMESTAMP; +static const char build_version_string[] = BUILD_MESSAGE_VERSION_STRING; +static const char build_version[] = BUILD_MESSAGE_VERSION; + +#endif /* BUILD_MESSAGE_H */ diff --git a/make_helpers/build_macros.mk b/make_helpers/build_macros.mk index 36ac1269a..cfd46d9ef 100644 --- a/make_helpers/build_macros.mk +++ b/make_helpers/build_macros.mk @@ -438,11 +438,6 @@ define SOURCES_TO_OBJS $(notdir $(patsubst %.S,%.o,$(filter %.S,$(1)))) endef -# Allow overriding the timestamp, for example for reproducible builds, or to -# synchronize timestamps across multiple projects. -# This must be set to a C string (including quotes where applicable). -BUILD_MESSAGE_TIMESTAMP ?= __TIME__", "__DATE__ - .PHONY: libraries # MAKE_LIB_DIRS macro defines the target for the directory where @@ -562,30 +557,19 @@ $(eval OBJS += $(MODULE_OBJS)) $(ELF): $(OBJS) $(DEFAULT_LINKER_SCRIPT) $(LINKER_SCRIPTS) | $(1)_dirs libraries $(BL_LIBS) $$(ECHO) " LD $$@" -ifdef MAKE_BUILD_STRINGS - $(call MAKE_BUILD_STRINGS,$(BUILD_DIR)/build_message.o) -else - @echo 'const char build_message[] = "Built : "$(BUILD_MESSAGE_TIMESTAMP); \ - const char version_string[] = "${VERSION_STRING}"; \ - const char version[] = "${VERSION}";' | \ - $($(ARCH)-cc) $$(TF_CFLAGS) $$(CFLAGS) -xc -c - -o $(BUILD_DIR)/build_message.o -endif ifeq ($($(ARCH)-ld-id),arm-link) $$(Q)$($(ARCH)-ld) -o $$@ $$(TF_LDFLAGS) $$(LDFLAGS) $(BL_LDFLAGS) --entry=${1}_entrypoint \ --predefine="-D__LINKER__=$(__LINKER__)" \ --predefine="-DTF_CFLAGS=$(TF_CFLAGS)" \ --map --list="$(MAPFILE)" --scatter=${PLAT_DIR}/scat/${1}.scat \ - $(LDPATHS) $(LIBWRAPPER) $(LDLIBS) $(BL_LIBS) \ - $(BUILD_DIR)/build_message.o $(OBJS) + $(LDPATHS) $(LIBWRAPPER) $(LDLIBS) $(BL_LIBS) $(OBJS) else ifeq ($($(ARCH)-ld-id),gnu-gcc) $$(Q)$($(ARCH)-ld) -o $$@ $$(TF_LDFLAGS) $$(LDFLAGS) $(BL_LDFLAGS) -Wl,-Map=$(MAPFILE) \ $(addprefix -Wl$(comma)--script$(comma),$(LINKER_SCRIPTS)) -Wl,--script,$(DEFAULT_LINKER_SCRIPT) \ - $(BUILD_DIR)/build_message.o \ $(OBJS) $(LDPATHS) $(LIBWRAPPER) $(LDLIBS) $(BL_LIBS) else $$(Q)$($(ARCH)-ld) -o $$@ $$(TF_LDFLAGS) $$(LDFLAGS) $(BL_LDFLAGS) -Map=$(MAPFILE) \ $(addprefix -T ,$(LINKER_SCRIPTS)) --script $(DEFAULT_LINKER_SCRIPT) \ - $(BUILD_DIR)/build_message.o \ $(OBJS) $(LDPATHS) $(LIBWRAPPER) $(LDLIBS) $(BL_LIBS) endif ifeq ($(DISABLE_BIN_GENERATION),1) diff --git a/make_helpers/windows.mk b/make_helpers/windows.mk index a75a74021..de34eafb7 100644 --- a/make_helpers/windows.mk +++ b/make_helpers/windows.mk @@ -79,16 +79,4 @@ endif # This can be overridden from the command line or environment. BUILD_STRING ?= development build -# The DOS echo shell command does not strip ' characters from the command -# parameters before printing. We therefore use an alternative method invoked -# by defining the MAKE_BUILD_STRINGS macro. -BUILT_TIME_DATE_STRING = const char build_message[] = "Built : "${BUILD_MESSAGE_TIMESTAMP}; -VERSION_STRING_MESSAGE = const char version_string[] = "${VERSION_STRING}"; -VERSION_MESSAGE = const char version[] = "${VERSION}"; -define MAKE_BUILD_STRINGS - $$(file >$1.in,$$(TF_CFLAGS) $$(CFLAGS)) - @echo $$(BUILT_TIME_DATE_STRING) $$(VERSION_STRING_MESSAGE) $$(VERSION_MESSAGE) | \ - $($(ARCH)-cc) @$1.in -x c -c - -o $1 -endef - MSVC_NMAKE := nmake.exe diff --git a/plat/arm/board/fvp_r/fvp_r_bl1_main.c b/plat/arm/board/fvp_r/fvp_r_bl1_main.c index 29495cfcb..6fe2b5b36 100644 --- a/plat/arm/board/fvp_r/fvp_r_bl1_main.c +++ b/plat/arm/board/fvp_r/fvp_r_bl1_main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2021-2024, Arm Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -161,7 +162,7 @@ void bl1_main(void) /* Announce our arrival */ NOTICE(FIRMWARE_WELCOME_STR); - NOTICE("BL1: %s\n", version_string); + NOTICE("BL1: %s\n", build_version_string); NOTICE("BL1: %s\n", build_message); INFO("BL1: RAM %p - %p\n", (void *)BL1_RAM_BASE, (void *)BL1_RAM_LIMIT); @@ -244,4 +245,3 @@ void print_debug_loop_message(void) NOTICE("BL1: Please connect the debugger to continue\n"); } #endif - diff --git a/plat/arm/board/morello/morello_image_load.c b/plat/arm/board/morello/morello_image_load.c index cfe8bee58..b95903198 100644 --- a/plat/arm/board/morello/morello_image_load.c +++ b/plat/arm/board/morello/morello_image_load.c @@ -5,6 +5,7 @@ */ #include +#include #include #include #include @@ -142,7 +143,7 @@ static int plat_morello_append_config_node(struct morello_plat_info *plat_info, return -1; } - err = fdt_setprop_string(fdt, nodeoffset_fw, "tfa-fw-version", version_string); + err = fdt_setprop_string(fdt, nodeoffset_fw, "tfa-fw-version", build_version_string); if (err < 0) { WARN("NT_FW_CONFIG: Unable to set tfa-fw-version\n"); } diff --git a/plat/imx/common/imx_sip_handler.c b/plat/imx/common/imx_sip_handler.c index 5d2918686..49fdacf0b 100644 --- a/plat/imx/common/imx_sip_handler.c +++ b/plat/imx/common/imx_sip_handler.c @@ -9,9 +9,10 @@ #include #include #include -#include +#include #include #include +#include #include #include #include @@ -261,7 +262,7 @@ static uint64_t imx_get_commit_hash(u_register_t x2, u_register_t x4) { /* Parse the version_string */ - char *parse = (char *)version_string; + char *parse = (char *)build_version_string; uint64_t hash = 0; do { diff --git a/services/std_svc/rmmd/trp/trp_main.c b/services/std_svc/rmmd/trp/trp_main.c index 33f2fb088..b75483cb6 100644 --- a/services/std_svc/rmmd/trp/trp_main.c +++ b/services/std_svc/rmmd/trp/trp_main.c @@ -1,9 +1,10 @@ /* - * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved. + * Copyright (c) 2021-2024, Arm Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ +#include #include #include #include @@ -86,7 +87,7 @@ int trp_validate_warmboot_args(uint64_t x0, uint64_t x1, /* Main function for TRP */ void trp_main(void) { - NOTICE("TRP: %s\n", version_string); + NOTICE("TRP: %s\n", build_version_string); NOTICE("TRP: %s\n", build_message); NOTICE("TRP: Supported RMM-EL3 Interface ABI: v.%u.%u\n", TRP_RMM_EL3_ABI_VERS_MAJOR, TRP_RMM_EL3_ABI_VERS_MINOR); From 7b45352669e53ab8a9ccf54b5fa3dac33620018b Mon Sep 17 00:00:00 2001 From: Chris Kay Date: Fri, 8 Mar 2024 16:26:53 +0000 Subject: [PATCH 2/5] build: separate preprocessing from DTB compilation This is a small change to separate preprocessing of device tree sources into their own build step as opposed to combining them. The impact of this is more on separation of concerns than anything tangible, but it's helpful to avoid doing more than necessary in a build rule. Change-Id: I770291bd9d9f627c93e82556a40f753bf27eef93 Signed-off-by: Chris Kay --- make_helpers/build_macros.mk | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/make_helpers/build_macros.mk b/make_helpers/build_macros.mk index cfd46d9ef..cf4595cd3 100644 --- a/make_helpers/build_macros.mk +++ b/make_helpers/build_macros.mk @@ -644,12 +644,14 @@ $(eval DTSDEP := $(patsubst %.dtb,%.o.d,$(DOBJ))) # Dependencies of the DT compilation on its pre-compiled DTS $(eval DTBDEP := $(patsubst %.dtb,%.d,$(DOBJ))) -$(DOBJ): $(2) $(filter-out %.d,$(MAKEFILE_LIST)) | fdt_dirs +$(DPRE): $(2) | fdt_dirs $${ECHO} " CPP $$<" $(eval DTBS := $(addprefix $(1)/,$(call SOURCES_TO_DTBS,$(2)))) $$(Q)$($(ARCH)-cpp) -E $$(TF_CFLAGS_$(ARCH)) $$(DTC_CPPFLAGS) -MT $(DTBS) -MMD -MF $(DTSDEP) -o $(DPRE) $$< + +$(DOBJ): $(DPRE) $(filter-out %.d,$(MAKEFILE_LIST)) | fdt_dirs $${ECHO} " DTC $$<" - $$(Q)$($(ARCH)-dtc) $$(DTC_FLAGS) -d $(DTBDEP) -o $$@ $(DPRE) + $$(Q)$($(ARCH)-dtc) $$(DTC_FLAGS) -d $(DTBDEP) -o $$@ $$< -include $(DTBDEP) -include $(DTSDEP) From 4d1289bd310ed01fdfcb965a3a2be03c19830ec3 Mon Sep 17 00:00:00 2001 From: Chris Kay Date: Mon, 11 Mar 2024 16:54:15 +0000 Subject: [PATCH 3/5] build(rcar): separate BL2 and BL31 SREC generation This small change creates individual Make non-phony targets for the Bl2 and BL31 SREC binaries to avoid rebuilding them unnecessarily. Change-Id: Ibb8880bb5c00a0956fc78d252fcc56391fbfe439 Signed-off-by: Chris Kay --- plat/renesas/rcar/platform.mk | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/plat/renesas/rcar/platform.mk b/plat/renesas/rcar/platform.mk index 5718478b2..8e3f52ecf 100644 --- a/plat/renesas/rcar/platform.mk +++ b/plat/renesas/rcar/platform.mk @@ -368,9 +368,13 @@ clean_srecord: @echo "clean bl2 and bl31 srecs" rm -f ${SREC_PATH}/bl2.srec ${SREC_PATH}/bl31.srec +$(SREC_PATH)/bl2.srec: $(BL2_ELF_SRC) + @echo "generating srec: $(SREC_PATH)/bl2.srec" + $(Q)$($(ARCH)-oc) -O srec --srec-forceS3 $(BL2_ELF_SRC) $(SREC_PATH)/bl2.srec + +$(SREC_PATH)/bl31.srec: $(BL31_ELF_SRC) + @echo "generating srec: $(SREC_PATH)/bl31.srec" + $(Q)$($(ARCH)-oc) -O srec --srec-forceS3 $(BL31_ELF_SRC) $(SREC_PATH)/bl31.srec + .PHONY: rcar_srecord -rcar_srecord: $(BL2_ELF_SRC) $(BL31_ELF_SRC) - @echo "generating srec: ${SREC_PATH}/bl2.srec" - $(Q)$($(ARCH)-oc) -O srec --srec-forceS3 ${BL2_ELF_SRC} ${SREC_PATH}/bl2.srec - @echo "generating srec: ${SREC_PATH}/bl31.srec" - $(Q)$($(ARCH)-oc) -O srec --srec-forceS3 ${BL31_ELF_SRC} ${SREC_PATH}/bl31.srec +rcar_srecord: $(SREC_PATH)/bl2.srec $(SREC_PATH)/bl31.srec From 784092ee168b9ba3a038f080fe9c29ca7e1c678c Mon Sep 17 00:00:00 2001 From: Chris Kay Date: Mon, 11 Mar 2024 16:54:15 +0000 Subject: [PATCH 4/5] build(rzg): separate BL2 and BL31 SREC generation This small change creates individual Make non-phony targets for the Bl2 and BL31 SREC binaries to avoid rebuilding them unnecessarily. Change-Id: Ia8e5db0e4a968d4b379fdb66123b6a8f20933bf5 Signed-off-by: Chris Kay --- plat/renesas/rzg/platform.mk | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/plat/renesas/rzg/platform.mk b/plat/renesas/rzg/platform.mk index 89ca22780..354eada67 100644 --- a/plat/renesas/rzg/platform.mk +++ b/plat/renesas/rzg/platform.mk @@ -266,9 +266,13 @@ clean_srecord: @echo "clean bl2 and bl31 srecs" rm -f ${SREC_PATH}/bl2.srec ${SREC_PATH}/bl31.srec +$(SREC_PATH)/bl2.srec: $(BL2_ELF_SRC) + @echo "generating srec: $(SREC_PATH)/bl2.srec" + $(Q)$($(ARCH)-oc) -O srec --srec-forceS3 $(BL2_ELF_SRC) $(SREC_PATH)/bl2.srec + +$(SREC_PATH)/bl31.srec: $(BL31_ELF_SRC) + @echo "generating srec: $(SREC_PATH)/bl31.srec" + $(Q)$($(ARCH)-oc) -O srec --srec-forceS3 $(BL31_ELF_SRC) $(SREC_PATH)/bl31.srec + .PHONY: rzg_srecord -rzg_srecord: $(BL2_ELF_SRC) $(BL31_ELF_SRC) - @echo "generating srec: ${SREC_PATH}/bl2.srec" - $(Q)$($(ARCH)-oc) -O srec --srec-forceS3 ${BL2_ELF_SRC} ${SREC_PATH}/bl2.srec - @echo "generating srec: ${SREC_PATH}/bl31.srec" - $(Q)$($(ARCH)-oc) -O srec --srec-forceS3 ${BL31_ELF_SRC} ${SREC_PATH}/bl31.srec +rzg_srecord: $(SREC_PATH)/bl2.srec $(SREC_PATH)/bl31.srec From 3d6c7e590e1252103f17bf9ba57c3617f4fad1de Mon Sep 17 00:00:00 2001 From: Chris Kay Date: Tue, 16 Apr 2024 17:19:20 +0000 Subject: [PATCH 5/5] build: improve diagnostics for unrecognized toolchain tools MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Up until recently the build system accepted an arbitrary value for `AS` and, unbeknownst to anybody, was simply not making use of it. Recent feedback has revealed that a number of contributors have `AS` explicitly configured to use the GNU assembler, which is not a supported assembler, and this breakage has yielded some cryptic error messages, e.g.: aarch64-none-elf-as: unrecognized option '-x' This change introduces human-readable diagnostics to help developers with diagnosing unsupported toolchain tools: The configured AArch64 assembler could not be identified and may not be supported: aarch64-none-elf-as The default AArch64 assembler is: aarch64-none-elf-gcc The following tools are supported: - Arm® Compiler for Embedded `armclang` - LLVM Clang (`clang`) - GNU GCC (`gcc`) The build system will treat this assembler as GNU GCC (`gcc`). Change-Id: I316036c83be2d45ee83a88846cf65c6ce7ae3c26 Signed-off-by: Chris Kay --- make_helpers/toolchain.mk | 217 +++++++++++++++------------ make_helpers/toolchains/aarch32.mk | 25 +++ make_helpers/toolchains/aarch64.mk | 25 +++ make_helpers/toolchains/host.mk | 27 +++- make_helpers/toolchains/rk3399-m0.mk | 17 +++ 5 files changed, 212 insertions(+), 99 deletions(-) diff --git a/make_helpers/toolchain.mk b/make_helpers/toolchain.mk index 2f4764705..8e5561967 100644 --- a/make_helpers/toolchain.mk +++ b/make_helpers/toolchain.mk @@ -17,48 +17,6 @@ toolchains ?= host $(ARCH) -ifneq ($(filter host,$(toolchains)),) - host-cc := $(HOSTCC) - host-cpp := $(HOSTCPP) - - host-as := $(HOSTAS) - - host-ld := $(HOSTLD) - host-oc := $(HOSTOC) - host-od := $(HOSTOD) - host-ar := $(HOSTAR) - - host-dtc := $(HOSTDTC) -endif - -ifneq ($(filter aarch32,$(toolchains)),) - aarch32-cc := $(if $(filter-out default,$(origin CC)),$(CC)) - aarch32-cpp := $(if $(filter-out default,$(origin CPP)),$(CPP)) - - aarch32-as := $(if $(filter-out default,$(origin AS)),$(AS)) - - aarch32-ld := $(if $(filter-out default,$(origin LD)),$(LD)) - aarch32-oc := $(if $(filter-out default,$(origin OC)),$(OC)) - aarch32-od := $(if $(filter-out default,$(origin OD)),$(OD)) - aarch32-ar := $(if $(filter-out default,$(origin AR)),$(AR)) - - aarch32-dtc := $(if $(filter-out default,$(origin DTC)),$(DTC)) -endif - -ifneq ($(filter aarch64,$(toolchains)),) - aarch64-cc := $(if $(filter-out default,$(origin CC)),$(CC)) - aarch64-cpp := $(if $(filter-out default,$(origin CPP)),$(CPP)) - - aarch64-as := $(if $(filter-out default,$(origin AS)),$(AS)) - - aarch64-ld := $(if $(filter-out default,$(origin LD)),$(LD)) - aarch64-oc := $(if $(filter-out default,$(origin OC)),$(OC)) - aarch64-od := $(if $(filter-out default,$(origin OD)),$(OD)) - aarch64-ar := $(if $(filter-out default,$(origin AR)),$(AR)) - - aarch64-dtc := $(if $(filter-out default,$(origin DTC)),$(DTC)) -endif - include $(dir $(lastword $(MAKEFILE_LIST)))build_env.mk include $(dir $(lastword $(MAKEFILE_LIST)))utilities.mk @@ -72,21 +30,29 @@ include $(addprefix $(dir $(lastword $(MAKEFILE_LIST)))toolchains/, \ # or type of tool in the toolchain. # -# C-related tools -tool-classes := cc # C compilers -tool-classes += cpp # C preprocessors +tool-classes := cc +tool-class-name-cc := C compiler -# Assembly-related tools -tool-classes += as # Assemblers +tool-classes += cpp +tool-class-name-cpp := C preprocessor -# Linking and object-handling tools -tool-classes += ld # Linkers -tool-classes += oc # Object copiers -tool-classes += od # Object dumpers -tool-classes += ar # Archivers +tool-classes += as +tool-class-name-as := assembler -# Other tools -tool-classes += dtc # Device tree compilers +tool-classes += ld +tool-class-name-ld := linker + +tool-classes += oc +tool-class-name-oc := object copier + +tool-classes += od +tool-class-name-od := object dumper + +tool-classes += ar +tool-class-name-ar := archiver + +tool-classes += dtc +tool-class-name-dtc := device tree compiler # # Configure tools that we recognize. @@ -96,28 +62,54 @@ tool-classes += dtc # Device tree compilers # further down. # -# Arm Compiler for Embedded -tools := arm-clang # armclang -tools += arm-link # armlink -tools += arm-ar # armar -tools += arm-fromelf # fromelf +# Arm® Compiler for Embedded +tools := arm-clang +tool-name-arm-clang := Arm® Compiler for Embedded `armclang` + +tools += arm-link +tool-name-arm-link := Arm® Compiler for Embedded `armlink` + +tools += arm-ar +tool-name-arm-ar := Arm® Compiler for Embedded `armar` + +tools += arm-fromelf +tool-name-arm-fromelf := Arm® Compiler for Embedded `fromelf` # LLVM Project -tools += llvm-clang # clang -tools += llvm-lld # lld -tools += llvm-objcopy # llvm-objcopy -tools += llvm-objdump # llvm-objdump -tools += llvm-ar # llvm-ar +tools += llvm-clang +tool-name-llvm-clang := LLVM Clang (`clang`) + +tools += llvm-lld +tool-name-llvm-lld := LLVM LLD (`lld`) + +tools += llvm-objcopy +tool-name-llvm-objcopy := LLVM `llvm-objcopy` + +tools += llvm-objdump +tool-name-llvm-objdump := LLVM `llvm-objdump` + +tools += llvm-ar +tool-name-llvm-ar := LLVM `llvm-ar` # GNU Compiler Collection & GNU Binary Utilities -tools += gnu-gcc # gcc -tools += gnu-ld # ld -tools += gnu-objcopy # objcopy -tools += gnu-objdump # objdump -tools += gnu-ar # gcc-ar +tools += gnu-gcc +tool-name-gnu-gcc := GNU GCC (`gcc`) + +tools += gnu-ld +tool-name-gnu-ld := GNU LD (`ld.bfd`) + +tools += gnu-objcopy +tool-name-gnu-objcopy := GNU `objcopy` + +tools += gnu-objdump +tool-name-gnu-objdump := GNU `objdump` + +tools += gnu-ar +tool-name-gnu-ar := GNU `ar` # Other tools -tools += dtc # Device Tree Compiler +tools += generic-dtc +tool-name-generic-dtc := Device Tree Compiler (`dtc`) # # Assign tools to tool classes. @@ -142,7 +134,7 @@ tools-od := arm-fromelf llvm-objdump gnu-objdump # Object dumpers tools-ar := arm-ar llvm-ar gnu-ar # Archivers # Other tools -tools-dtc := dtc # Device tree compilers +tools-dtc := generic-dtc # Device tree compilers define check-tool-class-tools $(eval tool-class := $(1)) @@ -224,27 +216,27 @@ $(foreach toolchain,$(toolchains), \ # # Arm Compiler for Embedded -guess-tool-arm-clang = $(shell $(call escape-shell,$(1)) --version 2>&1 <$(nul) | grep -o "Tool: armclang") -guess-tool-arm-link = $(shell $(call escape-shell,$(1)) --help 2>&1 <$(nul) | grep -o "Tool: armlink") -guess-tool-arm-fromelf = $(shell $(call escape-shell,$(1)) --help 2>&1 <$(nul) | grep -o "Tool: fromelf") -guess-tool-arm-ar = $(shell $(call escape-shell,$(1)) --version 2>&1 <$(nul) | grep -o "Tool: armar") +guess-tool-arm-clang = $(shell $(call escape-shell,$(1)) --version 2>&1 <$(nul) | grep -o "Tool: armclang") +guess-tool-arm-link = $(shell $(call escape-shell,$(1)) --help 2>&1 <$(nul) | grep -o "Tool: armlink") +guess-tool-arm-fromelf = $(shell $(call escape-shell,$(1)) --help 2>&1 <$(nul) | grep -o "Tool: fromelf") +guess-tool-arm-ar = $(shell $(call escape-shell,$(1)) --version 2>&1 <$(nul) | grep -o "Tool: armar") # LLVM Project -guess-tool-llvm-clang = $(shell $(call escape-shell,$(1)) -v 2>&1 <$(nul) | grep -o "clang version") -guess-tool-llvm-lld = $(shell $(call escape-shell,$(1)) --help 2>&1 <$(nul) | grep -o "OVERVIEW: lld") -guess-tool-llvm-objcopy = $(shell $(call escape-shell,$(1)) --help 2>&1 <$(nul) | grep -o "llvm-objcopy tool") -guess-tool-llvm-objdump = $(shell $(call escape-shell,$(1)) --help 2>&1 <$(nul) | grep -o "llvm object file dumper") -guess-tool-llvm-ar = $(shell $(call escape-shell,$(1)) --help 2>&1 <$(nul) | grep -o "LLVM Archiver") +guess-tool-llvm-clang = $(shell $(call escape-shell,$(1)) -v 2>&1 <$(nul) | grep -o "clang version") +guess-tool-llvm-lld = $(shell $(call escape-shell,$(1)) --help 2>&1 <$(nul) | grep -o "OVERVIEW: lld") +guess-tool-llvm-objcopy = $(shell $(call escape-shell,$(1)) --help 2>&1 <$(nul) | grep -o "llvm-objcopy tool") +guess-tool-llvm-objdump = $(shell $(call escape-shell,$(1)) --help 2>&1 <$(nul) | grep -o "llvm object file dumper") +guess-tool-llvm-ar = $(shell $(call escape-shell,$(1)) --help 2>&1 <$(nul) | grep -o "LLVM Archiver") # GNU Compiler Collection & GNU Binary Utilities -guess-tool-gnu-gcc = $(shell $(call escape-shell,$(1)) -v 2>&1 <$(nul) | grep -o "gcc version") -guess-tool-gnu-ld = $(shell $(call escape-shell,$(1)) -v 2>&1 <$(nul) | grep -o "GNU ld") -guess-tool-gnu-objcopy = $(shell $(call escape-shell,$(1)) --version 2>&1 <$(nul) | grep -o "GNU objcopy") -guess-tool-gnu-objdump = $(shell $(call escape-shell,$(1)) --version 2>&1 <$(nul) | grep -o "GNU objdump") -guess-tool-gnu-ar = $(shell $(call escape-shell,$(1)) --version 2>&1 <$(nul) | grep -o "GNU ar") +guess-tool-gnu-gcc = $(shell $(call escape-shell,$(1)) -v 2>&1 <$(nul) | grep -o "gcc version") +guess-tool-gnu-ld = $(shell $(call escape-shell,$(1)) -v 2>&1 <$(nul) | grep -o "GNU ld") +guess-tool-gnu-objcopy = $(shell $(call escape-shell,$(1)) --version 2>&1 <$(nul) | grep -o "GNU objcopy") +guess-tool-gnu-objdump = $(shell $(call escape-shell,$(1)) --version 2>&1 <$(nul) | grep -o "GNU objdump") +guess-tool-gnu-ar = $(shell $(call escape-shell,$(1)) --version 2>&1 <$(nul) | grep -o "GNU ar") # Other tools -guess-tool-dtc = $(shell $(call escape-shell,$(1)) --version 2>&1 <$(nul) | grep -o "Version: DTC") +guess-tool-generic-dtc = $(shell $(call escape-shell,$(1)) --version 2>&1 <$(nul) | grep -o "Version: DTC") guess-tool = $(firstword $(foreach candidate,$(1), \ $(if $(call guess-tool-$(candidate),$(2)),$(candidate)))) @@ -294,11 +286,44 @@ guess-gnu-gcc-oc = $(shell $(call escape-shell,$(1)) --print-prog-name objcopy 2 guess-gnu-gcc-od = $(shell $(call escape-shell,$(1)) --print-prog-name objdump 2>$(nul)) guess-gnu-gcc-ar = $(call which,$(call decompat-path,$(patsubst %$(call file-name,$(1)),%$(subst gcc,gcc-ar,$(call file-name,$(1))),$(call compat-path,$(1))))) +define warn-unrecognized-tool + $(eval toolchain := $(1)) + $(eval tool-class := $(2)) + + $$(warning ) + $$(warning The configured $$($(toolchain)-name) $$(tool-class-name-$(tool-class)) could not be identified and may not be supported:) + $$(warning ) + $$(warning $$(space) $$($(toolchain)-$(tool-class))) + $$(warning ) + $$(warning The default $$($(toolchain)-name) $$(tool-class-name-$(tool-class)) is:) + $$(warning ) + $$(warning $$(space) $$($(toolchain)-$(tool-class)-default)) + $$(warning ) + $$(warning The following tools are supported:) + $$(warning ) + + $$(foreach tool,$$(tools-$(tool-class)), \ + $$(warning $$(space) - $$(tool-name-$$(tool)))) + + $$(warning ) + $$(warning The build system will treat this $$(tool-class-name-$(tool-class)) as $$(tool-name-$$($(toolchain)-$(tool-class)-id-default)).) + $$(warning ) +endef + define locate-toolchain-tool-cc $(eval toolchain := $(1)) $(toolchain)-cc := $$(or $$($(toolchain)-cc),$$($(toolchain)-cc-default)) $(toolchain)-cc-id := $$(call guess-tool,$$(tools-cc),$$($(toolchain)-cc)) + + ifndef $(toolchain)-cc-id + $(toolchain)-cc-id := $$($(toolchain)-cc-id-default) + + $$(eval $$(call warn-unrecognized-tool,$(toolchain),cc)) + endif + + $(toolchain)-cc-path := $$($(toolchain)-cc) + $(toolchain)-cc := $$(call escape-shell,$$($(toolchain)-cc)) endef define locate-toolchain-tool @@ -308,33 +333,29 @@ define locate-toolchain-tool ifndef $(toolchain)-$(tool-class) $(toolchain)-$(tool-class) := $$(call guess-$$($(toolchain)-cc-id)-$(tool-class),$$($(toolchain)-cc-path)) - ifeq ($$($(toolchain)-$(tool-class)),) + ifndef $(toolchain)-$(tool-class) $(toolchain)-$(tool-class) := $$($(toolchain)-$(tool-class)-default) endif endif - $(toolchain)-$(tool-class)-id := $$(call guess-tool,$$(tools-$(tool-class)),$$($$(toolchain)-$(tool-class))) -endef + $(toolchain)-$(tool-class)-id := $$(call guess-tool,$$(tools-$(tool-class)),$$($(toolchain)-$(tool-class))) -define canonicalize-toolchain-tool-path - $(eval toolchain := $(1)) - $(eval tool-class := $(2)) + ifndef $(toolchain)-$(tool-class)-id + $(toolchain)-$(tool-class)-id := $$($(toolchain)-$(tool-class)-id-default) - $(toolchain)-$(tool-class)-path := $$(call absolute-path,$$(call which,$$($(toolchain)-$(tool-class)))) - $(toolchain)-$(tool-class)-path := $$(or $$($(toolchain)-$(tool-class)-path),$$($(toolchain)-$(tool-class))) + $$(eval $$(call warn-unrecognized-tool,$(toolchain),$(tool-class))) + endif - $(toolchain)-$(tool-class) := $(call escape-shell,$$($(toolchain)-$(tool-class)-path)) + $(toolchain)-$(tool-class) := $$(call escape-shell,$$($(toolchain)-$(tool-class))) endef define locate-toolchain $(eval toolchain := $(1)) $$(eval $$(call locate-toolchain-tool-cc,$(toolchain))) - $$(eval $$(call canonicalize-toolchain-tool-path,$(toolchain),cc)) $$(foreach tool-class,$$(filter-out cc,$$(tool-classes)), \ - $$(eval $$(call locate-toolchain-tool,$(toolchain),$$(tool-class))) \ - $$(eval $$(call canonicalize-toolchain-tool-path,$(toolchain),$$(tool-class)))) + $$(eval $$(call locate-toolchain-tool,$(toolchain),$$(tool-class)))) endef $(foreach toolchain,$(toolchains), \ diff --git a/make_helpers/toolchains/aarch32.mk b/make_helpers/toolchains/aarch32.mk index 3475c91fb..ff00a5339 100644 --- a/make_helpers/toolchains/aarch32.mk +++ b/make_helpers/toolchains/aarch32.mk @@ -4,11 +4,36 @@ # SPDX-License-Identifier: BSD-3-Clause # +aarch32-name := AArch32 + +aarch32-cc := $(if $(filter-out default,$(origin CC)),$(CC)) aarch32-cc-default := $(or $(CROSS_COMPILE),arm-none-eabi-)gcc +aarch32-cc-id-default := gnu-gcc + +aarch32-cpp := $(if $(filter-out default,$(origin CPP)),$(CPP)) aarch32-cpp-default := $(or $(CROSS_COMPILE),arm-none-eabi-)gcc +aarch32-cpp-id-default := gnu-gcc + +aarch32-as := $(if $(filter-out default,$(origin AS)),$(AS)) aarch32-as-default := $(or $(CROSS_COMPILE),arm-none-eabi-)gcc +aarch32-as-id-default := gnu-gcc + +aarch32-ld := $(if $(filter-out default,$(origin LD)),$(LD)) aarch32-ld-default := $(or $(CROSS_COMPILE),arm-none-eabi-)gcc +aarch32-ld-id-default := gnu-gcc + +aarch32-oc := $(if $(filter-out default,$(origin OC)),$(OC)) aarch32-oc-default := $(or $(CROSS_COMPILE),arm-none-eabi-)objcopy +aarch32-oc-id-default := gnu-objcopy + +aarch32-od := $(if $(filter-out default,$(origin OD)),$(OD)) aarch32-od-default := $(or $(CROSS_COMPILE),arm-none-eabi-)objdump +aarch32-od-id-default := gnu-objdump + +aarch32-ar := $(if $(filter-out default,$(origin AR)),$(AR)) aarch32-ar-default := $(or $(CROSS_COMPILE),arm-none-eabi-)gcc-ar +aarch32-ar-id-default := gnu-ar + +aarch32-dtc := $(if $(filter-out default,$(origin DTC)),$(DTC)) aarch32-dtc-default := dtc +aarch32-dtc-id-default := generic-dtc diff --git a/make_helpers/toolchains/aarch64.mk b/make_helpers/toolchains/aarch64.mk index d83d9187e..407f06818 100644 --- a/make_helpers/toolchains/aarch64.mk +++ b/make_helpers/toolchains/aarch64.mk @@ -4,11 +4,36 @@ # SPDX-License-Identifier: BSD-3-Clause # +aarch64-name := AArch64 + +aarch64-cc := $(if $(filter-out default,$(origin CC)),$(CC)) aarch64-cc-default := $(or $(CROSS_COMPILE),aarch64-none-elf-)gcc +aarch64-cc-id-default := gnu-gcc + +aarch64-cpp := $(if $(filter-out default,$(origin CPP)),$(CPP)) aarch64-cpp-default := $(or $(CROSS_COMPILE),aarch64-none-elf-)gcc +aarch64-cpp-id-default := gnu-gcc + +aarch64-as := $(if $(filter-out default,$(origin AS)),$(AS)) aarch64-as-default := $(or $(CROSS_COMPILE),aarch64-none-elf-)gcc +aarch64-as-id-default := gnu-gcc + +aarch64-ld := $(if $(filter-out default,$(origin LD)),$(LD)) aarch64-ld-default := $(or $(CROSS_COMPILE),aarch64-none-elf-)gcc +aarch64-ld-id-default := gnu-gcc + +aarch64-oc := $(if $(filter-out default,$(origin OC)),$(OC)) aarch64-oc-default := $(or $(CROSS_COMPILE),aarch64-none-elf-)objcopy +aarch64-oc-id-default := gnu-objcopy + +aarch64-od := $(if $(filter-out default,$(origin OD)),$(OD)) aarch64-od-default := $(or $(CROSS_COMPILE),aarch64-none-elf-)objdump +aarch64-od-id-default := gnu-objdump + +aarch64-ar := $(if $(filter-out default,$(origin AR)),$(AR)) aarch64-ar-default := $(or $(CROSS_COMPILE),aarch64-none-elf-)gcc-ar +aarch64-ar-id-default := gnu-ar + +aarch64-dtc := $(if $(filter-out default,$(origin DTC)),$(DTC)) aarch64-dtc-default := dtc +aarch64-dtc-id-default := generic-dtc diff --git a/make_helpers/toolchains/host.mk b/make_helpers/toolchains/host.mk index fe3fc1c8d..733c289b7 100644 --- a/make_helpers/toolchains/host.mk +++ b/make_helpers/toolchains/host.mk @@ -1,14 +1,39 @@ # -# Copyright (c) 2023, Arm Limited and Contributors. All rights reserved. +# Copyright (c) 2023-2024, Arm Limited and Contributors. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # +host-name := host + +host-cc := $(HOSTCC) host-cc-default := gcc +host-cc-id-default := gnu-gcc + +host-cpp := $(HOSTCPP) host-cpp-default := gcc +host-cpp-id-default := gnu-gcc + +host-as := $(HOSTAS) host-as-default := gcc +host-as-id-default := gnu-gcc + +host-ld := $(HOSTLD) host-ld-default := gcc +host-ld-id-default := gnu-gcc + +host-oc := $(HOSTOC) host-oc-default := objcopy +host-oc-id-default := gnu-objcopy + +host-od := $(HOSTOD) host-od-default := objdump +host-od-id-default := gnu-objdump + +host-ar := $(HOSTAR) host-ar-default := gcc-ar +host-ar-id-default := gnu-ar + +host-dtc := $(HOSTDTC) host-dtc-default := dtc +host-dtc-id-default := generic-dtc diff --git a/make_helpers/toolchains/rk3399-m0.mk b/make_helpers/toolchains/rk3399-m0.mk index f57d6583c..92309f1c7 100644 --- a/make_helpers/toolchains/rk3399-m0.mk +++ b/make_helpers/toolchains/rk3399-m0.mk @@ -4,11 +4,28 @@ # SPDX-License-Identifier: BSD-3-Clause # +rk3399-m0-name := RK3399 M0 + rk3399-m0-cc-default := $(or $(M0_CROSS_COMPILE),arm-none-eabi-)gcc +rk3399-m0-cc-id-default := gnu-gcc + rk3399-m0-cpp-default := $(or $(M0_CROSS_COMPILE),arm-none-eabi-)gcc +rk3399-m0-cpp-id-default := gnu-gcc + rk3399-m0-as-default := $(or $(M0_CROSS_COMPILE),arm-none-eabi-)gcc +rk3399-m0-as-id-default := gnu-gcc + rk3399-m0-ld-default := $(or $(M0_CROSS_COMPILE),arm-none-eabi-)gcc +rk3399-m0-ld-id-default := gnu-gcc + rk3399-m0-oc-default := $(or $(M0_CROSS_COMPILE),arm-none-eabi-)objcopy +rk3399-m0-oc-id-default := gnu-objcopy + rk3399-m0-od-default := $(or $(M0_CROSS_COMPILE),arm-none-eabi-)objdump +rk3399-m0-od-id-default := gnu-objdump + rk3399-m0-ar-default := $(or $(M0_CROSS_COMPILE),arm-none-eabi-)gcc-ar +rk3399-m0-ar-id-default := gnu-ar + rk3399-m0-dtc-default := dtc +rk3399-m0-dtc-id-default := generic-dtc