diff options
author | Ayke van Laethem <[email protected]> | 2020-04-05 18:23:19 +0200 |
---|---|---|
committer | Ayke <[email protected]> | 2020-04-07 16:17:10 +0200 |
commit | dd0fb1dd9ad159dc1ff79d3f685a5e368ede3301 (patch) | |
tree | 19556034fa1b108b714c4a04edffbc143e34d2f8 /builder/library.go | |
parent | 639ec1e6ee15cbcd3c244c6611769b5c9a6fb396 (diff) | |
download | tinygo-dd0fb1dd9ad159dc1ff79d3f685a5e368ede3301.tar.gz tinygo-dd0fb1dd9ad159dc1ff79d3f685a5e368ede3301.zip |
arm: use -fomit-frame-pointer
The frame pointer was already omitted in the object files that TinyGo
emits, but wasn't yet omitted in the C files it compiles. Omitting the
frame pointer is good for code size (and perhaps performance).
The frame pointer was originally used for printing stack traces in a
debugger. However, advances in DWARF debug info have made it largely
unnecessary (debug info contains enough information now to recover the
frame pointer even without an explicit frame pointer register). In fact,
GDB has been able to produce backtraces in TinyGo compiled code for a
while now while it didn't include a frame pointer.
Diffstat (limited to 'builder/library.go')
-rw-r--r-- | builder/library.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builder/library.go b/builder/library.go index a0d522a3e..d85e4d365 100644 --- a/builder/library.go +++ b/builder/library.go @@ -69,7 +69,7 @@ func (l *Library) Load(target string) (path string, err error) { // Precalculate the flags to the compiler invocation. args := append(l.cflags(), "-c", "-Oz", "-g", "-ffunction-sections", "-fdata-sections", "-Wno-macro-redefined", "--target="+target, "-fdebug-prefix-map="+dir+"="+remapDir) if strings.HasPrefix(target, "arm") || strings.HasPrefix(target, "thumb") { - args = append(args, "-fshort-enums") + args = append(args, "-fshort-enums", "-fomit-frame-pointer") } if strings.HasPrefix(target, "riscv32-") { args = append(args, "-march=rv32imac", "-mabi=ilp32", "-fforce-enable-int128") |