Commit Graph

812 Commits

Author SHA1 Message Date
Ian Lance Taylor 4729d7726b re PR go/65349 (go tool crashes, can't compile go code on 32bit linux systems)
PR go/65349
runtime: Don't call malloc from __go_file_line callback.

When crashing, we call runtime_printcreatedby which calls
__go_file_line which used to call the Go malloc.  If we are
crashing due to a signal due to heap corruption of some sort,
the GO malloc lock might already be held, leading to a crash
within a crash.  Avoid that by assuming that the libbacktrace
strings will stick around, as we already do in go-callers.c.

From-SVN: r221291
2015-03-09 23:40:58 +00:00
Ian Lance Taylor c271e224c2 libgo: Upgrade to Go 1.4.2 release.
From-SVN: r221245
2015-03-06 16:19:05 +00:00
Ian Lance Taylor 898c81f831 mksysinfo.sh: Remove _zone_net_addr_t handling.
From Rainer Orth.

The recent godump changes broke Solaris 11.1+ bootstrap in
libgo: before, gen-sysinfo.so had

type _zone_net_addr_t struct { zna_family uint16; zna_plen uint16; zna_addru struct { znau_addr6 _in6_addr; }; }

which was filtered out by mksysinfo.sh due to the use of
_in6_addr.

After the change, there's now

type _zone_net_addr_t struct { zna_family uint16; zna_plen uint16; zna_addru struct { znau_addr6 [16]byte; Godump_0_align [0]uint32; }; }

instead, not filtered, but added a second time by the
_zone_net_addr_t code in mksysinfo.sh, which leads to
redefinition warnings/errors.

Simply removing the old _zone_net_addr_t fragment fixes this
and restores bootstrap.

From-SVN: r220481
2015-02-06 16:18:14 +00:00
Ian Lance Taylor 8c5c44aa7e runtime: Add memprofilerate to GODEBUG
Add memprofilerate as a value recognized
in the GODEBUG env var.  The value provided
is used as the new setting for
runtime.MemProfileRate, allowing the user
to adjust memory profiling.

From-SVN: r220470
2015-02-06 05:03:22 +00:00
Ian Lance Taylor bfdd75a859 go/types: Remove unused testdata files.
The go/types package was removed in July 2013, but the
testdata files were accidentally left behind.

From-SVN: r220378
2015-02-03 21:39:27 +00:00
Ian Lance Taylor ba986acb05 re PR go/64573 (Cmd.Start swallows error from fork()/clone())
PR go/64573
syscall: Restore line somehow lost in libgo merge.

From-SVN: r220068
2015-01-23 23:45:04 +00:00
Ian Lance Taylor 9d8d3ba2bc re PR go/64725 (FAIL: libgo/runtime TestFinalizerType testing.go:278: #2: finalizer for type func(*int) didn't run)
PR go/64725
runtime: Disable tests that require that a finalizer run.

From-SVN: r220067
2015-01-23 23:22:29 +00:00
Ian Lance Taylor e0a0c2f4c6 re PR go/64595 (go programs abort when debug info is stripped)
PR go/64595
runtime: Don't crash in runtime_callers if no debug info available.

From-SVN: r220057
2015-01-23 19:49:53 +00:00
Ian Lance Taylor 6632034718 runtime: Add the Go language version information to the Version output.
From-SVN: r219976
2015-01-21 23:03:41 +00:00
Ian Lance Taylor 73cb399d51 re PR go/64683 (FAIL: runtime/pprof -- testing.go:278: The entry did not match)
PR go/64683
runtime/pprof: Let memory profiler test pass if value not collected.

Since gccgo's GC is not precise, the transient value may not
be collected.  Let the regexp match that case as well.

From-SVN: r219900
2015-01-20 16:11:36 +00:00
Ian Lance Taylor cea526b81c runtime: No special case for 386 complex in FFI support.
All supported libgo 386 targets now have complex support in
libffi.

From Uros Bizjak.

From-SVN: r219877
2015-01-20 04:18:12 +00:00
Richard Henderson 3bac62c2b2 Add attribute unused to dummy arguments in ffi stub
From-SVN: r219862
2015-01-19 14:10:59 -08:00
Ian Lance Taylor b077669c47 reflect: Fix build for systems that do not define ffi_go_closure.
From-SVN: r219831
2015-01-19 02:56:28 +00:00
Ian Lance Taylor 0f59f5c120 runtime: Add __sparc__ case for SETCONTEXT_CLOBBERS_TLS.
The glibc setcontext incorrectly modifies %g7 on SPARC.

From Richard Henderson.

From-SVN: r219778
2015-01-16 23:23:31 +00:00
Ian Lance Taylor 20780a006f testing/quick: Revert Alpha specific change.
No longer needed now that libffi supports complex types.

From-SVN: r219777
2015-01-16 23:19:20 +00:00
Richard Henderson 38bf819a5f compiler, reflect, runtime: Use static chain for closures.
Change from using __go_set_closure to passing the closure
value in the static chain field.  Uses new backend support for
setting the closure chain in a call from C via
__builtin_call_with_static_chain.  Uses new support in libffi
for Go closures.

The old architecture specific support for reflect.MakeFunc is
removed, replaced by the libffi support.

All work done by Richard Henderson.

	* go-gcc.cc (Gcc_backend::call_expression): Add chain_expr argument.
	(Gcc_backend::static_chain_variable): New method.

From-SVN: r219776
2015-01-16 22:58:53 +00:00
Ian Lance Taylor 72d7151a72 net: Restore earlier Solaris-specific version of setKeepAlivePeriod.
The version from the master repository seems to be appropriate
for OpenSolaris but not for Solaris itself.  Solaris 11.2
proper does not define TCP_KEEPIDLE or TCP_KEEPINTVL.

From-SVN: r219749
2015-01-16 15:57:32 +00:00
Ian Lance Taylor cb054b6341 runtime: Use a struct, not void, for an empty struct for libffi.
A recent libffi upgrade caused the reflect test to fail on
386.  The problem case is a function that returns an empty
struct--a struct with no fields.  The libffi library does not
recognize the existence of empty structs, presumably since
they can't happen in C.  To work around this, the Go interface
to the libffi library changes an empty struct to void.  This
normally works fine, but with the new libffi upgrade it fails
for a function that returns an empty struct.  On 386 a
function that returns a struct is expected to pop the hidden
pointer when it returns.  So when we convert an empty struct
to void, libffi is calling a function that pops the hidden
pointer but does not expect that to happen.

In the older version of libffi, this didn't matter, because
the libffi code for 386 used a frame pointer, so the fact that
the stack pointer was wonky when the function returned was
ignored as the stack pointer was immediately replaced by the
saved frame pointer.  In the newer version of libffi, the 386
code is more efficient and does not use a frame pointer, and
therefore it matters whether libffi expects the function to
pop the hidden pointer or not.

This patch changes libgo to convert an empty to a struct with
a single field of type void.  This seems to be enough to get
the test cases working again.

Of course the real fix would be to change libffi to handle
empty types, but as libffi uses size == 0 as a marker for an
uninitialized type, that would be a non-trivial change.

From-SVN: r219701
2015-01-16 02:54:13 +00:00
Ian Lance Taylor 1d59990631 go/build: cgo works on linux/alpha.
From Uros Bizjak.

From-SVN: r219691
2015-01-15 22:06:54 +00:00
Ian Lance Taylor 4c16468417 reflect: Correct error in conversion of s390x support to Go 1.4.
From-SVN: r219685
2015-01-15 20:42:43 +00:00
Ian Lance Taylor d5d9c650a2 libgo: Bump version number in libgo configure script.
From-SVN: r219629
2015-01-15 00:52:38 +00:00
Ian Lance Taylor 3307c079d5 Add files somehow left out of last commit (upgrade to Go 1.4).
From-SVN: r219628
2015-01-15 00:40:25 +00:00
Ian Lance Taylor f8d9fa9e80 libgo, compiler: Upgrade libgo to Go 1.4, except for runtime.
This upgrades all of libgo other than the runtime package to
the Go 1.4 release.  In Go 1.4 much of the runtime was
rewritten into Go.  Merging that code will take more time and
will not change the API, so I'm putting it off for now.

There are a few runtime changes anyhow, to accomodate other
packages that rely on minor modifications to the runtime
support.

The compiler changes slightly to add a one-bit flag to each
type descriptor kind that is stored directly in an interface,
which for gccgo is currently only pointer types.  Another
one-bit flag (gcprog) is reserved because it is used by the gc
compiler, but gccgo does not currently use it.

There is another error check in the compiler since I ran
across it during testing.

gotools/:
	* Makefile.am (go_cmd_go_files): Sort entries.  Add generate.go.
	* Makefile.in: Rebuild.

From-SVN: r219627
2015-01-15 00:27:56 +00:00
Ian Lance Taylor bb782ca3ec cmd/go: Back-port CL 157460043 (pass $CGO_LDFLAGS to linker with the "gccgo" toolchain).
From-SVN: r219419
2015-01-10 01:01:10 +00:00
Ian Lance Taylor b44fb4c37a cmd/go: Adjust finding gccgo to match current upstream sources.
From-SVN: r219406
2015-01-09 21:18:04 +00:00
Ian Lance Taylor d9ebff44bb cmd/go: Use builtin constant to set default gccgo compiler.
Don't look it up on PATH.  This lets a go tool built as part
of a GCC build use the gccgo from the same build.

Also pass -c when assembling a .s file with gccgo.

From-SVN: r219358
2015-01-08 20:32:42 +00:00
Ian Lance Taylor 7d7d64c1ae libgo: Add sources for go, cgo, and gofmt commands.
The new commands are not yet built.  That will be done
separately.

Also include a few changes to go/build to support them.

From-SVN: r219272
2015-01-06 23:26:02 +00:00
Ian Lance Taylor 24fa8749bb re PR go/61871 (FAIL: regexp from libgo testsuite on non-split stack targets)
PR go/61871
runtime: Increase stack size on 64-bit non-split-stack systems.

From Uros Bizjak.

From-SVN: r219192
2015-01-05 16:13:06 +00:00
Ian Lance Taylor bca4b95c4a runtime: Remove undefined references to runtime_race*.
From-SVN: r219049
2014-12-23 20:33:53 +00:00
Ian Lance Taylor 658b028ad0 mksysinfo: Pass -O to compiler to avoid warnings on CentOS.
From Uros Bizjak.
https://gcc.gnu.org/ml/gcc-patches/2014-12/msg01366.html

From-SVN: r218819
2014-12-17 14:26:55 +00:00
Ian Lance Taylor 9ac18f8c2a re PR go/61258 (gccgo: assertion failure go-map-delete.c:37 [GoSmith])
PR go/61258
runtime: Don't crash when deleting zero-sized key.

From-SVN: r218702
2014-12-13 01:58:46 +00:00
Ian Lance Taylor e846322c86 testing: Add testing.MainStart function.
This patches in the Go 1.4 function, for convenience for
people using the Go 1.4 go tool with mainline gccgo.

From-SVN: r218700
2014-12-13 01:00:49 +00:00
Ian Lance Taylor c31fc2f424 runtime: Clear stack pointers for extra G's.
Fix an unusual C to Go callback case.  Newly created C threads
call into Go code, forcing the Go code to allocate new M and G
structures.  While executing Go code, the stack is split.  The
Go code then returns.  Returning from a Go callback is treated
as entering a system call, so the G gcstack field is set to
point to the Go stack.  In this case, though, we were called
from a newly created C thread, so we drop the extra M and G
structures.  The C thread then exits.

Then a new C thread calls into Go code, reusing the previously
created M and G.  The Go code requires a larger stack frame,
causing the old stack segment to be unmapped and a new stack
segment allocated.  At this point the gcstack field is
pointing to the old stack segment.

Then a garbage collection occurs.  The garbage collector sees
that the gcstack field is not nil, so it scans it as the first
stack segment.  Unfortunately it points to memory that was
unmapped.  So the program crashes.

The fix is simple: when handling extra G structures created
for callbacks from new C threads, clear the gcstack field.

From-SVN: r218699
2014-12-13 00:52:20 +00:00
Kyrylo Tkachov 69aef6dcdc Add load of target-utils.exp to libatomic, libitm, libvtv, libgo testsuite drivers
* testsuite/lib/libatomic.exp: Load target-utils.exp

	* testsuite/lib/libitm.exp: Load target-utils.exp.
	Move load of target-supports.exp earlier.

	* testsuite/lib/libvtv.exp: Load target-utils.exp

From-SVN: r218664
2014-12-12 12:00:01 +00:00
Ian Lance Taylor 4368bc4589 runtime: introduce mvifdiff.sh script to replace GCC's move-if-change
This goes towards making libgo more self-contained.

From-SVN: r218198
2014-12-01 01:06:29 +00:00
Ian Lance Taylor 6f7ccafa91 runtime: GOARCH values for ppc64 BE & LE
ppc64 for BE
ppc64le for LE
issue 8654

From-SVN: r217941
2014-11-21 18:22:05 +00:00
Ian Lance Taylor 4c46b5f0c2 runtime: set library name based on compiler name
Different compilers may have different release cadences or ABI
incompatibilities, so it does not make sense to use the same library
name for runtime libraries intended for different compilers.

This CL causes a libgo built by llgo to receive the name libgo-llgo.
Likewise, libgobegin is named libgobegin-llgo.

From-SVN: r217583
2014-11-14 18:02:50 +00:00
Ian Lance Taylor 327a26a3af libgo: Update libtool support to files in current GCC trunk.
From-SVN: r217404
2014-11-12 03:51:36 +00:00
Dominik Vogt 4ad4ebfeae runtime: Use stckf unconditionally on s390.
2014-11-05  Dominik Vogt  <vogt@linux.vnet.ibm.com>

* libgo/runtime/runtime.c (runtime_cputicks): s390: use stckf
unconditionally

From-SVN: r217195
2014-11-06 17:00:13 +00:00
Dominik Vogt 5c2648fb01 mksysinfo: Tolerate missing structures in upcase_fields.
2014-11-06  Dominik Vogt  <vogt@linux.vnet.ibm.com>

* libgo/mksysinfo.sh: Tolerate missing structures.

From-SVN: r217194
2014-11-06 16:44:32 +00:00
Ian Lance Taylor c9bc4e2d2b sync/atomic: fix data races in tests
Backport https://codereview.appspot.com/111320044 from Go
master library.

From-SVN: r217110
2014-11-05 03:39:49 +00:00
Ian Lance Taylor 1fec5f5274 libgo: add s390 support
From Dominik Vogt.

* libgo/go/syscall/libcall_linux_s390.go: New file for s390 support.
* libgo/go/syscall/syscall_linux_s390.go: Ditto.
* libgo/go/syscall/libcall_linux_s390x.go: New file for s390x support.
* libgo/go/syscall/syscall_linux_s390x.go: Ditto.
* libgo/go/runtime/pprof/pprof.go (printStackRecord): Support s390 and
s390x.
* libgo/runtime/runtime.c (runtime_cputicks): Add support for s390 and
s390x
* libgo/mksysinfo.sh: Ditto.
(upcase_fields): New helper function

* libgo/go/debug/elf/file.go (applyRelocations): Implement relocations
on s390x.
(applyRelocationsS390x): Ditto.
(DWARF): Ditto.
* libgo/go/debug/elf/elf.go (R_390): New constants for S390 relocations.
(r390Strings): Ditto.
(String): Helper function for S390 relocations.
(GoString): Ditto.

* libgo/go/reflect/makefuncgo_s390.go: New file.
(S390MakeFuncStubGo): Implementation of s390 abi.
* libgo/go/reflect/makefuncgo_s390x.go: New file.
(S390xMakeFuncStubGo): Implementation of s390x abi.
* libgo/go/reflect/makefunc_s390.c: New file.
(makeFuncStub): s390 and s390x specific implementation of function.
* libgo/go/reflect/makefunc.go
(MakeFunc): Add support for s390 and s390x.
(makeMethodValue): Ditto.
(makeValueMethod): Ditto.
* libgo/Makefile.am (go_reflect_makefunc_s_file): Ditto.
(go_reflect_makefunc_file): Ditto.
* libgo/go/reflect/makefunc_dummy.c: Ditto.
* libgo/runtime/runtime.h (__go_makefunc_can_recover): Export prototype
for use in makefunc_s390.c.
(__go_makefunc_returning): Ditto.

* libgo/go/syscall/exec_linux.go (forkAndExecInChild): Fix order of the
arguments of the clone system call for s390[x].

* libgo/configure.ac (is_s390): New variable.
(is_s390x): Ditto
(LIBGO_IS_S390): Ditto.
(LIBGO_IS_S390X): Ditto.
(GOARCH): Support s390 and s390x.
* libgo/go/go/build/build.go (cgoEnabled): Ditto.
* libgo/go/go/build/syslist.go (goarchList): Ditto.

From-SVN: r217106
2014-11-04 22:39:30 +00:00
Ian Lance Taylor 24606f7137 runtime: use "$GOC -dumpversion" instead of BASE-VER to discover compiler version
From-SVN: r217049
2014-11-03 16:30:51 +00:00
Ian Lance Taylor 5d51c2d70c debug/elf: add power64 support along with relocation test
Backport of https://codereview.appspot.com/125910043 from the
dev.power64 branch of the master repository.

From-SVN: r216813
2014-10-28 22:57:35 +00:00
Ian Lance Taylor 3a21b777bb libgo: Add consts for ioctl
TIOCSWINSZ_val, TCGETS_val, TCSETS_val

From-SVN: r216807
2014-10-28 18:18:39 +00:00
Ian Lance Taylor 50a504654d libgo: Update to Go 1.3.3 release.
From-SVN: r216746
2014-10-27 16:57:33 +00:00
Ian Lance Taylor 0f2aeaa817 compiler, runtime: Add type information to single object allocation.
From-SVN: r216490
2014-10-20 19:12:44 +00:00
Ian Lance Taylor 7b28fa2c6b reflect: allocate correct type in assignTo and cvtT2I
Backport https://codereview.appspot.com/155450044 from the
master Go library.  Original description:

I came across this while debugging a GC problem in gccgo.
There is code in assignTo and cvtT2I that handles assignment
to all interface values.  It allocates an empty interface even
if the real type is a non-empty interface.  The fields are
then set for a non-empty interface, but the memory is recorded
as holding an empty interface.  This means that the GC has
incorrect information.

This is extremely unlikely to fail, because the code in the GC
that handles empty interfaces looks like this:

obj = nil;
typ = eface->type;
if(typ != nil) {
        if(!(typ->kind&KindDirectIface) || !(typ->kind&KindNoPointers))
                obj = eface->data;

In the current runtime the condition is always true--if
KindDirectIface is set, then KindNoPointers is clear--and we
always want to set obj = eface->data.  So the question is what
happens when we incorrectly store a non-empty interface value
in memory marked as an empty interface.  In that case
eface->type will not be a *rtype as we expect, but will
instead be a pointer to an Itab.  We are going to use this
pointer to look at a *rtype kind field.  The *rtype struct
starts out like this:

type rtype struct {
        size          uintptr
        hash          uint32            // hash of type; avoids computation in hash tables
        _             uint8             // unused/padding
        align         uint8             // alignment of variable with this type
        fieldAlign    uint8             // alignment of struct field with this type
        kind          uint8             // enumeration for C

An Itab always has at least two pointers, so on a
little-endian 64-bit system the kind field will be the high
byte of the second pointer.  This will normally be zero, so
the test of typ->kind will succeed, which is what we want.

On a 32-bit system it might be possible to construct a failing
case by somehow getting the Itab for an interface with one
method to be immediately followed by a word that is all ones.
The effect would be that the test would sometimes fail and the
GC would not mark obj, leading to an invalid dangling
pointer.  I have not tried to construct this test.

I noticed this in gccgo, where this error is much more likely
to cause trouble for a rather random reason: gccgo uses a
different layout of rtype, and in gccgo the kind field happens
to be the low byte of a pointer, not the high byte.

From-SVN: r216489
2014-10-20 18:04:55 +00:00
Ian Lance Taylor 204b9fc2b8 configure: Quote some shell variables.
From Dominik Vogt.

From-SVN: r216355
2014-10-17 00:03:20 +00:00
Ian Lance Taylor 6c4ee063a5 runtime: Don't create threads with a small stack.
We want to create goroutines with a small stack, at least on
systems where split stacks are supported.  We don't need to
create threads with a small stack.

From-SVN: r216353
2014-10-16 22:39:45 +00:00
Ian Lance Taylor 19d4baed57 re PR go/60406 (recover.go: test13reflect2 test failure)
PR go/60406
runtime: Check callers in can_recover if return address	doesn't match.

Also use __builtin_extract_return_address and tighten up the
checks in FFI code.

Fixes PR 60406.

From-SVN: r216003
2014-10-08 14:03:13 +00:00
Ian Lance Taylor 22806403ec re PR go/61877 (reflect: cannot use []string as type string in Call)
PR go/61877
refect: fix direct call of variadic method value

As reported in bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61877
gcc mainline has regressed in this.  This CL adds the tests proposed
for the main Go repository:

        https://codereview.appspot.com/151280043/
        https://codereview.appspot.com/152060043/

restores the code from the amd64/386 path that makes this work and
was lost when the Go 1.3 stdlib was merged and changes the FFI path
to call into the same helper code as the amd64/386 path.

I've only tested this on amd64 but I did test a version that was
patched to unconditionally take the FFI path.

From-SVN: r215859
2014-10-03 15:51:38 +00:00
Ian Lance Taylor 60d9e9fc19 runtime: Check for CPU_COUNT itself, don't check glibc version.
Fixes issue 38.

From-SVN: r215832
2014-10-03 05:04:59 +00:00
Ian Lance Taylor a819231d57 libgo/configure: Use -Qunused-arguments for asm tests if supported.
This supports clang, which by default issues warnings about
unused command line arguments, a habit that interacts poorly
with configure scripts.

From-SVN: r215699
2014-09-29 23:37:27 +00:00
Ian Lance Taylor 76deefd0cd runtime: Mark runtime_goexit function as noinline.
If the compiler inlines this function into kickoff, it may reuse
the TLS block address to load g. However, this is not necessarily
correct, as the call to g->entry in kickoff may cause the TLS
address to change. If the wrong value is loaded for g->status in
runtime_goexit, it may cause a runtime panic.

By marking the function as noinline we prevent the compiler from
reusing the TLS address.

From-SVN: r215484
2014-09-22 21:14:43 +00:00
Ian Lance Taylor f0c1b5671a runtime: Restore copyright notice accidentally removed from mgc0.c.
From-SVN: r215423
2014-09-20 20:42:59 +00:00
Ian Lance Taylor 01c2fa9d53 runtime: Use the clone system call on GNU/Linux.
Without this we weren't supporting the standard Cloneflags
field of SysProcAttr.

From-SVN: r214972
2014-09-05 15:24:36 +00:00
Ian Lance Taylor a7188cc650 runtime: Use correct size for unsafe.Pointer GC instructions.
From-SVN: r214965
2014-09-05 14:43:24 +00:00
Chris Manghane f1d2ac4f84 compiler: Add precise type information on the heap.
* go-gcc.cc (Gcc_backend::implicit_variable): Remove init
	parameter.  Add is_hidden parameter.
	(Gcc_backend::implicit_variable_set_init): New method.
	(Gcc_backend::implicit_variable_reference): New method.

From-SVN: r214894
2014-09-03 22:56:09 +00:00
Ian Lance Taylor ab36d98dd2 runtime: Don't get confused if m changes during runtime_gc.
From-SVN: r214048
2014-08-15 22:16:55 +00:00
Ian Lance Taylor 798c183f7f compiler, runtime: Fix unexpected GC interfering with closure passing.
The Go frontend passes closures through to functions using the
functions __go_set_closure and __go_get_closure.  The
expectation is that there are no function calls between
set_closure and get_closure.  However, it turns out that there
can be function calls if some of the function arguments
require type conversion to an interface type.  Converting to
an interface type can allocate memory, and that can in turn
trigger a garbage collection, and that can in turn call pool
cleanup functions that may call __go_set_closure.  So the
called function can see the wrong closure value, which is bad.

This patch fixes the problem in two different ways.  First, we
move all type conversions in function arguments into temporary
variables so that they can not appear before the call to
__go_set_closure.  (This required shifting the flatten phase
after the simplify_thunk phase, since the latter expects to
work with unconverted argument types.)  Second, we fix the
memory allocation function to preserve the closure value
across any possible garbage collection.

A test case is the libgo database/sql check run with the
environment variable GOGC set to 1.

From-SVN: r213932
2014-08-13 22:31:44 +00:00
Ian Lance Taylor d79fe5971a runtime: Add casts to mincore call to compile on Solaris.
Based on patch from Rainer Orth.

From-SVN: r213599
2014-08-04 17:54:09 +00:00
Ian Lance Taylor dc14e88e07 re PR other/61895 (libbacktrace crashes with bus error with empty file argv[0])
PR other/61895

runtime: Ignore small argv[0] file for backtrace.

Reportedly in some cases Docker starts processes with argv[0]
pointing to an empty file.  That would cause libgo to pass
that empty file to libbacktrace, which would then fail to do
any backtraces.  Everything should work fine if libbacktrace
falls back to /proc/self/exe.

This patch to libgo works around the problem by ignoring
argv[0] if it is a small file, or if stat fails.  This is not
a perfect fix but it's an unusual problem.

From-SVN: r213513
2014-08-02 00:54:15 +00:00
Ian Lance Taylor d5d0580e64 runtime: remove unused variable
This variable is unused apparently as a result of local changes.
gccgo accepts this variable declaration, but other frontends may not.

From-SVN: r212873
2014-07-20 19:20:12 +00:00
Ian Lance Taylor aefa5ff4cf runtime: add a missing import
This adds an import of the runtime package to fix compilation
of the TestStopCPUProfilingWithProfilerOff function.

The gccgo compiler should never have accepted this.  The patch
for the comiler is http://codereview.appspot.com/116960043 .
The test is https://codereview.appspot.com/118000043 .

From-SVN: r212870
2014-07-20 15:09:04 +00:00
Ian Lance Taylor 1c2afaca89 runtime: also disable split stacks for runtime_snprintf function under Clang
From-SVN: r212862
2014-07-20 09:24:16 +00:00
Ian Lance Taylor dffa732835 reflect, runtime: Use libffi closures to implement reflect.MakeFunc.
Keep using the existing 386 and amd64 code on those archs,
since it is more efficient.

From-SVN: r212853
2014-07-19 21:36:26 +00:00
Ian Lance Taylor 90fe3cc61f libgo: Bump version number.
From-SVN: r212840
2014-07-19 10:12:01 +00:00
Ian Lance Taylor 00d86ac99f libgo: Update to Go 1.3 release.
From-SVN: r212837
2014-07-19 08:53:52 +00:00
Ian Lance Taylor 2fa39ad859 runtime: Merge master revision 19185.
This revision renames several files in the runtime directory
from .c to .goc.

From-SVN: r212472
2014-07-12 00:01:09 +00:00
Ian Lance Taylor c14e64d4ca runtime: Rename iface.goc to go-iface.goc.
Rename in order to avoid confusion with the new
runtime/iface.goc file in the Go library master sources.

From-SVN: r212447
2014-07-11 00:39:03 +00:00
Ian Lance Taylor 2802d48b30 runtime: Drop reflectFlags tests.
The flags were used by the reflect package in the past, but
not for a couple of years now.

From-SVN: r212446
2014-07-11 00:26:25 +00:00
Ian Lance Taylor 9490fda67a re PR go/61620 (FAIL: go.test/test/fixedbugs/bug242.go execution, -O2 -g)
PR go/61620

runtime: Don't free tiny blocks in map deletion.

The memory allocator now has a special case for tiny blocks
(smaller than 16 bytes) and they can not be explicitly freed.

From-SVN: r212233
2014-07-02 14:23:45 +00:00
Ian Lance Taylor ffa98da470 runtime: introduce build targets for running benchmarks
This introduces the "bench" build target, which can be used to run
all benchmarks.

It is also possible to run subsets of benchmarks with the
"package/check" build targets by setting GOBENCH to a matching regex.

From-SVN: r212212
2014-07-01 23:19:24 +00:00
Ian Lance Taylor 7b169c293d runtime: add missing benchmark input files to the repository
From-SVN: r211961
2014-06-24 23:52:47 +00:00
Ian Lance Taylor 2abacbaec7 re PR go/52583 (Several new go testsuite failues on Solaris)
PR go/52583
runtime: Stop backtrace at a few recognized functions.

On x86_64 Solaris the makecontext function does not properly
indicate that it is at the top of the stack.  Attempting to
unwind the stack past a call to makecontext tends to crash.
This patch changes libgo to look for certain functions that
are always found at the top of the stack, and to stop
unwinding when it reaches one of those functions.  There is
never anything interesting past these functions--that is,
there is never any code written by the user.

From-SVN: r211640
2014-06-13 13:56:14 +00:00
Ian Lance Taylor eec40eac83 re PR go/61498 (Many 64-bit Go tests SEGV in scanblock)
PR go/61498
runtime: Always set gcnext_sp to pointer-aligned address.

The gcnext_sp field is only used on systems that do not use
split stacks.  It marks the bottom of the stack for the
garbage collector.  This change makes sure that the stack
bottom is always aligned to a pointer value.

Previously the garbage collector would align all the addresses
that it scanned, but it now expects them to be aligned before
scanning.

From-SVN: r211639
2014-06-13 13:50:13 +00:00
Ian Lance Taylor 816002df70 runtime: Initialize variable to avoid compiler warning.
From-SVN: r211394
2014-06-10 00:36:38 +00:00
Ian Lance Taylor 6736ef96ea libgo: Merge to master revision 19184.
The next revision, 19185, renames several runtime files, and
will be handled in a separate change.

From-SVN: r211328
2014-06-06 22:37:27 +00:00
Ian Lance Taylor bae90c989c libgo: Merge from revision 18783:00cce3a34d7e of master library.
This revision was committed January 7, 2014.  The next
revision deleted runtime/mfinal.c.  That will be done in a
subsequent merge.

This merge changes type descriptors to add a zero field,
pointing to a zero value for that type.  This is implemented
as a common variable.

	* go-gcc.cc (Gcc_backend::implicit_variable): Add is_common and
	alignment parameters.  Permit init parameter to be NULL.

From-SVN: r211249
2014-06-04 23:15:33 +00:00
Ian Lance Taylor 7480a39b77 runtime: Use _mm_pause rather than __builtin_ia32_pause.
Based on a patch from Peter Collingbourne.

From-SVN: r211081
2014-05-30 13:53:58 +00:00
Ian Lance Taylor 9a85ed03da runtime: add the --without-libatomic configure option
This adds the --without-libatomic configure option, which is useful for building libgo
with a non-gcc compiler.

It disables libgo's dependency on libatomic. This
is useful for platforms where it is known that the libatomic runtime
functions are not required, or where the compiler automatically
provides an implementation of them.

From-SVN: r211065
2014-05-29 20:22:27 +00:00
Ian Lance Taylor d76a1885bd runtime: disable split stacks for runtime_printf function under Clang
LLVM's code generator does not currently support split stacks for vararg
functions, so we disable split stacks for the only function that uses this
feature under Clang. This appears to be OK as long as:
- this function only calls non-inlined, internal-linkage (hence no dynamic
  loader) functions compiled with split stacks (i.e. go_vprintf), which can
  allocate more stack space as required;
- this function itself does not occupy more than BACKOFF bytes of stack space
  (see libgcc/config/i386/morestack.S).
These conditions are currently known to be satisfied by Clang on x86-32 and
x86-64. Note that signal handlers receive slightly less stack space than they
would normally do if they happen to be called while this function is being
run. If this turns out to be a problem we could consider increasing BACKOFF.

From-SVN: r211037
2014-05-29 00:03:30 +00:00
Ian Lance Taylor 93c521ea9c runtime: fix misc gcc-isms and undefined behavior
This includes the use of __complex and __builtin_ functions where
unprefixed entities would suffice, and the use of a union for
bit-casting between types.

From-SVN: r211036
2014-05-28 23:10:47 +00:00
Ian Lance Taylor 25e4b0497b libgo/runtime: fix unused-result warning
Result of runtime_write is ignored, causing
an unused-result result warning (error in my
case, with -Werror=unused-result).

From-SVN: r210987
2014-05-27 22:01:21 +00:00
Ian Lance Taylor 44d5790f7b mksysinfo: Define some more non-trivial TIOC constants.
From-SVN: r210192
2014-05-07 22:22:29 +00:00
Ian Lance Taylor d3b4df0b17 mksysinfo: Define CLONE flags.
From-SVN: r210189
2014-05-07 21:48:29 +00:00
Ian Lance Taylor 6c76a95d1b runtime: ask $GOC rather than $CC for the version and multi-os-directory
The Go compiler may have different values for these than the C compiler.

From-SVN: r209967
2014-05-01 00:35:58 +00:00
Ian Lance Taylor 9490b8da72 re PR go/60931 (libgo has issues when page size is not 4k)
PR go/60931

runtime: Fix garbage collector issue with non 4kB system page size

The go garbage collector tracks memory in terms of 4kB pages.
Most of the code checks getpagesize() at runtime and does the
right thing.

On a 64kB ppc64 box I see SEGVs in long running processes
which has been diagnosed as a bug in scavengelist.
scavengelist does a madvise(MADV_DONTNEED) without rounding
the arguments to the system page size.  A strace of one of the
failures shows the problem:

madvise(0xc211030000, 4096, MADV_DONTNEED) = 0

The kernel rounds the length up to 64kB and we mark 60kB of
valid data as no longer needed.

Round start up to a system page and end down before calling
madvise.

From-SVN: r209777
2014-04-25 04:29:07 +00:00
Ian Lance Taylor 5584c49a11 gofrontend: deduplicate C syscall function declarations
A gccgo language extension allows a function to be declared multiple
times. Avoid the use of this extension by dedeplicating declarations
in mksyscall.awk.

From-SVN: r209508
2014-04-17 23:39:23 +00:00
Ian Lance Taylor e8ad3ca026 runtime: remove use of obsolete map deletion syntax
The use of this syntax was eliminated upstream in Go 992248b2adc2,
but this particular use slipped through somehow.

From-SVN: r209506
2014-04-17 23:27:31 +00:00
Ian Lance Taylor e315e8a5b9 gofrontend: avoid use of unsafe.Sizeof extension
Avoid the use of a gccgo language extension which allows unsafe.Sizeof
to accept a type by passing an expression of the relevant type.

From-SVN: r209503
2014-04-17 23:13:39 +00:00
Ian Lance Taylor 73cc28d4e7 libgo: Remove Solaris 8 & 9 support.
From Rainer Orth.

From-SVN: r209448
2014-04-16 20:33:57 +00:00
Chris Manghane 7035307e8f Sync to current external repository.
user:        Ian Lance Taylor <iant@golang.org>
date:        Thu Apr 10 09:25:24 2014 -0700
files:       go/expressions.cc
description:
compiler: add checks for constant overflow

Prevent extremely large constants from eating all of memory.


user:        Chris Manghane <cmang@golang.org>
date:        Mon Apr 07 16:57:09 2014 -0700
files:       go/gogo-tree.cc go/gogo.cc go/gogo.h go/statements.cc
description:
compiler: Use backend interface for variable initialization.


user:        Chris Manghane <cmang@golang.org>
date:        Thu Apr 03 19:56:05 2014 -0700
files:       go/backend.h go/gogo-tree.cc go/gogo.cc go/gogo.h
description:
compiler: Use backend interface to build function code.


changeset:   1269:6e30875d539e
user:        Chris Manghane <cmang@golang.org>
date:        Wed Apr 02 13:16:00 2014 -0700
files:       go/backend.h go/gogo-tree.cc go/gogo.cc go/gogo.h
description:
compiler: Use backend interface for building function defer wrappers.


user:        Chris Manghane <cmang@golang.org>
date:        Mon Mar 31 12:42:49 2014 -0700
files:       go/expressions.cc go/gogo-tree.cc go/gogo.cc go/gogo.h
description:
compiler: Use backend interface for memory allocation.


user:        Chris Manghane <cmang@golang.org>
date:        Thu Mar 27 14:22:49 2014 -0700
files:       go/backend.h go/expressions.cc go/expressions.h
description:
compiler: Use backend interface for fixed array construction.


user:        Chris Manghane <cmang@golang.org>
date:        Mon Mar 17 21:25:04 2014 -0700
files:       go/expressions.cc
description:
compiler: Check for loops in self-referential array types. Fixes issue 7525.


user:        Chris Manghane <cmang@golang.org>
date:        Mon Mar 17 14:31:59 2014 -0700
files:       go/gogo.cc go/parse.cc
description:
compiler: Don't declare blank labels. Fixes issue 7539.


user:        Chris Manghane <cmang@golang.org>
date:        Mon Mar 17 13:12:32 2014 -0700
files:       go/backend.h go/expressions.cc go/expressions.h go/runtime.def
description:
compiler: Use backend interface for call expressions.


user:        Chris Manghane <cmang@golang.org>
date:        Wed Mar 12 13:34:27 2014 -0700
files:       go/expressions.cc go/expressions.h go/gogo-tree.cc go/statements.cc
description:
compiler: Use backend interface map construction.


user:        Chris Manghane <cmang@golang.org>
date:        Tue Mar 11 12:53:06 2014 -0700
files:       go/backend.h go/expressions.cc go/gogo-tree.cc go/gogo.h
description:
compiler: Use backend interface for string expressions.


user:        Chris Manghane <cmang@golang.org>
date:        Sat Mar 08 15:56:59 2014 -0800
files:       go/backend.h go/expressions.cc go/expressions.h
description:
compiler: Use backend interface for array and string indexing.


user:        Chris Manghane <cmang@golang.org>
date:        Fri Mar 07 16:02:18 2014 -0800
files:       go/expressions.cc
description:
compiler: Use backend interface for constant expressions.


user:        Chris Manghane <cmang@golang.org>
date:        Thu Mar 06 16:00:18 2014 -0800
files:       go/expressions.cc
description:
compiler: Use backend interface for struct construction.


user:        Chris Manghane <cmang@golang.org>
date:        Wed Mar 05 13:09:37 2014 -0800
files:       go/expressions.cc
description:
compiler: Use backend interface for type conversions.


user:        Chris Manghane <cmang@golang.org>
date:        Tue Mar 04 07:03:47 2014 -0800
files:       go/expressions.cc go/expressions.h go/gogo-tree.cc go/gogo.h go/runtime.def libgo/runtime/chan.c
description:
compiler: Use backend interface for channel receive.


user:        Chris Manghane <cmang@golang.org>
date:        Mon Mar 03 15:18:57 2014 -0800
files:       go/backend.h go/expressions.cc go/runtime.def
description:
compiler: Use backend interface for builtin calls.


user:        Chris Manghane <cmang@golang.org>
date:        Mon Mar 03 07:44:35 2014 -0800
files:       go/expressions.cc go/expressions.h go/types.cc go/types.h
description:
compiler: Use backend interface for string info.


user:        Chris Manghane <cmang@golang.org>
date:        Fri Feb 28 10:45:55 2014 -0800
files:       go/expressions.cc go/expressions.h go/gogo-tree.cc go/statements.cc
description:
compiler: Use backend interface for map indexing.


user:        Chris Manghane <cmang@golang.org>
date:        Wed Feb 26 14:13:10 2014 -0800
files:       go/expressions.cc go/expressions.h
description:
compiler: Use backend interface for slice value expressions.


user:        Chris Manghane <cmang@golang.org>
date:        Wed Feb 26 13:12:19 2014 -0800
files:       go/backend.h go/expressions.cc go/expressions.h go/gogo-tree.cc go/runtime.def go/statements.cc
description:
compiler: Use backend interface for interface values.


user:        Chris Manghane <cmang@golang.org>
date:        Mon Feb 24 12:30:13 2014 -0800
files:       go/expressions.cc go/expressions.h go/parse.cc go/statements.cc
description:
compiler: Change Heap_composite_expression to Heap_expression.


user:        Chris Manghane <cmang@golang.org>
date:        Thu Feb 20 19:47:06 2014 -0800
files:       go/expressions.cc go/expressions.h go/gogo-tree.cc go/gogo.cc go/gogo.h go/types.cc go/types.h
description:
compiler: Use backend interface for interface method table expressions.


user:        Chris Manghane <cmang@golang.org>
date:        Mon Feb 03 14:36:20 2014 -0800
files:       go/expressions.cc go/expressions.h
description:
compiler: Add compound expressions to the frontend.


	* go-gcc.cc: Include "convert.h".
	(Gcc_backend::string_constant_expression): New function.
	(Gcc_backend::real_part_expression): Likewise.
	(Gcc_backend::imag_part_expression): Likewise.
	(Gcc_backend::complex_expression): Likewise.
	(Gcc_backend::constructor_expression): Likewise.
	(Gcc_backend::array_constructor_expression): Likewise.
	(Gcc_backend::pointer_offset_expression): Likewise.
	(Gcc_backend::array_index_expression): Likewise.
	(Gcc_backend::call_expression): Likewise.
	(Gcc_backend::exception_handler_statement): Likewise.
	(Gcc_backend::function_defer_statement): Likewise.
	(Gcc_backend::function_set_parameters): Likewise.
	(Gcc_backend::function_set_body): Likewise.
	(Gcc_backend::convert_expression): Handle various type
	conversions.

From-SVN: r209393
2014-04-14 22:43:47 +00:00
Ian Lance Taylor 33a9145bb7 libgo: Build math package with -ffp-contract=off on non-x86.
http://golang.org/issue/7074 shows that not using
-ffp-contract=off produces the wrong result for math.Log2(1)
on arm64.

From-SVN: r208505
2014-03-12 04:38:52 +00:00
Ian Lance Taylor 9c48398f49 runtime: Fix GC bug caused by Entersyscall modifying reg.
This patch fixes a rare but serious bug.  The Go garbage
collector only examines Go stacks.  When Go code calls a
function that is not written in Go, it first calls
syscall.Entersyscall.  Entersyscall records the position of
the Go stack pointer and saves a copy of all the registers.
If the garbage collector runs while the thread is executing
the non-Go code, the garbage collector fetches the stack
pointer and registers from the saved location.

Entersyscall saves the registers using the getcontext
function.  Unfortunately I didn't consider the possibility
that Entersyscall might itself change a register before
calling getcontext.  This only matters for callee-saved
registers, as caller-saved registers would be visible on the
saved stack.  And it only matters if Entersyscall is compiled
to save and modify a callee-saved register before it calls
getcontext.  And it only matters if a garbage collection
occurs while the non-Go code is executing.  And it only
matters if the only copy of a valid Go pointer happens to be
in the callee-saved register when Entersyscall is called.
When all those conditions are true, the Go pointer might get
collected incorrectly, leading to memory corruption.

This patch tries to avoid the problem by splitting
Entersyscall into two functions.  The first is a simple
function that just calls getcontext and then calls the rest of
Entersyscall.  This should fix the problem, provided the
simple Entersyscall function does not itself modify any
callee-saved registers before calling getcontext.  That seems
to be true on the systems I checked.  But since the argument
to getcontext is an offset from a TLS variable, it won't be
true on a system which needs to save callee-saved registers in
order to get the address of a TLS variable.  I don't know why
any system would work that way, but I don't know how to rule
it out.  I think that on any such system this will have to be
implemented in assembler.  I can't put the ucontext_t
structure on the stack, because this function can not split
stacks, and the ucontext_t structure is large enough that it
could cause a stack overflow.

From-SVN: r208390
2014-03-07 05:04:37 +00:00
Ian Lance Taylor a10d35a8ba libgo: Update to Go 1.2.1 release.
From-SVN: r208286
2014-03-03 20:14:52 +00:00
Ian Lance Taylor 91d6f071fb runtime: Use a better heap location on arm64 systems.
Before this, the heap location used on a 64-bit system was not
available to user-space on arm64, so the "32-bit" strategy ended up
being used.  So use somewhere that is available, and for bonus points
is far away from where the kernel allocates address space by default.

From-SVN: r207977
2014-02-21 03:24:03 +00:00
Ian Lance Taylor e3aaedd6bf ltmain.sh: Patch for Solaris.
From Rainer Orth.

From-SVN: r207432
2014-02-03 17:39:44 +00:00
Ian Lance Taylor f56c5dd19c libgo/configure: Test for gold with gccgo -Wl,--help, not ld --help.
From-SVN: r206937
2014-01-22 19:10:47 +00:00
Ian Lance Taylor 6fbfce7841 re PR go/59866 (gccgo gc work buffer is misaligned)
PR go/59866
runtime: Force work variable in mgc0 to be aligned on 8-byte boundary.

From-SVN: r206738
2014-01-17 22:43:03 +00:00
Ian Lance Taylor abd471378c runtime: fix 32-bit malloc for pointers >= 0x80000000
The spans array is allocated in runtime_mallocinit.  On a
32-bit system the number of entries in the spans array is
MaxArena32 / PageSize, which (2U << 30) / (1 << 12) == (1 << 19).
So we are allocating an array that can hold 19 bits for an
index that can hold 20 bits.  According to the comment in the
function, this is intentional: we only allocate enough spans
(and bitmaps) for a 2G arena, because allocating more would
probably be wasteful.

But since the span index is simply the upper 20 bits of the
memory address, this scheme only works if memory addresses are
limited to the low 2G of memory.  That would be OK if we were
careful to enforce it, but we're not.  What we are careful to
enforce, in functions like runtime_MHeap_SysAlloc, is that we
always return addresses between the heap's arena_start and
arena_start + MaxArena32.

We generally get away with it because we start allocating just
after the program end, so we only run into trouble with
programs that allocate a lot of memory, enough to get past
address 0x80000000.

This changes the code that computes a span index to subtract
arena_start on 32-bit systems just as we currently do on
64-bit systems.

From-SVN: r206501
2014-01-09 23:16:56 +00:00
Ian Lance Taylor 747639c28f re PR go/59430 (os/user FAILs on Solaris)
PR go/59430
os/user: Use POSIX functions on Solaris.

From-SVN: r206412
2014-01-08 01:08:29 +00:00
Ian Lance Taylor 2da4a7611b re PR go/59433 (Many 64-bit Go tests SEGV on Solaris)
PR go/59433
net: Don't use stack space for fd_sets when using select.

From-SVN: r206411
2014-01-08 00:42:45 +00:00
Ian Lance Taylor 71d0d50aa3 go/build: Set GOARCH on arm64 systems.
I am reliably informed that the architecture name and letter for the
plan9/inferno compilers for 64-bit ARM systems will be "arm64" and "7"
respectively, so let's get that bit in nice and early.

From Michael Hudson-Doyle.
https://codereview.appspot.com/34830045/

From-SVN: r206374
2014-01-06 19:24:23 +00:00
Ian Lance Taylor 9596ecdf8c runtime: Remove unused runtime_cpuid variables.
From-SVN: r206353
2014-01-06 03:01:58 +00:00
Ian Lance Taylor f89b66f5ad net: work around Solaris connect issue when server closes socket
On Solaris, if you do a in-progress connect, and then the
server accepts and closes the socket, the client's later
attempt to complete the connect will fail with EINVAL.  Handle
this case by assuming that the connect succeeded.  This code
is weird enough that it is implemented as Solaris-only so that
it doesn't hide a real error on a different OS.

See http://golang.org/issue/6828.

From-SVN: r206232
2013-12-28 18:00:30 +00:00
Ian Lance Taylor afc8adc88f re PR go/59506 (net FAILs (timeout) on alpha)
PR go/59506

net: use DialTimeout in TestSelfConnect

Backported from master repository.

This avoids problems with systems that take a long time to
find out nothing is listening, while still testing for the
self-connect misfeature since a self-connect should be fast.
With this we may be able to remove the test for non-Linux
systems.

Tested (on GNU/Linux) by editing selfConnect in
tcpsock_posix.go to always return false and verifying that
TestSelfConnect then fails with and without this change.

Idea from Uros Bizjak.

From-SVN: r206224
2013-12-27 21:42:26 +00:00
Uros Bizjak ce2b81bfce Revert unwanted commit.
From-SVN: r206201
2013-12-25 23:24:26 +01:00
Allan Sandfeld Jensen 74924838e8 re PR target/59422 (Support more targets for function multi versioning)
gcc/

2013-12-25  Allan Sandfeld Jensen  <sandfeld@kde.org>
	    H.J. Lu  <hongjiu.lu@intel.com>

	PR target/59422
	* config/i386/i386.c (get_builtin_code_for_version): Handle
	PROCESSOR_HASWELL, PROCESSOR_SILVERMONT, PROCESSOR_BTVER1,
	PROCESSOR_BTVER2, PROCESSOR_BDVER3 and PROCESSOR_BDVER4.
	Change priority of PROCESSOR_BDVER1 to P_PROC_XOP.
	(fold_builtin_cpu): Add "ivybridge", "haswell", "bonnell",
	"silvermont", "bobcat" and "jaguar" CPU names.  Add "sse4a",
	"fma4", "xop" and "fma" ISA names.

libgcc/

2013-12-25  Allan Sandfeld Jensen  <sandfeld@kde.org>
	    H.J. Lu  <hongjiu.lu@intel.com>

        PR target/59422
        * config/i386/cpuinfo.c (enum processor_types):  Add AMD_BOBCAT
	and AMD_JAGUAR.
	(enum processor_subtypes): Add AMDFAM15H_BDVER3, AMDFAM15H_BDVER4,
	INTEL_COREI7_IVYBRIDGE and INTEL_COREI7_HASWELL.
	(enum processor_features): Add  FEATURE_SSE4_A, FEATURE_FMA4,
	FEATURE_XOP and FEATURE_FMA.
	(get_amd_cpu): Handle AMD_BOBCAT, AMD_JAGUAR, AMDFAM15H_BDVER2 and
	AMDFAM15H_BDVER3.
	(get_intel_cpu): Handle INTEL_COREI7 and INTEL_COREI7_HASWELL.
        (get_available_features): Handle FEATURE_FMA, FEATURE_SSE4_A,
	FEATURE_FMA4 and FEATURE_XOP.

testsuite/

2013-12-25  Allan Sandfeld Jensen  <sandfeld@kde.org>

	PR target/59422
	* gcc.target/i386/funcspec-5.c (test_fma, test_xop, test_no_fma,
	test_no_xop, test_arch_corei7, test_arch_corei7_avx,
	test_arch_core_avx2, test_arch_bdver1, test_arch_bdver2,
	test_arch_bdver3, test_tune_corei7, test_tune_corei7_avx,
	test_tune_core_avx2, test_tune_bdver1, test_tune_bdver2 and
	test_tune_bdver3): New function prototypes.

From-SVN: r206200
2013-12-25 23:22:24 +01:00
Ian Lance Taylor 1635eab367 runtime: Fix defer of unlock thread at program startup.
Don't free stack allocated defer block.  Also ensure we have a
Go context in a few more places before freeing the block.

From-SVN: r205940
2013-12-12 20:13:58 +00:00
Ian Lance Taylor ea56ff71a4 reflect: Fix MakeFunc returning float32 or float64 on 386.
From-SVN: r205932
2013-12-12 17:44:01 +00:00
Ian Lance Taylor 547a416879 compiler, reflect, runtime: Implement method values in reflect.
From-SVN: r205913
2013-12-12 01:08:52 +00:00
Ian Lance Taylor b1d137cf58 reflect, runtime: Let reflect.MakeFunc functions call recover.
From-SVN: r205908
2013-12-11 23:43:16 +00:00
Ian Lance Taylor dccd3a9b62 re PR go/59408 (Many Go tests FAIL with notesleep not on g0)
PR go/59408
runtime: Don't require g != m->g0 in sema notesleep.

From-SVN: r205756
2013-12-06 18:26:27 +00:00
Ian Lance Taylor 50312b2ff0 runtime: Use pthread_sigmask instead of sigprocmask.
From-SVN: r205652
2013-12-04 01:35:53 +00:00
Ian Lance Taylor e8d8443d22 runtime: Fix prototype and one use of runtime_traceback.
From Richard Biener.

From-SVN: r205634
2013-12-03 14:51:07 +00:00
Ian Lance Taylor 2583109c81 libgo: Avoid some cases of getting callers recursively.
Avoids hanging inside older versions of glibc that do not
support recurive calls to dl_iterate_phdr.

From-SVN: r205561
2013-12-01 01:40:16 +00:00
Ian Lance Taylor df5d92ce0e reflect: Rename struct field to be consistent in assembler and Go.
From-SVN: r205555
2013-11-30 18:08:42 +00:00
Ian Lance Taylor 9c6230e90e reflect: Fix MakeFunc for 386 when returning a struct.
When a 386 function returns a struct, it needs to return using
an rtd instruction that pops the hidden struct parameter off
the stack.  That wasn't happening.

From-SVN: r205551
2013-11-30 17:14:50 +00:00
Ian Lance Taylor 815ca4d336 libgo: Update to current Go library.
From-SVN: r205426
2013-11-27 01:05:38 +00:00
Ian Lance Taylor 763d87526f runtime: Fix handling of surrogate pairs in string([]rune).
From-SVN: r205422
2013-11-26 23:27:29 +00:00
Ian Lance Taylor 0fea993fa8 syscall: Set SizeofSockaddrAny to the value the go distribution uses
In particular this means that the names Getsockname returns are not
truncated to 26 characters.

Fixes issue 6829

https://codereview.appspot.com/31840043/

From-SVN: r205368
2013-11-25 22:54:05 +00:00
Ian Lance Taylor 6b05faddf0 syscall: Only call varargs libc functions from C code.
From-SVN: r205321
2013-11-24 02:38:28 +00:00
Ian Lance Taylor 42c447c0c4 libgo: Update libtool support for powerpc64le-linux-gnu.
From Ulrich Weigand.

From-SVN: r205287
2013-11-22 20:39:46 +00:00
Ian Lance Taylor 92495ff691 runtime: Update for change to libbacktrace library.
From-SVN: r205031
2013-11-19 15:02:27 +00:00
Ian Lance Taylor 41674b9fe4 reflect: Handle calls to functions that take or return empty structs
Fixes issue 6761

This simple change seems to work fine, slightly to my surprise.

This includes the tests I submitted to the main Go repository at
https://codereview.appspot.com/26570046

From-SVN: r205001
2013-11-19 02:30:03 +00:00
Ian Lance Taylor 9d5eec2da6 gotest: Recognize PPC ELF v2 function pointers in text section.
From-SVN: r205000
2013-11-19 02:14:40 +00:00
Ian Lance Taylor 824393bd5b libgo: Fix typo for is_dragonfly in configure script.
From-SVN: r204999
2013-11-19 02:11:38 +00:00
Ian Lance Taylor 7c0f17db44 runtime: Use runtime_m to get m value after call to runtime_mcall.
From-SVN: r204853
2013-11-15 17:20:25 +00:00
Ian Lance Taylor 37512c0399 runtime: Don't use filename without '/' for backtrace library.
Fixes http://golang.org/issue/6715.

From-SVN: r204828
2013-11-14 22:31:29 +00:00
Ian Lance Taylor 01ef823cdd net: On Solaris use Darwin keepalive code.
From-SVN: r204819
2013-11-14 20:19:51 +00:00
Ian Lance Taylor 03a231f752 runtime: Add netpoll code that uses select.
Required for Solaris support.

From-SVN: r204817
2013-11-14 20:15:04 +00:00
Ian Lance Taylor 7d608db296 runtime: Fix GC flag in when allocating memory from cgo.
From-SVN: r204815
2013-11-14 20:04:32 +00:00
Ian Lance Taylor eb50be04e9 go/build: Add all known gccgo architectures to list.
From-SVN: r204796
2013-11-14 18:16:59 +00:00
Ian Lance Taylor 9572918137 libgo/go/go/build: use syslist.go from the gc stdlib.
If cmd/go is rebuilt using -compiler gccgo the version of go/build that is linked into that cmd/go will not function properly as the list of file suffixes know as operating systems or architectures is incorrect.

From-SVN: r204794
2013-11-14 18:07:31 +00:00
Ian Lance Taylor 9544822809 net: Fix TCP keepalive handling for Solaris.
From-SVN: r204688
2013-11-11 21:25:42 +00:00
Ian Lance Taylor 3c450181dc mksysinfo, net: Always define F_DUPFD_CLOEXEC.
For Solaris and CentOS portability.

From-SVN: r204687
2013-11-11 21:21:50 +00:00
Ian Lance Taylor eb47f18904 os: Do not try to run go command in test.
From-SVN: r204684
2013-11-11 19:41:00 +00:00
Ian Lance Taylor 86dedeba36 runtime: Correct flag (FlagNoGC => FlagNoInvokeGC).
From-SVN: r204617
2013-11-09 16:23:00 +00:00
Ian Lance Taylor f671b58945 runtime: Fixes for Alpha.
From-SVN: r204551
2013-11-07 23:38:47 +00:00
Ian Lance Taylor f038dae646 libgo: Update to October 24 version of master library.
From-SVN: r204466
2013-11-06 19:49:01 +00:00
Ian Lance Taylor 134e622524 runtime: Fix typo in dup3 fallback implementation.
From Uros Bizjak.

From-SVN: r203820
2013-10-18 13:26:40 +00:00
Ian Lance Taylor d5b18b0b13 syscall: Add Dup3, {Get,List,Remove,Set}xattr, {Get,Set}priority.
From-SVN: r203788
2013-10-17 18:41:12 +00:00
Ian Lance Taylor c187e58fa2 runtime: Fix build on systems without split stack.
From Uros Bizjak.

From-SVN: r203703
2013-10-16 13:37:35 +00:00
Ian Lance Taylor 8088e1beb2 runtime: Don't clobber saved context when catching signal.
From-SVN: r203577
2013-10-14 21:02:52 +00:00
Ian Lance Taylor 301616f7ff runtime: Report len out of range for large len when making slice.
From-SVN: r203401
2013-10-11 00:46:57 +00:00
Ian Lance Taylor 215552adac compiler, runtime: Fix complex division of NaN / 0.
From-SVN: r203331
2013-10-09 22:31:15 +00:00
Ian Lance Taylor 7af190f113 runtime: Do not report thunks and recover functions in backtrace.
From-SVN: r203294
2013-10-09 00:02:14 +00:00
Ian Lance Taylor e3f6b60da9 reflect: Use C style comments in 386 assembly for Solaris assembler.
From Rainer Orth.

From-SVN: r203249
2013-10-07 15:32:08 +00:00
Ian Lance Taylor 8a2cb59f1c reflect: Fix calling Interface method on value created by MakeFunc.
From-SVN: r203212
2013-10-04 18:52:22 +00:00
Ian Lance Taylor 84c67c3bae runtime: Fix append of slice with elements of zero size.
From-SVN: r203140
2013-10-02 23:49:39 +00:00
Ian Lance Taylor cc1a9ac808 reflect: Use hand-coded .eh_frame section rather than CFI directives.
From Rainer Orth.

From-SVN: r203120
2013-10-02 17:30:07 +00:00
Ian Lance Taylor 2cb01a3972 reflect: Fix reflect.Call with function following non-pointer.
From-SVN: r203052
2013-10-01 03:12:15 +00:00
Ian Lance Taylor 5f18389f4d reflect: Copy stack values onto heap in amd64 MakeFunc.
From-SVN: r202995
2013-09-27 22:13:11 +00:00
Ian Lance Taylor a84dbde7fc reflect: Implement MakeFunc for 386.
From-SVN: r202993
2013-09-27 21:34:24 +00:00
Ian Lance Taylor 8bcd5487e5 reflect: Implement MakeFunc for amd64.
From-SVN: r202982
2013-09-27 17:53:46 +00:00
Ian Lance Taylor b15d794389 reflect: Fix bug calling method on indirect value.
The gccgo-specific iword function was checking v.kind, but for
a method value that is always Func.  Fix to check v.typ.Kind()
instead.

From-SVN: r202670
2013-09-17 22:11:43 +00:00
Ian Lance Taylor 05a7d56678 compiler, runtime: Use runtime functions to pass closure value.
This changes the compiler and runtime to not pass a closure
value as the last argument, but to instead pass it via
__go_set_closure and retrieve it via __go_get_closure.  This
eliminates the need for function descriptor wrapper functions.
It will make it possible to retrieve the closure value in a
reflect.MakeFunc function.

From-SVN: r202233
2013-09-03 21:52:37 +00:00
Ian Lance Taylor 6e6bbb604e libgo: Update libtool.m4 from upstream to recognize powerpcle.
From-SVN: r201933
2013-08-23 01:08:25 +00:00
Ian Lance Taylor 537a6f7b47 net: give C.getaddrinfo a hint that we only want SOCK_STREAM answers
This should be more efficient everywhere, and appears to be
required on Solaris.

Copied from master repository.

From-SVN: r201637
2013-08-09 20:51:16 +00:00
Ian Lance Taylor 1b3dc031eb syscall: Change AWK split call to use []+ rather than []*.
Using []* fails with the awk that is part of busybox:
https://groups.google.com/d/msg/gofrontend-dev/NbQsG_AMDpY/sXCc03kkwn4J

From-SVN: r201455
2013-08-02 22:30:30 +00:00
Ian Lance Taylor b0c5dc1655 runtime: Handle allocating memory in cgo/SWIG function.
A function that returns an interface type and returns a value
that requires memory allocation will try to allocate while
appearing to be in a syscall.  This patch lets that work.

From-SVN: r201226
2013-07-24 22:30:25 +00:00
Ian Lance Taylor 08d22f9b41 runtime: Check _end rather than end to find end of program.
This fixes a problem on Solaris, where end is not defined in
the main program but comes from some shared library.  This
only matters for 32-bit targets.

From-SVN: r201220
2013-07-24 17:37:07 +00:00
Ian Lance Taylor f735ce315f net: Only use GNU/Linux unix socket abstract paths on GNU/Linux.
From-SVN: r201217
2013-07-24 16:53:17 +00:00
Ian Lance Taylor c0f0119244 runtime: Move new 1.1.1 functions from thread-linux.c to runtime.c.
This way they are compiled on non-GNU/Linux systems.

From-SVN: r201209
2013-07-24 13:18:45 +00:00
Ian Lance Taylor 017e07a118 net/http: Don't try to trace sendfile64 on alpha.
From Uros Bizjak.

From-SVN: r201206
2013-07-24 13:09:32 +00:00
Ian Lance Taylor 9d824f6c8f log/syslog: Restore interface to make this work on Solaris again.
From-SVN: r201188
2013-07-23 21:23:27 +00:00
Ian Lance Taylor da8091da1b net: Remove Solaris-specific version of listenerSockaddr.
Solaris will use the version in sock_unix.go.

From-SVN: r201183
2013-07-23 20:38:49 +00:00
Ian Lance Taylor 6212cdcdf7 runtime: Declare epoll_create1 if necessary.
From-SVN: r201181
2013-07-23 20:32:26 +00:00
Ian Lance Taylor 7acd2b86bf runtime: Support cgo callbacks from threads started by C.
This adjusts the extram support to work with gccgo.  There are
some corresponding changes to cgo in
https://codereview.appspot.com/11406047/ .

From-SVN: r201179
2013-07-23 20:26:09 +00:00
Ian Lance Taylor 5f9ae7f2d6 runtime: Ignore SIGPROF if not on a Go thread.
From-SVN: r201154
2013-07-23 04:42:09 +00:00
Ian Lance Taylor 081e7aadae runtime: Fix build on non-split-stack systems.
From-SVN: r200983
2013-07-16 15:44:54 +00:00
Ian Lance Taylor be47d6ecef libgo: Update to Go 1.1.1.
From-SVN: r200974
2013-07-16 06:54:42 +00:00
Ian Lance Taylor fdbc38a6e8 compiler, runtime: Use function descriptors.
This changes the representation of a Go value of function type
from being a pointer to function code (like a C function
pointer) to being a pointer to a struct.  The first field of
the struct points to the function code.  The remaining fields,
if any, are the addresses of variables referenced in enclosing
functions.  For each call to a function, the address of the
function descriptor is passed as the last argument.

This lets us avoid generating trampolines, and removes the use
of writable/executable sections of the heap.

From-SVN: r200181
2013-06-18 23:49:49 +00:00
Ian Lance Taylor 73e0b984b3 runtime, testing/quick: libffi doesn't handle complex on Alpha.
From Uros Bizjak.

From-SVN: r196389
2013-03-01 19:26:43 +00:00
Ian Lance Taylor 0a2f103a45 runtime: Don't block SIGTRAP while creating a new thread.
Thanks to Uros Bizjak.

From-SVN: r196362
2013-02-28 21:56:14 +00:00
Ian Lance Taylor f46d686ef1 re PR go/56171 (syscall FAILs on Solaris)
PR go/56171
syscall: Solaris fixes for passing file descriptor.

From Rainer Orth.

From-SVN: r196180
2013-02-20 20:04:36 +00:00
Ian Lance Taylor aa777e7a23 re PR go/56320 (Several libgo tests FAIL on 64-bit Solaris/x86)
PR go/56320
runtime: Support Solaris AMD64 in lfstack.
The address space layout is similar on SPARC64 and AMD64 when
running Solaris.

From-SVN: r196179
2013-02-20 19:45:10 +00:00
Ian Lance Taylor 3ab98a471c runtime: Do not reserve huge amount of swap on 32 bit architectures.
The mmap() call which reserves the arena should have MAP_NORESERVE
flag as in typical cases this memory will never be (fully) needed.
This matters in environments which do not do Linux style memory
overcommit, such as OpenIndiana/OpenSolaris/Solaris.

The MAP_NORESERVE flag does not exist on all operating systems
(for example FreeBSD). Therefore we define it to zero value in
case it does not exist.

Fixes issue 21.

From-SVN: r196088
2013-02-15 18:55:09 +00:00
Ian Lance Taylor ae135907ba re PR go/56171 (syscall FAILs on Solaris)
PR go/56171
libgo: Solaris portability for syscall package.

From Rainer Orth.

From-SVN: r195950
2013-02-11 19:03:04 +00:00
Ian Lance Taylor d54fc07473 compiler, libgo: Permit testing package when test imports it circularly.
From-SVN: r195931
2013-02-10 06:02:38 +00:00
Ian Lance Taylor d3deca3973 re PR go/56017 (libgo testsuite does not support cross testing)
PR go/56017
libgo testsuite: If using DejaGNU, don't frob the log file.

From-SVN: r195927
2013-02-09 23:19:33 +00:00
Ian Lance Taylor d5698f71bb re PR go/56017 (libgo testsuite does not support cross testing)
PR go/56017
libgo DejaGNU testsuite: Load timeout.exp before go.exp.

From-SVN: r195926
2013-02-09 23:02:09 +00:00
Ian Lance Taylor 540817f4ef syscall: Always use _C_int for C libcalls.
From-SVN: r195897
2013-02-08 19:24:26 +00:00
Ian Lance Taylor 48227088fd runtime: Change main in goc2c to return int.
From Uros Bizjak.

From-SVN: r195868
2013-02-07 22:24:34 +00:00
Ian Lance Taylor af4acefcd7 re PR go/56173 (Several libgo tests FAIL on Solaris/SPARC)
PR go/56173
crypto/md5: fix for big-endian processors

From-SVN: r195867
2013-02-07 21:40:10 +00:00
Ian Lance Taylor 553752e19f libgo: Correct test for whether to use DejaGNU.
From-SVN: r195861
2013-02-07 18:01:54 +00:00
Ian Lance Taylor aa62fd35b5 re PR go/56172 (net FAILs on Solaris)
PR go/56172
net: Skip TestMulticastListener on Solaris

From Rainer Orth.

From-SVN: r195855
2013-02-07 17:04:24 +00:00
Ian Lance Taylor d617bce48c re PR go/56172 (net FAILs on Solaris)
PR go/56172
net: Fixes for select based pollster.

Make Close work properly, mainly for testing.  Restart the
select if a descriptor is closed.

From-SVN: r195823
2013-02-06 22:40:18 +00:00
Ian Lance Taylor 5c9768b360 re PR go/56172 (net FAILs on Solaris)
PR go/56172
runtime: Fix argument passed to forcegchelper.

From-SVN: r195774
2013-02-05 23:59:24 +00:00
Ian Lance Taylor 7134cf2833 re PR go/56017 (libgo testsuite does not support cross testing)
PR go/56017
libgo: Use DejaGNU when testing a cross-compiler.

From-SVN: r195766
2013-02-05 22:22:17 +00:00
Ian Lance Taylor 10f92c9c3f re PR go/56171 (syscall FAILs on Solaris)
PR go/56171
syscall: Only run creds_test on GNU/Linux.

From-SVN: r195686
2013-02-02 15:40:14 +00:00
Ian Lance Taylor 7ebe663e98 runtime: Correct handling of runtime.Callers skip parameter.
From-SVN: r195685
2013-02-02 15:11:48 +00:00
Ian Lance Taylor a1948282e8 runtime: Correct test for morestack.S.
From-SVN: r195640
2013-02-01 05:49:14 +00:00
Ian Lance Taylor cfbafb9a7e runtime: Recognize morestack.S if there is no function name.
From-SVN: r195634
2013-01-31 23:12:42 +00:00
Ian Lance Taylor 7c81527e48 runtime: Remove confusion about split stack functions in backtrace.
From-SVN: r195627
2013-01-31 19:44:24 +00:00
Ian Lance Taylor e259a3f2ca runtime: Block signals when creating a new thread.
From-SVN: r195619
2013-01-31 17:30:28 +00:00
Ian Lance Taylor 422e2fc062 runtime: Don't allocate when doing a backtrace.
From-SVN: r195615
2013-01-31 16:41:15 +00:00
Ian Lance Taylor 27741f93ef runtime: In backtraces, get inline functions, skip split-stack fns.
From-SVN: r195591
2013-01-30 22:24:40 +00:00
Ian Lance Taylor 777133fefb libgo: Update Go library to master revision 15502/229081515358.
From-SVN: r195569
2013-01-30 01:37:13 +00:00
Ian Lance Taylor d6f2922e91 libgo: Update Go library to master revision 15489/921e53d4863c.
From-SVN: r195560
2013-01-29 20:52:43 +00:00
Ian Lance Taylor 656e11a924 runtime: SPARCv9 fixes for lfstack.
From Rainer Orth.

From-SVN: r195534
2013-01-29 13:58:18 +00:00
Ian Lance Taylor 0d4668c1d5 libgo: Add --enable-werror configure option.
From-SVN: r195482
2013-01-26 00:13:34 +00:00
Ian Lance Taylor acc6151f4a re PR other/56076 (Several 64-bit libgo tests FAIL in read_line_header)
PR other/56076
runtime: Support sparc64 in lfstack.

From-SVN: r195479
2013-01-25 23:43:23 +00:00
Ian Lance Taylor f6b1e65ec3 re PR go/46986 (Go is not supported on Darwin)
PR go/46986
all: prepend #__USER_LABEL_PREFIX__ to mangled Go symbols
For old-fashioned Darwin.

From-SVN: r195438
2013-01-24 19:44:23 +00:00
Ian Lance Taylor 72d1cef254 re PR go/46986 (Go is not supported on Darwin)
PR go/46986
libgo/Makefile, libgo/go/os/stat_atimespec.go: fix typos

From-SVN: r195436
2013-01-24 18:12:23 +00:00
Ian Lance Taylor 409a5e7eb4 libgo: Update to revision 15193:6fdc1974457c of master library.
From-SVN: r194692
2012-12-22 01:15:33 +00:00
Ian Lance Taylor 5c167ca0a2 compiler: Error if name defined in both package and file blocks.
From-SVN: r194685
2012-12-21 22:23:23 +00:00
Ian Lance Taylor 69fffc1f0e libgo: Link against libatomic_convenience.la.
gcc/go:
	PR go/55201
	* gospec.c: Revert last patch.

gcc/testsuite:
	PR go/55201
	* lib/go.exp: Revert last patch.

From-SVN: r194593
2012-12-18 22:07:38 +00:00
Andreas Schwab 0b8ca8fefe libgo: Link against libatomic.
./:
	PR go/55201
	* Makefile.def (all-target-libgo): Depend on all-target-libatomic.
	* Makefile.in: Regenerate.
gcc/go:
	PR go/55201
	* gospec.c (LIBATOMIC): Define.
	(LIBATOMIC_PROFILE): Define.
	(lang_specific_driver): Add LIBATOMIC[_PROFILE] option.
gcc/testsuite:
	* lib/go.exp (go_link_flags): Add libatomic location to flags and
	ld_library_path.

From-SVN: r194581
2012-12-18 14:28:24 +00:00
Ian Lance Taylor a57bf4070a log/syslog: Solaris portability patches.
From-SVN: r194566
2012-12-17 21:07:27 +00:00
Ian Lance Taylor 35f33e3802 runtime: Delete from a nil map is now a no-op.
From-SVN: r194462
2012-12-12 23:29:10 +00:00
Ian Lance Taylor a42a906c42 libgo: Update to current master library sources.
From-SVN: r194460
2012-12-12 23:13:29 +00:00
Ian Lance Taylor 4d901dd735 os: Clean up directory reading code.
From-SVN: r194237
2012-12-06 02:00:13 +00:00
Ian Lance Taylor 03a6c305d3 syscall: Fix splice syscall.
From-SVN: r194185
2012-12-05 08:49:01 +00:00
Ian Lance Taylor 98fd70c20f mksysinfo: Fix TIOCNOTTY and TIOCSCTTY for ARM.
From Matthias Klose.

From-SVN: r194118
2012-12-04 06:23:37 +00:00
Ian Lance Taylor 4731f878b7 runtime: Fix build failures with -D_FORTIFY_SOURCE=2.
From-SVN: r194116
2012-12-04 06:18:07 +00:00
Ian Lance Taylor 744c3195ef compiler, runtime: Track fields with tag go:"track".
* go-gcc.cc: Include "output.h".
	(global_variable): Add is_unique_section parameter.
	(global_variable_set_init): Adjust unique section if necessary.
	* Make-lang.in (go/go-gcc.o): Add dependency on output.h.

From-SVN: r193945
2012-11-29 18:11:17 +00:00
Ian Lance Taylor 40ff695f5c syscall: Fix handling of Unix domain @ addresses.
From-SVN: r193783
2012-11-24 20:46:59 +00:00
Ian Lance Taylor fabcaa8df3 libgo: Update to current version of master library.
From-SVN: r193688
2012-11-21 07:03:38 +00:00
Ian Lance Taylor a3ce4803ea reflect: Fix invalid sharing in valueInterface.
From-SVN: r193614
2012-11-19 05:34:08 +00:00
Ian Lance Taylor 95d89457e2 runtime: Fix use of __atomic_compare_exchange_n: not weak, consistent.
From-SVN: r193581
2012-11-17 00:52:22 +00:00
Ian Lance Taylor 86f2731e63 syscall: Force first letter of error message to lower case.
From-SVN: r193449
2012-11-12 19:34:52 +00:00
Ian Lance Taylor 7e03f00470 reflect: Fix bug comparing struct field types.
From-SVN: r193395
2012-11-10 20:24:04 +00:00
Ian Lance Taylor 8273ed8077 compiler, runtime: Size of int is now 64 bits on x86_64.
From-SVN: r193255
2012-11-06 18:46:38 +00:00
Ian Lance Taylor fb3f38da2a compiler, libgo: Fixes to prepare for 64-bit int.
From-SVN: r193254
2012-11-06 18:28:21 +00:00
Ian Lance Taylor 855a44ee8f compiler, runtime: Memcmp routine returns intgo.
From-SVN: r193253
2012-11-06 18:12:45 +00:00
Ian Lance Taylor 0be1a5898f runtime: provide initcontext and fixcontext for NetBSD
From-SVN: r193173
2012-11-05 17:41:07 +00:00
Ian Lance Taylor ae0b23e2ff os: support more OSes
From-SVN: r193172
2012-11-05 17:36:40 +00:00
Ian Lance Taylor ff95e2ab0b syscall, mksysinfo: Prepare syscall package for 64-bit int.
From-SVN: r193112
2012-11-02 23:39:36 +00:00
Ian Lance Taylor 556ea3915a runtime: Fix reflect.Call support for 64-bit ints.
From-SVN: r193110
2012-11-02 23:17:05 +00:00
Ian Lance Taylor 776f27a67f compiler, runtime: More steps toward separating int and intgo.
From-SVN: r193059
2012-11-01 03:02:13 +00:00
Ian Lance Taylor e212c7f56c runtime/goc2c: Drop gc support, change int to intgo.
From-SVN: r193046
2012-10-31 20:49:53 +00:00
Ian Lance Taylor 85c2f96c1c syscall: fix creds_test to reliably close os.File
Uncovered by Uros Bizjak.

Before this patch the test would close the file descriptor but
not the os.File.  When the os.File was GC'ed, the finalizer
would close the file descriptor again.  That would cause
problems if the same file descriptor were returned by a later
call to open in another test.

On my system:

> GOGC=30 go test
--- FAIL: TestPassFD (0.04 seconds)
passfd_test.go:62: 	FileConn: dup: bad file descriptor
FAIL

From-SVN: r192854
2012-10-26 17:50:10 +00:00
Ian Lance Taylor f99a463f8a libgo: Solaris portability patches.
From Rainer Orth.

From-SVN: r192819
2012-10-25 18:26:34 +00:00
Ian Lance Taylor 1a6c552d12 mksysinfo: Define SIGPOLL and SIGCLD if necessary.
From-SVN: r192775
2012-10-24 19:00:44 +00:00
Ian Lance Taylor 8d672b2640 runtime: Disable crash tests that runs go tool.
From-SVN: r192735
2012-10-23 18:01:06 +00:00
Ian Lance Taylor e8028ecdd0 re PR go/54918 (libgo.so.0 is not runtime compatible between gcc-4.6.2 and gcc-4.7.x)
PR go/54918
libgo: Set library version number.

From-SVN: r192706
2012-10-23 05:01:24 +00:00
Ian Lance Taylor 4ccad563d2 libgo: Update to current sources.
From-SVN: r192704
2012-10-23 04:31:11 +00:00
Ian Lance Taylor fb521d54f1 runtime: Fix __go_symbol_value val argument to backtrace_syminfo.
From-SVN: r192194
2012-10-08 04:29:47 +00:00
Ian Lance Taylor 686750d25d runtime: Use argv[0] to get executable name for backtrace.
From-SVN: r192123
2012-10-05 13:44:40 +00:00
Ian Lance Taylor bd2e46c825 libgo: Update to Go 1.0.3.
From-SVN: r192025
2012-10-03 05:27:36 +00:00
Ian Lance Taylor ddd06f5372 runtime: Better detection of memory allocation request overflow.
From-SVN: r191841
2012-09-28 21:25:20 +00:00
Ian Lance Taylor 92aecb446a runtime: runtime.Caller should succeed even without debug info.
From-SVN: r191833
2012-09-28 17:42:53 +00:00
Ian Lance Taylor 0e56e59065 libgo: Use libbacktrace rather than debug/elf registration.
From-SVN: r191831
2012-09-28 14:48:30 +00:00
Ian Lance Taylor a2383b317b runtime: Reject surrogate pairs in range over string.
From-SVN: r191638
2012-09-22 07:18:45 +00:00
Ian Lance Taylor 1e39ea0812 compiler, runtime: Reject surrogate pair converting int to string.
From-SVN: r191636
2012-09-22 06:51:59 +00:00
Ian Lance Taylor 2afc1e0b30 runtime: Return random number of hash of NaN.
From-SVN: r191632
2012-09-22 06:06:31 +00:00
Ian Lance Taylor ee6440f8d8 libgo: Add no-dist and -Wno-portability to AM_INIT_AUTOMAKE.
From-SVN: r191575
2012-09-20 16:32:27 +00:00