Skip to content

Commit 8453e39

Browse files
keith-packardstephanosio
authored andcommitted
riscv: Change default to -mstrict-align
Zephyr doesn't provide support for handling unaligned access exceptions, so we need to make the default compiler setting avoid generating any. Signed-off-by: Keith Packard <[email protected]>
1 parent 24d48cb commit 8453e39

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

gcc/config/riscv/riscv.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ along with GCC; see the file COPYING3. If not see
3030
/* Target CPU builtins. */
3131
#define TARGET_CPU_CPP_BUILTINS() riscv_cpu_cpp_builtins (pfile)
3232

33+
/* Zephyr toolchain wants strict aligned accesses by default */
34+
#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT | MASK_STRICT_ALIGN)
35+
3336
#ifdef TARGET_BIG_ENDIAN_DEFAULT
3437
#define DEFAULT_ENDIAN_SPEC "b"
3538
#else

0 commit comments

Comments
 (0)