libunwind: fix mips*musl build w/ musl-1.2.1
This commit is contained in:
parent
66fe738af3
commit
d063daa9e7
3 changed files with 54 additions and 2 deletions
|
@ -1,11 +1,10 @@
|
||||||
--- src/mips/getcontext.S.orig
|
--- src/mips/getcontext.S.orig
|
||||||
+++ src/mips/getcontext.S
|
+++ src/mips/getcontext.S
|
||||||
@@ -24,7 +24,7 @@
|
@@ -24,7 +24,6 @@
|
||||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
|
|
||||||
#include "offsets.h"
|
#include "offsets.h"
|
||||||
-#include <endian.h>
|
-#include <endian.h>
|
||||||
+#include <bits/endian.h>
|
|
||||||
|
|
||||||
.text
|
.text
|
||||||
|
|
||||||
|
|
52
srcpkgs/libunwind/patches/mips-read_write_s32.patch
Normal file
52
srcpkgs/libunwind/patches/mips-read_write_s32.patch
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
--- include/tdep-mips/libunwind_i.h 2020-11-10 17:14:01.000000000 +0100
|
||||||
|
+++ include/tdep-mips/libunwind_i.h 2021-01-11 22:12:16.993539625 +0100
|
||||||
|
@@ -148,9 +148,10 @@
|
||||||
|
static inline int
|
||||||
|
read_s32 (struct dwarf_cursor *c, unw_word_t addr, unw_word_t *val)
|
||||||
|
{
|
||||||
|
- int offset = addr & 4;
|
||||||
|
int ret;
|
||||||
|
unw_word_t memval;
|
||||||
|
+#if _MIPS_SIM == _ABI64
|
||||||
|
+ int offset = addr & 4;
|
||||||
|
|
||||||
|
ret = (*c->as->acc.access_mem) (c->as, addr - offset, &memval, 0, c->as_arg);
|
||||||
|
if (ret < 0)
|
||||||
|
@@ -160,6 +161,13 @@
|
||||||
|
*val = (int32_t) memval;
|
||||||
|
else
|
||||||
|
*val = (int32_t) (memval >> 32);
|
||||||
|
+#else
|
||||||
|
+ ret = (*c->as->acc.access_mem) (c->as, addr, &memval, 0, c->as_arg);
|
||||||
|
+ if (ret < 0)
|
||||||
|
+ return ret;
|
||||||
|
+
|
||||||
|
+ *val = (int32_t) memval;
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@@ -167,9 +175,10 @@
|
||||||
|
static inline int
|
||||||
|
write_s32 (struct dwarf_cursor *c, unw_word_t addr, const unw_word_t *val)
|
||||||
|
{
|
||||||
|
- int offset = addr & 4;
|
||||||
|
- int ret;
|
||||||
|
unw_word_t memval;
|
||||||
|
+#if _MIPS_SIM == _ABI64
|
||||||
|
+ int offset = addr & 4;
|
||||||
|
+ int ret;
|
||||||
|
|
||||||
|
ret = (*c->as->acc.access_mem) (c->as, addr - offset, &memval, 0, c->as_arg);
|
||||||
|
if (ret < 0)
|
||||||
|
@@ -181,6 +190,10 @@
|
||||||
|
memval = (memval & 0xffffffffLL) | (uint32_t) (*val << 32);
|
||||||
|
|
||||||
|
return (*c->as->acc.access_mem) (c->as, addr - offset, &memval, 1, c->as_arg);
|
||||||
|
+#else
|
||||||
|
+ memval = (uint32_t) *val;
|
||||||
|
+ return (*c->as->acc.access_mem) (c->as, addr, &memval, 1, c->as_arg);
|
||||||
|
+#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/* FIXME: Implement these for the MIPS FPU. */
|
|
@ -19,6 +19,7 @@ case "$XBPS_TARGET_MACHINE" in
|
||||||
i686-musl) LDFLAGS=" -lssp_nonshared" ;;
|
i686-musl) LDFLAGS=" -lssp_nonshared" ;;
|
||||||
ppc64*-musl) makedepends+=" libucontext-devel"; LDFLAGS=" -lucontext" ;;
|
ppc64*-musl) makedepends+=" libucontext-devel"; LDFLAGS=" -lucontext" ;;
|
||||||
ppc*-musl) makedepends+=" libucontext-devel"; LDFLAGS=" -lucontext -lssp_nonshared" ;;
|
ppc*-musl) makedepends+=" libucontext-devel"; LDFLAGS=" -lucontext -lssp_nonshared" ;;
|
||||||
|
mips*-musl) CLAGS="-D_MIPS_SIM=_ABI32" ;;
|
||||||
*) ;;
|
*) ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue