gcc: update to 13.2.0. (nocross)

This commit is contained in:
oreo639 2023-08-07 15:41:41 -07:00
parent 7f55bd5830
commit e934cce81b
10 changed files with 353 additions and 304 deletions

View file

@ -63,7 +63,7 @@ libcc1plugin.so.0 gcc-6.2.1_1
libitm.so.1 libitm-4.7.3_1
liblto_plugin.so.0 gcc-4.7.3_1
libgcc_s.so.1 libgcc-4.4.0_1
libgo.so.21 libgo-12.2.0_1
libgo.so.22 libgo-13.2.0_1
libgccjit.so.0 libgccjit-10.2.1pre1_1
libperl.so.5.38 perl-5.38.0_1
libgmp.so.10 gmp-5.0.1_1
@ -855,8 +855,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1
libgtkmm-2.4.so.1 gtkmm2-2.24.0_1
libquadmath.so.0 libquadmath-4.4.0_1
libgfortran.so.5 libgfortran-8.2.0_1
libgnarl-12.so libada-12.2.0_1
libgnat-12.so libada-12.2.0_1
libgnarl-13.so libada-13.2.0_1
libgnat-13.so libada-13.2.0_1
libsharpyuv.so.0 libsharpyuv-1.3.0_1
libwebp.so.7 libwebp-0.6.0_1
libwebpmux.so.3 libwebp-0.6.0_1
@ -1669,6 +1669,7 @@ libubsan.so.1 libsanitizer-8.2.0_1
libtsan.so.2 libsanitizer-12.2.0_1
libasan.so.8 libsanitizer-12.2.0_1
liblsan.so.0 libsanitizer-6.3.0_1
libhwasan.so.0 libsanitizer-13.2.0_1
libvtv.so.0 libvtv-6.3.0_1
libatomic.so.1 libatomic-4.9.0_1
libpcsclite.so.1 libpcsclite-1.8.11_1

View file

@ -1,173 +1,199 @@
This is not among the normal patches as these changes are musl specific and
there is no way to easily conditionalize it in source for some of the changes.
Added by q66: runtime.h now uses libucontext_ prefixed APIs to allow build
with freestanding versions of libucontext
Souurce: Adélie Linux, q66
URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
--- a/Makefile.in
+++ b/Makefile.in
@@ -46325,7 +46325,7 @@ configure-target-libgo:
esac; \
module_srcdir=libgo; \
rm -f no-such-file || : ; \
- CONFIG_SITE=no-such-file $(SHELL) \
+ CONFIG_SITE=no-such-file LIBS="-lucontext $$LIBS" $(SHELL) \
$$s/$$module_srcdir/configure \
--srcdir=$${topdir}/$$module_srcdir \
$(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
--- a/libgo/mksysinfo.sh
+++ b/libgo/mksysinfo.sh
@@ -379,11 +379,7 @@ fi
# Some basic types.
echo 'type Size_t _size_t' >> ${OUT}
echo "type Ssize_t _ssize_t" >> ${OUT}
-if grep '^const _HAVE_OFF64_T = ' gen-sysinfo.go > /dev/null 2>&1; then
- echo "type Offset_t _off64_t" >> ${OUT}
-else
- echo "type Offset_t _off_t" >> ${OUT}
-fi
+echo "type Offset_t _off_t" >> ${OUT}
echo "type Mode_t _mode_t" >> ${OUT}
echo "type Pid_t _pid_t" >> ${OUT}
echo "type Uid_t _uid_t" >> ${OUT}
--- a/libgo/go/runtime/mem_gccgo.go
+++ b/libgo/go/runtime/mem_gccgo.go
@@ -16,7 +16,7 @@ import (
//go:linkname sysFree runtime.sysFree
From 4bfcb35bc43d3e3b7510620362d7c28d9e4c17ca Mon Sep 17 00:00:00 2001
From: psykose <alice@ayaya.dev>
Date: Mon, 10 Jul 2023 23:23:29 +0000
Subject: [PATCH 34/35] libgo: fix lfs64 use
---
.../go/internal/syscall/unix/at_largefile.go | 2 +-
libgo/go/os/dir_largefile.go | 2 +-
libgo/go/syscall/libcall_glibc.go | 2 +-
libgo/go/syscall/libcall_linux.go | 4 +--
libgo/go/syscall/libcall_posix_largefile.go | 26 +++++++++----------
libgo/runtime/go-varargs.c | 2 +-
libgo/sysinfo.c | 9 +++----
7 files changed, 22 insertions(+), 25 deletions(-)
diff --git a/libgo/go/internal/syscall/unix/at_largefile.go b/libgo/go/internal/syscall/unix/at_largefile.go
index 82e0dcfd074..16151ecad1b 100644
--- a/libgo/go/internal/syscall/unix/at_largefile.go
+++ b/libgo/go/internal/syscall/unix/at_largefile.go
@@ -10,5 +10,5 @@ import (
"syscall"
)
//extern mmap
-func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) unsafe.Pointer
+func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) unsafe.Pointer
-//extern fstatat64
+//extern fstatat
func fstatat(int32, *byte, *syscall.Stat_t, int32) int32
diff --git a/libgo/go/os/dir_largefile.go b/libgo/go/os/dir_largefile.go
index 1fc5ee0771f..0c6dffe1a75 100644
--- a/libgo/go/os/dir_largefile.go
+++ b/libgo/go/os/dir_largefile.go
@@ -11,5 +11,5 @@ package os
//extern munmap
func munmap(addr unsafe.Pointer, length uintptr) int32
@@ -38,7 +38,7 @@ func init() {
}
import "syscall"
-//extern readdir64
+//extern readdir
func libc_readdir(*syscall.DIR) *syscall.Dirent
diff --git a/libgo/go/syscall/libcall_glibc.go b/libgo/go/syscall/libcall_glibc.go
index 5c1ec483c75..5a1245ed44b 100644
--- a/libgo/go/syscall/libcall_glibc.go
+++ b/libgo/go/syscall/libcall_glibc.go
@@ -114,7 +114,7 @@ func Pipe2(p []int, flags int) (err error) {
}
-func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) (unsafe.Pointer, int) {
+func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) (unsafe.Pointer, int) {
p := sysMmap(addr, n, prot, flags, fd, off)
if uintptr(p) == _MAP_FAILED {
return nil, errno()
--- a/libgo/go/syscall/errstr.go
+++ b/libgo/go/syscall/errstr.go
@@ -5,7 +5,6 @@
// license that can be found in the LICENSE file.
//sys sendfile(outfd int, infd int, offset *Offset_t, count int) (written int, err error)
-//sendfile64(outfd _C_int, infd _C_int, offset *Offset_t, count Size_t) Ssize_t
+//sendfile(outfd _C_int, infd _C_int, offset *Offset_t, count Size_t) Ssize_t
// +build !hurd
-// +build !linux
package syscall
--- a/libgo/go/syscall/errstr_glibc.go
+++ /dev/null
@@ -1,33 +0,0 @@
-// errstr_glibc.go -- GNU/Linux and GNU/Hurd specific error strings.
-
-// Copyright 2010 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// We use this rather than errstr.go because on GNU/Linux sterror_r
-// returns a pointer to the error message, and may not use buf at all.
-
-// +build hurd linux
-
-package syscall
-
-import "unsafe"
-
-//sysnb strerror_r(errnum int, b []byte) (errstr *byte)
-//strerror_r(errnum _C_int, b *byte, len Size_t) *byte
-
-func Errstr(errnum int) string {
- a := make([]byte, 128)
- p := strerror_r(errnum, a)
- b := (*[1000]byte)(unsafe.Pointer(p))
- i := 0
- for b[i] != 0 {
- i++
- }
- // Lowercase first letter: Bad -> bad, but STREAM -> STREAM.
- if i > 1 && 'A' <= b[0] && b[0] <= 'Z' && 'a' <= b[1] && b[1] <= 'z' {
- c := b[0] + 'a' - 'A'
- return string(c) + string(b[1:i])
- }
- return string(b[:i])
-}
func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
if race.Enabled {
diff --git a/libgo/go/syscall/libcall_linux.go b/libgo/go/syscall/libcall_linux.go
index 03ca7261b59..ad21fd0b3ac 100644
--- a/libgo/go/syscall/libcall_linux.go
+++ b/libgo/go/syscall/libcall_linux.go
@@ -206,19 +206,19 @@ func Gettid() (tid int) {
//sys Setxattr(path string, attr string, data []byte, flags int) (err error)
//setxattr(path *byte, name *byte, value *byte, size Size_t, flags _C_int) _C_int
@@ -158,7 +158,7 @@ func Reboot(cmd int) (err error) {
//adjtimex(buf *Timex) _C_int
//sys Fstatfs(fd int, buf *Statfs_t) (err error)
-//fstatfs64(fd _C_int, buf *Statfs_t) _C_int
+//fstatfs(fd _C_int, buf *Statfs_t) _C_int
func Gettid() (tid int) {
r1, _, _ := Syscall(SYS_GETTID, 0, 0, 0)
@@ -245,7 +245,7 @@ func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n i
}
//sys Statfs(path string, buf *Statfs_t) (err error)
-//statfs64(path *byte, buf *Statfs_t) _C_int
+//statfs(path *byte, buf *Statfs_t) _C_int
//sysnb Sysinfo(info *Sysinfo_t) (err error)
//sysinfo(info *Sysinfo_t) _C_int
diff --git a/libgo/go/syscall/libcall_posix_largefile.go b/libgo/go/syscall/libcall_posix_largefile.go
index f90055bb29a..334212f0af1 100644
--- a/libgo/go/syscall/libcall_posix_largefile.go
+++ b/libgo/go/syscall/libcall_posix_largefile.go
@@ -10,40 +10,40 @@
package syscall
//sys Creat(path string, mode uint32) (fd int, err error)
-//creat64(path *byte, mode Mode_t) _C_int
+//creat(path *byte, mode Mode_t) _C_int
//sys Fstat(fd int, stat *Stat_t) (err error)
-//fstat64(fd _C_int, stat *Stat_t) _C_int
+//fstat(fd _C_int, stat *Stat_t) _C_int
//sys Ftruncate(fd int, length int64) (err error)
-//ftruncate64(fd _C_int, length Offset_t) _C_int
+//ftruncate(fd _C_int, length Offset_t) _C_int
//sysnb Getrlimit(resource int, rlim *Rlimit) (err error)
-//getrlimit64(resource _C_int, rlim *Rlimit) _C_int
+//getrlimit(resource _C_int, rlim *Rlimit) _C_int
//sys Lstat(path string, stat *Stat_t) (err error)
-//lstat64(path *byte, stat *Stat_t) _C_int
+//lstat(path *byte, stat *Stat_t) _C_int
//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
-//mmap64(addr *byte, length Size_t, prot _C_int, flags _C_int, fd _C_int, offset Offset_t) *byte
+//mmap(addr *byte, length Size_t, prot _C_int, flags _C_int, fd _C_int, offset Offset_t) *byte
//sys Open(path string, mode int, perm uint32) (fd int, err error)
-//__go_open64(path *byte, mode _C_int, perm Mode_t) _C_int
+//__go_open(path *byte, mode _C_int, perm Mode_t) _C_int
//sys Pread(fd int, p []byte, offset int64) (n int, err error)
-//pread64(fd _C_int, buf *byte, count Size_t, offset Offset_t) Ssize_t
+//pread(fd _C_int, buf *byte, count Size_t, offset Offset_t) Ssize_t
//sys Pwrite(fd int, p []byte, offset int64) (n int, err error)
-//pwrite64(fd _C_int, buf *byte, count Size_t, offset Offset_t) Ssize_t
+//pwrite(fd _C_int, buf *byte, count Size_t, offset Offset_t) Ssize_t
//sys Seek(fd int, offset int64, whence int) (off int64, err error)
-//lseek64(fd _C_int, offset Offset_t, whence _C_int) Offset_t
+//lseek(fd _C_int, offset Offset_t, whence _C_int) Offset_t
//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
-//setrlimit64(resource int, rlim *Rlimit) _C_int
+//setrlimit(resource int, rlim *Rlimit) _C_int
//sys Stat(path string, stat *Stat_t) (err error)
-//stat64(path *byte, stat *Stat_t) _C_int
+//stat(path *byte, stat *Stat_t) _C_int
//sys Truncate(path string, length int64) (err error)
-//truncate64(path *byte, length Offset_t) _C_int
+//truncate(path *byte, length Offset_t) _C_int
diff --git a/libgo/runtime/go-varargs.c b/libgo/runtime/go-varargs.c
index f84860891e6..7efc9615985 100644
--- a/libgo/runtime/go-varargs.c
+++ b/libgo/runtime/go-varargs.c
@@ -84,7 +84,7 @@ __go_ioctl_ptr (int d, int request, void *arg)
int
__go_open64 (char *path, int mode, mode_t perm)
{
- return open64 (path, mode, perm);
+ return open (path, mode, perm);
}
-//sys splice(rfd int, roff *_loff_t, wfd int, woff *_loff_t, len int, flags int) (n int64, err error)
-//splice(rfd _C_int, roff *_loff_t, wfd _C_int, woff *_loff_t, len Size_t, flags _C_uint) Ssize_t
+//sys splice(rfd int, roff *_off_t, wfd int, woff *_off_t, len int, flags int) (n int64, err error)
+//splice(rfd _C_int, roff *_off_t, wfd _C_int, woff *_off_t, len Size_t, flags _C_uint) Ssize_t
func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
- var lroff _loff_t
- var plroff *_loff_t
+ var lroff _off_t
+ var plroff *_off_t
if roff != nil {
- lroff = _loff_t(*roff)
+ lroff = _off_t(*roff)
plroff = &lroff
}
- var lwoff _loff_t
- var plwoff *_loff_t
+ var lwoff _off_t
+ var plwoff *_off_t
if woff != nil {
- lwoff = _loff_t(*woff)
+ lwoff = _off_t(*woff)
plwoff = &lwoff
}
n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
--- a/libgo/runtime/runtime.h
+++ b/libgo/runtime/runtime.h
@@ -500,10 +500,13 @@ int __go_setcontext(__go_context_t*);
void __go_makecontext(__go_context_t*, void (*)(), void*, size_t);
#else
#define __go_context_t ucontext_t
-#define __go_getcontext(c) getcontext(c)
-#define __go_setcontext(c) setcontext(c)
+int libucontext_getcontext(__go_context_t *);
+void libucontext_makecontext(__go_context_t *, void (*)(), int, ...);
+int libucontext_setcontext(const __go_context_t *);
+#define __go_getcontext(c) libucontext_getcontext(c)
+#define __go_setcontext(c) libucontext_setcontext(c)
#define __go_makecontext(c, fn, sp, size) \
- ((c)->uc_stack.ss_sp = sp, (c)->uc_stack.ss_size = size, makecontext(c, fn, 0))
+ ((c)->uc_stack.ss_sp = sp, (c)->uc_stack.ss_size = size, libucontext_makecontext(c, fn, 0))
#endif
// Symbols defined by the linker.
diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
index 180f5c31d74..1d717d55c0e 100644
--- a/libgo/sysinfo.c
+++ b/libgo/sysinfo.c
@@ -73,9 +73,6 @@
#include <sys/times.h>
#include <sys/wait.h>
#include <sys/un.h>
-#if defined(HAVE_SYS_USER_H)
-#include <sys/user.h>
-#endif
#if defined(HAVE_SYS_UTSNAME_H)
#include <sys/utsname.h>
@@ -366,7 +366,7 @@ typedef loff_t libgo_loff_t_type;
#endif
--- a/libgo/go/runtime/os_linux.go
+++ b/libgo/go/runtime/os_linux.go
@@ -365,7 +365,7 @@ func setThreadCPUProfiler(hz int32) {
var sevp _sigevent
sevp.sigev_notify = _SIGEV_THREAD_ID
sevp.sigev_signo = _SIGPROF
- *((*int32)(unsafe.Pointer(&sevp._sigev_un))) = int32(mp.procid)
+ *((*int32)(unsafe.Pointer(&sevp.__sev_fields))) = int32(mp.procid)
ret := timer_create(_CLOCK_THREAD_CPUTIME_ID, &sevp, &timerid)
if ret != 0 {
// If we cannot create a timer for this M, leave profileTimerValid false
#if defined(HAVE_OFF64_T)
-typedef off64_t libgo_off_t_type;
+typedef off_t libgo_off_t_type;
#else
typedef off_t libgo_off_t_type;
#endif
@@ -398,13 +398,11 @@ typedef off_t libgo_off_t_type;
// From dirent.h
SREF(dirent);
-SREF(dirent64);
OTREF(DIR);
EREF(DT_UNKNOWN);
// From fcntl.h
SREF(flock);
-SREF(flock64);
// From ffi headers
SREF(_ffi_type);
@@ -485,11 +483,10 @@ EREF(SS_ONSTACK);
EREF(SEGV_MAPERR);
// From stat.h
-SREF(stat64);
+SREF(stat);
// From statfs.h
SREF(statfs);
-SREF(statfs64);
// From sysinfo.h
SREF(sysinfo);
@@ -519,7 +516,7 @@ EREF(PTRACE_PEEKTEXT);
// From sys/resource.h
SREF(rusage);
-SREF(rlimit64);
+SREF(rlimit);
EREF(RLIMIT_NOFILE);
EREF(PRIO_USER);
EREF(RUSAGE_SELF);

View file

@ -1,7 +1,5 @@
First part taken from Alpine.
Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -984,10 +984,15 @@ proper position among the other output f
@ -42,29 +40,3 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl.
The lower bound for a buffer to be considered for stack smashing protection.
-param=stack-clash-protection-guard-size=
--- a/gcc/config/i386/gnu-user-common.h
+++ b/gcc/config/i386/gnu-user-common.h
@@ -64,9 +64,3 @@ along with GCC; see the file COPYING3. If not see
/* Static stack checking is supported by means of probes. */
#define STACK_CHECK_STATIC_BUILTIN 1
-
-/* We only build the -fsplit-stack support in libgcc if the
- assembler has full support for the CFI directives. */
-#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
-#define TARGET_CAN_SPLIT_STACK
-#endif
--- a/gcc/config/i386/gnu.h
+++ b/gcc/config/i386/gnu.h
@@ -40,11 +40,6 @@ along with GCC. If not, see <http://www.gnu.org/licenses/>.
/* i386 glibc provides __stack_chk_guard in %gs:0x14. */
#define TARGET_THREAD_SSP_OFFSET 0x14
-/* We only build the -fsplit-stack support in libgcc if the
- assembler has full support for the CFI directives. */
-#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
-#define TARGET_CAN_SPLIT_STACK
-#endif
/* We steal the last transactional memory word. */
#define TARGET_THREAD_SPLIT_STACK_OFFSET 0x30
#endif

View file

@ -1,41 +0,0 @@
From 548720bca6bff21ebc9aba22249d9ce45bbd90c7 Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor <iant@golang.org>
Date: Wed, 29 Jun 2022 15:32:04 -0700
Subject: [PATCH] libgo: handle stat st_atim32 field and SYS_SECCOMP
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Patches for musl support, from Sören Tempel.
Fixes https://gcc.gnu.org/PR105225
Change-Id: If396877d4a4c7d27962226d7a6e3bb91b1344413
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/415294
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
---
libgo/mksysinfo.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh
index 5aa30915..ea1fa17d 100755
--- a/libgo/mksysinfo.sh
+++ b/libgo/mksysinfo.sh
@@ -127,6 +127,7 @@ fi
# The syscall numbers. We force the names to upper case.
grep '^const _SYS_' gen-sysinfo.go | \
+ grep -v '^const _SYS_SECCOMP = ' | \
sed -e 's/const _\(SYS_[^= ]*\).*$/\1/' | \
while read sys; do
sup=`echo $sys | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`
@@ -506,7 +507,7 @@ fi
# For historical reasons Go uses the suffix "timespec" instead of "tim" for
# stat_t's time fields on NetBSD.
-st_times='-e s/st_atim/Atim/ -e s/st_mtim/Mtim/ -e s/st_ctim/Ctim/'
+st_times='-e s/st_atim/Atim/g -e s/st_mtim/Mtim/g -e s/st_ctim/Ctim/g'
if test "${GOOS}" = "netbsd"; then
st_times='-e s/st_atim/Atimespec/ -e s/st_mtim/Mtimespec/ -e s/st_ctim/Ctimespec/'
fi

View file

@ -28,13 +28,34 @@ When adding a new platform, fix this up too.
MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
--- a/gcc/config/mips/t-linux64
+++ b/gcc/config/mips/t-linux64
@@ -21,6 +21,6 @@ MULTILIB_DIRNAMES = n32 32 64
@@ -20,26 +20,7 @@ MULTILIB_OPTIONS = mabi=n32/mabi=32/mabi
MULTILIB_DIRNAMES = n32 32 64
MIPS_EL = $(if $(filter %el, $(firstword $(subst -, ,$(target)))),el)
MIPS_SOFT = $(if $(strip $(filter MASK_SOFT_FLOAT_ABI, $(target_cpu_default)) $(filter soft, $(with_float))),soft)
MULTILIB_OSDIRNAMES = \
-ifeq (yes,$(enable_multiarch))
- ifneq (,$(findstring gnuabi64,$(target)))
- MULTILIB_OSDIRNAMES = \
- ../lib32$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \
- ../libo32$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \
- ../lib$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
- else ifneq (,$(findstring gnuabin32,$(target)))
- MULTILIB_OSDIRNAMES = \
- ../lib$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \
- ../libo32$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \
- ../lib64$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
- else
- MULTILIB_OSDIRNAMES = \
- ../lib32$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \
- ../lib$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \
- ../lib64$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
- endif
-else
- MULTILIB_OSDIRNAMES = \
- ../lib32$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \
- ../lib$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \
- ../lib64$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
-endif
+MULTILIB_OSDIRNAMES = \
+ ../lib32 \
+ ../lib \
+ ../lib64

View file

@ -106,22 +106,28 @@ diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cp
index a04eed7aa5a6e3..6d61d276d77e35 100644
--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
@@ -154,7 +154,6 @@ typedef struct user_fpregs elf_fpregset_
#include <linux/serial.h>
#include <sys/msg.h>
#include <sys/ipc.h>
@@ -177,10 +177,6 @@ typedef struct user_fpregs elf_fpregset_t;
# include "sanitizer_platform_interceptors.h"
# include "sanitizer_platform_limits_posix.h"
-#if SANITIZER_INTERCEPT_CRYPT_R
-#include <crypt.h>
#endif // SANITIZER_ANDROID
#include <link.h>
@@ -254,7 +253,6 @@ namespace __sanitizer {
unsigned struct_ustat_sz = SIZEOF_STRUCT_USTAT;
unsigned struct_rlimit64_sz = sizeof(struct rlimit64);
-#endif
-
namespace __sanitizer {
unsigned struct_utsname_sz = sizeof(struct utsname);
unsigned struct_stat_sz = sizeof(struct stat);
@@ -300,10 +296,6 @@ namespace __sanitizer {
unsigned struct_statvfs64_sz = sizeof(struct statvfs64);
- unsigned struct_crypt_data_sz = sizeof(struct crypt_data);
#endif // SANITIZER_LINUX && !SANITIZER_ANDROID
#endif // SANITIZER_GLIBC
-#if SANITIZER_INTERCEPT_CRYPT_R
- unsigned struct_crypt_data_sz = sizeof(struct crypt_data);
-#endif
-
#if SANITIZER_LINUX && !SANITIZER_ANDROID
unsigned struct_timex_sz = sizeof(struct timex);
unsigned struct_msqid_ds_sz = sizeof(struct msqid_ds);
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
index e6f298c26e1fb6..58244c9944a03a 100644
--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h

View file

@ -0,0 +1,60 @@
From f4029de35fb1b293a4fd586574b1b4b73ddf7880 Mon Sep 17 00:00:00 2001
From: Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
Date: Wed, 26 Jul 2023 22:36:26 +0530
Subject: [PATCH] [aarch64/match.pd] Fix ICE observed in PR110280.
gcc/ChangeLog:
PR tree-optimization/110280
* match.pd (vec_perm_expr(v, v, mask) -> v): Explicitly build vector
using build_vector_from_val with the element of input operand, and
mask's type if operand and mask's types don't match.
gcc/testsuite/ChangeLog:
PR tree-optimization/110280
* gcc.target/aarch64/sve/pr110280.c: New test.
(cherry picked from commit 85d8e0d8d5342ec8b4e6a54e22741c30b33c6f04)
---
gcc/match.pd | 9 ++++++++-
gcc/testsuite/gcc.target/aarch64/sve/pr110280.c | 12 ++++++++++++
2 files changed, 20 insertions(+), 1 deletion(-)
create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/pr110280.c
diff --git a/gcc/match.pd b/gcc/match.pd
index 9118244825054..c3bb4fbc0a7a2 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -8292,7 +8292,14 @@ and,
(simplify
(vec_perm vec_same_elem_p@0 @0 @1)
- @0)
+ (if (types_match (type, TREE_TYPE (@0)))
+ @0
+ (with
+ {
+ tree elem = uniform_vector_p (@0);
+ }
+ (if (elem)
+ { build_vector_from_val (type, elem); }))))
/* Push VEC_PERM earlier if that may help FMA perception (PR101895). */
(simplify
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/pr110280.c b/gcc/testsuite/gcc.target/aarch64/sve/pr110280.c
new file mode 100644
index 0000000000000..d3279f383629f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/pr110280.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+#include "arm_sve.h"
+
+svuint32_t l()
+{
+ _Alignas(16) const unsigned int lanes[4] = {0, 0, 0, 0};
+ return svld1rq_u32(svptrue_b8(), lanes);
+}
+
+/* { dg-final { scan-tree-dump-not "VEC_PERM_EXPR" "optimized" } } */

View file

@ -9,15 +9,15 @@
self.val = val
self.contained_type = None
contained_value = None
@@ -1216,7 +1216,7 @@
mgrname = m.group(1)
# FIXME need to expand 'std::string' so that gdb.lookup_type works
if 'std::string' in mgrname:
- mgrname = re.sub("std::string(?!\w)", str(gdb.lookup_type('std::string').strip_typedefs()), m.group(1))
+ mgrname = re.sub(r"std::string(?!\w)", str(gdb.lookup_type('std::string').strip_typedefs()), m.group(1))
mgrtype = gdb.lookup_type(mgrname)
self.contained_type = mgrtype.template_argument(0)
@@ -1299,7 +1299,7 @@
mgrtypes = []
for s in strings:
try:
- x = re.sub("std::string(?!\w)", s, m.group(1))
+ x = re.sub(r"std::string(?!\w)", s, m.group(1))
# The following lookup might raise gdb.error if the
# manager function was never instantiated for 's' in the
# program, because there will be no such type.
@@ -1246,7 +1246,7 @@
def __init__ (self, typename, val):
valtype = self._recognize (val.type.template_argument(0))

View file

@ -2,10 +2,10 @@ Add --enable-autolink-libatomic, to make gcc link -latomic by default.
Taken from Alpine: https://git.alpinelinux.org/aports/tree/main/gcc/0035-configure-Add-enable-autolink-libatomic-use-in-LINK_.patch
From 573a66e4146c9a65d895af9081a4d3d49cfc9e7a Mon Sep 17 00:00:00 2001
From 7b50823d8a4131e5a55d2499a0f5a52b3d91eed2 Mon Sep 17 00:00:00 2001
From: Drew DeVault <sir@cmpwn.com>
Date: Wed, 9 Dec 2020 16:07:26 +0000
Subject: [PATCH] configure: Add --enable-autolink-libatomic, use in
Date: Wed, 9 Dec 2020 07:42:06 +0000
Subject: [PATCH 27/35] configure: Add --enable-autolink-libatomic, use in
LINK_GCC_C_SEQUENCE_SPEC [PR81358]
This fixes issues with RISC-V.
@ -13,19 +13,19 @@ This fixes issues with RISC-V.
Makefile.in | 1 +
gcc/config.in | 6 ++++++
gcc/config/gnu-user.h | 12 +++++++++++-
gcc/configure | 32 ++++++++++++++++++++++++++++++--
gcc/configure.ac | 22 +++++++++++++++++++++-
gcc/configure | 31 ++++++++++++++++++++++++++++++-
gcc/configure.ac | 21 +++++++++++++++++++++
gcc/doc/install.texi | 8 ++++++++
gcc/doc/tm.texi | 8 +++++++-
gcc/doc/tm.texi.in | 8 +++++++-
gcc/gcc.cc | 12 +++++++++++-
9 files changed, 102 insertions(+), 7 deletions(-)
9 files changed, 102 insertions(+), 5 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index b564ddbf792..a95c7407d16 100644
index 6ff2b3f9925..394b105b271 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -232,6 +232,7 @@ HOST_EXPORTS = \
@@ -235,6 +235,7 @@ HOST_EXPORTS = \
RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)"; export RANLIB_FOR_TARGET; \
READELF_FOR_TARGET="$(READELF_FOR_TARGET)"; export READELF_FOR_TARGET; \
TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
@ -34,7 +34,7 @@ index b564ddbf792..a95c7407d16 100644
GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
GMPINC="$(HOST_GMPINC)"; export GMPINC; \
diff --git a/gcc/config.in b/gcc/config.in
index f0fbf123aa8..af84efc4f9e 100644
index 0679fbbf4c6..ee81139b385 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -118,6 +118,12 @@
@ -51,7 +51,7 @@ index f0fbf123aa8..af84efc4f9e 100644
format instead of DPD */
#ifndef USED_FOR_TARGET
diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
index 8433e56c3e1..0347f10da8b 100644
index b26b17f2f2a..3f64ea46180 100644
--- a/gcc/config/gnu-user.h
+++ b/gcc/config/gnu-user.h
@@ -109,8 +109,18 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
@ -75,10 +75,10 @@ index 8433e56c3e1..0347f10da8b 100644
#undef LINK_GCC_C_SEQUENCE_SPEC
diff --git a/gcc/configure b/gcc/configure
index 2f6b3265a6c..6dc65bf4ccb 100755
index e59cbee1767..787c35d4e25 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -981,6 +981,7 @@ with_changes_root_url
@@ -984,6 +984,7 @@ with_changes_root_url
enable_languages
with_multilib_list
with_multilib_generator
@ -86,7 +86,7 @@ index 2f6b3265a6c..6dc65bf4ccb 100755
with_zstd
with_zstd_include
with_zstd_lib
@@ -1710,6 +1711,9 @@ Optional Features:
@@ -1713,6 +1714,9 @@ Optional Features:
--disable-shared don't provide a shared libgcc
--disable-gcov don't provide libgcov and related host tools
--enable-languages=LIST specify which front-ends to build
@ -96,7 +96,7 @@ index 2f6b3265a6c..6dc65bf4ccb 100755
--disable-rpath do not hardcode runtime library paths
--enable-sjlj-exceptions
arrange to use setjmp/longjmp exception handling
@@ -8324,7 +8328,6 @@ else
@@ -8329,7 +8333,6 @@ else
fi
@ -104,7 +104,7 @@ index 2f6b3265a6c..6dc65bf4ccb 100755
# Check whether --with-multilib-generator was given.
if test "${with_multilib_generator+set}" = set; then :
withval=$with_multilib_generator; :
@@ -8332,6 +8335,32 @@ else
@@ -8337,6 +8340,32 @@ else
with_multilib_generator=default
fi
@ -137,16 +137,11 @@ index 2f6b3265a6c..6dc65bf4ccb 100755
# -------------------------
# Checks for other programs
@@ -34296,4 +34325,3 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
-
diff --git a/gcc/configure.ac b/gcc/configure.ac
index e683d3a7a5f..07c81c78336 100644
index 57268319de1..56bcaa87620 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -1205,6 +1205,27 @@ AC_ARG_WITH(multilib-generator,
@@ -1199,6 +1199,27 @@ AC_ARG_WITH(multilib-generator,
:,
with_multilib_generator=default)
@ -174,16 +169,11 @@ index e683d3a7a5f..07c81c78336 100644
# -------------------------
# Checks for other programs
# -------------------------
@@ -7839,4 +7860,3 @@ done
],
[subdirs='$subdirs'])
AC_OUTPUT
-
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 48408d842db..c90be0ee750 100644
index b30d3691fe6..ccc8e5dbb00 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -2295,6 +2295,14 @@ files, but these changed header paths may conflict with some compilation
@@ -2377,6 +2377,14 @@ files, but these changed header paths may conflict with some compilation
environments. Enabled by default, and may be disabled using
@option{--disable-canonical-system-headers}.
@ -199,7 +189,7 @@ index 48408d842db..c90be0ee750 100644
Tell GCC that when the GNU C Library (glibc) is used on the target it
will be version @var{major}.@var{minor} or later. Normally this can
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index c5006afc00d..56b62c69ae8 100644
index a660e33739b..6183c407a2b 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -381,7 +381,13 @@ the argument @option{-lgcc} to tell the linker to do the search.
@ -218,7 +208,7 @@ index c5006afc00d..56b62c69ae8 100644
@defmac POST_LINK_SPEC
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index f869ddd5e5b..57c93f24ac3 100644
index f7ab5d48a63..281540aba68 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -381,7 +381,13 @@ the argument @option{-lgcc} to tell the linker to do the search.
@ -237,10 +227,10 @@ index f869ddd5e5b..57c93f24ac3 100644
@defmac POST_LINK_SPEC
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 735b2b1bba1..f10f3c91aa7 100644
index 59390fd39d6..dae1dd4cf79 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -987,13 +987,23 @@ proper position among the other output files. */
@@ -974,13 +974,23 @@ proper position among the other output files. */
# define ASM_DEBUG_OPTION_SPEC ""
#endif

View file

@ -3,14 +3,14 @@
# which use the version number.
pkgname=gcc
version=12.2.0
revision=4
version=13.2.0
revision=1
_minorver="${version%.*}"
_majorver="${_minorver%.*}"
_gmp_version=6.2.1
_mpfr_version=4.1.0
_mpc_version=1.2.1
_isl_version=0.24
_gmp_version=6.3.0
_mpfr_version=4.2.1
_mpc_version=1.3.1
_isl_version=0.26
create_wrksrc=yes
short_desc="GNU Compiler Collection"
maintainer="Enno Boland <gottox@voidlinux.org>"
@ -19,16 +19,17 @@ license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
# *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
distfiles="
${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
${GNU_SITE}/gmp/gmp-${_gmp_version}.tar.xz
${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
${SOURCEFORGE_SITE}/libisl/isl-${_isl_version}.tar.bz2"
checksum="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459
fcf78dd9656c10eb8cf9fbd5f59a0b6b01386205fe1934b3b287a0a1898145c0"
checksum="e275e76442a6067341a27f04c5c6b83d8613144004c0413528863dc6b5c743da
a3c2b80201b89e68616f4ad30bc66aee4927c3ce50e33929ca819d5c43538898
277807353a6726978996945af13e52829e3abd7a9a5b7fb2793894e18f1fcbb2
ab642492f5cf882b74aa0cb730cd410a81edcdbec895183ce930e706c1c759b8
5eac8664e9d67be6bd0bee5085d6840b8baf738c06814df47eaf4166d9776436"
nocross=temporarily
nopie=yes
lib32disabled=yes
bootstrap=yes
@ -36,6 +37,7 @@ replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0
libssp>=0 libssp-devel>=0"
_have_gccgo=yes
_have_libquadmath=no
# MIPS is untested and does not have go in crosstoolchains
# 32-bit PowerPC seems weirdly broken since the 10.x release
@ -45,6 +47,10 @@ case "$XBPS_TARGET_MACHINE" in
mips*-musl|ppc*) _have_gccgo=no ;;
esac
case "$XBPS_TARGET_MACHINE" in
i686*|x86_64*|ppc64le) _have_libquadmath=yes ;;
esac
if [ "$CHROOT_READY" ]; then
hostmakedepends="tar texinfo perl flex"
else
@ -85,6 +91,10 @@ fi
if [ "$CHROOT_READY" ]; then
subpackages+=" gcc-fortran libgfortran-devel libgfortran"
subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
if [ "$_have_libquadmath" = "yes" ]; then
subpackages+=" libquadmath libquadmath-devel"
fi
fi
if [ "$_have_gccgo" = "yes" ]; then
@ -136,12 +146,8 @@ case "$XBPS_TARGET_MACHINE" in
esac
case "$XBPS_TARGET_MACHINE" in
i686*|x86_64*)
subpackages+=" libquadmath libquadmath-devel"
subpackages+=" libvtv libvtv-devel"
;;
ppc64le)
subpackages+=" libquadmath libquadmath-devel"
;;
esac
case "$XBPS_TARGET_MACHINE" in
mips*) ;;
@ -187,8 +193,12 @@ pre_configure() {
# Do not run fixincludes
sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
# Do not enable C++17, gcc compiles with -std=c++11
sed -i 's/HAVE_CXX17=1/HAVE_CXX17=0/' isl/configure
if [ "$XBPS_TARGET_LIBC" = musl ]; then
for p in ${FILESDIR}/*-musl.patch; do
msg_normal "patching: $p\n"
patch -p1 -i $p
done
fi
@ -385,10 +395,9 @@ do_install() {
vman ${FILESDIR}/${f}.1
done
case "$XBPS_TARGET_MACHINE" in
i686*|x86_64*|ppc64le) ;;
*) rm -f ${DESTDIR}/usr/share/info/libquadmath.info;;
esac
if [ "$_have_libquadmath" != "yes"]; then
rm -f ${DESTDIR}/usr/share/info/libquadmath.info*
fi
}
gcc-ada_package() {
@ -502,6 +511,11 @@ libada_package() {
libgfortran-devel_package() {
depends="libgfortran>=${_minorver}"
short_desc+=" - Fortran library - development files"
if [ "$_have_libquadmath" = "yes" ]; then
depends+=" libquadmath-devel"
fi
pkg_install() {
vmove usr/lib/libgfortran.spec
vmove usr/lib/libgfortran.a
@ -675,7 +689,7 @@ libsanitizer-devel_package() {
pkg_install() {
vmove "usr/lib/lib*san*.so"
vmove "usr/lib/lib*san*.a"
vmove usr/lib/libasan_preinit.o
vmove "usr/lib/lib*san_preinit.o"
vmove usr/lib/libsanitizer.spec
}
}