Bug 65353 - [5 Regression] unknown ptrSize for $GOARCH "arm64" on aarch64-linux-gnu
Summary: [5 Regression] unknown ptrSize for $GOARCH "arm64" on aarch64-linux-gnu
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: go (show other bugs)
Version: 5.0
: P4 normal
Target Milestone: 5.0
Assignee: Ian Lance Taylor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-08 18:02 UTC by Matthias Klose
Modified: 2015-03-10 00:16 UTC (History)
1 user (show)

See Also:
Host:
Target: aarch64-linux-gnu
Build:
Known to work: 4.9.2
Known to fail: 5.0
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Klose 2015-03-08 18:02:01 UTC
$ go tool cgo -godefs types.go
unknown ptrSize for $GOARCH "arm64"

with a separately built go tool (1.2), built using gccgo-4.9, this works as expected.

filing this as a regression for now.

$ cat types.go 
// +build ignore

package pty

import "C"

type (
        _C_int  C.int
        _C_uint C.uint
)

$ go tool cgo -godefs types.go
// Created by cgo -godefs - DO NOT EDIT
// cgo -godefs types.go

package pty

type (
        _C_int  int32
        _C_uint uint32
)
Comment 1 Matthias Klose 2015-03-08 18:42:45 UTC
patch by Michael Hudson posted at https://launchpad.net/bugs/1361946

--- a/libgo/go/cmd/cgo/main.go
+++ b/libgo/go/cmd/cgo/main.go
@@ -133,6 +133,7 @@
        "386":   4,
        "amd64": 8,
        "arm":   4,
+       "arm64": 8,
        "ppc64": 8,
        "ppc64le": 8,
        "s390x": 8,
@@ -142,6 +143,7 @@
        "386":   4,
        "amd64": 8,
        "arm":   4,
+       "arm64": 8,
        "ppc64": 8,
        "ppc64le": 8,
        "s390x": 8,
Comment 2 Andrew Pinski 2015-03-08 19:03:38 UTC
(In reply to Matthias Klose from comment #1)
> patch by Michael Hudson posted at https://launchpad.net/bugs/1361946
> 
> --- a/libgo/go/cmd/cgo/main.go
> +++ b/libgo/go/cmd/cgo/main.go
> @@ -133,6 +133,7 @@
>         "386":   4,
>         "amd64": 8,
>         "arm":   4,
> +       "arm64": 8,
>         "ppc64": 8,
>         "ppc64le": 8,
>         "s390x": 8,
> @@ -142,6 +143,7 @@
>         "386":   4,
>         "amd64": 8,
>         "arm":   4,
> +       "arm64": 8,
>         "ppc64": 8,
>         "ppc64le": 8,
>         "s390x": 8,

Except hat is broken for ilp32.
Comment 3 Michael Hudson-Doyle 2015-03-08 20:27:49 UTC
ilp32 will need to be a new GOARCH; "arm64p32" would fit with the existing GOARCH value of amd64p32 for intel.
Comment 4 ian@gcc.gnu.org 2015-03-10 00:15:29 UTC
Author: ian
Date: Tue Mar 10 00:14:58 2015
New Revision: 221293

URL: https://gcc.gnu.org/viewcvs?rev=221293&root=gcc&view=rev
Log:
	PR go/65353.
cmd/cgo: Add all gccgo GOARCH values to size maps.

Modified:
    trunk/libgo/go/cmd/cgo/main.go
Comment 5 Ian Lance Taylor 2015-03-10 00:16:14 UTC
Should be fixed.

Thanks for reporting it.