From 0931855a6cbfb22fd7bf4e2844c0ef1291e82902 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Wed, 7 Dec 2022 16:03:29 -0800 Subject: [PATCH] Don't define posix macros that we don't support For some reason we were using -1, but AFAICT these macros are expected to be undefined when not available. This change was original made in #9452. --- system/lib/libc/README.md | 2 +- system/lib/libc/musl/include/unistd.h | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/system/lib/libc/README.md b/system/lib/libc/README.md index c0c53c0152d60..431fef4cf8b09 100644 --- a/system/lib/libc/README.md +++ b/system/lib/libc/README.md @@ -11,7 +11,7 @@ Some changes have been made to the version that was taken from upstream, includi * Backporting an operator-precedence warning fix from 6e76e1540fc58a418494bf5eb832b556f9c5763e in the upstream version. * Switch to using the wasi `fd_write` syscall instead of `writev`. * Simplify stdout stream handling: do not support seeking, terminal handling, etc., as it just increases code size and Emscripten doesn't have those features anyhow. - * Setting `_POSIX_REALTIME_SIGNALS` and `_POSIX_SPAWN` macros to -1, to exclude unsupported functions. + * Don't define `_POSIX_REALTIME_SIGNALS` and `_POSIX_SPAWN` macros, to exclude unsupported functions. Copy log.c and log2.c from ealier version of musl which result in smaller binary size since they do not rely data tables in log_data.c and log2_data.c. diff --git a/system/lib/libc/musl/include/unistd.h b/system/lib/libc/musl/include/unistd.h index 635fd4abf4bde..f765971eb30d7 100644 --- a/system/lib/libc/musl/include/unistd.h +++ b/system/lib/libc/musl/include/unistd.h @@ -242,8 +242,6 @@ pid_t gettid(void); #ifndef __EMSCRIPTEN__ #define _POSIX_REALTIME_SIGNALS _POSIX_VERSION -#else -#define _POSIX_REALTIME_SIGNALS -1 #endif #define _POSIX_REGEXP 1 @@ -252,8 +250,6 @@ pid_t gettid(void); #ifndef __EMSCRIPTEN__ #define _POSIX_SPAWN _POSIX_VERSION -#else -#define _POSIX_SPAWN -1 #endif #define _POSIX_VDISABLE 0 @@ -264,9 +260,7 @@ pid_t gettid(void); #define _POSIX_THREAD_ATTR_STACKADDR _POSIX_VERSION #define _POSIX_THREAD_ATTR_STACKSIZE _POSIX_VERSION #define _POSIX_THREAD_PRIORITY_SCHEDULING _POSIX_VERSION -#ifdef __EMSCRIPTEN__ -#define _POSIX_THREAD_CPUTIME -1 -#else +#ifndef __EMSCRIPTEN__ #define _POSIX_THREAD_CPUTIME _POSIX_VERSION #endif #define _POSIX_TIMERS _POSIX_VERSION