Summary: | editors/micro: fix build on aarch64 | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | Mikael Urankar <mikael> | ||||||
Component: | Individual Port(s) | Assignee: | Steve Wills <swills> | ||||||
Status: | Closed FIXED | ||||||||
Severity: | Affects Many People | CC: | dmgk, mikael | ||||||
Priority: | --- | Flags: | bugzilla:
maintainer-feedback?
(swills) |
||||||
Version: | Latest | ||||||||
Hardware: | arm64 | ||||||||
OS: | Any | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 242312 | ||||||||
Attachments: |
|
Description
Mikael Urankar
2019-12-26 09:48:11 UTC
(In reply to mikael.urankar from comment #0) I don't think fiodgnameArg needs additional padding, go implicitly aligns Buf to 8-byte boundary on aarch64: $ cat fiodgname_arg.c #include <stdio.h> #include <stddef.h> #include <sys/filio.h> int main(int argc, char *argv[]) { printf("len: %zu\n", offsetof(struct fiodgname_arg, len)); printf("buf: %zu\n", offsetof(struct fiodgname_arg, buf)); } $ cc -o fiodgname_arg fiodgname_arg.c && ./fiodgname_arg len: 0 buf: 8 $ cat fiodgname_arg.go package main import ( "fmt" "unsafe" ) type fiodgnameArg struct { Len int32 Buf *byte } func main() { x := fiodgnameArg{} fmt.Printf("x.Len: %d\n", unsafe.Offsetof(x.Len)) fmt.Printf("x.Buf: %d\n", unsafe.Offsetof(x.Buf)) } $ go run fiodgname_arg.go x.Len: 0 x.Buf: 8 (In reply to Dmitri Goutnik from comment #1) It was not obvious looking at the amd64 implementation. amd64 needs to be fixed? Created attachment 210238 [details]
patch
A commit references this bug: Author: swills Date: Mon Jan 6 13:48:48 UTC 2020 New revision: 522229 URL: https://svnweb.freebsd.org/changeset/ports/522229 Log: editors/micro: fix build on aarch64 PR: 242889 Submitted by: mikael.urankar@gmail.com Changes: head/editors/micro/files/ head/editors/micro/files/patch-vendor_github.com_zyedidia_pty_ztypes__freebsd__arm64.go Committed, thanks! |