mirror of
https://github.com/flatcar/scripts.git
synced 2025-10-03 19:42:15 +02:00
Go 1.15.5 fixed a security issue CVE-2020-28366, by rejecting certain LDFLAGS for CGO. See https://github.com/golang/go/issues/42559. However, that change breaks builds based on the Flatcar build chain, because `go_export` sets `$LDFLAGS` to `-Wl,-O1 -Wl,--as-needed`. As a result, Go build fails like: ``` go build runtime/cgo: invalid flag in go:cgo_ldflag: -Wl,-O1 ``` We need to remove the flag `-Wl,-O1` from $LDFLAGS before building the Go runtime, to fix the failure.
Description
Languages
Shell
93.1%
Python
6.9%