cross/gcc-*: upgrade to 12.2.1_git20220924-r4

This commit is contained in:
Oliver Smith 2022-11-02 15:27:11 +01:00
parent 5e2730d2db
commit d86cd0c188
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
8 changed files with 275 additions and 10 deletions

View file

@ -0,0 +1,65 @@
From 7b8400f902ef25ea71ed460716c1afedca357a61 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Wed, 2 Nov 2022 12:31:36 +0100
Subject: [PATCH] libphobos: fix undefined reference to `__cmsg_nxthdr' with
musl
Ported fix from upstream.
Upstream: https://github.com/dlang/dmd/commit/54544260a848c8ebad5582e27ac1e09627cdfb17
Bug-URL: https://issues.dlang.org/show_bug.cgi?id=23157
---
.../libdruntime/core/sys/posix/sys/socket.d | 36 +++++++++++++++++--
1 file changed, 33 insertions(+), 3 deletions(-)
diff --git a/libphobos/libdruntime/core/sys/posix/sys/socket.d b/libphobos/libdruntime/core/sys/posix/sys/socket.d
index c1309a68c9c..e3b536d87e7 100644
--- a/libphobos/libdruntime/core/sys/posix/sys/socket.d
+++ b/libphobos/libdruntime/core/sys/posix/sys/socket.d
@@ -188,10 +188,40 @@ version (linux)
extern (D) inout(ubyte)* CMSG_DATA( return scope inout(cmsghdr)* cmsg ) pure nothrow @nogc { return cast(ubyte*)( cmsg + 1 ); }
- private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
- extern (D) inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
+ version (CRuntime_Musl)
{
- return __cmsg_nxthdr(msg, cmsg);
+ extern (D)
+ {
+ private size_t __CMSG_LEN(inout(cmsghdr)* cmsg) pure nothrow @nogc
+ {
+ return (cmsg.cmsg_len + size_t.sizeof -1) & cast(size_t)(~(size_t.sizeof - 1));
+ }
+
+ private inout(cmsghdr)* __CMSG_NEXT(inout(cmsghdr)* cmsg) pure nothrow @nogc
+ {
+ return cmsg + __CMSG_LEN(cmsg);
+ }
+
+ private inout(msghdr)* __MHDR_END(inout(msghdr)* mhdr) pure nothrow @nogc
+ {
+ return cast(inout(msghdr)*)(mhdr.msg_control + mhdr.msg_controllen);
+ }
+
+ inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
+ {
+ return cmsg.cmsg_len < cmsghdr.sizeof ||
+ __CMSG_LEN(cmsg) + cmsghdr.sizeof >= __MHDR_END(msg) - cast(inout(msghdr)*)(cmsg)
+ ? cast(inout(cmsghdr)*) null : cast(inout(cmsghdr)*) __CMSG_NEXT(cmsg);
+ }
+ }
+ }
+ else
+ {
+ private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
+ extern (D) inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
+ {
+ return __cmsg_nxthdr(msg, cmsg);
+ }
}
extern (D) inout(cmsghdr)* CMSG_FIRSTHDR( inout(msghdr)* mhdr ) pure nothrow @nogc
--
2.38.1

View file

@ -10,7 +10,7 @@ LANG_JAVA=false
LANG_GO=false LANG_GO=false
LANG_FORTRAN=false LANG_FORTRAN=false
LANG_ADA=false LANG_ADA=false
options="!strip !tracedeps" options="!strip"
# abuild doesn't try to tries to install "build-base-$CTARGET_ARCH" # abuild doesn't try to tries to install "build-base-$CTARGET_ARCH"
# when this variable matches "no*" # when this variable matches "no*"
@ -24,7 +24,6 @@ CBUILDROOT="/"
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET" _cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
pkgname=gcc-aarch64 pkgname=gcc-aarch64
# FIXME WHEN UPGRADING: remove !tracedeps from options when upgrading to properly fix pma#1732 (we only have a workaround for now)
_pkgbase=12.2.1 # must match gcc/BASE-VER _pkgbase=12.2.1 # must match gcc/BASE-VER
_pkgsnap=20220924 _pkgsnap=20220924
pkgver=${_pkgbase}_git${_pkgsnap} pkgver=${_pkgbase}_git${_pkgsnap}
@ -33,7 +32,7 @@ pkgver=${_pkgbase}_git${_pkgsnap}
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target="" [ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
pkgname=gcc-aarch64 pkgname=gcc-aarch64
pkgrel=3 pkgrel=4
pkgdesc="Stage2 cross-compiler for aarch64" pkgdesc="Stage2 cross-compiler for aarch64"
url="https://gcc.gnu.org" url="https://gcc.gnu.org"
arch="x86_64" arch="x86_64"
@ -259,6 +258,7 @@ source="https://dev.alpinelinux.org/archive/gcc/${_pkgbase%%.*}-${_pkgsnap}/gcc-
0051-libgo-Explicitly-define-SYS_timer_settime-for-32-bit.patch 0051-libgo-Explicitly-define-SYS_timer_settime-for-32-bit.patch
0052-libgnat-time_t-is-always-64-bit-on-musl-libc.patch 0052-libgnat-time_t-is-always-64-bit-on-musl-libc.patch
0053-libgo-make-match.sh-POSIX-shell-compatible.patch 0053-libgo-make-match.sh-POSIX-shell-compatible.patch
0054-libphobos-fix-undefined-reference-to-__cmsg_nxthdr-w.patch
" "
# we build out-of-tree # we build out-of-tree
@ -810,4 +810,5 @@ c33ca2553642c2dbd1c65cd97046548f08775785a3db06d761e3bbe61398c37bc382fe132c0c3fa2
c82d7c8d340a76df3d796565a79b0ccc04ddffef39927620e1f3719bf2dc1db101ba13aef24b46c5bc95b7bf1e31c8bda4ab0936ba4c9c5e5047ba08826c982c 0051-libgo-Explicitly-define-SYS_timer_settime-for-32-bit.patch c82d7c8d340a76df3d796565a79b0ccc04ddffef39927620e1f3719bf2dc1db101ba13aef24b46c5bc95b7bf1e31c8bda4ab0936ba4c9c5e5047ba08826c982c 0051-libgo-Explicitly-define-SYS_timer_settime-for-32-bit.patch
eb403d8ea665fd5dc2c11faf43b055e6a3bf480a397ceee3e0ca1e38ec7d2392315f2694ed9a34ffbc99e464f2873fbbf91be8646ea4dea5d3636e3ea22fefa0 0052-libgnat-time_t-is-always-64-bit-on-musl-libc.patch eb403d8ea665fd5dc2c11faf43b055e6a3bf480a397ceee3e0ca1e38ec7d2392315f2694ed9a34ffbc99e464f2873fbbf91be8646ea4dea5d3636e3ea22fefa0 0052-libgnat-time_t-is-always-64-bit-on-musl-libc.patch
22fb6edf1ed0387e2b93839ffe6e82a7fee420950af90e91199c3488d966702fdeb1a3396d22be0c73a4051525da9349c93d070a0d83b724c83f2b268da6483f 0053-libgo-make-match.sh-POSIX-shell-compatible.patch 22fb6edf1ed0387e2b93839ffe6e82a7fee420950af90e91199c3488d966702fdeb1a3396d22be0c73a4051525da9349c93d070a0d83b724c83f2b268da6483f 0053-libgo-make-match.sh-POSIX-shell-compatible.patch
9b74d0a0e4140b597708a295bcf51b93944782698470e2ba9bc0f0d4a830fc418da9624eccc85f3d65ff6d50b8ebf40cecd34d5b045db9e6c29614e981e93f92 0054-libphobos-fix-undefined-reference-to-__cmsg_nxthdr-w.patch
" "

View file

@ -0,0 +1,65 @@
From 7b8400f902ef25ea71ed460716c1afedca357a61 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Wed, 2 Nov 2022 12:31:36 +0100
Subject: [PATCH] libphobos: fix undefined reference to `__cmsg_nxthdr' with
musl
Ported fix from upstream.
Upstream: https://github.com/dlang/dmd/commit/54544260a848c8ebad5582e27ac1e09627cdfb17
Bug-URL: https://issues.dlang.org/show_bug.cgi?id=23157
---
.../libdruntime/core/sys/posix/sys/socket.d | 36 +++++++++++++++++--
1 file changed, 33 insertions(+), 3 deletions(-)
diff --git a/libphobos/libdruntime/core/sys/posix/sys/socket.d b/libphobos/libdruntime/core/sys/posix/sys/socket.d
index c1309a68c9c..e3b536d87e7 100644
--- a/libphobos/libdruntime/core/sys/posix/sys/socket.d
+++ b/libphobos/libdruntime/core/sys/posix/sys/socket.d
@@ -188,10 +188,40 @@ version (linux)
extern (D) inout(ubyte)* CMSG_DATA( return scope inout(cmsghdr)* cmsg ) pure nothrow @nogc { return cast(ubyte*)( cmsg + 1 ); }
- private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
- extern (D) inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
+ version (CRuntime_Musl)
{
- return __cmsg_nxthdr(msg, cmsg);
+ extern (D)
+ {
+ private size_t __CMSG_LEN(inout(cmsghdr)* cmsg) pure nothrow @nogc
+ {
+ return (cmsg.cmsg_len + size_t.sizeof -1) & cast(size_t)(~(size_t.sizeof - 1));
+ }
+
+ private inout(cmsghdr)* __CMSG_NEXT(inout(cmsghdr)* cmsg) pure nothrow @nogc
+ {
+ return cmsg + __CMSG_LEN(cmsg);
+ }
+
+ private inout(msghdr)* __MHDR_END(inout(msghdr)* mhdr) pure nothrow @nogc
+ {
+ return cast(inout(msghdr)*)(mhdr.msg_control + mhdr.msg_controllen);
+ }
+
+ inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
+ {
+ return cmsg.cmsg_len < cmsghdr.sizeof ||
+ __CMSG_LEN(cmsg) + cmsghdr.sizeof >= __MHDR_END(msg) - cast(inout(msghdr)*)(cmsg)
+ ? cast(inout(cmsghdr)*) null : cast(inout(cmsghdr)*) __CMSG_NEXT(cmsg);
+ }
+ }
+ }
+ else
+ {
+ private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
+ extern (D) inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
+ {
+ return __cmsg_nxthdr(msg, cmsg);
+ }
}
extern (D) inout(cmsghdr)* CMSG_FIRSTHDR( inout(msghdr)* mhdr ) pure nothrow @nogc
--
2.38.1

View file

@ -10,7 +10,7 @@ LANG_JAVA=false
LANG_GO=false LANG_GO=false
LANG_FORTRAN=false LANG_FORTRAN=false
LANG_ADA=false LANG_ADA=false
options="!strip !tracedeps" options="!strip"
# abuild doesn't try to tries to install "build-base-$CTARGET_ARCH" # abuild doesn't try to tries to install "build-base-$CTARGET_ARCH"
# when this variable matches "no*" # when this variable matches "no*"
@ -24,7 +24,6 @@ CBUILDROOT="/"
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET" _cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
pkgname=gcc-armhf pkgname=gcc-armhf
# FIXME WHEN UPGRADING: remove !tracedeps from options when upgrading to properly fix pma#1732 (we only have a workaround for now)
_pkgbase=12.2.1 # must match gcc/BASE-VER _pkgbase=12.2.1 # must match gcc/BASE-VER
_pkgsnap=20220924 _pkgsnap=20220924
pkgver=${_pkgbase}_git${_pkgsnap} pkgver=${_pkgbase}_git${_pkgsnap}
@ -33,7 +32,7 @@ pkgver=${_pkgbase}_git${_pkgsnap}
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target="" [ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
pkgname=gcc-armhf pkgname=gcc-armhf
pkgrel=3 pkgrel=4
pkgdesc="Stage2 cross-compiler for armhf" pkgdesc="Stage2 cross-compiler for armhf"
url="https://gcc.gnu.org" url="https://gcc.gnu.org"
arch="x86_64" arch="x86_64"
@ -259,6 +258,7 @@ source="https://dev.alpinelinux.org/archive/gcc/${_pkgbase%%.*}-${_pkgsnap}/gcc-
0051-libgo-Explicitly-define-SYS_timer_settime-for-32-bit.patch 0051-libgo-Explicitly-define-SYS_timer_settime-for-32-bit.patch
0052-libgnat-time_t-is-always-64-bit-on-musl-libc.patch 0052-libgnat-time_t-is-always-64-bit-on-musl-libc.patch
0053-libgo-make-match.sh-POSIX-shell-compatible.patch 0053-libgo-make-match.sh-POSIX-shell-compatible.patch
0054-libphobos-fix-undefined-reference-to-__cmsg_nxthdr-w.patch
" "
# we build out-of-tree # we build out-of-tree
@ -810,4 +810,5 @@ c33ca2553642c2dbd1c65cd97046548f08775785a3db06d761e3bbe61398c37bc382fe132c0c3fa2
c82d7c8d340a76df3d796565a79b0ccc04ddffef39927620e1f3719bf2dc1db101ba13aef24b46c5bc95b7bf1e31c8bda4ab0936ba4c9c5e5047ba08826c982c 0051-libgo-Explicitly-define-SYS_timer_settime-for-32-bit.patch c82d7c8d340a76df3d796565a79b0ccc04ddffef39927620e1f3719bf2dc1db101ba13aef24b46c5bc95b7bf1e31c8bda4ab0936ba4c9c5e5047ba08826c982c 0051-libgo-Explicitly-define-SYS_timer_settime-for-32-bit.patch
eb403d8ea665fd5dc2c11faf43b055e6a3bf480a397ceee3e0ca1e38ec7d2392315f2694ed9a34ffbc99e464f2873fbbf91be8646ea4dea5d3636e3ea22fefa0 0052-libgnat-time_t-is-always-64-bit-on-musl-libc.patch eb403d8ea665fd5dc2c11faf43b055e6a3bf480a397ceee3e0ca1e38ec7d2392315f2694ed9a34ffbc99e464f2873fbbf91be8646ea4dea5d3636e3ea22fefa0 0052-libgnat-time_t-is-always-64-bit-on-musl-libc.patch
22fb6edf1ed0387e2b93839ffe6e82a7fee420950af90e91199c3488d966702fdeb1a3396d22be0c73a4051525da9349c93d070a0d83b724c83f2b268da6483f 0053-libgo-make-match.sh-POSIX-shell-compatible.patch 22fb6edf1ed0387e2b93839ffe6e82a7fee420950af90e91199c3488d966702fdeb1a3396d22be0c73a4051525da9349c93d070a0d83b724c83f2b268da6483f 0053-libgo-make-match.sh-POSIX-shell-compatible.patch
9b74d0a0e4140b597708a295bcf51b93944782698470e2ba9bc0f0d4a830fc418da9624eccc85f3d65ff6d50b8ebf40cecd34d5b045db9e6c29614e981e93f92 0054-libphobos-fix-undefined-reference-to-__cmsg_nxthdr-w.patch
" "

View file

@ -0,0 +1,65 @@
From 7b8400f902ef25ea71ed460716c1afedca357a61 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Wed, 2 Nov 2022 12:31:36 +0100
Subject: [PATCH] libphobos: fix undefined reference to `__cmsg_nxthdr' with
musl
Ported fix from upstream.
Upstream: https://github.com/dlang/dmd/commit/54544260a848c8ebad5582e27ac1e09627cdfb17
Bug-URL: https://issues.dlang.org/show_bug.cgi?id=23157
---
.../libdruntime/core/sys/posix/sys/socket.d | 36 +++++++++++++++++--
1 file changed, 33 insertions(+), 3 deletions(-)
diff --git a/libphobos/libdruntime/core/sys/posix/sys/socket.d b/libphobos/libdruntime/core/sys/posix/sys/socket.d
index c1309a68c9c..e3b536d87e7 100644
--- a/libphobos/libdruntime/core/sys/posix/sys/socket.d
+++ b/libphobos/libdruntime/core/sys/posix/sys/socket.d
@@ -188,10 +188,40 @@ version (linux)
extern (D) inout(ubyte)* CMSG_DATA( return scope inout(cmsghdr)* cmsg ) pure nothrow @nogc { return cast(ubyte*)( cmsg + 1 ); }
- private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
- extern (D) inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
+ version (CRuntime_Musl)
{
- return __cmsg_nxthdr(msg, cmsg);
+ extern (D)
+ {
+ private size_t __CMSG_LEN(inout(cmsghdr)* cmsg) pure nothrow @nogc
+ {
+ return (cmsg.cmsg_len + size_t.sizeof -1) & cast(size_t)(~(size_t.sizeof - 1));
+ }
+
+ private inout(cmsghdr)* __CMSG_NEXT(inout(cmsghdr)* cmsg) pure nothrow @nogc
+ {
+ return cmsg + __CMSG_LEN(cmsg);
+ }
+
+ private inout(msghdr)* __MHDR_END(inout(msghdr)* mhdr) pure nothrow @nogc
+ {
+ return cast(inout(msghdr)*)(mhdr.msg_control + mhdr.msg_controllen);
+ }
+
+ inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
+ {
+ return cmsg.cmsg_len < cmsghdr.sizeof ||
+ __CMSG_LEN(cmsg) + cmsghdr.sizeof >= __MHDR_END(msg) - cast(inout(msghdr)*)(cmsg)
+ ? cast(inout(cmsghdr)*) null : cast(inout(cmsghdr)*) __CMSG_NEXT(cmsg);
+ }
+ }
+ }
+ else
+ {
+ private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
+ extern (D) inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
+ {
+ return __cmsg_nxthdr(msg, cmsg);
+ }
}
extern (D) inout(cmsghdr)* CMSG_FIRSTHDR( inout(msghdr)* mhdr ) pure nothrow @nogc
--
2.38.1

View file

@ -10,7 +10,7 @@ LANG_JAVA=false
LANG_GO=false LANG_GO=false
LANG_FORTRAN=false LANG_FORTRAN=false
LANG_ADA=false LANG_ADA=false
options="!strip !tracedeps" options="!strip"
# abuild doesn't try to tries to install "build-base-$CTARGET_ARCH" # abuild doesn't try to tries to install "build-base-$CTARGET_ARCH"
# when this variable matches "no*" # when this variable matches "no*"
@ -24,7 +24,6 @@ CBUILDROOT="/"
_cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET" _cross_configure="--disable-bootstrap --with-sysroot=/usr/$CTARGET"
pkgname=gcc-armv7 pkgname=gcc-armv7
# FIXME WHEN UPGRADING: remove !tracedeps from options when upgrading to properly fix pma#1732 (we only have a workaround for now)
_pkgbase=12.2.1 # must match gcc/BASE-VER _pkgbase=12.2.1 # must match gcc/BASE-VER
_pkgsnap=20220924 _pkgsnap=20220924
pkgver=${_pkgbase}_git${_pkgsnap} pkgver=${_pkgbase}_git${_pkgsnap}
@ -33,7 +32,7 @@ pkgver=${_pkgbase}_git${_pkgsnap}
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target="" [ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
pkgname=gcc-armv7 pkgname=gcc-armv7
pkgrel=3 pkgrel=4
pkgdesc="Stage2 cross-compiler for armv7" pkgdesc="Stage2 cross-compiler for armv7"
url="https://gcc.gnu.org" url="https://gcc.gnu.org"
arch="x86_64" arch="x86_64"
@ -259,6 +258,7 @@ source="https://dev.alpinelinux.org/archive/gcc/${_pkgbase%%.*}-${_pkgsnap}/gcc-
0051-libgo-Explicitly-define-SYS_timer_settime-for-32-bit.patch 0051-libgo-Explicitly-define-SYS_timer_settime-for-32-bit.patch
0052-libgnat-time_t-is-always-64-bit-on-musl-libc.patch 0052-libgnat-time_t-is-always-64-bit-on-musl-libc.patch
0053-libgo-make-match.sh-POSIX-shell-compatible.patch 0053-libgo-make-match.sh-POSIX-shell-compatible.patch
0054-libphobos-fix-undefined-reference-to-__cmsg_nxthdr-w.patch
" "
# we build out-of-tree # we build out-of-tree
@ -810,4 +810,5 @@ c33ca2553642c2dbd1c65cd97046548f08775785a3db06d761e3bbe61398c37bc382fe132c0c3fa2
c82d7c8d340a76df3d796565a79b0ccc04ddffef39927620e1f3719bf2dc1db101ba13aef24b46c5bc95b7bf1e31c8bda4ab0936ba4c9c5e5047ba08826c982c 0051-libgo-Explicitly-define-SYS_timer_settime-for-32-bit.patch c82d7c8d340a76df3d796565a79b0ccc04ddffef39927620e1f3719bf2dc1db101ba13aef24b46c5bc95b7bf1e31c8bda4ab0936ba4c9c5e5047ba08826c982c 0051-libgo-Explicitly-define-SYS_timer_settime-for-32-bit.patch
eb403d8ea665fd5dc2c11faf43b055e6a3bf480a397ceee3e0ca1e38ec7d2392315f2694ed9a34ffbc99e464f2873fbbf91be8646ea4dea5d3636e3ea22fefa0 0052-libgnat-time_t-is-always-64-bit-on-musl-libc.patch eb403d8ea665fd5dc2c11faf43b055e6a3bf480a397ceee3e0ca1e38ec7d2392315f2694ed9a34ffbc99e464f2873fbbf91be8646ea4dea5d3636e3ea22fefa0 0052-libgnat-time_t-is-always-64-bit-on-musl-libc.patch
22fb6edf1ed0387e2b93839ffe6e82a7fee420950af90e91199c3488d966702fdeb1a3396d22be0c73a4051525da9349c93d070a0d83b724c83f2b268da6483f 0053-libgo-make-match.sh-POSIX-shell-compatible.patch 22fb6edf1ed0387e2b93839ffe6e82a7fee420950af90e91199c3488d966702fdeb1a3396d22be0c73a4051525da9349c93d070a0d83b724c83f2b268da6483f 0053-libgo-make-match.sh-POSIX-shell-compatible.patch
9b74d0a0e4140b597708a295bcf51b93944782698470e2ba9bc0f0d4a830fc418da9624eccc85f3d65ff6d50b8ebf40cecd34d5b045db9e6c29614e981e93f92 0054-libphobos-fix-undefined-reference-to-__cmsg_nxthdr-w.patch
" "

View file

@ -0,0 +1,65 @@
From 7b8400f902ef25ea71ed460716c1afedca357a61 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Wed, 2 Nov 2022 12:31:36 +0100
Subject: [PATCH] libphobos: fix undefined reference to `__cmsg_nxthdr' with
musl
Ported fix from upstream.
Upstream: https://github.com/dlang/dmd/commit/54544260a848c8ebad5582e27ac1e09627cdfb17
Bug-URL: https://issues.dlang.org/show_bug.cgi?id=23157
---
.../libdruntime/core/sys/posix/sys/socket.d | 36 +++++++++++++++++--
1 file changed, 33 insertions(+), 3 deletions(-)
diff --git a/libphobos/libdruntime/core/sys/posix/sys/socket.d b/libphobos/libdruntime/core/sys/posix/sys/socket.d
index c1309a68c9c..e3b536d87e7 100644
--- a/libphobos/libdruntime/core/sys/posix/sys/socket.d
+++ b/libphobos/libdruntime/core/sys/posix/sys/socket.d
@@ -188,10 +188,40 @@ version (linux)
extern (D) inout(ubyte)* CMSG_DATA( return scope inout(cmsghdr)* cmsg ) pure nothrow @nogc { return cast(ubyte*)( cmsg + 1 ); }
- private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
- extern (D) inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
+ version (CRuntime_Musl)
{
- return __cmsg_nxthdr(msg, cmsg);
+ extern (D)
+ {
+ private size_t __CMSG_LEN(inout(cmsghdr)* cmsg) pure nothrow @nogc
+ {
+ return (cmsg.cmsg_len + size_t.sizeof -1) & cast(size_t)(~(size_t.sizeof - 1));
+ }
+
+ private inout(cmsghdr)* __CMSG_NEXT(inout(cmsghdr)* cmsg) pure nothrow @nogc
+ {
+ return cmsg + __CMSG_LEN(cmsg);
+ }
+
+ private inout(msghdr)* __MHDR_END(inout(msghdr)* mhdr) pure nothrow @nogc
+ {
+ return cast(inout(msghdr)*)(mhdr.msg_control + mhdr.msg_controllen);
+ }
+
+ inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
+ {
+ return cmsg.cmsg_len < cmsghdr.sizeof ||
+ __CMSG_LEN(cmsg) + cmsghdr.sizeof >= __MHDR_END(msg) - cast(inout(msghdr)*)(cmsg)
+ ? cast(inout(cmsghdr)*) null : cast(inout(cmsghdr)*) __CMSG_NEXT(cmsg);
+ }
+ }
+ }
+ else
+ {
+ private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
+ extern (D) inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
+ {
+ return __cmsg_nxthdr(msg, cmsg);
+ }
}
extern (D) inout(cmsghdr)* CMSG_FIRSTHDR( inout(msghdr)* mhdr ) pure nothrow @nogc
--
2.38.1

View file

@ -32,7 +32,7 @@ pkgver=${_pkgbase}_git${_pkgsnap}
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target="" [ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
pkgname=gcc-riscv64 pkgname=gcc-riscv64
pkgrel=3 pkgrel=4
pkgdesc="Stage2 cross-compiler for riscv64" pkgdesc="Stage2 cross-compiler for riscv64"
url="https://gcc.gnu.org" url="https://gcc.gnu.org"
arch="x86_64" arch="x86_64"
@ -258,6 +258,7 @@ source="https://dev.alpinelinux.org/archive/gcc/${_pkgbase%%.*}-${_pkgsnap}/gcc-
0051-libgo-Explicitly-define-SYS_timer_settime-for-32-bit.patch 0051-libgo-Explicitly-define-SYS_timer_settime-for-32-bit.patch
0052-libgnat-time_t-is-always-64-bit-on-musl-libc.patch 0052-libgnat-time_t-is-always-64-bit-on-musl-libc.patch
0053-libgo-make-match.sh-POSIX-shell-compatible.patch 0053-libgo-make-match.sh-POSIX-shell-compatible.patch
0054-libphobos-fix-undefined-reference-to-__cmsg_nxthdr-w.patch
" "
# we build out-of-tree # we build out-of-tree
@ -809,4 +810,5 @@ c33ca2553642c2dbd1c65cd97046548f08775785a3db06d761e3bbe61398c37bc382fe132c0c3fa2
c82d7c8d340a76df3d796565a79b0ccc04ddffef39927620e1f3719bf2dc1db101ba13aef24b46c5bc95b7bf1e31c8bda4ab0936ba4c9c5e5047ba08826c982c 0051-libgo-Explicitly-define-SYS_timer_settime-for-32-bit.patch c82d7c8d340a76df3d796565a79b0ccc04ddffef39927620e1f3719bf2dc1db101ba13aef24b46c5bc95b7bf1e31c8bda4ab0936ba4c9c5e5047ba08826c982c 0051-libgo-Explicitly-define-SYS_timer_settime-for-32-bit.patch
eb403d8ea665fd5dc2c11faf43b055e6a3bf480a397ceee3e0ca1e38ec7d2392315f2694ed9a34ffbc99e464f2873fbbf91be8646ea4dea5d3636e3ea22fefa0 0052-libgnat-time_t-is-always-64-bit-on-musl-libc.patch eb403d8ea665fd5dc2c11faf43b055e6a3bf480a397ceee3e0ca1e38ec7d2392315f2694ed9a34ffbc99e464f2873fbbf91be8646ea4dea5d3636e3ea22fefa0 0052-libgnat-time_t-is-always-64-bit-on-musl-libc.patch
22fb6edf1ed0387e2b93839ffe6e82a7fee420950af90e91199c3488d966702fdeb1a3396d22be0c73a4051525da9349c93d070a0d83b724c83f2b268da6483f 0053-libgo-make-match.sh-POSIX-shell-compatible.patch 22fb6edf1ed0387e2b93839ffe6e82a7fee420950af90e91199c3488d966702fdeb1a3396d22be0c73a4051525da9349c93d070a0d83b724c83f2b268da6483f 0053-libgo-make-match.sh-POSIX-shell-compatible.patch
9b74d0a0e4140b597708a295bcf51b93944782698470e2ba9bc0f0d4a830fc418da9624eccc85f3d65ff6d50b8ebf40cecd34d5b045db9e6c29614e981e93f92 0054-libphobos-fix-undefined-reference-to-__cmsg_nxthdr-w.patch
" "