mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 19:07:45 +08:00
Build system:Board level control of no-unaligned-access
This commit is contained in:
committed by
Daniel Agar
parent
af9f8f08c6
commit
e2b4e435a9
@@ -30,3 +30,12 @@ config BOARD_USE_PROBES
|
|||||||
---help---
|
---help---
|
||||||
Select to use GPIO FMU-CH1-8, as PROBE_1-8 to provide timing signals
|
Select to use GPIO FMU-CH1-8, as PROBE_1-8 to provide timing signals
|
||||||
from selected drivers.
|
from selected drivers.
|
||||||
|
|
||||||
|
config BOARD_FORCE_ALIGNMENT
|
||||||
|
bool "Forces all acesses to be Aligned"
|
||||||
|
default n
|
||||||
|
|
||||||
|
---help---
|
||||||
|
Adds -mno-unaligned-access to build flags. to force alignment.
|
||||||
|
This can be needed if data is stored in a region of memory, that
|
||||||
|
is Strongly ordered and dcache is off.
|
||||||
|
|||||||
@@ -116,6 +116,11 @@ FLAGS = $(MAXOPTIMIZATION) -g2 \
|
|||||||
|
|
||||||
FLAGS += $(EXTRAFLAGS)
|
FLAGS += $(EXTRAFLAGS)
|
||||||
|
|
||||||
|
# force alignment
|
||||||
|
ifeq ($(CONFIG_BOARD_FORCE_ALIGNMENT),y)
|
||||||
|
FLAGS += -mno-unaligned-access
|
||||||
|
endif
|
||||||
|
|
||||||
# enable precise stack overflow tracking
|
# enable precise stack overflow tracking
|
||||||
ifeq ($(CONFIG_ARMV7M_STACKCHECK),y)
|
ifeq ($(CONFIG_ARMV7M_STACKCHECK),y)
|
||||||
FLAGS += -finstrument-functions -ffixed-r10
|
FLAGS += -finstrument-functions -ffixed-r10
|
||||||
|
|||||||
@@ -86,6 +86,13 @@ function(px4_os_add_flags)
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if("${CONFIG_BOARD_FORCE_ALIGNMENT}" STREQUAL "y")
|
||||||
|
message(STATUS "Board forcing alignment")
|
||||||
|
add_compile_options(
|
||||||
|
-mno-unaligned-access
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user