Re: Correct goarch.sh settings for gccgo on hppa?

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

 



Hi Matoro,

On 11/25/22 19:00, matoro wrote:
Hi, I was recommended to ask here but I'm trying to enable gccgo to
run on parisc,

That would be fantastic!!!

however I am not sure what the proper values should be
for the arch configuration settings.  The description is as follows:

# Code in Makefile.am will invoke this script with two arguments.
# The first is a GOARCH value.  The second is a keyword.
# The script will print the value of that keyword for that GOARCH.
# Keywords:
# - bigendian: true or false

true

# - cachelinesize: the cache line size in bytes
#    (for performance only; it's not essential to get this right)

32

# - defaultphyspagesize: the default physical page size in bytes
#    (not currently used, but maybe some day)

4096 bytes

# - family: the processor family, from ALLGOARCHFAMILY in configure.ac

I think "hppa", but could be "parisc" too...
uname reports back parisc (on 32bit kernel) or parisc64 (on 64-bit kernel).

# - int64align: alignment of int64 type in bytes

8 bytes

# - maxalign: maximum alignment of values of Go types in bytes

?

# - minframesize: size of smallest possible function frame in bytes
#    (not currently used, may never be used)

I think 64 bytes.

# - pcquantum: minimum size of a single instruction in bytes

Every assembler statement is always 4 bytes.

# - ptrsize: size of a pointer in bytes

4 bytes   (would be 8 bytes for 64-bit userspace which we don't have yet).

There is also an undocumented "stackalign" variable.

64 bytes.

# Default values
bigendian=false
cachelinesize=64
defaultphyspagesize=4096
family=unknown
int64align=8
maxalign=8
minframesize=0
pcquantum=1
ptrsize=8
stackalign=8

This was what I first attempted to set, according to a brief skim of the ISA manual:

diff --git a/libgo/goarch.sh b/libgo/goarch.sh
index 977f318b3..ed40815ac 100755
--- a/libgo/goarch.sh
+++ b/libgo/goarch.sh
@@ -88,6 +88,16 @@ case $goarch in
          ;;
      esac
      ;;
+    hppa)
+    family=HPPA
+    bigendian=true
+    defaultphyspagesize=4096
+    minframesize=16

this should be 64bytes.

+    int64align=8
+    stackalign=4
+    pcquantum=4
+    ptrsize=4
+    ;;
      ia64)
      family=IA64
      cachelinesize=128

However this was clearly wrong, because while it did build, the resulting binary immediately segfaults.

unexpected fault address 0x33d8effc
fatal error: fault
[signal SIGSEGV: segmentation violation code=0x1 addr=0x33d8effc pc=0xf58f4284]

goroutine 4 [running]:
runtime.dopanic__m
     /var/tmp/portage/sys-devel/gcc-12.2.1_p20221008/work/gcc-12-20221008/libgo/go/runtime/panic.go:1207
runtime.fatalthrow
     /var/tmp/portage/sys-devel/gcc-12.2.1_p20221008/work/gcc-12-20221008/libgo/go/runtime/panic.go:1073
runtime.throw
     /var/tmp/portage/sys-devel/gcc-12.2.1_p20221008/work/gcc-12-20221008/libgo/go/runtime/panic.go:1044
runtime.sigpanic
     /var/tmp/portage/sys-devel/gcc-12.2.1_p20221008/work/gcc-12-20221008/libgo/go/runtime/signal_unix.go:714
net_1http.connectMethod.scheme
     /var/tmp/portage/sys-devel/gcc-12.2.1_p20221008/work/gcc-12-20221008/libgo/go/net/http/transport.go:1829
net_1http.Transport.dialConn
     /var/tmp/portage/sys-devel/gcc-12.2.1_p20221008/work/gcc-12-20221008/libgo/go/net/http/transport.go:1612
net_1http.Transport.dialConnFor
     /var/tmp/portage/sys-devel/gcc-12.2.1_p20221008/work/gcc-12-20221008/libgo/go/net/http/transport.go:1449
runtime.kickoff
     /var/tmp/portage/sys-devel/gcc-12.2.1_p20221008/work/gcc-12-20221008/libgo/go/runtime/proc.go:1316
created by net_1http.Transport.queueForDial
     /var/tmp/portage/sys-devel/gcc-12.2.1_p20221008/work/gcc-12-20221008/libgo/go/net/http/transport.go:1418 +0x37b


Is there anybody who might be able to advise on what these values should be for parisc?

Helge




[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux