Commit Graph

722 Commits

Author SHA1 Message Date
Ian Lance Taylor 5ea350d1d7 libgo: update to 1.15.6 release
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/276153
2020-12-08 14:01:04 -08:00
Ian Lance Taylor 9121f80841 syscall: don't use AF_LINK on hurd
Patch from Svante Signell.

Fixes PR go/98153

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/275939
2020-12-07 17:08:48 -08:00
Ian Lance Taylor eafb46ce90 internal/cpu: don't define CacheLinePadSize for mips64x
For libgo the definition comes from the generated file cpugen.go.

Fixes PR go/98041

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/273866
2020-11-30 12:24:17 -08:00
Ian Lance Taylor 9ebad4b01c compiler, runtime: check len/cap for append(s, make(T, l)...)
The overflow checks done in growslice always reported an error for the
capacity argument, even if it was the length argument that overflowed.
This change lets the code pass the current issue4085b.go test.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/273806
2020-11-30 12:22:14 -08:00
Ian Lance Taylor bcbde431aa log/syslog: correct asm name for C function
Patch from Rainer Orth.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/272259
2020-11-23 08:14:20 -08:00
Ian Lance Taylor dec42fe4e3 libgo: update to Go 1.15.5 release
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/272146
2020-11-20 17:09:30 -08:00
Ian Lance Taylor a01dda3c23 compiler, libgo: change mangling scheme
Overhaul the mangling scheme to avoid ambiguities if the package path
contains a dot. Instead of using dot both to separate components and
to mangle characters, use dot only to separate components and use
underscore to mangle characters.

For golang/go#41862

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/271726
2020-11-20 12:44:35 -08:00
Ian Lance Taylor 397654d66a cmd/go, cmd/cgo: update gofrontend mangling checks
This is a port of two patches in the master repository.

https://golang.org/cl/259298

    cmd/cgo: split gofrontend mangling checks into cmd/internal/pkgpath

    This is a step toward porting https://golang.org/cl/219817 from the
    gofrontend repo to the main repo.

    Note that this also corrects the implementation of the v2 mangling
    scheme to use ..u and ..U where appropriate.

https://golang.org/cl/259299

    cmd/go: use cmd/internal/pkgpath for gccgo pkgpath symbol

For golang/go#37272
For golang/go#41862

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/270637
2020-11-17 18:32:07 -08:00
Ian Lance Taylor cf392dbdf1 libgo: update to Go 1.15.4 release
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/268177
2020-11-10 07:25:32 -08:00
Nikhil Benesch 0cdde1e7ae libgo: handle linking to NetBSD's versioned symbols
On NetBSD, for backwards compatibility, various libc symbols are
renamed to a symbol with a version suffix. For example, this is the
(abbreviated) definition of sigaction:

    int sigaction(...) __asm__ ("__sigaction14")

This poses a challenge for libgo, which attempts to link sigaction by
way of an "//extern" comment:

    //extern sigaction
    func sigaction(...)

This results in a reference to the deprecated compatibility symbol
"sigaction", rather than the desired "__sigaction14" symbol.

This patch introduces a new "//extern-sysinfo" comment to handle this
situation. The new mklinknames.awk script scans a package for these
comments and outputs a "//go:linkname" directive that links the wrapper
to the correct versioned symbol, as determined by parsing the __asm__
annotation on the function's declaration in gen-sysinfo.go.

For now, only the following packages are scanned by mklinknames.awk:

    os
    os/user
    runtime
    syscall

gotools/:
	* Makefile.am (check-runtime): Add runtime_linknames.go to
	--extrafiles.
	* Makefile.in: Regenerate.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/265125
2020-10-28 18:20:50 -07:00
Ian Lance Taylor dfbadb8ce9 syscall: don't build libcall_bsd.go on solaris
This new file was based on master sources that are built for *BSD
but not Solaris

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/266017
2020-10-28 12:18:01 -07:00
Ian Lance Taylor 668894d7b5 libgo: update to Go 1.15.3 release
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/265717
2020-10-27 13:58:02 -07:00
Ian Lance Taylor b7ac5fdbe7 compiler, go/internal/gccgoimporter: export notinheap annotation
This is the gofrontend version of https://golang.org/cl/259297.
This is required now because that change is in the 1.15.3 release.

This requires changing the go/internal/gccgoimporter package, to skip
the new annotation. This change will need to be ported to the gc and
x/tools repos.

For golang/go#41761

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/265258
2020-10-27 11:03:11 -07:00
Nikhil Benesch a573530d50 syscall: import additional BSD-specific syscall wrappers
Import additional code from upstream for handing system
calls on BSD systems. This makes the syscall package on
NetBSD complete enough to compile the standard library.

Updates golang/go#38538.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/265123
2020-10-26 15:04:16 -07:00
Nikhil Benesch 27f7ab27d1 net/http/cgi: merge upstream changes to default env vars
Incorporate upstream modifications to the cgi package's set of rules
about which environment variables should be inherited by child processes
by default on each platform. In particular this permits tests to pass on
NetBSD by preserving the value of the LD_LIBRARY_PATH environment
variable.

This is a partial backport of the following upstream CLs:

    https://golang.org/cl/263802
    https://golang.org/cl/263577
    https://golang.org/cl/254740

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/264097
2020-10-23 16:55:57 -07:00
Nikhil Benesch 439407aa2c syscall: only compile ptrace varargs shim on Linux
Only compile the __go_ptrace varargs shim on Linux to avoid compilation
failures on some other platforms. The C ptrace function is not entirely
portable (e.g., NetBSD has `int data` instead of `void* data`), and so
far Linux is the only platform that needs the varargs shim.

Additionally, make the types in the ptrace and raw_ptrace function
declarations match. This makes it more clear that the only difference
between the two is that calls via the former are allowed to block while
calls via the latter are not.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/263517
2020-10-21 22:29:04 -07:00
Nikhil Benesch 2ab1fc7a32 syscall: import upstream code for BSD sockets and sysctls
Import some missing upstream code for BSD sockets and sysctls and
adapt it for gccgo.

Updates golang/go#38538.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/261137
2020-10-21 16:57:59 -07:00
Nikhil Benesch 522307281c syscall: remove Sendfile on NetBSD
NetBSD does not support the sendfile syscall.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/263521
2020-10-20 10:57:10 -07:00
Nikhil Benesch dc570700be libgo: export NetBSD-specific types in mksysinfo.sh
The syscall package depends on many NetBSD-specific types on NetBSD.
Teach mksysinfo.sh to export these types.

This alone is not sufficient to get the syscall package to compile on
NetBSD, but it's a start.

Note that the IfMsgHdr type is recapitalized to IfMsghdr, which requires
changes in the AIX port. The new capitalization is what's used by
upstream in existing NetBSD-specific code and is more consistent with
the capitalization of other C structs with the "hdr" suffix.

Updates golang/go#38538.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/261739
2020-10-14 13:56:01 -07:00
Nikhil Benesch ca56d57624 runtime: correct semaphore implementation on netbsd
NetBSD's semaphores use the underlying lighweight process mechanism
(LWP) on NetBSD, rather than pthreads. This means the m.prodcid needs
to be set to the LWP ID rather than the pthread ID in order for unpark
notifications to get sent to the right place.

Introduce a new getProcID() method that selects the correct ID for the
platform.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/261742
2020-10-14 13:56:01 -07:00
Nikhil Benesch 7355c1df55 syscall: port fix for netbsd unix sockets from upstream
NetBSD does not include the null terminator when in its reported socket
length. Port the upstream bugfix for the issue (#6627).

This was likely missed during the usual upstream merge because the gc
and gccgo socket implementations have diverged quite a bit.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/261741
2020-10-13 22:19:35 -07:00
Clément Chigot 72b3833822 reflect: ensure uniqueness of type descriptors on AIX.
On AIX, duplication of type descriptors can occur if one is
declared in the libgo and one in the Go program being compiled.
The AIX linker isn't able to merge them together as Linux one does.
One solution is to always load libgo first but that needs a huge mechanism in
gcc core. Thus, this patch ensures that the duplication isn't visible
for the end user.

In reflect and internal/reflectlite, the comparison of rtypes is made on their
name and not only on their addresses.

In reflect, toType() function is using a canonicalization map to force rtypes
having the same rtype.String() to return the same Type. This can't be made in
internal/reflectlite as it needs sync package. But, for now, it doesn't matter
as internal/reflectlite is not widely used.

Fixes golang/go#39276

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/260158
2020-10-13 17:54:37 -07:00
Ian Lance Taylor 3e52eaab8c compiler: set varargs correctly for type of method expression
Fixes golang/go#41737

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/258977
2020-10-01 16:10:17 -07:00
Maciej W. Rozycki 2c5499b57c libgo: add 32-bit RISC-V (RV32) support
Add support for the 32-bit RISC-V (RV32) ISA matching the 64-bit RISC-V
(RV64) port except for async preemption added as a stub only.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/251179
2020-09-30 19:47:48 -07:00
Ian Lance Taylor 9042b6605c net: add hurd build tag
Patch from Svante Signell.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/257857
2020-09-28 16:16:54 -07:00
Ian Lance Taylor 10a83805e0 libgo: update to Go1.15.2 release
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/256618
2020-09-23 17:32:49 -07:00
Clément Chigot e884ced052 syscall: fix TestForeground for AIX
Syscall function can't be used on AIX. Therefore, Ioctl in
TestForeground must call raw_ioctl.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/175080
2020-09-22 20:07:34 -07:00
Clément Chigot 1260f69aeb syscall: remove ptrace syscall on ppc64
ptrace is available only for 32 bits programs.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/252558
2020-09-22 19:55:34 -07:00
Clément Chigot 63cd53d2f5 runtime, net: fix build errors on AIX
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/235158
2020-09-22 17:29:52 -07:00
Clément Chigot be3027e9c8 go/internal/gccgoimporter: recognize aixbigafMagic archives
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/255201
2020-09-21 15:42:00 -07:00
Paul E. Murphy c560591408 libgo: fix ptrace syscall hooks into glibc
ptrace is actually declared as a variadic function.  On ppc64le
the ABI requires to the caller to allocate space for the parameters
and allows the caller to modify them.

On ppc64le, depending on how and what version of GCC is used,
it will save to parameter save area.  This happened to clobber
a saved LR, and caused syscall.TestExecPtrace to fail with a timeout
when the tracee segfaults, and waits for the parent process to inspect.

Wrap this function to avoid directly calling glibc's ptrace from go.

Fixes golang/go#36698
Fixes go/92567

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/254755
2020-09-17 12:14:09 -07:00
Clément Chigot 0c223b02b6 cmd: add -maix32 to gcc calls for aix/ppc
As gcc might now be compiled in 64bit, -maix32 must always be added
to ensure that created objects will be 32bit.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/250778
2020-08-26 16:29:03 -07:00
Ian Lance Taylor 8f9fd3c4ee internal/syscall/unix: restore ppc build tag
It was accidentally lost in the 1.15rc1 merge.

Fixes PR go/96567

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/247843
2020-08-11 12:28:46 -07:00
Clément Chigot f4b9b13680 runtime: revert eqtype for AIX
AIX linker is not able to merge identical type descriptors in a single
symbol if there are coming from different object or shared object files.
This results into several pointers referencing the same type
descriptors.
Thus, eqtype is needed to ensure that these different symbols will be
considered as the same type descriptor.

Fixes golang/go#39276

gcc/go/ChangeLog:

	* go-c.h (struct go_create_gogo_args): Add need_eqtype field.
	* go-lang.c (go_langhook_init): Set need_eqtype.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/235697
2020-08-10 16:45:16 -07:00
Ian Lance Taylor 10c8507372 libgo: update to Go1.15rc2 release
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/247517
2020-08-07 17:22:33 -07:00
Ian Lance Taylor 76eb0434a4 internal/syscall/unix: correct ia64 syscall numbers
Per Andreas Schwab.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/246264
2020-08-03 11:03:40 -07:00
Ian Lance Taylor d8ea6acb5f internal/syscall/unix: define copyFileRangeTrap for all architectures
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/246363
2020-08-03 10:12:31 -07:00
Ian Lance Taylor f75af8c146 libgo: update to go1.15rc1
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/245157
2020-08-01 11:21:40 -07:00
Ian Lance Taylor 108fdcc56e compiler,runtime: pass only ptr and len to some runtime calls
This ports https://golang.org/cl/227163 to the Go frontend.
This is a step toward moving up to the go1.15rc1 release.

Original CL description:

    cmd/compile,runtime: pass only ptr and len to some runtime calls

    Some runtime calls accept a slice, but only use ptr and len.
    This change modifies most such routines to accept only ptr and len.

    After this change, the only runtime calls that accept an unnecessary
    cap arg are concatstrings and slicerunetostring.
    Neither is particularly common, and both are complicated to modify.

    Negligible compiler performance impact. Shrinks binaries a little.
    There are only a few regressions; the one I investigated was
    due to register allocation fluctuation.

    Passes 'go test -race std cmd', modulo golang/go#38265 and golang/go#38266.
    Wow, does that take a long time to run.

    file      before    after     Δ       %
    compile   19655024  19655152  +128    +0.001%
    cover     5244840   5236648   -8192   -0.156%
    dist      3662376   3658280   -4096   -0.112%
    link      6680056   6675960   -4096   -0.061%
    pprof     14789844  14777556  -12288  -0.083%
    test2json 2824744   2820648   -4096   -0.145%
    trace     11647876  11639684  -8192   -0.070%
    vet       8260472   8256376   -4096   -0.050%
    total     115163736 115118808 -44928  -0.039%

For golang/go#36890

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/245099
2020-07-27 17:05:17 -07:00
Ian Lance Taylor d5dfd4793f libgo: update to Go 1.14.6 release
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/243317
2020-07-17 14:28:28 -07:00
Ian Lance Taylor 2b6d99468d libgo: update to Go 1.14.4 release
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/241999
2020-07-10 11:30:23 -07:00
Tobias Klauser 882af4350b libgo: update x/sys/cpu to add all GOARCHes supported by gccgo
CL 237897 added additional GOARCHes supported by gccgo to x/sys/cpu.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/238038
2020-06-15 14:20:07 -07:00
Tobias Klauser 47ad09cb08 internal/syscall/unix: use getrandom_linux_generic.go on riscv
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/237899
2020-06-15 12:00:12 -07:00
Clément Chigot 75452d6867 runtime: fix arenaBaseOffset for aix/ppc
The arenaBaseOffset modifications was aimed only for aix/ppc64.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/237038
2020-06-12 16:30:53 -07:00
Clément Chigot adad99eb90 libgo: update x/sys/cpu after gccgo support added
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/234597
2020-05-25 13:43:44 -07:00
eric fang 5ca5751823 runtime: fix TestCallersNilPointerPanic
The expected result of TestCallersNilPointerPanic has changed in
GoLLVM.  This CL makes some elements of the expected result optional
so that this test passes in both gccgo and GoLLVM.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/230138
2020-05-11 17:36:24 -07:00
Ian Lance Taylor 4f157ed774 syscall: append to environment in tests, don't clobber it
This is a partial backport of https://golang.org/cl/233318.
It's only a partial backport because part of the change was
already applied to libgo in CL 193497 as part of the update
to the Go 1.13beta1 release.

Fixes PR go/95061

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/233359
2020-05-11 17:27:46 -07:00
Benny Siegert 8e841bd419 gccgo: fix runtime compilation on NetBSD
si_code in siginfo_t is a macro on NetBSD, not a member of the
struct itself, so add a C trampoline for receiving its value.

Also replace references to mos.waitsemacount with the replacement and
add some helpers from os_netbsd.go in the GC repository.

Update golang/go#38538.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/228918
2020-04-20 21:20:53 -07:00
Ian Lance Taylor d79a22eddc libgo: update to final 1.14.2 release
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/227551
2020-04-09 20:14:25 -07:00
Ian Lance Taylor 52fa80f853 libgo: update to almost the 1.14.2 release
Update to edea4a79e8d7dea2456b688f492c8af33d381dc2 which is likely to
be approximately the 1.14.2 release.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/227377
2020-04-06 16:37:24 -07:00