Author: JohnnyAnliZ Date: 2026-08-27T12:57:07-07:00 New Revision: 098e572f7f228486e6164ea3f9bcdd1e45625aea
URL: https://github.com/llvm/llvm-project/commit/098e572f7f228486e6164ea3f9bcdd1e45625aea DIFF: https://github.com/llvm/llvm-project/commit/098e572f7f228486e6164ea3f9bcdd1e45625aea.diff LOG: [Support] Fix visibility macro guard: __WASM__ is never defined (#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. Added: Modified: clang/include/clang/Support/Compiler.h llvm/include/llvm/Support/Compiler.h Removed: ################################################################################ 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
