Closed cdupont closed 3 years ago
I made some progress by adding --plugin liblto_plugin.so
on the ar commands:
/home/cdupont/.arduino15/packages//arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-ar rcs build-mkrnb1500/libcore.a (...) --plugin /home/cdupont/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/lib/gcc/arm-none-eabi/7.2.1/liblto_plugin.s
This way ar
runs without complaining.
For the last step, I have to change arm-none-eabi-gcc
with arm-none-eabi-g++
:
/home/cdupont/.arduino15/packages//arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-g++ (...)
With that, I get the "elf" file. How to make those changes automatic?
Are you using the latest commit in this repository? gcc
was swapped for g++
as the linker in this PR https://github.com/sudar/Arduino-Makefile/pull/645
Also, are you able to compile the ZeroBlink example? itoa.c is compiled as part of the SAMD core. I just re-tested and verified this:
packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-ar rcs build-arduino_zero_native/libcore.a build-arduino_zero_native/core/variant.cpp.o build-arduino_zero_native/core/WInterrupts.c.o build-arduino_zero_native/core/cortex_handlers.c.o build-arduino_zero_native/core/delay.c.o build-arduino_zero_native/core/hooks.c.o build-arduino_zero_native/core/itoa.c.o build-arduino_zero_native/core/pulse.c.o build-arduino_zero_native/core/startup.c.o build-arduino_zero_native/core/wiring.c.o build-arduino_zero_native/core/wiring_analog.c.o build-arduino_zero_native/core/wiring_digital.c.o build-arduino_zero_native/core/wiring_private.c.o build-arduino_zero_native/core/wiring_shift.c.o build-arduino_zero_native/core/avr/dtostrf.c.o build-arduino_zero_native/core/USB/samd21_host.c.o build-arduino_zero_native/core/IPAddress.cpp.o build-arduino_zero_native/core/Print.cpp.o build-arduino_zero_native /core/Reset.cpp.o build-arduino_zero_native/core/SERCOM.cpp.o build-arduino_zero_native/core/Stream.cpp.o build-arduino_zero_native/core/Tone.cpp.o build-arduino_zero_native/core/Uart.cpp.o build-arduino_zero_native/core/WMath.cpp.o build-arduino_zero_native/core/WString.cpp.o build-arduino_zero_native/core/abi.cpp.o build-arduino_zero_native/core/main.cpp.o build-arduino_zero_native/core/new.cpp.o build-arduino_zero_native/core/USB/CDC.cpp.o build-arduino_zero_native/core/USB/PluggableUSB.cpp.o build-arduino_zero_native/core/USB/USBCore.cpp.o build-arduino_zero_native/core/pulse_asm.S.o
I've also confirmed the IDE doesn't add this flag so I'm not sure what is going on here.
Yes, that's great, using the latest source of this repository solved the problem. Let me close this issue.
I am trying to compile with Arduino MKR NB 1500. Here is my Makefile:
I get the following errors (pruned for readability):
I suspect I need this "plugin to handle lto objects". What is it? Thanks for the help!