Issue 92698
Summary [clang][WebAssembly] Odd builtin behaviour
Labels clang
Assignees
Reporter Photosounder
    Using clang (version 18.1.4) to compile WebAssembly and going the `-nostdlib` route I'm noticing strange things when I try to use some builtins to implement libc functions. For instance doing `static float asinf(float x) { return __builtin_asinf(x); }` or `static double sqrt(double x) { return __builtin_sqrt(x); }` works fine but doing `static double exp2(double x) { return __builtin_exp2(x); }` gives me `wasm-ld: error: C:/msys/tmp/rl-89dcca.o: undefined symbol: exp2` and making it non-static with an `extern` prototype above itself just makes it call itself in a loop. That's even though `__has_builtin(__builtin_exp2)` is positive.

It seems as though some builtins aren't really there for WebAssembly, but there doesn't seem to be a clear way to determine which are actually usable, and knowing which I can actually use is what I would need.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to