aboutsummaryrefslogtreecommitdiff
path: root/libgo
AgeCommit message (Collapse)AuthorFilesLines
2018-09-26syscall: don't assume we have a GETEUID system callIan Lance Taylor2-0/+10
On Alpha GNU/Linux there is no geteuid system call, there is only getresuid. The raw geteuid system call is only used for testing, so just skip the test if it's not available. Reviewed-on: https://go-review.googlesource.com/137655 From-SVN: r264647
2018-09-26runtime, os: fix the build on SolarisIan Lance Taylor3-4/+61
Reviewed-on: https://go-review.googlesource.com/137535 From-SVN: r264593
2018-09-25internal/bytealg, internal/cpu, internal/poll: portability fixesIan Lance Taylor15-53/+34
In internal/bytealg correct a +build tag to never build indexbyte_generic.go for the gofrontend, where we always use indexbyte_native.go. For internal/cpu let the Makefile define CacheLineSize using goarch.sh, rather than trying to enumerate all the possibilities in cpu_ARCH.go files. In internal/poll call the C fcntl function rather than using SYS_FCNTL. Change mksysinfo.sh to ensure that F_GETPIPE_SZ is always defined, and check that in internal/poll. Reviewed-on: https://go-review.googlesource.com/137256 From-SVN: r264572
2018-09-25cmd/go: pass down testing gccgo in TestScriptIan Lance Taylor3-4/+11
This permits TestScript to work when gccgo is not installed. Previous testing was using a previously installed gccgo, not the newly built one. This revealed that the testing of whether an internal package is permitted was incorrect for standard library packages, since the uninstalled gccgo can see internal packages in the uninstalled libgo. Fix the internal package tests. This permitted removing a couple of gccgo-specific changes in the testsuite. Reviewed-on: https://go-review.googlesource.com/137255 From-SVN: r264570
2018-09-24libgo: update to Go 1.11Ian Lance Taylor1510-18932/+83837
Reviewed-on: https://go-review.googlesource.com/136435 gotools/: * Makefile.am (mostlyclean-local): Run chmod on check-go-dir to make sure it is writable. (check-go-tools): Likewise. (check-vet): Copy internal/objabi to check-vet-dir. * Makefile.in: Rebuild. From-SVN: r264546
2018-09-14cmd/go: correct gccgo buildid file on ARMIan Lance Taylor1-2/+6
Bring in https://golang.org/cl/135297 from the gc repository to fix a GCC bug report. Original CL description: The GNU assembler for ARM treats @ as a comment character, so section types must be written using % instead. Fixes https://gcc.gnu.org/PR87260. Reviewed-on: https://go-review.googlesource.com/135360 From-SVN: r264330
2018-09-13compiler, runtime: call gcWriteBarrier instead of writebarrierptrIan Lance Taylor2-21/+26
In 1.11 writebarrierptr is going away, so change the compiler to call gcWriteBarrier instead. We weren't using gcWriteBarrier before; adjust the implementation to use the putFast method. This revealed a problem in the kickoff function. When using cgo, kickoff can be called on the g0 of an m allocated by newExtraM. In that case the m will generally have a p, but systemstack may be called by wbBufFlush as part of flushing the write barrier buffer. At that point the buffer is full, so we can not do a write barrier. So adjust the existing code in kickoff so that in the case where we are g0, don't do any write barrier at all. Reviewed-on: https://go-review.googlesource.com/131395 From-SVN: r264295
2018-09-13runtime: correct counters in sweepIan Lance Taylor2-8/+27
In the sweep code we can sometimes see incorrect counts when conservative stack scanning causes us to grey an object that we earlier decided could be freed. We already ignored this check, but adjust this case to maintain correct span counts when it happens. This gives us slightly more correct numbers in MemStats, and helps avoid a rare failure in TestReadMemStats. Also fix the free index, and cope with finding a full span when allocating a new one. Reviewed-on: https://go-review.googlesource.com/134216 From-SVN: r264294
2018-09-13compiler, runtime: open code selectIan Lance Taylor1-205/+61
This is the gofrontend version of https://golang.org/cl/37933, https://golang.org/cl/37934, and https://golang.org/cl/37935. Open code the initialization of select cases. This is a step toward updating libgo to the 1.11 release. Reviewed-on: https://go-review.googlesource.com/135000 From-SVN: r264290
2018-09-13runtime: avoid write barriers with traceback infoIan Lance Taylor5-11/+13
Unlike the gc runtime, libgo stores traceback information in location structs, which contain strings. Therefore, copying location structs around appears to require write barriers, although in fact write barriers are never important because the strings are never allocated in Go memory. They come from libbacktrace. Some of the generated write barriers come at times when write barriers are not permitted. For example, exitsyscall, marked nowritebarrierrec, calls exitsyscallfast which calls traceGoSysExit which calls traceEvent which calls traceStackID which calls trace.stackTab.put which copies location values into memory allocated by tab.newStack. This write barrier can be invoked when there is no p, causing a crash. This change fixes the problem by ensuring that location values are copied around in the tracing code with no write barriers. This was found by fixing the compiler to fully implement //go:nowritebarrierrec; CL to follow. Reviewed-on: https://go-review.googlesource.com/134226 From-SVN: r264282
2018-09-13libgo: build roots index to speed up bulkBarrierPreWriteIan Lance Taylor4-21/+122
To reduce the amount of time spent in write barrier processing (specifically runtime.bulkBarrierPreWrite), add support for building a 'GC roots index', basically a sorted list of all roots, so as to allow more efficient lookups of gcdata structures for globals. The previous implementation worked on the raw (unsorted) roots list itself, which did not scale well. Reviewed-on: https://go-review.googlesource.com/132595 From-SVN: r264276
2018-08-29compiler, runtime: remove hmap field from maptypesIan Lance Taylor3-15/+1
This is the gofrontend version of https://golang.org/cl/91796. This is part of that CL, just the compiler change and required runtime changes, in preparation for updating libgo to 1.11. Relevant part of original CL description: The hmap field in the maptype is only used by the runtime to check the sizes of the hmap structure created by the compiler and runtime agree. Comments are already present about the hmap structure definitions in the compiler and runtime needing to be in sync. Reviewed-on: https://go-review.googlesource.com/130976 From-SVN: r263941
2018-08-24runtime: remove the dummy arg of getcallerspIan Lance Taylor9-42/+38
This is a port of https://golang.org/cl/109596 to the gofrontend, in preparation for updating libgo to 1.11. Original CL description: getcallersp is intrinsified, and so the dummy arg is no longer needed. Remove it, as well as a few dummy args that are solely to feed getcallersp. Reviewed-on: https://go-review.googlesource.com/131116 From-SVN: r263840
2018-08-07runtime: use poll rather than pollset for netpoll on AIXIan Lance Taylor2-109/+95
Updates golang/go#26634 Reviewed-on: https://go-review.googlesource.com/126857 From-SVN: r263364
2018-08-07libgo: uncomment trace.Stop() call in testing packageIan Lance Taylor1-1/+1
Fix up the testing package to insure that execution traces work properly (e.g. "-test.trace=<XXX>" command line option). The call to stop tracing and emit the output file was stubbed out. Reviewed-on: https://go-review.googlesource.com/128275 From-SVN: r263363
2018-07-27libgo: prune sighandler frames in runtime.sigprofIan Lance Taylor2-11/+70
When writing stack frames to the pprof CPU profile machinery, it is very important to insure that the frames emitted do not contain any frames corresponding to artifacts of the profiling process itself (signal handlers, sigprof, etc). This patch changes runtime.sigprof to strip out those frames from the raw stack generated by "runtime.callers". Fixes golang/go#26595. Reviewed-on: https://go-review.googlesource.com/126175 From-SVN: r263035
2018-07-13runtime: skip zero-sized fields in structs when converting to FFIIan Lance Taylor1-3/+45
The libffi library doesn't understand zero-sized objects. When we see a zero-sized field in a struct, just skip it when converting to the FFI data structures. There is no value to pass in any case, so not telling libffi about the field doesn't affect anything. The test case for this is https://golang.org/cl/123316. Fixes golang/go#26335 Reviewed-on: https://go-review.googlesource.com/123335 From-SVN: r262651
2018-07-02re PR go/86331 (the gccgo's "go" tool looks like failing to invoke any sub ↵Ian Lance Taylor1-2/+5
go command) PR go/86331 os: check return value as well as error from waitid https://gcc.gnu.org/PR86331 indicates that if a signal handler runs it is possible for syscall.Syscall6 to return a non-zero errno value even if no error occurs. That is a problem in general, but this fix will let us work around the general problem for the specific case of calling waitid. Reviewed-on: https://go-review.googlesource.com/121595 From-SVN: r262313
2018-06-28runtime: don't stat a NULL filenameIan Lance Taylor1-1/+1
Noticed in https://gcc.gnu.org/PR86331. Reviewed-on: https://go-review.googlesource.com/121417 From-SVN: r262234
2018-06-23runtime: use #ifdef instead of #if for USING_SPLIT_STACKIan Lance Taylor1-3/+3
USING_SPLIT_STACK is configured as defined/undefined, not 0/1. Most of the places test USING_SPLIT_STACK with #ifdef, with a few exceptions. This CL fixes the exceptions. Reviewed-on: https://go-review.googlesource.com/120596 From-SVN: r261980
2018-06-22syscall: remove UstatIan Lance Taylor6-83/+0
glibc 2.28 removes ustat.h and the ustat function entirely, which breaks syscall.Ustat. Updates golang/go#25990 Reviewed-on: https://go-review.googlesource.com/120535 From-SVN: r261896
2018-06-21cmd/go: re-enable a couple of tests of gccgoIan Lance Taylor1-2/+0
Port https://golang.org/cl/120375 over to the gofrontend repo so that it gets more reliable testing. Updates golang/go#22472 Reviewed-on: https://go-review.googlesource.com/120395 From-SVN: r261871
2018-06-13libgo: update to Go 1.10.3 releaseIan Lance Taylor30-327/+552
Reviewed-on: https://go-review.googlesource.com/118495 From-SVN: r261549
2018-06-11libgo: add riscv and js/wasm as known targetsIan Lance Taylor5-7/+17
Incorporates cut down versions of https://golang.org/cl/102835 and https://golang.org/cl/106256 from the master sources. This will tell go/build to skip files with those tags. Reviewed-on: https://go-review.googlesource.com/117996 From-SVN: r261451
2018-06-06reflect: fix StructOf hash and stringIan Lance Taylor2-2/+13
Adjust the hash and string fields computed by StructOf to match the values that the compiler computes for a struct type with the same field names and types. This makes the reflect code match the compiler's Type::hash_for_method and Type::reflection methods. Fixes golang/go#25284 Reviewed-on: https://go-review.googlesource.com/116515 From-SVN: r261235
2018-06-05reflect: canonicalize types returned by StructOf() and friendsIan Lance Taylor2-20/+33
Background: since gccgo does not currently merge identical types at link time, the reflect function canonicalize() exists to choose a canonical specimen for each set of identical types. In this way, user code has the guarantee that identical types will always compare as == Change: arrange reflect functions MapOf(), SliceOf(), StructOf() etc. to call canonicalize() on the types they create, before storing the types in internal lookup caches and returning them. This fixes known cases where canonicalize() is needed but was missing. Supersedes https://golang.org/cl/112575 and mostly fixes issue 25284. Updates golang/go#25284 Reviewed-on: https://go-review.googlesource.com/115577 From-SVN: r261216
2018-05-31libgo: update to Go 1.10.2 releaseIan Lance Taylor38-157/+852
Reviewed-on: https://go-review.googlesource.com/115196 From-SVN: r261041
2018-05-30cmd/go, cmd/vet: make vet work with gccgoIan Lance Taylor5-10/+34
Backport https://golang.org/cl/113715 and https://golang.org/cl/113716: cmd/go: don't pass -compiler flag to vet Without this running go vet -compiler=gccgo causes vet to fail. The vet tool does need to know the compiler, but it is passed in vetConfig.Compiler. cmd/go, cmd/vet, go/internal/gccgoimport: make vet work with gccgo When using gccgo/GoLLVM, there is no package file for a standard library package. Since it is impossible for the go tool to rebuild the package, and since the package file exists only in the form of a .gox file, this seems like the best choice. Unfortunately it was confusing vet, which wanted to see a real file. This caused vet to report errors about missing package files for standard library packages. The gccgoimporter knows how to correctly handle this case. Fix this by 1) telling vet which packages are standard; 2) letting vet skip those packages; 3) letting the gccgoimporter handle this case. As a separate required fix, gccgo/GoLLVM has no runtime/cgo package, so don't try to depend on it (as it happens, this fixes golang/go#25324). The result is that the cmd/go vet tests pass when using -compiler=gccgo. Reviewed-on: https://go-review.googlesource.com/114516 From-SVN: r260913
2018-05-30crypto/x509: specify path to AIX certificate fileIan Lance Taylor1-1/+3
Reviewed-on: https://go-review.googlesource.com/113179 From-SVN: r260908
2018-05-09go/build, cmd/go: update to match recent changes to gcIan Lance Taylor9-56/+172
Several recent changes to the gc version of cmd/go improve the gofrontend support. These changes are partially copies of existing gofrontend differences, and partially new code. This CL makes the gofrontend match the upstream code. The changes included here come from: https://golang.org/cl/111575 https://golang.org/cl/111595 https://golang.org/cl/111635 https://golang.org/cl/111636 For the record, the following recent gc changes are based on code already present in the gofrontend repo: https://golang.org/cl/110915 https://golang.org/cl/111615 For the record, a gc change, partially based on earlier gofrontend work, also with new gc code, was already copied to gofrontend repo in CL 111099: https://golang.org/cl/111097 This moves the generated list of standard library packages from cmd/go/internal/load to go/build. Reviewed-on: https://go-review.googlesource.com/112475 gotools/: * Makefile.am (check-go-tool): Don't copy zstdpkglist.go. * Makefile.in: Rebuild. From-SVN: r260097
2018-05-04cmd/go: on AIX, pass -X64 first when invoking arIan Lance Taylor1-1/+1
Reviewed-on: https://go-review.googlesource.com/111535 From-SVN: r259946
2018-05-04libgo: fix for unaligned read in go-unwind.c's read_encoded_value()Ian Lance Taylor1-11/+43
Change code to work properly reading unaligned data on architectures that don't support unaliged reads. This fixes a regression (broke Solaris/sparc) introduced in https://golang.org/cl/90235. Reviewed-on: https://go-review.googlesource.com/111296 From-SVN: r259935
2018-05-04cmd/go: update mkalldocs.shIan Lance Taylor2-9/+11
Update mkalldocs.sh from the current master sources, replacing the old mkdoc.sh. Reviewed-on: https://go-review.googlesource.com/111096 From-SVN: r259920
2018-05-04cmd/go: enable tests of vet toolIan Lance Taylor1-4/+0
Since gofrontend does have the vet tool now, we can test it. Reviewed-on: https://go-review.googlesource.com/111095 From-SVN: r259919
2018-05-04cmd/go: update to match recent changes to gcIan Lance Taylor7-20/+46
In https://golang.org/cl/111097 the gc version of cmd/go was updated to include some gofrontend-specific changes. The gofrontend code already has different versions of those changes; this CL makes the gofrontend match the upstream code. Reviewed-on: https://go-review.googlesource.com/111099 From-SVN: r259918
2018-05-03cmd/go: run tests that require package build IDsIan Lance Taylor1-2/+0
These tests used to be disabled in the gofrontend since the go tool didn't support build IDs for the gofrontend. It does now, so enable the tests again. Reviewed-on: https://go-review.googlesource.com/111098 From-SVN: r259875
2018-05-02libgo: add type/const references to sysinfo.cIan Lance Taylor2-0/+210
This patch adds explicit references to various types and constants defined by the header files included by sysinfo.c (used to drive the generation of gen-sysinfo.go as part of the libgo build via the GCC "-fdump-go-spec" option). The intent is to enable clients to gather the same info generated by "-fdump-go-spec" by instead reading the generated DWARF from a sysinfo.o object file compiled with "-g". Some compilers (notably clang) try to omit DWARF records for a given type unless there is an explicit use of it in the translation unit; the additional references are to insure that everything we want to see in the DWARF shows up. Reviewed-on: https://go-review.googlesource.com/99063 From-SVN: r259868
2018-05-02libgo: add support for the Nios II architectureIan Lance Taylor13-15/+30
Reviewed-on: https://go-review.googlesource.com/90775 From-SVN: r259866
2018-05-02runtime: remove unused stack.goIan Lance Taylor1-1229/+0
We're never going to use stack.go for gccgo. Although a build tag keeps it from being built, even having it around can be confusing. Remove it. Reviewed-on: https://go-review.googlesource.com/40774 From-SVN: r259865
2018-05-02libgo: refactor code to enumerate stdlib packagesIan Lance Taylor6-784/+424
Move the list of libgo, gotool, and check-target packages into separate files, then read the file contents as part of the build process on the fly. This is intended to enable other build tooling to share the canonical list of target packages (avoid duplication). Reviewed-on: https://go-review.googlesource.com/89515 libgo: revise rules for runtime.inc generation Refactor code for generating runtime.inc: extract out the relevant commands and place them in a separate shell script ("mkruntimeinc.sh"). Update rules to avoid generating macros whose names begin with "$", such as "#define $sinkconst0 0". Reviewed-on: https://go-review.googlesource.com/85955 From-SVN: r259863
2018-05-02libgo: break dependence on libgcc unwind-pe.hIan Lance Taylor1-2/+165
The C portion of the Go runtime includes the header "unwind-pe.h" from libgcc, which contains some constants and a few small routines for decoding pointer values within unwind info. This patch gets rid of that include and instead adds a re-implementation of that functionality in the single file that uses it. The intent is to allow the C runtime portion of libgo to be built without a companion GCC installation. Reviewed-on: https://go-review.googlesource.com/90235 From-SVN: r259861
2018-05-01re PR go/85429 (Several gotools tests FAIL with Solaris as)Ian Lance Taylor1-2/+21
PR go/85429 cmd/go: support more Solaris assembler syntaxes Patch by Rainer Orth. Reviewed-on: https://go-review.googlesource.com/110563 From-SVN: r259797
2018-04-27re PR go/85429 (Several gotools tests FAIL with Solaris as)Ian Lance Taylor1-3/+9
PR go/85429 cmd/go: add Solaris assembler syntax for gccgo buildid file The Solaris assembler uses a different syntax for section directives. This is https://golang.org/cl/109140 ported over to gccgo. Reviewed-on: https://go-review.googlesource.com/109141 From-SVN: r259719
2018-04-20gotest: only use [TD] on big-endian PPC64 non-AIX systemsIan Lance Taylor1-3/+7
Reviewed-on: https://go-review.googlesource.com/108457 From-SVN: r259531
2018-04-17os/signal: disable loading of history during testIan Lance Taylor1-0/+2
Bring in https://golang.org/cl/98616 from gc tip. Original CL description: This change modifies Go to disable loading of users' shell history for TestTerminalSignal tests. TestTerminalSignal, as part of its workload, will execute a new interactive bash shell. Bash will attempt to load the user's history from the file pointed to by the HISTFILE environment variable. For users with large histories that may take up to several seconds, pushing the whole test past the 5 second timeout and causing it to fail. Reviewed-on: https://go-review.googlesource.com/107624 From-SVN: r259452
2018-04-17gccgo: suppress "ar rcD" and "-zdefs" on AIXIan Lance Taylor1-5/+8
Reviewed-on: https://go-review.googlesource.com/100955 From-SVN: r259445
2018-03-26runtime: don't check for stale runtimeIan Lance Taylor1-0/+3
The gccgo runtime is never stale, and on a system with gc sources in ~/go the test may wind up checking whether the gc runtime is stale. Reviewed-on: https://go-review.googlesource.com/102282 From-SVN: r258865
2018-03-16libgo: add runtime/pprof/internal/profile.gox to noinst_DATAIan Lance Taylor2-3/+7
Also add noinst_DATA to CHECK_DEPS; it's not needed in practice since `make` will build noinst_DATA, but it's logically required and will make a difference if any of the noinst_DATA sources change between `make` and `make check`. Tony Reix figured out why omitting packages from noinst_DATA didn't seem to matter: because if gccgo can't find foo.gox, it will fall back to reading the export data in foo.o, and foo.o will exist because these packages go into libgo.a. Reviewed-on: https://go-review.googlesource.com/101077 From-SVN: r258606
2018-03-15cmd/go: force LANG=C when looking for compiler versionIan Lance Taylor1-1/+12
Tested by installing the gcc-locales package and running LANG=de_DE.utf8 go build hello.go Without this change, that fails, as described at https://gcc.gnu.org/PR84765. Reviewed-on: https://go-review.googlesource.com/100737 From-SVN: r258565
2018-03-09commit ce28919112dbb234366816ab39ce060ad45e8ca9Ian Lance Taylor2-2/+3
Makefile: add internal/trace to noinst_DATA The internal/trace package is only imported by tests (specifically the tests in runtime/trace) so it must be in noinst_DATA to ensure that it is built before running the tests. This was mostly working because internal/trace has tests itself, and is listed in check-packages.txt before runtime/trace, so typical invocations of make would build internal/trace for checking purposes before checking runtime/trace. But we need this change to make that reliable. Reviewed-on: https://go-review.googlesource.com/99836 From-SVN: r258392