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).
Этот коммит содержится в:
родитель
2e4dd09bbc
коммит
589569fc35
1 изменённых файлов: 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
|
||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче