aboutsummaryrefslogtreecommitdiff
path: root/libgo/go
AgeCommit message (Collapse)AuthorFilesLines
2015-10-31libgo: Update from Go 1.5 to Go 1.5.1.Ian Lance Taylor13-14/+87
Reviewed-on: https://go-review.googlesource.com/16527 From-SVN: r229624
2015-10-31runtime: Remove now unnecessary pad field from ParFor.Ian Lance Taylor988-30033/+85128
It is not needed due to the removal of the ctx field. Reviewed-on: https://go-review.googlesource.com/16525 From-SVN: r229616
2015-10-29compiler, reflect, runtime: remove zero field from type descriptorIan Lance Taylor1-6/+0
Type descriptors picked up a zero field because the gc map implementation used it. However, it's since been dropped by the gc library. It was never used by gccgo. Drop it now in preparation for upgrading to the Go 1.5 library. Reviewed-on: https://go-review.googlesource.com/16486 From-SVN: r229546
2015-10-29compiler, runtime: change type hash/equal to Go funcsIan Lance Taylor1-2/+2
Change the type descriptor hash and equal functions from C code pointers to Go func values. This permits them to be set to a Go function closure. This is in preparation for the Go 1.5, so that we can use a closure for the hash/equal functions returned by the new reflect.ArrayOf function. Reviewed-on: https://go-review.googlesource.com/16485 From-SVN: r229541
2015-10-07re PR go/67874 (fd_unix.go does not build when there is fcntl64 and no fcntl ↵Ian Lance Taylor1-1/+9
syscall) PR go/67874 net, runtime: Call C library fcntl function rather than syscall.Syscall. Not all systems define a fcntl syscall; some only have fcntl64. Fixes GCC PR go/67874. Reviewed-on: https://go-review.googlesource.com/15497 From-SVN: r228576
2015-09-15libgo: don't provide ustat on arm64 GNU/LinuxIan Lance Taylor2-3/+11
This avoids linker warnings when linking against glibc, as apparently arm64 GNU/Linux does not support the ustat system call. Also update to automake 1.11.6, as that is the new GCC standard. Reviewed-on: https://go-review.googlesource.com/14567 From-SVN: r227777
2015-08-03syscall: RawSockaddr fix for ppc64, ppc64leIan Lance Taylor3-5/+28
The struct RawSockaddr contains a field Data which should be uint8 on ppc64 and ppc64le, but is declared as int8 in gccgo. This change adds a two new files which contain the structure declaration for RawSockaddr, one with the correct types for for ppc64 and ppc64le, and the other for non-ppc64 platforms. Fixes golang/go#11469 Reviewed-on: https://go-review.googlesource.com/11946 From-SVN: r226533
2015-07-13syscall: remove calls to Entersyscall & Exitsyscall in GetdentsIan Lance Taylor1-2/+0
The syscall for Getdents in syscall/libcall_linux.go called Entersyscall and Exitsyscall, causing the runtime_sched counts for goroutines to be incorrect. Inconsistent counts caused checkdead in runtime/proc.c to panic. Fixes golang/go#11406 Reviewed-on: https://go-review.googlesource.com/11761 From-SVN: r225745
2015-04-17re PR go/64683 (FAIL: runtime/pprof -- testing.go:278: The entry did not match)Ian Lance Taylor1-0/+4
PR go/64683 runtime/pprof: Assume function with no name is in runtime. GCC PR 65797 causes some of the runtime functions to be compiled with no name in the debug info. This in turn causes the runtime/pprof test to fail as reported in GCC PR 64683. There are no good choices when a function has no name in the debug info, but here we assume that if we see such a function while reading the runtime functions, we assume that it is also a runtime function. From-SVN: r222200
2015-04-17re PR go/65755 (incorrect reflection of struct fields with gccgo)Ian Lance Taylor1-7/+1
PR go/65755 compiler, runtime, reflect: Use reflection string for type comparisons. Change the runtime and reflect libraries to always use only the type reflection string to determine whether two types are equal. It previously used the PkgPath and Name values for a type name, but that required a PkgPath that did not match the gc compiler. Change the compiler to use the same PkgPath value as the gc compiler in all cases. Change the compiler to put the receiver type in the reflection string for a type defined inside a method. From-SVN: r222194
2015-03-31go/cmd/go: always link external test packages firstIan Lance Taylor3-5/+14
When linking complex packages that use both internal and external tests as well as many dependencies it is critical that the link order be external test package, internal test package, everything else. This change is a back (forward?) port of the same change that canonical have been maintaining on their fork of the go tool for gccgo. Now that gccgo uses the go tool from upstream, this patch should be applied both to the gofrontend and golang/go repos. From-SVN: r221800
2015-03-26re PR go/65587 (C package incomplete/not working for powerpc-linux-gnu)Ian Lance Taylor1-1/+1
PR go/65587 debug/elf: apply relocations for SHT_RELA/EM_PPC From-SVN: r221698
2015-03-26libgo: Fix go/runtime test failure on S390.Ian Lance Taylor2-1/+11
The tests run out of memory on 31-bit S390 systems because it does not have split stacks. From-SVN: r221681
2015-03-24re PR go/65417 (debug/elf: lacks support for PPC relocations)Ian Lance Taylor3-0/+49
PR go/65417 debug/elf: support reading debug info from 32-bit PPC objects This is a backport of http://golang.org/7590 from the master Go library. From-SVN: r221644
2015-03-24re PR go/65462 (Use of 'go get' with gccgo is not finding dependencies ↵Ian Lance Taylor3-14/+20
correctly) PR go/65462 cmd: Fix dependencies for 'go get' with gccgo Problem described in GCC BZ 65462. Generate the list of the standard GO package names based on what was built into libgo in the libgo Makefile. Change the var name from reqPkgSrc to reqStdPkgSrc to clarify it only affects standard GO packages. Skip the attempted loading of a package only if it is a standard GO package and the flag is set indicating its source is not required to be available. This requires a corresponding change to gotools to build and link in the new file containing the list of standard GO package names that was generated by the libgo Makefile. gotools/: PR go/65462 * Makefile.am (go_cmd_go_files): Add $(libgodir)/zstdpkglist.go. * Makefile.in: Rebuild. From-SVN: r221643
2015-03-12go/build: cgo works on linux/arm64.Ian Lance Taylor1-0/+1
From-SVN: r221398
2015-03-12re PR go/65404 (cgo tool on powerpc-linux-gnu maybe incomplete)Ian Lance Taylor1-0/+1
PR go/65404 go/build: cgo works on linux/pcc. From-SVN: r221396
2015-03-10re PR go/65353 (unknown ptrSize for $GOARCH "arm64" on aarch64-linux-gnu)Ian Lance Taylor1-10/+32
PR go/65353. cmd/cgo: Add all gccgo GOARCH values to size maps. From-SVN: r221293
2015-03-06libgo: Upgrade to Go 1.4.2 release.Ian Lance Taylor15-53/+157
From-SVN: r221245
2015-02-06runtime: Add memprofilerate to GODEBUGIan Lance Taylor1-0/+4
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-03go/types: Remove unused testdata files.Ian Lance Taylor13-1992/+0
The go/types package was removed in July 2013, but the testdata files were accidentally left behind. From-SVN: r220378
2015-01-23re PR go/64573 (Cmd.Start swallows error from fork()/clone())Ian Lance Taylor1-0/+1
PR go/64573 syscall: Restore line somehow lost in libgo merge. From-SVN: r220068
2015-01-23re PR go/64725 (FAIL: libgo/runtime TestFinalizerType testing.go:278: #2: ↵Ian Lance Taylor1-0/+9
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-20re PR go/64683 (FAIL: runtime/pprof -- testing.go:278: The entry did not match)Ian Lance Taylor1-2/+4
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-19Add attribute unused to dummy arguments in ffi stubRichard Henderson1-1/+2
From-SVN: r219862
2015-01-19reflect: Fix build for systems that do not define ffi_go_closure.Ian Lance Taylor3-7/+7
From-SVN: r219831
2015-01-16testing/quick: Revert Alpha specific change.Ian Lance Taylor1-7/+4
No longer needed now that libffi supports complex types. From-SVN: r219777
2015-01-16compiler, reflect, runtime: Use static chain for closures.Richard Henderson12-2205/+48
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-16net: Restore earlier Solaris-specific version of setKeepAlivePeriod.Ian Lance Taylor1-0/+27
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-15go/build: cgo works on linux/alpha.Ian Lance Taylor1-0/+1
From Uros Bizjak. From-SVN: r219691
2015-01-15reflect: Correct error in conversion of s390x support to Go 1.4.Ian Lance Taylor1-1/+1
From-SVN: r219685
2015-01-15Add files somehow left out of last commit (upgrade to Go 1.4).Ian Lance Taylor2-0/+174
From-SVN: r219628
2015-01-15libgo, compiler: Upgrade libgo to Go 1.4, except for runtime.Ian Lance Taylor588-6750/+29513
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-10cmd/go: Back-port CL 157460043 (pass $CGO_LDFLAGS to linker with the "gccgo" ↵Ian Lance Taylor1-0/+1
toolchain). From-SVN: r219419
2015-01-09cmd/go: Adjust finding gccgo to match current upstream sources.Ian Lance Taylor1-6/+13
From-SVN: r219406
2015-01-08cmd/go: Use builtin constant to set default gccgo compiler.Ian Lance Taylor1-11/+12
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-06libgo: Add sources for go, cgo, and gofmt commands.Ian Lance Taylor132-3/+18957
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
2014-12-13testing: Add testing.MainStart function.Ian Lance Taylor1-5/+51
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-11-21runtime: GOARCH values for ppc64 BE & LEIan Lance Taylor1-1/+1
ppc64 for BE ppc64le for LE issue 8654 From-SVN: r217941
2014-11-05sync/atomic: fix data races in testsIan Lance Taylor1-8/+8
Backport https://codereview.appspot.com/111320044 from Go master library. From-SVN: r217110
2014-11-04libgo: add s390 supportIan Lance Taylor14-5/+1157
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-10-28debug/elf: add power64 support along with relocation testIan Lance Taylor4-1/+233
Backport of https://codereview.appspot.com/125910043 from the dev.power64 branch of the master repository. From-SVN: r216813
2014-10-27libgo: Update to Go 1.3.3 release.Ian Lance Taylor17-57/+325
From-SVN: r216746
2014-10-20reflect: allocate correct type in assignTo and cvtT2IIan Lance Taylor1-11/+11
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-08re PR go/60406 (recover.go: test13reflect2 test failure)Ian Lance Taylor1-17/+10
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-03re PR go/61877 (reflect: cannot use []string as type string in Call)Ian Lance Taylor2-39/+97
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-09-05runtime: Use the clone system call on GNU/Linux.Ian Lance Taylor1-2/+2
Without this we weren't supporting the standard Cloneflags field of SysProcAttr. From-SVN: r214972
2014-09-03compiler: Add precise type information on the heap.Chris Manghane2-6/+42
* 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-07-20runtime: remove unused variableIan Lance Taylor1-4/+3
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-20runtime: add a missing importIan Lance Taylor1-1/+1
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