From 411d9929b4ed25956af216c643e9c165a8fc26a6 Mon Sep 17 00:00:00 2001 From: lane-brain Date: Mon, 15 Feb 2021 20:32:51 -0500 Subject: [PATCH] New package: libgccjit-10.2.1_pre1 --- srcpkgs/libgccjit/files/c89.1 | 80 ++++++ srcpkgs/libgccjit/files/c89.sh | 2 + srcpkgs/libgccjit/files/c99.1 | 81 ++++++ srcpkgs/libgccjit/files/c99.sh | 2 + srcpkgs/libgccjit/files/gccgo-musl.patch | 222 ++++++++++++++++ srcpkgs/libgccjit/files/libgnarl-musl.patch | 125 +++++++++ srcpkgs/libgccjit/files/libssp-musl.patch | 70 +++++ srcpkgs/libgccjit/patches/ada-shared.patch | 28 ++ .../patches/consistent-library-paths.patch | 110 ++++++++ .../patches/fix-cxxflags-passing.patch | 10 + .../libgccjit/patches/fix-musl-execinfo.patch | 33 +++ .../patches/fix-vtv-link-order.patch | 20 ++ .../libgccjit/patches/libffi_gnulinux.patch | 11 + .../patches/libgcc-ibm128-no-tag.patch | 38 +++ .../libgccjit/patches/mips-sgidefs_h.patch | 11 + .../libgccjit/patches/mips-soft-float.patch | 18 ++ srcpkgs/libgccjit/patches/musl-ada.patch | 204 +++++++++++++++ srcpkgs/libgccjit/template | 241 ++++++++++++++++++ srcpkgs/libgccjit/update | 2 + 19 files changed, 1308 insertions(+) create mode 100644 srcpkgs/libgccjit/files/c89.1 create mode 100644 srcpkgs/libgccjit/files/c89.sh create mode 100644 srcpkgs/libgccjit/files/c99.1 create mode 100644 srcpkgs/libgccjit/files/c99.sh create mode 100644 srcpkgs/libgccjit/files/gccgo-musl.patch create mode 100644 srcpkgs/libgccjit/files/libgnarl-musl.patch create mode 100644 srcpkgs/libgccjit/files/libssp-musl.patch create mode 100644 srcpkgs/libgccjit/patches/ada-shared.patch create mode 100644 srcpkgs/libgccjit/patches/consistent-library-paths.patch create mode 100644 srcpkgs/libgccjit/patches/fix-cxxflags-passing.patch create mode 100644 srcpkgs/libgccjit/patches/fix-musl-execinfo.patch create mode 100644 srcpkgs/libgccjit/patches/fix-vtv-link-order.patch create mode 100644 srcpkgs/libgccjit/patches/libffi_gnulinux.patch create mode 100644 srcpkgs/libgccjit/patches/libgcc-ibm128-no-tag.patch create mode 100644 srcpkgs/libgccjit/patches/mips-sgidefs_h.patch create mode 100644 srcpkgs/libgccjit/patches/mips-soft-float.patch create mode 100644 srcpkgs/libgccjit/patches/musl-ada.patch create mode 100644 srcpkgs/libgccjit/template create mode 100644 srcpkgs/libgccjit/update diff --git a/srcpkgs/libgccjit/files/c89.1 b/srcpkgs/libgccjit/files/c89.1 new file mode 100644 index 00000000000..3ed984da33f --- /dev/null +++ b/srcpkgs/libgccjit/files/c89.1 @@ -0,0 +1,80 @@ +.\" $NetBSD: c89.1,v 1.2 2008/04/30 13:10:50 martin Exp $ +.\" +.\" Copyright (c) 1999 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd January 5, 1999 +.Dt C89 1 +.Os +.Sh NAME +.Nm c89 +.Nd ANSI (1989) C compiler +.Sh SYNOPSIS +.Nm +.Op Fl pedantic +.Op Fl pedantic-errors +.Op Fl D_ANSI_SOURCE +.Op options ... +.Sh DESCRIPTION +Calls the C compiler (cc) with the given +.Ar options , +using a C language environment compatible with the +.St -ansiC +specification. +.Pp +This includes proper handling of trigraphs, +disabling non-ANSI compiler features (such as +.Ar asm , +.Ar inline , +.Ar typeof , +and the $ character in identifiers), +and definition of the preprocessor symbol +.Ev __STRICT_ANSI__ . +.Pp +The following options are available: +.Bl -tag -width -pedantic-errorsxx +.It Fl pedantic +Issue extra warnings defined by ANSI for use of non-ANSI features. +.It Fl pedantic-errors +Issue errors instead of warnings that normally would be presented by +.Fl pedantic . +.It Fl D_ANSI_SOURCE +Tell the system header file set to use an ANSI-conformant "clean" namespace. +.El +.Sh SEE ALSO +.Xr cc 1 +.Sh STANDARDS +.Nm +conforms to +.St -p1003.2-92 . +.Sh HISTORY +.Nm +appeared in +.Nx 1.4 . +.Sh BUGS +Since +.Nm +is a shell wrapper script to +.Ar cc , +compile errors are prefixed by "cc:". diff --git a/srcpkgs/libgccjit/files/c89.sh b/srcpkgs/libgccjit/files/c89.sh new file mode 100644 index 00000000000..52d6d45431b --- /dev/null +++ b/srcpkgs/libgccjit/files/c89.sh @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/cc -std=c89 "$@" diff --git a/srcpkgs/libgccjit/files/c99.1 b/srcpkgs/libgccjit/files/c99.1 new file mode 100644 index 00000000000..d368f1a874b --- /dev/null +++ b/srcpkgs/libgccjit/files/c99.1 @@ -0,0 +1,81 @@ +.\" $NetBSD: c99.1,v 1.3 2010/05/14 01:53:28 joerg Exp $ +.\" +.\" Copyright (c) 1999-2008 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd September 24, 2008 +.Dt C99 1 +.Os +.Sh NAME +.Nm c99 +.Nd ANSI (1999) C compiler +.Sh SYNOPSIS +.Nm +.Op Fl pedantic +.Op Fl pedantic-errors +.Op Fl D_ANSI_SOURCE +.Op options ... +.Sh DESCRIPTION +Calls the C compiler (cc) with the given +.Ar options , +using a C language environment compatible with the +.St -isoC-99 +specification. +.Pp +This includes +inline functions, variable-length arrays, support for one-line +comments beginning with //, +disabling non-ANSI compiler features (such as +.Ar asm , +.Ar typeof , +and the $ character in identifiers), +and definition of the preprocessor symbol +.Ev __STRICT_ANSI__ . +.Pp +The following options are available: +.Bl -tag -width -pedantic-errorsxx +.It Fl pedantic +Issue extra warnings defined by ANSI for use of non-ANSI features. +.It Fl pedantic-errors +Issue errors instead of warnings that normally would be presented by +.Fl pedantic . +.It Fl D_ANSI_SOURCE +Tell the system header file set to use an ANSI-conformant "clean" namespace. +.El +.Sh SEE ALSO +.Xr cc 1 +.Sh STANDARDS +.Nm +conforms to +.St -p1003.2-92 . +.Sh HISTORY +.Nm +first appeared in +.Nx 5.0 . +.Sh BUGS +Since +.Nm +is a shell wrapper script to +.Ar cc , +compile errors are prefixed by "cc:". diff --git a/srcpkgs/libgccjit/files/c99.sh b/srcpkgs/libgccjit/files/c99.sh new file mode 100644 index 00000000000..15cab47c748 --- /dev/null +++ b/srcpkgs/libgccjit/files/c99.sh @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/cc -std=c99 "$@" diff --git a/srcpkgs/libgccjit/files/gccgo-musl.patch b/srcpkgs/libgccjit/files/gccgo-musl.patch new file mode 100644 index 00000000000..a2ce4b2b046 --- /dev/null +++ b/srcpkgs/libgccjit/files/gccgo-musl.patch @@ -0,0 +1,222 @@ +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 + +--- Makefile.in ++++ 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} \ +--- libgo/mksysinfo.sh ++++ 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} +--- libgo/go/runtime/mem_gccgo.go ++++ libgo/go/runtime/mem_gccgo.go +@@ -16,7 +16,7 @@ import ( + //go:linkname sysFree runtime.sysFree + + //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 munmap + func munmap(addr unsafe.Pointer, length uintptr) int32 +@@ -38,7 +38,7 @@ func init() { + } + } + +-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() +--- libgo/go/runtime/signal_gccgo.go ++++ libgo/go/runtime/signal_gccgo.go +@@ -111,7 +111,7 @@ func getsig(i uint32) uintptr { + if sigaction(i, nil, &sa) < 0 { + // On GNU/Linux glibc rejects attempts to call + // sigaction with signal 32 (SIGCANCEL) or 33 (SIGSETXID). +- if GOOS == "linux" && (i == 32 || i == 33) { ++ if GOOS == "linux" && (i == 32 || i == 33 || i == 34) { + return _SIG_DFL + } + throw("sigaction read failure") +--- libgo/go/syscall/errstr.go ++++ libgo/go/syscall/errstr.go +@@ -5,7 +5,6 @@ + // license that can be found in the LICENSE file. + + // +build !hurd +-// +build !linux + + package syscall + +--- 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]) +-} +--- libgo/go/syscall/libcall_linux.go ++++ 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 + +-//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) +--- libgo/mksigtab.sh ++++ libgo/mksigtab.sh +@@ -82,7 +82,7 @@ checksig _SIGPWR '{_SigNotify, "SIGPWR: power failure restart"}' + checksig _SIGEMT '{_SigThrow, "SIGEMT: emulate instruction executed"}' + checksig _SIGINFO '{_SigNotify, "SIGINFO: status request from keyboard"}' + checksig _SIGTHR '{_SigNotify, "SIGTHR: reserved"}' +-checksig _SIGPOLL '{_SigNotify, "SIGPOLL: pollable event occurred"}' ++#checksig _SIGPOLL '{_SigNotify, "SIGPOLL: pollable event occurred"}' + checksig _SIGWAITING '{_SigNotify, "SIGWAITING: reserved signal no longer used by"}' + checksig _SIGLWP '{_SigNotify, "SIGLWP: reserved signal no longer used by"}' + checksig _SIGFREEZE '{_SigNotify, "SIGFREEZE: special signal used by CPR"}' +@@ -95,10 +95,12 @@ checksig _SIGLOST ' {_SigNotify, "SIGLOST: resource lost (Sun); server died (G + + # Special handling of signals 32 and 33 on GNU/Linux systems, + # because they are special to glibc. ++# Signal 34 is additionally special to Linux systems with musl. + if test "${GOOS}" = "linux"; then +- SIGLIST=$SIGLIST"_32__33_" ++ SIGLIST=$SIGLIST"_32__33__34_" + echo ' 32: {_SigSetStack + _SigUnblock, "signal 32"}, /* SIGCANCEL; see issue 6997 */' + echo ' 33: {_SigSetStack + _SigUnblock, "signal 33"}, /* SIGSETXID; see issues 3871, 9400, 12498 */' ++ echo ' 34: {_SigSetStack + _SigUnblock, "signal 34"}, /* see issue 30062 */' + fi + + if test "${GOOS}" = "aix"; then +--- libgo/runtime/go-signal.c 2020-07-23 08:35:19.004402840 +0200 ++++ - 2020-08-09 21:35:54.352886232 +0200 +@@ -224,7 +224,11 @@ + #elif defined(__alpha__) && defined(__linux__) + ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.sc_pc; + #elif defined(__PPC__) && defined(__linux__) +- ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.regs->nip; ++ #ifdef __PPC64__ ++ ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32]; ++ #else ++ ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32]; ++ #endif + #elif defined(__PPC__) && defined(_AIX) + ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar; + #elif defined(__aarch64__) && defined(__linux__) +@@ -333,7 +337,7 @@ + runtime_printf("sp %X\n", m->sc_regs[30]); + runtime_printf("pc %X\n", m->sc_pc); + } +-#elif defined(__PPC__) && defined(__LITTLE_ENDIAN__) && defined(__linux__) ++#elif defined(__PPC__) && defined(__LITTLE_ENDIAN__) && defined(__linux__) && defined(__GLIBC__) + { + mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext; + int i; +--- libgo/runtime/runtime.h ++++ 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. +--- libgo/sysinfo.c ++++ libgo/sysinfo.c +@@ -73,9 +73,6 @@ + #include + #include + #include +-#if defined(HAVE_SYS_USER_H) +-#include +-#endif + #if defined(HAVE_SYS_UTSNAME_H) + #include + #endif diff --git a/srcpkgs/libgccjit/files/libgnarl-musl.patch b/srcpkgs/libgccjit/files/libgnarl-musl.patch new file mode 100644 index 00000000000..5ed9f16f558 --- /dev/null +++ b/srcpkgs/libgccjit/files/libgnarl-musl.patch @@ -0,0 +1,125 @@ +Source: Alpine Linux +Upstream: Unknown +Reason: Patch libgnarl to not use function missing from musl. + +diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-osinte__linux.ads gcc-8.2.0-new/gcc/ada/libgnarl/s-osinte__linux.ads +--- gcc/ada/libgnarl/s-osinte__linux.ads 2018-01-11 00:55:25.000000000 -0800 ++++ gcc/ada/libgnarl/s-osinte__linux.ads 2018-11-01 16:16:23.372452951 -0700 +@@ -394,12 +394,6 @@ package System.OS_Interface is + PTHREAD_RWLOCK_PREFER_WRITER_NP : constant := 1; + PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2; + +- function pthread_rwlockattr_setkind_np +- (attr : access pthread_rwlockattr_t; +- pref : int) return int; +- pragma Import +- (C, pthread_rwlockattr_setkind_np, "pthread_rwlockattr_setkind_np"); +- + function pthread_rwlock_init + (mutex : access pthread_rwlock_t; + attr : access pthread_rwlockattr_t) return int; +@@ -464,11 +458,6 @@ package System.OS_Interface is + protocol : int) return int; + pragma Import (C, pthread_mutexattr_setprotocol); + +- function pthread_mutexattr_setprioceiling +- (attr : access pthread_mutexattr_t; +- prioceiling : int) return int; +- pragma Import (C, pthread_mutexattr_setprioceiling); +- + type struct_sched_param is record + sched_priority : int; -- scheduling priority + end record; +diff -rup gcc-8.2.0/gcc/ada/libgnarl/s-taprop__linux.adb gcc-8.2.0-new/gcc/ada/libgnarl/s-taprop__linux.adb +--- gcc/ada/libgnarl/s-taprop__linux.adb 2018-01-11 00:55:25.000000000 -0800 ++++ gcc/ada/libgnarl/s-taprop__linux.adb 2018-11-13 11:28:36.433964449 -0800 +@@ -202,9 +202,6 @@ package body System.Task_Primitives.Oper + pragma Import + (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup"); + +- function GNAT_has_cap_sys_nice return C.int; +- pragma Import +- (C, GNAT_has_cap_sys_nice, "__gnat_has_cap_sys_nice"); + -- We do not have pragma Linker_Options ("-lcap"); here, because this + -- library is not present on many Linux systems. 'libcap' is the Linux + -- "capabilities" library, called by __gnat_has_cap_sys_nice. +@@ -214,38 +211,6 @@ package body System.Task_Primitives.Oper + -- Convert Ada priority to Linux priority. Priorities are 1 .. 99 on + -- GNU/Linux, so we map 0 .. 98 to 1 .. 99. + +- function Get_Ceiling_Support return Boolean; +- -- Get the value of the Ceiling_Support constant (see below). +- -- Note well: If this function or related code is modified, it should be +- -- tested by hand, because automated testing doesn't exercise it. +- +- ------------------------- +- -- Get_Ceiling_Support -- +- ------------------------- +- +- function Get_Ceiling_Support return Boolean is +- Ceiling_Support : Boolean := False; +- begin +- if Locking_Policy /= 'C' then +- return False; +- end if; +- +- declare +- function geteuid return Integer; +- pragma Import (C, geteuid, "geteuid"); +- Superuser : constant Boolean := geteuid = 0; +- Has_Cap : constant C.int := GNAT_has_cap_sys_nice; +- pragma Assert (Has_Cap in 0 | 1); +- begin +- Ceiling_Support := Superuser or else Has_Cap = 1; +- end; +- +- return Ceiling_Support; +- end Get_Ceiling_Support; +- +- pragma Warnings (Off, "non-static call not allowed in preelaborated unit"); +- Ceiling_Support : constant Boolean := Get_Ceiling_Support; +- pragma Warnings (On, "non-static call not allowed in preelaborated unit"); + -- True if the locking policy is Ceiling_Locking, and the current process + -- has permission to use this policy. The process has permission if it is + -- running as 'root', or if the capability was set by the setcap command, +@@ -348,7 +313,9 @@ package body System.Task_Primitives.Oper + -- Init_Mutex -- + ---------------- + ++ pragma Warnings (Off, "formal parameter * is not referenced"); + function Init_Mutex (L : RTS_Lock_Ptr; Prio : Any_Priority) return C.int is ++ pragma Warnings (On, "formal parameter * is not referenced"); + Mutex_Attr : aliased pthread_mutexattr_t; + Result, Result_2 : C.int; + +@@ -360,16 +327,7 @@ package body System.Task_Primitives.Oper + return Result; + end if; + +- if Ceiling_Support then +- Result := pthread_mutexattr_setprotocol +- (Mutex_Attr'Access, PTHREAD_PRIO_PROTECT); +- pragma Assert (Result = 0); +- +- Result := pthread_mutexattr_setprioceiling +- (Mutex_Attr'Access, Prio_To_Linux_Prio (Prio)); +- pragma Assert (Result = 0); +- +- elsif Locking_Policy = 'I' then ++ if Locking_Policy = 'I' then + Result := pthread_mutexattr_setprotocol + (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT); + pragma Assert (Result = 0); +@@ -409,11 +367,6 @@ package body System.Task_Primitives.Oper + Result := pthread_rwlockattr_init (RWlock_Attr'Access); + pragma Assert (Result = 0); + +- Result := pthread_rwlockattr_setkind_np +- (RWlock_Attr'Access, +- PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP); +- pragma Assert (Result = 0); +- + Result := pthread_rwlock_init (L.RW'Access, RWlock_Attr'Access); + + pragma Assert (Result in 0 | ENOMEM); + diff --git a/srcpkgs/libgccjit/files/libssp-musl.patch b/srcpkgs/libgccjit/files/libssp-musl.patch new file mode 100644 index 00000000000..e0b84f9acc9 --- /dev/null +++ b/srcpkgs/libgccjit/files/libssp-musl.patch @@ -0,0 +1,70 @@ +First part taken from Alpine. + +Second part added to prevent gccgo from thinking it can -fsplit-stack on musl. + +--- gcc/gcc.c ++++ gcc/gcc.c +@@ -874,10 +874,15 @@ proper position among the other output files. */ + #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}" + #endif + ++#ifdef ENABLE_DEFAULT_SSP ++#define NO_SSP_SPEC "%{nostdlib|nodefaultlibs|ffreestanding:-fno-stack-protector} " ++#else ++#define NO_SSP_SPEC "" ++#endif ++ + #ifndef LINK_SSP_SPEC + #ifdef TARGET_LIBC_PROVIDES_SSP +-#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ +- "|fstack-protector-strong|fstack-protector-explicit:}" ++#define LINK_SSP_SPEC "-lssp_nonshared" + #else + #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ + "|fstack-protector-strong|fstack-protector-explicit" \ +@@ -1155,7 +1160,7 @@ static const char *cc1_options = + %{-version:--version}\ + %{-help=*:--help=%*}\ + %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\ +- %{fsyntax-only:-o %j} %{-param*}\ ++ %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\ + %{coverage:-fprofile-arcs -ftest-coverage}\ + %{fprofile-arcs|fprofile-generate*|coverage:\ + %{!fprofile-update=single:\ +--- gcc/params.opt ++++ gcc/params.opt +@@ -853,7 +853,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim + The maximum number of SSA_NAME assignments to follow in determining a value. + + -param=ssp-buffer-size= +-Common Joined UInteger Var(param_ssp_buffer_size) Init(8) IntegerRange(1, 65536) Param Optimization ++Common Joined UInteger Var(param_ssp_buffer_size) Init(4) IntegerRange(1, 65536) Param Optimization + The lower bound for a buffer to be considered for stack smashing protection. + + -param=stack-clash-protection-guard-size= +--- gcc/config/i386/gnu-user-common.h ++++ 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 +--- gcc/config/i386/gnu.h ++++ gcc/config/i386/gnu.h +@@ -40,11 +40,6 @@ along with GCC. If not, see . + /* 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 diff --git a/srcpkgs/libgccjit/patches/ada-shared.patch b/srcpkgs/libgccjit/patches/ada-shared.patch new file mode 100644 index 00000000000..7b4280620fe --- /dev/null +++ b/srcpkgs/libgccjit/patches/ada-shared.patch @@ -0,0 +1,28 @@ +--- gcc/ada/link.c ++++ gcc/ada/link.c +@@ -105,9 +105,9 @@ + + #elif defined (__FreeBSD__) + const char *__gnat_object_file_option = "-Wl,@"; +-const char *__gnat_run_path_option = "-Wl,-rpath,"; +-char __gnat_shared_libgnat_default = STATIC; +-char __gnat_shared_libgcc_default = STATIC; ++const char *__gnat_run_path_option = ""; ++char __gnat_shared_libgnat_default = SHARED; ++char __gnat_shared_libgcc_default = SHARED; + int __gnat_link_max = 8192; + unsigned char __gnat_objlist_file_supported = 1; + const char *__gnat_object_library_extension = ".a"; +@@ -127,9 +127,9 @@ + + #elif defined (linux) || defined(__GLIBC__) + const char *__gnat_object_file_option = "-Wl,@"; +-const char *__gnat_run_path_option = "-Wl,-rpath,"; +-char __gnat_shared_libgnat_default = STATIC; +-char __gnat_shared_libgcc_default = STATIC; ++const char *__gnat_run_path_option = ""; ++char __gnat_shared_libgnat_default = SHARED; ++char __gnat_shared_libgcc_default = SHARED; + int __gnat_link_max = 8192; + unsigned char __gnat_objlist_file_supported = 1; + const char *__gnat_object_library_extension = ".a"; diff --git a/srcpkgs/libgccjit/patches/consistent-library-paths.patch b/srcpkgs/libgccjit/patches/consistent-library-paths.patch new file mode 100644 index 00000000000..1ec0e258526 --- /dev/null +++ b/srcpkgs/libgccjit/patches/consistent-library-paths.patch @@ -0,0 +1,110 @@ +Always use lib64 for 64-bit and lib32 for 32-bit. + +Do not change the dynamic linkers in any way, though. + +When adding a new platform, fix this up too. + +--- gcc/config/aarch64/t-aarch64-linux ++++ gcc/config/aarch64/t-aarch64-linux +@@ -22,7 +22,7 @@ LIB1ASMSRC = aarch64/lib1funcs.asm + LIB1ASMFUNCS = _aarch64_sync_cache_range + + AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be) +-MULTILIB_OSDIRNAMES = mabi.lp64=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu) ++MULTILIB_OSDIRNAMES = mabi.lp64=../lib64 + MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu) + + MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu_ilp32) +--- gcc/config/i386/t-linux64 ++++ gcc/config/i386/t-linux64 +@@ -33,6 +33,6 @@ + comma=, + MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG)) + MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS))) +-MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu) +-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu) ++MULTILIB_OSDIRNAMES = m64=../lib64 ++MULTILIB_OSDIRNAMES+= m32=../lib32 + MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32) +--- gcc/config/mips/t-linux64 ++++ gcc/config/mips/t-linux64 +@@ -21,6 +21,6 @@ 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 = \ +- ../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)) ++ ../lib32 \ ++ ../lib \ ++ ../lib64 +--- gcc/config/rs6000/t-linux ++++ gcc/config/rs6000/t-linux +@@ -2,7 +2,8 @@ + # or soft-float. + ifeq (,$(filter $(with_cpu),$(SOFT_FLOAT_CPUS))$(findstring soft,$(with_float))) + ifneq (,$(findstring powerpc64,$(target))) +-MULTILIB_OSDIRNAMES := .=../lib64$(call if_multiarch,:powerpc64-linux-gnu) ++MULTILIB_OSDIRNAMES := m64=../lib64 ++MULTILIB_OSDIRNAMES += m32=../lib32 + else + MULTIARCH_DIRNAME := $(call if_multiarch,powerpc-linux-gnu) + endif +@@ -10,7 +11,8 @@ ifneq (,$(findstring powerpcle,$(target))) + MULTIARCH_DIRNAME := $(subst -linux,le-linux,$(MULTIARCH_DIRNAME)) + endif + ifneq (,$(findstring powerpc64le,$(target))) +-MULTILIB_OSDIRNAMES := $(subst -linux,le-linux,$(MULTILIB_OSDIRNAMES)) ++MULTILIB_OSDIRNAMES := m64=../lib64 ++MULTILIB_OSDIRNAMES += m32=../lib32 + endif + endif + +--- gcc/config/rs6000/t-linux64 ++++ gcc/config/rs6000/t-linux64 +@@ -28,8 +28,8 @@ + MULTILIB_OPTIONS := m64/m32 + MULTILIB_DIRNAMES := 64 32 + MULTILIB_EXTRA_OPTS := +-MULTILIB_OSDIRNAMES := m64=../lib64$(call if_multiarch,:powerpc64-linux-gnu) +-MULTILIB_OSDIRNAMES += m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:powerpc-linux-gnu) ++MULTILIB_OSDIRNAMES := m64=../lib64 ++MULTILIB_OSDIRNAMES += m32=../lib32 + + rs6000-linux.o: $(srcdir)/config/rs6000/rs6000-linux.c + $(COMPILE) $< +--- gcc/config/rs6000/t-linux64bele ++++ gcc/config/rs6000/t-linux64bele +@@ -2,6 +2,6 @@ + + MULTILIB_OPTIONS += mlittle + MULTILIB_DIRNAMES += le +-MULTILIB_OSDIRNAMES += $(subst =,.mlittle=,$(subst lible32,lib32le,$(subst lible64,lib64le,$(subst lib,lible,$(subst -linux,le-linux,$(MULTILIB_OSDIRNAMES)))))) +-MULTILIB_OSDIRNAMES += $(subst $(if $(findstring 64,$(target)),m64,m32).,,$(filter $(if $(findstring 64,$(target)),m64,m32).mlittle%,$(MULTILIB_OSDIRNAMES))) ++MULTILIB_OSDIRNAMES = m64=../lib64 ++MULTILIB_OSDIRNAMES+= m32=../lib32 + MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN} +--- gcc/config/rs6000/t-linux64lebe ++++ gcc/config/rs6000/t-linux64lebe +@@ -2,6 +2,6 @@ + + MULTILIB_OPTIONS += mbig + MULTILIB_DIRNAMES += be +-MULTILIB_OSDIRNAMES += $(subst =,.mbig=,$(subst libbe32,lib32be,$(subst libbe64,lib64be,$(subst lib,libbe,$(subst le-linux,-linux,$(MULTILIB_OSDIRNAMES)))))) +-MULTILIB_OSDIRNAMES += $(subst $(if $(findstring 64,$(target)),m64,m32).,,$(filter $(if $(findstring 64,$(target)),m64,m32).mbig%,$(MULTILIB_OSDIRNAMES))) ++MULTILIB_OSDIRNAMES := m64=../lib64 ++MULTILIB_OSDIRNAMES += m32=../lib32 + MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN} +--- gcc/config/s390/t-linux64 ++++ gcc/config/s390/t-linux64 +@@ -7,5 +7,5 @@ + + MULTILIB_OPTIONS = m64/m31 + MULTILIB_DIRNAMES = 64 32 +-MULTILIB_OSDIRNAMES = ../lib64$(call if_multiarch,:s390x-linux-gnu) +-MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:s390-linux-gnu) ++MULTILIB_OSDIRNAMES = m64=../lib64 ++MULTILIB_OSDIRNAMES+= m32=../lib32 +-- +2.29.2 + diff --git a/srcpkgs/libgccjit/patches/fix-cxxflags-passing.patch b/srcpkgs/libgccjit/patches/fix-cxxflags-passing.patch new file mode 100644 index 00000000000..dda2a50460b --- /dev/null +++ b/srcpkgs/libgccjit/patches/fix-cxxflags-passing.patch @@ -0,0 +1,10 @@ +--- Makefile.in.orig ++++ Makefile.in +@@ -169,6 +169,7 @@ + # built for the build system to override those in BASE_FLAGS_TO_PASSS. + EXTRA_BUILD_FLAGS = \ + CFLAGS="$(CFLAGS_FOR_BUILD)" \ ++ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \ + LDFLAGS="$(LDFLAGS_FOR_BUILD)" + + # This is the list of directories to built for the host system. diff --git a/srcpkgs/libgccjit/patches/fix-musl-execinfo.patch b/srcpkgs/libgccjit/patches/fix-musl-execinfo.patch new file mode 100644 index 00000000000..583eac7b0dc --- /dev/null +++ b/srcpkgs/libgccjit/patches/fix-musl-execinfo.patch @@ -0,0 +1,33 @@ +There is no in musl libc + +--- libvtv/vtv_rts.cc 2016-09-23 16:17:11.000000000 +0200 ++++ libvtc/vtv_rts.cc 2016-09-25 15:08:57.896000000 +0200 +@@ -124,7 +124,7 @@ + #include + #include + #include +-#else ++#elif defined (__GLIBC__) + #include + #endif + +--- libvtv/vtv_utils.cc 2016-09-23 16:17:11.000000000 +0200 ++++ libvtv/vtv_utils.cc 2016-09-25 15:15:35.529000000 +0200 +@@ -34,7 +34,7 @@ + #include + #if defined (__CYGWIN__) || defined (__MINGW32__) + #include +-#else ++#elif defined (__GLIBC__) + #include + #endif + +@@ -178,7 +178,7 @@ + + __vtv_add_to_log (vtv_failures_log_fd, "%s", log_msg); + +-#if !defined (__CYGWIN__) && !defined (__MINGW32__) ++#if !defined (__CYGWIN__) && !defined (__MINGW32__) && defined(__GLIBC__) + if (generate_backtrace) + { + #define STACK_DEPTH 20 diff --git a/srcpkgs/libgccjit/patches/fix-vtv-link-order.patch b/srcpkgs/libgccjit/patches/fix-vtv-link-order.patch new file mode 100644 index 00000000000..3315c3e990b --- /dev/null +++ b/srcpkgs/libgccjit/patches/fix-vtv-link-order.patch @@ -0,0 +1,20 @@ +put vtv_end.o in front of postdep_objects_CXX +having it after crtendS.o leads to missing zero termination in eh_frame section + +This is in line with comment in libgcc/vtv_end.c: + + When the GCC driver inserts vtv_start.o into the link line (just + after crtbegin.o) it also inserts vtv_end.o into the link line, + just before crtend.o. + +--- libstdc++-v3/configure ++++ libstdc++-v3/configure +@@ -15443,7 +15443,7 @@ + + if test "$enable_vtable_verify" = yes; then + predep_objects_CXX="${predep_objects_CXX} ${glibcxx_builddir}/../libgcc/vtv_start.o" +- postdep_objects_CXX="${postdep_objects_CXX} ${glibcxx_builddir}/../libgcc/vtv_end.o" ++ postdep_objects_CXX="${glibcxx_builddir}/../libgcc/vtv_end.o ${postdep_objects_CXX}" + fi + + diff --git a/srcpkgs/libgccjit/patches/libffi_gnulinux.patch b/srcpkgs/libgccjit/patches/libffi_gnulinux.patch new file mode 100644 index 00000000000..413b4aef5af --- /dev/null +++ b/srcpkgs/libgccjit/patches/libffi_gnulinux.patch @@ -0,0 +1,11 @@ +--- libffi/src/closures.c.orig ++++ libffi/src/closures.c +@@ -34,7 +34,7 @@ + #include + + #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE +-# if __gnu_linux__ && !defined(__ANDROID__) ++# if __linux__ && !defined(__ANDROID__) + /* This macro indicates it may be forbidden to map anonymous memory + with both write and execute permission. Code compiled when this + option is defined will attempt to map such pages once, but if it diff --git a/srcpkgs/libgccjit/patches/libgcc-ibm128-no-tag.patch b/srcpkgs/libgccjit/patches/libgcc-ibm128-no-tag.patch new file mode 100644 index 00000000000..855f8f1b035 --- /dev/null +++ b/srcpkgs/libgccjit/patches/libgcc-ibm128-no-tag.patch @@ -0,0 +1,38 @@ +From 236634eed58fa6e00cc50f19e7202903a9d8fae6 Mon Sep 17 00:00:00 2001 +From: q66 +Date: Thu, 12 Dec 2019 04:03:56 +0100 +Subject: [PATCH] libgcc: use -mno-gnu-attribute for 128-bit IBM ldouble + support code + +Doing this will allow libgcc to emit the appropriate symbols without actually +emitting the FP ABI tag for them, which allows 64-bit long double environments +to function and even link statically while still allowing usage of +explicit __ibm128. +--- + libgcc/config/rs6000/t-ibm-ldouble | 2 +- + libgcc/config/rs6000/t-linux | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libgcc/config/rs6000/t-ibm-ldouble b/libgcc/config/rs6000/t-ibm-ldouble +index b132784..fb5eca8 100644 +--- libgcc/config/rs6000/t-ibm-ldouble ++++ libgcc/config/rs6000/t-ibm-ldouble +@@ -1,6 +1,6 @@ + # GCC 128-bit long double support routines. + LIB2ADD += $(srcdir)/config/rs6000/ibm-ldouble.c + +-HOST_LIBGCC2_CFLAGS += -mlong-double-128 ++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute + + SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-ibm-ldouble.ver +diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux +index 4f6d4c4..fa93bb6 100644 +--- libgcc/config/rs6000/t-linux ++++ libgcc/config/rs6000/t-linux +@@ -1,3 +1,3 @@ + SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver + +-HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc ++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc +-- +2.24.0 diff --git a/srcpkgs/libgccjit/patches/mips-sgidefs_h.patch b/srcpkgs/libgccjit/patches/mips-sgidefs_h.patch new file mode 100644 index 00000000000..e5fdbf9f96f --- /dev/null +++ b/srcpkgs/libgccjit/patches/mips-sgidefs_h.patch @@ -0,0 +1,11 @@ +--- libffi/src/mips/ffitarget.h 2014-11-08 13:47:24.000000000 +0100 ++++ libffi/src/mips/ffitarget.h 2017-11-09 16:51:11.866848444 +0100 +@@ -42,7 +42,7 @@ + #define _MIPS_SIM_NABI32 2 + #define _MIPS_SIM_ABI64 3 + #elif !defined(__OpenBSD__) +-# include ++# include + #endif + + # ifndef _ABIN32 diff --git a/srcpkgs/libgccjit/patches/mips-soft-float.patch b/srcpkgs/libgccjit/patches/mips-soft-float.patch new file mode 100644 index 00000000000..4db0e2fb07a --- /dev/null +++ b/srcpkgs/libgccjit/patches/mips-soft-float.patch @@ -0,0 +1,18 @@ +--- libffi/src/mips/o32.S 2020-03-12 12:07:23.000000000 +0100 ++++ libffi/src/mips/o32.S 2020-05-14 20:52:45.701809054 +0200 +@@ -278,6 +278,7 @@ + li $9, FFI_TYPE_VOID + beq $8, $9, closure_done + ++#ifndef __mips_soft_float + li $13, 1 # FFI_O32 + bne $16, $13, 1f # Skip fp restore if FFI_O32_SOFT_FLOAT + +@@ -289,6 +290,7 @@ + l.d $f0, V0_OFF2($fp) + beq $8, $9, closure_done + 1: ++#endif + REG_L $3, V1_OFF2($fp) + REG_L $2, V0_OFF2($fp) + diff --git a/srcpkgs/libgccjit/patches/musl-ada.patch b/srcpkgs/libgccjit/patches/musl-ada.patch new file mode 100644 index 00000000000..61823684da5 --- /dev/null +++ b/srcpkgs/libgccjit/patches/musl-ada.patch @@ -0,0 +1,204 @@ +diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c +index 3b0aea9..ee0bb69 100644 +--- gcc/ada/adaint.c ++++ gcc/ada/adaint.c +@@ -76,6 +76,11 @@ + #include + #include + #endif ++ ++#if defined (linux) ++#define _GNU_SOURCE 1 ++#include ++#endif + + #ifdef __PikeOS__ + #define __BSD_VISIBLE 1 +@@ -3255,7 +3260,6 @@ __gnat_lwp_self (void) + #endif + + #if defined (__linux__) +-#include + + /* glibc versions earlier than 2.7 do not define the routines to handle + dynamically allocated CPU sets. For these targets, we use the static +@@ -3265,7 +3269,7 @@ __gnat_lwp_self (void) + + /* Dynamic cpu sets */ + +-cpu_set_t * ++void * + __gnat_cpu_alloc (size_t count) + { + return CPU_ALLOC (count); +@@ -3278,33 +3282,33 @@ __gnat_cpu_alloc_size (size_t count) + } + + void +-__gnat_cpu_free (cpu_set_t *set) ++__gnat_cpu_free (void *set) + { +- CPU_FREE (set); ++ CPU_FREE ((cpu_set_t *) set); + } + + void +-__gnat_cpu_zero (size_t count, cpu_set_t *set) ++__gnat_cpu_zero (size_t count, void *set) + { +- CPU_ZERO_S (count, set); ++ CPU_ZERO_S (count, (cpu_set_t *) set); + } + + void +-__gnat_cpu_set (int cpu, size_t count, cpu_set_t *set) ++__gnat_cpu_set (int cpu, size_t count, void *set) + { + /* Ada handles CPU numbers starting from 1, while C identifies the first + CPU by a 0, so we need to adjust. */ +- CPU_SET_S (cpu - 1, count, set); ++ CPU_SET_S (cpu - 1, count, (cpu_set_t *) set); + } + + #else /* !CPU_ALLOC */ + + /* Static cpu sets */ + +-cpu_set_t * ++void * + __gnat_cpu_alloc (size_t count ATTRIBUTE_UNUSED) + { +- return (cpu_set_t *) xmalloc (sizeof (cpu_set_t)); ++ return xmalloc (sizeof (cpu_set_t)); + } + + size_t +@@ -3314,23 +3318,23 @@ __gnat_cpu_alloc_size (size_t count ATTRIBUTE_UNUSED) + } + + void +-__gnat_cpu_free (cpu_set_t *set) ++__gnat_cpu_free (void *set) + { + free (set); + } + + void +-__gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, cpu_set_t *set) ++__gnat_cpu_zero (size_t count ATTRIBUTE_UNUSED, void *set) + { +- CPU_ZERO (set); ++ CPU_ZERO ((cpu_set_t *) set); + } + + void +-__gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, cpu_set_t *set) ++__gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, void *set) + { + /* Ada handles CPU numbers starting from 1, while C identifies the first + CPU by a 0, so we need to adjust. */ +- CPU_SET (cpu - 1, set); ++ CPU_SET (cpu - 1, (cpu_set_t *) set); + } + #endif /* !CPU_ALLOC */ + #endif /* __linux__ */ +diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h +index 0d12f7e..a063b47 100644 +--- gcc/ada/adaint.h ++++ gcc/ada/adaint.h +@@ -316,13 +316,11 @@ extern void *__gnat_lwp_self (void); + + /* Routines for interface to required CPU set primitives */ + +-#include +- +-extern cpu_set_t *__gnat_cpu_alloc (size_t); ++extern void * __gnat_cpu_alloc (size_t); + extern size_t __gnat_cpu_alloc_size (size_t); +-extern void __gnat_cpu_free (cpu_set_t *); +-extern void __gnat_cpu_zero (size_t, cpu_set_t *); +-extern void __gnat_cpu_set (int, size_t, cpu_set_t *); ++extern void __gnat_cpu_free (void *); ++extern void __gnat_cpu_zero (size_t, void *); ++extern void __gnat_cpu_set (int, size_t, void *); + #endif + + #if defined (_WIN32) +--- gcc/ada/Makefile.rtl 2020-07-23 08:35:17.052381336 +0200 ++++ - 2020-08-09 19:38:24.230351406 +0200 +@@ -1533,7 +1533,7 @@ + s-intman.adb