aboutsummaryrefslogtreecommitdiff
path: root/libgo
AgeCommit message (Collapse)AuthorFilesLines
2016-01-11re PR go/68980 (ps -o cmd in gotest isn't portable)Ian Lance Taylor1-1/+1
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
2015-12-18syscall: Add definition for NLA_HDRLENIan Lance Taylor1-3/+10
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-11-26re PR go/61303 (gccgo: segfault, regression since 4.8.2)Ian Lance Taylor1-6/+10
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-23re PR go/68496 ([libgo] reflect test fails on Linux x86-64)Ian Lance Taylor1-0/+6
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-21re PR go/66378 (libgo syscall.Sendfile() does not honor/use offset argument)Ian Lance Taylor2-0/+2
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-21re PR go/65785 (libgo TestIPv4MulticastListener test fails on machine with ↵Ian Lance Taylor1-2/+2
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-21re PR go/66574 (Time is provided in millisecond precision instead of ↵Ian Lance Taylor3-5/+62
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-20re PR go/68072 (malformed DWARF TagVariable entry)Ian Lance Taylor1-0/+5
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-20cmd: Use correct install tool dir with gccgoIan Lance Taylor2-2/+27
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-10libgo: use Solaris sendfile lib, fix Solaris _in6_addr_t fieldsIan Lance Taylor3-0/+63
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-10re PR go/68255 (cgo-generated constructor not being called)Ian Lance Taylor1-10/+2
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-07re PR go/66138 (json decoder Decode function fails for some structure return ↵Ian Lance Taylor7-18/+47
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-06libgo: Solaris portability fixes.Ian Lance Taylor9-37/+63
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-04gotest: fix handling of --goarch optionIan Lance Taylor3-17/+7
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-03mksysinfo.sh: Make sure that CLONE_NEWUSER is defined.Ian Lance Taylor1-0/+5
Reviewed-on: https://go-review.googlesource.com/16588 From-SVN: r229711
2015-11-02libgo: Bump version number.Ian Lance Taylor2-2/+2
Reviewed-on: https://go-review.googlesource.com/16583 From-SVN: r229686
2015-11-02mksysinfo.sh: Handle TIOCGPGRP if too complex for -dump-go-spec.Ian Lance Taylor1-0/+8
Reviewed-on: https://go-review.googlesource.com/16580 From-SVN: r229676
2015-11-02syscall: Change raw_ioctl cmd type to uintptr.Ian Lance Taylor1-2/+2
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-01mksysinfo.sh: Handle TIOCSPGRP if too complex for -fdump-go-spec.Ian Lance Taylor1-0/+8
Reviewed-on: https://go-review.googlesource.com/16534 From-SVN: r229645
2015-10-31runtime: If no split stacks, allocate stacks using mmap on 64-bit systems.Ian Lance Taylor1-2/+15
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-31libgo: Update from Go 1.5 to Go 1.5.1.Ian Lance Taylor15-16/+89
Reviewed-on: https://go-review.googlesource.com/16527 From-SVN: r229624
2015-10-31runtime: Remove now unnecessary pad field from ParFor.Ian Lance Taylor1006-30196/+86205
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-29compiler, reflect, runtime: remove zero field from type descriptorIan Lance Taylor4-23/+3
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-29compiler, runtime: change type hash/equal to Go funcsIan Lance Taylor19-37/+111
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-09Testsuite: add dg-{begin|end}-multiline-output commandsDavid Malcolm1-0/+1
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-07re PR go/67874 (fd_unix.go does not build when there is fcntl64 and no fcntl ↵Ian Lance Taylor2-1/+33
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-09-24runtime: Fix recent lfstack change on Solaris.Ian Lance Taylor1-1/+1
Reviewed-on: https://go-review.googlesource.com/14922 From-SVN: r228087
2015-09-23re PR go/67695 (Please improve POSIX shell compatibility of libgo/mksysinfo.sh)Ian Lance Taylor1-1/+1
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-23runtime: rewrite lfstack packing/unpacking to look more like that in GoIan Lance Taylor1-21/+37
Reviewed-on: https://go-review.googlesource.com/13037 From-SVN: r228057
2015-09-15libgo: If compiler can split-stack and linker can not, use -fno-split-stack.Ian Lance Taylor5-4/+23
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-15libgo: test linking split-stack and non-split-stack togetherIan Lance Taylor2-4/+53
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-15runtime: Ignore stack sizes when deciding when to GC.Ian Lance Taylor1-1/+1
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-15libgo: don't provide ustat on arm64 GNU/LinuxIan Lance Taylor7-209/+357
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-11libgo/runtime: return 0, not NULL, from mainIan Lance Taylor1-1/+1
Reviewed-on: https://go-review.googlesource.com/13421 From-SVN: r227673
2015-09-10libgo: Use stat_atim.go on Solaris 12+Ian Lance Taylor4-3/+42
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-08-20libgo/testsuite: another fix for killing the sleep processIan Lance Taylor1-3/+6
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-07libgo/testsuite: don't call kill without argsIan Lance Taylor1-1/+4
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-04runtime: initialize variable to avoid compiler warningIan Lance Taylor1-1/+1
Reviewed-on: https://go-review.googlesource.com/13095 From-SVN: r226543
2015-08-03syscall: RawSockaddr fix for ppc64, ppc64leIan Lance Taylor5-5/+44
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-03libgo/testsuite: kill sleep process in gotestIan Lance Taylor1-1/+1
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-03re PR go/67101 (mprof.goc:408:5: error: calling ↵Ian Lance Taylor1-3/+1
‘__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-07-29syscall: Fix to libgo/mksysinfo.shIan Lance Taylor1-3/+3
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-25syscall: Add ioctl consts from if_tun.hIan Lance Taylor1-0/+187
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-14compiler,runtime: Determine if allocations need new pointers in runtime.Ian Lance Taylor1-9/+2
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-13syscall: remove calls to Entersyscall & Exitsyscall in GetdentsIan Lance Taylor1-2/+0
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-05-16libgo: Use __USING_SJLJ_EXCEPTIONS__ rather than configure test.Ian Lance Taylor4-121/+3
From Eric Botcazou. From-SVN: r223231
2015-05-11runtime: Fix runtime/pprof test when libgo is not optimized.Ian Lance Taylor1-3/+3
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-05re PR go/66016 (Accessing nil Func's name results in crash)Ian Lance Taylor1-0/+2
PR go/66016 runtime: Don't crash in Func.Name if the Func is nil. Related to Go issue 10696 From-SVN: r222816
2015-04-29runtime: Support -buildmode=c-shared.Ian Lance Taylor7-8/+333
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-24re PR go/65616 (libgobegin.a not compiled with -fPIC)Ian Lance Taylor2-13/+36
PR go/65616 libgo: Compile go-main, in libgobegin, with -fPIC. From-SVN: r222431