tinygo/builder
Ayke van Laethem 895c542076 builder: do not ignore debug info on baremetal targets
Since https://github.com/tinygo-org/tinygo/pull/3200, `-no-debug` would
ignore debug info for some linkers. Example:

    $ tinygo build -o test.elf -target=arduino -no-debug examples/blinky1
    $ objdump -h test.elf

    test.elf:       file format elf32-avr

    Sections:
    Idx Name            Size     VMA      LMA      Type
      0                 00000000 00000000 00000000
      1 .text           000004e0 00000000 00000000 TEXT
      2 .trampolines    00000000 000004e0 000004e0 TEXT
      3 .stack          00000200 00800100 00800100 BSS
      4 .data           0000004c 00800300 000004e0 DATA
      5 .bss            000000a9 0080034c 0000052c BSS
      6 .debug_loc      00001bf0 00000000 00000000 DEBUG
      7 .debug_abbrev   000004ed 00000000 00000000 DEBUG
      8 .debug_info     00004176 00000000 00000000 DEBUG
      9 .debug_ranges   00000150 00000000 00000000 DEBUG
     10 .debug_str      0000206e 00000000 00000000 DEBUG
     11 .debug_pubnames 000024bf 00000000 00000000 DEBUG
     12 .debug_pubtypes 000004ca 00000000 00000000 DEBUG
     13 .debug_line     0000193c 00000000 00000000 DEBUG
     14 .debug_aranges  0000002c 00000000 00000000 DEBUG
     15 .debug_rnglists 00000015 00000000 00000000 DEBUG
     16 .debug_line_str 00000082 00000000 00000000 DEBUG
     17 .shstrtab       000000d9 00000000 00000000
     18 .symtab         000006d0 00000000 00000000
     19 .strtab         00000607 00000000 00000000

This shows that even though `-no-debug` is supplied, debug information
is emitted in the ELF file.

With this change, debug information is not stripped when TinyGo doesn't
know how to do it:

    $ tinygo build -o test.elf -target=arduino -no-debug examples/blinky1
    error: cannot remove debug information: unknown linker: avr-gcc

(This issue will eventually be fixed by moving to `ld.lld`).
2022-09-28 19:18:11 +02:00
..
ar.go all: format code according to Go 1.19 rules 2022-08-04 12:18:32 +02:00
build.go builder: do not ignore debug info on baremetal targets 2022-09-28 19:18:11 +02:00
builder_test.go all: update _test.go files for ioutil changes 2022-08-07 10:32:23 +02:00
buildid.go Fix for builds of tinygo using an Android host 2022-08-09 11:14:39 +02:00
builtins.go avr: use compiler-rt 2022-05-18 15:20:09 +02:00
cc.go all: move from os.IsFoo to errors.Is(err, ErrFoo) 2022-08-07 10:32:23 +02:00
cc1as.cpp all: update to LLVM 14 2022-04-23 08:45:46 +02:00
cc1as.h all: switch to LLVM 13 2022-01-09 11:04:10 +01:00
cc_test.go builder: cache C and assembly file outputs 2021-04-05 20:52:04 +02:00
clang.cpp all: switch to LLVM 11 for static builds 2020-12-10 07:01:32 +01:00
commands.go builder: remove extra formatting verb from error message 2022-05-18 09:06:03 +02:00
config.go all: drop support for Go 1.16 and Go 1.17 2022-08-30 12:38:06 +02:00
darwin-libsystem.go all: remove support for LLVM 11 and LLVM 12 2022-05-07 17:15:35 +02:00
elfpatch.go rp2040: patch elf to checksum 2nd stage boot 2021-06-17 12:10:04 +02:00
env.go all: move from os.IsFoo to errors.Is(err, ErrFoo) 2022-08-07 10:32:23 +02:00
error.go compiler: add location information to the IR checker 2019-12-21 20:49:51 +01:00
esp.go all: remove calls to deprecated ioutil package 2022-08-07 10:32:23 +02:00
jobs.go builder: refactor job runner and use a shared semaphore across build jobs 2021-12-30 12:03:12 -05:00
library.go compiler: use the LLVM builtins everywhere 2022-08-28 23:37:56 +02:00
lld.cpp all: update to LLVM 14 2022-04-23 08:45:46 +02:00
mingw-w64.go compiler: use the LLVM builtins everywhere 2022-08-28 23:37:56 +02:00
musl.go compiler: use the LLVM builtins everywhere 2022-08-28 23:37:56 +02:00
nrfutil.go all: remove calls to deprecated ioutil package 2022-08-07 10:32:23 +02:00
objcopy.go all: remove calls to deprecated ioutil package 2022-08-07 10:32:23 +02:00
picolibc.go compiler: replace math aliases with intrinsics 2022-08-30 17:33:16 +02:00
sizes.go darwin: print full size information for -size=full 2022-06-24 13:50:30 +02:00
tools-builtin.go all: remove support for LLVM 11 and LLVM 12 2022-05-07 17:15:35 +02:00
tools-external.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00
tools.go main: implement tinygo lldb subcommand 2021-10-05 06:26:21 +02:00
uf2.go all: remove calls to deprecated ioutil package 2022-08-07 10:32:23 +02:00