Skip to content

Commit 9f47298

Browse files
committed
Arduino projects can now change LDFLAGS, enabling relocation records
1 parent 79fb95b commit 9f47298

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

legacy/builder/builder_utils/utils.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,11 @@ func ExpandSysprogsExtensionProperties(properties *properties.Map, subtype strin
133133
return result
134134
}
135135

136-
136+
func ExpandSysprogsLinkerProperties(properties *properties.Map) *properties.Map {
137+
var result = properties.Clone()
138+
result.Set("compiler.ldflags", result.Get("compiler.ldflags") + " " + result.Get("com.sysprogs.extraflags.ld"))
139+
return result
140+
}
137141

138142
func findFilesInFolder(sourcePath *paths.Path, extension string, recurse bool) (paths.PathList, error) {
139143
files, err := utils.ReadDirFiltered(sourcePath.String(), utils.FilterFilesWithExtensions(extension))

legacy/builder/phases/linker.go

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ func (s *Linker) Run(ctx *types.Context) error {
5454
}
5555

5656
buildProperties := ctx.BuildProperties
57+
buildProperties = builder_utils.ExpandSysprogsLinkerProperties(buildProperties)
5758

5859
if ctx.CodeModelBuilder != nil {
5960
//Just compute the linker command line (even without the full object list), we are not actually linking and are only interested in the output file name

0 commit comments

Comments
 (0)