-
Notifications
You must be signed in to change notification settings - Fork 107
Allow Overriding Linkerfile for SBT Projects #592
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
Allow Overriding Linkerfile for SBT Projects #592
Conversation
ifeq "$(RISCV_CORE)" "" # RISCV | ||
# Default linkerfile is only specified for standard Arm-core projects. | ||
# Otherwise, gcc_riscv.mk sets the appropriate riscv linkerfile. | ||
LINKERFILE ?= $(TARGET_LC).ld |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should SBT==1 check here, before setting LINKERFILE?
Otherwise it seems not works for ME10/ME14/ME12/ME18 which has secure + non-secure version MCUs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since SBT-config.mk
is included before max32xxx.mk
we shouldn't need it. This check will be the default value if nothing has been set through the entire build process
@ozersa I just updated all projects. I think it should be more reliable now, and I tested the common SBT projects/micros. Let me know if you find any other issues |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved.
- Note, this commit also renormalized line endings. The actual change was "ifeq ($(MAKECMDGOALS),scpa)" vs "ifeq ($(MAKECMDGOALS), scpa)" (extra space after the comma)
e23dd99
to
1b3b71d
Compare
I'm confused as heck, mostly cause I'm not super familiar with the build system. Why is the linkerfile selection removed from the project makefiles? Shouldn't we still need to set up the linkerpath somewhere? |
For future readers: The default is specified by the target-specific makefile (ex. max32520.mk). The previous section that has been removed by this PR was a workaround for a bug on MSYS2 when MAXIM_PATH was not set. The bug was resolved as of #173. |
This PR allows setting the
LINKERFILE
build config variable when SBT=1.Ex:
~/repos/fork/msdk/Examples/MAX32520/Hello_World ❯ make LINKERFILE=max32520_ram.ld Loaded project.mk Auto-located linkerfile: /home/jakecarter/repos/fork/msdk/Libraries/CMSIS/Device/Maxim/MAX32520/Source/GCC/max32520_ram.ld arm-none-eabi-size --format=berkeley /home/jakecarter/repos/fork/msdk/Examples/MAX32520/Hello_World/build/max32520.elf text data bss dec hex filename 34572 2580 372 37524 9294 /home/jakecarter/repos/fork/msdk/Examples/MAX32520/Hello_World/build/max32520.elf
Ex: (Trying to set a non-existent linkerfile)
The changes have been applied to the Hello_World project for the MAX32520 for easier testing/review. The same changes will be applied to all micros on approval.
LINKERFILE
selection to part-specific makefile (ex: max32520.mk).?=
in sbt-config.mk to allow user overrideResolves https://jira.maxim-ic.com/browse/MSDK-1100