aboutsummaryrefslogtreecommitdiff
path: root/libgo
AgeCommit message (Collapse)AuthorFilesLines
2017-02-17libgo: update to final Go 1.8 releaseIan Lance Taylor19-264/+893
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 From-SVN: r245535
2017-02-13re PR go/79443 (libgo/math test fails on s390x (undefined symbols cosh, ↵Ian Lance Taylor2-0/+3
sinh, tanh, hasVX)) PR go/79443 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 From-SVN: r245397
2017-01-27libgo: update to go1.8rc3Ian Lance Taylor14-92/+389
Reviewed-on: https://go-review.googlesource.com/35844 From-SVN: r244981
2017-01-26runtime: fix setting of isarchiveIan Lance Taylor1-0/+5
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 From-SVN: r244947
2017-01-26runtime: fix context used by getTracebackIan Lance Taylor1-1/+1
I typoed the argument passed to getcontext in getTraceback, and the error was hidden by ucontext_arg. This would have been caught by some of the runtime package tests, but we don't run most of them because they rely on `go build`, and the go tool is not available while running the libgo testsuite. We should fix the libgo testsuite, somehow, so that they run. Reviewed-on: https://go-review.googlesource.com/35837 From-SVN: r244946
2017-01-23libgo: update to go1.8rc2Ian Lance Taylor120-103/+10870
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 From-SVN: r244835
2017-01-23re PR go/79037 (gccgo: Binaries crash with parforsetup: pos is not aligned ↵Ian Lance Taylor3-3/+4
on m68k) PR go/79037 compiler, runtime: align gc data for m68k The current GC requires that the gc data be aligned to at least a 4 byte boundary, because it uses the lower two bits of the address for flags (see LOOP and PRECISE in runtime/mgc0.c). As the gc data is stored as a [...]uintptr, that is normally always true. However, on m68k, that only guarantees 2 byte alignment. Fix it by forcing the alignment. The parfor code used by the current GC requires that the parfor data be aligned to at least an 8 byte boundary. The code in parfor.c verifies this. This is normally true, as the data uses uint64_t values, but, again, this must be enforced explicitly on m68k. Fixes GCC PR 79037. Reviewed-on: https://go-review.googlesource.com/35478 From-SVN: r244824
2017-01-23libgo: bump library version to 11Ian Lance Taylor2-2/+2
As usual I forgot to bump the library version when I updated the library to 1.8rc1. Reviewed-on: https://go-review.googlesource.com/35568 From-SVN: r244823
2017-01-20runtime, testing/internal/testdeps: fixes for cgoIan Lance Taylor4-6/+59
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 From-SVN: r244733
2017-01-20re PR go/79146 (Bootstrapping go on s390x fails; redefined symbols)Ian Lance Taylor1-0/+1
PR go/79146 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. From-SVN: r244731
2017-01-20re PR go/79146 (Bootstrapping go on s390x fails; redefined symbols)Ian Lance Taylor1-0/+1
PR go/79146 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 From-SVN: r244679
2017-01-18syscall, golang_org/x/net/lif: fixes for gccgo on SolarisIan Lance Taylor4-24/+25
Reviewed-on: https://go-review.googlesource.com/35390 From-SVN: r244563
2017-01-16runtime: rename siginfo to _siginfo_tIan Lance Taylor4-10/+8
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 From-SVN: r244484
2017-01-16libgo: correct golang_org Makefile variables not used on all systemsIan Lance Taylor2-4/+4
Patch by Rainer Orth. Reviewed-on: https://go-review.googlesource.com/35238 From-SVN: r244483
2017-01-14libgo: update to Go 1.8 release candidate 1Ian Lance Taylor973-17420/+69003
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. From-SVN: r244456
2017-01-10runtime: copy more scheduler code from Go 1.7 runtimeIan Lance Taylor12-393/+586
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 From-SVN: r244291
2017-01-10compiler, runtime: drop size arguments to hash/equal functionsIan Lance Taylor13-416/+212
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 From-SVN: r244256
2017-01-09runtime: copy more of scheduler from Go 1.7 runtimeIan Lance Taylor15-1541/+1996
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 From-SVN: r244236
2017-01-06runtime: actually remove go-alloc.hIan Lance Taylor1-11/+0
Accidentally omitted from the commit of CL 34797 (SVN revision 244036). From-SVN: r244166
2017-01-06re PR go/78978 (runtime/pprof FAILs on Solaris 2/x86)Ian Lance Taylor5-50/+36
PR go/78978 libgo: build with -Wa,-nH if possible on Solaris By default the Solaris assembler records the required hardware capability in the object file. This means that the AES hashing code breaks on systems that do not support AES, even though the code uses a runtime check to only actually invoke the AES instructions on systems that support it. An earlier fix for the problem only fixed the shared library, not the static libgo.a. Fix the problem for real by using an assembler option to not record the hardware capability. For GCC PR 78978. Patch by Rainer Orth. Reviewed-on: https://go-review.googlesource.com/34910 From-SVN: r244165
2017-01-03runtime: remove __go_alloc and __go_freeIan Lance Taylor17-442/+351
Move allocg and handling of allgs slice from C to Go. Reviewed-on: https://go-review.googlesource.com/34797 From-SVN: r244036
2017-01-03re PR go/78789 (Error: no such instruction: `aesenc %xmm0,%xmm2' when ↵Ian Lance Taylor9-4/+65
compiling libgo/runtime/aeshash.c) PR go/78789 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 From-SVN: r244031
2016-12-19runtime: copy cgo support from Go 1.7 runtimeIan Lance Taylor17-633/+629
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 From-SVN: r243805
2016-12-13libgo: fixes for Solaris buildIan Lance Taylor6-9/+74
Don't put m[0-4] in runtime.inc. Pass -mclear-hwcap to the linker if supported. From Rainer Orth. Reviewed-on: https://go-review.googlesource.com/34331 From-SVN: r243619
2016-12-08runtime: mark non-x86 aeshashbody parameters as unusedIan Lance Taylor1-1/+4
Avoids warnings during the build. Reviewed-on: https://go-review.googlesource.com/34142 From-SVN: r243459
2016-12-08runtime: copy memory hash code from Go 1.7Ian Lance Taylor20-46/+935
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 From-SVN: r243445
2016-12-08runtime: allocate _panic struct on heapIan Lance Taylor1-4/+13
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 From-SVN: r243444
2016-12-08runtime: remove some unused variables/declarations from runtime.hIan Lance Taylor1-4/+0
Small patch from Eric Botcazou. Reviewed-on: https://go-review.googlesource.com/34029 From-SVN: r243424
2016-12-01runtime: set isarchive in initsigIan Lance Taylor1-0/+5
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 From-SVN: r243094
2016-11-30runtime: print C functions in tracebackIan Lance Taylor1-0/+9
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 From-SVN: r243083
2016-11-30runtime: fixes for -buildmode=c-archiveIan Lance Taylor4-5/+23
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 From-SVN: r242992
2016-11-22re PR go/77910 (go: open zversion.go: no such file or directory)Ian Lance Taylor1-1/+6
PR go/77910 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 From-SVN: r242724
2016-11-22runtime: rewrite panic/defer code from C to GoIan Lance Taylor22-1022/+895
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 From-SVN: r242715
2016-11-18runtime: move schedt type and sched var from C to GoIan Lance Taylor3-268/+242
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 From-SVN: r242600
2016-11-18runtime: don't call __go_alloc/__go_free in environment functionsIan Lance Taylor2-33/+21
Reviewed-on: https://go-review.googlesource.com/33363 From-SVN: r242594
2016-11-18libgo: remove old/regexp and old/templateIan Lance Taylor10-4505/+12
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 From-SVN: r242592
2016-11-18Correct gcc/go/gofrontend/lex.cc and libgo/aclocal.m4 to the versions in the ↵Ian Lance Taylor4-210/+5
gofrontend repo... Correct gcc/go/gofrontend/lex.cc and libgo/aclocal.m4 to the versions 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. From-SVN: r242583
2016-11-18Update libgo/configure to restore it to the master version.Ian Lance Taylor5-5/+45
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. From-SVN: r242582
2016-11-18runtime, reflect: rewrite Go to FFI type conversion in GoIan Lance Taylor13-338/+471
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 From-SVN: r242578
2016-11-16runtime: replace runtime1.goc with Go and C codeIan Lance Taylor10-133/+95
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 From-SVN: r242509
2016-11-15config-ml.in: Remove references to GCJ.Matthias Klose2-52/+95
<toplevel> 2016-11-15 Matthias Klose <doko@ubuntu.com> * config-ml.in: Remove references to GCJ. * configure.ac: Likewise. * configure: Regenerate. config/ 2016-11-15 Matthias Klose <doko@ubuntu.com> multi.m4: Don't set GCJ. gcc/ 2016-11-15 Matthias Klose <doko@ubuntu.com> * doc/install.texi: Remove references to gcj/libjava. * doc/invoke.texi: Likewise. */ (where necessary) 2016-11-15 Matthias Klose <doko@ubuntu.com> * configure: Regenerate. From-SVN: r242433
2016-11-14runtime: don't crash if signal handler info argument is nilIan Lance Taylor3-3/+15
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 From-SVN: r242403
2016-11-11libgo: fix GOARCH_INT64ALIGN for several targetsIan Lance Taylor2-10/+2
From Andreas Schwab. Reviewed-on: https://go-review.googlesource.com/33130 From-SVN: r242072
2016-11-10runtime: copy signal code from Go 1.7 runtimeIan Lance Taylor24-934/+1359
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 From-SVN: r242060
2016-11-05re PR go/78172 (gen-sysinfo.go vs AIX cred.h)Ian Lance Taylor1-2/+2
PR go/78172. libgo: avoid confusion in upcase_fields in mksysinfo.sh The mksysinfo.sh script could get confused when there were multiple types starting with the same name. I believe this is the underlying cause of GCC PR 78172. Also redirect a grep to /dev/null to avoid extraneous messages during the build. Reviewed-on: https://go-review.googlesource.com/32821 From-SVN: r241868
2016-11-01libgo: fix GOARCH_PHYSPAGESIZE for ia64Ian Lance Taylor2-2/+2
From Andreas Schwab. Reviewed-on: https://go-review.googlesource.com/32537 From-SVN: r241757
2016-11-01runtime: recreate function called by cgo -gccgoIan Lance Taylor1-0/+17
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 From-SVN: r241743
2016-11-01libgo: only rebuild package if dependent .gox has changedIan Lance Taylor2-4/+10
Use mvifdiff and stamp files to track whether a .gox file has changed. When package A depends on package B, and we rebuild package B, only rebuild package A if package B's .gox file changes. This is safe because when package A imports package B it only reads package B's .gox file. This means that changes that do not affect export information will not cause dependent packages to be recompiled. Reviewed-on: https://go-review.googlesource.com/32476 From-SVN: r241742
2016-11-01libgo: minor Makefile improvementsIan Lance Taylor2-6/+6
Suggested by Ralph Corderoy. Reviewed-on: https://go-review.googlesource.com/32414 From-SVN: r241741
2016-10-30libgo: eliminate a lot of duplication in Makefile.amIan Lance Taylor3-4070/+577
I read through the GNU make manual. I knew there had to be a way to do it. Remove the special netgo library. The essential feature--using the Go DNS resolver--is now available by setting GODEBUG=netdns=go. Reviewed-on: https://go-review.googlesource.com/32333 From-SVN: r241687