pmaports/cross/gcc-riscv64/0045-druntime-link-against-libucontext-on-all-platforms.patch
Luca Weiss dc9e47ae00
cross/{binutils,gcc,musl}-riscv64: new aport (MR 3559)
Use pmbootstrap aportgen to generate these new packages.

[ci:skip-vercheck]
2022-10-20 18:52:37 +02:00

51 lines
2 KiB
Diff

From 39f5c9a850917a3c19630c0115ef0d5b0f151c72 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Sat, 16 Jul 2022 13:26:49 +0200
Subject: [PATCH] druntime: link against libucontext on all platforms
On musl-based Linux distributions, swapcontext etc. are not provided by
musl but instead by libucontext. Hence, we _always_ need to link against
an external library for these functions.
---
libphobos/configure | 8 --------
libphobos/m4/druntime/libraries.m4 | 8 --------
2 files changed, 16 deletions(-)
diff --git a/libphobos/configure b/libphobos/configure
index 9da06f087d0..0db0acfb9c2 100755
--- a/libphobos/configure
+++ b/libphobos/configure
@@ -15192,14 +15192,6 @@ fi
# Keep this in sync with core/thread.d, set druntime_fiber_asm_external to
# "yes" for targets that have 'version = AsmExternal'.
druntime_fiber_asm_external=no
- case "$target_cpu" in
- aarch64* | \
- arm* | \
- i[34567]86|x86_64 | \
- powerpc)
- druntime_fiber_asm_external=yes
- ;;
- esac
if test "$druntime_fiber_asm_external" = no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing swapcontext" >&5
$as_echo_n "checking for library containing swapcontext... " >&6; }
diff --git a/libphobos/m4/druntime/libraries.m4 b/libphobos/m4/druntime/libraries.m4
index 45a56f6f76a..fef6e890b1e 100644
--- a/libphobos/m4/druntime/libraries.m4
+++ b/libphobos/m4/druntime/libraries.m4
@@ -220,14 +220,6 @@ AC_DEFUN([DRUNTIME_LIBRARIES_UCONTEXT],
# Keep this in sync with core/thread.d, set druntime_fiber_asm_external to
# "yes" for targets that have 'version = AsmExternal'.
druntime_fiber_asm_external=no
- case "$target_cpu" in
- aarch64* | \
- arm* | \
- i[[34567]]86|x86_64 | \
- powerpc)
- druntime_fiber_asm_external=yes
- ;;
- esac
if test "$druntime_fiber_asm_external" = no; then
AC_SEARCH_LIBS([swapcontext], [c ucontext], [],
AC_MSG_ERROR([swapcontext required but not found]))