summaryrefslogtreecommitdiff
path: root/libgo/go
AgeCommit message (Collapse)Author
2017-10-15 PR go/82559ian
Backport from mainline: https://golang.org/cl/46712 https://golang.org/cl/46839 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@253770 138bc75d-0d04-0410-961f-82ee72b054a4
2017-10-09Backport correct Go MIPS architecture names from trunk.ian
Brings in the following patches: https://golang.org/cl/46150 https://golang.org/cl/46151 https://golang.org/cl/46152 https://golang.org/cl/46153 https://golang.org/cl/46154 https://gcc.gnu.org/ml/gcc-patches/2017-06/msg01777.html * go.test/go-test.exp (go-set-goarch): Update MIPS architecture names. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@253551 138bc75d-0d04-0410-961f-82ee72b054a4
2017-10-02libgo: update to Go 1.8.3 releaseian
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@253367 138bc75d-0d04-0410-961f-82ee72b054a4
2017-07-20 PR go/81393ian
syscall: don't use GETREGS/SETREGS on s390 They were removed in recent glibc. This is a backport of https://golang.org/cl/48231 to earlier branches. Define required type and constants in syscall package directly, don't try to pull them from the system header files. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@250402 138bc75d-0d04-0410-961f-82ee72b054a4
2017-06-23 os: align siginfo argument to waitidian
Backport https://golang.org/cl/46511 from gc trunk, as it may fix a bug reported for gccgo running on MIPS (https://groups.google.com/d/msg/golang-dev/sDg-t1_DPw0/-AJmLxgPBQAJ). Reviewed-on: https://go-review.googlesource.com/46571 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@249600 138bc75d-0d04-0410-961f-82ee72b054a4
2017-04-17 libgo: update to Go 1.8.1 releaseian
Reviewed-on: https://go-review.googlesource.com/40775 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@246957 138bc75d-0d04-0410-961f-82ee72b054a4
2017-04-12 PR go/77857ian
cmd/go: generate vendor paths for -I arg on compile This change generates the vendor path to be used with -I on a gccgo compile to find imports from the vendor directories. Fixes golang/go#15628 Reviewed-on: https://go-review.googlesource.com/39590 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@246864 138bc75d-0d04-0410-961f-82ee72b054a4
2017-04-04 PR go/80302ian
time: make the ParseInLocation test more robust This is a backport of https://golang.org/cl/37964 from the gc toolchain. Original description: The tzdata 2017a update (2017-02-28) changed the abbreviation of the Asia/Baghdad time zone (used in TestParseInLocation) from 'AST' to the numeric '+03'. Update the test so that it skips the checks if we're using a recent tzdata release. Updates golang/go#19457 Fixes GCC PR 80302. Reviewed-on: https://go-review.googlesource.com/39470 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@246695 138bc75d-0d04-0410-961f-82ee72b054a4
2017-03-22 internal/syscall/unix: add randomTrap for m68kian
Patch by Andrwas Schwab. Reviewed-on: https://go-review.googlesource.com/38456 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@246410 138bc75d-0d04-0410-961f-82ee72b054a4
2017-03-01cmd/go: add testdata/timeoutbench_test.goian
This file was accidentally omitted from the update to the final Go 1.8. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@245814 138bc75d-0d04-0410-961f-82ee72b054a4
2017-02-28 runtime: fix sigfwd to not allocate memoryian
The use of &[1]uintptr{fn} was causing sigfwd to allocate memory, even though it is being compiled for the runtime package. That is a bad idea for this function, which is invoked by a signal handler. Rewrite it to use only constructs that do not allocate memory when compiled for the runtime package. The test for this is misc/cgo/testcarchive in the main repo, which we don't yet test. Reviewed-on: https://go-review.googlesource.com/37454 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@245777 138bc75d-0d04-0410-961f-82ee72b054a4
2017-02-17 libgo: update to final Go 1.8 releaseian
Along with the update this fixes a problem that was always present but only showed up with the new reflect test. When a program used a **unsafe.Pointer and stored the value in an interface type, the generated type descriptor pointed to the GC data for *unsafe.Pointer. It did that by name, but we were not generating a variable with the right name. Reviewed-on: https://go-review.googlesource.com/37144 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@245535 138bc75d-0d04-0410-961f-82ee72b054a4
2017-02-13 PR go/79443ian
libgo: fix some s390x tests Add `+build ignore` to ignore tests that rely on s390x assembly code not yet implemented for gccgo. Fixes GCC PR 79443. Reviewed-on: https://go-review.googlesource.com/36909 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@245397 138bc75d-0d04-0410-961f-82ee72b054a4
2017-01-27 libgo: update to go1.8rc3ian
Reviewed-on: https://go-review.googlesource.com/35844 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244981 138bc75d-0d04-0410-961f-82ee72b054a4
2017-01-26 runtime: fix setting of isarchiveian
When I updated to Go 1.8, the initsig function moved from signal1_unix.go to signal_unix.go, and lost a gccgo-specific change in the move. Add it back. This would have been caught by the misc/cgo/testcarchive tests in the gc repository, but we don't run those in the gccgo repository. We should fix that, somehow. Reviewed-on: https://go-review.googlesource.com/35839 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244947 138bc75d-0d04-0410-961f-82ee72b054a4
2017-01-23 libgo: update to go1.8rc2ian
Fix a bug in the generation of the hash value in reflect.FuncOf. The merge script missed a bunch of testdata files over the years. Copy them over. Reviewed-on: https://go-review.googlesource.com/35570 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244835 138bc75d-0d04-0410-961f-82ee72b054a4
2017-01-20 runtime, testing/internal/testdeps: fixes for cgoian
Some fixes that permit misc/cgo/test in the master gc repository to pass using the current gccgo. Install testing/internal/testdeps.gox; it is needed by `go test`. Export runtime.lockedOSThread to enable calling via go:linkname; it is used by misc/cgo/test. Loop on EAGAIN when creating a new thread; this is what the gc code does, and misc/cgo/test tests that it works. Reviewed-on: https://go-review.googlesource.com/35479 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244733 138bc75d-0d04-0410-961f-82ee72b054a4
2017-01-20 PR go/79146ian
math/big: fix build on s390x Don't build arith_decl_s390x.go for gccgo; it is only for assembly code that has not yet been ported to gccgo. For GCC PR 79146. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244731 138bc75d-0d04-0410-961f-82ee72b054a4
2017-01-20 PR go/79146ian
crypto/elliptic: explicitly ignore p256_s390x.go The file only works if used in conjunction with assembly code not (yet) written for gccgo. Fixes GCC PR 79146. Reviewed-on: https://go-review.googlesource.com/35477 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244679 138bc75d-0d04-0410-961f-82ee72b054a4
2017-01-18 syscall, golang_org/x/net/lif: fixes for gccgo on Solarisian
Reviewed-on: https://go-review.googlesource.com/35390 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244563 138bc75d-0d04-0410-961f-82ee72b054a4
2017-01-16 runtime: rename siginfo to _siginfo_tian
Since the name siginfo winds up in runtime.inc, this avoids a name collision on systems that define "struct siginfo" in the system header files. Reviewed-on: https://go-review.googlesource.com/35239 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244484 138bc75d-0d04-0410-961f-82ee72b054a4
2017-01-14 libgo: update to Go 1.8 release candidate 1ian
Compiler changes: * Change map assignment to use mapassign and assign value directly. * Change string iteration to use decoderune, faster for ASCII strings. * Change makeslice to take int, and use makeslice64 for larger values. * Add new noverflow field to hmap struct used for maps. Unresolved problems, to be fixed later: * Commented out test in go/types/sizes_test.go that doesn't compile. * Commented out reflect.TestStructOf test for padding after zero-sized field. Reviewed-on: https://go-review.googlesource.com/35231 gotools/: Updates for Go 1.8rc1. * Makefile.am (go_cmd_go_files): Add bug.go. (s-zdefaultcc): Write defaultPkgConfig. * Makefile.in: Rebuild. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244456 138bc75d-0d04-0410-961f-82ee72b054a4
2017-01-10 runtime: copy more scheduler code from Go 1.7 runtimeian
I looked at a diff of proc.go between Go 1.7 and gccgo, and copied over all the easy stuff. Reviewed-on: https://go-review.googlesource.com/35090 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244291 138bc75d-0d04-0410-961f-82ee72b054a4
2017-01-10 compiler, runtime: drop size arguments to hash/equal functionsian
Drop the size arguments for the hash/equal functions stored in type descriptors. Types know what size they are. To make this work, generate hash/equal functions for types that can use an identity comparison but are not a standard size and alignment. Drop the multiplications by 33 in the generated hash code and the reflect package hash code. They are not necessary since we started passing a seed value around, as the seed includes the hash of the earlier values. Copy the algorithms for standard types from the Go 1.7 runtime, replacing the C functions. Reviewed-on: https://go-review.googlesource.com/34983 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244256 138bc75d-0d04-0410-961f-82ee72b054a4
2017-01-09 runtime: copy more of scheduler from Go 1.7 runtimeian
This started by moving procresize from C to Go so that we can pass the right type to the memory allocator when allocating a p, which forced the gomaxprocs variable to move from C to Go, and everything else followed from that. Reviewed-on: https://go-review.googlesource.com/34916 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244236 138bc75d-0d04-0410-961f-82ee72b054a4
2017-01-03 runtime: remove __go_alloc and __go_freeian
Move allocg and handling of allgs slice from C to Go. Reviewed-on: https://go-review.googlesource.com/34797 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244036 138bc75d-0d04-0410-961f-82ee72b054a4
2017-01-03 PR go/78789ian
runtime: don't build aeshash.c if the assembler doesn't support it This is for CentOS 5, whose assembler does not know the aesinc instruction. Fixes GCC PR 78789. Patch by Uros Bizjak. Reviewed-on: https://go-review.googlesource.com/34796 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244031 138bc75d-0d04-0410-961f-82ee72b054a4
2016-12-19 runtime: copy cgo support from Go 1.7 runtimeian
Remove support for _cgo_allocate. It was removed from the gc toolchain in Go 1.5, so it is unlikely that anybody is trying to use it. Reviewed-on: https://go-review.googlesource.com/34557 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@243805 138bc75d-0d04-0410-961f-82ee72b054a4
2016-12-08 runtime: copy memory hash code from Go 1.7ian
Rewrite the AES hashing code from gc assembler to C code using intrinsics. The resulting code generates the same hash code for the same input as the gc code--that doesn't matter as such, but testing it ensures that the C code does something useful. Also change mips64pe32le to mips64p32le in configure script--noticed during CL review. Reviewed-on: https://go-review.googlesource.com/34022 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@243445 138bc75d-0d04-0410-961f-82ee72b054a4
2016-12-08 runtime: allocate _panic struct on heapian
The gc library allocates a _panic struct on the stack. This does not work for gccgo, because when a deferred function recovers the panic we unwind the stack up to that point so that returning from the function will work correctly. Allocating on the stack fine if the panic is not recovered, and it works fine if the panic is recovered by a function that returns. However, it fails if the panic is recovered by a function that itself panics, and if that second panic is then recovered by a function higher up on the stack. When we unwind the stack to that second panic, the g will wind up pointing at a panic farther down on the stack. Even then everything will often work fine, except when the deferred function catching the second panic makes a bunch of calls that use stack space before returning. In that case the code can overwrite the panic struct, which will then cause disaster when we remove the struct from the linked list, as the link field will be garbage. This case is rare enough that all the x86 tests were passing, but there was a failure on ppc64le. Before https://golang.org/cl/33414 we allocated the panic struct on the heap, so go back to doing that again. Fixes golang/go#18228. Reviewed-on: https://go-review.googlesource.com/34027 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@243444 138bc75d-0d04-0410-961f-82ee72b054a4
2016-12-01 runtime: set isarchive in initsigian
The library initialization code in go-libmain.c sets the C variable runtime_isarchive but failed to set the Go variable runtime.isarchive. We don't currently have a way to let C code access an unexported Go variable, but fortunately the only time the Go function initsig is called with an argument of true is exactly where we want to set isarchive. So let initsig do it. Reviewed-on: https://go-review.googlesource.com/33753 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@243094 138bc75d-0d04-0410-961f-82ee72b054a4
2016-11-30 runtime: print C functions in tracebackian
Since gccgo can trace back through C code as easily as Go code, we should print C functions in the traceback. This worked before https://golang.org/cl/31230 for a dumb reason. The default value for runtime.traceback_cache was, and is, 2 << 2, meaning to print all functions. The old C code for runtime_parsedebugvars would return immediately and do nothing if the environment variable GODEBUG was not set (if GODEBUG was set it would later call setTraceback. The new Go code for runtime.parsedebugvars does not return immediately if GODEBUG is not set, and always calls setTraceback. Either way, if GOTRACEBACK is not set, setTraceback would set traceback_cache to 1 << 2, meaning to only print non-runtime functions and having the effect of not printing plain C functions. Keep the current handling of GODEBUG/GOTRACEBACK, which matches the gc library, but add an extra check to print C functions by default. Reviewed-on: https://go-review.googlesource.com/33717 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@243083 138bc75d-0d04-0410-961f-82ee72b054a4
2016-11-30 runtime: fixes for -buildmode=c-archiveian
With -buildmode=c-archive, initsig is called before the memory allocator has been initialized. The code was doing a memory allocation because of the call to funcPC(sigtramp). When escape analysis is fully implemented, that call should not allocate. For now, finesse the issue by calling a C function to get the C function pointer value of sigtramp. When returning from a call from C to a Go function, a deferred function is run to go back to syscall mode. When the call occurs on a non-Go thread, that call sets g to nil, making it impossible to add the _defer struct back to the pool. Just drop it and let the garbage collector clean it up. Reviewed-on: https://go-review.googlesource.com/33675 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242992 138bc75d-0d04-0410-961f-82ee72b054a4
2016-11-22 PR go/77910ian
cmd/go: don't check standard packages when using gccgo This copies https://golang.org/cl/33295 to libgo. This fixes GCC PR 77910. Reviewed-on: https://go-review.googlesource.com/33471 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242724 138bc75d-0d04-0410-961f-82ee72b054a4
2016-11-22 runtime: rewrite panic/defer code from C to Goian
The actual stack unwind code is still in C, but the rest of the code, notably all the memory allocation, is now in Go. The names are changed to the names used in the Go 1.7 runtime, but the code is necessarily somewhat different. The __go_makefunc_can_recover function is dropped, as the uses of it were removed in https://golang.org/cl/198770044. Reviewed-on: https://go-review.googlesource.com/33414 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242715 138bc75d-0d04-0410-961f-82ee72b054a4
2016-11-18 runtime: move schedt type and sched var from C to Goian
This doesn't change any actual code, it just starts using the Go definition of the schedt type and the sched variable rather than the C definitions. The schedt type is tweaked slightly for gccgo. We aren't going to release goroutine stacks, so we don't need separate gfreeStack and gfreeNostack lists. We only have one size of defer function, so we don't need a list of 5 different pools. Reviewed-on: https://go-review.googlesource.com/33364 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242600 138bc75d-0d04-0410-961f-82ee72b054a4
2016-11-18 libgo: remove old/regexp and old/templateian
They were removed from the master Go library in 2012 (https://golang.org/cl/5979046) but somehow that was not reflected here. Reviewed-on: https://go-review.googlesource.com/33391 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242592 138bc75d-0d04-0410-961f-82ee72b054a4
2016-11-18Correct gcc/go/gofrontend/lex.cc and libgo/aclocal.m4 to the versionsian
in the gofrontend repo, which is supposed to be the master copy. Remove a few files in libgo that somehow were not deleted in the past. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242583 138bc75d-0d04-0410-961f-82ee72b054a4
2016-11-18Update libgo/configure to restore it to the master version.ian
Update a few binary files that were changed in the master gc repo, copied into the gofrontend repo, but not correctly copied into the GCC repo. The changes are all minor and do not affect any actual tests. Two instances of "http" changed to "https", and two timestamps were zeroed out. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242582 138bc75d-0d04-0410-961f-82ee72b054a4
2016-11-18 runtime, reflect: rewrite Go to FFI type conversion in Goian
As we move toward the Go 1.7 garbage collector, it's essential that all allocation of values that can contain Go pointers be done using the correct type descriptor. That is simplest if we do all such allocation in Go code. This rewrites the code that converts from a Go type to a libffi CIF into Go. Reviewed-on: https://go-review.googlesource.com/33353 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242578 138bc75d-0d04-0410-961f-82ee72b054a4
2016-11-16 runtime: replace runtime1.goc with Go and C codeian
A step toward eliminating goc2c. Drop the exported parfor code; it was needed for tests in the past, but no longer is. The Go 1.7 runtime no longer uses parfor. Reviewed-on: https://go-review.googlesource.com/33324 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242509 138bc75d-0d04-0410-961f-82ee72b054a4
2016-11-14 runtime: don't crash if signal handler info argument is nilian
Apparently on Solaris 10 a SA_SIGINFO signal handler can be invoked with a nil info argument. I would not have believed it but I've now seen it happen, and the sigaction man page actually says "If the second argument is not equal to NULL, it points to a siginfo_t structure...." So, if that happens, don't crash. Also fix another case where we want to make sure that &T{} does not allocate. Reviewed-on: https://go-review.googlesource.com/33150 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242403 138bc75d-0d04-0410-961f-82ee72b054a4
2016-11-10 runtime: copy signal code from Go 1.7 runtimeian
Add a little shell script to auto-generate runtime.sigtable from the known signal names. Force the main package to always import the runtime package. Otherwise some runtime package global variables may never be initialized. Set the syscallsp and syscallpc fields of g when entering a syscall, so that the runtime package knows when a g is executing a syscall. Fix runtime.funcPC to avoid dead store elimination of the interface value when the function is inlined. Reviewed-on: https://go-review.googlesource.com/33025 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242060 138bc75d-0d04-0410-961f-82ee72b054a4
2016-11-01 runtime: recreate function called by cgo -gccgoian
When using cgo -gccgo calls to C.GoString, C.GoStringN, and C.GoBytes are turned into calls to __go_byte_array_to_string and __go_string_to_byte_array. Those functions were removed when the string code was copied from Go 1.7, but we still need them for cgo. While cgo should be updated, old versions will exist for some time. Reviewed-on: https://go-review.googlesource.com/32474 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241743 138bc75d-0d04-0410-961f-82ee72b054a4
2016-10-28 compiler, runtime: copy slice code from Go 1.7 runtimeian
Change the compiler handle append as the gc compiler does: call a function to grow the slice, but otherwise assign the new elements directly to the final slice. For the current gccgo memory allocator the slice code has to call runtime_newarray, not mallocgc directly, so that the allocator sets the TypeInfo_Array bit in the type pointer. Rename the static function cnew to runtime_docnew, so that the stack trace ignores it when ignoring runtime functions. This was needed to fix the runtime/pprof tests on 386. Reviewed-on: https://go-review.googlesource.com/32218 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241667 138bc75d-0d04-0410-961f-82ee72b054a4
2016-10-28 PR go/78144ian
libgo: incorporate fix for timezone test This brings over the test-only fix for issue 17276 into gccgo/libgo (with tzdata-2016g there is a new zone abbreviation). This is a copy of https://golang.org/cl/29995. Reviewed-on: https://go-review.googlesource.com/32182 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241661 138bc75d-0d04-0410-961f-82ee72b054a4
2016-10-28 PR go/78143ian
runtime: build lfstack_32bit.go on ppc Missed a build tag. This is GCC PR 78143. Reviewed-on: https://go-review.googlesource.com/32295 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241659 138bc75d-0d04-0410-961f-82ee72b054a4
2016-10-21 runtime: copy lfstack code from Go 1.7 runtimeian
Note that lfstack_64bit.go was modified for Solaris support in a different, and better, way than the superseded lfstack.goc code. Reviewed-on: https://go-review.googlesource.com/31673 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241427 138bc75d-0d04-0410-961f-82ee72b054a4
2016-10-20 runtime: rewrite interface code into Goian
I started to copy the Go 1.7 interface code, but the gc and gccgo representations of interfaces are too different. So instead I rewrote the gccgo interface code from C to Go. The code is largely the same as it was, but the names are more like those used in the gc runtime. I also copied over the string comparison functions, and tweaked the compiler to use eqstring when comparing strings for equality. Reviewed-on: https://go-review.googlesource.com/31591 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241384 138bc75d-0d04-0410-961f-82ee72b054a4
2016-10-19 runtime, syscall: force EPOLLET to be positiveian
The C definition is 1U << 31. Reportedly on some systems GCC's -fgo-dump-spec can print this as -2147483648. Reviewed-on: https://go-review.googlesource.com/31448 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241347 138bc75d-0d04-0410-961f-82ee72b054a4