tinygo/targets/esp8266.json
Ayke van Laethem d3d4acaadf esp: add picolibc
With this change, it is possible to fully use CGo on ESP32/ESP8266
chips. The following will work:

    tinygo flash -target=d1mini       -port=/dev/ttyUSB0 ./testdata/cgo/
    tinygo flash -target=esp32-mini32 -port=/dev/ttyUSB0 ./testdata/cgo/

Previously it would produce output like the following:

    /tmp/tinygo905539688/main.o:(.literal.runtime.run$1$gowrapper+0x150): undefined reference to `strcpy'
    /tmp/tinygo905539688/main.o:(.literal.runtime.run$1$gowrapper+0x154): undefined reference to `strlen'
2021-02-11 10:50:29 +01:00

20 строки
507 Б
JSON

{
"inherits": ["xtensa"],
"cpu": "esp8266",
"build-tags": ["esp8266", "esp"],
"scheduler": "tasks",
"linker": "xtensa-esp32-elf-ld",
"default-stack-size": 2048,
"cflags": [
"-mcpu=esp8266"
],
"rtlib": "compiler-rt",
"libc": "picolibc",
"linkerscript": "targets/esp8266.ld",
"extra-files": [
"src/device/esp/esp8266.S",
"src/internal/task/task_stack_esp8266.S"
],
"binary-format": "esp8266",
"flash-command": "esptool.py --chip=esp8266 --port {port} write_flash 0x00000 {bin} -fm qio"
}