go-qml / qml

QML support for the Go language
Other
1.96k stars 189 forks source link

Broken under Go 1.12 (relocation target runtime.acquirem not defined for ABI0 (but is defined for ABIInternal)) #190

Open neclepsio opened 5 years ago

neclepsio commented 5 years ago

Compiling using Go 1.12 gives the following error:

cdata.Ref: relocation target runtime.acquirem not defined for ABI0 (but is defined for ABIInternal)
cdata.Ref: relocation target runtime.releasem not defined for ABI0 (but is defined for ABIInternal)
neclepsio commented 5 years ago

It should be related to https://github.com/golang/proposal/blob/master/design/27539-internal-abi.md#compatibility.

neclepsio commented 5 years ago

I was able to make it work removing the Refs function from assembly and adding this definition in a Windows-only file:

package cdata

import (
    "golang.org/x/sys/windows"
)

func Ref() uintptr {
    return uintptr(windows.GetCurrentThreadId())
}

Maybe this leaks a pointer so it shoud be modified to return a uint32, along with guiMainRef and guiPaintRef in bridge.go (and fixing related compilation errors). I suppose Linux and MacOS can use a similar approach using syscall.Gettid.

nanu-c commented 5 years ago

Your solution is only working in windows?

neclepsio commented 5 years ago

In neclepsio/qml-go there is a fix tested under Windows and Linux.

nanu-c commented 5 years ago

Thanks a lot, i merged your changes in my fork and i still had to rename the assembler files to get it working :)