Added commentary about wasm mem* functions
This commit is contained in:
committed by
Sergey Bogolepov
parent
0406b0ff0b
commit
c4bb89969b
@@ -324,10 +324,10 @@ targetSysRoot.wasm32 = target-sysroot-2-wasm
|
||||
optFlags.wasm32 = -internalize
|
||||
optNooptFlags.wasm32 = -O1
|
||||
optOptFlags.wasm32 = -O3
|
||||
optDebugFlags.wasm32 =
|
||||
optDebugFlags.wasm32 = -O0
|
||||
llcFlags.wasm32 =
|
||||
llcNooptFlags.wasm32 = -O1
|
||||
llcOptFlags.wasm32 = -O3
|
||||
llcDebugFlags.wasm32 =
|
||||
llcDebugFlags.wasm32 = -O0
|
||||
# The stack size is in bytes.
|
||||
s2wasmFlags.wasm32 = --allocate-stack 1048576 --import-memory
|
||||
|
||||
@@ -46,7 +46,11 @@ int snprintf(char* buffer, size_t size, const char* format, ...);
|
||||
size_t strnlen(const char* buffer, size_t maxSize);
|
||||
|
||||
|
||||
|
||||
// These functions should be marked with RUNTIME_USED attribute for wasm target
|
||||
// because clang replaces these operations with intrinsics that will be
|
||||
// replaced back to library calls only on codegen step. And there is no stdlib
|
||||
// for wasm target for now :(
|
||||
// Otherwise `opt` will see no usages of these definitions and will remove them.
|
||||
extern "C" {
|
||||
#ifdef KONAN_WASM
|
||||
|
||||
@@ -65,9 +69,6 @@ int memcmp(const void *s1, const void *s2, size_t n);
|
||||
RUNTIME_USED
|
||||
void *memset(void *b, int c, size_t len);
|
||||
|
||||
RUNTIME_USED
|
||||
size_t strlen(const char *s);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user