8000 Automatic stack location selection (SYS or HEAP), enable per library AR-chive in arduino build system by d-a-v · Pull Request #5018 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content

Automatic stack location selection (SYS or HEAP), enable per library AR-chive in arduino build system #5018

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Aug 20, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
dot_a_linkage=true
  • Loading branch information
d-a-v committed Aug 9, 2018
commit 05b2aeeb203c0e0f8be05a992557f866d4f8dfb1
1 change: 1 addition & 0 deletions libraries/ArduinoOTA/library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ paragraph=With this library you can enable your sketch to be upgraded over netwo
category=Communication
url=
architectures=esp8266
dot_a_linkage=true
1 change: 1 addition & 0 deletions libraries/DNSServer/library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ paragraph=This library implements a simple DNS server.
category=Communication
url=
architectures=esp8266
dot_a_linkage=true
1 change: 1 addition & 0 deletions libraries/EEPROM/library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ paragraph=
category=Data Storage
url=http://arduino.cc/en/Reference/EEPROM
architectures=esp8266
dot_a_linkage=true
1 change: 1 addition & 0 deletions libraries/ESP8266AVRISP/library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ paragraph=This library allows programming 8-bit AVR ICSP targets via TCP over Wi
category=Communication
url=
architectures=esp8266
dot_a_linkage=true
1 change: 1 addition & 0 deletions libraries/ESP8266HTTPClient/library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ paragraph=
category=Communication
url=https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266HTTPClient
architectures=esp8266
dot_a_linkage=true
1 change: 1 addition & 0 deletions libraries/ESP8266HTTPUpdateServer/library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ paragraph=The library accepts HTTP post requests to the /update url, and updates
category=Communication
url=
architectures=esp8266
dot_a_linkage=true
1 change: 1 addition & 0 deletions libraries/ESP8266NetBIOS/library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ paragraph=With this library you can connect to your ESP from Windows using a sho
category=Communication
url=http://www.xpablo.cz/?p=751#more-751
architectures=esp8266
dot_a_linkage=true
1 change: 1 addition & 0 deletions libraries/ESP8266WebServer/library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ paragraph=The library supports HTTP GET and POST requests, provides argument par
category=Communication
url=
architectures=esp8266
dot_a_linkage=true
1 change: 1 addition & 0 deletions libraries/ESP8266WiFi/library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ paragraph=With this library you can instantiate Servers, Clients and send/receiv
category=Communication
url=
architectures=esp8266
dot_a_linkage=true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why these are all being converted to .a. Does this mean anyone providing a library for the 8266 now needs to modify their lib.properties?

Copy link
Collaborator Author
@d-a-v d-a-v Aug 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not mandatory (except for the ESP8266WiFi library). It is not needed by anyone. Such library's object files are stored in an intermediate libraryname.a (the regular way after all) and this one is used instead of all library's object files in the linker command line.
Other libraries not using "dot_a_linkage" are still usable.
I checked with ESP8266Audio (local branch with this PR merged with latest master) and it's OK. I also tried with "dot_a_linkage" in your lib and the final sketch was reduced by 25KB (!).
Not to mention the linker command looking like a real one (with some .a instead of a huge bunch of .o - well, this is minor cosmetic effect, but still :) ).
What I do not understand is why this was not done by default from the beginning in Arduino.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's awesome news! Glad to hear about it, I'll throw it in my own lib as well now...

1 change: 1 addition & 0 deletions libraries/ESP8266WiFiMesh/library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ paragraph=The library sets up a Mesh Node which acts as a router, creating a Mes
category=Communication
url=
architectures=esp8266
dot_a_linkage=true
1 change: 1 addition & 0 deletions libraries/ESP8266httpUpdate/library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ paragraph=
category=Data Processing
url=https://github.com/Links2004/Arduino/tree/esp8266/hardware/esp8266com/esp8266/libraries/ESP8266httpUpdate
architectures=esp8266
dot_a_linkage=true
1 change: 1 addition & 0 deletions libraries/Ethernet/library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ paragraph=With this library you can use the Arduino Ethernet (shield or board) t
category=Communication
url=http://www.arduino.cc/en/Reference/Ethernet
architectures=esp8266
dot_a_linkage=true
1 change: 1 addition & 0 deletions libraries/GDBStub/library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ paragraph=GDB server stub helps debug crashes when JTAG isn't an option.
category=Uncategorized
url=https://github.com/espressif/esp-gdbstub
architectures=esp8266
dot_a_linkage=true
1 change: 1 addition & 0 deletions libraries/Hash/library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ paragraph=
category=Data Processing
url=
architectures=esp8266
dot_a_linkage=true
1 change: 1 addition & 0 deletions libraries/SD/library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ paragraph=Once an SD memory card is connected to the SPI interfare of the Arduin
category=Data Storage
url=http://www.arduino.cc/en/Reference/SD
architectures=esp8266
dot_a_linkage=true
1 change: 1 addition & 0 deletions libraries/SPI/library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ paragraph=
category=Signal Input/Output
url=http://arduino.cc/en/Reference/SPI
architectures=esp8266
dot_a_linkage=true
1 change: 1 addition & 0 deletions libraries/SPISlave/library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ paragraph=
category=Signal Input/Output
url=
architectures=esp8266
dot_a_linkage=true
1 change: 1 addition & 0 deletions libraries/Servo/library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ paragraph=This library can control a great number of servos.<br />It makes caref
category=Device Control
url=http://arduino.cc/en/Reference/Servo
architectures=esp8266
dot_a_linkage=true
1 change: 1 addition & 0 deletions libraries/Ticker/library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ paragraph=
category=Timing
url=
architectures=esp8266
dot_a_linkage=true
1 change: 1 addition & 0 deletions libraries/Wire/library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ paragraph=
category=Signal Input/Output
url=http://arduino.cc/en/Reference/Wire
architectures=esp8266
dot_a_linkage=true
1 change: 1 addition & 0 deletions libraries/esp8266/library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ paragraph=
category=Other
url=
architectures=esp8266
dot_a_linkage=true
6 changes: 4 additions & 2 deletions platform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,12 @@ recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpreprocessor
recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.flags} {compiler.S.flags} -DF_CPU={build.f_cpu} {build.lwip_flags} {build.debug_port} {build.debug_level} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" {build.led} {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"

## Create archives
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/arduino.ar" "{object_file}"
#recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/arduino.ar" "{object_file}"
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"

## Combine gc-sections, archives, and objects
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" -Wl,-Map "-Wl,{build.path}/{build.project_name}.map" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" -Wl,--start-group {object_files} "{build.path}/arduino.ar" {compiler.c.elf.libs} -Wl,--end-group "-L{build.path}"
#recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" -Wl,-Map "-Wl,{build.path}/{build.project_name}.map" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" -Wl,--start-group {object_files} "{build.path}/arduino.ar" {compiler.c.elf.libs} -Wl,--end-group "-L{build.path}"
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" -Wl,-Map "-Wl,{build.path}/{build.project_name}.map" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" -Wl,--start-group {object_files} "{archive_file_path}" "-L{build.path}" {compiler.c.elf.libs} -Wl,--end-group "-L{build.path}"

## Create eeprom
recipe.objcopy.eep.pattern=
Expand Down
1 change: 1 addition & 0 deletions tests/device/libraries/BSTest/library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ paragraph=
category=Uncategorized
url=
architectures=esp8266
dot_a_linkage=true
0