diff --git a/Makefile b/Makefile index fa9ae5513..de2e59e67 100644 --- a/Makefile +++ b/Makefile @@ -50,7 +50,7 @@ CFLAGS_BASE += -Wall -Wundef -Wextra -Werror -Wno-unused-parameter -Wno-stringop CFLAGS_COMMON := $(CFLAGS_BASE) # Linker options -LDFLAGS_COMMON := -specs=nano.specs $(LIBS) -Wl,--gc-sections -Wl,--print-memory-usage +LDFLAGS_COMMON := -specs=nano.specs $(LIBS) -Wl,--gc-sections -Wl,--print-memory-usage -Wl,--no-warn-rwx-segments # Search source files SRC_COMMON := $(foreach dir,$(SRC_DIRS_COMMON),$(wildcard $(dir)/*.[cs])) diff --git a/Src/dummy_syscalls.c b/Src/dummy_syscalls.c new file mode 100644 index 000000000..56c2fb0d9 --- /dev/null +++ b/Src/dummy_syscalls.c @@ -0,0 +1,8 @@ +/* + dummy system calls to avoid linker errors with gcc 14.x + */ + +int _close_r(void) { return -1; } +int _lseek_r(void) { return -1; } +int _read_r(void) { return -1; } +int _write_r(void) { return -1; } diff --git a/Src/main.c b/Src/main.c index 85884e3d4..2914440b5 100644 --- a/Src/main.c +++ b/Src/main.c @@ -1591,6 +1591,9 @@ static void checkDeviceInfo(void) #define DEVINFO_MAGIC1 0x5925e3da #define DEVINFO_MAGIC2 0x4eb863d9 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Warray-bounds" + const struct devinfo { uint32_t magic1; uint32_t magic2; @@ -1614,6 +1617,7 @@ static void checkDeviceInfo(void) break; } +#pragma GCC diagnostic pop // TODO: check pin code and reboot to bootloader if incorrect } diff --git a/make/tools.mk b/make/tools.mk index 46395a23d..9de24b47c 100644 --- a/make/tools.mk +++ b/make/tools.mk @@ -4,9 +4,10 @@ # ############################################################### +GCC_VERSION:=14.2.1-1.1 ifeq ($(OS),Windows_NT) -ARM_SDK_PREFIX:=tools/windows/xpack-arm-none-eabi-gcc-10.3.1-2.3/bin/arm-none-eabi- +ARM_SDK_PREFIX:=tools/windows/xpack-arm-none-eabi-gcc-$(GCC_VERSION)/bin/arm-none-eabi- SHELL:=cmd.exe CP:=tools\\windows\\make\\bin\\cp DSEP:=\\ @@ -20,7 +21,7 @@ else # MacOS and Linux UNAME_S := $(shell uname -s) ifeq ($(UNAME_S),Darwin) -ARM_SDK_PREFIX:=tools/macos/xpack-arm-none-eabi-gcc-10.3.1-2.3/bin/arm-none-eabi- +ARM_SDK_PREFIX:=tools/macos/xpack-arm-none-eabi-gcc-$(GCC_VERSION)/bin/arm-none-eabi- CP:=cp DSEP:=/ NUL:=/dev/null @@ -30,7 +31,7 @@ CUT:=cut FGREP:=fgrep else # assume Linux -ARM_SDK_PREFIX:=tools/linux/xpack-arm-none-eabi-gcc-10.3.1-2.3/bin/arm-none-eabi- +ARM_SDK_PREFIX:=tools/linux/xpack-arm-none-eabi-gcc-$(GCC_VERSION)/bin/arm-none-eabi- CP:=cp DSEP:=/ NUL:=/dev/null