This exact clang --target=wasm32 and wasm-ld pipeline (or its Emscripten wrapper) is how Figma and AutoCAD ported their existing C++ codebases to run at near-native speed inside a browser tab. The __attribute__((visibility("default"))) export step you're documenting is the real reason a compiled function is callable from JavaScript at all — without it, wasm-ld strips the symbol entirely.