Skip to content

compiler.c.elf.extra_flags is in the wrong place - precompiled libs, ldflags #46

Open
@kgoveas

Description

@kgoveas

In platform.txt, the recipe for combining the elf file is incorrect. It should be placed before the linker flags for other static libraries like below.

Background:
In order for the arduino-builder to be able to use precompiled libs, the ldflags are loaded into compiler.c.elf.extra_flags (as per @facchinm 's commits in March 2017).

As per ld conventions, one should list the linker flags at the end. This stackoverflow issue highlights a case.

## Combine gc-sections, archives, and objects
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}"  "-L{build.path}" {compiler.c.elf.flags} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" --specs=nano.specs --specs=nosys.specs {compiler.ldflags} -o "{build.path}/{build.project_name}.elf" {object_files} -Wl,--start-group {compiler.arm.cmsis.ldflags} {compiler.c.elf.extra_flags} -lm "{build.path}/{archive_file}" -Wl,--end-group

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions