tinygo/builder
Ayke van Laethem 8cbfbcae5a build: avoid sharing GlobalValues between build instances
This happens with `tinygo test` for example when testing multiple
packages at the same time. I found this because the compiler crashed in
`make tinygo-test-fast`:

    fatal error: concurrent map writes
    fatal error: concurrent map read and map write

    goroutine 15 [running]:
    github.com/tinygo-org/tinygo/builder.Build({0x40002d0be0, 0xa}, {0x0, 0x0}, {0x4000398048, 0x14}, 0x40003b0000)
            /home/ayke/src/tinygo/tinygo/builder/build.go:131 +0x388
    main.buildAndRun({0x40002d0be0, 0xa}, 0x40003b0000, {0x8bc178, 0x40003a4090}, {0x0, 0x0, 0x0}, {0x0, 0x0, ...}, ...)
            /home/ayke/src/tinygo/tinygo/main.go:856 +0x45c
    main.Test({0x40002d0be0, 0xa}, {0x8bc118, 0x40000b3a08}, {0x0?, 0x0?}, 0x40001e6000, {0x0, 0x0})
            /home/ayke/src/tinygo/tinygo/main.go:270 +0x758
    main.main.func3()
            /home/ayke/src/tinygo/tinygo/main.go:1718 +0xe4
    created by main.main in goroutine 1
            /home/ayke/src/tinygo/tinygo/main.go:1712 +0x34ec

My solution is essentially to copy the map over instead of modifying it
directly.

I've also moved the code up a little, because I think that's a more
sensible place (out of the way of the whole package compile logic).
2023-10-04 16:20:32 +02:00
..
ar.go compiler: add compiler-rt and wasm symbols to table 2023-07-31 14:52:26 +02:00
build.go build: avoid sharing GlobalValues between build instances 2023-10-04 16:20:32 +02:00
builder_test.go wasm: add support for GOOS=wasip1 2023-08-17 18:16:54 +02:00
buildid.go
builtins.go
cc.go builder: remove non-ThinLTO build mode 2023-02-26 19:22:10 +01:00
cc1as.cpp all: switch to LLVM 16 2023-09-18 21:58:02 +02:00
cc1as.h all: switch to LLVM 16 2023-09-18 21:58:02 +02:00
cc_test.go
clang.cpp
commands.go
config.go builder: update message for max supported Go version 2023-08-09 19:27:15 +02:00
darwin-libsystem.go
elfpatch.go
env.go
error.go
esp.go fix some comments 2023-04-18 22:51:49 +02:00
jobs.go builder: print the status of the job that just completed 2023-04-22 10:01:02 +02:00
library.go all: remove LLVM 14 support 2023-10-01 18:32:15 +02:00
lld.cpp ci: build LLVM with thread support on Windows 2023-03-07 22:38:14 +01:00
mingw-w64.go
musl.go all: remove LLVM 14 support 2023-10-01 18:32:15 +02:00
nrfutil.go builder: implement Nordic DFU file writer in Go 2023-05-13 09:52:42 +02:00
objcopy.go
picolibc.go
sizes.go compiler: account for alignment with -size=full 2023-03-08 07:09:46 +01:00
sizes_test.go all: use the new LLVM pass manager 2023-10-04 13:05:58 +02:00
tools-builtin.go
tools-external.go
tools.go
uf2.go