Skip to content

Commit

Permalink
Update to musl 1.2.5.
Browse files Browse the repository at this point in the history
See the WHATSNEW file for details.
  • Loading branch information
sunfishcode committed Dec 11, 2024
1 parent 574b88d commit 627643c
Show file tree
Hide file tree
Showing 292 changed files with 3,872 additions and 553 deletions.
7 changes: 6 additions & 1 deletion libc-top-half/musl/INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,16 @@ and ABI combinations:

* OpenRISC 1000 (or1k)

* RISC-V 64
* RISC-V
* 32-bit and 64-bit
* Little endian
* Hard, soft, and hard-single/soft-double floating point ABIs
* Standard ELF; no shared-text NOMMU support

* LoongArch
* 64-bit ISA
* Hard, soft, and hard-single/soft-double floating point ABIs



Build and Installation Procedure
Expand Down
2 changes: 1 addition & 1 deletion libc-top-half/musl/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.3
1.2.5
111 changes: 111 additions & 0 deletions libc-top-half/musl/WHATSNEW
Original file line number Diff line number Diff line change
Expand Up @@ -2327,3 +2327,114 @@ bugs fixed:
arch-specific bugs fixed:
- powerpc (32-bit) struct shmid_ds layout was wrong for some fields
- time64 struct layout was wrong in sound ioctl fallback (32-bit archs)



1.2.4 release notes

new features:
- large dns record lookups via tcp fallback
- new getaddrinfo EAI_NODATA result to distinguish NODATA/NxDomain
- support for new RELR compressed format for relative relocations
- sysconf keys for querying signal stack size requirements
- real vfork on riscv64

performance:
- mallocng no longer uses MADV_FREE (high performance cost, little gain)
- vdso clock_gettime is supported once again on 32-bit arm

compatibility:
- gethostbyname family now distinguishes NO_DATA from HOST_NOT_FOUND
- res_send now works with caller-provided edns0 queries
- arpa/nameser.h RR types list is now up-to-date
- previously-missing POSIX confstr keys have been added
- mntent interfaces now accept missing fields
- alt signal stack, if any, is now used for internal signals
- the LFS64 macros are no longer exposed without _LARGEFILE64_SOURCE
- memmem (POSIX-future) is now exposed in default feature profile
- pthread_atfork now admits calls from an application-provided malloc
- debugger tracking of shared libraries now works on MIPS PIE binaries
- sendmsg now supports up to SCM_MAX_FD fds in SCM_RIGHTS messages

bugs fixed:
- gethostbyname[2]_r wrongly returned nonzero (error) on negative result
- parallel v4/v6 address queries could fail on query id collisions
- spurious getaddrinfo/AI_ADDRCONFIG failures due to errno clobbering
- dns search domains ending in dot (including lone dot) broke lookups
- ipv6 servers in resolv.conf broke lookups on systems with v6 disabled
- systems with bindv6only failed to query both v4 and v6 nameservers
- res_mkquery mishandled consecutive final dots in name
- res_send could malfunction for very small answer buffer sizes
- resolver dns backend accepted answers with wrong (A vs AAAA) RR type
- getservbyport_r returned junk or ENOENT (vs ERANGE) on buffer size errors
- dns result parsing of malformed responses could process uninitialized data
- freopen didn't reset stream orientation (byte/wide) & encoding rule
- fwprintf didn't print most fields on open_wmemstream FILEs
- wide printf %lc ignored field width
- wide printf erroneously processed %n after encoding errors
- use of wide printf %9$ argument slot overflowed undersized buffer
- swprintf malfunctioned on nul character in output
- strverscmp ordered digit sequences vs nondigits incorrectly
- timer_create/SIGEV_THREAD failure leaked the thread
- semaphores were subject to missed-wake under certain usage patterns
- several possible rare deadlocks with lock handling at thread exit
- several possible rare deadlocks with aio and multithreaded fork
- dynamic linker relro processing was broken on archs w/variable pagesize
- async cancellation could run cancellation handlers in invalid context
- pthread_detach was wrongly a cancellation point in rare race code path
- use-after-close/double-close errors in mq_notify error paths
- mq_notify event thread wrongly ran with signals unmasked
- wcs{,n}cmp, wmemcmp returned wrong results when difference overflowed
- accept4, pipe2, and dup3 handled unknown flags wrong in fallback cases
- CPU_SETSIZE macro had wrong unit
- select fallback for pre-time64 kernels truncated timeout (vs clamping)

arch-specific bugs fixed:
- x32 new socketcalls took fallback path due to pointer sign extension
- x32 wait4 didn't fill rusage structure (time64 regression)
- x32 semtimedop mismatched timespec ABI with kernel (time64 regression)
- sigaction signal mask was bogus on or1k, microblaze, mips, and riscv
- powerpc-sf longjmp asm clobbered value argument
- or1k poll function passed timeout to syscall in wrong form



1.2.5 release notes

new features:
- statx function (linux extension; via syscall and fallback using fstatat)
- clone function is now usable and gives _Fork-like consistency in child
- statvfs now provides f_type result
- preadv2 and pwritev2 (linux extension) syscall wrappers
- riscv64 TLSDESC support

new ports:
- loongarch64
- riscv32

compatibility:
- DNS resolver can now handle answers with long CNAME chains
- string.h no longer provides (C23-incompat) non-prototype decl of basename
- fstatat statx backend now matches stat syscall non-automounting behavior
- mntent interfaces now handle escaped whitespace in paths/options

standards updates:
- printf %lc of nul wchar now produces output
- snprintf and swprintf no longer fail on n > INT_MAX
- ppoll is now exposed in default feature profile

bugs fixed:
- some long DNS answers were wrongly rejected despite new TCP support
- glob could wrongly return GLOB_NOMATCH if aborted before any matches
- multithreaded set*id could malfunction from thread sequencing logic bug
- certain use of threads after fork could deadlock thread-list lock
- posix_spawn child could deadlock in race with async parent death
- mbrtowc return value was wrong if argument n exceeded UINT_MAX
- 80-bit extended acoshl and powl got some corner cases wrong
- syslog incorrectly generated localized timestamps

arch-specific bugs fixed:
- arm (32-bit) TLSDESC malfunctioned due to addends being processed wrong
- riscv64 icache flush operation was non-functional
- sh sigsetjmp failed to properly restore call-saved register r8 on return
- sh dlsym RTLD_NEXT did not identify calling module correctly
5 changes: 5 additions & 0 deletions libc-top-half/musl/arch/aarch64/bits/syscall.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -299,4 +299,9 @@
#define __NR_landlock_create_ruleset 444
#define __NR_landlock_add_rule 445
#define __NR_landlock_restrict_self 446
#define __NR_process_mrelease 448
#define __NR_futex_waitv 449
#define __NR_set_mempolicy_home_node 450
#define __NR_cachestat 451
#define __NR_fchmodat2 452

5 changes: 5 additions & 0 deletions libc-top-half/musl/arch/arm/bits/syscall.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,11 @@
#define __NR_landlock_create_ruleset 444
#define __NR_landlock_add_rule 445
#define __NR_landlock_restrict_self 446
#define __NR_process_mrelease 448
#define __NR_futex_waitv 449
#define __NR_set_mempolicy_home_node 450
#define __NR_cachestat 451
#define __NR_fchmodat2 452

#define __ARM_NR_breakpoint 0x0f0001
#define __ARM_NR_cacheflush 0x0f0002
Expand Down
2 changes: 1 addition & 1 deletion libc-top-half/musl/arch/arm/reloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#define REL_TPOFF R_ARM_TLS_TPOFF32
#define REL_TLSDESC R_ARM_TLS_DESC

#define TLSDESC_BACKWARDS
#define TLSDESC_BACKWARDS 1

#define CRTJMP(pc,sp) __asm__ __volatile__( \
"mov sp,%1 ; bx %0" : : "r"(pc), "r"(sp) : "memory" )
7 changes: 7 additions & 0 deletions libc-top-half/musl/arch/arm/syscall_arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,10 @@ static inline long __syscall6(long n, long a, long b, long c, long d, long e, lo
#define SYSCALL_FADVISE_6_ARG

#define SYSCALL_IPC_BROKEN_MODE

#define VDSO_USEFUL
#define VDSO_CGT32_SYM "__vdso_clock_gettime"
#define VDSO_CGT32_VER "LINUX_2.6"
#define VDSO_CGT_SYM "__vdso_clock_gettime64"
#define VDSO_CGT_VER "LINUX_2.6"
#define VDSO_CGT_WORKAROUND 1
6 changes: 6 additions & 0 deletions libc-top-half/musl/arch/i386/bits/syscall.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -436,4 +436,10 @@
#define __NR_landlock_create_ruleset 444
#define __NR_landlock_add_rule 445
#define __NR_landlock_restrict_self 446
#define __NR_memfd_secret 447
#define __NR_process_mrelease 448
#define __NR_futex_waitv 449
#define __NR_set_mempolicy_home_node 450
#define __NR_cachestat 451
#define __NR_fchmodat2 452

53 changes: 53 additions & 0 deletions libc-top-half/musl/arch/loongarch64/atomic_arch.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#define a_ll a_ll
static inline int a_ll(volatile int *p)
{
int v;
__asm__ __volatile__ (
"ll.w %0, %1"
: "=r"(v)
: "ZC"(*p));
return v;
}

#define a_sc a_sc
static inline int a_sc(volatile int *p, int v)
{
int r;
__asm__ __volatile__ (
"sc.w %0, %1"
: "=r"(r), "=ZC"(*p)
: "0"(v) : "memory");
return r;
}

#define a_ll_p a_ll_p
static inline void *a_ll_p(volatile void *p)
{
void *v;
__asm__ __volatile__ (
"ll.d %0, %1"
: "=r"(v)
: "ZC"(*(void *volatile *)p));
return v;
}

#define a_sc_p a_sc_p
static inline int a_sc_p(volatile void *p, void *v)
{
long r;
__asm__ __volatile__ (
"sc.d %0, %1"
: "=r"(r), "=ZC"(*(void *volatile *)p)
: "0"(v)
: "memory");
return r;
}

#define a_barrier a_barrier
static inline void a_barrier()
{
__asm__ __volatile__ ("dbar 0" : : : "memory");
}

#define a_pre_llsc a_barrier
#define a_post_llsc a_barrier
18 changes: 18 additions & 0 deletions libc-top-half/musl/arch/loongarch64/bits/alltypes.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#define _Addr long
#define _Int64 long
#define _Reg long

#define __BYTE_ORDER 1234
#define __LONG_MAX 0x7fffffffffffffffL

#ifndef __cplusplus
TYPEDEF int wchar_t;
#endif

TYPEDEF float float_t;
TYPEDEF double double_t;

TYPEDEF struct { long long __ll; long double __ld; } max_align_t;

TYPEDEF unsigned nlink_t;
TYPEDEF int blksize_t;
20 changes: 20 additions & 0 deletions libc-top-half/musl/arch/loongarch64/bits/fenv.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#define FE_INEXACT 0x010000
#define FE_UNDERFLOW 0x020000
#define FE_OVERFLOW 0x040000
#define FE_DIVBYZERO 0x080000
#define FE_INVALID 0x100000

#define FE_ALL_EXCEPT 0x1F0000

#define FE_TONEAREST 0x000
#define FE_TOWARDZERO 0x100
#define FE_UPWARD 0x200
#define FE_DOWNWARD 0x300

typedef unsigned fexcept_t;

typedef struct {
unsigned __cw;
} fenv_t;

#define FE_DFL_ENV ((const fenv_t *) -1)
16 changes: 16 additions & 0 deletions libc-top-half/musl/arch/loongarch64/bits/float.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#define FLT_EVAL_METHOD 0

#define LDBL_TRUE_MIN 6.47517511943802511092443895822764655e-4966L
#define LDBL_MIN 3.36210314311209350626267781732175260e-4932L
#define LDBL_MAX 1.18973149535723176508575932662800702e+4932L
#define LDBL_EPSILON 1.92592994438723585305597794258492732e-34L

#define LDBL_MANT_DIG 113
#define LDBL_MIN_EXP (-16381)
#define LDBL_MAX_EXP 16384

#define LDBL_DIG 33
#define LDBL_MIN_10_EXP (-4931)
#define LDBL_MAX_10_EXP 4932

#define DECIMAL_DIG 36
2 changes: 2 additions & 0 deletions libc-top-half/musl/arch/loongarch64/bits/posix.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#define _POSIX_V6_LP64_OFF64 1
#define _POSIX_V7_LP64_OFF64 1
2 changes: 2 additions & 0 deletions libc-top-half/musl/arch/loongarch64/bits/reg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#undef __WORDSIZE
#define __WORDSIZE 64
1 change: 1 addition & 0 deletions libc-top-half/musl/arch/loongarch64/bits/setjmp.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
typedef unsigned long __jmp_buf[23];
Loading

0 comments on commit 627643c

Please sign in to comment.