Search code examples
cllvmllvm-clangwebassembly

`__heap_base` seems to be missing in clang 9.0.0, is there a replacement?


I'm trying to compile a C library of mine for WebAssembly, using clang (no emscripten), and it compiles fine with clang version 8.0.1, but fails with clang version 9.0.0. The reported error is wasm-ld: error: ….o: undefined symbol: __heap_base. Has __heap_base been replaced with some other symbol?

The library is open source and compilation instructions can be found here


Solution

  • Actually, I believe I found the culprit: the linker in 9.0.0 seems to require the --export=__heap_base (-Wl,--export=__heap_base for the clang). This works for my project.