summaryrefslogtreecommitdiff
path: root/libgo/go
AgeCommit message (Collapse)Author
2020-05-11syscall: append to environment in tests, don't clobber itIan Lance Taylor
This is a partial backport of https://golang.org/cl/233318. It's only a partial backport because part of the change was already applied to libgo in CL 193497 as part of the update to the Go 1.13beta1 release. Fixes PR go/95061 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/233359
2020-04-20gccgo: fix runtime compilation on NetBSDBenny Siegert
si_code in siginfo_t is a macro on NetBSD, not a member of the struct itself, so add a C trampoline for receiving its value. Also replace references to mos.waitsemacount with the replacement and add some helpers from os_netbsd.go in the GC repository. Update golang/go#38538. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/228918
2020-04-09libgo: update to final 1.14.2 releaseIan Lance Taylor
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/227551
2020-04-06libgo: update to almost the 1.14.2 releaseIan Lance Taylor
Update to edea4a79e8d7dea2456b688f492c8af33d381dc2 which is likely to be approximately the 1.14.2 release. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/227377
2020-02-26libgo: update to final Go1.14 releaseIan Lance Taylor
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/221158
2020-02-24internal/poll: add hurd build tagIan Lance Taylor
Patch from Svante Signell. Fixes GCC PR go/93900 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/220592
2020-02-24internal/syscall/unix: add hurd build tagIan Lance Taylor
Patch from Svante Signell. Fixes GCC PR go/93900 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/220589
2020-02-18cmd/go: update -DGOPKGPATH to use current pkgpath encodingIan Lance Taylor
This will need to be done in the gc version too, probably more cleverly. This version will ensure that the next GCC release works correctly when using the GCC version of the go tool. Updates golang/go#37272 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/219817
2020-02-15libgo: update to Go1.14rc1 releaseIan Lance Taylor
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/218017
2020-02-15runtime: on 32-bit systems, limit default GOMAXPROCS to 32Ian Lance Taylor
Otherwise we can easily run out of stack space for threads. The user can still override by setting GOMAXPROCS. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/219278
2020-02-03syscall: fix riscv64 GNU/Linux buildIan Lance Taylor
Make syscall_linux_riscv64.go, new in the 1.14beta1 release, look like the other syscall_linux_GOARCH.go files. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/217577
2020-01-29runtime, syscall: add a couple of hurd build tagsIan Lance Taylor
Patch by Svante Signell. Updates PR go/93468 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/216959
2020-01-29runtime: update netpoll_hurd.go for go1.14beta1 changesIan Lance Taylor
Patch from Svante Signell. Updates PR go/93468 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/216958
2020-01-23internal/cpu: don't define CacheLinePadSize for riscv64Ian Lance Taylor
In libgo CacheLinePadSize is defined by the generated file cpugen.go. Keep cpu_riscv64.go around, even though it is now empty, so that we will pick up changes to it in future merges. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/216077
2020-01-22runtime: for Solaris, add osinit, and drop duplicate getncpuIan Lance Taylor
Fixes a build breakage introduced in the 1.14beta1 upgrade. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/215857
2020-01-22internal/syscall/unix: use getrandom_linux_generic.go on arm64beAndrew Pinski
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/215342
2020-01-21libgo: update to Go1.14beta1Ian Lance Taylor
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/214297
2020-01-09libgo: compile examples in _test packagesIan Lance Taylor
Previously if the only names defined by _test packages were examples, the gotest script would emit an incorrect _testmain.go file. I worked around that by marking the example_test.go files +build ignored. This CL changes the gotest script to handle this case correctly, and removes the now-unnecessary build tags. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/214039 From-SVN: r280085
2020-01-07compiler, runtime: stop using __go_runtime_errorIan Lance Taylor
Use specific panic functions instead, which are mostly already in the runtime package. Also correct "defer nil" to panic when we execute the defer, rather than throw when we queue it. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/213642 From-SVN: r279979
2020-01-02compiler, runtime, reflect: generate hash functions only for map keysIan Lance Taylor
Right now we generate hash functions for all types, just in case they are used as map keys. That's a lot of wasted effort and binary size for types which will never be used as a map key. Instead, generate hash functions only for types that we know are map keys. Just doing that is a bit too simple, since maps with an interface type as a key might have to hash any concrete key type that implements that interface. So for that case, implement hashing of such types at runtime (instead of with generated code). It will be slower, but only for maps with interface types as keys, and maybe only a bit slower as the aeshash time probably dominates the dispatch time. Reorg where we keep the equals and hash functions. Move the hash function from the key type to the map type, saving a field in every non-map type. That leaves only one function in the alg structure, so get rid of that and just keep the equal function in the type descriptor itself. While we're here, reorganize the rtype struct to more closely match the gc version. This is the gofrontend version of https://golang.org/cl/191198. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/212843 From-SVN: r279848
2019-12-24re PR go/93020 (Final patches to build gcc-10 on GNU/Hurd)Ian Lance Taylor
PR go/93020 libgo: Hurd portability patches By Svante Signell. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/212409 From-SVN: r279724
2019-12-09re PR go/92861 (Passes relative time to sem_timedwait on GNU/Hurd)Ian Lance Taylor
PR go/92861 runtime: don't define CLOCK_REALTIME in os_hurd.go It's already defined in sysinfo.go. Patch by Samuel Thibault. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/210538 From-SVN: r279136
2019-12-09re PR go/92861 (Passes relative time to sem_timedwait on GNU/Hurd)Ian Lance Taylor
PR go/92861 runtime: use absolute time for sem_timedwait Patch by Samuel Thibault. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/210457 From-SVN: r279106
2019-12-06re PR other/29842 ([meta-bug] outstanding patches / issues from ↵Ian Lance Taylor
STMicroelectronics) PR go/29842 runtime: update HURD support for mOS now being embedded Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/210285 From-SVN: r279062
2019-11-19libgo: better cmd/cgo handling for '.' in pkgpathIan Lance Taylor
Updates cgo's gccgoPkgpathToSymbolNew() to bring it into conformance with the way that gccgo now handles package paths with embedded dots (see CL 200838). See also https://gcc.gnu.org/PR61880, a related bug. This CL is a copy of CL 207957 in the main Go repo. Updates golang/go#35623. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/207977 From-SVN: r278470
2019-10-14runtime: correct facilities names in s390 CPU supportIan Lance Taylor
Patch from Andreas Krebbel. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/201038 From-SVN: r276964
2019-10-14internal/cpu: define kdsaQuery for s390Ian Lance Taylor
Patch from Andreas Krebbel. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/201037 From-SVN: r276962
2019-09-17runtime: for FFI, treat directIface types as pointersIan Lance Taylor
This only matters on systems that pass a struct with a single pointer field differently than passing a single pointer. I noticed it on 32-bit PPC, where the reflect package TestDirectIfaceMethod failed. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/195878 From-SVN: r275814
2019-09-17re PR go/91781 (r275691 breaks go test "reflect")Ian Lance Taylor
PR go/91781 reflect: promote integer closure return to full word The libffi library expects an integer return type to be promoted to a full word. Implement that when returning from a closure written in Go. This only matters on big-endian systems when returning an integer smaller than the pointer size, which is why we didn't notice it until now. Fixes https://gcc.gnu.org/PR91781. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/195858 From-SVN: r275813
2019-09-17reflect: unexport FFICallbackGo; use go:linkname insteadIan Lance Taylor
The function was always intended to be internal-only, but was exported so that C code could call it. Now that have go:linkname for that, use it. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/195857 From-SVN: r275809
2019-09-12libgo: update to Go1.13Ian Lance Taylor
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/194698 From-SVN: r275691
2019-09-11golang.org/x/sys/cpu: define doinit when neededIan Lance Taylor
Should fix the build on riscv64 and other systems. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/194641 From-SVN: r275650
2019-09-10libgo: Solaris and x/sys/cpu compatibility fixesIan Lance Taylor
Restore Solaris compatibility fixes lost when internal/x/net/lif moved to golang.org/x/net/lif. Also fix the Makefile for x/net/lif and x/net/route. Change x/sys/cpu to get the cache line size from goarch.sh as the gofrontend version of internal/cpu does. Partially based on work by Rainer Orth. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/194438 From-SVN: r275611
2019-09-10go/internal/gccgoimporter: support embedded field in pointer loopIan Lance Taylor
Backport of https://golang.org/cl/194440. Original description: If an embedded field refers to a type via a pointer, the parser needs to know the name of the embedded field. It is possible that the pointer type is not yet resolved. This CL fixes the parser to handle that case by setting the pointer element type to the unresolved named type while the pointer is being resolved. Updates golang/go#34182 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/194562 From-SVN: r275606
2019-09-10cmd/go: look for tool build ID before hashing entire fileIan Lance Taylor
Also fix the key used to store the ID. This is a significant speedup in cmd/go run time. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/194257 From-SVN: r275559
2019-09-06libgo: update to Go 1.13beta1 releaseIan Lance Taylor
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/193497 From-SVN: r275473
2019-08-31compiler, runtime: support and use single argument go:linknameIan Lance Taylor
The gc compiler has started permitting go:linkname comments with a single argument to mean that a function should be externally visible outside the package. Implement this in the Go frontend. Change the libgo runtime package to use it, rather than repeating the name just to export a function. Remove a couple of unnecessary go:linkname comments on declarations. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/192197 From-SVN: r275239
2019-08-31runtime: always build panic32.goIan Lance Taylor
Avoids problems with arm64 ILP32 mode. We might want to handle that mode better in general, but always building panic32.go is simple and fixes the build. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/192723 From-SVN: r275237
2019-08-30compile, runtime: permit anonymous and empty fields in C headerIan Lance Taylor
Permit putting structs with anonymous and empty fields in the C header file runtime.inc that is used to build the C runtime code. This is required for upcoming 1.13 support, as the m struct has picked up an anonymous field. Doing this lets the C header contain all the type descriptor structs, so start using those in the C code. This cuts the number of copies of type descriptor definitions from 3 to 2. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/192343 From-SVN: r275227
2019-08-28runtime: move osinit to GoIan Lance Taylor
This is a step toward updating libgo to 1.13. This adds the 1.13 version of the osinit function to Go code, and removes the corresponding code from the C runtime. This should simplify future updates. Some additional 1.13 code was brought in to simplify this change. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/191717 From-SVN: r275010
2019-08-28compiler, runtime: provide index information on bounds check failureIan Lance Taylor
This implements https://golang.org/cl/161477 in the gofrontend. Updates golang/go#30116 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/191881 From-SVN: r274998
2019-08-23compiler: record pointer var values to remove write barriersIan Lance Taylor
Record when a local pointer variable is set to a value such that indirecting through the pointer does not require a write barrier. Use that to eliminate write barriers when indirecting through that local pointer variable. Only keep this information per-block, so it's not all that applicable. This reduces the number of write barriers generated when compiling the runtime package from 553 to 524. The point of this is to eliminate a bad write barrier in the bytes function in runtime/print.go. Mark that function nowritebarrier so that the problem does not recur. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/191581 From-SVN: r274890
2019-08-19runtime: be more strict in GCIan Lance Taylor
With CL 190599, along with what we do in greyobject, we ensure that we only mark allocated heap objects. As a result we can be more strict in GC: - Enable "sweep increased allocation count" check, which checks that the number of mark bits set are no more than the number of allocation bits. - Enable invalid pointer check on heap scan. We only trace allocated heap objects, which should not contain invalid pointer. This also makes the libgo runtime more convergent with the gc runtime. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/190797 From-SVN: r274678
2019-08-17compiler, runtime: allocate defer records on the stackIan Lance Taylor
When a defer is executed at most once in a function body, we can allocate the defer record for it on the stack instead of on the heap. This should make defers like this (which are very common) faster. This is a port of CL 171758 from the gc repo. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/190410 From-SVN: r274613
2019-08-17runtime: scan write barrier buffer conservativelyIan Lance Taylor
In gccgo, we insert the write barriers in the frontend, and so we cannot completely prevent write barriers on stack writes. So it is possible for a bad pointer appearing in the write barrier buffer. When flushing the write barrier, treat it the same as sacnning the stack. In particular, don't mark a pointer if it does not point to an allocated object. We already have similar logic in greyobject. With this, hopefully, we can prevent an unallocated object from being marked completely. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/190599 From-SVN: r274598
2019-07-04compiler: optimize 0,1,2-case select statementIan Lance Taylor
For a select statement with zero-, one-, or two-case with a default case, we can generate simpler code instead of calling the generic selectgo. A zero-case select is just blocking the execution. A one-case select is mostly just executing the case. A two-case select with a default case is a non-blocking send or receive. We add these special cases for lowering a select statement. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/184998 From-SVN: r273034
2019-06-26cmd/go: silence ar with D flag failuresIan Lance Taylor
The first call of ar must not show its output in order to avoid useless error messages about D flag. The corresponding Go toolchain patch is CL 182077. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/183817 From-SVN: r272661
2019-06-24compiler: open code string equalityIan Lance Taylor
Open code string equality with builtin memcmp. This allows further optimizations in the backend. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/183538 From-SVN: r272624
2019-06-21runtime: inline and remove eqtypeIan Lance Taylor
Now that type equality is just a pointer equality, write it inlined and remove the eqtype function. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/182978 From-SVN: r272578
2019-06-21compiler: open code some type assertionsIan Lance Taylor
Now that type equality is just simple pointer equality, we can open code some type assertions instead of making runtime calls. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/182977 From-SVN: r272577