void-packages/srcpkgs/ghdl/patches/musl.patch

59 lines
1.8 KiB
Diff

From 7ab20a0919c2bd62182cd0f93ce3d275c6eb4492 Mon Sep 17 00:00:00 2001
From: Guiltybyte <jordan.mcconnon5@mail.dcu.ie>
Date: Thu, 9 Jun 2022 15:54:07 +0100
Subject: [PATCH 1/2] Only enable backtrace on linux if glibc is present
---
src/grt/config/jumps.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/grt/config/jumps.c b/src/grt/config/jumps.c
index 9a2ee10467..9a2f25bef7 100644
--- a/src/grt/config/jumps.c
+++ b/src/grt/config/jumps.c
@@ -27,7 +27,7 @@
#include <signal.h>
#include <fcntl.h>
-#if ( defined (__linux__) || defined (__APPLE__) ) && !defined (__ANDROID__)
+#if ( (defined (__linux__) && defined (__GLIBC__) ) || defined (__APPLE__) ) && !defined (__ANDROID__)
#define HAVE_BACKTRACE 1
#include <sys/ucontext.h>
#endif
@@ -97,8 +97,10 @@ get_bt_from_ucontext (void *uctxt, struct backtrace_addrs *bt)
#ifdef HAVE_BACKTRACE
bt->size = backtrace (bt->addrs, sizeof (bt->addrs) / sizeof (void *));
bt->skip = 0;
+ #pragma message "HAVE_BACKTRACE=1"
#else
bt->size = 0;
+ #pragma message "HAVE_BACKTRACE=0"
return;
#endif
From c58a8c30daa3c5a371ef7cfc52175319986efeaf Mon Sep 17 00:00:00 2001
From: Guiltybyte <jordan.mcconnon5@mail.dcu.ie>
Date: Thu, 9 Jun 2022 15:57:58 +0100
Subject: [PATCH 2/2] deleted pragma messages
---
src/grt/config/jumps.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/grt/config/jumps.c b/src/grt/config/jumps.c
index 9a2f25bef7..0b01409e73 100644
--- a/src/grt/config/jumps.c
+++ b/src/grt/config/jumps.c
@@ -97,10 +97,8 @@ get_bt_from_ucontext (void *uctxt, struct backtrace_addrs *bt)
#ifdef HAVE_BACKTRACE
bt->size = backtrace (bt->addrs, sizeof (bt->addrs) / sizeof (void *));
bt->skip = 0;
- #pragma message "HAVE_BACKTRACE=1"
#else
bt->size = 0;
- #pragma message "HAVE_BACKTRACE=0"
return;
#endif