From 440bdc740ec6c24865b427f2233973b684ad2766 Mon Sep 17 00:00:00 2001 From: Michal Gorecki Date: Mon, 11 Mar 2024 08:20:24 +0100 Subject: [PATCH] newt: Always generate link tables header Now link tables header will always be generated. Script that generates default linker scripts requires this file to exist, so we generate it even when it is going to be empty. --- newt/builder/extcmd.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/newt/builder/extcmd.go b/newt/builder/extcmd.go index e28de1d42..e75530f8b 100644 --- a/newt/builder/extcmd.go +++ b/newt/builder/extcmd.go @@ -197,14 +197,6 @@ func getLinkTableEntry(name string) string { func (t *TargetBuilder) generateLinkTables() { var s []string - for _, pkg := range t.res.LpkgRpkgMap { - s = append(s, pkg.Lpkg.LinkTables()...) - } - - if len(s) == 0 { - return - } - dir := GeneratedBaseDir(t.target.FullName()) + "/link/include" err := os.MkdirAll(dir, os.ModePerm) if err != nil { @@ -218,6 +210,14 @@ func (t *TargetBuilder) generateLinkTables() { return } + for _, pkg := range t.res.LpkgRpkgMap { + s = append(s, pkg.Lpkg.LinkTables()...) + } + + if len(s) == 0 { + return + } + for _, linkTable := range s { linkHeader.WriteString(getLinkTableEntry(linkTable)) }