Skip to content

Commit c450220

Browse files
committed
Merge branch 'master' of git://git.musl-libc.org/musl
2 parents 1815307 + c7bb9c4 commit c450220

File tree

275 files changed

+6709
-4627
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

275 files changed

+6709
-4627
lines changed

COPYRIGHT

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,31 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2525

2626
Authors/contributors include:
2727

28+
A. Wilcox
2829
Alex Dowad
2930
Alexander Monakov
31+
Andrew Kelley
3032
Anthony G. Basile
3133
Arvid Picciani
34+
Bartosz Brachaczek
3235
Bobby Bingham
3336
Boris Brezillon
3437
Brent Cook
3538
Chris Spiegel
3639
Clément Vasseur
3740
Daniel Micay
41+
Daniel Sabogal
42+
Daurnimator
43+
David Edelsohn
3844
Denys Vlasenko
45+
Dmitry Ivanov
46+
Dmitry V. Levin
3947
Emil Renner Berthing
4048
Felix Fietkau
4149
Felix Janda
4250
Gianluca Anzolin
4351
Hauke Mehrtens
52+
He X
4453
Hiltjo Posthuma
4554
Isaac Dunham
4655
Jaydeep Patil
@@ -50,22 +59,29 @@ Jo-Philipp Wich
5059
Joakim Sindholt
5160
John Spencer
5261
Josiah Worcester
62+
Julien Ramseier
5363
Justin Cormack
5464
Khem Raj
5565
Kylie McClain
66+
Leah Neukirchen
5667
Luca Barbato
5768
Luka Perkov
5869
M Farkas-Dyck (Strake)
5970
Mahesh Bodapati
71+
Masanori Ogino
6072
Michael Forney
73+
Mikhail Kremnyov
6174
Natanael Copa
6275
Nicholas J. Kain
6376
orc
6477
Pascal Cuoq
6578
Petr Hosek
79+
Petr Skocik
6680
Pierre Carrier
81+
Reini Urban
6782
Rich Felker
6883
Richard Pennington
84+
Samuel Holland
6985
Shiz
7086
sin
7187
Solar Designer
@@ -75,6 +91,7 @@ Timo Teräs
7591
Trutz Behn
7692
Valentin Ochs
7793
William Haddon
94+
William Pitcock
7895

7996
Portions of this software are derived from third-party works licensed
8097
under terms compatible with the above MIT license:

INSTALL

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,20 @@ and ABI combinations:
6969
that does not use FPU registers or instructions is available
7070

7171
* PowerPC
72-
* Only 32-bit is supported
7372
* Compiler toolchain must provide 64-bit long double, not IBM
7473
double-double or IEEE quad
7574
* For dynamic linking, compiler toolchain must be configured for
7675
"secure PLT" variant
7776

77+
* PowerPC64
78+
* Both little and big endian variants are supported
79+
* Compiler toolchain must provide 64-bit long double, not IBM
80+
double-double or IEEE quad
81+
* Compiler toolchain must use the new (ELFv2) ABI regardless of
82+
whether it is for little or big endian
83+
84+
* S390X (64-bit S390)
85+
7886
* SuperH (SH)
7987
* Standard ELF ABI or FDPIC ABI (shared-text without MMU)
8088
* Little-endian by default; big-engian variant also supported

Makefile

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -113,24 +113,17 @@ obj/crt/rcrt1.o: $(srcdir)/ldso/dlstart.c
113113

114114
obj/crt/Scrt1.o obj/crt/rcrt1.o: CFLAGS_ALL += -fPIC
115115

116-
obj/crt/$(ARCH)/crti.o: $(srcdir)/crt/$(ARCH)/crti.s
117-
118-
obj/crt/$(ARCH)/crtn.o: $(srcdir)/crt/$(ARCH)/crtn.s
119-
120116
OPTIMIZE_SRCS = $(wildcard $(OPTIMIZE_GLOBS:%=$(srcdir)/src/%))
121117
$(OPTIMIZE_SRCS:$(srcdir)/%.c=obj/%.o) $(OPTIMIZE_SRCS:$(srcdir)/%.c=obj/%.lo): CFLAGS += -O3
122118

123-
MEMOPS_SRCS = src/string/memcpy.c src/string/memmove.c src/string/memcmp.c src/string/memset.c
124-
$(MEMOPS_SRCS:%.c=obj/%.o) $(MEMOPS_SRCS:%.c=obj/%.lo): CFLAGS_ALL += $(CFLAGS_MEMOPS)
125-
126-
NOSSP_SRCS = $(wildcard crt/*.c) \
127-
src/env/__libc_start_main.c src/env/__init_tls.c \
128-
src/env/__stack_chk_fail.c \
129-
src/thread/__set_thread_area.c src/thread/$(ARCH)/__set_thread_area.c \
130-
src/string/memset.c src/string/$(ARCH)/memset.c \
131-
src/string/memcpy.c src/string/$(ARCH)/memcpy.c \
132-
ldso/dlstart.c ldso/dynlink.c
133-
$(NOSSP_SRCS:%.c=obj/%.o) $(NOSSP_SRCS:%.c=obj/%.lo): CFLAGS_ALL += $(CFLAGS_NOSSP)
119+
MEMOPS_OBJS = $(filter %/memcpy.o %/memmove.o %/memcmp.o %/memset.o, $(LIBC_OBJS))
120+
$(MEMOPS_OBJS) $(MEMOPS_OBJS:%.o=%.lo): CFLAGS_ALL += $(CFLAGS_MEMOPS)
121+
122+
NOSSP_OBJS = $(CRT_OBJS) $(LDSO_OBJS) $(filter \
123+
%/__libc_start_main.o %/__init_tls.o %/__stack_chk_fail.o \
124+
%/__set_thread_area.o %/memset.o %/memcpy.o \
125+
, $(LIBC_OBJS))
126+
$(NOSSP_OBJS) $(NOSSP_OBJS:%.o=%.lo): CFLAGS_ALL += $(CFLAGS_NOSSP)
134127

135128
$(CRT_OBJS): CFLAGS_ALL += -DCRT
136129

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.16
1+
1.1.19

WHATSNEW

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1776,3 +1776,134 @@ arch-specific bugs fixed:
17761776
- wrong pread/pwrite syscall calling convention on sh
17771777
- wrong preadv2/pwritev2 syscall numbers on x32
17781778
- mrand48/jrand48 produced wrong-signedness results on 64-bit archs
1779+
1780+
1781+
1.1.17 release notes
1782+
1783+
new features:
1784+
- RTLD_LAZY deferred symbol binding, functionally equivalent to lazy binding
1785+
- safeguard against dlopen of multiple libc versions/instances
1786+
- new posix_spawn flag POSIX_SPAWN_SETSID
1787+
- posix_spawnattr_setflags now reports unknown flags as error
1788+
- ldso option --argv0 to set argv[0]
1789+
- added _NL_LOCALE_NAME extension to nl_langinfo
1790+
1791+
compatibility:
1792+
- dlopen local-to-global promotion no longer changes existing symbols
1793+
- gettext now searches locale name variants for translation files
1794+
- increased locale name length limit from 15 to 23 bytes
1795+
- setlocale(LC_ALL, 0) returns single name if all categories are same
1796+
- realloc no longer fails when mremap doesn't work
1797+
- getservby* no longer treat numeric port strings as service records
1798+
- mmap now works around incorrect EPERM error codes from kernel
1799+
- impact of REG_* namespace pollution in x86[_64] signal.h is reduced
1800+
- arm atomic asm now assembles correctly with new binutils
1801+
- PAGE_SIZE on arm is no longer constant (quiet upstream ABI relaxation)
1802+
- lsearch/lfind now pass args to compare callback in canonical order
1803+
- STB_WEAK and STB_GNU_UNIQUE symbols now behave same as STB_GLOBAL
1804+
- better clang CFLAGS checks in configure
1805+
- global vis.h hack, which made lld refuse to link to libc.so, is disabled
1806+
1807+
performance:
1808+
- single-instruction optimized math functions for aarch64, s390x, powerpc64
1809+
- fast path for ASCII in towupper/towlower
1810+
- new mostly-integer-math fma function
1811+
1812+
semantic bugs fixed:
1813+
- POSIX-format TZ dst time transitions were wrong for southern hemisphere
1814+
- regex REG_NEWLINE semantics were wrong with negated brackets
1815+
- various bugs in strptime %j, %p, %C formats
1816+
- iconv mapped some characters to legacy 8bit encodings incorrectly
1817+
- glob failed to match "/"
1818+
- UTF-8 decoder accepted invalid f4 9x xx xx code sequences
1819+
- scanf %% conversion failed to consume whitespace
1820+
- glob with GLOB_PERIOD wrongly descended into . and ..
1821+
- nftw gave incorrect base name offset when pathname ends in "/"
1822+
- functional regression in resolv.conf attempts option
1823+
- scalbn could produce wrong result due to double rounding in subnormal range
1824+
- strftime %y format wrong with negative years
1825+
- mbsnrtowcs and wcsnrtombs mishandled input limits
1826+
- minor issues with error codes for various functions
1827+
1828+
safety/consistency bugs fixed:
1829+
- stack-based buffer overflow in dns response processing
1830+
- invalid free in regexec on certain error paths
1831+
- invalid free in globfree after failed glob
1832+
- one-byte buffer overflow in legacy getpass function
1833+
- failed dlopen corrupted thread-local storage module list
1834+
- race in pthread_create with priority attributes could leave signals masked
1835+
- multithreaded set*id() functions could induce spurious EINTRs
1836+
- dl_iterate_phdr reported wrong base address in static PIE
1837+
- fd leak and wrong cancellation state after dns socket failure
1838+
- memory leaks and other issues in environment-modification functions
1839+
- read-after-free race in pthread_detach
1840+
- memmem performed single-byte over-read in short-needle code paths
1841+
- read via uninitialized pointer in gettext core
1842+
- bindtextdomain broke bindings for all other domains
1843+
- various silent undefined behavior
1844+
- getopt clobbered optopt on success
1845+
1846+
arch-specific bugs fixed:
1847+
- x32 dynamic TLS accesses crashed
1848+
- s390x was missing dlsym entry point (needed for RTLD_NEXT)
1849+
- powerpc64 ldso startup could crash depending on link order
1850+
- powerpc64 setjmp/longjmp didn't properly save/restore TOC pointer
1851+
- thumb2 setjmp/longjmp silently broke at ld-time with text not aligned
1852+
- fchown was broken on archs without SYS_fchown syscall
1853+
- fstatat was broken on mips64
1854+
- various incorrect constants in powerpc64 and mips headers
1855+
1856+
1857+
1.1.18 release notes
1858+
1859+
regression fixes:
1860+
- glob failed to match literal . and .. path components
1861+
- build for armv4t ISA level was broken
1862+
1863+
other bug fixes:
1864+
- stack overflow in posix_spawnp with large PATH variable in environment
1865+
1866+
1867+
1.1.19 release notes
1868+
1869+
new features:
1870+
- iconv framework for processing stateful encodings
1871+
- iconv support for iso-2022-jp
1872+
- iconv support for converting to legacy JIS-based Japanese encodings
1873+
- iconv support for UTF-16/32 with BOM-determined endianness
1874+
- iconv ibm1047 (ebcdic latin1-equivalent) support
1875+
- iconv cp866 (dos cyrillic) support
1876+
- character data tables & case mappings updated to Unicode 10.0
1877+
- fopencookie stdio extension
1878+
- strftime padding character extensions
1879+
- header-level support for new linux features through 4.13
1880+
1881+
compatibility:
1882+
- UTC timezone is now called UTC instead of GMT
1883+
- _DIRENT_HAVE_D_* macros in dirent.h
1884+
- dladdr dli_fbase definition now matches other implementations
1885+
- pthread_getattr_np now reports guard size
1886+
- strftime '+' modifier better matches apparent intent of POSIX
1887+
- getopt_long handles long option names containing '='
1888+
- better compatibility with linux uapi headers
1889+
- workaround linux bug where getcwd can return non-absolute pathname
1890+
- configure logic for finding compiler_rt with clang
1891+
- execvp path search now continues after ENOTDIR components
1892+
1893+
bugs fixed:
1894+
- fgetwc failed when character crossed buffer boundary
1895+
- memory corruption after failing to dlopen a second libc
1896+
- sysconf reported infinite rlimits incorrectly
1897+
- getopt_long --opt=arg did not work with partial matches
1898+
- printf was wrong for alt-form octal with value 0, no explicit precision
1899+
- endian errors in arpa/nameser.h and netinet/icmp6.h (missing endian.h)
1900+
- atfork handler could clobber fork's errno
1901+
- iconv could wrongly output surrogate pairs in ucs2
1902+
- fmemopen buffer underallocation with extreme size argument
1903+
- getaddrinfo AI_NUMERICSERV wrong error code
1904+
- data race in at_quick_exit
1905+
- ldd failed to honor rpath $ORIGIN for program in . without "./" prefix
1906+
1907+
arch-specfic bugs fixed:
1908+
- x32 unistd.h wrongly reported LP64 instead of ILP32
1909+
- aarch64 signal.h had wrong type for ucontext_t uc_link member

arch/aarch64/atomic_arch.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,10 @@ static inline int a_ctz_64(uint64_t x)
7373
: "=r"(x) : "r"(x));
7474
return x;
7575
}
76+
77+
#define a_clz_64 a_clz_64
78+
static inline int a_clz_64(uint64_t x)
79+
{
80+
__asm__("clz %0, %1" : "=r"(x) : "r"(x));
81+
return x;
82+
}

arch/aarch64/bits/hwcap.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,15 @@
99
#define HWCAP_ATOMICS (1 << 8)
1010
#define HWCAP_FPHP (1 << 9)
1111
#define HWCAP_ASIMDHP (1 << 10)
12+
#define HWCAP_CPUID (1 << 11)
13+
#define HWCAP_ASIMDRDM (1 << 12)
14+
#define HWCAP_JSCVT (1 << 13)
15+
#define HWCAP_FCMA (1 << 14)
16+
#define HWCAP_LRCPC (1 << 15)
17+
#define HWCAP_DCPOP (1 << 16)
18+
#define HWCAP_SHA3 (1 << 17)
19+
#define HWCAP_SM3 (1 << 18)
20+
#define HWCAP_SM4 (1 << 19)
21+
#define HWCAP_ASIMDDP (1 << 20)
22+
#define HWCAP_SHA512 (1 << 21)
23+
#define HWCAP_SVE (1 << 22)

arch/aarch64/bits/signal.h

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ typedef struct sigcontext {
2424

2525
#define FPSIMD_MAGIC 0x46508001
2626
#define ESR_MAGIC 0x45535201
27+
#define EXTRA_MAGIC 0x45585401
28+
#define SVE_MAGIC 0x53564501
2729
struct _aarch64_ctx {
2830
unsigned int magic;
2931
unsigned int size;
@@ -38,6 +40,50 @@ struct esr_context {
3840
struct _aarch64_ctx head;
3941
unsigned long esr;
4042
};
43+
struct extra_context {
44+
struct _aarch64_ctx head;
45+
unsigned long datap;
46+
unsigned int size;
47+
unsigned int __reserved[3];
48+
};
49+
struct sve_context {
50+
struct _aarch64_ctx head;
51+
unsigned short vl;
52+
unsigned short __reserved[3];
53+
};
54+
#define SVE_VQ_BYTES 16
55+
#define SVE_VQ_MIN 1
56+
#define SVE_VQ_MAX 512
57+
#define SVE_VL_MIN (SVE_VQ_MIN * SVE_VQ_BYTES)
58+
#define SVE_VL_MAX (SVE_VQ_MAX * SVE_VQ_BYTES)
59+
#define SVE_NUM_ZREGS 32
60+
#define SVE_NUM_PREGS 16
61+
#define sve_vl_valid(vl) \
62+
((vl) % SVE_VQ_BYTES == 0 && (vl) >= SVE_VL_MIN && (vl) <= SVE_VL_MAX)
63+
#define sve_vq_from_vl(vl) ((vl) / SVE_VQ_BYTES)
64+
#define sve_vl_from_vq(vq) ((vq) * SVE_VQ_BYTES)
65+
#define SVE_SIG_ZREG_SIZE(vq) ((unsigned)(vq) * SVE_VQ_BYTES)
66+
#define SVE_SIG_PREG_SIZE(vq) ((unsigned)(vq) * (SVE_VQ_BYTES / 8))
67+
#define SVE_SIG_FFR_SIZE(vq) SVE_SIG_PREG_SIZE(vq)
68+
#define SVE_SIG_REGS_OFFSET \
69+
((sizeof(struct sve_context) + (SVE_VQ_BYTES - 1)) \
70+
/ SVE_VQ_BYTES * SVE_VQ_BYTES)
71+
#define SVE_SIG_ZREGS_OFFSET SVE_SIG_REGS_OFFSET
72+
#define SVE_SIG_ZREG_OFFSET(vq, n) \
73+
(SVE_SIG_ZREGS_OFFSET + SVE_SIG_ZREG_SIZE(vq) * (n))
74+
#define SVE_SIG_ZREGS_SIZE(vq) \
75+
(SVE_SIG_ZREG_OFFSET(vq, SVE_NUM_ZREGS) - SVE_SIG_ZREGS_OFFSET)
76+
#define SVE_SIG_PREGS_OFFSET(vq) \
77+
(SVE_SIG_ZREGS_OFFSET + SVE_SIG_ZREGS_SIZE(vq))
78+
#define SVE_SIG_PREG_OFFSET(vq, n) \
79+
(SVE_SIG_PREGS_OFFSET(vq) + SVE_SIG_PREG_SIZE(vq) * (n))
80+
#define SVE_SIG_PREGS_SIZE(vq) \
81+
(SVE_SIG_PREG_OFFSET(vq, SVE_NUM_PREGS) - SVE_SIG_PREGS_OFFSET(vq))
82+
#define SVE_SIG_FFR_OFFSET(vq) \
83+
(SVE_SIG_PREGS_OFFSET(vq) + SVE_SIG_PREGS_SIZE(vq))
84+
#define SVE_SIG_REGS_SIZE(vq) \
85+
(SVE_SIG_FFR_OFFSET(vq) + SVE_SIG_FFR_SIZE(vq) - SVE_SIG_REGS_OFFSET)
86+
#define SVE_SIG_CONTEXT_SIZE(vq) (SVE_SIG_REGS_OFFSET + SVE_SIG_REGS_SIZE(vq))
4187
#else
4288
typedef struct {
4389
long double __regs[18+256];
@@ -52,7 +98,7 @@ struct sigaltstack {
5298

5399
typedef struct __ucontext {
54100
unsigned long uc_flags;
55-
struct ucontext *uc_link;
101+
struct __ucontext *uc_link;
56102
stack_t uc_stack;
57103
sigset_t uc_sigmask;
58104
mcontext_t uc_mcontext;

arch/aarch64/bits/syscall.h.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
#define __NR_splice 76
7878
#define __NR_tee 77
7979
#define __NR_readlinkat 78
80-
#define __NR_fstatat 79
80+
#define __NR_newfstatat 79
8181
#define __NR_fstat 80
8282
#define __NR_sync 81
8383
#define __NR_fsync 82
@@ -242,7 +242,6 @@
242242
#define __NR_perf_event_open 241
243243
#define __NR_accept4 242
244244
#define __NR_recvmmsg 243
245-
#define __NR_or1k_atomic 244
246245
#define __NR_wait4 260
247246
#define __NR_prlimit64 261
248247
#define __NR_fanotify_init 262
@@ -274,4 +273,5 @@
274273
#define __NR_pkey_mprotect 288
275274
#define __NR_pkey_alloc 289
276275
#define __NR_pkey_free 290
276+
#define __NR_statx 291
277277

arch/arm/atomic_arch.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,14 @@ static inline void a_crash()
8181
#endif
8282
: : : "memory");
8383
}
84+
85+
#if __ARM_ARCH >= 5
86+
87+
#define a_clz_32 a_clz_32
88+
static inline int a_clz_32(uint32_t x)
89+
{
90+
__asm__ ("clz %0, %1" : "=r"(x) : "r"(x));
91+
return x;
92+
}
93+
94+
#endif

0 commit comments

Comments
 (0)