1 |
commit: 5ffa7558b47964913a0c88edb85c0eca3020d7bc |
2 |
Author: Thomas Beierlein <tomjbe <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Feb 25 05:54:02 2022 +0000 |
4 |
Commit: Thomas Beierlein <tomjbe <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Feb 25 05:54:02 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5ffa7558 |
7 |
|
8 |
sci-electronics/xnec2c: Fix musl related compile problems |
9 |
|
10 |
After discussion with upstream drop left overs from experiments with |
11 |
handling of some dynamic libraries. That fixes the problems with the use |
12 |
of dlinfo() and backtrack_symbols(). |
13 |
|
14 |
Closes: https://bugs.gentoo.org/832744 |
15 |
Package-Manager: Portage-3.0.30, Repoman-3.0.3 |
16 |
Signed-off-by: Thomas Beierlein <tomjbe <AT> gentoo.org> |
17 |
|
18 |
.../xnec2c/files/xnec2c-4.4.5-musl.patch | 63 ++++++++++++++++++++++ |
19 |
sci-electronics/xnec2c/xnec2c-4.4.5.ebuild | 3 ++ |
20 |
2 files changed, 66 insertions(+) |
21 |
|
22 |
diff --git a/sci-electronics/xnec2c/files/xnec2c-4.4.5-musl.patch b/sci-electronics/xnec2c/files/xnec2c-4.4.5-musl.patch |
23 |
new file mode 100644 |
24 |
index 000000000000..a995463224b0 |
25 |
--- /dev/null |
26 |
+++ b/sci-electronics/xnec2c/files/xnec2c-4.4.5-musl.patch |
27 |
@@ -0,0 +1,63 @@ |
28 |
+diff --git a/src/mathlib.c b/src/mathlib.c |
29 |
+index 5354240..b28033e 100644 |
30 |
+--- a/src/mathlib.c |
31 |
++++ b/src/mathlib.c |
32 |
+@@ -155,9 +155,6 @@ int open_mathlib(mathlib_t *lib) |
33 |
+ return 0; |
34 |
+ } |
35 |
+ |
36 |
+- if (dlinfo(lib->handle, RTLD_DI_LMID, &lib->lmid) == -1) |
37 |
+- printf("dlinfo: %s: %s\n", lib->lib, dlerror()); |
38 |
+- |
39 |
+ // Call the init() function if configured |
40 |
+ if (lib->init != NULL) |
41 |
+ lib->init(lib); |
42 |
+@@ -217,14 +214,7 @@ void init_mathlib() |
43 |
+ mathlibs[libidx].available = 1; |
44 |
+ |
45 |
+ // At this point the library load was successful, provide detail: |
46 |
+- if (mathlibs[libidx].handle != NULL) |
47 |
+- { |
48 |
+- char lpath[PATH_MAX]; |
49 |
+- dlinfo(mathlibs[libidx].handle, RTLD_DI_ORIGIN, lpath); |
50 |
+- printf(" loaded ok: %s/%s\n", lpath, mathlibs[libidx].lib); |
51 |
+- } |
52 |
+- else |
53 |
+- printf(" loaded ok.\n"); |
54 |
++ printf(" loaded ok.\n"); |
55 |
+ |
56 |
+ // Set the default to the first one we find: |
57 |
+ if (current_mathlib == NULL) |
58 |
+diff --git a/src/utils.c b/src/utils.c |
59 |
+index b803402..1462df2 100644 |
60 |
+--- a/src/utils.c |
61 |
++++ b/src/utils.c |
62 |
+@@ -17,7 +17,7 @@ |
63 |
+ * https://www.xnec2c.org/ |
64 |
+ */ |
65 |
+ |
66 |
+-#include <execinfo.h> |
67 |
++//#include <execinfo.h> |
68 |
+ |
69 |
+ #include "utils.h" |
70 |
+ #include "shared.h" |
71 |
+@@ -736,18 +736,7 @@ void _print_backtrace(char **strings) |
72 |
+ // Return an array of backtrace strings. The value returned must be free()'ed. |
73 |
+ char **_get_backtrace() |
74 |
+ { |
75 |
+- void *array[10]; |
76 |
+- char **strings; |
77 |
+- int size; |
78 |
+- |
79 |
+- size = backtrace(array, 10); |
80 |
+- strings = backtrace_symbols(array, size); |
81 |
+- |
82 |
+- // This wastes an array entry, but allows _print_backtrace() to find |
83 |
+- // the end of the list without realloc'ing space for a NULL: |
84 |
+- strings[size-1] = NULL; |
85 |
+- |
86 |
+- return strings; |
87 |
++ return NULL; |
88 |
+ } |
89 |
+ |
90 |
+ void print_backtrace(char *msg) |
91 |
|
92 |
diff --git a/sci-electronics/xnec2c/xnec2c-4.4.5.ebuild b/sci-electronics/xnec2c/xnec2c-4.4.5.ebuild |
93 |
index d305cccd2dda..6c495a7c80f8 100644 |
94 |
--- a/sci-electronics/xnec2c/xnec2c-4.4.5.ebuild |
95 |
+++ b/sci-electronics/xnec2c/xnec2c-4.4.5.ebuild |
96 |
@@ -21,10 +21,13 @@ RDEPEND="dev-libs/glib:2 |
97 |
DEPEND="${RDEPEND} |
98 |
sys-devel/gettext" |
99 |
|
100 |
+PATCHES=( "${FILESDIR}/$PN-4.4.5-musl.patch" ) |
101 |
+ |
102 |
S="${WORKDIR}/${MY_P}" |
103 |
|
104 |
src_prepare() { |
105 |
eapply_user |
106 |
+ eapply ${PATCHES[@]} |
107 |
eautoreconf |
108 |
} |