]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
runtime, net: fix build errors on AIX
authorClément Chigot <chigot.c@gmail.com>
Tue, 26 May 2020 09:31:37 +0000 (11:31 +0200)
committerIan Lance Taylor <iant@golang.org>
Wed, 23 Sep 2020 00:29:52 +0000 (17:29 -0700)
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/235158

gcc/go/gofrontend/MERGE
libgo/go/internal/cpu/cpu_no_init.go
libgo/go/internal/cpu/cpu_ppcx.go [moved from libgo/go/internal/cpu/cpu_ppc64x.go with 97% similarity]
libgo/go/net/interface_aix.go
libgo/go/runtime/os_aix.go
libgo/mksysinfo.sh
libgo/sysinfo.c

index a8ba5a35e44df5ed76d81488258a04a89d2e3831..d17d39702c8ef5caf071b6338ca7fc52a545dbe2 100644 (file)
@@ -1,4 +1,4 @@
-b24062f0b2e8f6173731d5654afe0addf857270e
+5605a0727d3395becba1fbd4447807073984ec13
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index fb381e1ce2d61b3080ec58eb54727a509bfd3822..e7ff87383c3a7309516b003e13307cb2b466293c 100644 (file)
@@ -6,6 +6,7 @@
 // +build !amd64
 // +build !arm
 // +build !arm64
+// +build !ppc
 // +build !ppc64
 // +build !ppc64le
 // +build !s390x
similarity index 97%
rename from libgo/go/internal/cpu/cpu_ppc64x.go
rename to libgo/go/internal/cpu/cpu_ppcx.go
index b726cc86d52e2a86165603d46b08e234b4c3f93f..56ff87524eea50b087e0207acab9d7082ba645ff 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build ppc64 ppc64le
+// +build ppc ppc64 ppc64le
 
 package cpu
 
index f57c5ff6622c6350aec03408f460b9f5fa21f3b5..bd5538699bb7eb55a0b4e68828c8de00096a62f1 100644 (file)
@@ -33,8 +33,6 @@ const _RTAX_NETMASK = 2
 const _RTAX_IFA = 5
 const _RTAX_MAX = 8
 
-const _SIOCGIFMTU = -0x3fd796aa
-
 func getIfList() ([]byte, error) {
        needed, err := syscall.Getkerninfo(_KINFO_RT_IFLIST, 0, 0, 0)
        if err != nil {
index b337330c8f276b5441be35173265131c4cb680fb..951aeb6cffd7d59517dc2ac677c99c64d0ac8527 100644 (file)
@@ -46,7 +46,7 @@ func clock_gettime(clock_id int64, timeout *timespec) int32
 
 //go:nosplit
 func semacreate(mp *m) {
-       if mp.mos.waitsema != 0 {
+       if mp.waitsema != 0 {
                return
        }
 
@@ -59,7 +59,7 @@ func semacreate(mp *m) {
        if sem_init(sem, 0, 0) != 0 {
                throw("sem_init")
        }
-       mp.mos.waitsema = uintptr(unsafe.Pointer(sem))
+       mp.waitsema = uintptr(unsafe.Pointer(sem))
 }
 
 //go:nosplit
@@ -85,7 +85,7 @@ func semasleep(ns int64) int32 {
                ts.tv_sec = timespec_sec_t(sec)
                ts.tv_nsec = timespec_nsec_t(nsec)
 
-               if sem_timedwait((*semt)(unsafe.Pointer(_m_.mos.waitsema)), &ts) != 0 {
+               if sem_timedwait((*semt)(unsafe.Pointer(_m_.waitsema)), &ts) != 0 {
                        err := errno()
                        if err == _ETIMEDOUT || err == _EAGAIN || err == _EINTR {
                                return -1
@@ -96,7 +96,7 @@ func semasleep(ns int64) int32 {
                return 0
        }
        for {
-               r1 := sem_wait((*semt)(unsafe.Pointer(_m_.mos.waitsema)))
+               r1 := sem_wait((*semt)(unsafe.Pointer(_m_.waitsema)))
                if r1 == 0 {
                        break
                }
@@ -110,7 +110,7 @@ func semasleep(ns int64) int32 {
 
 //go:nosplit
 func semawakeup(mp *m) {
-       if sem_post((*semt)(unsafe.Pointer(mp.mos.waitsema))) != 0 {
+       if sem_post((*semt)(unsafe.Pointer(mp.waitsema))) != 0 {
                throw("sem_post")
        }
 }
@@ -128,7 +128,6 @@ const (
 
 const (
        // getsystemcfg constants
-       _SC_IMPL     = 2
        _IMPL_POWER8 = 0x10000
        _IMPL_POWER9 = 0x20000
 )
index bd2ba32cba1b58c9fc8fb54d055eb2d3089ab94c..9671e394cb8cd8739a4db75e2b7e4fe92804b113 100755 (executable)
@@ -1041,9 +1041,16 @@ grep '^const _IFF' gen-sysinfo.go | \
     sed -e 's/^\(const \)_\(IFF[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT}
 grep '^const _IFNAMSIZ' gen-sysinfo.go | \
     sed -e 's/^\(const \)_\(IFNAMSIZ[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT}
-grep '^const _SIOC' gen-sysinfo.go |
+grep '^const _SIOC' gen-sysinfo.go | \
+    grep -v '_val =' | \
     sed -e 's/^\(const \)_\(SIOC[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT}
 
+if ! grep '^const SIOCGIFMTU' ${OUT} >/dev/null 2>&1; then
+       if grep '^const _SIOCGIFMTU_val' ${OUT} >/dev/null 2>&1; then
+               echo 'const SIOCGIFMTU = _SIOCGIFMTU_val' >> ${OUT}
+       fi
+fi
+
 # The ifaddrmsg struct.
 grep '^type _ifaddrmsg ' gen-sysinfo.go | \
     sed -e 's/_ifaddrmsg/IfAddrmsg/' \
index 764055971289a7444eda81bb2b432c99818060dd..6ea990f471ad332d192c5ecbd480745e35c0a40a 100644 (file)
@@ -281,6 +281,14 @@ enum {
 #endif
 };
 
+// SIOCGIFMTU can't be added in the above enum as it might
+// be signed in some OSes.
+#ifdef SIOCGIFMTU
+enum {
+  SIOCGIFMTU_val = SIOCGIFMTU,
+};
+#endif
+
 #if defined(HAVE_SYS_EPOLL_H)
 enum {
   epoll_data_offset = offsetof(struct epoll_event, data)