bsd.cpu.mk: Add a workaround for erratum 843419

Add a workaround for the Arm Cortex-A53 erratum 843419. This has been
targeted when the build is either unoptimised for any CPU/architecture
or targets the Cortex-A53 or ARMv8.0 architecture.

PR:		296240
PR:		296395
Reported by:	Hal Murray <[email protected]>
Reported by:	Andreas Schuh <[email protected]>
Reviewed by:	cognet, mmel
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D58212
This commit is contained in:
Andrew Turner committed 2026-07-14 16:47:15 +01:00
1 parent 4c9f648852
commit f1e8b0ff4e
1 file changed
+17 -1
+17 -1
View File
@@ -6,7 +6,7 @@
.if !defined(CPUTYPE) || empty(CPUTYPE)
_CPUCFLAGS =
. if ${MACHINE_CPUARCH} == "aarch64"
MACHINE_CPU = arm64
MACHINE_CPU = arm64 cortexa53
. elif ${MACHINE_CPUARCH} == "amd64"
MACHINE_CPU = amd64 sse2 sse mmx
. elif ${MACHINE_CPUARCH} == "arm"
@@ -124,6 +124,14 @@ _CPUCFLAGS = -mcpu=${CPUTYPE}
. elif ${MACHINE_ARCH:Mpowerpc64*} != ""
_CPUCFLAGS = -mcpu=${CPUTYPE}
. elif ${MACHINE_CPUARCH} == "aarch64"
MACHINE_CPU = arm64
. if ${CPUTYPE} == "generic"
MACHINE_CPU += cortexa53
. elif ${CPUTYPE} == "armv8-a"
MACHINE_CPU += cortexa53
. elif ${CPUTYPE:M*cortex-a53*} != ""
MACHINE_CPU += cortexa53
. endif
. if ${CPUTYPE:Marmv*} != ""
# Use -march when the CPU type is an architecture value, e.g. armv8.1-a
_CPUCFLAGS = -march=${CPUTYPE}
@@ -302,6 +310,14 @@ MACHINE_CPU = riscv
. endif
.endif
########## arm64/aarch64
.if ${MACHINE_CPUARCH} == "aarch64"
# Add the Cortex-A53 erratum 843419 workaround if we are targeting it.
. if ${MACHINE_CPU:Mcortexa53} != ""
LDFLAGS += -Wl,--fix-cortex-a53-843419
. endif
.endif
########## arm
.if ${MACHINE_CPUARCH} == "arm"
MACHINE_CPU += arm