The magic CGo construct to turn a C array into a slice turned out to be
not portable.

Note: this is not the only problem, there is also a bug in the Go
bindings for LLVM. With that one fixed, it is possible to build TinyGo
on a Raspberry Pi (32-bit).
Этот коммит содержится в:
Ayke van Laethem 2019-01-22 21:13:33 +01:00
родитель 2e4dd09bbc
коммит 589569fc35

Просмотреть файл

@ -39,7 +39,7 @@ func (info *fileInfo) parseFragment(fragment string, cflags []string) error {
// convert Go slice of strings to C array of strings.
cmdargsC := C.malloc(C.size_t(len(cflags)) * C.size_t(unsafe.Sizeof(uintptr(0))))
defer C.free(cmdargsC)
cmdargs := (*[1<<30 - 1]*C.char)(cmdargsC)
cmdargs := (*[1 << 16]*C.char)(cmdargsC)
for i, cflag := range cflags {
s := C.CString(cflag)
cmdargs[i] = s