glfw icon indicating copy to clipboard operation
glfw copied to clipboard

unaligned pointer(s) for architecture arm64

Open preslavrachev opened this issue 3 years ago • 7 comments
trafficstars

I am getting the following error while trying to run the simple demo code locally:

ld: unaligned pointer(s) for architecture arm64
clang-13: error: linker command failed with exit code 1 (use -v to see invocation)

I am running Go v1.18.2 on an M1 Mac. I assume that the new chips are not yet fully supported. Is that correct?

preslavrachev avatar Jul 23 '22 10:07 preslavrachev

I assume that the new chips are not yet fully supported. Is that correct?

I don't think that should be the case. We have had https://github.com/fyne-io/fyne working on macOS arm64 for quite a long time now.

Jacalz avatar Jul 23 '22 12:07 Jacalz

Looks like this has to do with the Go version. I tried with gotip, using the latest Go version:

go version devel go1.19-c5da4fb7ac Fri Jul 22 20:12:19 2022 +0000 darwin/arm64

and there it worked without any issues. Typical CGO stuff 🤷‍♂️

preslavrachev avatar Jul 23 '22 17:07 preslavrachev

Ah, interesting. I see that you mention using Go 1.18.2 but 1.18.4 is the latest. Does it change anything to use the latest stable version?

Jacalz avatar Jul 23 '22 17:07 Jacalz

v3.3/glfw supports darwin/arm64 as of v3.3.3 (see PR #309) and should work well. I've not had issues on my M1 machine.

Are you running into this problem with v3.3/glfw or are you using another version? Can you include more complete steps to reproduce the problem?

dmitshur avatar Jul 24 '22 17:07 dmitshur

@Jacalz I've just updated to 1.18.4, and I see the same exact behavior.

@dmitshur That's what I am seeing: image

This is how my go.mod looks like:

module glfw-demo

go 1.18

require github.com/go-gl/glfw/v3.3/glfw v0.0.0-20220712193148-63cf1f4ef61f // indirect

Anyway, as I mentioned before, it seems to work with the latest version of gotip coming form master, so I can do my work, but it is strange nonetheless.

For the record, here are some more version specifics

clang 13.0.1 macOS 12.4

preslavrachev avatar Jul 25 '22 08:07 preslavrachev

I'd suggest opening a bug upstream in the golang/go repository on GitHub.

FYI, your module seems strange. There should not be any // indirect when you are explicitly using it like that. Have you run go mod tidy?

Jacalz avatar Jul 25 '22 12:07 Jacalz