pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/51653



The following reply was made to PR pkg/51653; it has been noted by GNATS.

From: Yasushi Oshima <oshima-ya%yagoto-urayama.jp@localhost>
To: gnats-bugs%NetBSD.org@localhost
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.
 


Home | Main Index | Thread Index | Old Index