Age | Commit message (Collapse) | Author | Files | Lines |
|
The last argument to the C mmap function is type off_t, not uintptr.
On some 32-bit systems, off_t is larger than uintptr.
Based on patch by Sören Tempel.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/445735
|
|
Previously, libgo relied on the _sigev_un implementation-specific
field in struct sigevent, which is only available on glibc.
This patch uses the sigev_notify_thread_id macro instead which is
mandated by timer_create(2). In theory, this should work with any libc
implementation for Linux. Unfortunately, there is an open glibc bug
as glibc does not define this macro. For this reason, a glibc-specific
workaround is required. Other libcs (such as musl) define the macro
and don't require the workaround.
See https://sourceware.org/bugzilla/show_bug.cgi?id=27417
This makes libgo compatible with musl libc.
Based on patch by Sören Tempel.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/434755
|
|
In GCCGO and gollvm, the logic for allocating one byte for the last field is:
1. the last field has zero size
2. the struct itself does not have zero size
3. the last field is not blank
this commit adds the last two conditions to runtime.structToFFI.
For golang/go#55146
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/431735
|
|
This ports https://go.dev/cl/421879 to libgo. This is a quick port to
update gofrontend to work with the version of cgo in gc mainline.
A more complete port will follow, changing the gc version of cmd/cgo to
choose an approach based on feature testing the gccgo in use.
Updates golang/go#46731
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/432338
|
|
Fixes golang/go#51850
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/414734
|
|
They are macros in musl libc, rather than typedefs, and -fgo-dump-spec
doesn't handle that case.
Based on patch by Sören Tempel.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/412075
|
|
Add blank lines after //sys comments where needed, and then run gofmt
on the syscall package with the new formatter.
This is the libgo version of CL 407136.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/412074
|
|
The musl libc uses signal 34 internally for setgid (similar to how glibc
uses signal 32 and signal 33). For this reason, special handling is
needed for this signal in the runtime. The gc implementation already
handles the signal accordingly. As such, this commit intends to
simply copy the behavior of the Google Go implementation to libgo.
See https://go.dev/issues/39343
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/400594
|
|
Revert CL 245098. It caused incorrect initialization ordering.
Adjust the runtime package to work even with the CL reverted.
Original description of CL 245098:
This avoids requiring an init function to initialize the variable.
This can only be done if x is a static initializer.
The go1.15rc1 runtime package relies on this optimization.
The package has a variable "var maxSearchAddr = maxOffAddr".
The maxSearchAddr variable is used by code that runs before package
initialization is complete.
For golang/go#51913
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/395994
|
|
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/393377
|
|
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/388635
|
|
Fixes libgo build on non-Linux systems.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/387134
|
|
Patches from Svante Signell for PR go/104290.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/386797
|
|
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/386594
|
|
Patch from Svante Signell.
PR go/103573
PR go/104290
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/386216
|
|
Add build tags and a few other changes so that libgo builds on Solaris.
Patch partially from Rainer Orth.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/386215
|
|
It turns out to be painful to require linking against -lrt on
GNU/Linux, as that makes it harder to link Go code into C programs.
Instead just call the timer syscalls directly. That is what the
upstream library does anyhow.
gcc/go/
* gospec.cc: Revert 2022-02-09 change:
(RTLIB, RT_LIBRARY): Don't define.
(lang_specific_driver): Don't add -lrt if linking statically
on GNU/Linux.
gotools/
* configure.ac: Revert 2022-02-09 change:
(RT_LIBS): Don't define.
* Makefile.am (check-runtime): Don't set GOLIBS to $(RT_LIBS).
* configure, Makefile.in: Regenerate.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/385475
|
|
gotools/
* Makefile.am (go_cmd_cgo_files): Add ast_go118.go
(check-go-tool): Copy golang.org/x/tools directories.
* Makefile.in: Regenerate.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/384695
|
|
The Go 1.18 standard library uses an internal/abi package with two
functions that are implemented in the compiler. This patch implements
them in the gofrontend, to support the upcoming update to 1.18.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/383514
|
|
Fixes https://gcc.gnu.org/PR104149
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/380054
|
|
In Go 1.17 the gc toolchain changed to set runtime.GOROOT in cmd/link
(previously it was runtime/internal/sys.GOROOT). Do the same in libgo.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/351313
gotools/:
* Makefile.am (check-runtime): Add goroot.go to --extrafiles.
* Makefile.in: Regenerate.
|
|
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/350414
|
|
Fixes PR go/102102
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/348015
|
|
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/343729
|
|
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/342189
|
|
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/341629
|
|
|
|
This is the gofrontend version of https://golang.org/cl/264480.
For golang/go#42076
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/340609
|
|
This is the gofrontend version of https://golang.org/cl/289152.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/339690
|
|
The only different between selectnbrecv and selectnbrecv2 is the later
set the input pointer value by second return value from chanrecv.
So by making selectnbrecv return two values from chanrecv, we can get
rid of selectnbrecv2, the compiler can now call only selectnbrecv and
generate simpler code.
This is the gofrontend version of https://golang.org/cl/292890.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/339529
|
|
Panic if the slice is too short.
For golang/go#395
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/338630
|
|
For golang/go#19367
For golang/go#40481
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/338949
|
|
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/326772
|
|
|
|
|
|
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/309490
|
|
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/301459
|
|
Go requires that pointer moves are done 8 bytes at a time,
but gccgo uses libc's memmove and memset which does not require
that, and there are some cases where an 8 byte move might be
done as 4+4.
To enforce 8 byte moves for memmove and memset, this adds a
C implementation in libgo/runtime for memmove and memset to be
used on ppc64le and ppc64. Asm implementations were considered
but discarded to avoid different implementations for different
target ISAs.
Fixes golang/go#41428
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/294931
|
|
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/293793
|
|
Directly set getsystemcfg as //extern in internal/cpu instead of
trying to use the runtime as in Go toolchain.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/287932
|
|
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/287493
|
|
Patch from Svante Signell.
Fixes PR go/98496
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/283692
|
|
On powerpc64le, this caused a failure in TestUnshareUidGidMapping
due to stack corruption which resulted in a bogus execve syscall.
Use the existing c wrapper to ensure we respect the ppc abi for
variadic functions.
Fixes PR go/98610
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/282717
|
|
We don't use them, since we always call the C library functions which do
the right thing anyhow. And they aren't defined on all GNU/Linux variants.
Fixes PR go/98510
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/281473
|
|
Some files were missing from the libgo copy of internal/cpu, because they
used to only declare CacheLinePadSize which libgo gets from goarch.sh.
Now they also declare doinit, so copy them over. Adjust cpu_other.go.
Fix the amd64p32 build by adding a build constraint to cpu_no_name.go.
Fixes PR go/98493
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/281472
|
|
Patch from Andreas Schwab.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/281000
|
|
In libgo it's referenced from os_gccgo.go on all platforms.
Fixes go/98496
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/280999
|
|
Add support (mostly dummy support) for GOARCH values supported by
gofrontend but not gc. Fix PPC handling.
Fixes https://gcc.gnu.org/PR98493
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/280932
|
|
This does not yet include support for the //go:embed directive added
in this release.
* Makefile.am (check-runtime): Don't create check-runtime-dir.
(mostlyclean-local): Don't remove check-runtime-dir.
(check-go-tool, check-vet): Copy in go.mod and modules.txt.
(check-cgo-test, check-carchive-test): Add go.mod file.
* Makefile.in: Regenerate.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/280172
|
|
This is the gofrontend version of https://golang.org/cl/245125.
Original CL description:
Currently, we include a "kind" field on scase to distinguish the three
kinds of cases in a select statement: sends, receives, and defaults.
This commit removes by kind field by instead arranging for the
compiler to always place sends before receives, and to provide their
counts separately. It also passes an explicit "block bool" parameter
to avoid needing to include a default case in the array.
It's safe to shuffle cases like this because the runtime will
randomize the order they're polled in anyway.
For golang/go#40410.
This is being brought over to gofrontend as a step toward upgrading to
Go1.16beta1.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/279735
|