aboutsummaryrefslogtreecommitdiff
path: root/libgo/go
AgeCommit message (Collapse)AuthorFilesLines
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
2014-07-19reflect, runtime: Use libffi closures to implement reflect.MakeFunc.Ian Lance Taylor5-63/+290
Keep using the existing 386 and amd64 code on those archs, since it is more efficient. From-SVN: r212853
2014-07-19libgo: Update to Go 1.3 release.Ian Lance Taylor422-4133/+11539
From-SVN: r212837
2014-07-12runtime: Merge master revision 19185.Ian Lance Taylor2-19/+21
This revision renames several files in the runtime directory from .c to .goc. From-SVN: r212472
2014-06-24runtime: add missing benchmark input files to the repositoryIan Lance Taylor7-0/+0
From-SVN: r211961
2014-06-06libgo: Merge to master revision 19184.Ian Lance Taylor279-4790/+9742
The next revision, 19185, renames several runtime files, and will be handled in a separate change. From-SVN: r211328
2014-06-04libgo: Merge from revision 18783:00cce3a34d7e of master library.Ian Lance Taylor205-7478/+8793
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-04-17gofrontend: deduplicate C syscall function declarationsIan Lance Taylor1-2/+5
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-17runtime: remove use of obsolete map deletion syntaxIan Lance Taylor1-1/+1
The use of this syntax was eliminated upstream in Go 992248b2adc2, but this particular use slipped through somehow. From-SVN: r209506
2014-04-17gofrontend: avoid use of unsafe.Sizeof extensionIan Lance Taylor1-1/+1
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-16libgo: Remove Solaris 8 & 9 support.Ian Lance Taylor1-10/+0
From Rainer Orth. From-SVN: r209448
2014-03-03libgo: Update to Go 1.2.1 release.Ian Lance Taylor3-10/+65
From-SVN: r208286
2014-01-08re PR go/59430 (os/user FAILs on Solaris)Ian Lance Taylor3-6/+36
PR go/59430 os/user: Use POSIX functions on Solaris. From-SVN: r206412
2014-01-06go/build: Set GOARCH on arm64 systems.Ian Lance Taylor4-3/+5
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
2013-12-28net: work around Solaris connect issue when server closes socketIan Lance Taylor1-0/+10
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-27re PR go/59506 (net FAILs (timeout) on alpha)Ian Lance Taylor1-1/+1
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-25Revert unwanted commit.Uros Bizjak1-1/+1
From-SVN: r206201
2013-12-25re PR target/59422 (Support more targets for function multi versioning)Allan Sandfeld Jensen1-1/+1
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-12reflect: Fix MakeFunc returning float32 or float64 on 386.Ian Lance Taylor2-15/+26
From-SVN: r205932
2013-12-12compiler, reflect, runtime: Implement method values in reflect.Ian Lance Taylor6-44/+115
From-SVN: r205913
2013-12-11reflect, runtime: Let reflect.MakeFunc functions call recover.Ian Lance Taylor2-0/+31
From-SVN: r205908
2013-11-30reflect: Rename struct field to be consistent in assembler and Go.Ian Lance Taylor1-2/+2
From-SVN: r205555
2013-11-30reflect: Fix MakeFunc for 386 when returning a struct.Ian Lance Taylor2-1/+14
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-27libgo: Update to current Go library.Ian Lance Taylor29-59/+240
From-SVN: r205426
2013-11-25syscall: Set SizeofSockaddrAny to the value the go distribution usesIan Lance Taylor1-1/+1
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-24syscall: Only call varargs libc functions from C code.Ian Lance Taylor5-5/+5
From-SVN: r205321
2013-11-19reflect: Handle calls to functions that take or return empty structsIan Lance Taylor1-0/+40
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-14net: On Solaris use Darwin keepalive code.Ian Lance Taylor1-25/+0
From-SVN: r204819
2013-11-14go/build: Add all known gccgo architectures to list.Ian Lance Taylor1-1/+1
From-SVN: r204796
2013-11-14libgo/go/go/build: use syslist.go from the gc stdlib.Ian Lance Taylor1-0/+8
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-11net: Fix TCP keepalive handling for Solaris.Ian Lance Taylor1-0/+25
From-SVN: r204688
2013-11-11mksysinfo, net: Always define F_DUPFD_CLOEXEC.Ian Lance Taylor1-1/+1
For Solaris and CentOS portability. From-SVN: r204687
2013-11-11os: Do not try to run go command in test.Ian Lance Taylor1-0/+1
From-SVN: r204684
2013-11-06libgo: Update to October 24 version of master library.Ian Lance Taylor543-6047/+29665
From-SVN: r204466
2013-10-17syscall: Add Dup3, {Get,List,Remove,Set}xattr, {Get,Set}priority.Ian Lance Taylor2-0/+21
From-SVN: r203788
2013-10-07reflect: Use C style comments in 386 assembly for Solaris assembler.Ian Lance Taylor1-23/+24
From Rainer Orth. From-SVN: r203249
2013-10-04reflect: Fix calling Interface method on value created by MakeFunc.Ian Lance Taylor2-1/+25
From-SVN: r203212
2013-10-02reflect: Use hand-coded .eh_frame section rather than CFI directives.Ian Lance Taylor2-21/+162
From Rainer Orth. From-SVN: r203120