Patchwork libgo patch committed: Add Solaris support to mksysinfo.sh

login
register
mail settings
Submitter Rainer Orth
Date Jan. 14, 2011, 4:04 p.m.
Message ID <yddoc7jpj43.fsf@manam.CeBiTec.Uni-Bielefeld.DE>
Download mbox | patch
Permalink /patch/78933/
State New
Headers show

Comments

Rainer Orth - Jan. 14, 2011, 4:04 p.m.
Ian Lance Taylor <iant@google.com> writes:

> Oh yeah, fixed with this patch.  Bootstrapped on
> x86_64-unknown-linux-gnu.  Committed to mainline.

Thanks, but there's another necessary change.  Since your patch not to
dump float80 any longer, _u?pad128_t aren't included in sysinfo.go
anymore:

// type _pad128_t struct { _q INVALID-float-80; }
// type _upad128_t struct { _q INVALID-float-80; }

but are needed in the definition of _fxsave_state:

type _fxsave_state struct { fx_fcw uint16; fx_fsw uint16; fx_fctw uint16; fx_fop uint16; fx_eip uint32; fx_cs uint16; __fx_ign0 uint16; fx_dp uint32; fx_ds uint16; __fx_ign1 uint16; fx_mxcsr uint32; fx_mxcsr_mask uint32; fx_st [7+1]struct { fpr_16 [4+1]uint16; }; fx_xmm [7+1]_upad128_t; __fx_ign2 [13+1]_upad128_t; }
type _xsave_state struct { xs_fxsave _fxsave_state; xs_xstate_bv uint64; xs_rsv_mbz [1+1]uint64; xs_reserved [4+1]uint64; xs_ymm [15+1]_upad128_t; }
type _fpchip_state struct { state [26+1]uint32; status uint32; mxcsr uint32; xstatus uint32; __pad [1+1]uint32; xmm [7+1]_upad128_t; }

This patch fixes this by emitting another variant of the unions
instead.  It allowed me to get further along with the libgo bootstrap on
Solaris 10 and 11/x86 (more to follow separately).

Ok for mainline?

	Rainer


2011-01-14  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* mksysinfo.sh (_pad128_t): Define if commented.
	(_upad128_t): Likewise.
Ian Taylor - Jan. 14, 2011, 6:42 p.m.
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:

> 2011-01-14  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
>
> 	* mksysinfo.sh (_pad128_t): Define if commented.
> 	(_upad128_t): Likewise.

Committed.

Thanks.

Ian

Patch

diff -r d41829b039be libgo/mksysinfo.sh
--- a/libgo/mksysinfo.sh	Fri Jan 14 10:14:45 2011 +0100
+++ b/libgo/mksysinfo.sh	Fri Jan 14 10:24:54 2011 +0100
@@ -1,6 +1,6 @@ 
 #!/bin/sh
 
-# Copyright 2009 The Go Authors. All rights reserved.
+# Copyright 2009, 2011 The Go Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
@@ -250,6 +250,15 @@ 
   exit 1
 fi
 
+# Solaris 2 needs _u?pad128_t, but its default definition in terms of long
+# double is commented by -fdump-go-spec.
+if grep "^// type _pad128_t" gen-sysinfo.go > /dev/null 2>&1; then
+  echo "type _pad128_t struct { _l [4]int32; }" >> ${OUT}
+fi
+if grep "^// type _upad128_t" gen-sysinfo.go > /dev/null 2>&1; then
+  echo "type _upad128_t struct { _l [4]uint32; }" >> ${OUT}
+fi
+
 # 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.