mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-17 01:54:22 +00:00
build: always use the C compiler to preprocess
We're a bit inconsistent about which tool we use to preprocess source files; in some places we use `$(CC) -E` whilst in others we use `cpp`. This change forces all invocations of the C preprocessor to use the first scheme, which ensures that the preprocessor behaves the same way as the C compiler used when compiling C source files. Change-Id: Iede2f25ff86ea8b43d7a523e32648058d5023832 Signed-off-by: Chris Kay <chris.kay@arm.com>
This commit is contained in:
parent
e068a7ca86
commit
781cb31439
4 changed files with 8 additions and 10 deletions
6
Makefile
6
Makefile
|
@ -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
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
#
|
#
|
||||||
|
@ -100,14 +100,13 @@ 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}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
|
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 +186,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)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# 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
|
||||||
#
|
#
|
||||||
|
@ -8,7 +8,7 @@ AS = $(CROSS_COMPILE)as
|
||||||
AR = $(CROSS_COMPILE)ar
|
AR = $(CROSS_COMPILE)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
|
||||||
|
|
|
@ -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
|
||||||
#
|
#
|
||||||
|
@ -658,7 +658,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,7 +40,7 @@ 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}ar
|
||||||
OC := ${M0_CROSS_COMPILE}objcopy
|
OC := ${M0_CROSS_COMPILE}objcopy
|
||||||
OD := ${M0_CROSS_COMPILE}objdump
|
OD := ${M0_CROSS_COMPILE}objdump
|
||||||
|
|
Loading…
Add table
Reference in a new issue