From 8d4226c06c843225f7ba7ff896fd21d16c614d06 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 25 Jan 2012 15:49:31 -0800 Subject: improve nativize_llvm --- system/lib/debugging.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 system/lib/debugging.cpp (limited to 'system/lib/debugging.cpp') diff --git a/system/lib/debugging.cpp b/system/lib/debugging.cpp new file mode 100644 index 00000000..ff9e0d68 --- /dev/null +++ b/system/lib/debugging.cpp @@ -0,0 +1,22 @@ + +// Some stuff to patch up an emscripten-sdk build so it can be built natively (see nativize_llvm) + +#include +#include + +extern "C" { + +int *__errno() +{ + static int e = 0; + return &e; +} + +void __assert_func(const char *file, int line, const char *assertt, const char *cond) +{ + printf("assert-func: %s : %d : %s : %s\n", file, line, assertt, cond); + abort(); +} + +} + -- cgit v1.2.3-18-g5258