Commit Graph

1049 Commits

Author SHA1 Message Date
Ian Lance Taylor 11309337c4 libgo: update to Go 1.10.2 release
Reviewed-on: https://go-review.googlesource.com/115196

From-SVN: r261041
2018-05-31 21:42:53 +00:00
Ian Lance Taylor bb3976df48 cmd/go, cmd/vet: make vet work with gccgo
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-30 00:16:58 +00:00
Ian Lance Taylor 4ec2cf3bd0 crypto/x509: specify path to AIX certificate file
Reviewed-on: https://go-review.googlesource.com/113179

From-SVN: r260908
2018-05-30 00:16:02 +00:00
Ian Lance Taylor 2f55f4aa6c go/build, cmd/go: update to match recent changes to gc
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-09 21:49:47 +00:00
Ian Lance Taylor 1c72513315 cmd/go: on AIX, pass -X64 first when invoking ar
Reviewed-on: https://go-review.googlesource.com/111535

From-SVN: r259946
2018-05-04 17:51:46 +00:00
Ian Lance Taylor 772455c964 libgo: fix for unaligned read in go-unwind.c's read_encoded_value()
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-04 14:29:05 +00:00
Ian Lance Taylor 105073e1cc cmd/go: update mkalldocs.sh
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-04 01:43:39 +00:00
Ian Lance Taylor 28fc5502cf cmd/go: enable tests of vet tool
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-04 01:41:22 +00:00
Ian Lance Taylor 6522932843 cmd/go: update to match recent changes to gc
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-04 01:34:30 +00:00
Ian Lance Taylor 5cf052826f cmd/go: run tests that require package build IDs
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-03 03:19:28 +00:00
Ian Lance Taylor fbf2f198ce libgo: add type/const references to sysinfo.c
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-02 22:32:23 +00:00
Ian Lance Taylor 746d6ed4ad libgo: add support for the Nios II architecture
Reviewed-on: https://go-review.googlesource.com/90775

From-SVN: r259866
2018-05-02 22:28:46 +00:00
Ian Lance Taylor e1aeb9bc9e runtime: remove unused stack.go
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-02 22:01:22 +00:00
Ian Lance Taylor cec9701b51 libgo: refactor code to enumerate stdlib packages
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-02 21:57:35 +00:00
Ian Lance Taylor 019808c95c libgo: break dependence on libgcc unwind-pe.h
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-02 21:53:30 +00:00
Ian Lance Taylor 8c2e1d6ca5 re PR go/85429 (Several gotools tests FAIL with Solaris as)
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-05-01 14:08:44 +00:00
Ian Lance Taylor 2885a4939a re PR go/85429 (Several gotools tests FAIL with Solaris as)
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-27 18:01:00 +00:00
Ian Lance Taylor 447638d2c4 gotest: only use [TD] on big-endian PPC64 non-AIX systems
Reviewed-on: https://go-review.googlesource.com/108457

From-SVN: r259531
2018-04-20 20:40:27 +00:00
Ian Lance Taylor 4ba0105019 os/signal: disable loading of history during test
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-17 23:55:17 +00:00
Ian Lance Taylor aa4ec2cdff gccgo: suppress "ar rcD" and "-zdefs" on AIX
Reviewed-on: https://go-review.googlesource.com/100955

From-SVN: r259445
2018-04-17 20:10:49 +00:00
Ian Lance Taylor a8ebf991f3 runtime: don't check for stale runtime
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-26 19:29:27 +00:00
Ian Lance Taylor 534d990b35 libgo: add runtime/pprof/internal/profile.gox to noinst_DATA
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-16 19:01:40 +00:00
Ian Lance Taylor 8bb2726d08 cmd/go: force LANG=C when looking for compiler version
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-15 16:56:24 +00:00
Ian Lance Taylor 300e61fa15 commit ce28919112dbb234366816ab39ce060ad45e8ca9
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-09 18:21:42 +00:00
Ian Lance Taylor 123ba0918c runtime: push arena on AIX higher due to clashes
Reviewed-on: https://go-review.googlesource.com/99117

From-SVN: r258337
2018-03-07 15:22:46 +00:00
Ian Lance Taylor 2dab5d909f runtime: use a fence instruction before rdtsc
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-07 14:31:03 +00:00
Ian Lance Taylor 14710257c1 libgo: fix typo in mksysinfo.sh script
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-03-05 18:44:44 +00:00
Ian Lance Taylor 8cda97ab52 runtime: update AIX memory allocation for new versions
Reviewed-on: https://go-review.googlesource.com/97357

From-SVN: r258052
2018-02-28 01:39:03 +00:00
Ian Lance Taylor 930540ca89 libgo: update to final Go 1.10 release
Reviewed-on: https://go-review.googlesource.com/97517

From-SVN: r258051
2018-02-28 01:19:07 +00:00
Andreas Schwab b613cc2e91 re PR go/84484 (libgo configure tests fail to find -latomic)
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-22 19:49:04 +00:00
Ian Lance Taylor afedc99bd2 runtime: funcfileline: get missing function name from symbol table
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-22 18:52:33 +00:00
Ian Lance Taylor 35e7db41ca libgo: add -L option for libatomic when using -pthread
Fixes https://gcc.gnu.org/PR84484
    
    Reviewed-on: https://go-review.googlesource.com/95436

From-SVN: r257911
2018-02-22 18:49:33 +00:00
Ian Lance Taylor 911cef2e3b runtime: allow preemption in fast syscall return
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-20 15:30:31 +00:00
Ian Lance Taylor c3ab26e8bb runtime: add some more preemption checks
In particular this lets BenchmarkPingPongHog in runtime/proc_test.go
    complete.
    
    Reviewed-on: https://go-review.googlesource.com/94735

From-SVN: r257743
2018-02-16 16:42:53 +00:00
Ian Lance Taylor 52eb4ab409 compiler: error on func declaration/definition
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-12 19:29:52 +00:00
Ian Lance Taylor 86ff185365 re PR go/84215 (Random results in go/libgo tests)
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-12 18:50:16 +00:00
Ian Lance Taylor 74e6f14adb runtime: get missing function name from symbol table
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-08 15:37:43 +00:00
Ian Lance Taylor 9adab5dd16 libgo: update to Go1.10rc2
Reviewed-on: https://go-review.googlesource.com/92736

From-SVN: r257493
2018-02-08 15:30:22 +00:00
Ian Lance Taylor f1a2d8b1b5 runtime: don't call funcPC from a function
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-07 22:04:55 +00:00
Ian Lance Taylor c88893a0da runtime: correct runtime structfield type to match reflect
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-06 15:18:50 +00:00
Ian Lance Taylor 59597e3735 cmd/go: don't lose last flag from _cgo_flags
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-05 01:38:34 +00:00
Ian Lance Taylor 60a57222fe reflect: enable allocation tests
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-02 00:33:03 +00:00
Ian Lance Taylor 38f08ec0bd runtime: scan register backing store on ia64
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-02 00:16:43 +00:00
Ian Lance Taylor 28f3c8143b math: adjust compilation flags, use them when testing
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-01 21:05:20 +00:00
Ian Lance Taylor 4d0bf3e1e1 compiler: omit field name for embedded fields in reflection string
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-01 15:54:04 +00:00
Ian Lance Taylor fc876f22b3 net: declare lib_getaddrinfo as returning int32
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-02-01 15:49:53 +00:00
Ian Lance Taylor 9734500e9b runtime: fix type descriptor name in C code
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-31 18:25:17 +00:00
Ian Lance Taylor 382ce98374 gotest: accept symbols with leading dot
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-31 18:21:47 +00:00
Ian Lance Taylor cb6a6b25e4 net: rename TestAddr6 to avoid gotest confusion
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-31 14:43:37 +00:00
Ian Lance Taylor 111c8b4ce9 internal/syscall/unix: add randomTrap for sh/shbe
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-30 04:48:55 +00:00
Ian Lance Taylor f6acbd0805 libgo: update to Go1.10rc1
Reviewed-on: https://go-review.googlesource.com/90295

From-SVN: r257127
2018-01-27 23:45:46 +00:00
Ian Lance Taylor d779dffc4b libgo: update to Go1.10rc1
Reviewed-on: https://go-review.googlesource.com/90295

From-SVN: r257126
2018-01-27 23:44:29 +00:00
Ian Lance Taylor a14e122ae2 compiler: deref receiver types in mangled names
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
2018-01-25 23:10:35 +00:00
Ian Lance Taylor a88d1f8bb2 runtime: fix lfstackUnpack on ia64
The top three region number bits must be masked out before
    right-shifting the address bits into place, otherwise they will be
    copied down into the lower always-zero address bits.
    
    Reviewed-on: https://go-review.googlesource.com/84535

From-SVN: r257061
2018-01-25 17:44:19 +00:00
Ian Lance Taylor 4880b994d6 compiler: rationalize external symbol names
Encode all external symbol names using only ASCII alphanumeric
    characters, underscore, and dot.  Use a scheme that can be reliably
    demangled to a somewhat readable version as described in the long
    comment in names.cc.
    
    A minor cleanup discovered during this was that we were treating
    function types as different if one had a NULL parameters_ field and
    another has a non-NULL parameters_ field that has no parameters.  This
    worked because we mangled them slightly differently.  We now mangle
    them the same, so we treat them as equal, as we should anyhow.
    
    Reviewed-on: https://go-review.googlesource.com/89555

	* go.go-torture/execute/names-1.go: New test.

From-SVN: r257033
2018-01-24 23:50:09 +00:00
Ian Lance Taylor 38ad6f8a44 cmd/go: buildid support for AIX archives.
Reviewed-on: https://go-review.googlesource.com/88935

From-SVN: r256971
2018-01-23 04:44:12 +00:00
Ian Lance Taylor 2a3abc862a mksysinfo: use rlimit64 if available when we use getrlimit64
This makes no difference on most systems, because <sys/resource.h>
    renames the type appropriately anyhow, but apparently it makes a
    difference on AIX.
    
    Reviewed-on: https://go-review.googlesource.com/88076

From-SVN: r256877
2018-01-19 05:09:43 +00:00
Ian Lance Taylor ddc606cef7 mksysinfo: force Passwd.Pw_[ug]id from int32 to uint32
Solaris 10 uses int32 for the Pw_uid and Pw_gid fields of Passwd,
    but most systems, including Solaris 11, use uint32.  Force uint32
    for consistency and to fix the build.
    
    Reviewed-on: https://go-review.googlesource.com/88195

From-SVN: r256875
2018-01-19 04:52:12 +00:00
Ian Lance Taylor 674dddfe2d runtime: no escape for some functions on AIX
Reviewed-on: https://go-review.googlesource.com/88236

From-SVN: r256874
2018-01-19 04:48:51 +00:00
Ian Lance Taylor 219f9bad83 cmd/go: recognize AIX objects and archives
Reviewed-on: https://go-review.googlesource.com/88275

From-SVN: r256873
2018-01-19 04:27:38 +00:00
Ian Lance Taylor 549e4febc3 runtime: add go:noescape declaration for Solaris
Patch by Rainer Orth.
    
    Reviewed-on: https://go-review.googlesource.com/88376

From-SVN: r256872
2018-01-19 04:09:55 +00:00
Ian Lance Taylor a9411cce01 re PR go/83787 (Many 32-bit Solaris/SPARC Go tests FAIL after Go1.10beta1 update)
PR go/83787
    compiler: pass int to makechan, call makechan64 when appropriate
    
    The update to 1.10beta1 changed makechan to take int instead of int64,
    and added a makechan64 call for large values.  Since the size is the
    last argument to makechan, the old compiler which always passed a
    64-bit int worked fine on 64-bit systems and little-endian 32-bit
    systems, but broke on big-endian 32-bit systems.  This CL fixes the
    compiler to use the appropriate types.
    
    This fixes GCC PR 83787.
    
    Reviewed-on: https://go-review.googlesource.com/88077

From-SVN: r256835
2018-01-18 04:24:48 +00:00
Ian Lance Taylor c1fa27707a archive/tar: support stat and device numbers on AIX
Reviewed-on: https://go-review.googlesource.com/87198

From-SVN: r256810
2018-01-17 18:33:50 +00:00
Ian Lance Taylor c6d6367f84 libgo: update to Go1.10beta2 release
Reviewed-on: https://go-review.googlesource.com/87897

From-SVN: r256794
2018-01-17 14:20:29 +00:00
Ian Lance Taylor ffad1c54d2 go/types: implement SizesFor for gccgo
Move the architecture-specific settings out of configure.ac into a new
    shell script goarch.sh.  Use the new script to collect the values for
    all architectures to make them available in go/types.
    
    Also fix cmd/vet to pass the right compiler when it calls SizesFor.
    
    This fixes cmd/vet for systems that are not implemented in the gc
    toolchain, such as alpha and ia64.
    
    Reviewed-on: https://go-review.googlesource.com/87635

From-SVN: r256655
2018-01-14 04:59:01 +00:00
Ian Lance Taylor fbea3c33e8 re PR go/83794 (misc/cgo/test uses gigabytes of memory)
PR go/83794
    misc/cgo/test: avoid endless loop when we can't parse notes
    
    Reviewed-on: https://go-review.googlesource.com/87416

From-SVN: r256553
2018-01-11 19:58:55 +00:00
Ian Lance Taylor 840573729e debug/dwarf: formStrp uses a 64-bit value for 64-bit DWARF
No test as the only system I know that uses 64-bit DWARF is AIX.
    
    Backport of https://golang.org/cl/84379, which will be in Go 1.11.
    Backporting now for AIX support in gccgo.
    
    Reviewed-on: https://go-review.googlesource.com/87296

From-SVN: r256474
2018-01-11 01:51:16 +00:00
Ian Lance Taylor bbb31a1d5c os, syscall: handle _st_timespec for AIX stat
Reviewed-on: https://go-review.googlesource.com/87197

From-SVN: r256450
2018-01-10 19:51:24 +00:00
Ian Lance Taylor fd0c1dd167 libgo: add platform support for SuperH
Reviewed-on: https://go-review.googlesource.com/84555

From-SVN: r256446
2018-01-10 19:19:02 +00:00
Ian Lance Taylor 7074b41bdc Add missing .a files.
Add missing .a files.  These should have been committed with the
update to go1.10beta1, but were skipped because by default Subversion
ignores all files matching *.a.

From-SVN: r256442
2018-01-10 18:02:33 +00:00
Ian Lance Taylor 389578d7a6 re PR c/82922 (Request: add -Wstrict-prototypes to -Wextra as K&R style is obsolescent)
PR c/82922

    runtime, syscall: use full prototypes in C code
    
    Based on patch by Martin Sebor.
    
    Reviewed-on: https://go-review.googlesource.com/86815

From-SVN: r256437
2018-01-10 15:42:23 +00:00
Ian Lance Taylor 447fb74d97 exp: remove exp/proxy and exp/terminal packages
The exp/proxy package was removed from the master library in
    https://golang.org/cl/6461056 (August, 2012).
    
    The exp/terminal package was removed from the master library in
    https://golang.org/cl/5970044 (March, 2012).
    
    I'm not sure why they lingered in the gofrontend copy, but let's
    finally remove them now.
    
    Reviewed-on: https://go-review.googlesource.com/87138

From-SVN: r256435
2018-01-10 15:37:45 +00:00
Ian Lance Taylor d0ac0d52e9 cmd/go: check for another GCC error message
GCC always recognizes the -fsplit-stack option, but then tests whether
    it is supported by the selected target. If not, it reports
        cc1: error: ‘-fsplit-stack’ is not supported by this compiler configuration
    Check for that error message when deciding whether a compiler option works.
    
    Reviewed-on: https://go-review.googlesource.com/87137

From-SVN: r256433
2018-01-10 15:18:55 +00:00
Ian Lance Taylor c9edeca8b8 runtime: fix makemap calls in __go_construct_map
The signature of makemap changed with the update to 1.10beta1,
    but I forgot to update the call from C code.
    
    Reviewed-on: https://go-review.googlesource.com/87135

From-SVN: r256431
2018-01-10 15:04:21 +00:00
Ian Lance Taylor 692aefcd56 runtime: work around escaping closure in export_test.go
When compiling runtime, it is not allowed for local variables
    and closures to be heap allocated. In one test, there is a go
    statement with a closure. In the gc compiler, it distinguishes
    capturing variable by value vs. by address, and rewrites it to
    passing the captured values as arguments. Currently we don't
    have this, and the escape analysis decides to heap allocate the
    closure and also the captured variables, which is not allowed.
    Work around it by passing the variables explicitly.
    
    This is in preparation of turning on escape analysis for the
    runtime.
    
    Reviewed-on: https://go-review.googlesource.com/86245

From-SVN: r256419
2018-01-10 05:26:29 +00:00
Ian Lance Taylor e4876be5f5 runtime: noescape some functions/variables
This is in preparation of turning on escape analysis for the
    runtime.
    
    - In gccgo, systemstack is implemented with mcall, which is not
      go:noescape. Wrap the closure in noescape so the escape analysis
      does not think it escapes.
    
    - Mark some C functions go:noescape. They do not leak arguments.
    
    - Use noescape function to make a few local variables' addresses
      not escape. The escape analysis cannot figure out because they
      are assigned to pointer indirections.
    
    Reviewed-on: https://go-review.googlesource.com/86244

From-SVN: r256418
2018-01-10 05:15:52 +00:00
Ian Lance Taylor fe9e170268 cmd/go: add AIX support
For gccgo code avoid --whole-archive and -(.  Use -blibpath instead of
    -rpath.
    
    Reviewed-on: https://go-review.googlesource.com/86956

From-SVN: r256417
2018-01-10 05:12:39 +00:00
Ian Lance Taylor 76e723a313 libgo: add aix build tags
Reviewed-on: https://go-review.googlesource.com/86936

From-SVN: r256416
2018-01-10 04:53:55 +00:00
Ian Lance Taylor ee6019ce5d os/signal/internal/pty: build on Solaris
Patch from Rainer Orth.
    
    Reviewed-on: https://go-review.googlesource.com/87037

From-SVN: r256399
2018-01-09 21:42:59 +00:00
Ian Lance Taylor 1a2f01efa6 libgo: update to Go1.10beta1
Update the Go library to the 1.10beta1 release.
    
    Requires a few changes to the compiler for modifications to the map
    runtime code, and to handle some nowritebarrier cases in the runtime.
    
    Reviewed-on: https://go-review.googlesource.com/86455

gotools/:
	* Makefile.am (go_cmd_vet_files): New variable.
	(go_cmd_buildid_files, go_cmd_test2json_files): New variables.
	(s-zdefaultcc): Change from constants to functions.
	(noinst_PROGRAMS): Add vet, buildid, and test2json.
	(cgo$(EXEEXT)): Link against $(LIBGOTOOL).
	(vet$(EXEEXT)): New target.
	(buildid$(EXEEXT)): New target.
	(test2json$(EXEEXT)): New target.
	(install-exec-local): Install all $(noinst_PROGRAMS).
	(uninstall-local): Uninstasll all $(noinst_PROGRAMS).
	(check-go-tool): Depend on $(noinst_PROGRAMS).  Copy down
	objabi.go.
	(check-runtime): Depend on $(noinst_PROGRAMS).
	(check-cgo-test, check-carchive-test): Likewise.
	(check-vet): New target.
	(check): Depend on check-vet.  Look at cmd_vet-testlog.
	(.PHONY): Add check-vet.
	* Makefile.in: Rebuild.

From-SVN: r256365
2018-01-09 01:23:08 +00:00
Ian Lance Taylor 319e41dc77 libgo: fix GOARCH_CACHELINESIZE on ia64
Reviewed-on: https://go-review.googlesource.com/85256

From-SVN: r256306
2018-01-06 01:17:29 +00:00
Ian Lance Taylor be528ae9aa os: pass -s to hostname on AIX
Reviewed-on: https://go-review.googlesource.com/79375

From-SVN: r255738
2017-12-16 01:49:54 +00:00
Ian Lance Taylor fe6272cc44 syscall: emulate Flock on AIX
Reviewed-on: https://go-review.googlesource.com/79095

From-SVN: r255737
2017-12-16 01:45:45 +00:00
Ian Lance Taylor 4c413747a3 libgo: remove -fplan9-extensions from CFLAGS
Remove -fplan9-extensions from the CFLAGS used for libgo (no
    longer needed since the runtime was converted from C to Go).
    
    Reviewed-on: https://go-review.googlesource.com/82177

From-SVN: r255445
2017-12-06 17:43:29 +00:00
Ian Lance Taylor 79c9f76563 runtime: export cgoCheck functions
The functions cgoCheckPointer and cgoCheckResult are called by code
    generated by cgo. That means that we need to export them using
    go:linkname, as otherwise they are local symbols. The cgo code
    currently uses weak references to only call the symbols if they are
    defined, which is why it has been working--the cgo code has not been
    doing any checks.
    
    Reviewed-on: https://go-review.googlesource.com/80295

From-SVN: r255347
2017-12-02 00:46:00 +00:00
Ian Lance Taylor 02dc624e21 cmd/go, go/internal/gccgoimporter: pass -X to ar on AIX
Reviewed-on: https://go-review.googlesource.com/72930

From-SVN: r255090
2017-11-23 00:24:21 +00:00
Ian Lance Taylor ce143aa6e3 libgo: don't use grep -q in mksigtab.sh
Solaris grep does not support the -q option.
    
    Reviewed-on: https://go-review.googlesource.com/79239

From-SVN: r255042
2017-11-22 00:27:29 +00:00
Ian Lance Taylor c9548fa4f1 libgo: fix makefile buglet
Fix a small bug in the libgo Makefile recipe that constructs the
    directory from which to pick up libgcc_s.so ; the gccgo invocation
    with -print-libgcc-file-name was missing the flags, which meant that
    for -m32 builds we'd see the 64-bit libgcc dir.
    
    Reviewed-on: https://go-review.googlesource.com/78836

From-SVN: r254984
2017-11-21 06:19:10 +00:00
Rainer Orth f021f1d3a6 Adapt Solaris 12 references
libgcc:
	* config.host (*-*-solaris2*): Adapt comment for Solaris 12
	renaming.
	* config/sol2/crtpg.c (__start_crt_compiler): Likewise.
	* configure.ac (libgcc_cv_solaris_crts): Likewise.
	* configure: Regenerate.

	gcc:
	* config.gcc (*-*-solaris2*): Enable default_use_cxa_atexit since
	Solaris 11.  Update comment.
	* configure.ac (gcc_cv_ld_pid): Adapt comment for Solaris 12
	renaming.
	* config/sol2.h (STARTFILE_SPEC): Likewise.
	* configure: Regenerate.

	gcc/testsuite:
	* lib/target-supports.exp (check_effective_target_pie): Adapt
	comment for Solaris 12 renaming.

	* gcc.dg/torture/pr60092.c: Remove *-*-solaris2.11* dg-xfail-run-if.

From-SVN: r254737
2017-11-14 18:31:01 +00:00
Ian Lance Taylor 082fc7e884 libgo: adapt Solaris 12 references
With the change in the Solaris release model (no more major releases
    like Solaris 12 but only minor ones like 11.4), the Solaris 12
    references in GCC need to be adapted.
    
    Patch by Rainer Orth.
    
    Reviewed-on: https://go-review.googlesource.com/77490

From-SVN: r254729
2017-11-14 14:26:04 +00:00
Ian Lance Taylor 5ac29058f0 sync/atomic, runtime/internal/atomic: don't assume reads from 0 fail
For a misaligned address force a panic rather than assuming that reading
    from the address 0 will cause one.
    
    Reviewed-on: https://go-review.googlesource.com/69850

From-SVN: r254610
2017-11-09 21:56:59 +00:00
Ian Lance Taylor ce995d1cc2 libgo: pass flags to recursive make
"make check" runs make recursively to check each package. Pass
    the flags through. So it is possible to run "make check" with
    different settings easily.
    
    Reviewed-on: https://go-review.googlesource.com/76029

From-SVN: r254475
2017-11-06 20:59:32 +00:00
Ian Lance Taylor 001cbba0ef debug/dwarf: support 64-bit DWARF in byte order check
Also fix 64-bit DWARF to read a 64-bit abbrev offset in the
    compilation unit.
    
    This is a backport of https://golang.org/cl/71171, which will be in
    the Go 1.10 release, to the gofrontend copy. Doing it now because AIX
    is pretty much the only system that uses 64-bit DWARF.
    
    Reviewed-on: https://go-review.googlesource.com/72250

From-SVN: r253955
2017-10-20 18:34:36 +00:00
Ian Lance Taylor 3ff1b2b0a9 runtime: fix issues on AIX about uintptr(_t)
Reviewed-on: https://go-review.googlesource.com/69891

From-SVN: r253664
2017-10-11 21:16:49 +00:00
Ian Lance Taylor eafa7a907b debug/elf: support 32-bit SPARC relocs
Patch by Rainer Orth.
    
    Reviewed-on: https://go-review.googlesource.com/67111

From-SVN: r253292
2017-09-29 14:35:58 +00:00
Ian Lance Taylor 039073944d mksysinfo: strip locale structs
We don't need them, and this fixes the build when using uClibc-ng
    1.0.26 as originally reported at
    https://gcc.gnu.org/ml/gcc-patches/2017-09/msg01930.html
    
    Reviewed-on: https://go-review.googlesource.com/67110

From-SVN: r253291
2017-09-29 14:14:40 +00:00
Ian Lance Taylor 509b9b7ae0 net: check Getsockname error return
Reviewed-on: https://go-review.googlesource.com/64550

From-SVN: r253231
2017-09-27 14:22:36 +00:00
Ian Lance Taylor c90df0d293 debug/xcoff,cmd: add XCOFF support
Reviewed-on: https://go-review.googlesource.com/64592

From-SVN: r253105
2017-09-22 18:49:52 +00:00
Ian Lance Taylor 7399e345be libgo: fix build when using -enable-static=no
With -enable-static=no we don't build non-pic objects, but libgotool.a
    is built from non-pic objects.  Build the packages that go into
    libgotool.a in static mode in all cases.
    
    Also ensure that internal test packages are built, since nothing
    explicitly depended on them.
    
    Reviewed-on: https://go-review.googlesource.com/65050

From-SVN: r253042
2017-09-20 23:31:00 +00:00
Ian Lance Taylor 836cccc71d syscall: enable ParseDirent for AIX
Reviewed-on: https://go-review.googlesource.com/64990

From-SVN: r253022
2017-09-20 17:49:11 +00:00