This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: libgo patch committed: netinet/icmp6.h require netinet/in.h on AIX
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: Ian Lance Taylor <iant at golang dot org>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, "gofrontend-dev\@googlegroups.com" <gofrontend-dev at googlegroups dot com>
- Date: Thu, 31 Aug 2017 10:09:22 +0200
- Subject: Re: libgo patch committed: netinet/icmp6.h require netinet/in.h on AIX
- Authentication-results: sourceware.org; auth=none
- References: <CAOyqgcUg+tjBsfY4qWx=+AQS-EswShQU0tdXD+d=wa=885HTRQ@mail.gmail.com>
Hi Ian,
> This patch from Tony Reix fixes the libgo configure script to
> correctly decide whether netinet/icmp6.h exists on AIX. Bootstrapped
> and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline.
unfortunately, this patch broke Solaris bootstrap (seen on Solaris 11.4,
but the headers are the same all the way back to Solaris 10):
runtime_sysinfo.go:1504:32: error: use of undefined type '_mld_hdr_t'
type _mld2q struct { mld2q_hdr _mld_hdr_t; mld2q_sqrv uint8; mld2q_qqic uint8; mld2q_numsrc uint16; }
^
runtime_sysinfo.go:1504:32: error: use of undefined type '_mld_hdr_t'
gen-sysinfo.go has
gen-sysinfo.go:type _mld_hdr_t struct { mld_icmp6_hdr _icmp6_hdr; mld_addr _in6_addr; }
which is lost in sysinfo.go due to the use of _in6_addr. The solution
is the same as for AIX _arpcom, and the following patch allowed an
i386-pc-solaris2.11 bootstrap to finish.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
diff --git a/libgo/mkrsysinfo.sh b/libgo/mkrsysinfo.sh
--- a/libgo/mkrsysinfo.sh
+++ b/libgo/mkrsysinfo.sh
@@ -36,6 +36,10 @@ grep -v '^// ' gen-sysinfo.go | \
grep '^type _arpcom ' gen-sysinfo.go | \
sed -e 's/_in6_addr/[16]byte/' >> ${OUT}
+# Same on Solaris for _mld_hdr_t.
+grep '^type _mld_hdr_t ' gen-sysinfo.go | \
+ sed -e 's/_in6_addr/[16]byte/' >> ${OUT}
+
# The time structures need special handling: we need to name the
# types, so that we can cast integers to the right types when
# assigning to the structures.
diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh
--- a/libgo/mksysinfo.sh
+++ b/libgo/mksysinfo.sh
@@ -48,6 +48,10 @@ grep -v '^// ' gen-sysinfo.go | \
grep '^type _arpcom ' gen-sysinfo.go | \
sed -e 's/_in6_addr/[16]byte/' >> ${OUT}
+# Same on Solaris for _mld_hdr_t.
+grep '^type _mld_hdr_t ' gen-sysinfo.go | \
+ sed -e 's/_in6_addr/[16]byte/' >> ${OUT}
+
# The errno constants. These get type Errno.
egrep '#define E[A-Z0-9_]+ ' errno.i | \
sed -e 's/^#define \(E[A-Z0-9_]*\) .*$/const \1 = Errno(_\1)/' >> ${OUT}