DAPLink icon indicating copy to clipboard operation
DAPLink copied to clipboard

Support for newer versions of GNU Arm Embedded Toolchain

Open mathias-arm opened this issue 1 year ago • 0 comments

There are two link-time issues with newer versions of arm-none-eabi-gcc

The first one is related to some missing symbols:

[...]/libc_nano.a(libc_a-closer.o): in function `_close_r':
[...]/closer.c:47: warning: _close is not implemented and will always fail
[...]/libc_nano.a(libc_a-lseekr.o): in function `_lseek_r':
[...]/lseekr.c:49: warning: _lseek is not implemented and will always fail
[...]/libc_nano.a(libc_a-readr.o): in function `_read_r':
[...]/readr.c:49: warning: _read is not implemented and will always fail
[...]/libc_nano.a(libc_a-writer.o): in function `_write_r':
[...]/writer.c:49: warning: _write is not implemented and will always fail

A work-around for this issue is to add the following lines in a .c file (e.g. source/daplink/sdk_stub.c):

void _close_r(void) {}
void _lseek_r(void) {}
void _read_r(void) {}
void _write_r(void) {}

The other issue relates to the permission of the RAM segment (needed in some cases for RAM functions when writing to flash):

warning: build/xxxxx.elf has a LOAD segment with RWX permissions

The work-around is add -Wl,--no-warn-rwx-segment to ld_flags in records/tools/gcc_arm.yaml. This is not a solution we could just merge because the flag is not supported by older versions of arm-none-eabi-gcc. Another alternative would be to remove -Werror, but that seems even worse.

mathias-arm avatar Aug 03 '23 03:08 mathias-arm