mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-03 02:27:48 +00:00
loader: fix ARM compatibility
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).
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user