Skip to content

Allow user overrides of LINKER_SCRIPT Make variable #3594

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 3 commits into from
Jan 26, 2017

Conversation

nuket
Copy link
Contributor

@nuket nuket commented Jan 17, 2017

Description

Allow LINKER_SCRIPT overrides via:

make LINKER_SCRIPT=something.ld -f Makefile

The user can then set aside a block of flash memory for production config data by customizing the linker script like so: https://vilimpoc.org/blog/2016/12/25/flash-based-configuration-data-using-the-ld-linker/

@theotherjimmy
Copy link
Contributor

So, I take it that make LINKER_SCRIPT=something.ld does not work out of the box?

LINKER_SCRIPT := {{linker_script}}
endif
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's not reinvent the wheel here. this whole block is equal to

LINKER_SCRIPT ?= {{linker_script}}

https://www.gnu.org/software/make/manual/make.html#Setting

@nuket
Copy link
Contributor Author

nuket commented Jan 17, 2017

Changed to use the conditional variable assignment operator.

Copy link
Contributor

@theotherjimmy theotherjimmy left a comment

Choose a reason for hiding this comment

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

Awesome thanks! Maybe we don't need the comment?

@nuket
Copy link
Contributor Author

nuket commented Jan 17, 2017

Removed. Fine by me, it's pretty clear what the change does.

@theotherjimmy
Copy link
Contributor

@nuket That's great! What a small diff.

@bridadan
Copy link
Contributor

/morph export-build

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph export-build

Output

mbed Build Number: 87

All exports and builds passed!

@theotherjimmy
Copy link
Contributor

Could we rebase-squash this series when we merge it? I'd rather see the single character change as one commit.

@0xc0170 0xc0170 merged commit 2ce1a8d into ARMmbed:master Jan 26, 2017
simonqhughes pushed a commit to simonqhughes/mbed-os-1 that referenced this pull request Jan 31, 2017
Makefile: Allow user overrides of LINKER_SCRIPT Make variable
simonqhughes pushed a commit that referenced this pull request Jan 31, 2017
Makefile: Allow user overrides of LINKER_SCRIPT Make variable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants