builder: interpret linker error messages

This shows nicely formatted error messages for missing symbol names and
for out-of-flash, out-of-RAM conditions (on microcontrollers with
limited flash/RAM).

Unfortunately the missing symbol name errors aren't available on Windows
and WebAssembly because the linker doesn't report source locations yet.
This is something that I could perhaps improve in LLD.
This commit is contained in:
Ayke van Laethem
2024-07-10 13:42:21 +02:00
committed by Ron Evans
parent 2eb39785fe
commit 2e76cd3687
9 changed files with 220 additions and 44 deletions
+2 -2
View File
@@ -8,7 +8,6 @@ import (
"bytes"
"errors"
"flag"
"fmt"
"io"
"os"
"os/exec"
@@ -696,7 +695,8 @@ func TestMain(m *testing.M) {
// Invoke a specific tool.
err := builder.RunTool(os.Args[1], os.Args[2:]...)
if err != nil {
fmt.Fprintln(os.Stderr, err)
// The tool should have printed an error message already.
// Don't print another error message here.
os.Exit(1)
}
os.Exit(0)