I'm curious if it's possible to have emscripten build a binary without libc.
If I have simple.c:
int add1(int x) {
return x + 1;
}
And I don't want to include any of libc, is that possible?
My best attempt so far has been:
emcc simple.c -s NO_FILESYSTEM=1 -s DISABLE_EXCEPTION_CATCHING=1 -s DEFAULT_LIBRARY_FUNCS_TO_INCLUDE='[]' -s LIBRARY_DEPS_TO_AUTOEXPORT='[]' -s EXPORTED_FUNCTIONS='["add1"]' -s USE_SDL=0 -o simple.js -nostdlib
But the generated output still includes symbols for malloc, string conversion routines, and so on.
I'm also interested in the same process for generating webassembly; that is, my real goal is generating a webassembly module that contains only a single function. Is this possible with emscripten?