Commit Graph

749 Commits

Author SHA1 Message Date
Ian Lance Taylor aa8a418bbc text/template: reduce maxExecDepth for gccgo
When using gccgo on systems without full support for split stacks a
    recursive template can overrun the available stack space.  Reduce the
    limit from 100000 to 10000 to make this less likely.  It's still high
    enough that real uses will work.
    
    Reviewed-on: https://go-review.googlesource.com/25467

From-SVN: r239141
2016-08-04 16:48:28 +00:00
Ian Lance Taylor 9c26dfd08a gotest: multiple +build lines must all be true
The code that handled +build lines did not correctly require them to all
    be true.  While looking into this I discovered that multiple +build
    lines were mishandled in a different way, because the shell does not
    preseve line breaks in backquoted data.  Look for the +build token to
    tell us when we are switching from one +build line to another.
    
    Reviewed-on: https://go-review.googlesource.com/25460

From-SVN: r239100
2016-08-03 22:46:06 +00:00
Ian Lance Taylor c5fe5e8032 libgo: bump library version number for 1.7
Reviewed-on: https://go-review.googlesource.com/25211

From-SVN: r238743
2016-07-26 01:53:27 +00:00
Ian Lance Taylor 870e8ca5a7 os/user: fix Solaris declaration.
Patch from Rainer Orth.
    
    Reviewed-on: https://go-review.googlesource.com/25210

From-SVN: r238742
2016-07-26 01:38:33 +00:00
Ian Lance Taylor 22b955cca5 libgo: update to go1.7rc3
Reviewed-on: https://go-review.googlesource.com/25150

From-SVN: r238662
2016-07-22 18:15:38 +00:00
Ian Lance Taylor a38f74e823 cmd/go: bring in final version of gccgo pkg-config support
This updates gccgo to the final version of https://golang.org/cl/18790,
    by Michael Hudson-Doyle.
    
    Update golang/go#11739.
    
    Reviewed-on: https://go-review.googlesource.com/22400

From-SVN: r235380
2016-04-23 00:41:03 +00:00
Ian Lance Taylor 88b5d499b5 libgo: update to Go 1.6.1 release
Reviewed-on: https://go-review.googlesource.com/22007

From-SVN: r234958
2016-04-13 19:11:16 +00:00
Ian Lance Taylor d90936ff88 reflect: change Value.Call results to not be addressable
Leaving them incorrectly marked as addressable broke a use of the
    text/template package, because state.evalField checks CanAddr and takes
    the address if it is addressable.
    
    Reviewed-on: https://go-review.googlesource.com/21908

From-SVN: r234923
2016-04-12 22:20:30 +00:00
Ian Lance Taylor bb72703282 runtime: Use atomic load for in entersyscall.
Reportedly fixes PPC64 deadlock.
    
    From a comment by Gabriel Russell.
    
    Fixes golang/go#15051.
    
    Reviewed-on: https://go-review.googlesource.com/21450

From-SVN: r234694
2016-04-02 00:47:53 +00:00
Ian Lance Taylor 6b2cd37bd9 re PR go/69966 (libgo: Port syscall.SetsockoptUcred from golang)
PR go/69966
    syscall: Add new Getsockopt functions.
    
    Add GetsockoptICMPv6Filter, GetsockoptIPv6MTUInfo, GetsockoptUcred as
    appropriate.  These functions exist in the master library.
    
    For GCC PR 69966.

    Reviewed-on: https://go-review.googlesource.com/19960

From-SVN: r233747
2016-02-26 17:36:00 +00:00
Ian Lance Taylor 4501d9ad44 runtime: lock M during cgo call
cgo should lock the M.
    
    
    See also https://golang.org/cl/18882 .
    
    Reviewed-on: https://go-review.googlesource.com/18883

From-SVN: r233670
2016-02-24 15:03:04 +00:00
Ian Lance Taylor 43414a5dd3 libgo: Update to final Go 1.6 release.
Reviewed-on: https://go-review.googlesource.com/19592

From-SVN: r233515
2016-02-18 05:56:46 +00:00
Ian Lance Taylor 54c9c975f1 runtime: For c-archive/c-shared, install signal handlers synchronously.
This is a port of https://golang.org/cl/18150 to the gccgo runtime.
    
    The previous behaviour of installing the signal handlers in a separate
    thread meant that Go initialization raced with non-Go initialization if
    the non-Go initialization also wanted to install signal handlers.  Make
    installing signal handlers synchronous so that the process-wide behavior
    is predictable.
    
    Reviewed-on: https://go-review.googlesource.com/19494

From-SVN: r233393
2016-02-12 22:10:09 +00:00
Ian Lance Taylor 931f434a72 re PR go/66904 (cmd/go: "#cgo pkg-config:" comments do not work with gccgo)
PR go/66904
    cmd/go: fix "#cgo pkg-config:" comments with gccgo
    
    Copy of https://golang.org/cl/18790 by Michael Hudson-Doyle.
    
    The unique difficulty of #cgo pkg-config is that the linker flags are recorded
    when the package is compiled but (obviously) must be used when the package is
    linked into an executable -- so the flags need to be stored on disk somewhere.
    As it happens cgo already writes out a _cgo_flags file: nothing uses it
    currently, but this change adds it to the lib$pkg.a file when compiling a
    package, reads it out when linking (and passes a version of the .a file with
    _cgo_flags stripped out of it to the linker). It's all fairly ugly but it works
    and I can't really think of any way of reducing the essential level of
    ugliness.
    
    Update golang/go#11739.
    GCC PR 66904.

    Reviewed-on: https://go-review.googlesource.com/19431

From-SVN: r233290
2016-02-10 18:30:27 +00:00
Ian Lance Taylor de24ed7803 re PR go/69511 (G.gcstack_size uses uintptr instead of size_t)
PR go/69511
    runtime: change G gcstack_size field to size_t
    
    Because its address is passed to __splitstack_find, which expects size_t*.
    
    From Dominik Vogt in GCC PR 69511.
    
    Reviewed-on: https://go-review.googlesource.com/19429

From-SVN: r233260
2016-02-10 02:16:04 +00:00
Ian Lance Taylor cc240aa7d1 re PR go/69357 (libgo refers to _end in a non-weak way)
PR go/69537
    runtime: Don't refer to _end symbol in shared library.
    
    Fixes GCC PR 69357.
    
    Reviewed-on: https://go-review.googlesource.com/19362

From-SVN: r233235
2016-02-09 00:34:55 +00:00
Ian Lance Taylor d5bc1c65ef libgo: bump version number for upgrade to 1.6rc1
Reviewed-on: https://go-review.googlesource.com/19233

From-SVN: r233156
2016-02-04 22:54:20 +00:00
Ian Lance Taylor f98dd1a338 libgo: Update to go1.6rc1.
Reviewed-on: https://go-review.googlesource.com/19200

From-SVN: r233110
2016-02-03 21:58:02 +00:00
Ian Lance Taylor 06caa02ccf compiler, runtime: mark stub methods, ignore them in runtime.Caller.
This fixes the long-standing bug in which the testing package misreports
    the file/line of an error.
    
    Reviewed-on: https://go-review.googlesource.com/19179

From-SVN: r233098
2016-02-03 06:54:41 +00:00
Ian Lance Taylor de41ebf5dd re PR go/68980 (ps -o cmd in gotest isn't portable)
PR 68980
    libgo/testsuite: portable ps usage in gotest
    
    gotest is using "ps" to list descendant sleep
    processes in its timeout handling, grepping
    the command name.
    
    We are currently using the "cmd" ps output
    formatter, which is non-portable. We should
    use "comm" which is part of the POSIX
    standard, and outputs only the command name
    and not the arguments.
    
    Fixes https://gcc.gnu.org/PR68980
    
    Reviewed-on: https://go-review.googlesource.com/18426

From-SVN: r232234
2016-01-11 17:55:39 +00:00
Ian Lance Taylor 474c8a0757 syscall: Add definition for NLA_HDRLEN
This change updates mksysinfo.sh so it correctly
    includes the define NLA_HDRLEN in the syscall package.
    
    Fixes golang/go/#13629
    
    Reviewed-on: https://go-review.googlesource.com/17893

From-SVN: r231796
2015-12-18 01:15:37 +00:00
Ian Lance Taylor ae026741df re PR go/61303 (gccgo: segfault, regression since 4.8.2)
PR go/61303
    runtime: don't overallocate in select code
    
    If we've already allocated an fd_set, don't allocate another one.
    
    Also, don't bother to read from rdwake if it wasn't returned in select.
    
    Fixes https://gcc.gnu.org/PR61303.
    
    Reviewed-on: https://go-review.googlesource.com/17243

From-SVN: r230922
2015-11-26 00:24:21 +00:00
Ian Lance Taylor 8c61286797 re PR go/68496 ([libgo] reflect test fails on Linux x86-64)
PR go/68496
    reflect: Allocate space for FFI functions returning a zero-sized type.
    
    The libffi library does not understand zero-sized types.  We represent
    them as a struct with a single field of type void.  If such a type is
    returned from a function, libffi will copy 1 byte of data.  Allocate
    space for that byte, although we won't use it.
    
    Fixes https://gcc.gnu.org/PR68496.

    Reviewed-on: https://go-review.googlesource.com/17175

From-SVN: r230776
2015-11-23 21:17:45 +00:00
Ian Lance Taylor 3b29389671 re PR go/66378 (libgo syscall.Sendfile() does not honor/use offset argument)
PR go/66378
    syscall: Fix initial offset value in syscall.Sendfile.
    
    Bug reported in https://gcc.gnu.org/PR66378.
    
    Reviewed-on: https://go-review.googlesource.com/17159

From-SVN: r230699
2015-11-21 04:43:50 +00:00
Ian Lance Taylor eaa7bc3388 re PR go/65785 (libgo TestIPv4MulticastListener test fails on machine with no network connection)
PR go/65785
    net: don't run multicast listen test on nil interface in short mode
    
    This is a backport of https://golang.org/cl/17154.
    
    The gccgo bug report https://gcc.gnu.org/PR65785 points out that the
    multicast listen tests will use the network even with -test.short.
    Fix test by checking testing.Short with a nil interface.
    
    Reviewed-on: https://go-review.googlesource.com/17158

From-SVN: r230695
2015-11-21 01:41:24 +00:00
Ian Lance Taylor bbbe8b338b re PR go/66574 (Time is provided in millisecond precision instead of nanoseconds as described in go documentation)
PR go/66574
    runtime: Use clock_gettime to get current time.
    
    Fetch the current time in nanoseconds, not microseconds, by using
    clock_gettime rather than gettimeofday.
    
    Update golang/go#11222.
    
    Fixes https://gcc.gnu.org/PR66574.
    
    Reviewed-on: https://go-review.googlesource.com/17156

From-SVN: r230694
2015-11-21 01:27:44 +00:00
Ian Lance Taylor 4944c7791b re PR go/68072 (malformed DWARF TagVariable entry)
PR go/68072
    cmd/cgo: ignore vars with no name or type if they have a AttrSpecification
    
    Backport of master CL https://golang.org/cl/17151.
    
    Fixes https://gcc.gnu.org/PR/68072.
    
    Reviewed-on: https://go-review.googlesource.com/17152

From-SVN: r230685
2015-11-20 22:48:47 +00:00
Ian Lance Taylor dcfa3345eb cmd: Use correct install tool dir with gccgo
When using the go command built from gccgo to build and
    install a go tool, use the value from runtime GCCGOTOOLDIR as
    the install directory.
    
    This also fixes the output from 'go tool' when used with the
    gccgo-built go command, to only include the go tools and not
    other binaries found in the same directory.
    
    Reviewed-on: https://go-review.googlesource.com/16516

From-SVN: r230677
2015-11-20 21:30:16 +00:00
Ian Lance Taylor 88cf4de8b7 libgo: use Solaris sendfile lib, fix Solaris _in6_addr_t fields
Before Solaris 12 the sendfile function is found in -lsendfile, so look
    for it there.
    
    Solaris 12 adds some more types that use _in6_addr_t, that need to be
    edited in mksysinfo.
    
    Patch by Rainer Orth.
    
    Reviewed-on: https://go-review.googlesource.com/16779

From-SVN: r230132
2015-11-10 21:38:30 +00:00
Ian Lance Taylor ea5c200338 re PR go/68255 (cgo-generated constructor not being called)
PR go/68255
    cmd/go: always use --whole-archive for gccgo packages
    
    This is a backport of https://golang.org/cl/16775.
    
    This is, in effect, what the gc toolchain does.  It fixes cases where Go
    code refers to a C global variable; without this, if the global variable
    was the only thing visible in the C code, the generated cgo file might
    not get pulled in from the archive, leaving the Go variable
    uninitialized.
    
    This was reported against gccgo as https://gcc.gnu.org/PR68255 .
    
    Reviewed-on: https://go-review.googlesource.com/16778

From-SVN: r230120
2015-11-10 20:31:11 +00:00
Ian Lance Taylor f5eb9a8ec6 re PR go/66138 (json decoder Decode function fails for some structure return values)
PR go/66138
    reflect, encoding/json, encoding/xml: fix unexported embedded structs
    
    Bring in three changes from the master Go repository.  These changes
    will be in Go 1.6, but they are appropriate for gccgo now because they
    resolve a long-standing discrepancy between how gc and gccgo handle the
    PkgPath field for embedded unexported struct fields.  The core issue is
    described at https://golang.org/cl/7247.  This has been reported against
    gccgo as https://gcc.gnu.org/PR66138.
    
    The three changes being brought over are:
    
    https://golang.org/cl/14010
    
    reflect: adjust access to unexported embedded structs
    
    This CL changes reflect to allow access to exported fields and
    methods in unexported embedded structs for gccgo and after gc
    has been adjusted to disallow access to embedded unexported structs.
    
    Adresses #12367, #7363, #11007, and #7247.
    
    https://golang.org/cl/14011
    
    encoding/json: check for exported fields in embedded structs
    
    Addresses issue #12367.
    
    https://golang.org/cl/14012
    
    encoding/xml: check for exported fields in embedded structs
    
    Addresses issue #12367.
    
    Reviewed-on: https://go-review.googlesource.com/16723

From-SVN: r229907
2015-11-07 01:24:57 +00:00
Ian Lance Taylor 9da92cbda9 libgo: Solaris portability fixes.
Only build net/hook_cloexec.go on GNU/Linux and FreeBSD, because those
    are the only systems with accept4.
    
    Add syscall/libcall_bsd.go to define sendfile for *BSD and Solaris.
    
    Revert tcpsockopt_solaris.go back to the earlier version, so that it
    works on Solaris 10.
    
    Always pass the address of a Pid_t value to TIOCGPGRP and TIOCSPGRP.
    
    Include <unistd.h> in runtime/go-varargs.c.
    
    Reviewed-on: https://go-review.googlesource.com/16719

From-SVN: r229880
2015-11-06 19:15:45 +00:00
Ian Lance Taylor aa3ba34fba gotest: fix handling of --goarch option
I managed to add a new --goarch option to gotest without noticing that
    the script already had one.  Worse, they set different variables.
    Remove the old option in favor of the new one.
    
    Reviewed-on: https://go-review.googlesource.com/16613

From-SVN: r229734
2015-11-04 01:52:40 +00:00
Ian Lance Taylor 7372dfe4bb mksysinfo.sh: Make sure that CLONE_NEWUSER is defined.
Reviewed-on: https://go-review.googlesource.com/16588

From-SVN: r229711
2015-11-03 15:07:47 +00:00
Ian Lance Taylor 09df499401 libgo: Bump version number.
Reviewed-on: https://go-review.googlesource.com/16583

From-SVN: r229686
2015-11-02 23:30:21 +00:00
Ian Lance Taylor c5f6dbf60d mksysinfo.sh: Handle TIOCGPGRP if too complex for -dump-go-spec.
Reviewed-on: https://go-review.googlesource.com/16580

From-SVN: r229676
2015-11-02 20:23:09 +00:00
Ian Lance Taylor ec3838a735 syscall: Change raw_ioctl cmd type to uintptr.
Attempt to fix a build bug report:
    
    ../../../../libgo/go/syscall/exec_linux.go:185:37: error: integer constant overflow
       _, err1 = raw_ioctl_ptr(sys.Ctty, TIOCSPGRP, unsafe.Pointer(&pgrp))
    
    Reviewed-on: https://go-review.googlesource.com/16539

From-SVN: r229674
2015-11-02 19:58:15 +00:00
Ian Lance Taylor 1c47a3bfa3 mksysinfo.sh: Handle TIOCSPGRP if too complex for -fdump-go-spec.
Reviewed-on: https://go-review.googlesource.com/16534

From-SVN: r229645
2015-11-01 20:51:23 +00:00
Ian Lance Taylor 2b193803d7 runtime: If no split stacks, allocate stacks using mmap on 64-bit systems.
When not using split stacks, libgo allocate large stacks for each
    goroutine.  On a 64-bit system, libgo allocates a maximum of 128G for
    the Go heap, and allocates 4M for each stack.  When the stacks are
    allocated from the Go heap, the result is that a program can only create
    32K goroutines, which is not enough for an active Go server.  This patch
    changes libgo to allocate the stacks using mmap directly, rather than
    allocating them out of the Go heap.  This change is only done for 64-bit
    systems when not using split stacks.  When using split stacks, the
    stacks are allocated using mmap directly anyhow.  On a 32-bit system,
    there is no maximum size for the Go heap, or, rather, the maximum size
    is the available address space anyhow.
    
    Reviewed-on: https://go-review.googlesource.com/16531

From-SVN: r229636
2015-10-31 23:48:19 +00:00
Ian Lance Taylor b9702967ee libgo: Update from Go 1.5 to Go 1.5.1.
Reviewed-on: https://go-review.googlesource.com/16527

From-SVN: r229624
2015-10-31 15:23:52 +00:00
Ian Lance Taylor af146490bb runtime: Remove now unnecessary pad field from ParFor.
It is not needed due to the removal of the ctx field.
    
    Reviewed-on: https://go-review.googlesource.com/16525

From-SVN: r229616
2015-10-31 00:59:47 +00:00
Ian Lance Taylor f4a513a98e compiler, reflect, runtime: remove zero field from type descriptor
Type descriptors picked up a zero field because the gc map
    implementation used it.  However, it's since been dropped by the gc
    library.  It was never used by gccgo.  Drop it now in preparation for
    upgrading to the Go 1.5 library.
    
    Reviewed-on: https://go-review.googlesource.com/16486

From-SVN: r229546
2015-10-29 18:14:50 +00:00
Ian Lance Taylor 730f6d1425 compiler, runtime: change type hash/equal to Go funcs
Change the type descriptor hash and equal functions from C code pointers
    to Go func values.  This permits them to be set to a Go function
    closure.  This is in preparation for the Go 1.5, so that we can use a
    closure for the hash/equal functions returned by the new reflect.ArrayOf
    function.
    
    Reviewed-on: https://go-review.googlesource.com/16485

From-SVN: r229541
2015-10-29 17:14:51 +00:00
David Malcolm 9e531d3749 Testsuite: add dg-{begin|end}-multiline-output commands
This patch adds an easy way to write tests for expected multiline
output.  For example we can test carets and underlines for
a particular diagnostic with:

/* { dg-begin-multiline-output "" }
 typedef struct _GMutex GMutex;
                ^~~~~~~
   { dg-end-multiline-output "" } */

multiline.exp is used by prune.exp; hence we need to load it before
prune.exp via *load_gcc_lib* for the testsuites of the various
non-"gcc" support libraries (e.g. boehm-gc).

gcc/testsuite/ChangeLog:
	* lib/multiline.exp: New file.
	* lib/prune.exp: Load multiline.exp.
	(prune_gcc_output): Call into multiline.exp to handle any
	multiline output directives.
	* lib/libgo.exp: Load multiline.exp before prune.exp, using
	load_gcc_lib.

boehm-gc/ChangeLog:
	* testsuite/lib/boehm-gc.exp: Load multiline.exp before
	prune.exp, using load_gcc_lib.

libatomic/ChangeLog:
	* testsuite/lib/libatomic.exp: Load multiline.exp before
	prune.exp, using load_gcc_lib.

libgomp/ChangeLog:
	* testsuite/lib/libgomp.exp: Load multiline.exp before prune.exp,
	using load_gcc_lib.

libitm/ChangeLog:
	* testsuite/lib/libitm.exp: Load multiline.exp before prune.exp,
	using load_gcc_lib.

libvtv/ChangeLog:
	* testsuite/lib/libvtv.exp: Load multiline.exp before prune.exp,
	using load_gcc_lib.

From-SVN: r228655
2015-10-09 13:55:23 +00:00
Ian Lance Taylor 0786e1fe86 re PR go/67874 (fd_unix.go does not build when there is fcntl64 and no fcntl syscall)
PR go/67874
    net, runtime: Call C library fcntl function rather than syscall.Syscall.
    
    Not all systems define a fcntl syscall; some only have fcntl64.
    
    Fixes GCC PR go/67874.
    
    Reviewed-on: https://go-review.googlesource.com/15497

From-SVN: r228576
2015-10-07 17:22:08 +00:00
Ian Lance Taylor 055db850c6 runtime: Fix recent lfstack change on Solaris.
Reviewed-on: https://go-review.googlesource.com/14922

From-SVN: r228087
2015-09-24 13:33:20 +00:00
Ian Lance Taylor 9f59bddfbf re PR go/67695 (Please improve POSIX shell compatibility of libgo/mksysinfo.sh)
PR go/67695
    mksysinfo.sh: Use = with test rather than ==.
    
    Fixes GCC PR 67695.

    Reviewed-on: https://go-review.googlesource.com/14858

From-SVN: r228064
2015-09-23 20:43:46 +00:00
Ian Lance Taylor 46efdbbc01 runtime: rewrite lfstack packing/unpacking to look more like that in Go
Reviewed-on: https://go-review.googlesource.com/13037

From-SVN: r228057
2015-09-23 17:07:15 +00:00
Ian Lance Taylor a2bf11d16a libgo: If compiler can split-stack and linker can not, use -fno-split-stack.
If the compiler supports split-stack but we are using a gold linker that
    does not, as happens on PPC with current GCC but old gold, then we need
    to compile the Go code with -fno-split-stack to avoid a linker error
    avoid the inability to call from split-stack code to non-split-stack
    code.
    
    Reviewed-on: https://go-review.googlesource.com/14598

From-SVN: r227811
2015-09-15 21:15:37 +00:00
Ian Lance Taylor c33c18cdc6 libgo: test linking split-stack and non-split-stack together
PPC has split-stack support in current GCC, but old version of gold will
    reject attempts to link PPC split-stack and non-split-stack code
    together.  Test for that, and don't compile the C code with
    -fsplit-stack if it doesn't work.
    
    Reviewed-on: https://go-review.googlesource.com/14594

From-SVN: r227802
2015-09-15 17:05:14 +00:00
Ian Lance Taylor 7e56d66864 runtime: Ignore stack sizes when deciding when to GC.
This restores https://golang.org/cl/6081043 which was lost accidentally
    when updating a new version of libgo in https://golang.org/cl/22440043 .
    
    Reviewed-on: https://go-review.googlesource.com/14569

From-SVN: r227784
2015-09-15 12:32:31 +00:00
Ian Lance Taylor 44c925bdb0 libgo: don't provide ustat on arm64 GNU/Linux
This avoids linker warnings when linking against glibc, as apparently
    arm64 GNU/Linux does not support the ustat system call.
    
    Also update to automake 1.11.6, as that is the new GCC standard.
    
    Reviewed-on: https://go-review.googlesource.com/14567

From-SVN: r227777
2015-09-15 03:43:01 +00:00
Ian Lance Taylor 5dbd3b8045 libgo/runtime: return 0, not NULL, from main
Reviewed-on: https://go-review.googlesource.com/13421

From-SVN: r227673
2015-09-11 03:12:28 +00:00
Ian Lance Taylor 476013d60b libgo: Use stat_atim.go on Solaris 12+
From Rainer Orth.
    
    Solaris 12 changes the stat_[amc]tim members of struct stat from
    timestruc_t to timespec_t for XPG7 compatiblity, thus breaking the libgo
    build.  The following patch checks for this change and uses the common
    stat_atim.go if appropriate.
    
    Reviewed-on: https://go-review.googlesource.com/14495

From-SVN: r227665
2015-09-10 21:17:00 +00:00
Ian Lance Taylor f999c862ec libgo/testsuite: another fix for killing the sleep process
Avoid ps padding issues.  Make sure we locate and kill just the sleep
    process.
    
    Reviewed-on: https://go-review.googlesource.com/13634

From-SVN: r227037
2015-08-20 17:10:45 +00:00
Ian Lance Taylor d0ceffe507 libgo/testsuite: don't call kill without args
If the timeout subshell has no child processes,
    the "xargs | kill" will fail. Ensure there is
    some input for kill before calling it.
    
    Reviewed-on: https://go-review.googlesource.com/13295

From-SVN: r226719
2015-08-07 10:10:00 +00:00
Ian Lance Taylor f48495834f runtime: initialize variable to avoid compiler warning
Reviewed-on: https://go-review.googlesource.com/13095

From-SVN: r226543
2015-08-04 03:39:21 +00:00
Ian Lance Taylor 1ca95ba067 syscall: RawSockaddr fix for ppc64, ppc64le
The struct RawSockaddr contains a field Data which
    should be uint8 on ppc64 and ppc64le, but is declared
    as int8 in gccgo.  This change adds a two new files
    which contain the structure declaration for
    RawSockaddr, one with the correct types for for ppc64
    and ppc64le, and the other for non-ppc64 platforms.
    
    Fixes golang/go#11469
    
    Reviewed-on: https://go-review.googlesource.com/11946

From-SVN: r226533
2015-08-03 21:18:56 +00:00
Ian Lance Taylor ca81dee392 libgo/testsuite: kill sleep process in gotest
This change modifies the "gotest" shell script
    to kill all processes, including "sleep", spawned
    by the timeout subshell. This prevents the sleep
    process from living beyond the gotest process.
    
    BACKGROUND
    
    The "gotest" shell script spawns "sleep" processes
    in the background to kill off test cases that run
    past their specified timeout. There are commands
    included that appear to kill the sleep process,
    but they only kill the parent shell, causing the
    sleep process to reparent.
    
    The orphaned sleep process can cause issues when
    gotest is run under some build systems, such as
    Ninja [0]. The particular issue with Ninja is the
    method it uses to identify terminated processes:
    it creates a pipe, passes the write end to the
    child process, and waits for EOF. In the case of
    libgo/gotest, the orphaned sleep process inherits
    the pipe FD and keeps it open for 4 minutes by
    default.
    
    [0] https://github.com/martine/ninja
    
    Reviewed-on: https://go-review.googlesource.com/12227

From-SVN: r226526
2015-08-03 18:23:42 +00:00
Ian Lance Taylor 3d6d2a63b2 re PR go/67101 (mprof.goc:408:5: error: calling ‘__builtin_frame_address’ with a nonzero argument is unsafe [-Werror=frame-address])
PR go/67101

    runtime: Remove call to __builtin_frame_address.
    
    __builtin_frame_address was only supposed to use nonzero arguments
    for debugging purposes.  Calling it with nonzero arguments can have
    unpredictable results and uses are now marked unsafe when
    -Wframe-address is enabled.
    
    Reviewed-on: https://go-review.googlesource.com/13063

From-SVN: r226525
2015-08-03 17:54:50 +00:00
Ian Lance Taylor d266c7e943 syscall: Fix to libgo/mksysinfo.sh
In a recent change to mksysinfo.sh, a space was missing on
    some lines which caused the libgo build to hang on some
    systems.  This corrects that problem.
    
    Fixes golang/go#11924
    
    Reviewed-on: https://go-review.googlesource.com/12835

From-SVN: r226366
2015-07-29 21:42:30 +00:00
Ian Lance Taylor 2850beb940 syscall: Add ioctl consts from if_tun.h
During the gccgo build define constants from
    some header files are processed by mksysinfo.sh and
    added to syscall.go.  In some cases the constants
    are based on macros which are not processed
    correctly by mksysinfo.sh.  This adds the support
    to generate the correct values for the TUN* constants
    from linux/if_tun.h.
    
    Fixes golang/go#11707
    
    Reviewed-on: https://go-review.googlesource.com/12491

From-SVN: r226196
2015-07-25 00:01:04 +00:00
Ian Lance Taylor 67a546ab45 compiler,runtime: Determine if allocations need new pointers in runtime.
As the removed comment states, if the package being compiled played
    certain tricks with pointers that looked like integers, the compiler
    might allocate space for new pointers unnecessarily.  Since the type
    information on the heap is now precise, this logic can be moved to the
    runtime.
    
    Reviewed-on: https://go-review.googlesource.com/11581

From-SVN: r225757
2015-07-14 01:22:25 +00:00
Ian Lance Taylor 51cef06e02 syscall: remove calls to Entersyscall & Exitsyscall in Getdents
The syscall for Getdents in syscall/libcall_linux.go
    called Entersyscall and Exitsyscall, causing the
    runtime_sched counts for goroutines to be incorrect.
    Inconsistent counts caused checkdead in runtime/proc.c
    to panic.
    
    Fixes golang/go#11406
    
    Reviewed-on: https://go-review.googlesource.com/11761

From-SVN: r225745
2015-07-13 18:55:15 +00:00
Ian Lance Taylor 5ea73ae3b8 libgo: Use __USING_SJLJ_EXCEPTIONS__ rather than configure test.
From Eric Botcazou.

From-SVN: r223231
2015-05-16 00:17:46 +00:00
Ian Lance Taylor b1b0e90567 runtime: Fix runtime/pprof test when libgo is not optimized.
When libgo is not optimized the static function profilealloc
in malloc.goc shows up in the stack trace.  Rename it to
runtime_profilealloc so that runtime/pprof.printStackRecord
ignores it.

From-SVN: r223006
2015-05-11 16:19:23 +00:00
Ian Lance Taylor bd9e8f7e4a re PR go/66016 (Accessing nil Func's name results in crash)
PR go/66016
runtime: Don't crash in Func.Name if the Func is nil.

Related to Go issue 10696

From-SVN: r222816
2015-05-05 16:38:57 +00:00
Ian Lance Taylor 081564faed runtime: Support -buildmode=c-shared.
These changes permit using the go tool from the upcoming Go
1.5 release with -buildmode=c-archive to build gccgo code into
an archive file that can be linked with a C program.

From-SVN: r222594
2015-04-29 21:31:53 +00:00
Ian Lance Taylor bddc11a8ff re PR go/65616 (libgobegin.a not compiled with -fPIC)
PR go/65616
libgo: Compile go-main, in libgobegin, with -fPIC.

From-SVN: r222431
2015-04-24 22:08:32 +00:00
Ian Lance Taylor 46f120ca7b re PR go/65798 (runtime.Caller returns ok=true when return data is invalid)
PR go/65798
runtime: In Caller don't return ok == true if PC == 0.

GCC PR 65798 reports that this can happen in some cases.

From-SVN: r222204
2015-04-17 21:59:10 +00:00
Ian Lance Taylor d6c2d7c1ca re PR go/64683 (FAIL: runtime/pprof -- testing.go:278: The entry did not match)
PR go/64683
runtime/pprof: Assume function with no name is in runtime.

GCC PR 65797 causes some of the runtime functions to be
compiled with no name in the debug info.  This in turn causes
the runtime/pprof test to fail as reported in GCC PR 64683.

There are no good choices when a function has no name in the
debug info, but here we assume that if we see such a function
while reading the runtime functions, we assume that it is also
a runtime function.

From-SVN: r222200
2015-04-17 21:29:20 +00:00
Ian Lance Taylor 5fdb119fd5 re PR go/64999 (s390x libgo test failure in TestMemoryProfiler)
PR go/64999
	PR go/65180
runtime: Adjust libbacktrace PC value to what runtime.Callers expects.

From Lynn Boger.

From-SVN: r222196
2015-04-17 19:29:28 +00:00
Ian Lance Taylor 90e00f872d re PR go/65755 (incorrect reflection of struct fields with gccgo)
PR go/65755
compiler, runtime, reflect: Use reflection string for type comparisons.

Change the runtime and reflect libraries to always use only
the type reflection string to determine whether two types are
equal.  It previously used the PkgPath and Name values for a
type name, but that required a PkgPath that did not match the
gc compiler.

Change the compiler to use the same PkgPath value as the gc
compiler in all cases.

Change the compiler to put the receiver type in the reflection
string for a type defined inside a method.

From-SVN: r222194
2015-04-17 18:19:44 +00:00
Ian Lance Taylor 5d22575b1b mksysinfo.sh: Define Solaris zone_net_addr_t struct.
From Rainer Orth.

From-SVN: r221920
2015-04-08 14:17:13 +00:00
Ian Lance Taylor 4bcd34f6ad re PR go/63731 (Fallback to netgo does not work)
PR go/63731
libgo: Build and install libnetgo.a

libnetgo.a provides the net
package built with the netgo
tag enabled.  This provides the
netgo fallback solution for gccgo.
This lib must be explicitly linked
in using the -gccgoflags, so is
not included by default.

From-SVN: r221906
2015-04-07 18:09:28 +00:00
Ian Lance Taylor 2ee920291d Remove some files that were accidentally committed in 2014.
From-SVN: r221802
2015-03-31 19:47:23 +00:00
Ian Lance Taylor 9f5059b275 go/cmd/go: always link external test packages first
When linking complex packages that use both internal and external tests as well as many dependencies it is critical that the link order be external test package, internal test package, everything else.

This change is a back (forward?) port of the same change that canonical have been maintaining on their fork of the go tool for gccgo. Now that gccgo uses the go tool from upstream, this patch should be applied both to the gofrontend and golang/go repos.

From-SVN: r221800
2015-03-31 17:54:07 +00:00
Ian Lance Taylor ef99b3de9f re PR go/65587 (C package incomplete/not working for powerpc-linux-gnu)
PR go/65587
debug/elf: apply relocations for SHT_RELA/EM_PPC

From-SVN: r221698
2015-03-26 17:51:57 +00:00
Ian Lance Taylor d94a1e7fe9 libgo: Fix go/runtime test failure on S390.
The tests run out of memory on 31-bit S390 systems because
it does not have split stacks.

From-SVN: r221681
2015-03-26 00:39:45 +00:00
Ian Lance Taylor 7b980c32fa re PR go/65570 (cannot find package "runtime/cgo")
PR go/65570
libgo/Makefile.am: add runtime/cgo to list of standard packages

The runtime/cgo package is treated specially by the go tool.
It needs to know that it is always available for gccgo.

From-SVN: r221673
2015-03-25 21:19:01 +00:00
Ian Lance Taylor e93870c12b re PR go/65417 (debug/elf: lacks support for PPC relocations)
PR go/65417
debug/elf: support reading debug info from 32-bit PPC objects

This is a backport of http://golang.org/7590 from the master
Go library.

From-SVN: r221644
2015-03-24 20:55:43 +00:00
Ian Lance Taylor ab24432b9a re PR go/65462 (Use of 'go get' with gccgo is not finding dependencies correctly)
PR go/65462
cmd: Fix dependencies for 'go get' with gccgo

Problem described in GCC BZ 65462.
Generate the list of the standard GO package names based on what was built into libgo in the libgo Makefile.
Change the var name from reqPkgSrc to reqStdPkgSrc to clarify it only affects standard GO packages.
Skip the attempted loading of a package only if it is a standard GO package and the flag is set indicating its source is not required to be available.
This requires a corresponding change to gotools to build and link in the new file containing the list of standard GO package names that was generated by the libgo Makefile.

gotools/:
	PR go/65462
	* Makefile.am (go_cmd_go_files): Add $(libgodir)/zstdpkglist.go.
	* Makefile.in: Rebuild.

From-SVN: r221643
2015-03-24 19:50:31 +00:00
Ian Lance Taylor f41914c385 libgo/README: Minor updates.
In particular, mention that libgo should not be stripped.

From-SVN: r221427
2015-03-13 18:53:13 +00:00
Ian Lance Taylor 2960e09d9d go/build: cgo works on linux/arm64.
From-SVN: r221398
2015-03-12 17:05:22 +00:00
Ian Lance Taylor 64b54a6fd2 re PR go/65404 (cgo tool on powerpc-linux-gnu maybe incomplete)
PR go/65404
go/build: cgo works on linux/pcc.

From-SVN: r221396
2015-03-12 16:41:28 +00:00
Ian Lance Taylor 1c1f0c595b re PR go/65353 (unknown ptrSize for $GOARCH "arm64" on aarch64-linux-gnu)
PR go/65353.
cmd/cgo: Add all gccgo GOARCH values to size maps.

From-SVN: r221293
2015-03-10 00:14:58 +00:00
Ian Lance Taylor dc4d494ae9 re PR go/65349 (go tool crashes, can't compile go code on 32bit linux systems)
PR go/65349
runtime: Don't crash if explicitly freeing small map.

From-SVN: r221292
2015-03-09 23:43:16 +00:00
Ian Lance Taylor 4729d7726b re PR go/65349 (go tool crashes, can't compile go code on 32bit linux systems)
PR go/65349
runtime: Don't call malloc from __go_file_line callback.

When crashing, we call runtime_printcreatedby which calls
__go_file_line which used to call the Go malloc.  If we are
crashing due to a signal due to heap corruption of some sort,
the GO malloc lock might already be held, leading to a crash
within a crash.  Avoid that by assuming that the libbacktrace
strings will stick around, as we already do in go-callers.c.

From-SVN: r221291
2015-03-09 23:40:58 +00:00
Ian Lance Taylor c271e224c2 libgo: Upgrade to Go 1.4.2 release.
From-SVN: r221245
2015-03-06 16:19:05 +00:00
Ian Lance Taylor 898c81f831 mksysinfo.sh: Remove _zone_net_addr_t handling.
From Rainer Orth.

The recent godump changes broke Solaris 11.1+ bootstrap in
libgo: before, gen-sysinfo.so had

type _zone_net_addr_t struct { zna_family uint16; zna_plen uint16; zna_addru struct { znau_addr6 _in6_addr; }; }

which was filtered out by mksysinfo.sh due to the use of
_in6_addr.

After the change, there's now

type _zone_net_addr_t struct { zna_family uint16; zna_plen uint16; zna_addru struct { znau_addr6 [16]byte; Godump_0_align [0]uint32; }; }

instead, not filtered, but added a second time by the
_zone_net_addr_t code in mksysinfo.sh, which leads to
redefinition warnings/errors.

Simply removing the old _zone_net_addr_t fragment fixes this
and restores bootstrap.

From-SVN: r220481
2015-02-06 16:18:14 +00:00
Ian Lance Taylor 8c5c44aa7e runtime: Add memprofilerate to GODEBUG
Add memprofilerate as a value recognized
in the GODEBUG env var.  The value provided
is used as the new setting for
runtime.MemProfileRate, allowing the user
to adjust memory profiling.

From-SVN: r220470
2015-02-06 05:03:22 +00:00
Ian Lance Taylor bfdd75a859 go/types: Remove unused testdata files.
The go/types package was removed in July 2013, but the
testdata files were accidentally left behind.

From-SVN: r220378
2015-02-03 21:39:27 +00:00
Ian Lance Taylor ba986acb05 re PR go/64573 (Cmd.Start swallows error from fork()/clone())
PR go/64573
syscall: Restore line somehow lost in libgo merge.

From-SVN: r220068
2015-01-23 23:45:04 +00:00
Ian Lance Taylor 9d8d3ba2bc re PR go/64725 (FAIL: libgo/runtime TestFinalizerType testing.go:278: #2: finalizer for type func(*int) didn't run)
PR go/64725
runtime: Disable tests that require that a finalizer run.

From-SVN: r220067
2015-01-23 23:22:29 +00:00
Ian Lance Taylor e0a0c2f4c6 re PR go/64595 (go programs abort when debug info is stripped)
PR go/64595
runtime: Don't crash in runtime_callers if no debug info available.

From-SVN: r220057
2015-01-23 19:49:53 +00:00
Ian Lance Taylor 6632034718 runtime: Add the Go language version information to the Version output.
From-SVN: r219976
2015-01-21 23:03:41 +00:00
Ian Lance Taylor 73cb399d51 re PR go/64683 (FAIL: runtime/pprof -- testing.go:278: The entry did not match)
PR go/64683
runtime/pprof: Let memory profiler test pass if value not collected.

Since gccgo's GC is not precise, the transient value may not
be collected.  Let the regexp match that case as well.

From-SVN: r219900
2015-01-20 16:11:36 +00:00
Ian Lance Taylor cea526b81c runtime: No special case for 386 complex in FFI support.
All supported libgo 386 targets now have complex support in
libffi.

From Uros Bizjak.

From-SVN: r219877
2015-01-20 04:18:12 +00:00
Richard Henderson 3bac62c2b2 Add attribute unused to dummy arguments in ffi stub
From-SVN: r219862
2015-01-19 14:10:59 -08:00
Ian Lance Taylor b077669c47 reflect: Fix build for systems that do not define ffi_go_closure.
From-SVN: r219831
2015-01-19 02:56:28 +00:00