fix(build): march handling with arch-features

Currently all march compiler option handling is moved to build
utility in march.mk.

We pass arch-features to build which appends to march options,
so this should be done once we decide march options and moving
it to march.mk file.

Change-Id: Ifaf99af5f371fd28db376a12657ccf4f363295c2
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
This commit is contained in:
Govindraj Raja 2024-01-23 16:00:19 -06:00
parent 2a71f1633c
commit 7275ac2af8
2 changed files with 11 additions and 12 deletions

View file

@ -160,15 +160,6 @@ endif #(ARM_ARCH_MAJOR)
################################################################################
arch-features = ${ARM_ARCH_FEATURE}
# Set the compiler's architecture feature modifiers
ifneq ($(arch-features), none)
# Strip "none+" from arch-features
arch-features := $(subst none+,,$(arch-features))
march-directive := $(march-directive)+$(arch-features)
# Print features
$(info Arm Architecture Features specified: $(subst +, ,$(arch-features)))
endif #(arch-features)
ifneq ($(findstring clang,$(notdir $(CC))),)
ifneq ($(findstring armclang,$(notdir $(CC))),)
TF_CFLAGS_aarch32 := -target arm-arm-none-eabi
@ -232,8 +223,6 @@ endif #(AARCH32_INSTRUCTION_SET)
TF_CFLAGS_aarch32 += -mno-unaligned-access
TF_CFLAGS_aarch64 += -mgeneral-regs-only -mstrict-align
ASFLAGS += $(march-directive)
##############################################################################
# WARNINGS Configuration
###############################################################################
@ -691,6 +680,7 @@ endif
include ${MAKE_HELPERS_DIRECTORY}march.mk
TF_CFLAGS += $(march-directive)
ASFLAGS += $(march-directive)
# This internal flag is common option which is set to 1 for scenarios
# when the BL2 is running in EL3 level. This occurs in two scenarios -

View file

@ -1,5 +1,5 @@
#
# Copyright (c) 2023, Arm Limited. All rights reserved.
# Copyright (c) 2023-2024, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@ -82,4 +82,13 @@ endif # not clang
march-directive := -march=${provided-march}
# Set the compiler's architecture feature modifiers
ifneq ($(arch-features), none)
# Strip "none+" from arch-features
arch-features := $(subst none+,,$(arch-features))
march-directive := $(march-directive)+$(arch-features)
# Print features
$(info Arm Architecture Features specified: $(subst +, ,$(arch-features)))
endif #(arch-features)
endif # MARCH_DIRECTIVE