'Where does core.a come from in the Arduino build process?
I am trying to generate a Rust wrapper around an Arduino C++ library (right now I'm targeting Adafruit_NeoPixel) . I have been using strace to figure out what the Arduino IDE execs.
I am currently convinced that core.a is an important part of the process because it shows up in the ld invocation.
2337 execve("/usr/libexec/gcc/avr/ld", ["/usr/libexec/gcc/avr/ld", "-plugin", "/usr/libexec/gcc/avr/11.2.0/liblto_plugin.so", "-plugin-opt=/usr/libexec/gcc/avr/11.2.0/lto-wrapper", "-plugin-opt=-fresolution=/tmp/ccqWVTle.res", "-plugin-opt=-pass-through=-lgcc", "-plugin-opt=-pass-through=-lm", "-plugin-opt=-pass-through=-lc", "-plugin-opt=-pass-through=-latmega328p", "-mavr5", "-Tdata", "0x800100", "-o", "/tmp/arduino_build_966100/sketch_jan13a.ino.elf", "/usr/lib/gcc/avr/11.2.0/../../../../avr/lib/avr5/crtatmega328p.o", "-L/tmp/arduino_build_966100", "-L/usr/lib/gcc/avr/11.2.0/avr5", "-L/usr/lib/gcc/avr/11.2.0/../../../../avr/lib/avr5", "-L/usr/lib/gcc/avr/11.2.0", "-L/usr/lib/gcc/avr/11.2.0/../../../../avr/lib", "--gc-sections", "/tmp/arduino_build_966100/sketch/sketch_jan13a.ino.cpp.o", "/tmp/arduino_build_966100/core/core.a", "-lm", "--start-group", "-lgcc", "-lm", "-lc", "-latmega328p", "--end-group"], 0x12d9410 /* 62 vars */ <unfinished ...>
$ ar t /tmp/arduino_build_966100/core/core.a
wiring_pulse.S.o
WInterrupts.c.o
hooks.c.o
wiring.c.o
wiring_analog.c.o
wiring_digital.c.o
wiring_pulse.c.o
wiring_shift.c.o
CDC.cpp.o
HardwareSerial.cpp.o
HardwareSerial0.cpp.o
HardwareSerial1.cpp.o
HardwareSerial2.cpp.o
HardwareSerial3.cpp.o
IPAddress.cpp.o
PluggableUSB.cpp.o
Print.cpp.o
Stream.cpp.o
Tone.cpp.o
USBCore.cpp.o
WMath.cpp.o
WString.cpp.o
abi.cpp.o
main.cpp.o
new.cpp.o
It appears in the /tmp/arduino_build_* sketch build directory, but I am not sure where it comes from. I can not find it in /usr/share/arduino.
How is core.a created?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
