Skip to content

Arduino library.properties dot_a_linkage does not (quite) work #1049

Closed
@timr49

Description

@timr49

Hardware:

Board: Sparkfun ESP32 Thing
Core Installation/update date: 30/Jan/2018
IDE name: Arduino IDE
Flash Frequency: 80Mhz
Upload Speed: 921600

Description:

From "Arduino IDE 1.5: Library specification" https://github.com/arduino/arduino/wiki/arduino-ide-1.5:-library-specification ...
"... dot_a_linkage - (available from IDE 1.6.0 / arduino-builder 1.0.0-beta13) when set to true, the library will be compiled using a .a (archive) file. First, all source files are compiled into .o files as normal. Then instead of including all .o files in the linker command directly, all .o files are saved into a .a file, which is then included in the linker command. 1.5 format library folder structure is required."

If this option is used with the ESP32 Arduino IDE, the linker fails with:

.../arduino_build_10463/libraries/LIBRARY/LIBRARY.a: No such file or directory

Inspecting the build directory shows that the .o files have been added to the arduino.ar file

$ ar t arduino.ar
LIBRARY.cpp.o
esp32-hal-adc.c.o
...
main.cpp.o

but the linker error message (above) suggests that it is expecting to find them in a libraries/LIBRARY/LIBRARY.a file, which does not exist.

If you create either a dummy LIBRARY.a file
ar c LIBRARY.a
or a LIBRARY.a file containing the .o files
ar c LIBRARY.a *.o
in the library/LIBRARY directory and then recompile, it successfully links.

Sketch:

#include <LIBRARY.h>
void setup() {
  // put your setup code here, to run once:
}
void loop() {
  // put your main code here, to run repeatedly:
}

Debug Messages:

xtensa-esp32-elf-gcc: error: /var/folders/5k/v4z291_x3sd08tt8ldfb34km0000gn/T/arduino_build_10463/libraries/LIBRARY/LIBRARY.a: No such file or directory
Using library LIBRARY at version 1.0.0 in folder: /Users/tim/Repositories/sam/src/Arduino/libraries/LIBRARY 
exit status 1
Error compiling for board SparkFun ESP32 Thing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: StaleIssue is stale stage (outdated/stuck)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions