From afc2ecaf819f14a92a180a36d28b1d23571742bc Mon Sep 17 00:00:00 2001 From: Marcel Licence Date: Sat, 27 Nov 2021 10:24:17 +0100 Subject: [PATCH 1/3] compiler.libraries.ldflags= was missing, generating an error when trying to link precompiled libraries. This line is required to be compatible with the Arduino library specification --- platform.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/platform.txt b/platform.txt index 9f823d2c99..4ff98e6f69 100644 --- a/platform.txt +++ b/platform.txt @@ -93,6 +93,7 @@ compiler.cpp.extra_flags= compiler.ar.extra_flags= compiler.objcopy.eep.extra_flags= compiler.elf2hex.extra_flags= +compiler.libraries.ldflags= ## generate file with git version number ## needs git From 425473630bf970c63df066cd9df2ca8283c8b26b Mon Sep 17 00:00:00 2001 From: Marcel Licence Date: Tue, 30 Nov 2021 12:59:37 +0100 Subject: [PATCH 2/3] Add {compiler.libraries.ldflags} to recipe.c.combine.pattern expression --- platform.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.txt b/platform.txt index 4ff98e6f69..ee088a8b2c 100644 --- a/platform.txt +++ b/platform.txt @@ -120,7 +120,7 @@ recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.fla 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}" {build.exception_flags} -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}" {compiler.c.elf.libs} -Wl,--end-group "-L{build.path}" +recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {build.exception_flags} -Wl,-Map "-Wl,{build.path}/{build.project_name}.map" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} {compiler.libraries.ldflags} -o "{build.path}/{build.project_name}.elf" -Wl,--start-group {object_files} "{archive_file_path}" {compiler.c.elf.libs} -Wl,--end-group "-L{build.path}" ## Create eeprom recipe.objcopy.eep.pattern= From 70f38c372e22a6084de8f08a7ee32aca760cf06d Mon Sep 17 00:00:00 2001 From: Maxim Prokhorov Date: Thu, 2 Dec 2021 23:39:46 +0300 Subject: [PATCH 3/3] add comment, expand var inside of the link-group --- platform.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/platform.txt b/platform.txt index ee088a8b2c..a7fd631a5e 100644 --- a/platform.txt +++ b/platform.txt @@ -58,6 +58,9 @@ compiler.sdk.path={runtime.platform.path}/tools/sdk compiler.libc.path={runtime.platform.path}/tools/sdk/libc/xtensa-lx106-elf compiler.cpreprocessor.flags=-D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -D_GNU_SOURCE "-I{compiler.sdk.path}/include" "-I{compiler.sdk.path}/{build.lwip_include}" "-I{compiler.libc.path}/include" "-I{build.path}/core" +# support precompiled libraries in IDE v1.8.6+ +compiler.libraries.ldflags= + compiler.c.cmd=xtensa-lx106-elf-gcc compiler.c.flags=-c {compiler.warning_flags} -std=gnu17 {build.stacksmash_flags} -Os -g -free -fipa-pta -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -falign-functions=4 -MMD -ffunction-sections -fdata-sections {build.exception_flags} {build.sslflags} {build.mmuflags} {build.non32xferflags} @@ -93,7 +96,6 @@ compiler.cpp.extra_flags= compiler.ar.extra_flags= compiler.objcopy.eep.extra_flags= compiler.elf2hex.extra_flags= -compiler.libraries.ldflags= ## generate file with git version number ## needs git @@ -120,7 +122,7 @@ recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.fla 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}" {build.exception_flags} -Wl,-Map "-Wl,{build.path}/{build.project_name}.map" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} {compiler.libraries.ldflags} -o "{build.path}/{build.project_name}.elf" -Wl,--start-group {object_files} "{archive_file_path}" {compiler.c.elf.libs} -Wl,--end-group "-L{build.path}" +recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {build.exception_flags} -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}" {compiler.c.elf.libs} {compiler.libraries.ldflags} -Wl,--end-group "-L{build.path}" ## Create eeprom recipe.objcopy.eep.pattern=