Closed PvdBerg1998 closed 5 years ago
Hi,
At the variable in the archive group of the combine recipe. -Wl,--start-group {object_files} "{archive_file_path}" {compiler.libraries.ldflags} -Wl,--end-group
For anyone stumbling upon this issue, the final section is:
## Combine gc-sections, archives, and objects
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mcpu={build.mcu} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -lm {compiler.libraries.ldflags} -lgcc -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group {object_files} "{archive_file_path}" {compiler.libraries.ldflags} -Wl,--end-group
@kgoveas Thank you so much, it's working now. ❤️
I'm trying to use a precompiled library (written in Rust, detail here https://rust-embedded.github.io/book/interoperability/rust-with-c.html). This should all be set up properly and generate a correct static library.
I'm using a Maple Mini, so I compile my Rust code for
thumbv7m-none-eabi
. This generates alib<name>.a
file which I placed inside my library folder:The
library.properties
file includes the flags:However, this doesn't even add the set linker flag to the verbose compiler output I see in the Arduino IDE. After some googling I found that the
platform.txt
may not include this flag, so I added it toArduino/hardware/Arduino_STM32/STM32F1/platform.txt
:Notice the
{compiler.libraries.ldflags}
. This does pass the flag correctly.The structure of the library is exactly the same as the library https://github.com/BoschSensortec/BSEC-Arduino-library.
Result of this adventure:
I'm getting extremely frustrated by this issue, I hope someone can help me out.