summaryrefslogtreecommitdiff
path: root/libgo
Commit message (Collapse)AuthorAgeFilesLines
* syscall: add prlimitIan Lance Taylor2023-05-111-0/+8
| | | | | | | | | | As of https://go.dev/cl/476695 golang.org/x/sys/unix can call syscall.prlimit, so we need such a function in libgo. For golang/go#46279 Fixes golang/go#59712 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/486576
* mime: remove test ordering dependencyIan Lance Taylor2023-04-072-1/+5
| | | | | | | | | | | | | | | | | Backport CL 421442 from upstream. Original description: Arrange for tests that call setMimeInit to fully restore the old values, by clearing the sync.Once that controls initialization. Once we've done that, call initMime in initMimeUnixTest because otherwise the test types loaded there will be cleared by the call to initMime that previously was not being done. For golang/go#51648 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/483117
* libgo: revert incorrectly committed changeIan Lance Taylor2023-03-051-1/+0
| | | | This directory should be changed upstream, not in the GCC repo.
* Always define `WIN32_LEAN_AND_MEAN` before <windows.h>LIU Hao2023-01-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recently, mingw-w64 has got updated <msxml.h> from Wine which is included indirectly by <windows.h> if `WIN32_LEAN_AND_MEAN` is not defined. The `IXMLDOMDocument` class has a member function named `abort()`, which gets affected by our `abort()` macro in "system.h". `WIN32_LEAN_AND_MEAN` should, nevertheless, always be defined. This can exclude 'APIs such as Cryptography, DDE, RPC, Shell, and Windows Sockets' [1], and speed up compilation of these files a bit. [1] https://learn.microsoft.com/en-us/windows/win32/winprog/using-the-windows-headers gcc/ PR middle-end/108300 * config/xtensa/xtensa-dynconfig.c: Define `WIN32_LEAN_AND_MEAN` before <windows.h>. * diagnostic-color.cc: Likewise. * plugin.cc: Likewise. * prefix.cc: Likewise. gcc/ada/ PR middle-end/108300 * adaint.c: Define `WIN32_LEAN_AND_MEAN` before `#include <windows.h>`. * cio.c: Likewise. * ctrl_c.c: Likewise. * expect.c: Likewise. * gsocket.h: Likewise. * mingw32.h: Likewise. * mkdir.c: Likewise. * rtfinal.c: Likewise. * rtinit.c: Likewise. * seh_init.c: Likewise. * sysdep.c: Likewise. * terminals.c: Likewise. * tracebak.c: Likewise. gcc/jit/ PR middle-end/108300 * jit-w32.h: Define `WIN32_LEAN_AND_MEAN` before <windows.h>. libatomic/ PR middle-end/108300 * config/mingw/lock.c: Define `WIN32_LEAN_AND_MEAN` before <windows.h>. libffi/ PR middle-end/108300 * src/aarch64/ffi.c: Define `WIN32_LEAN_AND_MEAN` before <windows.h>. libgcc/ PR middle-end/108300 * config/i386/enable-execute-stack-mingw32.c: Define `WIN32_LEAN_AND_MEAN` before <windows.h>. * libgcc2.c: Likewise. * unwind-generic.h: Likewise. libgfortran/ PR middle-end/108300 * intrinsics/sleep.c: Define `WIN32_LEAN_AND_MEAN` before <windows.h>. libgomp/ PR middle-end/108300 * config/mingw32/proc.c: Define `WIN32_LEAN_AND_MEAN` before <windows.h>. libiberty/ PR middle-end/108300 * make-temp-file.c: Define `WIN32_LEAN_AND_MEAN` before <windows.h>. * pex-win32.c: Likewise. libssp/ PR middle-end/108300 * ssp.c: Define `WIN32_LEAN_AND_MEAN` before <windows.h>. libstdc++-v3/ PR middle-end/108300 * src/c++11/system_error.cc: Define `WIN32_LEAN_AND_MEAN` before <windows.h>. * src/c++11/thread.cc: Likewise. * src/c++17/fs_ops.cc: Likewise. * src/filesystem/ops.cc: Likewise. libvtv/ PR middle-end/108300 * vtv_malloc.cc: Define `WIN32_LEAN_AND_MEAN` before <windows.h>. * vtv_rts.cc: Likewise. * vtv_utils.cc: Likewise.
* libgo: check for makecontext in -lucontextIan Lance Taylor2022-12-202-0/+60
| | | | | | Patch from Sören Tempel. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/458396
* libgo: bump major versionIan Lance Taylor2022-12-122-2/+2
| | | | | | | | | | | PR go/108057 The current version is the same as for the previous GCC release, but there have been minor changes like new type descriptors that make it impossible to run Go programs built with the previous GCC release with the current libgo. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/456976
* runtime: force XSI strerror on hurdIan Lance Taylor2022-11-301-2/+2
| | | | Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/454275
* syscall, runtime: always call XSI strerror_rIan Lance Taylor2022-11-295-48/+52
| | | | | | | | This does the right thing for either glibc or musl on GNU/Linux. Based on patch by Sören Tempel. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/454176
* runtime: use _libgo_off_t_type when calling C mmapIan Lance Taylor2022-10-271-2/+4
| | | | | | | | | 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
* runtime: portable access to sigev_notify_thread_idIan Lance Taylor2022-09-272-1/+29
| | | | | | | | | | | | | | | | | | | 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
* runtime: synchronize empty struct field handlingmelonedo2022-09-271-4/+10
| | | | | | | | | | | | 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
* cmd/cgo: add and use runtime/cgo.Incomplete instead of //go:notinheapIan Lance Taylor2022-09-225-51/+66
| | | | | | | | | | | 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
* runtime: ignore __morestack function in runtime.CallersIan Lance Taylor2022-09-061-1/+1
| | | | | | | | | We were ignoring all functions starting with "__morestack_", but not the function "__morestack" itself. Without this change, some tests such as recover.go started failing recently, though I'm not sure exactly what changed. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/427935
* libgo: use SYS_timer_settime32Ian Lance Taylor2022-07-301-0/+5
| | | | | | | | Musl defines SYS_timer_settime32, not SYS_timer_settime, on 32-bit systems. Based on patch by Sören Tempel. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/420222
* libgo: use POSIX shell arithmetic expansionIan Lance Taylor2022-07-222-2/+2
| | | | | | | | | | | Avoid bash-specific ((expression)) syntax. As the bash syntax converts a non-zero value to a zero status (and a zero value to a 1 status), and POSIX arithmetic expansion does not, we have to negate the result. Based on patch by Sören Tempel. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/419154
* libgo: don't include <linux/fs.h> when building gen-sysinfo.goIan Lance Taylor2022-07-131-3/+0
| | | | | | | | | | Removing this doesn't change anything at least with glibc 2.33. The include was added in https://go.dev/cl/6100049 but it's not clear why. Fixes PR go/106266 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/417294
* libgo: handle stat st_atim32 field and SYS_SECCOMPIan Lance Taylor2022-06-301-1/+2
| | | | | | | | Patches for musl support, from Sören Tempel. Fixes PR go/105225 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/415294
* libgo: make runtime.Version return a meaningful stringIan Lance Taylor2022-06-283-10/+2
| | | | | | Fixes golang/go#51850 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/414734
* libgo: #include <sys/types.h> when checking for loff_tIan Lance Taylor2022-06-212-2/+8
| | | | | | | | PR go/106033 Fixes golang/go#53469 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/413214
* libgo: permit loff_t and off_t to be macrosIan Lance Taylor2022-06-176-18/+39
| | | | | | | | | 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
* syscall: gofmtIan Lance Taylor2022-06-1442-6/+52
| | | | | | | | | 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
* runtime: use correct field name for PPC32 GLIBC registersIan Lance Taylor2022-04-201-12/+23
| | | | | | | | One of these days we will get this right. Fixes PR go/105315 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/401374
* libgo: make a couple of sed uses POSIX compliantIan Lance Taylor2022-04-193-3/+3
| | | | | | Patch from Jonathan Wakely. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/401054
* libgo: only add signum to siglist if it doesn't exist yetSören Tempel2022-04-181-2/+6
| | | | | | | | This fixes a build issue on musl libc where the same signal number is used for SIGIO and SIGPOLL. This causes a compilation error since the signal numbers must be unique for the signal table. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/400595
* runtime: add special handling for signal 34A. Wilcox2022-04-182-2/+5
| | | | | | | | | | | | 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
* compiler: revert `for package-scope "a = b; b = x" just set "a = x"`Ian Lance Taylor2022-04-152-6/+8
| | | | | | | | | | | | | | | | | | | | 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
* runtime: use regset indexes for PPC register valuesIan Lance Taylor2022-04-141-15/+10
| | | | | | | | | Using names depended on <asm/ptrace.h>, which glibc includes somewhere but musl did not. Change to just always use indexes. Based on patch by Sören Tempel. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/400214
* runtime: support PPC32 MUSL register accessIan Lance Taylor2022-03-311-0/+18
| | | | | | Based on patch by Sören Tempel. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/397394
* libgo: update to final Go 1.18 releaseIan Lance Taylor2022-03-1691-603/+1982
| | | | Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/393377
* mkruntimeinc: skip _FILEIan Lance Taylor2022-03-041-1/+2
| | | | | | | | We don't need it, and it breaks uclibc. PR go/101246 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/390021
* libgo: move golang.org/x/sync/semaphore to gotool packagesClément Chigot2022-03-042-1/+1
| | | | | | golang/x/sync/semaphore is required by gofmt.go. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/388634
* libgo: fix AIX build for the Go1.18 updateClément Chigot2022-03-044-4/+2
| | | | Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/388635
* libgo: update README.gccIan Lance Taylor2022-02-221-4/+3
| | | | Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/387514
* runtime/internal/syscall: build dummy package if not LinuxIan Lance Taylor2022-02-211-0/+7
| | | | | | Fixes libgo build on non-Linux systems. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/387134
* libgo: update Hurd supportIan Lance Taylor2022-02-188-9/+297
| | | | | | Patches from Svante Signell for PR go/104290. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/386797
* libgo: update to Go1.18rc1 releaseIan Lance Taylor2022-02-18187-2975/+3699
| | | | Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/386594
* net: add hurd build tag for setReadMsgCloseOnExecIan Lance Taylor2022-02-171-1/+1
| | | | | | | | | Patch from Svante Signell. PR go/103573 PR go/104290 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/386216
* libgo: restore building on SolarisIan Lance Taylor2022-02-167-8/+17
| | | | | | | | 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
* runtime: call timer functions via syscallIan Lance Taylor2022-02-136-35/+18
| | | | | | | | | | | | | | | | | | | | | 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
* libgo: update to Go1.18beta2Ian Lance Taylor2022-02-111977-36276/+84204
| | | | | | | | | 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
* compiler, internal/abi: implement FuncPCABI0, FuncPCABIInternalIan Lance Taylor2022-02-083-5/+42
| | | | | | | | 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
* make `-Werror` optional in libatomic/libbacktrace/libgomp/libitm/libsanitizerDavid Seifert2022-02-032-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * `-Werror` can cause issues when a more recent version of GCC compiles an older version: - https://bugs.gentoo.org/229059 - https://bugs.gentoo.org/475350 - https://bugs.gentoo.org/667104 libatomic/ChangeLog: * configure.ac: Support --disable-werror. * configure: Regenerate. libbacktrace/ChangeLog: * configure.ac: Support --disable-werror. * configure: Regenerate. libgomp/ChangeLog: * configure.ac: Support --disable-werror. * configure: Regenerate. libitm/ChangeLog: * configure.ac: Support --disable-werror. * configure: Regenerate. libsanitizer/ChangeLog: * configure.ac: Support --disable-werror. * aclocal.m4: Include also ../config/warnings.m4. * libbacktrace/Makefile.am (WARN_FLAGS): Remove. * configure: Regenerate. * Makefile.in: Regenerate. * asan/Makefile.in: Regenerate. * hwasan/Makefile.in: Regenerate. * interception/Makefile.in: Regenerate. * libbacktrace/Makefile.in: Regenerate. * lsan/Makefile.in: Regenerate. * sanitizer_common/Makefile.in: Regenerate. * tsan/Makefile.in: Regenerate. * ubsan/Makefile.in: Regenerate. Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
* runtime: build panic32.go on amd64p32Ian Lance Taylor2022-01-201-2/+2
| | | | | | Fixes https://gcc.gnu.org/PR104149 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/380054
* compiler, libgo: don't pad sparc64-linux epolleventIan Lance Taylor2021-12-291-1/+1
| | | | | | | | | | | | | | | | Change the compiler to not add zero padding because of zero-sized fields named "_", since those can't be referenced anyhow. Change the sparc-linux64 epollevent struct to name the alignment field "_", to avoid zero padding. Fixes PR go/103847 PR go/103847 * godump.c (go_force_record_alignment): Name the alignment field "_". Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/374914
* runtime: set runtime.GOROOT value at build timeIan Lance Taylor2021-09-213-4/+21
| | | | | | | | | | | 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.
* libgo: update to go1.17.1 releaseIan Lance Taylor2021-09-1613-20/+153
| | | | Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/350414
* runtime: use hash32, not hash64, for amd64p32, mips64p32, mips64p32leIan Lance Taylor2021-09-072-4/+4
| | | | | | Fixes PR go/102102 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/348015
* libgo: update to final Go 1.17 releaseIan Lance Taylor2021-09-0512-65/+215
| | | | Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/343729
* libgo: various fixes for Solaris supportIan Lance Taylor2021-08-149-16/+34
| | | | Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/342189
* runtime: use C cast syntax in stack.cIan Lance Taylor2021-08-131-1/+1
| | | | | | | Didn't notice earlier because this code is only used on systems that do not support -fsplit-stack. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/342051