-
Notifications
You must be signed in to change notification settings - Fork 914
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
2eb3978
commit 2e76cd3
Showing
9 changed files
with
220 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package main | ||
|
||
import "unsafe" | ||
|
||
const ( | ||
a = "0123456789abcdef" // 16 bytes | ||
b = a + a + a + a + a + a + a + a // 128 bytes | ||
c = b + b + b + b + b + b + b + b // 1024 bytes | ||
d = c + c + c + c + c + c + c + c // 8192 bytes | ||
e = d + d + d + d + d + d + d + d // 65536 bytes | ||
f = e + e + e + e + e + e + e + e // 524288 bytes | ||
) | ||
|
||
var s = f | ||
|
||
func main() { | ||
println(unsafe.StringData(s)) | ||
} | ||
|
||
// ERROR: program too large for this chip (flash overflowed by {{[0-9]+}} bytes) | ||
// ERROR: optimization guide: https://tinygo.org/docs/guides/optimizing-binaries/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package main | ||
|
||
var b [64 << 10]byte // 64kB | ||
|
||
func main() { | ||
println("ptr:", &b[0]) | ||
} | ||
|
||
// ERROR: program uses too much static RAM on this chip (RAM overflowed by {{[0-9]+}} bytes) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package main | ||
|
||
func foo() | ||
|
||
func main() { | ||
foo() | ||
foo() | ||
} | ||
|
||
// ERROR: linker-undefined.go:6: linker could not find symbol {{_?}}main.foo | ||
// ERROR: linker-undefined.go:7: linker could not find symbol {{_?}}main.foo |