From 596f2dc79456aac323a4624861881520b1e6431b Mon Sep 17 00:00:00 2001 From: per1234 Date: Sun, 19 Jul 2020 17:04:34 -0700 Subject: [PATCH] Document compiler.libraries.ldflags property in platform specification --- docs/platform-specification.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/platform-specification.md b/docs/platform-specification.md index 3f96c7f3858..90db7c2f634 100644 --- a/docs/platform-specification.md +++ b/docs/platform-specification.md @@ -189,16 +189,23 @@ The recipe can be built concatenating the following automatically generated prop - `{archive_file_path}`: fully qualified archive file (ex. "/path/to/core.a"). This property was added in Arduino IDE 1.6.6/arduino builder 1.0.0-beta12 as a replacement for `{build.path}/{archive_file}`. - `{archive_file}`: the name of the core archive file (ex. "core.a") +- `{compiler.libraries.ldflags}`: the linking flags for precompiled libraries, which consist of automatically generated + `-L` flags for the library path and `-l` flags for library files, as well as any custom flags provided via the + `ldflags` field of library.properties. In order to support precompiled libraries, platform.txt must contain a + definition of `compiler.libraries.ldflags`, to which any automatically generated flags will be appended. Support for + precompiled libraries was added in Arduino IDE 1.8.6/arduino-builder 1.4.0. For example the following is used for AVR: compiler.c.elf.flags=-Os -Wl,--gc-sections compiler.c.elf.cmd=avr-gcc + compiler.libraries.ldflags= + [......] ## Combine gc-sections, archives, and objects - recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mmcu={build.mcu} -o "{build.path}/{build.project_name}.elf" {object_files} "{archive_file_path}" "-L{build.path}" -lm + recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mmcu={build.mcu} -o "{build.path}/{build.project_name}.elf" {object_files} {compiler.libraries.ldflags} "{archive_file_path}" "-L{build.path}" -lm #### Recipes for extraction of executable files and other binary data