Misc. Build Options

  • -no-debugDisable outputting debug symbols. This can be useful for WebAssembly, as there is no debugger for .wasm files yet and .wasm files are generally served directly. Avoiding debug symbols can have a big impact on generated binary size, reducing them by more than half.This is not necessary on microcontrollers because debugging symbols are not flashed to the microcontroller. Additionally, you will need it when you use tinygo gdb. In general, it is recommended to include debug symbols unless you have a good reason not to.Note: while there is some support for debug symbols, only line numbers have been implemented so far. That means single-stepping and stacktraces work just fine, but no variables can be inspected.

  • -sizePrint size (none, short, or full) of the output (linked) binary. Note that the calculated size includes RAM reserved for the stack.

  • none (default)Print nothing.

  • shortPrint size statistics, roughly like what the size binutils program would print but with useful flash and RAM columns:

  1. code data bss | flash ram
  2. 5780 144 2132 | 5924 2276
  • fullTry to determine per package how much space is used. Note that these calculations are merely guesses and can somethimes be way off due to various reasons like inlining:
  1. code rodata data bss | flash ram | package
  2. 876 0 4 0 | 880 4 | (bootstrap)
  3. 38 0 0 0 | 38 0 | device/arm
  4. 0 0 0 66 | 0 66 | machine
  5. 2994 440 124 0 | 3558 124 | main
  6. 948 127 4 1 | 1079 5 | runtime
  7. 4856 567 132 67 | 5555 199 | (sum)
  8. 5780 - 144 2132 | 5924 2276 | (all)