Skip to content

Commit

Permalink
newt: Always generate link tables header
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
m-gorecki authored and kasjer committed Mar 11, 2024
1 parent 7e93439 commit c558063
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions newt/builder/extcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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))
}
Expand Down

0 comments on commit c558063

Please sign in to comment.