pkgsrc-Changes archive

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

CVS commit: pkgsrc/lang/gcc9



Module Name:    pkgsrc
Committed By:   bsiegert
Date:           Mon Apr 20 14:25:52 UTC 2020

Modified Files:
        pkgsrc/lang/gcc9: Makefile distinfo
Added Files:
        pkgsrc/lang/gcc9/patches: patch-libgo_go_runtime_os__netbsd.go
            patch-libgo_go_runtime_signal__gccgo.go
            patch-libgo_go_runtime_stubs.go patch-libgo_runtime_go-signal.c

Log Message:
gcc9: start fixing gccgo build under NetBSD.

This fixes the build of the "runtime" package, now the compilation is
stuck in the "syscall" package instead.

Submitted upstream as https://go-review.googlesource.com/c/gofrontend/+/228918/.
Upstream bug report at https://github.com/golang/go/issues/38538.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 pkgsrc/lang/gcc9/Makefile
cvs rdiff -u -r1.3 -r1.4 pkgsrc/lang/gcc9/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/lang/gcc9/patches/patch-libgo_go_runtime_os__netbsd.go \
    pkgsrc/lang/gcc9/patches/patch-libgo_go_runtime_signal__gccgo.go \
    pkgsrc/lang/gcc9/patches/patch-libgo_go_runtime_stubs.go \
    pkgsrc/lang/gcc9/patches/patch-libgo_runtime_go-signal.c

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

Modified files:

Index: pkgsrc/lang/gcc9/Makefile
diff -u pkgsrc/lang/gcc9/Makefile:1.17 pkgsrc/lang/gcc9/Makefile:1.18
--- pkgsrc/lang/gcc9/Makefile:1.17      Wed Apr  8 16:35:59 2020
+++ pkgsrc/lang/gcc9/Makefile   Mon Apr 20 14:25:52 2020
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.17 2020/04/08 16:35:59 wiz Exp $
+# $NetBSD: Makefile,v 1.18 2020/04/20 14:25:52 bsiegert Exp $
 
 GCC9_VERSION=  9.3.0
+PKGREVISION=   1
 
 DISTNAME=      gcc-${GCC9_VERSION}
 PKGNAME=       gcc9-${GCC9_VERSION}

Index: pkgsrc/lang/gcc9/distinfo
diff -u pkgsrc/lang/gcc9/distinfo:1.3 pkgsrc/lang/gcc9/distinfo:1.4
--- pkgsrc/lang/gcc9/distinfo:1.3       Wed Apr  8 16:35:59 2020
+++ pkgsrc/lang/gcc9/distinfo   Mon Apr 20 14:25:52 2020
@@ -1,9 +1,13 @@
-$NetBSD: distinfo,v 1.3 2020/04/08 16:35:59 wiz Exp $
+$NetBSD: distinfo,v 1.4 2020/04/20 14:25:52 bsiegert Exp $
 
 SHA1 (gcc-9.3.0.tar.xz) = b746688bf045a316fc92c3528138ad10d0822b6b
 RMD160 (gcc-9.3.0.tar.xz) = e0ade31726b8fbb1eb308e2b1383a79633aef996
 SHA512 (gcc-9.3.0.tar.xz) = 4b9e3639eef6e623747a22c37a904b4750c93b6da77cf3958d5047e9b5ebddb7eebe091cc16ca0a227c0ecbd2bf3b984b221130f269a97ee4cc18f9cf6c444de
 Size (gcc-9.3.0.tar.xz) = 70533868 bytes
 SHA1 (patch-gcc_gimplify.c) = f933a033d4a6c11fa82c8c9c6785842ba7993862
+SHA1 (patch-libgo_go_runtime_os__netbsd.go) = 357c62afe017a5ca3d7138abb2c19dc10bc5cd3d
+SHA1 (patch-libgo_go_runtime_signal__gccgo.go) = 51b632c1c827f6d99fc2d7803294a0b7a64514a1
+SHA1 (patch-libgo_go_runtime_stubs.go) = f4753765eb7ee9a933f2bb3a05f27c487a1d51ef
+SHA1 (patch-libgo_runtime_go-signal.c) = 6121b041cdd850adeea943f385d52b65d6bfe249
 SHA1 (patch-libstdc++-v3_config_os_bsd_netbsd_ctype__base.h) = f12f6a97f94d13efa73a2500411bc77b27887edd
 SHA1 (patch-libstdc++-v3_config_os_bsd_netbsd_ctype__configure__char.cc) = 007bce70f75deace18f60924b5a3f94bf7a0af2f

Added files:

Index: pkgsrc/lang/gcc9/patches/patch-libgo_go_runtime_os__netbsd.go
diff -u /dev/null pkgsrc/lang/gcc9/patches/patch-libgo_go_runtime_os__netbsd.go:1.1
--- /dev/null   Mon Apr 20 14:25:52 2020
+++ pkgsrc/lang/gcc9/patches/patch-libgo_go_runtime_os__netbsd.go       Mon Apr 20 14:25:52 2020
@@ -0,0 +1,55 @@
+$NetBSD: patch-libgo_go_runtime_os__netbsd.go,v 1.1 2020/04/20 14:25:52 bsiegert Exp $
+
+Fix compilation errors under NetBSD. Taken from upstream Go 1.14 sources.
+
+--- libgo/go/runtime/os_netbsd.go.orig 2020-03-12 11:07:24.000000000 +0000
++++ libgo/go/runtime/os_netbsd.go
+@@ -52,11 +52,11 @@ func semasleep(ns int64) int32 {
+                               return -1
+                       }
+                       var nsec int32
+-                      ts.set_sec(timediv(wait, 1000000000, &nsec))
++                      ts.set_sec(int64(timediv(wait, 1000000000, &nsec)))
+                       ts.set_nsec(nsec)
+                       tsp = &ts
+               }
+-              ret := lwp_park(_CLOCK_MONOTONIC, _TIMER_RELTIME, tsp, 0, unsafe.Pointer(&_g_.m.waitsemacount), nil)
++              ret := lwp_park(_CLOCK_MONOTONIC, _TIMER_RELTIME, tsp, 0, unsafe.Pointer(&_g_.m.mos.waitsemacount), nil)
+               if ret == _ETIMEDOUT {
+                       return -1
+               }
+@@ -77,3 +77,34 @@ func semawakeup(mp *m) {
+               })
+       }
+ }
++
++func sysargs(argc int32, argv **byte) {
++      n := argc + 1
++
++      // skip over argv, envp to get to auxv
++      for argv_index(argv, n) != nil {
++              n++
++      }
++
++      // skip NULL separator
++      n++
++
++      // now argv+n is auxv
++      auxv := (*[1 << 28]uintptr)(add(unsafe.Pointer(argv), uintptr(n)*sys.PtrSize))
++      sysauxv(auxv[:])
++}
++
++const (
++      _AT_NULL   = 0 // Terminates the vector
++      _AT_PAGESZ = 6 // Page size in bytes
++)
++
++func sysauxv(auxv []uintptr) {
++      for i := 0; auxv[i] != _AT_NULL; i += 2 {
++              tag, val := auxv[i], auxv[i+1]
++              switch tag {
++              case _AT_PAGESZ:
++                      physPageSize = val
++              }
++      }
++}
Index: pkgsrc/lang/gcc9/patches/patch-libgo_go_runtime_signal__gccgo.go
diff -u /dev/null pkgsrc/lang/gcc9/patches/patch-libgo_go_runtime_signal__gccgo.go:1.1
--- /dev/null   Mon Apr 20 14:25:52 2020
+++ pkgsrc/lang/gcc9/patches/patch-libgo_go_runtime_signal__gccgo.go    Mon Apr 20 14:25:52 2020
@@ -0,0 +1,15 @@
+$NetBSD: patch-libgo_go_runtime_signal__gccgo.go,v 1.1 2020/04/20 14:25:52 bsiegert Exp $
+
+si_code is a macro on NetBSD, add a C trampoline function.
+
+--- libgo/go/runtime/signal_gccgo.go.orig      2020-04-18 16:53:50.092569597 +0000
++++ libgo/go/runtime/signal_gccgo.go
+@@ -65,7 +65,7 @@ func (c *sigctxt) sigcode() uint64 {
+               // code, just avoid a misleading value.
+               return _SI_USER + 1
+       }
+-      return uint64(c.info.si_code)
++      return uint64(getSiginfoCode(c.info))
+ }
+ 
+ //go:nosplit
Index: pkgsrc/lang/gcc9/patches/patch-libgo_go_runtime_stubs.go
diff -u /dev/null pkgsrc/lang/gcc9/patches/patch-libgo_go_runtime_stubs.go:1.1
--- /dev/null   Mon Apr 20 14:25:52 2020
+++ pkgsrc/lang/gcc9/patches/patch-libgo_go_runtime_stubs.go    Mon Apr 20 14:25:52 2020
@@ -0,0 +1,17 @@
+$NetBSD: patch-libgo_go_runtime_stubs.go,v 1.1 2020/04/20 14:25:52 bsiegert Exp $
+
+si_code is a macro on NetBSD, add a C trampoline function.
+
+--- libgo/go/runtime/stubs.go.orig     2020-03-12 11:07:24.000000000 +0000
++++ libgo/go/runtime/stubs.go
+@@ -326,6 +326,10 @@ func getSigactionHandler(*_sigaction) ui
+ //go:noescape
+ func setSigactionHandler(*_sigaction, uintptr)
+ 
++// Get signal code, written in C.
++//go:noescape
++func getSiginfoCode(*_siginfo_t) uintptr
++
+ // Retrieve fields from the siginfo_t and ucontext_t pointers passed
+ // to a signal handler using C, as they are often hidden in a union.
+ // Returns  and, if available, PC where signal occurred.
Index: pkgsrc/lang/gcc9/patches/patch-libgo_runtime_go-signal.c
diff -u /dev/null pkgsrc/lang/gcc9/patches/patch-libgo_runtime_go-signal.c:1.1
--- /dev/null   Mon Apr 20 14:25:52 2020
+++ pkgsrc/lang/gcc9/patches/patch-libgo_runtime_go-signal.c    Mon Apr 20 14:25:52 2020
@@ -0,0 +1,25 @@
+$NetBSD: patch-libgo_runtime_go-signal.c,v 1.1 2020/04/20 14:25:52 bsiegert Exp $
+
+si_code is a macro on NetBSD, add a C trampoline function.
+
+--- libgo/runtime/go-signal.c.orig     2020-03-12 11:07:24.000000000 +0000
++++ libgo/runtime/go-signal.c
+@@ -179,6 +179,18 @@ setSigactionHandler(struct sigaction* sa
+ // C code to fetch values from the siginfo_t and ucontext_t pointers
+ // passed to a signal handler.
+ 
++uintptr getSiginfoCode(siginfo_t *)
++      __attribute__ ((no_split_stack));
++
++uintptr getSiginfoCode(siginfo_t *)
++      __asm__ (GOSYM_PREFIX "runtime.getSiginfoCode");
++
++uintptr
++getSiginfoCode(siginfo_t *info)
++{
++      return (uintptr)(info->si_code);
++}
++
+ struct getSiginfoRet {
+       uintptr sigaddr;
+       uintptr sigpc;



Home | Main Index | Thread Index | Old Index