diff --git a/docs/datasheet/software.adoc b/docs/datasheet/software.adoc index 0fa88c52..0b43a155 100644 --- a/docs/datasheet/software.adoc +++ b/docs/datasheet/software.adoc @@ -265,6 +265,8 @@ The following default compiler flags are used for compiling an application. Thes | `-lgcc` | Make sure we have no unresolved references to internal GCC library subroutines. | `-mno-fdiv` | Use built-in software functions for floating-point divisions and square roots (since the according instructions are not supported yet). | `-g` | Include debugging information/symbols in ELF. +| `-mstrict-align` | Unaligned memory accesses cannot be resolved by the hardware and require emulation. +| `-mbranch-cost=...` | Branches cost a lot cycles on a multi-cycle architecture. |======================= :sectnums: diff --git a/sw/common/common.mk b/sw/common/common.mk index a4ff9cfb..b051161f 100644 --- a/sw/common/common.mk +++ b/sw/common/common.mk @@ -130,7 +130,7 @@ IMAGE_GEN = $(NEORV32_EXG_PATH)/image_gen # Compiler & linker flags CC_OPTS = -march=$(MARCH) -mabi=$(MABI) $(EFFORT) -Wall -ffunction-sections -fdata-sections -nostartfiles -mno-fdiv -CC_OPTS += -g -Wl,--gc-sections +CC_OPTS += -mstrict-align -mbranch-cost=10 -g -Wl,--gc-sections CC_OPTS += $(USER_FLAGS) LD_LIBS = -lm -lc -lgcc LD_LIBS += $(USER_LIBS)