NetBSD Problem Report #51653

From bjjl@rpi.pocketservices.de  Fri Nov 25 22:01:16 2016
Return-Path: <bjjl@rpi.pocketservices.de>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 170857A2E9
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 25 Nov 2016 22:01:16 +0000 (UTC)
Message-Id: <20161125220112.D44E06CDA2@rpi.pocketservices.de>
Date: Fri, 25 Nov 2016 23:01:12 +0100 (CET)
From: inbox@benjaminlorenz.email
To: gnats-bugs@NetBSD.org
Subject: pkgsrc breaks on RPI - evbarm vs. earm
X-Send-Pr-Version: 3.95

>Number:         51653
>Category:       pkg
>Synopsis:       pkgsrc fails for evbarm packages
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bsiegert
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Nov 25 22:05:00 +0000 2016
>Closed-Date:    Thu Apr 05 09:13:47 +0000 2018
>Last-Modified:  Thu Apr 05 09:13:47 +0000 2018
>Originator:     Benjamin Lorenz
>Release:        NetBSD 7.0.2
>Organization:

>Environment:


System: NetBSD rpi.pocketservices.de 7.0.2 NetBSD 7.0.2 (RPI) #1: Wed Nov 16 15:58:28 CET 2016 bjjl@rpi.pocketservices.de:/home/bjjl/702/obj/sys/arch/evbarm/compile/RPI evbarm
Architecture: earm
Machine: evbarm
>Description:
Cannot compile e.g. pkgsrc/lang/go - it complains about earm not being
supported. But in fact, I have an RPI/evbarm which in turn IS supported
by the package, so it should build. After hacking version.mk the build
process is ok (changing evbarm to earm in the file - but this is a hack?!).

What's the correct fix?
>How-To-Repeat:

>Fix:


>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: port-evbarm-maintainer->pkg-mgr
Responsible-Changed-By: martin@NetBSD.org
Responsible-Changed-When: Fri, 25 Nov 2016 22:14:22 +0000
Responsible-Changed-Why:
pkgsrc issue


From: coypu@SDF.ORG
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-evbarm/51653: pkgsrc breaks on RPI - evbarm vs. earm
Date: Fri, 25 Nov 2016 22:21:53 +0000

 Hi,

 Does the following help?

 Index: version.mk
 ===================================================================
 RCS file: /cvsroot/pkgsrc/lang/go/version.mk,v
 retrieving revision 1.17
 diff -u -r1.17 version.mk
 --- version.mk	10 Sep 2016 09:09:23 -0000	1.17
 +++ version.mk	25 Nov 2016 22:21:00 -0000
 @@ -5,7 +5,7 @@
  GO_VERSION=	1.7.1
  GO14_VERSION=	1.4.3

 -ONLY_FOR_PLATFORM=	*-*-i386 *-*-x86_64 *-*-evbarm
 +ONLY_FOR_PLATFORM=	*-*-i386 *-*-x86_64 *-*-*arm
  NOT_FOR_PLATFORM=	SunOS-*-i386
  .if ${MACHINE_ARCH} == "i386"
  GOARCH=		386
 @@ -13,7 +13,7 @@
  .elif ${MACHINE_ARCH} == "x86_64"
  GOARCH=		amd64
  GOCHAR=		6
 -.elif ${MACHINE_ARCH} == "evbarm"
 +.elif !empty(MACHINE_ARCH:M*arm)
  GOARCH=		arm
  GOCHAR=		5
  .endif

From: bjjl@rpi.pocketservices.de (Benjamin Lorenz)
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-evbarm/51653: pkgsrc breaks on RPI - evbarm vs. earm
Date: Sat, 26 Nov 2016 11:06:48 +0100 (CET)

 Yes, this seems to fix the issue. Thanks much.

From: bjjl@prod.mx.plus (Benjamin Lorenz)
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-evbarm/51653: pkgsrc breaks on RPI - evbarm vs. earm
Date: Sat, 26 Nov 2016 13:07:41 +0100 (CET)

 Update: The build of the package starts, but during compilation of
 dependent go14, the system hangs reproducibly:

 [...]
 regexp/syntax
 regexp
 go/token
 go/scanner
 go/ast
 go/parser
 os/exec
 os/signal
 net/url
 text/template/parse
 text/template
 go/doc
 go/build
 cmd/go
 <nothing happens beyond this point>

 and the system is frozen. Ping still works, but everything else hangs.

 Last output of top from another terminal:

 load averages:  1.06,  1.07,  0.88;               up 0+00:26:24            12:55:57
 31 processes: 1 runnable, 29 sleeping, 1 on CPU
 CPU states: 82.8% user,  0.0% nice, 11.2% system,  6.0% interrupt,  0.0% idle
 Memory: 161M Act, 7072K Wired, 16M Exec, 57M File, 253M Free
 Swap: 384M Total, 384M Free

   PID USERNAME PRI NICE   SIZE   RES STATE      TIME   WCPU    CPU COMMAND
 14611 bjjl      31    0    64M   51M RUN        0:06 98.99% 25.68% 5l
     0 root     124    0     0K 8304K syncer     0:06  0.63%  0.63% [system]

 So apparently 5l makes the system crash, but only while linking cmd/go.

 This happens with NetBSD/evbarm on my RPI with 7.0.2, and also kernel 7.0.1
 and 7.0_STABLE from January 10th 2016. 

From: coypu@SDF.ORG
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-evbarm/51653: pkgsrc breaks on RPI - evbarm vs. earm
Date: Sun, 27 Nov 2016 14:32:10 +0000

 I've made a similar bug before, toolchain/51472, for netbsd32_compat on x86.
 But no idea what causes it.

 Note Go is a little special. on my amd64 laptop:
 % file `which pkglint`
 /usr/pkg/bin/pkglint: ELF 64-bit LSB executable, x86-64, version 1 (NetBSD), dynamically linked, interpreter /usr/libexec/ld.elf_so, for NetBSD 5.99, not stripped
 % file /usr/pkg/go14/bin/go
 /usr/pkg/go14/bin/go: ELF 64-bit LSB executable, x86-64, version 1 (NetBSD), dynamically linked, interpreter /usr/libexec/ld.elf_so, for NetBSD 5.99, not stripped

 It's possible it wedges on some syscall when lacking COMPAT_* options.

 This is just an idea that is untested.

Responsible-Changed-From-To: pkg-mgr->pkg-manager
Responsible-Changed-By: dholland@NetBSD.org
Responsible-Changed-When: Sun, 27 Nov 2016 20:11:40 +0000
Responsible-Changed-Why:
use right address


From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-evbarm/51653: pkgsrc breaks on RPI - evbarm vs. earm
Date: Sun, 27 Nov 2016 20:11:11 +0000

 On Sun, Nov 27, 2016 at 02:35:01PM +0000, coypu@SDF.ORG wrote:
  >  Note Go is a little special. on my amd64 laptop:
  >  % file `which pkglint`
  >  /usr/pkg/bin/pkglint: ELF 64-bit LSB executable, x86-64, version 1 (NetBSD), dynamically linked, interpreter /usr/libexec/ld.elf_so, for NetBSD 5.99, not stripped

 *5*.99?

 -- 
 David A. Holland
 dholland@netbsd.org

From: "Maya Rashish" <maya@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/51653 CVS commit: pkgsrc/lang/go
Date: Sun, 27 Nov 2016 21:07:22 +0000

 Module Name:	pkgsrc
 Committed By:	maya
 Date:		Sun Nov 27 21:07:22 UTC 2016

 Modified Files:
 	pkgsrc/lang/go: version.mk

 Log Message:
 go: match more netbsd/arm, which can be machine arch earm,
 and not just evbarm.

 PR pkg/51653

 Note that this does not resolve the PR, as the build hangs.


 To generate a diff of this commit:
 cvs rdiff -u -r1.18 -r1.19 pkgsrc/lang/go/version.mk

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: coypu@SDF.ORG
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-evbarm/51653: pkgsrc breaks on RPI - evbarm vs. earm
Date: Sun, 27 Nov 2016 21:14:19 +0000

 On Sun, Nov 27, 2016 at 08:15:01PM +0000, David Holland wrote:
 >  *5*.99?
 >  

 Yes.

 For go14, I believe it is picked up from src/cmd/ld/elf.c

 // NetBSD Signature (as per sys/exec_elf.h)                                                                                                            
 #define ELF_NOTE_NETBSD_NAMESZ          7
 #define ELF_NOTE_NETBSD_DESCSZ          4
 #define ELF_NOTE_NETBSD_TAG             1
 #define ELF_NOTE_NETBSD_NAME            "NetBSD\0\0"
 #define ELF_NOTE_NETBSD_VERSION         599000000       /* NetBSD 5.99 */

 I don't know why it felt the need to replicate sys/exec_elf.h. Possibly it relies
 on compat to do the right thing.

From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, pkg-manager@netbsd.org, gnats-admin@netbsd.org, 
	pkgsrc-bugs@netbsd.org, inbox@benjaminlorenz.email
Cc: 
Subject: Re: port-evbarm/51653: pkgsrc breaks on RPI - evbarm vs. earm
Date: Mon, 28 Nov 2016 07:59:02 -0500

 On Nov 27,  9:15pm, coypu@SDF.ORG (coypu@SDF.ORG) wrote:
 -- Subject: Re: port-evbarm/51653: pkgsrc breaks on RPI - evbarm vs. earm

 | The following reply was made to PR pkg/51653; it has been noted by GNATS.
 | 
 | From: coypu@SDF.ORG
 | To: gnats-bugs@NetBSD.org
 | Cc: 
 | Subject: Re: port-evbarm/51653: pkgsrc breaks on RPI - evbarm vs. earm
 | Date: Sun, 27 Nov 2016 21:14:19 +0000
 | 
 |  On Sun, Nov 27, 2016 at 08:15:01PM +0000, David Holland wrote:
 |  >  *5*.99?
 |  >  
 |  
 |  Yes.
 |  
 |  For go14, I believe it is picked up from src/cmd/ld/elf.c
 |  
 |  // NetBSD Signature (as per sys/exec_elf.h)                                                                                                            
 |  #define ELF_NOTE_NETBSD_NAMESZ          7
 |  #define ELF_NOTE_NETBSD_DESCSZ          4
 |  #define ELF_NOTE_NETBSD_TAG             1
 |  #define ELF_NOTE_NETBSD_NAME            "NetBSD\0\0"
 |  #define ELF_NOTE_NETBSD_VERSION         599000000       /* NetBSD 5.99 */
 |  
 |  I don't know why it felt the need to replicate sys/exec_elf.h. Possibly it relies
 |  on compat to do the right thing.

 It does not (rely on compat). It should really be using the right values
 or they should be talking to us about making -1 or 0 meaning current, so
 they don't have to change it.

 christos

From: Benny Siegert <bsiegert@gmail.com>
To: gnats-bugs@NetBSD.org
Cc: pkg-manager@netbsd.org,
 gnats-admin@netbsd.org,
 pkgsrc-bugs@netbsd.org,
 inbox@benjaminlorenz.email
Subject: Re: port-evbarm/51653: pkgsrc breaks on RPI - evbarm vs. earm
Date: Mon, 28 Nov 2016 19:45:07 +0100

 > It does not (rely on compat). It should really be using the right =
 values
 > or they should be talking to us about making -1 or 0 meaning current, =
 so
 > they don't have to change it.

 The point of contact for that would be me :) So what should Go put into =
 its binaries instead of what it is putting there? The thing is, if it =
 needs a change on the NetBSD side, does that mean breaking compatibility =
 with released NetBSD versions?

 The reason the 5.99.51 is in there is because this is what I was using =
 at the time for testing, and it was working. 5.x releases are clearly =
 too old, anything from 6 on is fine.=20

 It would be great if you could take a Go binary built on NetBSD 7 would =
 also run on NetBSD 6 though. That=E2=80=99s the way this works for the =
 other OSes, and it is a nice thing for deploying binaries.=

From: christos@zoulas.com (Christos Zoulas)
To: Benny Siegert <bsiegert@gmail.com>, gnats-bugs@NetBSD.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org, 
	inbox@benjaminlorenz.email
Subject: Re: port-evbarm/51653: pkgsrc breaks on RPI - evbarm vs. earm
Date: Mon, 28 Nov 2016 13:56:12 -0500

 On Nov 28,  7:45pm, bsiegert@gmail.com (Benny Siegert) wrote:
 -- Subject: Re: port-evbarm/51653: pkgsrc breaks on RPI - evbarm vs. earm

 | > It does not (rely on compat). It should really be using the right values
 | > or they should be talking to us about making -1 or 0 meaning current, so
 | > they don't have to change it.
 | 
 | The point of contact for that would be me :) So what should Go put into its=
 |  binaries instead of what it is putting there? The thing is, if it needs a =
 | change on the NetBSD side, does that mean breaking compatibility with relea=
 | sed NetBSD versions?
 | 
 | The reason the 5.99.51 is in there is because this is what I was using at t=
 | he time for testing, and it was working. 5.x releases are clearly too old, =
 | anything from 6 on is fine.=20
 | 
 | It would be great if you could take a Go binary built on NetBSD 7 would als=
 | o run on NetBSD 6 though. That=E2=80=99s the way this works for the other O=
 | Ses, and it is a nice thing for deploying binaries.

 Binary compatibility on NetBSD is achieved in two different layers:

 1. kernel ABI 	keep old syscalls via compat_foo (static binaries mostly)
 2. lib ABI	wrap old lib calls to new syscalls (dynamic binaries mostly)

 Most binaries are dynamically linked and they use (2), go binaries
 are not and thus fall into (1). While the baked-into-binary ELF
 note version is not used much to determine what version of NetBSD,
 the binary was created on to make the kernel behave differently,
 it is used a little:

 https://nxr.netbsd.org/search?q=&project=src&defs=&refs=ep_osversion&path=&hist=

 The question is what is the right 'version' of NetBSD to put in the go binary?

 1. The running kernel version
 2. The cross-built userland environment version
 3. The go toolchain version (as determined by what NetBSD binary the
    toolchain was compiled on)
 4. Something I have not considered?

 I think 3 is probably the right choice, so the versioned backed into the
 go toolchain should be the value __NetBSD_Version__ at the time the go
 toolchain was built. It should be simple enough to get this value from
 <sys/param.h> and bake it into the the note that the go toolchain provides.

 Any opinions?

 christos

From: coypu@SDF.ORG
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-evbarm/51653: pkgsrc breaks on RPI - evbarm vs. earm
Date: Fri, 2 Dec 2016 12:28:09 +0000

 On Mon, Nov 28, 2016 at 07:00:02PM +0000, Christos Zoulas wrote:
 >  I think 3 is probably the right choice, so the versioned backed into the
 >  go toolchain should be the value __NetBSD_Version__ at the time the go
 >  toolchain was built. It should be simple enough to get this value from
 >  <sys/param.h> and bake it into the the note that the go toolchain provides.
 >  
 >  Any opinions?
 >  

 What should Go building binaries for NetBSD on other operating systems use?
 For Go, cross compiling for netbsd/arm is a matter of GOOS=netbsd and GOARCH=arm.



 Also, relevant to the PR in general, ut not your reply:
 https://github.com/golang/go/issues/13806

 I assume we will want something similar for go 1.4

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-evbarm/51653: pkgsrc breaks on RPI - evbarm vs. earm
Date: Fri, 2 Dec 2016 16:48:41 +0000

 On Fri, Dec 02, 2016 at 12:30:01PM +0000, coypu@SDF.ORG wrote:
  >  What should Go building binaries for NetBSD on other operating systems use?
  >  For Go, cross compiling for netbsd/arm is a matter of GOOS=netbsd and GOARCH=arm.

 Same as otherwise, that is, whatever's baked in when the compiler is
 built.

 Because Go doesn't use the libc interface, the binary interface it
 does use (for any target OS and CPU) is whatever it thinks it ought to
 be using when it builds its static runtime.

 If it gets that by probing the kernel it's building against, then it
 should use the version from that kernel.

 If it gets it from some static table of lore about what it thinks the
 ABI is, then it's ~always going to be wrong so it probably doesn't
 matter :-)

 -- 
 David A. Holland
 dholland@netbsd.org

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: port-evbarm/51653: pkgsrc breaks on RPI - evbarm vs. earm
Date: Fri, 2 Dec 2016 17:00:28 +0000

 On Fri, Dec 02, 2016 at 04:50:01PM +0000, David Holland wrote:
  >>  What should Go building binaries for NetBSD on other operating
  >>  systems use?
  >>  For Go, cross compiling for netbsd/arm is a matter of GOOS=netbsd
  >>  and GOARCH=arm.
  >  
  >  Same as otherwise, that is, whatever's baked in when the compiler is
  >  built.
  >  
  >  Because Go doesn't use the libc interface, the binary interface it
  >  does use (for any target OS and CPU) is whatever it thinks it ought to
  >  be using when it builds its static runtime.
  >  
  >  If it gets that by probing the kernel it's building against, then it
  >  should use the version from that kernel.
  >  
  >  If it gets it from some static table of lore about what it thinks the
  >  ABI is, then it's ~always going to be wrong so it probably doesn't
  >  matter :-)

 That is, suppose I compile with GOOS=buggix GOARCH=sporc; it must have
 a static runtime for sporc-buggix. Where does/did it get the ABI
 constants for that?

 -- 
 David A. Holland
 dholland@netbsd.org

From: Yasushi Oshima <oshima-ya@yagoto-urayama.jp>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/51653
Date: Sun, 04 Dec 2016 06:04:17 +0900 (JST)

 Hi,

 I'm tring to run golang on NetBSD/(e)arm, too.

 I think go netbsd/arm till 1.7.x has many problems, it will not work.

  1. Problems with EABI support. I reported this to upstream befor:
       https://github.com/golang/go/issues/13806
     This fix includes EABI padding and EABI flag to ELF binary.
     It will be included in 1.8.

  2. Problem of page size. Page size was hard-coded up to go 1.7.x,
     In ARM,  this is 4K. Howeber NetBSD/earm 7.0 or lator
     is 8K (default) when ARM v6 or later kernels.
     Therefore, Go's memory management code does not work properly.
     This was chenged to  get dynamically from the kernel in master,
     so will be fixed in 1.8.
       https://github.com/golang/go/commit/6dda7b2f5fb675a2747fea5ae020248245b8903f
  3. Problem of linker. Go ELF linker sets p_align of ELF Header
     to 4K somehow.
     https://github.com/golang/go/blob/master/src/cmd/link/internal/arm/obj.go#L107
     In Pagesize 8K kernel, this will cause problems when loading binary.
     This value can be changed with option '-R' on Go linker:
       Go build -ldflags '-R 8192' program.go
     However, it can not be specified when build bootstrap tools.
     For this reason, it is not able to self-build go distribution on
     NetBSD/earm (with 8K page kernel).
     I think this is not a problem in only NetBSD, nor only ARM CPUs.
     There is no countermeasure even in the current source..

     > and the system is frozen. Ping still works, but everything else hangs.

     I guess the reason for hangup is the above.

 I wrote some local hacks to source of golang (including 1.4).
 Still some problems exist in this, but it can make self-building
 and building Go 1.7 and 1.8 Beta in my environment.
 These are:
   https://github.com/oshimaya/go
     branch: netbsd, go1.[4567]-netbsd

 In addition:
  I think that golang now can not support both EABI and OABI of arm
  on one OS. Because ARM(OABI) and EARM(EABI) are the same arch
   "arm" at least in current sources.
  It will be  the same when Linux or FreeBSD that supports EABI. It
  seems that they support only EABI.

  Also, it will not work with ARMv5 CPUs even if GOARM=5. because
  it uses some instructions which are in ARMv6 or lator CPUs only.

  For example:
    https://github.com/golang/go/blob/master/src/sync/atomic/asm_arm.s
    It uses LDREX and STREX...

  I do not know how to fix them.

 thanks.

 --
 Yasushi Oshima.

From: Benny Siegert <bsiegert@gmail.com>
To: gnats-bugs@NetBSD.org,
 Yasushi Oshima <oshima-ya@yagoto-urayama.jp>
Cc: pkg-manager@netbsd.org,
 gnats-admin@netbsd.org,
 pkgsrc-bugs@netbsd.org,
 inbox@benjaminlorenz.email
Subject: Re: pkg/51653
Date: Sun, 4 Dec 2016 21:00:40 +0100

 >=20
 >  3. Problem of linker. Go ELF linker sets p_align of ELF Header
 >     to 4K somehow.
 >     =
 https://github.com/golang/go/blob/master/src/cmd/link/internal/arm/obj.go#=
 L107
 >     In Pagesize 8K kernel, this will cause problems when loading =
 binary.
 >     This value can be changed with option '-R' on Go linker:
 >       Go build -ldflags '-R 8192' program.go
 >     However, it can not be specified when build bootstrap tools.
 >     For this reason, it is not able to self-build go distribution on
 >     NetBSD/earm (with 8K page kernel).
 >     I think this is not a problem in only NetBSD, nor only ARM CPUs.
 >     There is no countermeasure even in the current source..

 Did you report this upstream? If not, please do and Cc me (@bsiegert) =
 :).

 =E2=80=94Benny.=

From: Yasushi Oshima <oshima-ya@yagoto-urayama.jp>
To: bsiegert@gmail.com, gnats-bugs@NetBSD.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org,
 inbox@benjaminlorenz.email
Subject: Re: pkg/51653 
Date: Sun, 11 Dec 2016 13:21:36 +0900 (JST)

 At Sun, 4 Dec 2016 21:00:40 +0100
 Benny Siegert <bsiegert@gmail.com> wrote:

 >> 
 >>  3. Problem of linker. Go ELF linker sets p_align of ELF Header
 >>     to 4K somehow.
 >>     https://github.com/golang/go/blob/master/src/cmd/link/internal/arm/obj.go#L107
 >>     In Pagesize 8K kernel, this will cause problems when loading binary.
 >>     This value can be changed with option '-R' on Go linker:
 >>       Go build -ldflags '-R 8192' program.go
 >>     However, it can not be specified when build bootstrap tools.
 >>     For this reason, it is not able to self-build go distribution on
 >>     NetBSD/earm (with 8K page kernel).
 >>     I think this is not a problem in only NetBSD, nor only ARM CPUs.
 >>     There is no countermeasure even in the current source..
 > 
 > Did you report this upstream? If not, please do and Cc me (@bsiegert) :).

 This problem has been reported several times in the past for many platform.
 And it  was fixed only for arm64 and sparc64 platform the other day,
 but not be fixed for 32bit arm.

 I add a comment at the following issue:
 https://github.com/golang/go/issues/10180


 Thanks,

 --
 Yasushi Oshima

From: Yasushi Oshima <oshima-ya@yagoto-urayama.jp>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/51653 pkgsrc breaks on RPI - evbarm vs. earm 
Date: Thu, 16 Mar 2017 01:38:43 +0900 (JST)

 I wrote:
 >>>  3. Problem of linker. Go ELF linker sets p_align of ELF Header
 >>>     to 4K somehow.
 >>>     I think this is not a problem in only NetBSD, nor only ARM CPUs.

 It has been changed from 4K to 64K on 2017-1-4:

 https://github.com/golang/go/commit/f64b7d301d8f22efb9b539f8ac4db60aedf182c6

 It is included in Go 1.8 released on 2017-2-16

 When cross-building using Go with other arch (include NetBSD/{amd64,i386})
 like bellow, Go 1.8 runtime which will work on NetBSD/earmv{6,7}hf.

 Case for earmv6hf:
 $ cd /foo/bar/go/src
 $ GOROOT_BOOTSTRAP=/where/host-goroot GOOS=netbsd GOARCH=arm GOARM=6 ./bootstrap.bash

 Case for earmv7hf:
 $ cd /foo/bar/go/src
 $ GOROOT_BOOTSTRAP=/where/host-goroot GOOS=netbsd GOARCH=arm GOARM=7 ./bootstrap.bash

 NOTE: can not build for earmv5 or earlier.

 For pkgsrc,

 I think there are two ways.

  - Back port changes in Go 1.7 to Go 1.4.
     It is necessary to change some sources from Go to C.
     Also, it will be its own change because Go 1.4 may be EOL.

 - Create a binary for bootstrap by cross building in advance and use it
    when building under pkgsrc.
     Like an openjdk-bootstrap binary.
     It is necessary to prepare for both earmv6hf and earmv7hf.

 I do not know which is better...

 Thanks.
 --
 Yasushi Oshima

Responsible-Changed-From-To: pkg-manager->bsiegert
Responsible-Changed-By: bsiegert@NetBSD.org
Responsible-Changed-When: Wed, 15 Mar 2017 18:50:19 +0000
Responsible-Changed-Why:
I am the maintainer


State-Changed-From-To: open->feedback
State-Changed-By: bsiegert@NetBSD.org
State-Changed-When: Sat, 05 Aug 2017 09:48:45 +0000
State-Changed-Why:
Could you try again? Does this compile now?


State-Changed-From-To: feedback->open
State-Changed-By: bsiegert@NetBSD.org
State-Changed-When: Sat, 19 Aug 2017 19:28:22 +0000
State-Changed-Why:
Feedback bounces :( Sounds like I need to get an ARM board working myself.


State-Changed-From-To: open->closed
State-Changed-By: bsiegert@NetBSD.org
State-Changed-When: Thu, 05 Apr 2018 09:13:47 +0000
State-Changed-Why:
This works and is supported.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.