aboutsummaryrefslogtreecommitdiff
path: root/libgo
AgeCommit message (Collapse)AuthorFilesLines
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
2018-03-07runtime: push arena on AIX higher due to clashesIan Lance Taylor1-2/+2
Reviewed-on: https://go-review.googlesource.com/99117 From-SVN: r258337
2018-03-07runtime: use a fence instruction before rdtscIan Lance Taylor1-4/+55
This implements the same choices made in the gc runtime, except that for 32-bit x86 we only use the fence instruction if the processor supports SSE2. The code here is hacked up for speed; the gc runtime uses straight assembler. Reviewed-on: https://go-review.googlesource.com/97715 From-SVN: r258336
2018-03-05libgo: fix typo in mksysinfo.sh scriptIan Lance Taylor1-1/+1
Fix a small typo in the mksysinfo.sh script (incorrect input file for a grep command). Reviewed-on: https://go-review.googlesource.com/98635 From-SVN: r258259
2018-02-28runtime: update AIX memory allocation for new versionsIan Lance Taylor1-5/+8
Reviewed-on: https://go-review.googlesource.com/97357 From-SVN: r258052
2018-02-28libgo: update to final Go 1.10 releaseIan Lance Taylor6-11/+66
Reviewed-on: https://go-review.googlesource.com/97517 From-SVN: r258051
2018-02-22re PR go/84484 (libgo configure tests fail to find -latomic)Andreas Schwab15-17/+29
PR go/84484 libgo: add support for riscv64 Patch by Andreas Schwab. Reviewed-on: https://go-review.googlesource.com/96377 * go.test/go-test.exp (go-set-goarch): Recognize riscv64-*-*. From-SVN: r257914
2018-02-22runtime: funcfileline: get missing function name from symbol tableIan Lance Taylor3-13/+23
Copy the idea of https://golang.org/cl/92756 to funcfileline, which is used by runtime.FuncForPC, runtime.(*Frames).Next, and others. Reviewed-on: https://go-review.googlesource.com/96175 From-SVN: r257913
2018-02-22libgo: add -L option for libatomic when using -pthreadIan Lance Taylor2-4/+6
Fixes https://gcc.gnu.org/PR84484 Reviewed-on: https://go-review.googlesource.com/95436 From-SVN: r257911
2018-02-20runtime: allow preemption in fast syscall returnIan Lance Taylor1-0/+7
Let a fast syscall return be a preemption point. This helps with tight loops that make system calls, as in BenchmarkSyscallExcessWork. Reviewed-on: https://go-review.googlesource.com/94895 From-SVN: r257848
2018-02-16runtime: add some more preemption checksIan Lance Taylor5-2/+46
In particular this lets BenchmarkPingPongHog in runtime/proc_test.go complete. Reviewed-on: https://go-review.googlesource.com/94735 From-SVN: r257743
2018-02-12compiler: error on func declaration/definitionIan Lance Taylor4-21/+4
Long long long ago Go permitted writing func F() in one file and writing func F() {} in another file. This was removed from the language, and that is now considered to be a multiple definition error. Gccgo never caught up to that, and it has been permitting this invalid code for some time. Stop permitting it, so that we give correct errors. Since we've supported it for a long time, the compiler uses it in a couple of cases: it predeclares the hash/equal methods if it decides to create them while compiling another function, and it predeclares main.main as a mechanism for getting the right warning if a program uses the wrong signature for main. For simplicity, keep those existing uses. This required a few minor changes in libgo which were relying, unnecessarily, on the current behavior. Reviewed-on: https://go-review.googlesource.com/93083 From-SVN: r257600
2018-02-12re PR go/84215 (Random results in go/libgo tests)Ian Lance Taylor3-50/+69
PR go/84215 runtime, sync/atomic: use write barrier for atomic pointer functions This copies atomic_pointer.go from 1.10rc2. It was omitted during the transition of the runtime from C to Go, and I forgot about it. This may help with https://gcc.gnu.org/PR84215. Reviewed-on: https://go-review.googlesource.com/93197 From-SVN: r257599
2018-02-08runtime: get missing function name from symbol tableIan Lance Taylor7-6/+211
If we trace back through code that has no debug info, as when calling through C code compiled with -g0, we won't have a function name. Try to fetch the function name using the symbol table. Adding the test case revealed that gotest failed to use the gccgo tag when matching files, so add that. Reviewed-on: https://go-review.googlesource.com/92756 From-SVN: r257495
2018-02-08libgo: update to Go1.10rc2Ian Lance Taylor38-344/+1034
Reviewed-on: https://go-review.googlesource.com/92736 From-SVN: r257493
2018-02-07runtime: don't call funcPC from a functionIan Lance Taylor3-6/+8
The escape analysis support is not yet good enough to avoid escaping the argument to funcPC. This causes unnecessary and often harmful memory allocation. E.g., (*cpuProfile).addExtra can be called from a signal handler, and it must not allocate memory. Move the calls to funcPC to use variables instead. This was done in the original migration to using funcPC, but was not done for newer code. In one case, in signal handling code, use getSigtramp. Reviewed-on: https://go-review.googlesource.com/92735 From-SVN: r257463
2018-02-06runtime: correct runtime structfield type to match reflectIan Lance Taylor2-6/+14
The offset field in structfield has changed to offsetAnon, and now requires a shift to get the actual offset value. Fixes golang/go#23391 Reviewed-on: https://go-review.googlesource.com/92275 From-SVN: r257413
2018-02-05cmd/go: don't lose last flag from _cgo_flagsIan Lance Taylor1-0/+3
The quoting code that read _cgo_flags, currently only in the gccgo version of cmd/go, was losing the last flag read from the file. Fixes golang/go#23666 Reviewed-on: https://go-review.googlesource.com/91655 From-SVN: r257373
2018-02-02reflect: enable allocation testsIan Lance Taylor1-6/+0
They were disabled due to the lack of escape analysis. Now that we have escape analysis, unskip these tests. Reviewed-on: https://go-review.googlesource.com/86248 From-SVN: r257324
2018-02-02runtime: scan register backing store on ia64Ian Lance Taylor4-0/+43
On ia64, a separate stack is used for saving/restoring register frames, occupying the other end of the stack mapping. This must also be scanned for pointers into the heap. Reviewed-on: https://go-review.googlesource.com/85276 From-SVN: r257323
2018-02-01math: adjust compilation flags, use them when testingIan Lance Taylor5-13/+12
We were using special compilation flags for the math package, but we weren't using them when testing. That meant that our tests were not checking the real code we were providing. Fix that. Fixing that revealed that we were not using a good set of flags, or at least were not using flags that let the tests pass. Adjust the flags to stop using -funsafe-math-optimizations on x86. Instead always use -ffp-contract=off -fno-math-errno -fno-trapping-math for all targets. Fixes golang/go#23647 Reviewed-on: https://go-review.googlesource.com/91355 From-SVN: r257312
2018-02-01compiler: omit field name for embedded fields in reflection stringIan Lance Taylor1-0/+8
This matches the gc compiler. The test case was sent for the master repo as https://golang.org/cl/91138. Fixes golang/go#23620 Reviewed-on: https://go-review.googlesource.com/91139 From-SVN: r257300
2018-02-01net: declare lib_getaddrinfo as returning int32Ian Lance Taylor1-1/+1
Otherwise on a 64-bit system we will read the 32-bit value as a 64-bit value. Since getaddrinfo returns negative numbers as error values, these will be interpreted as numbers like 0xfffffffe rather than -2, and the comparisons with values like syscall.EAI_NONAME will fail. Fixes golang/go#23645 Reviewed-on: https://go-review.googlesource.com/91296 From-SVN: r257299
2018-01-31runtime: fix type descriptor name in C codeIan Lance Taylor1-3/+5
I forgot to update the name of the map[string]bool type descriptor used in go-fieldtrack.c. This didn't cause any errors because it's a weak symbol, and the current testsuite has no field tracking tests. Reviewed-on: https://go-review.googlesource.com/91096 From-SVN: r257249
2018-01-31gotest: accept symbols with leading dotIan Lance Taylor1-3/+3
On AIX nm displays symbols with a leading dot; don't discard such symbols. While we're here stop doing fgrep -v '$', symbol names no longer contain '$' anyhow. Reviewed-on: https://go-review.googlesource.com/91095 From-SVN: r257247
2018-01-31net: rename TestAddr6 to avoid gotest confusionIan Lance Taylor1-3/+3
On ppc64 gotest treats data variables whose names begin with "Test" as tests to run. This is to support the function descriptors used for ppc64 ELF ABI v1. This causes gotest to think that TestAddr6 is a test, when it is actually a variable. For a simple fix until we can figure out how to write gotest properly, rename the variable. Fixes golang/go#23623 Reviewed-on: https://go-review.googlesource.com/90995 From-SVN: r257235
2018-01-30internal/syscall/unix: add randomTrap for sh/shbeIan Lance Taylor1-0/+11
CL 84555 added support for the SuperH architecture, but didn't add the randomTrap definition to be used for the getrandom syscall on Linux. Add it now. Reviewed-on: https://go-review.googlesource.com/90535 From-SVN: r257171
2018-01-27libgo: update to Go1.10rc1Ian Lance Taylor4-0/+62
Reviewed-on: https://go-review.googlesource.com/90295 From-SVN: r257127
2018-01-27libgo: update to Go1.10rc1Ian Lance Taylor39-514/+962
Reviewed-on: https://go-review.googlesource.com/90295 From-SVN: r257126
2018-01-25compiler: deref receiver types in mangled namesIan Lance Taylor2-2/+2
This was the original intent, as reflected in the long comment at the start of names.cc, but I forgot to implement it. Also, remove a leading ".0" from the final name. That could occur for a method whose receiver type starts with 'u', as in that case we prepend a space to the mangled name, to avoid confusion with the Unicode mangling, and the space turns into ".0". Also, if the Unicode encoding would cause the final to start with "..u" or "..U", add a leading underscore. Patch gotest to not get fooled by some names. The result of these changes is that all symbols start with a letter or an underscore. Reviewed-on: https://go-review.googlesource.com/90015 From-SVN: r257068