aboutsummaryrefslogtreecommitdiff
path: root/libgo
AgeCommit message (Collapse)AuthorFilesLines
2020-11-23log/syslog: correct asm name for C functionIan Lance Taylor1-1/+1
Patch from Rainer Orth. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/272259
2020-11-20libgo: update to Go 1.15.5 releaseIan Lance Taylor8-7/+311
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/272146
2020-11-20compiler, libgo: change mangling schemeIan Lance Taylor45-231/+341
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-17cmd/go, cmd/cgo: update gofrontend mangling checksIan Lance Taylor7-130/+275
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-10libgo: update to Go 1.15.4 releaseIan Lance Taylor16-28/+266
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/268177
2020-10-28libgo: handle linking to NetBSD's versioned symbolsNikhil Benesch15-34/+197
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-28syscall: don't build libcall_bsd.go on solarisIan Lance Taylor1-1/+1
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-27libgo: update to Go 1.15.3 releaseIan Lance Taylor26-187/+365
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/265717
2020-10-27compiler, go/internal/gccgoimporter: export notinheap annotationIan Lance Taylor1-0/+7
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-26syscall: import additional BSD-specific syscall wrappersNikhil Benesch2-0/+141
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-23net/http/cgi: merge upstream changes to default env varsNikhil Benesch1-3/+3
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-21syscall: only compile ptrace varargs shim on LinuxNikhil Benesch13-18/+17
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-21syscall: import upstream code for BSD sockets and sysctlsNikhil Benesch3-1/+103
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-20libgo: adjust NetBSD-specific types for stable syscall APINikhil Benesch1-3/+15
The backwards-compatibility guarantees of the syscall package require some munging of the C API inferred by mksysinfo.sh. Specifically, the RTM_RESOLVE constant must be added if it is missing, and the stat_t struct must use the suffix "timespec" rather than "tim" for its time-related fields. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/263519
2020-10-20syscall: remove Sendfile on NetBSDNikhil Benesch2-3/+3
NetBSD does not support the sendfile syscall. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/263521
2020-10-15runtime: use correct types in __go_ptrace shimNikhil Benesch1-1/+1
Make the types of the addr and data arguments in the __go_ptrace shim match the types declared in Go and the types declared by the C ptrace function, i.e., void*. This avoids a warning about an implicit int-to-pointer cast on some platforms. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/262340
2020-10-15libgo: correct Makefile typo in path to x/net/route packageNikhil Benesch2-2/+2
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/262342
2020-10-14libgo: print reason code if throwing unwind exception failsNikhil Benesch1-5/+9
Calls to _Unwind_RaiseException and friends *can* return due to bugs in libgo or memory corruption. When this occurs, print a message to stderr with the reason code before aborting to aid debugging. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/261257
2020-10-14libgo: export NetBSD-specific types in mksysinfo.shNikhil Benesch6-15/+195
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-14runtime: correct semaphore implementation on netbsdNikhil Benesch6-7/+29
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-13runtime: populate signal PC on NetBSDNikhil Benesch1-0/+2
The NetBSD libc provides an architecture-independent macro that can extract the PC from a ucontext struct. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/261740
2020-10-13syscall: port fix for netbsd unix sockets from upstreamNikhil Benesch1-3/+9
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-13reflect: ensure uniqueness of type descriptors on AIX.Clément Chigot9-29/+167
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-07libgo/configure: remove -fno-section-anchors for AIXClément Chigot2-10/+2
This option is no longer needed. There is no crash without it since at least gcc-9. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/260157
2020-10-07libgo: handle go1.10+ correctly in match.shNikhil Benesch2-8/+8
match.sh was not correctly handling build constraints for Go versions that have a two-digit suffix, like "go1.10". The same issue will arise with Go 1.100, but that is a long ways off. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/260077
2020-10-01compiler: set varargs correctly for type of method expressionIan Lance Taylor1-1/+7
Fixes golang/go#41737 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/258977
2020-09-30libgo: add 32-bit RISC-V (RV32) supportMaciej W. Rozycki22-20/+113
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-28net: add hurd build tagIan Lance Taylor1-1/+1
Patch from Svante Signell. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/257857
2020-09-24runtime: remove __go_ptrace on AIXClément Chigot1-1/+3
AIX ptrace syscalls doesn't have the same semantic than the glibc one. The syscall package is already handling it correctly so disable the new __go_ptrace C function for AIX. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/256777
2020-09-23libgo: update to Go1.15.2 releaseIan Lance Taylor33-108/+708
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/256618
2020-09-22syscall: fix TestForeground for AIXClément Chigot2-1/+17
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-22syscall: remove ptrace syscall on ppc64Clément Chigot2-3/+3
ptrace is available only for 32 bits programs. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/252558
2020-09-22runtime, net: fix build errors on AIXClément Chigot6-10/+23
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/235158
2020-09-21go/internal/gccgoimporter: recognize aixbigafMagic archivesClément Chigot1-1/+1
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/255201
2020-09-21libgo: don't put golang.org packages in zstdpkglist.goIan Lance Taylor2-2/+2
This ensures that internal/goroot.IsStandardPackage does not treat golang.org packages as being in the standard library. For golang/go#41368 Fixes golang/go#41499 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/256319
2020-09-17libgo: fix ptrace syscall hooks into glibcPaul E. Murphy3-2/+18
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-15libgo: additional type/const references in sysinfo.cThan McIntosh1-0/+2
Add a few more explicit references to enumeration constants (RUSAGE_SELF, DT_UNKNOWN) in sysinfo.c to insure that their hosting enums are emitted into DWARF, when using a clang host compiler during the gollvm build. Updates golang/go#41382. Updates golang/go#41404. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/254941
2020-08-27gotest: use a space rather than a middle dot in target listsMaciej W. Rozycki1-2/+2
Replace the U+00B7 middle dot character, placed after "mips64p32le" in the target lists, with a space. The U+00B7 character may not be considered whitespace by Bourne shell and any non-ASCII character may render incorrectly in some terminal devices. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/251177
2020-08-26cmd: add -maix32 to gcc calls for aix/ppcClément Chigot2-1/+8
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-26libgo: add FAT library support for static libraries on AIXClément Chigot2-0/+8
Like shared libraries, AIX static libraries must also have both 32 and 64 bit objects. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/250777
2020-08-12libgo: correctly handle AIX FAT library creationClément Chigot5-14/+28
The previous patch wasn't working everytime. Especially when AR had "-X32_64", the new .so would replace the default one and not just being added. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/247377
2020-08-11internal/syscall/unix: restore ppc build tagIan Lance Taylor1-1/+1
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-10runtime: revert eqtype for AIXClément Chigot4-11/+64
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-07libgo: update to Go1.15rc2 releaseIan Lance Taylor23-196/+335
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/247517
2020-08-03internal/syscall/unix: correct ia64 syscall numbersIan Lance Taylor1-2/+2
Per Andreas Schwab. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/246264
2020-08-03internal/syscall/unix: define copyFileRangeTrap for all architecturesIan Lance Taylor9-26/+34
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/246363
2020-08-01libgo: update to go1.15rc1Ian Lance Taylor915-14893/+45795
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/245157
2020-07-27compiler,runtime: pass only ptr and len to some runtime callsIan Lance Taylor5-63/+68
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-23libgo: add AIX FAT libraries supportClément Chigot5-2/+44
AIX-style libraries contains both 32 and 64 bit shared objects. This patch follows the adding of FAT libraries support in other gcc libraries (libgcc, listdc++, etc). Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/242957
2020-07-17libgo: update to Go 1.14.6 releaseIan Lance Taylor24-815/+1130
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/243317