musl: update to 1.1.24

This commit is contained in:
q66 2019-10-21 02:42:57 +02:00 committed by Juan RP
parent 5a2f276ef1
commit 6f84477db3
5 changed files with 72 additions and 108 deletions

View file

@ -1,19 +0,0 @@
Clang defines wchar_t as int, gcc as long on the target. They have the same
size, but are different types. i386 already has this same change, do it for
powerpc as well.
--- arch/powerpc/bits/alltypes.h.in
+++ arch/powerpc/bits/alltypes.h.in
@@ -6,8 +6,12 @@ TYPEDEF __builtin_va_list va_list;
TYPEDEF __builtin_va_list __isoc_va_list;
#ifndef __cplusplus
+#ifdef __WCHAR_TYPE__
+TYPEDEF __WCHAR_TYPE__ wchar_t;
+#else
TYPEDEF long wchar_t;
#endif
+#endif
TYPEDEF float float_t;
TYPEDEF double double_t;

View file

@ -0,0 +1,38 @@
commit c2518a8efb6507f1b41c3b12e03b06f8f2317a1f
Author: Rich Felker <dalias@aerifal.cx>
Date: Sat Oct 19 15:53:43 2019 -0400
use struct pt_regs * rather than void * for powerpc[64] sigcontext regs
this is to match the kernel and glibc interfaces. here, struct pt_regs
is an incomplete type, but that's harmless, and if it's completed by
inclusion of another header then members of the struct pointed to by
the regs member can be accessed directly without going through a cast
or intermediate pointer object.
diff --git a/arch/powerpc/bits/signal.h b/arch/powerpc/bits/signal.h
index 06efb11c..c1bf3caf 100644
--- arch/powerpc/bits/signal.h
+++ arch/powerpc/bits/signal.h
@@ -28,7 +28,7 @@ struct sigcontext {
int signal;
unsigned long handler;
unsigned long oldmask;
- void *regs;
+ struct pt_regs *regs;
};
typedef struct {
diff --git a/arch/powerpc64/bits/signal.h b/arch/powerpc64/bits/signal.h
index 4dec22a5..d5493b18 100644
--- arch/powerpc64/bits/signal.h
+++ arch/powerpc64/bits/signal.h
@@ -32,7 +32,7 @@ typedef struct sigcontext {
int _pad0;
unsigned long handler;
unsigned long oldmask;
- void *regs;
+ struct pt_regs *regs;
gregset_t gp_regs;
fpregset_t fp_regs;
vrregset_t *v_regs;

View file

@ -1,86 +0,0 @@
Date: Sun, 30 Jun 2019 07:39:20 -0500
From: Samuel Holland <samuel@...lland.org>
To: musl@...ts.openwall.com
Cc: Samuel Holland <samuel@...lland.org>
Subject: [PATCH] add support for powerpc/powerpc64 unaligned relocations
R_PPC_UADDR32 (R_PPC64_UADDR64) has the same meaning as R_PPC_ADDR32
(R_PPC64_ADDR64), except that its address need not be aligned. For
powerpc64, BFD ld(1) will automatically convert between ADDR<->UADDR
relocations when the address is/isn't at its native alignment. This
will happen if, for example, there is a pointer in a packed struct.
gold and lld do not currently generate R_PPC64_UADDR64, but pass
through misaligned R_PPC64_ADDR64 relocations from object files,
possibly relaxing them to misaligned R_PPC64_RELATIVE. In both cases
(relaxed or not) this violates the PSABI, which defines the relevant
field type as "a 64-bit field occupying 8 bytes, the alignment of
which is 8 bytes unless otherwise specified."
All three linkers violate the PSABI on 32-bit powerpc, where the only
difference is that the field is 32 bits wide, aligned to 4 bytes.
Currently musl fails to load executables linked by BFD ld containing
R_PPC64_UADDR64, with the error "unsupported relocation type 43".
This change provides compatibility with BFD ld on powerpc64, and any
static linker on either architecture that starts following the PSABI
more closely.
---
arch/powerpc/reloc.h | 1 +
arch/powerpc64/reloc.h | 1 +
ldso/dynlink.c | 3 +++
src/internal/dynlink.h | 1 +
4 files changed, 6 insertions(+)
diff --git a/arch/powerpc/reloc.h b/arch/powerpc/reloc.h
index 1b4cab36..527b6b7c 100644
--- arch/powerpc/reloc.h
+++ arch/powerpc/reloc.h
@@ -9,6 +9,7 @@
#define TPOFF_K (-0x7000)
#define REL_SYMBOLIC R_PPC_ADDR32
+#define REL_USYMBOLIC R_PPC_UADDR32
#define REL_GOT R_PPC_GLOB_DAT
#define REL_PLT R_PPC_JMP_SLOT
#define REL_RELATIVE R_PPC_RELATIVE
diff --git a/arch/powerpc64/reloc.h b/arch/powerpc64/reloc.h
index faf70acd..5bdaeede 100644
--- arch/powerpc64/reloc.h
+++ arch/powerpc64/reloc.h
@@ -11,6 +11,7 @@
#define TPOFF_K (-0x7000)
#define REL_SYMBOLIC R_PPC64_ADDR64
+#define REL_USYMBOLIC R_PPC64_UADDR64
#define REL_GOT R_PPC64_GLOB_DAT
#define REL_PLT R_PPC64_JMP_SLOT
#define REL_RELATIVE R_PPC64_RELATIVE
diff --git a/ldso/dynlink.c b/ldso/dynlink.c
index db543c19..b5ef4bfc 100644
--- ldso/dynlink.c
+++ ldso/dynlink.c
@@ -407,6 +407,9 @@ static void do_relocs(struct dso *dso, size_t *rel, size_t rel_size, size_t stri
case REL_PLT:
*reloc_addr = sym_val + addend;
break;
+ case REL_USYMBOLIC:
+ memcpy(reloc_addr, &(size_t){sym_val + addend}, sizeof(size_t));
+ break;
case REL_RELATIVE:
*reloc_addr = (size_t)base + addend;
break;
diff --git a/src/internal/dynlink.h b/src/internal/dynlink.h
index 165bbedb..ffd06b04 100644
--- src/internal/dynlink.h
+++ src/internal/dynlink.h
@@ -28,6 +28,7 @@ typedef Elf64_Sym Sym;
enum {
REL_NONE = 0,
REL_SYMBOLIC = -100,
+ REL_USYMBOLIC,
REL_GOT,
REL_PLT,
REL_RELATIVE,
--
2.21.0

View file

@ -0,0 +1,31 @@
commit c9f48cde0a22641ce3daf54596a9ecebdab91435
Author: Rich Felker <dalias@aerifal.cx>
Date: Sat Oct 19 15:39:45 2019 -0400
fix fpregset_t type on powerpc64
the userspace ucontext API has this as an array rather than a
structure.
commit 3c59a868956636bc8adafb1b168d090897692532 fixed the
corresponding mistake for vrregset_t, namely that the original
powerpc64 port used a mix of types from 32-bit powerpc and powerpc64
rather than matching the 64-bit types.
diff --git a/arch/powerpc64/bits/signal.h b/arch/powerpc64/bits/signal.h
index 2cc0604c..4dec22a5 100644
--- arch/powerpc64/bits/signal.h
+++ arch/powerpc64/bits/signal.h
@@ -9,11 +9,7 @@
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
typedef unsigned long greg_t, gregset_t[48];
-
-typedef struct {
- double fpregs[32];
- double fpscr;
-} fpregset_t;
+typedef double fpregset_t[33];
typedef struct {
#ifdef __GNUC__

View file

@ -1,7 +1,7 @@
# Template file for 'musl'
pkgname=musl
version=1.1.23
revision=2
version=1.1.24
revision=1
archs="*-musl"
build_style=gnu-configure
configure_args="--prefix=/usr --disable-gcc-wrapper"
@ -11,7 +11,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
license="MIT"
homepage="http://www.musl-libc.org/"
distfiles="http://www.musl-libc.org/releases/musl-${version}.tar.gz"
checksum=8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
checksum=1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
conflicts="glibc>=0"
nostrip_files="libc.so"