From f4131cf8a645d7c857fb1c0401000cac0b50080b Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Tue, 3 May 2022 21:45:20 +0200 Subject: musl: update to 1.2.3 This was a bit trickier than it should be due to symbol conflicts with zig's compiler-rt implementation. We attempt to use weak linkage in our compiler-rt, but this does not seem to be working in all cases. I manually disabled export of the problematic compiler-rt math functions in order to cross compile musl's libc.so for all targets as input to `tools/gen_stubs.zig`. Other than that, this update went fairly smoothly. Quite a few additional symbols were added to the blacklist in `tools/gen_stubs.zig` due to recent reorganization of zig's compiler-rt. --- lib/libc/musl/src/malloc/mallocng/aligned_alloc.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/libc/musl/src/malloc/mallocng/aligned_alloc.c') diff --git a/lib/libc/musl/src/malloc/mallocng/aligned_alloc.c b/lib/libc/musl/src/malloc/mallocng/aligned_alloc.c index 3411689600..e0862a83ae 100644 --- a/lib/libc/musl/src/malloc/mallocng/aligned_alloc.c +++ b/lib/libc/musl/src/malloc/mallocng/aligned_alloc.c @@ -22,6 +22,9 @@ void *aligned_alloc(size_t align, size_t len) if (align <= UNIT) align = UNIT; unsigned char *p = malloc(len + align - UNIT); + if (!p) + return 0; + struct meta *g = get_meta(p); int idx = get_slot_index(p); size_t stride = get_stride(g); -- cgit v1.2.3