You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently when one need to debug code with full
debugging symbols (including access to macros -g3) then
the linker fails because adding -g3 causes that preprocessed
{preprocld.filepath} file contains a series of #define like:
#define __STDC__ 1
#define __STDC_VERSION__ 201112L
#define __STDC_UTF_16__ 1
#define __STDC_UTF_32__ 1
#define __STDC_HOSTED__ 1
#define __GNUC__ 7
#define __GNUC_MINOR__ 4
#define __GNUC_PATCHLEVEL__ 0
#define __VERSION__ "7.4.0"
#define __ATOMIC_RELAXED 0
#define __ATOMIC_SEQ_CST 5
#define __ATOMIC_ACQUIRE 2
#define __ATOMIC_RELEASE 3
...
which later on causes the linker to not accept such a file:
/usr/lib/gcc/arm-none-eabi/7.4.0/../../../../arm-none-eabi/bin/ld:/home/sw/Arduino/DS18B20Test/.build/preproc.ld:1: ignoring invalid character `#' in expression
/usr/lib/gcc/arm-none-eabi/7.4.0/../../../../arm-none-eabi/bin/ld:/home/sw/Arduino/DS18B20Test/.build/preproc.ld:1: syntax error
The fix removes entirely preprocessing of linker file operation step
and passes an appropriate value of the symbol directly to the linker
using: -Wl,--defsym= option.
Log excerpt:
Linking everything together...
"/usr/bin/arm-none-eabi-gcc" -mcpu=cortex-m3 -mthumb -Os --specs=nano.specs -Wl,--defsym=LD_MAX_SIZE=131072 -Wl,--defsym=LD_MAX_DATA_SIZE=20480
Signed-off-by: Damian Wrobel <[email protected]>
0 commit comments