Commit Graph

506 Commits

Author SHA1 Message Date
Ian Lance Taylor 75791bab05 runtime: use -fgo-c-header to build C header file
Use the new -fgo-c-header option to build a header file for the Go
    runtime code in libgo/go/runtime, and use the new header file in the C
    runtime code in libgo/runtime.  This will ensure that the Go code and C
    code share the same data structures as we convert the runtime from C to
    Go.
    
    The new file libgo/go/runtime/runtime2.go is copied from the Go 1.7
    release, and then edited to remove unnecessary data structures and
    modify others for use with libgo.
    
    The new file libgo/go/runtime/mcache.go is an initial version of the
    same files in the Go 1.7 release, and will be replaced by the Go 1.7
    file when we convert to the new memory allocator.
    
    The new file libgo/go/runtime/type.go describes the gccgo version of the
    reflection data structures, and replaces the Go 1.7 runtime file which
    describes the gc version of those structures.
    
    Using the new header file means changing a number of struct fields to
    use Go naming conventions (that is, no underscores) and to rename
    constants to have a leading underscore so that they are not exported
    from the Go package.  These names were updated in the C code.
    
    The C code was also changed to drop the thread-local variable m, as was
    done some time ago in the gc sources.  Now the m field is always
    accessed using g->m, where g is the single remaining thread-local
    variable.  This in turn required some adjustments to set g->m correctly
    in all cases.
    
    Also pass the new -fgo-compiling-runtime option when compiling the
    runtime package, although that option doesn't do anything yet.
    
    Reviewed-on: https://go-review.googlesource.com/28051

From-SVN: r239872
2016-08-30 21:07:47 +00:00
Ian Lance Taylor 87155d4f6c cmd/go: ignore errors from go/build for standard packages
The go/build package does not know that gccgo's standard packages don't
    have source, and will report an error saying that it can not find them.
    Work around that in the cmd/go sources, since the go/build sources don't
    currently have a list of standard packages.
    
    This should get a real fix in the master sources, somehow.
    
    Fixes golang/go#16701.
    
    Reviewed-on: https://go-review.googlesource.com/27052

From-SVN: r239486
2016-08-15 18:05:24 +00:00
Ian Lance Taylor 237673d052 crypto/aes, hash/crc32: ignore s390x specific files for now
These files are used to select s390x assembler support in the gc
    toolchain.  We don't currently have that support, as it is written in
    the cmd/asm syntax rather than gas syntax.  Mark the files to be ignored
    for now, falling back to the default implementations.
    
    Patch by Andreas Krebbel.
    
    Reviewed-on: https://go-review.googlesource.com/26994

From-SVN: r239442
2016-08-13 00:19:56 +00:00
Ian Lance Taylor 7159824eb3 syscall: remove exec_solaris_test.go
It is testing functionality that gccgo does not need and does not
    support.
    
    Reviewed-on: https://go-review.googlesource.com/26992

From-SVN: r239438
2016-08-13 00:14:19 +00:00
Ian Lance Taylor 3d0fa95d5c os: fix build tags for dir_regfile.go
We want to build dir_regfile.go if not GNU/linux, and not solaris/386,
    and not solaris/sparc.  The latter two conditions were incorrect.  To
    write ! solaris/386 we have to write !solaris !386.  I forgot De
    Morgan's Law.
    
    Reviewed-on: https://go-review.googlesource.com/26870

From-SVN: r239393
2016-08-11 21:36:13 +00:00
Ian Lance Taylor 0717bdbfbd text/template: reduce maxExecDepth for gccgo further
We already lowered the limit of recursive template invocations from
    100,000 to 10,000, but the tests still fail occasionally on
    x86_64-pc-linux-gnu when using GNU ld (so that split stacks are not
    fully functional).  Reduce the limit further, to 1000, enough so that
    the test passes consistently.
    
    Permitting 1000 recursive template invocations still seems capacious
    enough for real world use.
    
    Reviewed-on: https://go-review.googlesource.com/25590

From-SVN: r239261
2016-08-08 22:55:29 +00:00
Ian Lance Taylor 4f8e688afc internal/syscall/unix: fix syscalls for alpha, ia64, s390
Also change the configure script to set GOARCH correctly for ia64, and
    add ia64 as a processor to match.sh and gotest.
    
    Reviewed-on: https://go-review.googlesource.com/25549

From-SVN: r239225
2016-08-07 22:32:46 +00:00
Ian Lance Taylor 851e6c6a8e libgo: fix getrandom build for 32-bit ppc
Add a ppc build constraint for internal/syscall/unix.
    
    Reviewed-on: https://go-review.googlesource.com/25547

From-SVN: r239210
2016-08-06 15:58:22 +00:00
Ian Lance Taylor e0f69f36ea libgo: change build procedure to use build tags
Previously the libgo Makefile explicitly listed the set of files to
    compile for each package.  For packages that use build tags, this
    required a lot of awkward automake conditionals in the Makefile.
    
    This CL changes the build to look at the build tags in the files.
    The new shell script libgo/match.sh does the matching.  This required
    adjusting a lot of build tags, and removing some files that are never
    used.  I verified that the exact same sets of files are compiled on
    amd64 GNU/Linux.  I also tested the build on i386 Solaris.
    
    Writing match.sh revealed some bugs in the build tag handling that
    already exists, in a slightly different form, in the gotest shell
    script.  This CL fixes those problems as well.
    
    The old code used automake conditionals to handle systems that were
    missing strerror_r and wait4.  Rather than deal with those in Go, those
    functions are now implemented in runtime/go-nosys.c when necessary, so
    the Go code can simply assume that they exist.
    
    The os testsuite looked for dir_unix.go, which was never built for gccgo
    and has now been removed.  I changed the testsuite to look for dir.go
    instead.
    
    Reviewed-on: https://go-review.googlesource.com/25546

From-SVN: r239189
2016-08-06 00:36:33 +00:00
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 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 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 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 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 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 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 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 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 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 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
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 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 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 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 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 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 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 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 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 c271e224c2 libgo: Upgrade to Go 1.4.2 release.
From-SVN: r221245
2015-03-06 16:19:05 +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 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
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
Ian Lance Taylor 20780a006f testing/quick: Revert Alpha specific change.
No longer needed now that libffi supports complex types.

From-SVN: r219777
2015-01-16 23:19:20 +00:00
Richard Henderson 38bf819a5f compiler, reflect, runtime: Use static chain for closures.
Change from using __go_set_closure to passing the closure
value in the static chain field.  Uses new backend support for
setting the closure chain in a call from C via
__builtin_call_with_static_chain.  Uses new support in libffi
for Go closures.

The old architecture specific support for reflect.MakeFunc is
removed, replaced by the libffi support.

All work done by Richard Henderson.

	* go-gcc.cc (Gcc_backend::call_expression): Add chain_expr argument.
	(Gcc_backend::static_chain_variable): New method.

From-SVN: r219776
2015-01-16 22:58:53 +00:00
Ian Lance Taylor 72d7151a72 net: Restore earlier Solaris-specific version of setKeepAlivePeriod.
The version from the master repository seems to be appropriate
for OpenSolaris but not for Solaris itself.  Solaris 11.2
proper does not define TCP_KEEPIDLE or TCP_KEEPINTVL.

From-SVN: r219749
2015-01-16 15:57:32 +00:00
Ian Lance Taylor 1d59990631 go/build: cgo works on linux/alpha.
From Uros Bizjak.

From-SVN: r219691
2015-01-15 22:06:54 +00:00
Ian Lance Taylor 4c16468417 reflect: Correct error in conversion of s390x support to Go 1.4.
From-SVN: r219685
2015-01-15 20:42:43 +00:00
Ian Lance Taylor 3307c079d5 Add files somehow left out of last commit (upgrade to Go 1.4).
From-SVN: r219628
2015-01-15 00:40:25 +00:00
Ian Lance Taylor f8d9fa9e80 libgo, compiler: Upgrade libgo to Go 1.4, except for runtime.
This upgrades all of libgo other than the runtime package to
the Go 1.4 release.  In Go 1.4 much of the runtime was
rewritten into Go.  Merging that code will take more time and
will not change the API, so I'm putting it off for now.

There are a few runtime changes anyhow, to accomodate other
packages that rely on minor modifications to the runtime
support.

The compiler changes slightly to add a one-bit flag to each
type descriptor kind that is stored directly in an interface,
which for gccgo is currently only pointer types.  Another
one-bit flag (gcprog) is reserved because it is used by the gc
compiler, but gccgo does not currently use it.

There is another error check in the compiler since I ran
across it during testing.

gotools/:
	* Makefile.am (go_cmd_go_files): Sort entries.  Add generate.go.
	* Makefile.in: Rebuild.

From-SVN: r219627
2015-01-15 00:27:56 +00:00
Ian Lance Taylor bb782ca3ec cmd/go: Back-port CL 157460043 (pass $CGO_LDFLAGS to linker with the "gccgo" toolchain).
From-SVN: r219419
2015-01-10 01:01:10 +00:00
Ian Lance Taylor b44fb4c37a cmd/go: Adjust finding gccgo to match current upstream sources.
From-SVN: r219406
2015-01-09 21:18:04 +00:00
Ian Lance Taylor d9ebff44bb cmd/go: Use builtin constant to set default gccgo compiler.
Don't look it up on PATH.  This lets a go tool built as part
of a GCC build use the gccgo from the same build.

Also pass -c when assembling a .s file with gccgo.

From-SVN: r219358
2015-01-08 20:32:42 +00:00
Ian Lance Taylor 7d7d64c1ae libgo: Add sources for go, cgo, and gofmt commands.
The new commands are not yet built.  That will be done
separately.

Also include a few changes to go/build to support them.

From-SVN: r219272
2015-01-06 23:26:02 +00:00
Ian Lance Taylor e846322c86 testing: Add testing.MainStart function.
This patches in the Go 1.4 function, for convenience for
people using the Go 1.4 go tool with mainline gccgo.

From-SVN: r218700
2014-12-13 01:00:49 +00:00
Ian Lance Taylor 6f7ccafa91 runtime: GOARCH values for ppc64 BE & LE
ppc64 for BE
ppc64le for LE
issue 8654

From-SVN: r217941
2014-11-21 18:22:05 +00:00
Ian Lance Taylor c9bc4e2d2b sync/atomic: fix data races in tests
Backport https://codereview.appspot.com/111320044 from Go
master library.

From-SVN: r217110
2014-11-05 03:39:49 +00:00
Ian Lance Taylor 1fec5f5274 libgo: add s390 support
From Dominik Vogt.

* libgo/go/syscall/libcall_linux_s390.go: New file for s390 support.
* libgo/go/syscall/syscall_linux_s390.go: Ditto.
* libgo/go/syscall/libcall_linux_s390x.go: New file for s390x support.
* libgo/go/syscall/syscall_linux_s390x.go: Ditto.
* libgo/go/runtime/pprof/pprof.go (printStackRecord): Support s390 and
s390x.
* libgo/runtime/runtime.c (runtime_cputicks): Add support for s390 and
s390x
* libgo/mksysinfo.sh: Ditto.
(upcase_fields): New helper function

* libgo/go/debug/elf/file.go (applyRelocations): Implement relocations
on s390x.
(applyRelocationsS390x): Ditto.
(DWARF): Ditto.
* libgo/go/debug/elf/elf.go (R_390): New constants for S390 relocations.
(r390Strings): Ditto.
(String): Helper function for S390 relocations.
(GoString): Ditto.

* libgo/go/reflect/makefuncgo_s390.go: New file.
(S390MakeFuncStubGo): Implementation of s390 abi.
* libgo/go/reflect/makefuncgo_s390x.go: New file.
(S390xMakeFuncStubGo): Implementation of s390x abi.
* libgo/go/reflect/makefunc_s390.c: New file.
(makeFuncStub): s390 and s390x specific implementation of function.
* libgo/go/reflect/makefunc.go
(MakeFunc): Add support for s390 and s390x.
(makeMethodValue): Ditto.
(makeValueMethod): Ditto.
* libgo/Makefile.am (go_reflect_makefunc_s_file): Ditto.
(go_reflect_makefunc_file): Ditto.
* libgo/go/reflect/makefunc_dummy.c: Ditto.
* libgo/runtime/runtime.h (__go_makefunc_can_recover): Export prototype
for use in makefunc_s390.c.
(__go_makefunc_returning): Ditto.

* libgo/go/syscall/exec_linux.go (forkAndExecInChild): Fix order of the
arguments of the clone system call for s390[x].

* libgo/configure.ac (is_s390): New variable.
(is_s390x): Ditto
(LIBGO_IS_S390): Ditto.
(LIBGO_IS_S390X): Ditto.
(GOARCH): Support s390 and s390x.
* libgo/go/go/build/build.go (cgoEnabled): Ditto.
* libgo/go/go/build/syslist.go (goarchList): Ditto.

From-SVN: r217106
2014-11-04 22:39:30 +00:00
Ian Lance Taylor 5d51c2d70c debug/elf: add power64 support along with relocation test
Backport of https://codereview.appspot.com/125910043 from the
dev.power64 branch of the master repository.

From-SVN: r216813
2014-10-28 22:57:35 +00:00
Ian Lance Taylor 50a504654d libgo: Update to Go 1.3.3 release.
From-SVN: r216746
2014-10-27 16:57:33 +00:00
Ian Lance Taylor 7b28fa2c6b reflect: allocate correct type in assignTo and cvtT2I
Backport https://codereview.appspot.com/155450044 from the
master Go library.  Original description:

I came across this while debugging a GC problem in gccgo.
There is code in assignTo and cvtT2I that handles assignment
to all interface values.  It allocates an empty interface even
if the real type is a non-empty interface.  The fields are
then set for a non-empty interface, but the memory is recorded
as holding an empty interface.  This means that the GC has
incorrect information.

This is extremely unlikely to fail, because the code in the GC
that handles empty interfaces looks like this:

obj = nil;
typ = eface->type;
if(typ != nil) {
        if(!(typ->kind&KindDirectIface) || !(typ->kind&KindNoPointers))
                obj = eface->data;

In the current runtime the condition is always true--if
KindDirectIface is set, then KindNoPointers is clear--and we
always want to set obj = eface->data.  So the question is what
happens when we incorrectly store a non-empty interface value
in memory marked as an empty interface.  In that case
eface->type will not be a *rtype as we expect, but will
instead be a pointer to an Itab.  We are going to use this
pointer to look at a *rtype kind field.  The *rtype struct
starts out like this:

type rtype struct {
        size          uintptr
        hash          uint32            // hash of type; avoids computation in hash tables
        _             uint8             // unused/padding
        align         uint8             // alignment of variable with this type
        fieldAlign    uint8             // alignment of struct field with this type
        kind          uint8             // enumeration for C

An Itab always has at least two pointers, so on a
little-endian 64-bit system the kind field will be the high
byte of the second pointer.  This will normally be zero, so
the test of typ->kind will succeed, which is what we want.

On a 32-bit system it might be possible to construct a failing
case by somehow getting the Itab for an interface with one
method to be immediately followed by a word that is all ones.
The effect would be that the test would sometimes fail and the
GC would not mark obj, leading to an invalid dangling
pointer.  I have not tried to construct this test.

I noticed this in gccgo, where this error is much more likely
to cause trouble for a rather random reason: gccgo uses a
different layout of rtype, and in gccgo the kind field happens
to be the low byte of a pointer, not the high byte.

From-SVN: r216489
2014-10-20 18:04:55 +00:00
Ian Lance Taylor 19d4baed57 re PR go/60406 (recover.go: test13reflect2 test failure)
PR go/60406
runtime: Check callers in can_recover if return address	doesn't match.

Also use __builtin_extract_return_address and tighten up the
checks in FFI code.

Fixes PR 60406.

From-SVN: r216003
2014-10-08 14:03:13 +00:00
Ian Lance Taylor 22806403ec re PR go/61877 (reflect: cannot use []string as type string in Call)
PR go/61877
refect: fix direct call of variadic method value

As reported in bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61877
gcc mainline has regressed in this.  This CL adds the tests proposed
for the main Go repository:

        https://codereview.appspot.com/151280043/
        https://codereview.appspot.com/152060043/

restores the code from the amd64/386 path that makes this work and
was lost when the Go 1.3 stdlib was merged and changes the FFI path
to call into the same helper code as the amd64/386 path.

I've only tested this on amd64 but I did test a version that was
patched to unconditionally take the FFI path.

From-SVN: r215859
2014-10-03 15:51:38 +00:00
Ian Lance Taylor 01c2fa9d53 runtime: Use the clone system call on GNU/Linux.
Without this we weren't supporting the standard Cloneflags
field of SysProcAttr.

From-SVN: r214972
2014-09-05 15:24:36 +00:00
Chris Manghane f1d2ac4f84 compiler: Add precise type information on the heap.
* go-gcc.cc (Gcc_backend::implicit_variable): Remove init
	parameter.  Add is_hidden parameter.
	(Gcc_backend::implicit_variable_set_init): New method.
	(Gcc_backend::implicit_variable_reference): New method.

From-SVN: r214894
2014-09-03 22:56:09 +00:00
Ian Lance Taylor d5d0580e64 runtime: remove unused variable
This variable is unused apparently as a result of local changes.
gccgo accepts this variable declaration, but other frontends may not.

From-SVN: r212873
2014-07-20 19:20:12 +00:00
Ian Lance Taylor aefa5ff4cf runtime: add a missing import
This adds an import of the runtime package to fix compilation
of the TestStopCPUProfilingWithProfilerOff function.

The gccgo compiler should never have accepted this.  The patch
for the comiler is http://codereview.appspot.com/116960043 .
The test is https://codereview.appspot.com/118000043 .

From-SVN: r212870
2014-07-20 15:09:04 +00:00
Ian Lance Taylor dffa732835 reflect, runtime: Use libffi closures to implement reflect.MakeFunc.
Keep using the existing 386 and amd64 code on those archs,
since it is more efficient.

From-SVN: r212853
2014-07-19 21:36:26 +00:00
Ian Lance Taylor 00d86ac99f libgo: Update to Go 1.3 release.
From-SVN: r212837
2014-07-19 08:53:52 +00:00
Ian Lance Taylor 2fa39ad859 runtime: Merge master revision 19185.
This revision renames several files in the runtime directory
from .c to .goc.

From-SVN: r212472
2014-07-12 00:01:09 +00:00
Ian Lance Taylor 7b169c293d runtime: add missing benchmark input files to the repository
From-SVN: r211961
2014-06-24 23:52:47 +00:00
Ian Lance Taylor 6736ef96ea libgo: Merge to master revision 19184.
The next revision, 19185, renames several runtime files, and
will be handled in a separate change.

From-SVN: r211328
2014-06-06 22:37:27 +00:00
Ian Lance Taylor bae90c989c libgo: Merge from revision 18783:00cce3a34d7e of master library.
This revision was committed January 7, 2014.  The next
revision deleted runtime/mfinal.c.  That will be done in a
subsequent merge.

This merge changes type descriptors to add a zero field,
pointing to a zero value for that type.  This is implemented
as a common variable.

	* go-gcc.cc (Gcc_backend::implicit_variable): Add is_common and
	alignment parameters.  Permit init parameter to be NULL.

From-SVN: r211249
2014-06-04 23:15:33 +00:00
Ian Lance Taylor 5584c49a11 gofrontend: deduplicate C syscall function declarations
A gccgo language extension allows a function to be declared multiple
times. Avoid the use of this extension by dedeplicating declarations
in mksyscall.awk.

From-SVN: r209508
2014-04-17 23:39:23 +00:00
Ian Lance Taylor e8ad3ca026 runtime: remove use of obsolete map deletion syntax
The use of this syntax was eliminated upstream in Go 992248b2adc2,
but this particular use slipped through somehow.

From-SVN: r209506
2014-04-17 23:27:31 +00:00
Ian Lance Taylor e315e8a5b9 gofrontend: avoid use of unsafe.Sizeof extension
Avoid the use of a gccgo language extension which allows unsafe.Sizeof
to accept a type by passing an expression of the relevant type.

From-SVN: r209503
2014-04-17 23:13:39 +00:00
Ian Lance Taylor 73cc28d4e7 libgo: Remove Solaris 8 & 9 support.
From Rainer Orth.

From-SVN: r209448
2014-04-16 20:33:57 +00:00
Ian Lance Taylor a10d35a8ba libgo: Update to Go 1.2.1 release.
From-SVN: r208286
2014-03-03 20:14:52 +00:00
Ian Lance Taylor 747639c28f re PR go/59430 (os/user FAILs on Solaris)
PR go/59430
os/user: Use POSIX functions on Solaris.

From-SVN: r206412
2014-01-08 01:08:29 +00:00
Ian Lance Taylor 71d0d50aa3 go/build: Set GOARCH on arm64 systems.
I am reliably informed that the architecture name and letter for the
plan9/inferno compilers for 64-bit ARM systems will be "arm64" and "7"
respectively, so let's get that bit in nice and early.

From Michael Hudson-Doyle.
https://codereview.appspot.com/34830045/

From-SVN: r206374
2014-01-06 19:24:23 +00:00
Ian Lance Taylor f89b66f5ad net: work around Solaris connect issue when server closes socket
On Solaris, if you do a in-progress connect, and then the
server accepts and closes the socket, the client's later
attempt to complete the connect will fail with EINVAL.  Handle
this case by assuming that the connect succeeded.  This code
is weird enough that it is implemented as Solaris-only so that
it doesn't hide a real error on a different OS.

See http://golang.org/issue/6828.

From-SVN: r206232
2013-12-28 18:00:30 +00:00
Ian Lance Taylor afc8adc88f re PR go/59506 (net FAILs (timeout) on alpha)
PR go/59506

net: use DialTimeout in TestSelfConnect

Backported from master repository.

This avoids problems with systems that take a long time to
find out nothing is listening, while still testing for the
self-connect misfeature since a self-connect should be fast.
With this we may be able to remove the test for non-Linux
systems.

Tested (on GNU/Linux) by editing selfConnect in
tcpsock_posix.go to always return false and verifying that
TestSelfConnect then fails with and without this change.

Idea from Uros Bizjak.

From-SVN: r206224
2013-12-27 21:42:26 +00:00
Uros Bizjak ce2b81bfce Revert unwanted commit.
From-SVN: r206201
2013-12-25 23:24:26 +01:00
Allan Sandfeld Jensen 74924838e8 re PR target/59422 (Support more targets for function multi versioning)
gcc/

2013-12-25  Allan Sandfeld Jensen  <sandfeld@kde.org>
	    H.J. Lu  <hongjiu.lu@intel.com>

	PR target/59422
	* config/i386/i386.c (get_builtin_code_for_version): Handle
	PROCESSOR_HASWELL, PROCESSOR_SILVERMONT, PROCESSOR_BTVER1,
	PROCESSOR_BTVER2, PROCESSOR_BDVER3 and PROCESSOR_BDVER4.
	Change priority of PROCESSOR_BDVER1 to P_PROC_XOP.
	(fold_builtin_cpu): Add "ivybridge", "haswell", "bonnell",
	"silvermont", "bobcat" and "jaguar" CPU names.  Add "sse4a",
	"fma4", "xop" and "fma" ISA names.

libgcc/

2013-12-25  Allan Sandfeld Jensen  <sandfeld@kde.org>
	    H.J. Lu  <hongjiu.lu@intel.com>

        PR target/59422
        * config/i386/cpuinfo.c (enum processor_types):  Add AMD_BOBCAT
	and AMD_JAGUAR.
	(enum processor_subtypes): Add AMDFAM15H_BDVER3, AMDFAM15H_BDVER4,
	INTEL_COREI7_IVYBRIDGE and INTEL_COREI7_HASWELL.
	(enum processor_features): Add  FEATURE_SSE4_A, FEATURE_FMA4,
	FEATURE_XOP and FEATURE_FMA.
	(get_amd_cpu): Handle AMD_BOBCAT, AMD_JAGUAR, AMDFAM15H_BDVER2 and
	AMDFAM15H_BDVER3.
	(get_intel_cpu): Handle INTEL_COREI7 and INTEL_COREI7_HASWELL.
        (get_available_features): Handle FEATURE_FMA, FEATURE_SSE4_A,
	FEATURE_FMA4 and FEATURE_XOP.

testsuite/

2013-12-25  Allan Sandfeld Jensen  <sandfeld@kde.org>

	PR target/59422
	* gcc.target/i386/funcspec-5.c (test_fma, test_xop, test_no_fma,
	test_no_xop, test_arch_corei7, test_arch_corei7_avx,
	test_arch_core_avx2, test_arch_bdver1, test_arch_bdver2,
	test_arch_bdver3, test_tune_corei7, test_tune_corei7_avx,
	test_tune_core_avx2, test_tune_bdver1, test_tune_bdver2 and
	test_tune_bdver3): New function prototypes.

From-SVN: r206200
2013-12-25 23:22:24 +01:00
Ian Lance Taylor ea56ff71a4 reflect: Fix MakeFunc returning float32 or float64 on 386.
From-SVN: r205932
2013-12-12 17:44:01 +00:00
Ian Lance Taylor 547a416879 compiler, reflect, runtime: Implement method values in reflect.
From-SVN: r205913
2013-12-12 01:08:52 +00:00
Ian Lance Taylor b1d137cf58 reflect, runtime: Let reflect.MakeFunc functions call recover.
From-SVN: r205908
2013-12-11 23:43:16 +00:00
Ian Lance Taylor df5d92ce0e reflect: Rename struct field to be consistent in assembler and Go.
From-SVN: r205555
2013-11-30 18:08:42 +00:00
Ian Lance Taylor 9c6230e90e reflect: Fix MakeFunc for 386 when returning a struct.
When a 386 function returns a struct, it needs to return using
an rtd instruction that pops the hidden struct parameter off
the stack.  That wasn't happening.

From-SVN: r205551
2013-11-30 17:14:50 +00:00
Ian Lance Taylor 815ca4d336 libgo: Update to current Go library.
From-SVN: r205426
2013-11-27 01:05:38 +00:00
Ian Lance Taylor 0fea993fa8 syscall: Set SizeofSockaddrAny to the value the go distribution uses
In particular this means that the names Getsockname returns are not
truncated to 26 characters.

Fixes issue 6829

https://codereview.appspot.com/31840043/

From-SVN: r205368
2013-11-25 22:54:05 +00:00
Ian Lance Taylor 6b05faddf0 syscall: Only call varargs libc functions from C code.
From-SVN: r205321
2013-11-24 02:38:28 +00:00
Ian Lance Taylor 41674b9fe4 reflect: Handle calls to functions that take or return empty structs
Fixes issue 6761

This simple change seems to work fine, slightly to my surprise.

This includes the tests I submitted to the main Go repository at
https://codereview.appspot.com/26570046

From-SVN: r205001
2013-11-19 02:30:03 +00:00
Ian Lance Taylor 01ef823cdd net: On Solaris use Darwin keepalive code.
From-SVN: r204819
2013-11-14 20:19:51 +00:00
Ian Lance Taylor eb50be04e9 go/build: Add all known gccgo architectures to list.
From-SVN: r204796
2013-11-14 18:16:59 +00:00
Ian Lance Taylor 9572918137 libgo/go/go/build: use syslist.go from the gc stdlib.
If cmd/go is rebuilt using -compiler gccgo the version of go/build that is linked into that cmd/go will not function properly as the list of file suffixes know as operating systems or architectures is incorrect.

From-SVN: r204794
2013-11-14 18:07:31 +00:00
Ian Lance Taylor 9544822809 net: Fix TCP keepalive handling for Solaris.
From-SVN: r204688
2013-11-11 21:25:42 +00:00
Ian Lance Taylor 3c450181dc mksysinfo, net: Always define F_DUPFD_CLOEXEC.
For Solaris and CentOS portability.

From-SVN: r204687
2013-11-11 21:21:50 +00:00
Ian Lance Taylor eb47f18904 os: Do not try to run go command in test.
From-SVN: r204684
2013-11-11 19:41:00 +00:00
Ian Lance Taylor f038dae646 libgo: Update to October 24 version of master library.
From-SVN: r204466
2013-11-06 19:49:01 +00:00
Ian Lance Taylor d5b18b0b13 syscall: Add Dup3, {Get,List,Remove,Set}xattr, {Get,Set}priority.
From-SVN: r203788
2013-10-17 18:41:12 +00:00
Ian Lance Taylor e3f6b60da9 reflect: Use C style comments in 386 assembly for Solaris assembler.
From Rainer Orth.

From-SVN: r203249
2013-10-07 15:32:08 +00:00
Ian Lance Taylor 8a2cb59f1c reflect: Fix calling Interface method on value created by MakeFunc.
From-SVN: r203212
2013-10-04 18:52:22 +00:00
Ian Lance Taylor cc1a9ac808 reflect: Use hand-coded .eh_frame section rather than CFI directives.
From Rainer Orth.

From-SVN: r203120
2013-10-02 17:30:07 +00:00
Ian Lance Taylor 2cb01a3972 reflect: Fix reflect.Call with function following non-pointer.
From-SVN: r203052
2013-10-01 03:12:15 +00:00
Ian Lance Taylor 5f18389f4d reflect: Copy stack values onto heap in amd64 MakeFunc.
From-SVN: r202995
2013-09-27 22:13:11 +00:00
Ian Lance Taylor a84dbde7fc reflect: Implement MakeFunc for 386.
From-SVN: r202993
2013-09-27 21:34:24 +00:00
Ian Lance Taylor 8bcd5487e5 reflect: Implement MakeFunc for amd64.
From-SVN: r202982
2013-09-27 17:53:46 +00:00
Ian Lance Taylor b15d794389 reflect: Fix bug calling method on indirect value.
The gccgo-specific iword function was checking v.kind, but for
a method value that is always Func.  Fix to check v.typ.Kind()
instead.

From-SVN: r202670
2013-09-17 22:11:43 +00:00
Ian Lance Taylor 05a7d56678 compiler, runtime: Use runtime functions to pass closure value.
This changes the compiler and runtime to not pass a closure
value as the last argument, but to instead pass it via
__go_set_closure and retrieve it via __go_get_closure.  This
eliminates the need for function descriptor wrapper functions.
It will make it possible to retrieve the closure value in a
reflect.MakeFunc function.

From-SVN: r202233
2013-09-03 21:52:37 +00:00
Ian Lance Taylor 537a6f7b47 net: give C.getaddrinfo a hint that we only want SOCK_STREAM answers
This should be more efficient everywhere, and appears to be
required on Solaris.

Copied from master repository.

From-SVN: r201637
2013-08-09 20:51:16 +00:00
Ian Lance Taylor 1b3dc031eb syscall: Change AWK split call to use []+ rather than []*.
Using []* fails with the awk that is part of busybox:
https://groups.google.com/d/msg/gofrontend-dev/NbQsG_AMDpY/sXCc03kkwn4J

From-SVN: r201455
2013-08-02 22:30:30 +00:00
Ian Lance Taylor f735ce315f net: Only use GNU/Linux unix socket abstract paths on GNU/Linux.
From-SVN: r201217
2013-07-24 16:53:17 +00:00
Ian Lance Taylor 017e07a118 net/http: Don't try to trace sendfile64 on alpha.
From Uros Bizjak.

From-SVN: r201206
2013-07-24 13:09:32 +00:00
Ian Lance Taylor 9d824f6c8f log/syslog: Restore interface to make this work on Solaris again.
From-SVN: r201188
2013-07-23 21:23:27 +00:00
Ian Lance Taylor da8091da1b net: Remove Solaris-specific version of listenerSockaddr.
Solaris will use the version in sock_unix.go.

From-SVN: r201183
2013-07-23 20:38:49 +00:00
Ian Lance Taylor be47d6ecef libgo: Update to Go 1.1.1.
From-SVN: r200974
2013-07-16 06:54:42 +00:00
Ian Lance Taylor fdbc38a6e8 compiler, runtime: Use function descriptors.
This changes the representation of a Go value of function type
from being a pointer to function code (like a C function
pointer) to being a pointer to a struct.  The first field of
the struct points to the function code.  The remaining fields,
if any, are the addresses of variables referenced in enclosing
functions.  For each call to a function, the address of the
function descriptor is passed as the last argument.

This lets us avoid generating trampolines, and removes the use
of writable/executable sections of the heap.

From-SVN: r200181
2013-06-18 23:49:49 +00:00
Ian Lance Taylor 73e0b984b3 runtime, testing/quick: libffi doesn't handle complex on Alpha.
From Uros Bizjak.

From-SVN: r196389
2013-03-01 19:26:43 +00:00
Ian Lance Taylor f46d686ef1 re PR go/56171 (syscall FAILs on Solaris)
PR go/56171
syscall: Solaris fixes for passing file descriptor.

From Rainer Orth.

From-SVN: r196180
2013-02-20 20:04:36 +00:00
Ian Lance Taylor d54fc07473 compiler, libgo: Permit testing package when test imports it circularly.
From-SVN: r195931
2013-02-10 06:02:38 +00:00
Ian Lance Taylor 540817f4ef syscall: Always use _C_int for C libcalls.
From-SVN: r195897
2013-02-08 19:24:26 +00:00
Ian Lance Taylor af4acefcd7 re PR go/56173 (Several libgo tests FAIL on Solaris/SPARC)
PR go/56173
crypto/md5: fix for big-endian processors

From-SVN: r195867
2013-02-07 21:40:10 +00:00
Ian Lance Taylor aa62fd35b5 re PR go/56172 (net FAILs on Solaris)
PR go/56172
net: Skip TestMulticastListener on Solaris

From Rainer Orth.

From-SVN: r195855
2013-02-07 17:04:24 +00:00
Ian Lance Taylor d617bce48c re PR go/56172 (net FAILs on Solaris)
PR go/56172
net: Fixes for select based pollster.

Make Close work properly, mainly for testing.  Restart the
select if a descriptor is closed.

From-SVN: r195823
2013-02-06 22:40:18 +00:00
Ian Lance Taylor 777133fefb libgo: Update Go library to master revision 15502/229081515358.
From-SVN: r195569
2013-01-30 01:37:13 +00:00
Ian Lance Taylor d6f2922e91 libgo: Update Go library to master revision 15489/921e53d4863c.
From-SVN: r195560
2013-01-29 20:52:43 +00:00
Ian Lance Taylor f6b1e65ec3 re PR go/46986 (Go is not supported on Darwin)
PR go/46986
all: prepend #__USER_LABEL_PREFIX__ to mangled Go symbols
For old-fashioned Darwin.

From-SVN: r195438
2013-01-24 19:44:23 +00:00
Ian Lance Taylor 72d1cef254 re PR go/46986 (Go is not supported on Darwin)
PR go/46986
libgo/Makefile, libgo/go/os/stat_atimespec.go: fix typos

From-SVN: r195436
2013-01-24 18:12:23 +00:00
Ian Lance Taylor 409a5e7eb4 libgo: Update to revision 15193:6fdc1974457c of master library.
From-SVN: r194692
2012-12-22 01:15:33 +00:00
Ian Lance Taylor 5c167ca0a2 compiler: Error if name defined in both package and file blocks.
From-SVN: r194685
2012-12-21 22:23:23 +00:00
Ian Lance Taylor a57bf4070a log/syslog: Solaris portability patches.
From-SVN: r194566
2012-12-17 21:07:27 +00:00
Ian Lance Taylor a42a906c42 libgo: Update to current master library sources.
From-SVN: r194460
2012-12-12 23:13:29 +00:00
Ian Lance Taylor 4d901dd735 os: Clean up directory reading code.
From-SVN: r194237
2012-12-06 02:00:13 +00:00
Ian Lance Taylor 03a6c305d3 syscall: Fix splice syscall.
From-SVN: r194185
2012-12-05 08:49:01 +00:00
Ian Lance Taylor 744c3195ef compiler, runtime: Track fields with tag go:"track".
* go-gcc.cc: Include "output.h".
	(global_variable): Add is_unique_section parameter.
	(global_variable_set_init): Adjust unique section if necessary.
	* Make-lang.in (go/go-gcc.o): Add dependency on output.h.

From-SVN: r193945
2012-11-29 18:11:17 +00:00
Ian Lance Taylor 40ff695f5c syscall: Fix handling of Unix domain @ addresses.
From-SVN: r193783
2012-11-24 20:46:59 +00:00
Ian Lance Taylor fabcaa8df3 libgo: Update to current version of master library.
From-SVN: r193688
2012-11-21 07:03:38 +00:00
Ian Lance Taylor a3ce4803ea reflect: Fix invalid sharing in valueInterface.
From-SVN: r193614
2012-11-19 05:34:08 +00:00
Ian Lance Taylor 86f2731e63 syscall: Force first letter of error message to lower case.
From-SVN: r193449
2012-11-12 19:34:52 +00:00
Ian Lance Taylor 7e03f00470 reflect: Fix bug comparing struct field types.
From-SVN: r193395
2012-11-10 20:24:04 +00:00
Ian Lance Taylor fb3f38da2a compiler, libgo: Fixes to prepare for 64-bit int.
From-SVN: r193254
2012-11-06 18:28:21 +00:00
Ian Lance Taylor ae0b23e2ff os: support more OSes
From-SVN: r193172
2012-11-05 17:36:40 +00:00
Ian Lance Taylor ff95e2ab0b syscall, mksysinfo: Prepare syscall package for 64-bit int.
From-SVN: r193112
2012-11-02 23:39:36 +00:00
Ian Lance Taylor 776f27a67f compiler, runtime: More steps toward separating int and intgo.
From-SVN: r193059
2012-11-01 03:02:13 +00:00
Ian Lance Taylor 85c2f96c1c syscall: fix creds_test to reliably close os.File
Uncovered by Uros Bizjak.

Before this patch the test would close the file descriptor but
not the os.File.  When the os.File was GC'ed, the finalizer
would close the file descriptor again.  That would cause
problems if the same file descriptor were returned by a later
call to open in another test.

On my system:

> GOGC=30 go test
--- FAIL: TestPassFD (0.04 seconds)
passfd_test.go:62: 	FileConn: dup: bad file descriptor
FAIL

From-SVN: r192854
2012-10-26 17:50:10 +00:00
Ian Lance Taylor f99a463f8a libgo: Solaris portability patches.
From Rainer Orth.

From-SVN: r192819
2012-10-25 18:26:34 +00:00
Ian Lance Taylor 8d672b2640 runtime: Disable crash tests that runs go tool.
From-SVN: r192735
2012-10-23 18:01:06 +00:00
Ian Lance Taylor 4ccad563d2 libgo: Update to current sources.
From-SVN: r192704
2012-10-23 04:31:11 +00:00
Ian Lance Taylor bd2e46c825 libgo: Update to Go 1.0.3.
From-SVN: r192025
2012-10-03 05:27:36 +00:00
Ian Lance Taylor 0e56e59065 libgo: Use libbacktrace rather than debug/elf registration.
From-SVN: r191831
2012-09-28 14:48:30 +00:00
Ian Lance Taylor a85cfff41d debug/elf, debug/dwarf: DWARF line number fixes.
Support DW_AT_high_pc as a constant.
Support DW_AT_ranges.

PR gcc/52583

From-SVN: r191008
2012-09-06 05:28:02 +00:00
Ian Lance Taylor c92900d1db compiler: Remove old handling of unsafe.Pointer in type assertions.
Fixes issue 17.

From-SVN: r190608
2012-08-23 00:20:48 +00:00
Ian Lance Taylor 1fae9801e4 runtime, runtime/pprof: Fix runtime/pprof test to pass, enable it.
From-SVN: r189878
2012-07-26 01:57:04 +00:00
Ian Lance Taylor 08a680a887 libgo: Update to Go 1.0.2 release.
From-SVN: r188943
2012-06-25 16:20:03 +00:00
Ian Lance Taylor c789c04510 compiler, reflect: Quote package path with tabs.
From-SVN: r188548
2012-06-14 05:04:04 +00:00
Ian Lance Taylor 73b5b93a59 os/user: Use Entersyscall.
From-SVN: r188496
2012-06-13 05:56:09 +00:00
Ian Lance Taylor 57d195e224 os: Use Entersyscall when reading directories.
From-SVN: r188494
2012-06-13 04:47:25 +00:00
Ian Lance Taylor 9690ac05c9 compiler, reflect: Handle package path like gc compiler.
From-SVN: r188482
2012-06-12 20:33:22 +00:00
Ian Lance Taylor 7bea4023f2 runtime: Better SWIG interface for allocating Go memory from C/C++.
From-SVN: r188164
2012-06-04 05:34:59 +00:00
Ian Lance Taylor eaca667ecf log/syslog: Fix name of C function syslog_c.
From Rainer Orth.

From-SVN: r187596
2012-05-16 14:52:03 +00:00
Ian Lance Taylor c39cbb22b0 debug/dwarf: Fix handling of LineSetFile.
From-SVN: r187578
2012-05-16 05:36:31 +00:00
Ian Lance Taylor f3ab5720f7 libgo: Use -fgo-pkgpath.
From-SVN: r187485
2012-05-14 22:08:42 +00:00
Ian Lance Taylor 33e337e34d libgo: Update to Go 1.0.1 release.
From-SVN: r187163
2012-05-04 15:01:11 +00:00
Ian Lance Taylor 81b9589421 re PR go/52586 (libgo fails to build for mips*64-linux-gnu (reference to undefined name 'SYS_GETDENTS64'))
PR go/52586
mksysinfo, syscall: Make sure SYS_GETDENTS64 is defined.

Fixes build on MIPS GNU/Linux.

From-SVN: r186986
2012-04-30 16:04:17 +00:00
Ian Lance Taylor 6c88c77ec7 re PR go/52358 (math FAILs on Solaris 8 and 9)
PR go/52358
math: Work around bug in Solaris 9 implementation of ldexp.

The bug is that ldexp(-1, -1075) should return -0, but the
Solaris 9 implementation returns +0.

From-SVN: r186913
2012-04-27 16:32:42 +00:00
Ian Lance Taylor 181c7267c7 mksysinfo, net: Always define syscall.SO_REUSEPORT.
From-SVN: r186857
2012-04-26 04:25:56 +00:00
Ian Lance Taylor 2b210b6f0b re PR go/52341 (crypto/rand FAILs before Solaris 11)
PR go/52341

crypto/rand: Use io.ReadFull when reading from /dev/urandom.

From-SVN: r186803
2012-04-25 04:40:49 +00:00
Ian Lance Taylor b685de12d2 re PR go/52583 (Several new go testsuite failues on Solaris)
PR go/52583

net: Solaris fixes.

In particular fix fd_select.go to handle the case where a file
descriptor is closed by one goroutine while another goroutine
is waiting for it.

From-SVN: r186801
2012-04-25 04:26:12 +00:00
Ian Lance Taylor 1ec20ea138 go-lang.c (go_langhook_init): Set MPFR precision to 256.
* go-lang.c (go_langhook_init): Set MPFR precision to 256.

time: Adjust float expression so that it first integer context.

From-SVN: r186727
2012-04-23 21:39:12 +00:00
Ian Lance Taylor f04e40afc1 mksysinfo: More fixes to emulate master Go library.
From-SVN: r186685
2012-04-22 20:07:23 +00:00
Ian Lance Taylor f12e8bd5c3 godump.c (go_output_typedef): Dump size of structs.
* godump.c (go_output_typedef): Dump size of structs.

mksysinfo, syscall: Change Sizeof names from var to const.

From-SVN: r186678
2012-04-22 18:51:44 +00:00
Ian Lance Taylor 1410c22260 syscall: Additional constants, some type corrections.
From-SVN: r186655
2012-04-21 18:49:58 +00:00
Ian Lance Taylor d25a12fc2d net, syscall: Use native endianness for GNU/Linux netlink code.
From-SVN: r186640
2012-04-20 20:11:28 +00:00
Ian Lance Taylor 0e27a180fd net/http: Ignore sigaltstack when running strace in test.
Avoids bug in strace 4.5.20 on powerpc-unknown-linux-gnu.

From-SVN: r186635
2012-04-20 18:51:05 +00:00
Ian Lance Taylor 76c0db7391 debug/dwarf: Fix address lookups for different types of lines.
This fixes the lookup when, e.g., discriminators force adding
new line arrays.

From-SVN: r186633
2012-04-20 18:44:09 +00:00
Ian Lance Taylor cf1f0eb7cc runtime: Disable memory profiling in gc_test.
From-SVN: r186631
2012-04-20 18:40:14 +00:00
Ian Lance Taylor ea8505da90 syscall, net: Fix GNU/Linux netlink code for big-endian systems.
From-SVN: r186123
2012-04-03 23:44:53 +00:00
Ian Lance Taylor a1552fc3ec libgo: Update to weekly.2012-03-27 aka go1 release.
From-SVN: r186029
2012-03-30 22:36:44 +00:00
Ian Lance Taylor 99002f8366 File removed in weekly.2012-03-22 release.
From-SVN: r186028
2012-03-30 22:14:14 +00:00
Ian Lance Taylor 9a18821cfc libgo: Update to weekly.2012-03-22.
From-SVN: r186026
2012-03-30 22:09:55 +00:00
Ian Lance Taylor 456fba2651 libgo: Update to weekly.2012-03-13.
From-SVN: r186023
2012-03-30 21:27:11 +00:00
Ian Lance Taylor e0be8a5c20 syscall: Convert errno to error after Exitsyscall.
From-SVN: r186020
2012-03-30 21:10:32 +00:00
Ian Lance Taylor a0c8ad3bdf compiler, libgo: unsafe.{Sizeof,Alignof,Offsetof} return uintptr.
From-SVN: r185946
2012-03-29 03:53:13 +00:00
Ian Lance Taylor 03934a5632 syscall: Fix errno handling in syscall.Syscall and friends.
From-SVN: r185746
2012-03-23 18:41:07 +00:00
Ian Lance Taylor 24aea58753 libgo: Export {enter,exit}syscall and use it for getaddrinfo.
From-SVN: r185363
2012-03-13 23:01:30 +00:00
Ian Lance Taylor 896977b38f debug/dwarf: Support DWARF versions 3 and 4.
From-SVN: r185126
2012-03-09 06:35:00 +00:00
Ian Lance Taylor 060b4284aa debug/elf: Don't crash if line numbers are not available.
From-SVN: r185124
2012-03-09 05:33:10 +00:00
Ian Lance Taylor 0effc3f961 libgo: Implement and use runtime.Caller, runtime.Func.FileLine.
From-SVN: r185025
2012-03-07 01:16:20 +00:00
Ian Lance Taylor 593f74bbab libgo: Update to weekly.2012-03-04 release.
From-SVN: r185010
2012-03-06 17:57:23 +00:00
Ian Lance Taylor 501699af16 libgo: Update to weekly.2012-02-22 release.
From-SVN: r184819
2012-03-02 20:01:37 +00:00
Ian Lance Taylor cbb6491d76 libgo: Update to weekly.2012-02-14 release.
From-SVN: r184798
2012-03-02 16:38:43 +00:00
Ian Lance Taylor b65734ac6c syscall: Fill out GNU/Linux support.
From-SVN: r184669
2012-02-29 20:02:31 +00:00
Ian Lance Taylor 5d46bf0538 libgo: Add mount flags, fallocate, statfs.
From-SVN: r184365
2012-02-18 01:22:02 +00:00
Ian Lance Taylor a64b24bdef re PR go/51874 (Many libgo testsuite failures on IRIX)
PR go/51874
math: Don't use libc log2 and trunc functions.

From-SVN: r184300
2012-02-16 07:17:03 +00:00
Ian Lance Taylor 2b120fe98e syscall: Change Dup2 to only return an error.
From-SVN: r184222
2012-02-14 19:36:31 +00:00
Ian Lance Taylor 09578bcd52 net: Don't run UDP multicast tests on Alpha GNU/Linux.
From Uros Bizjak.

From-SVN: r184187
2012-02-14 00:30:12 +00:00
Ian Lance Taylor 14e50d352e sync/atomic: Disable tests which can't run based on pointer size.
From-SVN: r184136
2012-02-12 05:57:02 +00:00
Ian Lance Taylor 1fd5b9687e os: Fix Solaris stat functions.
From Rainer Orth.

From-SVN: r184065
2012-02-09 18:07:43 +00:00
Ian Lance Taylor 94252f4bcc libgo: Update to weekly.2012-02-07.
From-SVN: r184034
2012-02-09 08:19:58 +00:00
Ian Lance Taylor 09839cde4c os: Fix typo in //extern comment.
From-SVN: r184023
2012-02-08 22:21:04 +00:00
Ian Lance Taylor b806269c9b compiler, libgo: Use //extern comments rather than __asm__.
From-SVN: r183981
2012-02-07 19:26:30 +00:00
Ian Lance Taylor 4631101689 compiler, reflect: Fix hash codes of named types, fix PtrTo hash.
From-SVN: r183889
2012-02-04 01:41:24 +00:00
Ian Lance Taylor 10f5ffa4e9 syscall: Add syscall.Times.
From-SVN: r183826
2012-02-02 06:40:11 +00:00
Ian Lance Taylor 7c275c4339 os/exec: Make sure file descriptor is not closed early.
From-SVN: r183815
2012-02-01 20:47:15 +00:00
Ian Lance Taylor 9af4cb9545 libgo: Update to weekly.2012-01-27.
From-SVN: r183810
2012-02-01 19:26:59 +00:00
Ian Lance Taylor 7d18953823 syscall: Add Gettid on GNU/Linux systems.
From-SVN: r183775
2012-01-31 20:47:55 +00:00
Ian Lance Taylor e8738e985e syscall: Don't use PtraceRegs if it is not defined.
From-SVN: r183758
2012-01-31 14:23:07 +00:00
Ian Lance Taylor 4a1a859611 syscall: Support socket control messages.
From-SVN: r183745
2012-01-30 23:57:42 +00:00
Ian Lance Taylor af5c13eb04 syscall: Define IPV6 constants for Irix.
From Rainer Orth.

From-SVN: r183652
2012-01-27 22:37:14 +00:00
Ian Lance Taylor eb6a1fe097 libgo: Fix merge errors shown on Solaris.
From Rainer Orth.

From-SVN: r183651
2012-01-27 22:34:53 +00:00
Ian Lance Taylor af92e38566 libgo: Update to weekly.2012-01-20.
From-SVN: r183540
2012-01-25 21:54:22 +00:00
Ian Lance Taylor df1304ee03 libgo: Update to weekly.2012-01-15.
From-SVN: r183539
2012-01-25 20:56:26 +00:00
Ian Lance Taylor b1b3aec1b1 compiler: Give an error if a variable is defined but not used.
From-SVN: r183458
2012-01-23 23:55:31 +00:00
Ian Lance Taylor 4cce1836bd libgo: Only build iopl and ioperm on 386, amd64, alpha GNU/Linux.
From-SVN: r183171
2012-01-13 23:35:44 +00:00
Ian Lance Taylor df4aa89a5e libgo: Update to weekly.2011-12-22.
From-SVN: r183150
2012-01-13 05:11:45 +00:00
Ian Lance Taylor 9a0e3259f4 libgo: Update to weekly.2011-12-14.
From-SVN: r183118
2012-01-12 01:31:45 +00:00
Ian Lance Taylor e44d7e3917 syscall: Don't define IPMreq in socket_irix.go.
From Rainer Orth.

From-SVN: r182549
2011-12-20 18:17:21 +00:00
Ian Lance Taylor d48be5dfaf libgo: Fix use of -D_GNU_SOURCE and friends when building libgo.
From-SVN: r182548
2011-12-20 18:14:30 +00:00
Ian Lance Taylor a84bd8ba19 os: Fix fileInfoFromStat for Solaris.
From Rainer Orth.

From-SVN: r182402
2011-12-16 14:45:49 +00:00
Ian Lance Taylor 5f8090a435 syscall: Move Errno into its own file, for RTEMS.
From-SVN: r182356
2011-12-15 07:12:03 +00:00
Ian Lance Taylor d536359059 libgo: Update to weekly.2011-12-06.
From-SVN: r182338
2011-12-14 15:41:54 +00:00
Ian Lance Taylor 9532fecfc5 runtime: Bump memory limit in gc_test.
From-SVN: r182332
2011-12-14 14:54:32 +00:00
Ian Lance Taylor 90a9ea010a runtime: Change gc_test to test only newly allocated memory.
From-SVN: r182315
2011-12-13 23:15:36 +00:00
Ian Lance Taylor de05aad683 syscall: Don't build wait status functions on RTEMS.
From-SVN: r182313
2011-12-13 22:07:25 +00:00
Ian Lance Taylor 9dadf3bf5e libgo: Solaris compatibility patches.
From Rainer Orth.

From-SVN: r182296
2011-12-13 19:18:34 +00:00
Ian Lance Taylor 7b1c3dd9e6 libgo: Update to weekly.2011-12-02.
From-SVN: r182295
2011-12-13 19:16:27 +00:00
Ian Lance Taylor ab61e9c4da libgo: Update to weekly.2011-11-18.
From-SVN: r182266
2011-12-12 23:40:51 +00:00
Ian Lance Taylor fe4bf59fb6 net/http: delete temporary files.
From-SVN: r182256
2011-12-12 18:45:08 +00:00
Ian Lance Taylor 9820d09c26 syslog: Fix name of C syslog function.
From Rainer Orth.

From-SVN: r182168
2011-12-09 16:46:44 +00:00
Ian Lance Taylor c19bd76920 libgo: Add back tests of syscall time.
From-SVN: r182075
2011-12-07 01:55:49 +00:00
Ian Lance Taylor 598fd331d0 libgo: Remove debug/proc, os.Error.
From-SVN: r182074
2011-12-07 01:21:57 +00:00
Ian Lance Taylor 9c63abc9a1 libgo: Update to weekly 2011-11-09.
From-SVN: r182073
2011-12-07 01:11:29 +00:00
Ian Lance Taylor 6c025f46f0 libgo: Remove more os.Error cases.
From Rainer Orth.

From-SVN: r182060
2011-12-06 18:13:04 +00:00
Ian Lance Taylor 2fd401c8f1 libgo: Update to weekly.2011-11-02.
From-SVN: r181964
2011-12-03 02:17:34 +00:00
Ian Lance Taylor 506cf9aaea libgo: Update to weekly.2011-11-01.
From-SVN: r181938
2011-12-02 19:34:41 +00:00
Ian Lance Taylor b740cb6335 libgo: update to weekly.2011-10-25
Changes were mainly straightforward to merge.

From-SVN: r181824
2011-11-29 23:02:54 +00:00
Ian Lance Taylor 737087cbc8 runtime: Multiplex goroutines onto OS threads.
From-SVN: r181772
2011-11-28 05:45:49 +00:00
Ian Lance Taylor f58abe3caa syscall: Remove Linux system calls not available in older glibcs.
From-SVN: r180784
2011-11-02 17:53:20 +00:00
Ian Lance Taylor c417a082ea exp/terminal: Use tcgetattr/tcsetattr rather than ioctl.
From-SVN: r180780
2011-11-02 16:50:10 +00:00