Skip to content
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

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

Open
kgoveas opened this issue Nov 17, 2017 · 0 comments

Comments

@kgoveas
Copy link

kgoveas commented Nov 17, 2017

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant