https://github.com/JohnnyAnliZ created https://github.com/llvm/llvm-project/pull/215665
The CLANG_ABI/LLVM_ABI visibility branches test defined __WASM__, but clang predefines lowercase __wasm__ for WebAssembly targets. __WASM__ doesn't exist, so this branch never fire for pure-WASI builds. I hit this mismatch while building clang for wasm32-wasip1 with wasi-sdk. >From 7fa39a8edfed8cf16981bdac1759dbc94939b132 Mon Sep 17 00:00:00 2001 From: JohnnyAnliZ <[email protected]> Date: Tue, 11 Aug 2026 16:49:49 -0400 Subject: [PATCH] [Support] Fix visibility macro guard: __WASM__ is never defined The CLANG_ABI/LLVM_ABI visibility branches test defined __WASM__, but clang predefines lowercase __wasm__ for WebAssembly targets. __WASM__ doesn't exist, so this branch never fire for pure-WASI builds. --- clang/include/clang/Support/Compiler.h | 2 +- llvm/include/llvm/Support/Compiler.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/clang/include/clang/Support/Compiler.h b/clang/include/clang/Support/Compiler.h index d7f7a0b092fbb..66d6c5b30e7b7 100644 --- a/clang/include/clang/Support/Compiler.h +++ b/clang/include/clang/Support/Compiler.h @@ -62,7 +62,7 @@ #define CLANG_ABI_EXPORT LLVM_ATTRIBUTE_VISIBILITY_DEFAULT #define CLANG_TEMPLATE_ABI LLVM_ATTRIBUTE_VISIBILITY_DEFAULT #define CLANG_EXPORT_TEMPLATE -#elif defined(__MACH__) || defined(__WASM__) || defined(__EMSCRIPTEN__) +#elif defined(__MACH__) || defined(__wasm__) || defined(__EMSCRIPTEN__) #define CLANG_ABI LLVM_ATTRIBUTE_VISIBILITY_DEFAULT #define CLANG_ABI_EXPORT LLVM_ATTRIBUTE_VISIBILITY_DEFAULT #define CLANG_TEMPLATE_ABI diff --git a/llvm/include/llvm/Support/Compiler.h b/llvm/include/llvm/Support/Compiler.h index f9dc2e8d45c4d..33ea019a87be5 100644 --- a/llvm/include/llvm/Support/Compiler.h +++ b/llvm/include/llvm/Support/Compiler.h @@ -203,7 +203,7 @@ #define LLVM_TEMPLATE_ABI LLVM_ABI #define LLVM_EXPORT_TEMPLATE #define LLVM_ABI_EXPORT LLVM_ABI -#elif defined(__MACH__) || defined(__WASM__) || defined(__EMSCRIPTEN__) +#elif defined(__MACH__) || defined(__wasm__) || defined(__EMSCRIPTEN__) #define LLVM_ABI __attribute__((visibility("default"))) #define LLVM_TEMPLATE_ABI #define LLVM_EXPORT_TEMPLATE _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
