This is an automated email from the ASF dual-hosted git repository. vipulrahane pushed a commit to branch vipul/fix_whole_archive_compiler_fag_handling in repository https://gitbox.apache.org/repos/asf/mynewt-newt.git
commit 0307ed2efa518f866246696700f939a3f36c0d64 Author: Vipul Rahane <vipul.rah...@juul.com> AuthorDate: Fri May 17 14:14:28 2024 -0700 Fix whole archive compiler flag handling --- newt/toolchain/compiler.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/newt/toolchain/compiler.go b/newt/toolchain/compiler.go index f84e16ed..13b3899d 100644 --- a/newt/toolchain/compiler.go +++ b/newt/toolchain/compiler.go @@ -1036,11 +1036,10 @@ func (c *Compiler) CompileBinaryCmd(dstFile string, options map[string]bool, for _, lib := range libList { if lib.WholeArch { cmd = append(cmd, "-Wl,--whole-archive") - } - cmd = append(cmd, lib.File) - if lib.WholeArch { + } else { cmd = append(cmd, "-Wl,--no-whole-archive") } + cmd = append(cmd, lib.File) } if c.ldResolveCircularDeps { cmd = append(cmd, "-Wl,--end-group")