Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
de155790
Commit
de155790
authored
Dec 11, 2020
by
Manish Pandey
Committed by
TrustedFirmware Code Review
Dec 11, 2020
Browse files
Merge "TF-A: Add build option for Arm Feature Modifiers" into integration
parents
bd054fd6
f1821790
Changes
3
Show whitespace changes
Inline
Side-by-side
Makefile
View file @
de155790
...
...
@@ -185,13 +185,14 @@ target32-directive = -target arm-none-eabi
else
target32-directive
=
-target
armv8a-none-eabi
# Set the compiler's target architecture profile based on ARM_ARCH_MINOR option
# Set the compiler's target architecture profile based on
# ARM_ARCH_MAJOR ARM_ARCH_MINOR options
ifeq
(${ARM_ARCH_MINOR},0)
march32-directive
=
-march
=
armv
8
-a
march64-directive
=
-march
=
armv
8
-a
march32-directive
=
-march
=
armv
${ARM_ARCH_MAJOR}
-a
march64-directive
=
-march
=
armv
${ARM_ARCH_MAJOR}
-a
else
march32-directive
=
-march
=
armv
8
.
${ARM_ARCH_MINOR}
-a
march64-directive
=
-march
=
armv
8
.
${ARM_ARCH_MINOR}
-a
march32-directive
=
-march
=
armv
${ARM_ARCH_MAJOR}
.
${ARM_ARCH_MINOR}
-a
march64-directive
=
-march
=
armv
${ARM_ARCH_MAJOR}
.
${ARM_ARCH_MINOR}
-a
endif
endif
...
...
@@ -203,23 +204,43 @@ mem_tag_arch_support = yes
endif
endif
# Enabled required option for memory stack tagging. Currently, these options are
# enabled only for clang and armclang compiler.
# Get architecture feature modifiers
arch-features
=
${ARM_ARCH_FEATURE}
# Enable required options for memory stack tagging.
# Currently, these options are enabled only for clang and armclang compiler.
ifeq
(${SUPPORT_STACK_MEMTAG},yes)
ifdef
mem_tag_arch_support
# Check for armclang and clang compilers
ifneq
( ,$(filter $(notdir $(CC)),armclang clang))
march64-directive
=
-march
=
armv
${ARM_ARCH_MAJOR}
.
${ARM_ARCH_MINOR}
-a
+memtag
# Add "memtag" architecture feature modifier if not specified
ifeq
( ,$(findstring memtag,$(arch-features)))
arch-features
:=
$
(
arch-features
)
+memtag
endif
# memtag
ifeq
($(notdir $(CC)),armclang)
TF_CFLAGS
+=
-mmemtag-stack
else
ifeq
($(notdir $(CC)),clang)
TF_CFLAGS
+=
-fsanitize
=
memtag
endif
endif
endif
# armclang
endif
# armclang clang
else
$(error "Error
:
stack memory tagging is not supported for architecture
\
${ARCH}
,
armv${ARM_ARCH_MAJOR}.${ARM_ARCH_MINOR}-a")
endif
# mem_tag_arch_support
endif
# SUPPORT_STACK_MEMTAG
# Set the compiler's architecture feature modifiers
ifneq
($(arch-features), none)
# Strip "none+" from arch-features
arch-features
:=
$(
subst
none+,,
$
(
arch-features
))
ifeq
($(ARCH), aarch32)
march32-directive
:=
$
(
march32-directive
)
+
$
(
arch-features
)
else
march64-directive
:=
$
(
march64-directive
)
+
$
(
arch-features
)
endif
endif
# Print features
$(info Arm Architecture Features specified
:
$(subst +
,
,
$(arch-features)))
endif
# arch-features
ifneq
($(findstring armclang,$(notdir $(CC))),)
TF_CFLAGS_aarch32
=
-target
arm-arm-none-eabi
$
(
march32-directive
)
...
...
docs/getting_started/build-options.rst
View file @
de155790
...
...
@@ -26,6 +26,12 @@ Common build options
``aarch64`` or ``aarch32`` as values. By default, it is defined to
``aarch64``.
- ``ARM_ARCH_FEATURE``: Optional Arm Architecture build option which specifies
one or more feature modifiers. This option has the form ``[no]feature+...``
and defaults to ``none``. It translates into compiler option
``-march=armvX[.Y]-a+[no]feature+...``. See compiler'
s
documentation
for
the
list
of
supported
feature
modifiers
.
-
``
ARM_ARCH_MAJOR
``:
The
major
version
of
Arm
Architecture
to
target
when
compiling
TF
-
A
.
Its
value
must
be
numeric
,
and
defaults
to
8
.
See
also
,
*
Armv8
Architecture
Extensions
*
and
*
Armv7
Architecture
Extensions
*
in
...
...
make_helpers/defaults.mk
View file @
de155790
...
...
@@ -19,6 +19,9 @@ AARCH32_SP := none
# The Target build architecture. Supported values are: aarch64, aarch32.
ARCH
:=
aarch64
# ARM Architecture feature modifiers: none by default
ARM_ARCH_FEATURE
:=
none
# ARM Architecture major and minor versions: 8.0 by default.
ARM_ARCH_MAJOR
:=
8
ARM_ARCH_MINOR
:=
0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment