On Wed, Sep 9, 2020 at 8:17 PM Ian Lance Taylor wrote:
> Exact alignment/offset compatibility with the C ABI is not a goal.
> Sorry. (It's actually harder than one might think to maintain that
> kind of compatibility. For example, on x86, the C ABI uses one
> alignment for double variables and
On Wed, Sep 9, 2020 at 4:59 AM Jan Mercl <0xj...@gmail.com> wrote:
>
> If the intent is to have Go alignments/offsets of types compatible
> with the C ABI then I think it's safe to say this is a bug.
>
> And the existence of the syscall package, in some cases passing
> Go-defined structs to the ker
On Wed, Sep 9, 2020 at 1:45 PM 'Dan Kortschak' via golang-nuts
wrote:
> I think it comes down to these lines in src/cmd/internal/sys/arch.go
> [1]
>
> ```
> var ArchARM = &Arch{
> Name: "arm",
> Family:ARM,
> ByteOrder: binary.LittleEndian,
> PtrSize: 4,
On Wed, 2020-09-09 at 13:21 +0200, Jan Mercl wrote:
>
>
> On Wed, Sep 9, 2020 at 1:09 PM 'Dan Kortschak' via golang-nuts <
> golang-nuts@googlegroups.com> wrote:
>
> > What does cgo -godefs give you? On my amd64 and arm64 I get this:
> >
> > ```
> > ~/cznic $ cat main.go
> > package main
> >
> >
On Wed, Sep 9, 2020 at 1:09 PM 'Dan Kortschak' via golang-nuts <
golang-nuts@googlegroups.com> wrote:
> What does cgo -godefs give you? On my amd64 and arm64 I get this:
>
> ```
> ~/cznic $ cat main.go
> package main
>
> /*
> struct s {
> long long i;
> } x;
> */
> import "C"
>
> type S st
On Wed, 2020-09-09 at 12:50 +0200, Jan Mercl wrote:
> On Wed, Sep 9, 2020 at 12:41 PM Dan Kortschak
> wrote:
>
> > I get the following
> >
> > ```
> > C alignof struct s: 8
> > Go alignof struct s: 8
> > Go alignofS: 8
> > ~/cznic $ go version
> > go version go1.15.1 linux/arm64
> > ~/c
On Wed, Sep 9, 2020 at 12:41 PM Dan Kortschak wrote:
> I get the following
>
> ```
> C alignof struct s: 8
> Go alignof struct s: 8
> Go alignofS: 8
> ~/cznic $ go version
> go version go1.15.1 linux/arm64
> ~/cznic $ uname -a
> Linux bildr 4.19.0-10-arm64 #1 SMP Debian 4.19.132-1 (2020-
On Wed, 2020-09-09 at 12:19 +0200, Jan Mercl wrote:
> Observation:
>
> pi@raspberrypi:~/src/tmp.tmp $ go version
> go version go1.15.1 linux/arm
> pi@raspberrypi:~/src/tmp.tmp $ cat main.go
> package main
>
> /*
>
> struct s {
> long long i;
> } x;
>
> size_t align() {
> return
Observation:
pi@raspberrypi:~/src/tmp.tmp $ go version
go version go1.15.1 linux/arm
pi@raspberrypi:~/src/tmp.tmp $ cat main.go
package main
/*
struct s {
long long i;
} x;
size_t align() {
return _Alignof(struct s);
}
*/
import "C"
import (
"fmt"
"unsafe"
)
t