This is an automated email from the ASF dual-hosted git repository. sjanc pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-newt.git
commit 08b95fb7dabdc1486d641af8d36d2e61334edcf4 Author: Szymon Janc <[email protected]> AuthorDate: Wed Oct 21 02:07:51 2026 +0200 newt/toolchain: Sort static libraries added from object list getStaticLibs() appended object paths in map iteration order, unlike getObjFiles() which sorts them. Sort them as well so that linker command line does not depend on map iteration order. Assisted-by: Claude:claude-opus-5-5 --- newt/toolchain/compiler.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/newt/toolchain/compiler.go b/newt/toolchain/compiler.go index e0e38250..63da81eb 100644 --- a/newt/toolchain/compiler.go +++ b/newt/toolchain/compiler.go @@ -1158,11 +1158,18 @@ func (c *Compiler) getObjFiles(baseObjFiles []string) []string { } func (c *Compiler) getStaticLibs(baseStaticLib []util.StaticLib) []util.StaticLib { + objNames := []string{} + c.mutex.Lock() for objName, _ := range c.objPathList { - baseStaticLib = append(baseStaticLib, util.NewStaticLib(objName, false)) + objNames = append(objNames, objName) } c.mutex.Unlock() + + sort.Strings(objNames) + for _, objName := range objNames { + baseStaticLib = append(baseStaticLib, util.NewStaticLib(objName, false)) + } return baseStaticLib }
