From 80687dae7974037b845724fe777dc3550c79d8dd Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Fri, 20 Mar 2026 09:06:57 -0600 Subject: [PATCH] disable custom page size support when using `-fPIC` See https://github.com/WebAssembly/wasi-libc/issues/778 for details. --- libc-bottom-half/headers/public/__macro_PAGESIZE.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libc-bottom-half/headers/public/__macro_PAGESIZE.h b/libc-bottom-half/headers/public/__macro_PAGESIZE.h index fbeff8d00..2101a3ec1 100644 --- a/libc-bottom-half/headers/public/__macro_PAGESIZE.h +++ b/libc-bottom-half/headers/public/__macro_PAGESIZE.h @@ -14,7 +14,9 @@ * consideration. POSIX has deprecated `getpagesize` in favor of * `sysconf(_SC_PAGESIZE)` which does not have this problem. */ -#if __clang_major__ >= 22 +// FIXME(#778): `__wasm_first_page_end` is broken for PIC as of this writing and +// will likely require `wasm-ld` changes, at which point we can re-enable it. +#if __clang_major__ >= 22 && !defined __pic__ extern char __wasm_first_page_end; #define PAGESIZE ((unsigned long)&__wasm_first_page_end) #else