Commit Graph

605 Commits

Author SHA1 Message Date
Ian Lance Taylor 44cacba39d os/signal: increase deliver time for signal testcase
This increases the time to wait for signals to be delivered in the
    TestAtomicStop testcase. When running gccgo tests on ppc64 or ppc64le,
    there are intermittent failures in this test because the wait time is
    too small.
    
    Updates golang/go#29046
    
    Reviewed-on: https://go-review.googlesource.com/c/153879

From-SVN: r267068
2018-12-12 22:48:46 +00:00
Ian Lance Taylor 5a58929be8 runtime: add missing return for non-GNU/Linux version of tgkill
Path from Rainer Orth.
    
    Reviewed-on: https://go-review.googlesource.com/c/153118

From-SVN: r266890
2018-12-07 14:22:55 +00:00
Ian Lance Taylor c43137e800 runtime: add precise stack scan support
This CL adds support of precise stack scan using stack maps to
    the runtime. The stack maps are generated by the compiler (if
    supported). Each safepoint is associated with a (real or dummy)
    landing pad, and its "type info" in the exception table is a
    pointer to the stack map. When a stack is scanned, the stack map
    is found by the stack unwinding code by inspecting the exception
    table (LSDA).
    
    For precise stack scan we need to unwind the stack. There are
    three cases:
    
    - If a goroutine is scanning its own stack, it can unwind the
      stack and scan the frames.
    
    - If a goroutine is scanning another, stopped, goroutine, it
      cannot directly unwind the target stack. We handle this by
      switching (runtime.gogo) to the target g, letting it unwind
      and scan the stack, and switch back.
    
    - If we are scanning a goroutine that is blocked in a syscall,
      we send a signal to the target goroutine's thread, and let the
      signal handler unwind and scan the stack. Extra care is needed
      as this races with enter/exit syscall.
    
    Currently this is only implemented on linux.
    
    Reviewed-on: https://go-review.googlesource.com/c/140518

From-SVN: r266832
2018-12-05 23:09:51 +00:00
Ian Lance Taylor 9cf3cb7c25 syscall: remove Flock for aix/ppc64
CL 152397 removed it from gc's syscall package.
    
    Updates golang/go#29084
    
    Reviewed-on: https://go-review.googlesource.com/c/152557

From-SVN: r266812
2018-12-05 01:11:02 +00:00
Ian Lance Taylor 8f80bd8972 cmd/vet: use default compiler when determining type sizes
Fixes a segfault running vet on alpha.
    
    Patch by Uros Bizjak.
    
    Reviewed-on: https://go-review.googlesource.com/c/152437

From-SVN: r266781
2018-12-04 14:29:11 +00:00
Ian Lance Taylor ab25c42d05 cmd/go: allow buildmode c-archive for gccgo on ppc64
In buildmodeinit, the c-archive buildmode is flagged as invalid
    on linux/ppc64 for gccgo when it should be valid. This happens
    because the check against the gccgo flag is done after the checks
    for valid GOOS/GOARCH pairs instead of before as is done for all
    other buildmode cases in this switch. This corrects the problem and
    allows several of the gccgo gotools testcases to pass on linux/ppc64.
    
    Updates #29046
    
    Reviewed-on: https://go-review.googlesource.com/c/152137

From-SVN: r266764
2018-12-03 20:25:11 +00:00
Ian Lance Taylor 80d7d30d24 compiler: add '$' to names in expression export data
For inlined function bodies we're going to need to refer to variables,
    so change the existing export data to add a '$' to names that look
    like identifiers: true, false, nil, convert.
    
    While we're here drop an unnecessary space character after operators.
    
    Reviewed-on: https://go-review.googlesource.com/c/150067

From-SVN: r266529
2018-11-27 21:25:58 +00:00
Ian Lance Taylor 1e4cc1d4b0 compiler: initial support for exporting function bodies
Create a framework for putting function bodies in export data.  At
    present only empty functions will be put there, and they will be
    ignored on import.  Later patches will get this to the point of
    supporting inlining of (some) functions defined in other packages.
    
    Reviewed-on: https://go-review.googlesource.com/c/150061

From-SVN: r266490
2018-11-26 21:44:20 +00:00
Ian Lance Taylor 0d26cdf1cf cmd/cgo: fix typo in gccgo name mangling recipe
The code to implement new-style gccgo name mangling had a recipe that
    didn't quite match the one in the compiler (incorrect handling for
    '.'). This showed up as a failure in the gotools cgo test if the
    directory containing the test run included a "." character.
    
    Reviewed-on: https://go-review.googlesource.com/c/147917

From-SVN: r265981
2018-11-09 19:03:59 +00:00
Ian Lance Taylor 797ea25427 libgo: fix improperly mangled linker symbol directive
Fix asm name directive for the C version of log/syslog.syslog_c,
    which didn't get included in the recent name mangling change.
    
    Reviewed-on: https://go-review.googlesource.com/c/145017

From-SVN: r265533
2018-10-26 16:53:24 +00:00
Ian Lance Taylor 34489eb2af compiler: improve name mangling for packpaths
The current implementation of Gogo::pkgpath_for_symbol was written in
    a way that allowed two distinct package paths to map to the same
    symbol, which could cause collisions at link- time or compile-time.
    
    Switch to a better mangling scheme to insure that we get a unique
    packagepath symbol for each package. In the new scheme instead of having
    separate mangling schemes for identifiers and package paths, the
    main identifier mangler ("go_encode_id") now handles mangling of
    both packagepath characters and identifier characters.
    
    The new mangling scheme is more intrusive: "foo/bar.Baz" is mangled as
    "foo..z2fbar.Baz" instead of "foo_bar.Baz". To mitigate this, this
    patch also adds a demangling capability so that function names
    returned from runtime.CallersFrames are converted back to their
    original unmangled form.
    
    Changing the pkgpath_for_symbol scheme requires updating a number of
    //go:linkname directives and C "__asm__" directives to match the new
    scheme, as well as updating the 'gotest' driver (which makes
    assumptions about the correct mapping from pkgpath symbol to package
    name).
    
    Fixes golang/go#27534.
    
    Reviewed-on: https://go-review.googlesource.com/c/135455

From-SVN: r265510
2018-10-25 22:18:08 +00:00
Ian Lance Taylor 8dd2ae4bc7 re PR go/87661 (libgo bootstrap failure on arm-linux-gnueabihf (redefinition of constants))
PR go/87661
    runtime: remove unused armArch, hwcap and hardDiv
    
    After CL 140057 these are only written but never read in gccgo.
    
    Reviewed-on: https://go-review.googlesource.com/c/141077

From-SVN: r265439
2018-10-23 19:02:29 +00:00
Ian Lance Taylor a847d2b7b1 compiler: export indexed type data, read unexported types lazily
Introduce a new "types" command to the export data to record the
    number of types and the size of their export data. It is immediately
    followed by new "type" commands that can be indexed. Parse all the
    exported types immediately so that we register them, but parse other
    type data only as needed.
    
    Reviewed-on: https://go-review.googlesource.com/c/143022

From-SVN: r265409
2018-10-23 02:46:41 +00:00
Ian Lance Taylor dbf9376f9e compiler: list indirect imports separately in export data
Previously when export data referred to a type that was not defined in
    a directly imported package, we would write the package name as
    additional information in the type's export data.  That approach
    required all type information to be read in order.  This patch changes
    the compiler to find all references to indirectly imported packages,
    and write them out as an indirectimport line in the import data.  This
    will permit us to read exported type data out of order.
    
    The type traversal used to find indirect imports is a little more
    complicated than necessary in preparation for later patches in this
    series.
    
    Reviewed-on: https://go-review.googlesource.com/c/143020

From-SVN: r265296
2018-10-18 23:22:01 +00:00
Ian Lance Taylor e8ce849a48 compiler: drop semicolons in export data
The export data, which is approximately readable and looks something
    like Go, was first implemented back when Go still used semicolons.
    Drop the semicolons, to make it look slightly more Go like and make it
    slightly smaller.
    
    This updates the compiler and the gccgoimporter package.
    
    This introduces a new version of the export data.  There are going to
    be more changes to the export data, so this version is still subject
    to change.
    
    Reviewed-on: https://go-review.googlesource.com/c/143018

From-SVN: r265284
2018-10-18 19:35:46 +00:00
Ian Lance Taylor 91b01194c9 runtime: skip testSetPanicOnFault for gollvm
LLVM doesn't support non-call exception. This test was passing
    more or less by luck: if the faulting instruction is between two
    calls with the same landing pad (in instruction layout order,
    not the program's logic order), it generates a merged PC range
    that covers the faulting instruction. If the instruction layout
    order changes, or it uses two different (but may be degenerate)
    landing pads, this doesn't work.
    
    Reviewed-on: https://go-review.googlesource.com/c/140517

From-SVN: r264985
2018-10-09 16:51:10 +00:00
Ian Lance Taylor 3cbb7cbb09 libgo: update to Go 1.11.1 release
Reviewed-on: https://go-review.googlesource.com/c/140277

From-SVN: r264932
2018-10-08 14:21:30 +00:00
Ian Lance Taylor 7fc9c2e52f libgo: use inline assembly in favor of call to _xgetbv()
Use inline assembly in the implementation of internal_cpu.xgetbv as
    opposed to a call to the intrinsic _xgetbv(), since non-gcc compilers
    (e.g. clang) may or may not have support for it.
    
    Reviewed-on: https://go-review.googlesource.com/c/140137

From-SVN: r264882
2018-10-05 17:51:57 +00:00
Ian Lance Taylor cbba2e1e47 runtime: remove checkgoarm function
Nothing in libgo calls checkgoarm, and it relies on a variable, goarm,
    that is not set.
    
    Reviewed-on: https://go-review.googlesource.com/c/140057

From-SVN: r264872
2018-10-05 14:21:01 +00:00
Ian Lance Taylor d8ccfadbf2 internal/bytealg: support systems that don't have memmem
Reviewed-on: https://go-review.googlesource.com/138839

From-SVN: r264798
2018-10-02 16:45:51 +00:00
Ian Lance Taylor 4913fc07e0 net: don't fail test if splice fails because pipe2 is missing
This reportedly happens on CentOS 5.11.  The real code will work fine;
    this test is assuming that the unexported slice function will handle
    the splice, but if pipe2 does not work then it doesn't.  The relevant
    code in internal/poll/splice_linux.go says "Falling back to pipe is
    possible, but prior to 2.6.29 splice returns -EAGAIN instead of 0 when
    the connection is closed."
    
    Reviewed-on: https://go-review.googlesource.com/138838

From-SVN: r264793
2018-10-02 15:07:14 +00:00
Ian Lance Taylor 44ef03008c libgo: support x32 as GOARCH=amd64p32 GOOS=linux
This is enough to let libgo build when configured using
    --with-multilib-list=m64,m32,mx32.  I don't have an x32-enabled kernel
    so I haven't tested whether it executes correctly.
    
    For https://gcc.gnu.org/PR87470
    
    Reviewed-on: https://go-review.googlesource.com/138817

From-SVN: r264772
2018-10-01 20:17:11 +00:00
Ian Lance Taylor dd554b787d syscall: don't assume we have a GETEUID system call
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-26 15:17:30 +00:00
Ian Lance Taylor 201054a7f0 runtime, os: fix the build on Solaris
Reviewed-on: https://go-review.googlesource.com/137535

From-SVN: r264593
2018-09-26 03:29:07 +00:00
Ian Lance Taylor f5ec13f15d internal/bytealg, internal/cpu, internal/poll: portability fixes
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-25 14:31:57 +00:00
Ian Lance Taylor b16084d244 cmd/go: pass down testing gccgo in TestScript
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-25 14:16:32 +00:00
Ian Lance Taylor dd931d9b48 libgo: update to Go 1.11
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-24 21:46:21 +00:00
Ian Lance Taylor e47515aa89 cmd/go: correct gccgo buildid file on ARM
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-14 19:42:01 +00:00
Ian Lance Taylor cec07c4759 compiler, runtime: call gcWriteBarrier instead of writebarrierptr
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-13 22:25:58 +00:00
Ian Lance Taylor 38fab7369d runtime: correct counters in sweep
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-13 22:06:16 +00:00
Ian Lance Taylor 84cdf51de4 compiler, runtime: open code select
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-13 21:32:24 +00:00
Ian Lance Taylor f0d89c7759 runtime: avoid write barriers with traceback info
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-13 17:30:00 +00:00
Ian Lance Taylor 2919ad1ee3 libgo: build roots index to speed up bulkBarrierPreWrite
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-09-13 16:44:43 +00:00
Ian Lance Taylor 347462bfee compiler, runtime: remove hmap field from maptypes
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-29 00:20:25 +00:00
Ian Lance Taylor 1d29bb0408 runtime: remove the dummy arg of getcallersp
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-24 18:15:04 +00:00
Ian Lance Taylor b7d7c92f24 runtime: use poll rather than pollset for netpoll on AIX
Updates golang/go#26634
    
    Reviewed-on: https://go-review.googlesource.com/126857

From-SVN: r263364
2018-08-07 17:29:50 +00:00
Ian Lance Taylor 9be4d77249 libgo: uncomment trace.Stop() call in testing package
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-08-07 17:28:22 +00:00
Ian Lance Taylor 5ac2fd0d6e libgo: prune sighandler frames in runtime.sigprof
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-27 18:43:34 +00:00
Ian Lance Taylor 867b003fd7 runtime: skip zero-sized fields in structs when converting to FFI
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-13 20:39:02 +00:00
Ian Lance Taylor 7edd4c1885 re PR go/86331 (the gccgo's "go" tool looks like failing to invoke any sub 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-07-02 16:28:43 +00:00
Ian Lance Taylor 38a4d6da17 syscall: remove Ustat
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-22 14:25:52 +00:00
Ian Lance Taylor 27fbc519e0 cmd/go: re-enable a couple of tests of gccgo
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-21 23:02:25 +00:00
Ian Lance Taylor c949264918 libgo: update to Go 1.10.3 release
Reviewed-on: https://go-review.googlesource.com/118495

From-SVN: r261549
2018-06-13 13:51:23 +00:00
Ian Lance Taylor 87cbbc45a9 libgo: add riscv and js/wasm as known targets
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-11 19:16:34 +00:00
Ian Lance Taylor 1d6ccc5f29 reflect: fix StructOf hash and string
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-06 14:50:16 +00:00
Ian Lance Taylor e0b195b58a reflect: canonicalize types returned by StructOf() and friends
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-06-05 20:23:40 +00:00
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 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 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 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 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 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 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 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 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 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 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 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