mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-18 10:34:19 +00:00
Merge changes from topics "rcar-tools-fix", "toolchain-cleanup" into integration
* changes: build: remove the `NM` variable build: prefer `gcc-ar` over `ar` build: add `--no-warn-rwx-segments` when linking with GCC build: always use the C compiler to assemble build: always use the C compiler to preprocess fix(rcar): fix implicit rule invocations in tools
This commit is contained in:
commit
07da4854e9
7 changed files with 23 additions and 25 deletions
8
Makefile
8
Makefile
|
@ -100,14 +100,12 @@ HOSTCC := gcc
|
||||||
export HOSTCC
|
export HOSTCC
|
||||||
|
|
||||||
CC := ${CROSS_COMPILE}gcc
|
CC := ${CROSS_COMPILE}gcc
|
||||||
CPP := ${CROSS_COMPILE}cpp
|
CPP := ${CROSS_COMPILE}gcc -E
|
||||||
AS := ${CROSS_COMPILE}gcc
|
AS := ${CROSS_COMPILE}gcc
|
||||||
AR := ${CROSS_COMPILE}ar
|
AR := ${CROSS_COMPILE}gcc-ar
|
||||||
LINKER := ${CROSS_COMPILE}ld
|
LINKER := ${CROSS_COMPILE}ld
|
||||||
OC := ${CROSS_COMPILE}objcopy
|
OC := ${CROSS_COMPILE}objcopy
|
||||||
OD := ${CROSS_COMPILE}objdump
|
OD := ${CROSS_COMPILE}objdump
|
||||||
NM := ${CROSS_COMPILE}nm
|
|
||||||
PP := ${CROSS_COMPILE}gcc -E
|
|
||||||
DTC := dtc
|
DTC := dtc
|
||||||
|
|
||||||
# Use ${LD}.bfd instead if it exists (as absolute path or together with $PATH).
|
# Use ${LD}.bfd instead if it exists (as absolute path or together with $PATH).
|
||||||
|
@ -187,7 +185,6 @@ ifneq ($(findstring clang,$(notdir $(CC))),)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CPP := $(CC) -E $(TF_CFLAGS_$(ARCH))
|
CPP := $(CC) -E $(TF_CFLAGS_$(ARCH))
|
||||||
PP := $(CC) -E $(TF_CFLAGS_$(ARCH))
|
|
||||||
AS := $(CC) -c -x assembler-with-cpp $(TF_CFLAGS_$(ARCH))
|
AS := $(CC) -c -x assembler-with-cpp $(TF_CFLAGS_$(ARCH))
|
||||||
else ifneq ($(findstring gcc,$(notdir $(CC))),)
|
else ifneq ($(findstring gcc,$(notdir $(CC))),)
|
||||||
ifeq ($(ENABLE_LTO),1)
|
ifeq ($(ENABLE_LTO),1)
|
||||||
|
@ -356,6 +353,7 @@ ifneq ($(findstring armlink,$(notdir $(LD))),)
|
||||||
# LD = gcc (used when GCC LTO is enabled)
|
# LD = gcc (used when GCC LTO is enabled)
|
||||||
else ifneq ($(findstring gcc,$(notdir $(LD))),)
|
else ifneq ($(findstring gcc,$(notdir $(LD))),)
|
||||||
# Pass ld options with Wl or Xlinker switches
|
# Pass ld options with Wl or Xlinker switches
|
||||||
|
TF_LDFLAGS += $(call ld_option,-Xlinker --no-warn-rwx-segments)
|
||||||
TF_LDFLAGS += -Wl,--fatal-warnings -O1
|
TF_LDFLAGS += -Wl,--fatal-warnings -O1
|
||||||
TF_LDFLAGS += -Wl,--gc-sections
|
TF_LDFLAGS += -Wl,--gc-sections
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2021-2023, Arm Limited. All rights reserved.
|
# Copyright (c) 2021-2024, Arm Limited. All rights reserved.
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
#
|
#
|
||||||
|
@ -774,6 +774,9 @@ subsections:
|
||||||
- title: PSCI
|
- title: PSCI
|
||||||
scope: psci
|
scope: psci
|
||||||
|
|
||||||
|
- title: ROMlib
|
||||||
|
scope: romlib
|
||||||
|
|
||||||
- title: GPT
|
- title: GPT
|
||||||
scope: gpt
|
scope: gpt
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2018-2019, Arm Limited and Contributors. All rights reserved.
|
# Copyright (c) 2018-2024, Arm Limited and Contributors. All rights reserved.
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
#
|
#
|
||||||
|
|
||||||
AS = $(CROSS_COMPILE)as
|
AS = $(CROSS_COMPILE)gcc
|
||||||
AR = $(CROSS_COMPILE)ar
|
AR = $(CROSS_COMPILE)gcc-ar
|
||||||
LD = $(CROSS_COMPILE)ld
|
LD = $(CROSS_COMPILE)ld
|
||||||
OC = $(CROSS_COMPILE)objcopy
|
OC = $(CROSS_COMPILE)objcopy
|
||||||
CPP = $(CROSS_COMPILE)cpp
|
CPP = $(CROSS_COMPILE)gcc -E
|
||||||
ROMLIB_GEN = ./romlib_generator.py
|
ROMLIB_GEN = ./romlib_generator.py
|
||||||
BUILD_DIR = $(BUILD_PLAT)/romlib
|
BUILD_DIR = $(BUILD_PLAT)/romlib
|
||||||
LIB_DIR = $(BUILD_PLAT)/lib
|
LIB_DIR = $(BUILD_PLAT)/lib
|
||||||
|
@ -48,11 +48,11 @@ all: $(BUILD_DIR)/romlib.bin $(LIB_DIR)/libwrappers.a
|
||||||
|
|
||||||
%.o: %.s
|
%.o: %.s
|
||||||
@echo " AS $@"
|
@echo " AS $@"
|
||||||
$(Q)$(AS) $(ASFLAGS) -o $@ $<
|
$(Q)$(AS) -c $(ASFLAGS) -o $@ $<
|
||||||
|
|
||||||
$(BUILD_DIR)/%.o: %.s
|
$(BUILD_DIR)/%.o: %.s
|
||||||
@echo " AS $@"
|
@echo " AS $@"
|
||||||
$(Q)$(AS) $(ASFLAGS) -o $@ $<
|
$(Q)$(AS) -c $(ASFLAGS) -o $@ $<
|
||||||
|
|
||||||
$(BUILD_DIR)/romlib.ld: romlib.ld.S
|
$(BUILD_DIR)/romlib.ld: romlib.ld.S
|
||||||
@echo " PP $@"
|
@echo " PP $@"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2015-2023, Arm Limited and Contributors. All rights reserved.
|
# Copyright (c) 2015-2024, Arm Limited and Contributors. All rights reserved.
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
#
|
#
|
||||||
|
@ -101,9 +101,7 @@ endef
|
||||||
|
|
||||||
# Convenience function to check for a given linker option. An call to
|
# Convenience function to check for a given linker option. An call to
|
||||||
# $(call ld_option, --no-XYZ) will return --no-XYZ if supported by the linker
|
# $(call ld_option, --no-XYZ) will return --no-XYZ if supported by the linker
|
||||||
define ld_option
|
ld_option = $(shell $(LD) $(1) -Wl,--version >/dev/null 2>&1 || $(LD) $(1) -v >/dev/null 2>&1 && echo $(1))
|
||||||
$(shell if $(LD) $(1) -v >/dev/null 2>&1; then echo $(1); fi )
|
|
||||||
endef
|
|
||||||
|
|
||||||
# Convenience function to check for a given compiler option. A call to
|
# Convenience function to check for a given compiler option. A call to
|
||||||
# $(call cc_option, --no-XYZ) will return --no-XYZ if supported by the compiler
|
# $(call cc_option, --no-XYZ) will return --no-XYZ if supported by the compiler
|
||||||
|
@ -658,7 +656,7 @@ $(eval DTBDEP := $(patsubst %.dtb,%.d,$(DOBJ)))
|
||||||
$(DOBJ): $(2) $(filter-out %.d,$(MAKEFILE_LIST)) | fdt_dirs
|
$(DOBJ): $(2) $(filter-out %.d,$(MAKEFILE_LIST)) | fdt_dirs
|
||||||
$${ECHO} " CPP $$<"
|
$${ECHO} " CPP $$<"
|
||||||
$(eval DTBS := $(addprefix $(1)/,$(call SOURCES_TO_DTBS,$(2))))
|
$(eval DTBS := $(addprefix $(1)/,$(call SOURCES_TO_DTBS,$(2))))
|
||||||
$$(Q)$$(PP) $$(DTC_CPPFLAGS) -MT $(DTBS) -MMD -MF $(DTSDEP) -o $(DPRE) $$<
|
$$(Q)$$(CPP) $$(DTC_CPPFLAGS) -MT $(DTBS) -MMD -MF $(DTSDEP) -o $(DPRE) $$<
|
||||||
$${ECHO} " DTC $$<"
|
$${ECHO} " DTC $$<"
|
||||||
$$(Q)$$(DTC) $$(DTC_FLAGS) -d $(DTBDEP) -o $$@ $(DPRE)
|
$$(Q)$$(DTC) $$(DTC_FLAGS) -d $(DTBDEP) -o $$@ $(DPRE)
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
|
# Copyright (c) 2016-2024, Arm Limited and Contributors. All rights reserved.
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
#
|
#
|
||||||
|
@ -40,11 +40,10 @@ LDFLAGS := -Wl,--gc-sections -Wl,--build-id=none
|
||||||
|
|
||||||
# Cross tool
|
# Cross tool
|
||||||
CC := ${M0_CROSS_COMPILE}gcc
|
CC := ${M0_CROSS_COMPILE}gcc
|
||||||
CPP := ${M0_CROSS_COMPILE}cpp
|
CPP := ${M0_CROSS_COMPILE}gcc -E
|
||||||
AR := ${M0_CROSS_COMPILE}ar
|
AR := ${M0_CROSS_COMPILE}gcc-ar
|
||||||
OC := ${M0_CROSS_COMPILE}objcopy
|
OC := ${M0_CROSS_COMPILE}objcopy
|
||||||
OD := ${M0_CROSS_COMPILE}objdump
|
OD := ${M0_CROSS_COMPILE}objdump
|
||||||
NM := ${M0_CROSS_COMPILE}nm
|
|
||||||
|
|
||||||
# NOTE: The line continuation '\' is required in the next define otherwise we
|
# NOTE: The line continuation '\' is required in the next define otherwise we
|
||||||
# end up with a line-feed characer at the end of the last c filename.
|
# end up with a line-feed characer at the end of the last c filename.
|
||||||
|
|
|
@ -113,8 +113,8 @@ $(OUTPUT_FILE_SA6) : $(MEMORY_DEF_SA6) $(OBJ_FILE_SA6)
|
||||||
# Compile
|
# Compile
|
||||||
###################################################
|
###################################################
|
||||||
|
|
||||||
%.o:../%.c
|
%.o: %.c
|
||||||
$(CC) -c -I $< -o $@
|
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
|
|
|
@ -110,8 +110,8 @@ $(OUTPUT_FILE_SA6) : $(MEMORY_DEF_SA6) $(OBJ_FILE_SA6)
|
||||||
# Compile
|
# Compile
|
||||||
###################################################
|
###################################################
|
||||||
|
|
||||||
%.o:../%.c
|
%.o: %.c
|
||||||
$(CC) -c -I $< -o $@
|
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
|
|
Loading…
Add table
Reference in a new issue