aboutsummaryrefslogtreecommitdiffstats
path: root/testing/blender/0001-musl-fixes.patch
blob: 8ca03d433ce92fa8f80e67301538ff599e0a44ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
From 9f5cd19b34c6357d0473f61b8b4d13b28c3e8b6c Mon Sep 17 00:00:00 2001
From: Leon Marz <lmarz@cs.uni-frankfurt.de>
Date: Wed, 25 Nov 2020 10:10:41 +0100
Subject: [PATCH 1/3] musl fixes

Original patch by Nathanael Copa
---
 intern/guardedalloc/intern/mallocn_intern.h | 2 +-
 intern/libc_compat/libc_compat.c            | 2 --
 source/blender/blenlib/intern/system.c      | 4 +++-
 source/blender/gpu/GPU_vertex_buffer.h      | 1 -
 source/creator/creator_signals.c            | 2 +-
 5 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/intern/guardedalloc/intern/mallocn_intern.h b/intern/guardedalloc/intern/mallocn_intern.h
index aa95615..f7e347d 100644
--- a/intern/guardedalloc/intern/mallocn_intern.h
+++ b/intern/guardedalloc/intern/mallocn_intern.h
@@ -33,7 +33,7 @@
 #undef HAVE_MALLOC_STATS
 #define USE_MALLOC_USABLE_SIZE /* internal, when we have malloc_usable_size() */
 
-#if defined(__linux__) || (defined(__FreeBSD_kernel__) && !defined(__FreeBSD__)) || \
+#if defined(__linux__) && !defined(__MUSL__) || (defined(__FreeBSD_kernel__) && !defined(__FreeBSD__)) || \
     defined(__GLIBC__)
 #  include <malloc.h>
 #  define HAVE_MALLOC_STATS
diff --git a/intern/libc_compat/libc_compat.c b/intern/libc_compat/libc_compat.c
index 78e387e..d21c281 100644
--- a/intern/libc_compat/libc_compat.c
+++ b/intern/libc_compat/libc_compat.c
@@ -25,7 +25,6 @@
 #  include <features.h>
 #  include <math.h>
 
-#  if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 31)
 
 double __exp_finite(double x);
 double __exp2_finite(double x);
@@ -124,5 +123,4 @@ float __powf_finite(float x, float y)
   return powf(x, y);
 }
 
-#  endif /* __GLIBC_PREREQ */
 #endif   /* __linux__ */
diff --git a/source/blender/blenlib/intern/system.c b/source/blender/blenlib/intern/system.c
index f4110c6..f5a32c5 100644
--- a/source/blender/blenlib/intern/system.c
+++ b/source/blender/blenlib/intern/system.c
@@ -35,7 +35,9 @@
 
 #  include "BLI_winstuff.h"
 #else
+#if !defined(__MUSL__)
 #  include <execinfo.h>
+#endif
 #  include <unistd.h>
 #endif
 
@@ -80,7 +82,7 @@ void BLI_system_backtrace(FILE *fp)
 {
   /* ------------- */
   /* Linux / Apple */
-#  if defined(__linux__) || defined(__APPLE__)
+#  if defined(__linux__) && !defined(__MUSL__) || defined(__APPLE__)
 
 #    define SIZE 100
   void *buffer[SIZE];
diff --git a/source/blender/gpu/GPU_vertex_buffer.h b/source/blender/gpu/GPU_vertex_buffer.h
index aae58de..0a3a627 100644
--- a/source/blender/gpu/GPU_vertex_buffer.h
+++ b/source/blender/gpu/GPU_vertex_buffer.h
@@ -118,7 +118,6 @@ GPU_INLINE void *GPU_vertbuf_raw_step(GPUVertBufRaw *a)
 {
   unsigned char *data = a->data;
   a->data += a->stride;
-  BLI_assert(data < a->_data_end);
   return (void *)data;
 }
 
diff --git a/source/creator/creator_signals.c b/source/creator/creator_signals.c
index 29e12a9..d90da8f 100644
--- a/source/creator/creator_signals.c
+++ b/source/creator/creator_signals.c
@@ -269,7 +269,7 @@ void main_signal_setup_fpe(void)
    * set breakpoints on sig_handle_fpe */
   signal(SIGFPE, sig_handle_fpe);
 
-#    if defined(__linux__) && defined(__GNUC__)
+#    if defined(__linux__) && defined(__GNUC__) && !defined(__MUSL__)
   feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
 #    endif /* defined(__linux__) && defined(__GNUC__) */
 #    if defined(OSX_SSE_FPE)
-- 
2.31.1