Skip to content

Instantly share code, notes, and snippets.

@kripken
Created April 21, 2017 18:29
Show Gist options
  • Save kripken/a26ed97b2d92a9340ec0a2f2ea479268 to your computer and use it in GitHub Desktop.
Save kripken/a26ed97b2d92a9340ec0a2f2ea479268 to your computer and use it in GitHub Desktop.
$ EMCC_DEBUG=1 ./emcc -s VERBOSE=1 tests/hello_libcxx.cpp
DEBUG:root:PYTHON not defined in /home/alon/.emscripten, using "/usr/bin/python"
DEBUG:root:Cache: PID 4282 acquiring multiprocess file lock to Emscripten cache
DEBUG:root:Cache: done
DEBUG:root:Cache: PID 4282 released multiprocess file lock to Emscripten cache
DEBUG:root:check tells us to use asm.js backend
WARNING:root:invocation: ./emcc -s VERBOSE=1 tests/hello_libcxx.cpp (in /home/alon/Dev/emscripten)
DEBUG:root:Checking JS engine ['nodejs']
INFO:root:(Emscripten: Running sanity checks)
DEBUG:root:compiling to bitcode
DEBUG:root:emcc step "parse arguments and setup" took 0.01 seconds
DEBUG:root:compiling source file: tests/hello_libcxx.cpp
DEBUG:root:running: /home/alon/Dev/fastcomp/build/bin/clang++ -target asmjs-unknown-emscripten -D__EMSCRIPTEN_major__=1 -D__EMSCRIPTEN_minor__=37 -D__EMSCRIPTEN_tiny__=10 -D_LIBCPP_ABI_VERSION=2 -Werror=implicit-function-declaration -nostdinc -Xclang -nobuiltininc -Xclang -nostdsysteminc -Xclang -isystem/home/alon/Dev/emscripten/system/include/libcxx -Xclang -isystem/home/alon/Dev/emscripten/system/lib/libcxxabi/include -Xclang -isystem/home/alon/Dev/emscripten/system/include/compat -Xclang -isystem/home/alon/Dev/emscripten/system/include -Xclang -isystem/home/alon/Dev/emscripten/system/include/SSE -Xclang -isystem/home/alon/Dev/emscripten/system/include/libc -Xclang -isystem/home/alon/Dev/emscripten/system/lib/libc/musl/arch/emscripten -Xclang -isystem/home/alon/Dev/emscripten/system/local/include -std=c++03 tests/hello_libcxx.cpp -Xclang -isystem/home/alon/Dev/emscripten/system/include/SDL -emit-llvm -c -o /tmp/tmprcQ11E/hello_libcxx_0.o
DEBUG:root:emcc step "bitcodeize inputs" took 2.70 seconds
DEBUG:root:emcc step "process inputs" took 0.00 seconds
DEBUG:root:will generate JavaScript
DEBUG:root:adding dependency on export _main
DEBUG:root:adding dependency on export _malloc
DEBUG:root:adding dependency on export _free
DEBUG:root:adding dependency on export ___errno_location
DEBUG:root:adding dependency on export _fflush
DEBUG:root:undefs: set(['malloc', '_ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv', '_ZNSt3__26localeD1Ev', '_ZNSt3__28ios_base5clearEj', u'__cxa_is_pointer_type', '__cxa_end_catch', '_ZNKSt3__26locale9use_facetERNS0_2idE', 'fflush', 'strlen', '_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED1Ev', '_ZNSt3__25ctypeIcE2idE', '_ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE6sentryC1ERS3_', 'main', '_ZNSt3__28ios_base33__set_badbit_and_consider_rethrowEv', '_ZNKSt3__28ios_base6getlocEv', 'free', '_ZSt9terminatev', '_ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE6sentryD1Ev', '_ZNSt3__24coutE', '__cxa_begin_catch', '__cxa_call_unexpected', '__errno_location', '__gxx_personality_v0', u'__cxa_can_catch', '_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEjc', '_ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc'])
DEBUG:root:considering libcxx.a: we need set(['_ZNKSt3__28ios_base6getlocEv', '_ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv', '_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED1Ev', '_ZNSt3__26localeD1Ev', '_ZNSt3__28ios_base5clearEj', '_ZNSt3__25ctypeIcE2idE', '_ZNSt3__28ios_base33__set_badbit_and_consider_rethrowEv', '_ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE6sentryC1ERS3_', '_ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE6sentryD1Ev', '_ZNSt3__24coutE', '_ZNKSt3__26locale9use_facetERNS0_2idE', '_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEjc', '_ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc']) and have set(['_ZNSt3__216__pad_and_outputIcNS_11char_traitsIcEEEENS_19ostreambuf_iteratorIT_T0_EES6_PKS4_S8_S8_RNS_8ios_baseES4_', '__clang_call_terminate'])
DEBUG:root:including libcxx.a
DEBUG:root:Cache: PID 4282 acquiring multiprocess file lock to Emscripten cache
DEBUG:root:Cache: done
DEBUG:root:Cache: PID 4282 released multiprocess file lock to Emscripten cache
DEBUG:root:including libcxxabi.bc
DEBUG:root:Cache: PID 4282 acquiring multiprocess file lock to Emscripten cache
DEBUG:root:Cache: done
DEBUG:root:Cache: PID 4282 released multiprocess file lock to Emscripten cache
DEBUG:root:undefs: set(['malloc', '_ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv', '_ZNSt3__26localeD1Ev', '_ZNSt3__28ios_base5clearEj', u'__cxa_is_pointer_type', '__cxa_end_catch', '_ZNKSt3__26locale9use_facetERNS0_2idE', 'fflush', 'strlen', '_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED1Ev', '_ZNSt3__25ctypeIcE2idE', '_ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE6sentryC1ERS3_', 'main', '_ZNSt3__28ios_base33__set_badbit_and_consider_rethrowEv', '_ZNKSt3__28ios_base6getlocEv', 'free', '_ZSt9terminatev', '_ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE6sentryD1Ev', '_ZNSt3__24coutE', '__cxa_begin_catch', '__cxa_call_unexpected', '__errno_location', '__gxx_personality_v0', u'__cxa_can_catch', '_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEjc', '_ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc'])
DEBUG:root:considering gl.bc: we need set([]) and have set([])
DEBUG:root:undefs: set(['malloc', '_ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5flushEv', '_ZNSt3__26localeD1Ev', '_ZNSt3__28ios_base5clearEj', u'__cxa_is_pointer_type', '__cxa_end_catch', '_ZNKSt3__26locale9use_facetERNS0_2idE', 'fflush', 'strlen', '_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED1Ev', '_ZNSt3__25ctypeIcE2idE', '_ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE6sentryC1ERS3_', 'main', '_ZNSt3__28ios_base33__set_badbit_and_consider_rethrowEv', '_ZNKSt3__28ios_base6getlocEv', 'free', '_ZSt9terminatev', '_ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE6sentryD1Ev', '_ZNSt3__24coutE', '__cxa_begin_catch', '__cxa_call_unexpected', '__errno_location', '__gxx_personality_v0', u'__cxa_can_catch', '_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEjc', '_ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc'])
DEBUG:root:considering compiler-rt.a: we need set([]) and have set([])
DEBUG:root:including libc.bc
DEBUG:root:Cache: PID 4282 acquiring multiprocess file lock to Emscripten cache
DEBUG:root:Cache: done
DEBUG:root:Cache: PID 4282 released multiprocess file lock to Emscripten cache
DEBUG:root:including dlmalloc.bc
DEBUG:root:Cache: PID 4282 acquiring multiprocess file lock to Emscripten cache
DEBUG:root:Cache: done
DEBUG:root:Cache: PID 4282 released multiprocess file lock to Emscripten cache
DEBUG:root:emcc step "calculate system libraries" took 0.15 seconds
DEBUG:root:linking: ['/tmp/tmprcQ11E/hello_libcxx_0.o', '/home/alon/.emscripten_cache/asmjs/libc.bc', '/home/alon/.emscripten_cache/asmjs/dlmalloc.bc', '/home/alon/.emscripten_cache/asmjs/libcxx.a', '/home/alon/.emscripten_cache/asmjs/libcxxabi.bc']
DEBUG:root:adding object /tmp/tmprcQ11E/hello_libcxx_0.o to link
DEBUG:root:adding object /home/alon/.emscripten_cache/asmjs/libc.bc to link
DEBUG:root:adding object /home/alon/.emscripten_cache/asmjs/dlmalloc.bc to link
DEBUG:root:considering archive /home/alon/.emscripten_cache/asmjs/libcxx.a
DEBUG:root:adding object /tmp/emscripten_temp_jKd8mz_archive_contents/ios_c652cc52.cpp.o to link
DEBUG:root:adding object /tmp/emscripten_temp_jKd8mz_archive_contents/iostream_ab46a785.cpp.o to link
DEBUG:root:adding object /tmp/emscripten_temp_jKd8mz_archive_contents/locale_c93df7b8.cpp.o to link
DEBUG:root:adding object /tmp/emscripten_temp_jKd8mz_archive_contents/memory_b1de8817.cpp.o to link
DEBUG:root:adding object /tmp/emscripten_temp_jKd8mz_archive_contents/mutex_51fb4f57.cpp.o to link
DEBUG:root:adding object /tmp/emscripten_temp_jKd8mz_archive_contents/new_cf22a31b.cpp.o to link
DEBUG:root:adding object /tmp/emscripten_temp_jKd8mz_archive_contents/stdexcept_3ccb19b7.cpp.o to link
DEBUG:root:adding object /tmp/emscripten_temp_jKd8mz_archive_contents/string_1f437cfd.cpp.o to link
DEBUG:root:adding object /tmp/emscripten_temp_jKd8mz_archive_contents/system_error_08ba02a8.cpp.o to link
DEBUG:root:adding object /tmp/emscripten_temp_jKd8mz_archive_contents/condition_variable_eec6fefc.cpp.o to link
DEBUG:root:adding object /tmp/emscripten_temp_jKd8mz_archive_contents/thread_4d322b8f.cpp.o to link
DEBUG:root:adding object /tmp/emscripten_temp_jKd8mz_archive_contents/future_7fefbb37.cpp.o to link
DEBUG:root:adding object /tmp/emscripten_temp_jKd8mz_archive_contents/exception_df4cbe19.cpp.o to link
DEBUG:root:done running loop of archive /home/alon/.emscripten_cache/asmjs/libcxx.a
DEBUG:root:adding object /home/alon/.emscripten_cache/asmjs/libcxxabi.bc to link
DEBUG:root:emcc step "link" took 0.35 seconds
DEBUG:root:saving intermediate processing steps to /tmp/emscripten_temp
DEBUG:root:(not saving intermediate /tmp/emscripten_temp/emcc-0-basebc.bc because deferring linking)
DEBUG:root:emcc: LLVM opts: -strip-debug -disable-debug-info-type-map -internalize -internalize-public-api-list=main,malloc,free,__errno_location,fflush,__cxa_can_catch,__cxa_is_pointer_type -globaldce -disable-loop-vectorization -disable-slp-vectorization -vectorize-loops=false -vectorize-slp=false -vectorize-slp-aggressive=false [num inputs: 17]
DEBUG:root:emcc step "post-link" took 2.72 seconds
DEBUG:root:LLVM => JS
DEBUG:root:emscript: llvm backend: /home/alon/Dev/fastcomp/build/bin/llc /tmp/tmprcQ11E/a.out.bc -march=js -filetype=asm -o /tmp/emscripten_temp/tmpg30t46.4.js -emscripten-stack-size=5242880 -O0 -emscripten-assertions=1 -emscripten-no-aliasing-function-pointers -emscripten-global-base=8 -enable-emscripten-cpp-exceptions
DEBUG:root: emscript: llvm backend took 1.3199429512 seconds
DEBUG:root:emscript: js compiler glue
VERBOSE is on, this generates a lot of output and can slow down compilation
adding ___cxa_atexit and deps atexit : function ___cxa_atexit() {
return _atexi
adding _atexit and deps : function _atexit(func, arg) {
__ATEX
adding _i64Subtract and deps : function _i64Subtract(a, b, c, d) {
adding _i64Add and deps : function _i64Add(a, b, c, d) {
/*
adding ___cxa_throw and deps _ZSt18uncaught_exceptionv,__cxa_find_matching_catch,$EXCEPTIONS : function ___cxa_throw(ptr, type, destruc
adding __ZSt18uncaught_exceptionv and deps : function __ZSt18uncaught_exceptionv() {
adding ___cxa_find_matching_catch and deps __resumeException,$EXCEPTIONS : function ___cxa_find_matching_catch() {
adding ___resumeException and deps $EXCEPTIONS,function () { Functions.libraryFunctions['___resumeException'] = 1 } : function ___resumeException(ptr) {
i
adding EXCEPTIONS and deps : {last:0,caught:[],infos:{},deAdjust:func
adding _memset and deps : function _memset(ptr, value, num) {
adding _pthread_mutex_lock and deps : function _pthread_mutex_lock(x) {
x
adding _strftime_l and deps strftime : function _strftime_l(s, maxsize, format,
adding _strftime and deps _isLeapYear,_arraySum,_addDays,_MONTH_DAYS_REGULAR,_MONTH_DAYS_LEAP : function _strftime(s, maxsize, format, t
adding __isLeapYear and deps : function __isLeapYear(year) {
retu
adding __arraySum and deps : function __arraySum(array, index) {
adding __addDays and deps _isLeapYear,_MONTH_DAYS_LEAP,_MONTH_DAYS_REGULAR : function __addDays(date, days) {
var
adding __MONTH_DAYS_LEAP and deps : [31,29,31,30,31,30,31,31,30,31,30,31]
adding __MONTH_DAYS_REGULAR and deps : [31,28,31,30,31,30,31,31,30,31,30,31]
adding _abort and deps : function _abort() {
Module['abort'](
adding ___cxa_end_catch and deps __cxa_free_exception,$EXCEPTIONS : function ___cxa_end_catch() {
// Cle
adding ___cxa_free_exception and deps free : function ___cxa_free_exception(ptr) {
adding _free and deps : function _free() {
}
adding _pthread_once and deps : function _pthread_once(ptr, func) {
adding ___lock and deps : function ___lock() {}
adding ___unlock and deps : function ___unlock() {}
adding _pthread_getspecific and deps $PTHREAD_SPECIFIC : function _pthread_getspecific(key) {
adding PTHREAD_SPECIFIC and deps : {}
adding _pthread_key_create and deps $PTHREAD_SPECIFIC,$PTHREAD_SPECIFIC_NEXT_KEY,$ERRNO_CODES : function _pthread_key_create(key, destru
adding PTHREAD_SPECIFIC_NEXT_KEY and deps : 1
adding ERRNO_CODES and deps : {EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,
adding ___syscall91 and deps $SYSCALLS : function ___syscall91(which, varargs) {S
adding SYSCALLS and deps $FS,$ERRNO_CODES,$PATH : {DEFAULT_POLLMASK:5,mappings:{},umask:51
adding FS and deps $ERRNO_CODES,$ERRNO_MESSAGES,__setErrNo,$PATH,$TTY,$MEMFS,$IDBFS,$NODEFS,$WORKERFS,stdin,stdout,stderr : {root:null,mounts:[],devices:[null],stre
adding ERRNO_MESSAGES and deps : {0:"Success",1:"Not super-user",2:"No su
adding ___setErrNo and deps : function ___setErrNo(value) {
if (Mo
adding PATH and deps $FS : {splitPath:function (filename) {
v
adding TTY and deps $FS : {ttys:[],init:function () {
// htt
adding MEMFS and deps $FS : {ops_table:null,mount:function (mount) {
adding IDBFS and deps $FS,$MEMFS,$PATH : {dbs:{},indexedDB:function () {
if
adding NODEFS and deps $FS,$PATH : {isWindows:false,staticInit:function ()
adding WORKERFS and deps $FS : {DIR_MODE:16895,FILE_MODE:33279,reader:n
adding _stdin and deps : STATICTOP; STATICTOP += 16;
adding _stdout and deps : STATICTOP; STATICTOP += 16;
adding _stderr and deps : STATICTOP; STATICTOP += 16;
adding _pthread_setspecific and deps $PTHREAD_SPECIFIC,$ERRNO_CODES : function _pthread_setspecific(key, value
adding ___cxa_allocate_exception and deps malloc : function ___cxa_allocate_exception(size)
adding _malloc and deps : function _malloc(bytes) {
/* Over-al
adding ___syscall54 and deps $SYSCALLS : function ___syscall54(which, varargs) {S
adding _bitshift64Lshr and deps : function _bitshift64Lshr(low, high, bits
adding _pthread_cond_broadcast and deps : function _pthread_cond_broadcast(x) {
adding _getenv and deps $ENV : function _getenv(name) {
// char *ge
adding ENV and deps __buildEnvironment : {}
adding ___buildEnvironment and deps __environ : function ___buildEnvironment(env) {
adding ___environ and deps environ,environ,$ENV : _environ
adding _environ and deps $ENV : STATICTOP; STATICTOP += 16;
adding ___cxa_find_matching_catch_4 and deps : function ___cxa_find_matching_catch_4()
adding ___map_file and deps $ERRNO_CODES,__setErrNo : function ___map_file(pathname, size) {
adding ___cxa_find_matching_catch_2 and deps : function ___cxa_find_matching_catch_2()
adding ___cxa_find_matching_catch_3 and deps : function ___cxa_find_matching_catch_3()
adding ___cxa_begin_catch and deps _ZSt18uncaught_exceptionv,$EXCEPTIONS : function ___cxa_begin_catch(ptr) {
v
adding _memcpy and deps emscripten_memcpy_big : function _memcpy(dest, src, num) {
d
adding _emscripten_memcpy_big and deps : function _emscripten_memcpy_big(dest, sr
adding ___syscall6 and deps $SYSCALLS : function ___syscall6(which, varargs) {SY
adding ___udivdi3 and deps __udivmoddi4 : function ___udivdi3($a$0, $a$1, $b$0, $b
adding ___udivmoddi4 and deps i64Add,i64Subtract,llvm_cttz_i32 : function ___udivmoddi4($a$0, $a$1, $b$0,
adding _llvm_cttz_i32 and deps function () {
function cttz(x) {
for (var i = 0; i < 8; i++) {
if (x & (1 << i)) {
return i;
}
}
return 8;
}
if (SIDE_MODULE) return ''; // uses it from the parent
return 'var cttz_i8 = allocate([' + range(256).map(function(x) { return cttz(x) }).join(',') + '], "i8", ALLOC_STATIC);';
} : function _llvm_cttz_i32(x) {
x = x|0
adding ___muldi3 and deps __muldsi3 : function ___muldi3($a$0, $a$1, $b$0, $b$
adding ___muldsi3 and deps : function ___muldsi3($a, $b) {
$a = $
adding _sbrk and deps __setErrNo : function _sbrk(increment) {
incremen
adding _bitshift64Shl and deps : function _bitshift64Shl(low, high, bits)
adding _memmove and deps memcpy : function _memmove(dest, src, num) {
adding ___gxx_personality_v0 and deps _ZSt18uncaught_exceptionv,__cxa_find_matching_catch : function ___gxx_personality_v0() {
}
adding ___uremdi3 and deps __udivmoddi4 : function ___uremdi3($a$0, $a$1, $b$0, $b
adding _pthread_cond_wait and deps : function _pthread_cond_wait() { return 0
adding ___cxa_rethrow and deps __cxa_end_catch,$EXCEPTIONS : function ___cxa_rethrow() {
var ptr
adding _pthread_mutex_unlock and deps : function _pthread_mutex_unlock(x) {
adding _llvm_bswap_i32 and deps : function _llvm_bswap_i32(x) {
x = x|
adding ___syscall140 and deps $SYSCALLS : function ___syscall140(which, varargs) {
adding ___syscall146 and deps $SYSCALLS : function ___syscall146(which, varargs) {
adding ___syscall145 and deps $SYSCALLS : function ___syscall145(which, varargs) {
adding ___dso_handle and deps : STATICTOP; STATICTOP += 16;
DEBUG:root: emscript: glue took 1.22769999504 seconds
DEBUG:root:emscript: python processing: function tables and exports
DEBUG:root:asm text sizes[[2117591, 19682], 17766, 243, 4653, 0, 5280, 93824, 2080, 268, 3570, 16050]
DEBUG:root: emscript: python processing: function tables and exports took 0.092875957489 seconds
DEBUG:root:emscript: python processing: finalize
DEBUG:root: emscript: python processing: finalize took 0.019877910614 seconds
DEBUG:root:emcc step "emscript (llvm => executable code)" took 2.97 seconds
DEBUG:root:emcc step "source transforms" took 0.00 seconds
DEBUG:root:optimizing memory initialization
DEBUG:root:emcc step "memory initializer" took 0.07 seconds
DEBUG:root:emcc step "js opts" took 0.00 seconds
DEBUG:root:emcc step "final emitting" took 0.00 seconds
DEBUG:root:total time: 8.98 seconds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment