webruby 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/bin/webruby +36 -0
- data/driver/driver.c +50 -0
- data/driver/main.c +40 -0
- data/lib/webruby/app.rb +13 -0
- data/lib/webruby/config.rb +61 -0
- data/lib/webruby/environment.rb +32 -0
- data/lib/webruby/rake/files.rake +66 -0
- data/lib/webruby/rake/general.rake +22 -0
- data/lib/webruby/rake/mruby.rake +44 -0
- data/lib/webruby/utility.rb +132 -0
- data/lib/webruby.rb +10 -0
- data/modules/emscripten/AUTHORS +89 -0
- data/modules/emscripten/LICENSE +68 -0
- data/modules/emscripten/README.markdown +14 -0
- data/modules/emscripten/cmake/Platform/Emscripten.cmake +61 -0
- data/modules/emscripten/cmake/Platform/Emscripten_unix.cmake +24 -0
- data/modules/emscripten/em++ +12 -0
- data/modules/emscripten/em++.bat +2 -0
- data/modules/emscripten/em-config +24 -0
- data/modules/emscripten/em-config.bat +2 -0
- data/modules/emscripten/emar +24 -0
- data/modules/emscripten/emar.bat +2 -0
- data/modules/emscripten/emcc +1744 -0
- data/modules/emscripten/emcc.bat +2 -0
- data/modules/emscripten/emcc.py +5 -0
- data/modules/emscripten/emconfigure +27 -0
- data/modules/emscripten/emconfigure.bat +2 -0
- data/modules/emscripten/emlibtool +11 -0
- data/modules/emscripten/emlibtool.bat +2 -0
- data/modules/emscripten/emlink.py +293 -0
- data/modules/emscripten/emmake +29 -0
- data/modules/emscripten/emmake.bat +2 -0
- data/modules/emscripten/emranlib +9 -0
- data/modules/emscripten/emranlib.bat +2 -0
- data/modules/emscripten/emscons +20 -0
- data/modules/emscripten/emscripten.py +835 -0
- data/modules/emscripten/patches/README +4 -0
- data/modules/emscripten/patches/series +2 -0
- data/modules/emscripten/scons-tools/closure.py +28 -0
- data/modules/emscripten/scons-tools/emscripten.py +359 -0
- data/modules/emscripten/scons-tools/llvm.py +33 -0
- data/modules/emscripten/src/analyzer.js +1695 -0
- data/modules/emscripten/src/compiler.html +48 -0
- data/modules/emscripten/src/compiler.js +298 -0
- data/modules/emscripten/src/corruptionCheck.js +98 -0
- data/modules/emscripten/src/determinstic.js +20 -0
- data/modules/emscripten/src/embind/embind.js +1677 -0
- data/modules/emscripten/src/embind/emval.js +283 -0
- data/modules/emscripten/src/experimental/allow_loopvars_from_memsetcpy_inasm.diff +97 -0
- data/modules/emscripten/src/experimental/batching.diff +44 -0
- data/modules/emscripten/src/experimental/functypeopt.diff +113 -0
- data/modules/emscripten/src/experimental/multiple_heaps.diff +175 -0
- data/modules/emscripten/src/experimental/noncallgraphprofiling.diff +197 -0
- data/modules/emscripten/src/experimental/optimize_memcpy_for_ta1.diff +124 -0
- data/modules/emscripten/src/experimental/remove__label__s.diff +140 -0
- data/modules/emscripten/src/experimental/renderer_cache_hash.diff +99 -0
- data/modules/emscripten/src/experimental/sdl_key_forwarding.diff +57 -0
- data/modules/emscripten/src/experimental/simplifyGeneratedFunctionsDetection.diff +336 -0
- data/modules/emscripten/src/experimental/stringCache.diff +147 -0
- data/modules/emscripten/src/fastLong.js +299 -0
- data/modules/emscripten/src/framework.js +257 -0
- data/modules/emscripten/src/gl-matrix.js +1952 -0
- data/modules/emscripten/src/headless.js +904 -0
- data/modules/emscripten/src/intertyper.js +1050 -0
- data/modules/emscripten/src/jsifier.js +1827 -0
- data/modules/emscripten/src/library.js +8270 -0
- data/modules/emscripten/src/library_browser.js +911 -0
- data/modules/emscripten/src/library_egl.js +491 -0
- data/modules/emscripten/src/library_gc.js +236 -0
- data/modules/emscripten/src/library_gl.js +4452 -0
- data/modules/emscripten/src/library_glfw.js +576 -0
- data/modules/emscripten/src/library_glut.js +449 -0
- data/modules/emscripten/src/library_jansson.js +320 -0
- data/modules/emscripten/src/library_openal.js +602 -0
- data/modules/emscripten/src/library_sdl.js +2024 -0
- data/modules/emscripten/src/library_strtok_r.c +97 -0
- data/modules/emscripten/src/library_xlib.js +23 -0
- data/modules/emscripten/src/long.js +1609 -0
- data/modules/emscripten/src/modules.js +491 -0
- data/modules/emscripten/src/parseTools.js +2474 -0
- data/modules/emscripten/src/postamble.js +170 -0
- data/modules/emscripten/src/postamble_sharedlib.js +16 -0
- data/modules/emscripten/src/preamble.js +914 -0
- data/modules/emscripten/src/preamble_sharedlib.js +25 -0
- data/modules/emscripten/src/relooper/README.markdown +14 -0
- data/modules/emscripten/src/relooper/Relooper.cpp +1236 -0
- data/modules/emscripten/src/relooper/Relooper.h +250 -0
- data/modules/emscripten/src/relooper/doit.sh +70 -0
- data/modules/emscripten/src/relooper/emscripten/glue.js +57 -0
- data/modules/emscripten/src/relooper/emscripten/test.js +44 -0
- data/modules/emscripten/src/relooper/fuzzer.py +116 -0
- data/modules/emscripten/src/relooper/ministring.h +35 -0
- data/modules/emscripten/src/relooper/paper.pdf +0 -0
- data/modules/emscripten/src/relooper/test.cpp +262 -0
- data/modules/emscripten/src/relooper/test.txt +155 -0
- data/modules/emscripten/src/relooper/test2.c +44 -0
- data/modules/emscripten/src/relooper/test2.txt +12 -0
- data/modules/emscripten/src/relooper/test3.c +42 -0
- data/modules/emscripten/src/relooper/test3.txt +27 -0
- data/modules/emscripten/src/relooper/test4.cpp +40 -0
- data/modules/emscripten/src/relooper/test4.txt +23 -0
- data/modules/emscripten/src/relooper/test5.cpp +40 -0
- data/modules/emscripten/src/relooper/test5.txt +32 -0
- data/modules/emscripten/src/relooper/test6.cpp +31 -0
- data/modules/emscripten/src/relooper/test6.txt +12 -0
- data/modules/emscripten/src/relooper/test_dead.cpp +28 -0
- data/modules/emscripten/src/relooper/test_dead.txt +9 -0
- data/modules/emscripten/src/relooper/test_debug.cpp +30 -0
- data/modules/emscripten/src/relooper/test_debug.txt +128 -0
- data/modules/emscripten/src/relooper/test_fuzz1.cpp +52 -0
- data/modules/emscripten/src/relooper/test_fuzz1.txt +32 -0
- data/modules/emscripten/src/relooper/test_fuzz2.cpp +34 -0
- data/modules/emscripten/src/relooper/test_fuzz2.txt +13 -0
- data/modules/emscripten/src/relooper/test_fuzz3.cpp +36 -0
- data/modules/emscripten/src/relooper/test_fuzz3.txt +9 -0
- data/modules/emscripten/src/relooper/test_fuzz4.cpp +38 -0
- data/modules/emscripten/src/relooper/test_fuzz4.txt +19 -0
- data/modules/emscripten/src/relooper/test_fuzz5.cpp +57 -0
- data/modules/emscripten/src/relooper/test_fuzz5.txt +52 -0
- data/modules/emscripten/src/relooper/test_fuzz6.cpp +322 -0
- data/modules/emscripten/src/relooper/test_fuzz6.txt +108 -0
- data/modules/emscripten/src/relooper/test_inf.cpp +813 -0
- data/modules/emscripten/src/relooper/test_inf.txt +385 -0
- data/modules/emscripten/src/relooper/testit.sh +62 -0
- data/modules/emscripten/src/relooper/updateit.sh +17 -0
- data/modules/emscripten/src/relooper.js +11516 -0
- data/modules/emscripten/src/relooper.js.raw.js +11511 -0
- data/modules/emscripten/src/runtime.js +546 -0
- data/modules/emscripten/src/settings.js +1284 -0
- data/modules/emscripten/src/shell.html +92 -0
- data/modules/emscripten/src/shell.js +153 -0
- data/modules/emscripten/src/shell_sharedlib.js +12 -0
- data/modules/emscripten/src/socket.io.js +3870 -0
- data/modules/emscripten/src/utility.js +379 -0
- data/modules/emscripten/src/wrtcp.js +821 -0
- data/modules/emscripten/system/include/AL/al.h +172 -0
- data/modules/emscripten/system/include/AL/alc.h +84 -0
- data/modules/emscripten/system/include/EGL/egl.h +329 -0
- data/modules/emscripten/system/include/EGL/eglext.h +398 -0
- data/modules/emscripten/system/include/EGL/eglplatform.h +141 -0
- data/modules/emscripten/system/include/GL/freeglut_std.h +628 -0
- data/modules/emscripten/system/include/GL/gl.h +2241 -0
- data/modules/emscripten/system/include/GL/glew.h +6 -0
- data/modules/emscripten/system/include/GL/glext.h +11127 -0
- data/modules/emscripten/system/include/GL/glfw.h +518 -0
- data/modules/emscripten/system/include/GL/glu.h +353 -0
- data/modules/emscripten/system/include/GL/glut.h +21 -0
- data/modules/emscripten/system/include/GLES/gl.h +770 -0
- data/modules/emscripten/system/include/GLES/glext.h +1278 -0
- data/modules/emscripten/system/include/GLES/glplatform.h +30 -0
- data/modules/emscripten/system/include/GLES2/gl2.h +621 -0
- data/modules/emscripten/system/include/GLES2/gl2ext.h +803 -0
- data/modules/emscripten/system/include/GLES2/gl2platform.h +30 -0
- data/modules/emscripten/system/include/KHR/khrplatform.h +277 -0
- data/modules/emscripten/system/include/SDL/COPYING +19 -0
- data/modules/emscripten/system/include/SDL/SDL.h +162 -0
- data/modules/emscripten/system/include/SDL/SDL_assert.h +241 -0
- data/modules/emscripten/system/include/SDL/SDL_atomic.h +318 -0
- data/modules/emscripten/system/include/SDL/SDL_audio.h +509 -0
- data/modules/emscripten/system/include/SDL/SDL_blendmode.h +60 -0
- data/modules/emscripten/system/include/SDL/SDL_clipboard.h +75 -0
- data/modules/emscripten/system/include/SDL/SDL_compat.h +365 -0
- data/modules/emscripten/system/include/SDL/SDL_config.h +48 -0
- data/modules/emscripten/system/include/SDL/SDL_config.h.in +297 -0
- data/modules/emscripten/system/include/SDL/SDL_config_android.h +133 -0
- data/modules/emscripten/system/include/SDL/SDL_config_iphoneos.h +148 -0
- data/modules/emscripten/system/include/SDL/SDL_config_macosx.h +172 -0
- data/modules/emscripten/system/include/SDL/SDL_config_minimal.h +74 -0
- data/modules/emscripten/system/include/SDL/SDL_config_nintendods.h +129 -0
- data/modules/emscripten/system/include/SDL/SDL_config_pandora.h +125 -0
- data/modules/emscripten/system/include/SDL/SDL_config_windows.h +207 -0
- data/modules/emscripten/system/include/SDL/SDL_config_wiz.h +119 -0
- data/modules/emscripten/system/include/SDL/SDL_copying.h +20 -0
- data/modules/emscripten/system/include/SDL/SDL_cpuinfo.h +150 -0
- data/modules/emscripten/system/include/SDL/SDL_endian.h +248 -0
- data/modules/emscripten/system/include/SDL/SDL_error.h +77 -0
- data/modules/emscripten/system/include/SDL/SDL_events.h +639 -0
- data/modules/emscripten/system/include/SDL/SDL_gesture.h +91 -0
- data/modules/emscripten/system/include/SDL/SDL_gfxPrimitives.h +246 -0
- data/modules/emscripten/system/include/SDL/SDL_haptic.h +1200 -0
- data/modules/emscripten/system/include/SDL/SDL_hints.h +206 -0
- data/modules/emscripten/system/include/SDL/SDL_image.h +138 -0
- data/modules/emscripten/system/include/SDL/SDL_input.h +87 -0
- data/modules/emscripten/system/include/SDL/SDL_joystick.h +208 -0
- data/modules/emscripten/system/include/SDL/SDL_keyboard.h +169 -0
- data/modules/emscripten/system/include/SDL/SDL_keycode.h +344 -0
- data/modules/emscripten/system/include/SDL/SDL_loadso.h +85 -0
- data/modules/emscripten/system/include/SDL/SDL_log.h +211 -0
- data/modules/emscripten/system/include/SDL/SDL_main.h +98 -0
- data/modules/emscripten/system/include/SDL/SDL_mixer.h +634 -0
- data/modules/emscripten/system/include/SDL/SDL_mouse.h +213 -0
- data/modules/emscripten/system/include/SDL/SDL_mutex.h +248 -0
- data/modules/emscripten/system/include/SDL/SDL_name.h +11 -0
- data/modules/emscripten/system/include/SDL/SDL_opengl.h +11116 -0
- data/modules/emscripten/system/include/SDL/SDL_opengles.h +38 -0
- data/modules/emscripten/system/include/SDL/SDL_opengles2.h +38 -0
- data/modules/emscripten/system/include/SDL/SDL_pixels.h +423 -0
- data/modules/emscripten/system/include/SDL/SDL_platform.h +160 -0
- data/modules/emscripten/system/include/SDL/SDL_power.h +79 -0
- data/modules/emscripten/system/include/SDL/SDL_quit.h +58 -0
- data/modules/emscripten/system/include/SDL/SDL_rect.h +136 -0
- data/modules/emscripten/system/include/SDL/SDL_render.h +615 -0
- data/modules/emscripten/system/include/SDL/SDL_revision.h +2 -0
- data/modules/emscripten/system/include/SDL/SDL_revision.h.orig +2 -0
- data/modules/emscripten/system/include/SDL/SDL_rotozoom.h +123 -0
- data/modules/emscripten/system/include/SDL/SDL_rwops.h +220 -0
- data/modules/emscripten/system/include/SDL/SDL_scancode.h +398 -0
- data/modules/emscripten/system/include/SDL/SDL_shape.h +147 -0
- data/modules/emscripten/system/include/SDL/SDL_stdinc.h +764 -0
- data/modules/emscripten/system/include/SDL/SDL_surface.h +499 -0
- data/modules/emscripten/system/include/SDL/SDL_syswm.h +241 -0
- data/modules/emscripten/system/include/SDL/SDL_thread.h +182 -0
- data/modules/emscripten/system/include/SDL/SDL_timer.h +108 -0
- data/modules/emscripten/system/include/SDL/SDL_touch.h +124 -0
- data/modules/emscripten/system/include/SDL/SDL_ttf.h +249 -0
- data/modules/emscripten/system/include/SDL/SDL_types.h +29 -0
- data/modules/emscripten/system/include/SDL/SDL_version.h +166 -0
- data/modules/emscripten/system/include/SDL/SDL_video.h +820 -0
- data/modules/emscripten/system/include/SDL/begin_code.h +135 -0
- data/modules/emscripten/system/include/SDL/close_code.h +37 -0
- data/modules/emscripten/system/include/X11/X.h +717 -0
- data/modules/emscripten/system/include/X11/Xatom.h +79 -0
- data/modules/emscripten/system/include/X11/Xfuncproto.h +127 -0
- data/modules/emscripten/system/include/X11/Xlib.h +4023 -0
- data/modules/emscripten/system/include/X11/Xosdefs.h +116 -0
- data/modules/emscripten/system/include/X11/Xutil.h +826 -0
- data/modules/emscripten/system/include/X11/keysym.h +73 -0
- data/modules/emscripten/system/include/X11/keysymdef.h +2389 -0
- data/modules/emscripten/system/include/bsd/float.h +91 -0
- data/modules/emscripten/system/include/bsd/readme.txt +2 -0
- data/modules/emscripten/system/include/bsd/sys/mman.h +180 -0
- data/modules/emscripten/system/include/bsd/sys/utsname.h +70 -0
- data/modules/emscripten/system/include/dlfcn.h +31 -0
- data/modules/emscripten/system/include/emscripten/bind.h +1210 -0
- data/modules/emscripten/system/include/emscripten/emscripten.h +388 -0
- data/modules/emscripten/system/include/emscripten/val.h +311 -0
- data/modules/emscripten/system/include/emscripten/wire.h +393 -0
- data/modules/emscripten/system/include/err.h +95 -0
- data/modules/emscripten/system/include/execinfo.h +44 -0
- data/modules/emscripten/system/include/features.h +3 -0
- data/modules/emscripten/system/include/gc.h +70 -0
- data/modules/emscripten/system/include/gfx/png.h +3798 -0
- data/modules/emscripten/system/include/gfx/pngconf.h +1665 -0
- data/modules/emscripten/system/include/gfx/tiff.h +654 -0
- data/modules/emscripten/system/include/gfx/tiffconf.h +104 -0
- data/modules/emscripten/system/include/gfx/tiffio.h +526 -0
- data/modules/emscripten/system/include/gfx/tiffvers.h +9 -0
- data/modules/emscripten/system/include/jansson.h +323 -0
- data/modules/emscripten/system/include/jansson_config.h +54 -0
- data/modules/emscripten/system/include/libc/_ansi.h +135 -0
- data/modules/emscripten/system/include/libc/_syslist.h +40 -0
- data/modules/emscripten/system/include/libc/alloca.h +21 -0
- data/modules/emscripten/system/include/libc/ar.h +69 -0
- data/modules/emscripten/system/include/libc/argz.h +33 -0
- data/modules/emscripten/system/include/libc/assert.h +46 -0
- data/modules/emscripten/system/include/libc/complex.h +124 -0
- data/modules/emscripten/system/include/libc/ctype.h +196 -0
- data/modules/emscripten/system/include/libc/dirent.h +16 -0
- data/modules/emscripten/system/include/libc/endian.h +3 -0
- data/modules/emscripten/system/include/libc/envlock.h +15 -0
- data/modules/emscripten/system/include/libc/envz.h +16 -0
- data/modules/emscripten/system/include/libc/errno.h +11 -0
- data/modules/emscripten/system/include/libc/fastmath.h +13 -0
- data/modules/emscripten/system/include/libc/fcntl.h +1 -0
- data/modules/emscripten/system/include/libc/fnmatch.h +55 -0
- data/modules/emscripten/system/include/libc/getopt.h +196 -0
- data/modules/emscripten/system/include/libc/glob.h +89 -0
- data/modules/emscripten/system/include/libc/grp.h +94 -0
- data/modules/emscripten/system/include/libc/iconv.h +62 -0
- data/modules/emscripten/system/include/libc/ieeefp.h +256 -0
- data/modules/emscripten/system/include/libc/ifaddrs.h +64 -0
- data/modules/emscripten/system/include/libc/inttypes.h +290 -0
- data/modules/emscripten/system/include/libc/iso646.h +43 -0
- data/modules/emscripten/system/include/libc/langinfo.h +316 -0
- data/modules/emscripten/system/include/libc/libgen.h +23 -0
- data/modules/emscripten/system/include/libc/limits.h +155 -0
- data/modules/emscripten/system/include/libc/locale.h +80 -0
- data/modules/emscripten/system/include/libc/machine/_default_types.h +121 -0
- data/modules/emscripten/system/include/libc/machine/_types.h +8 -0
- data/modules/emscripten/system/include/libc/machine/ansi.h +1 -0
- data/modules/emscripten/system/include/libc/machine/endian.h +31 -0
- data/modules/emscripten/system/include/libc/machine/fastmath.h +100 -0
- data/modules/emscripten/system/include/libc/machine/ieeefp.h +376 -0
- data/modules/emscripten/system/include/libc/machine/malloc.h +8 -0
- data/modules/emscripten/system/include/libc/machine/param.h +1 -0
- data/modules/emscripten/system/include/libc/machine/setjmp-dj.h +43 -0
- data/modules/emscripten/system/include/libc/machine/setjmp.h +361 -0
- data/modules/emscripten/system/include/libc/machine/stdlib.h +8 -0
- data/modules/emscripten/system/include/libc/machine/termios.h +1 -0
- data/modules/emscripten/system/include/libc/machine/time.h +19 -0
- data/modules/emscripten/system/include/libc/machine/types.h +30 -0
- data/modules/emscripten/system/include/libc/malloc.h +169 -0
- data/modules/emscripten/system/include/libc/math.h +594 -0
- data/modules/emscripten/system/include/libc/newlib.h +2 -0
- data/modules/emscripten/system/include/libc/paths.h +7 -0
- data/modules/emscripten/system/include/libc/process.h +44 -0
- data/modules/emscripten/system/include/libc/pthread.h +362 -0
- data/modules/emscripten/system/include/libc/pwd.h +78 -0
- data/modules/emscripten/system/include/libc/readme.txt +3 -0
- data/modules/emscripten/system/include/libc/reent.h +183 -0
- data/modules/emscripten/system/include/libc/regdef.h +7 -0
- data/modules/emscripten/system/include/libc/regex.h +102 -0
- data/modules/emscripten/system/include/libc/sched.h +97 -0
- data/modules/emscripten/system/include/libc/search.h +59 -0
- data/modules/emscripten/system/include/libc/setjmp.h +20 -0
- data/modules/emscripten/system/include/libc/signal.h +30 -0
- data/modules/emscripten/system/include/libc/stdarg.h +50 -0
- data/modules/emscripten/system/include/libc/stddef.h +64 -0
- data/modules/emscripten/system/include/libc/stdint.h +493 -0
- data/modules/emscripten/system/include/libc/stdio.h +694 -0
- data/modules/emscripten/system/include/libc/stdlib.h +230 -0
- data/modules/emscripten/system/include/libc/string.h +105 -0
- data/modules/emscripten/system/include/libc/strings.h +35 -0
- data/modules/emscripten/system/include/libc/sys/_default_fcntl.h +223 -0
- data/modules/emscripten/system/include/libc/sys/_types.h +93 -0
- data/modules/emscripten/system/include/libc/sys/cdefs.h +123 -0
- data/modules/emscripten/system/include/libc/sys/config.h +255 -0
- data/modules/emscripten/system/include/libc/sys/custom_file.h +2 -0
- data/modules/emscripten/system/include/libc/sys/dir.h +10 -0
- data/modules/emscripten/system/include/libc/sys/dirent.h +58 -0
- data/modules/emscripten/system/include/libc/sys/errno.h +190 -0
- data/modules/emscripten/system/include/libc/sys/fcntl.h +4 -0
- data/modules/emscripten/system/include/libc/sys/features.h +212 -0
- data/modules/emscripten/system/include/libc/sys/file.h +2 -0
- data/modules/emscripten/system/include/libc/sys/iconvnls.h +77 -0
- data/modules/emscripten/system/include/libc/sys/lock.h +24 -0
- data/modules/emscripten/system/include/libc/sys/param.h +25 -0
- data/modules/emscripten/system/include/libc/sys/queue.h +471 -0
- data/modules/emscripten/system/include/libc/sys/reent.h +843 -0
- data/modules/emscripten/system/include/libc/sys/resource.h +59 -0
- data/modules/emscripten/system/include/libc/sys/sched.h +67 -0
- data/modules/emscripten/system/include/libc/sys/signal.h +314 -0
- data/modules/emscripten/system/include/libc/sys/stat.h +222 -0
- data/modules/emscripten/system/include/libc/sys/stdio.h +27 -0
- data/modules/emscripten/system/include/libc/sys/string.h +2 -0
- data/modules/emscripten/system/include/libc/sys/syslimits.h +65 -0
- data/modules/emscripten/system/include/libc/sys/termios.h +280 -0
- data/modules/emscripten/system/include/libc/sys/time.h +85 -0
- data/modules/emscripten/system/include/libc/sys/timeb.h +39 -0
- data/modules/emscripten/system/include/libc/sys/times.h +28 -0
- data/modules/emscripten/system/include/libc/sys/ttydefaults.h +97 -0
- data/modules/emscripten/system/include/libc/sys/types.h +481 -0
- data/modules/emscripten/system/include/libc/sys/unistd.h +514 -0
- data/modules/emscripten/system/include/libc/sys/utime.h +26 -0
- data/modules/emscripten/system/include/libc/sys/wait.h +40 -0
- data/modules/emscripten/system/include/libc/tar.h +39 -0
- data/modules/emscripten/system/include/libc/termios.h +7 -0
- data/modules/emscripten/system/include/libc/time.h +273 -0
- data/modules/emscripten/system/include/libc/unctrl.h +46 -0
- data/modules/emscripten/system/include/libc/unistd.h +6 -0
- data/modules/emscripten/system/include/libc/utime.h +12 -0
- data/modules/emscripten/system/include/libc/utmp.h +8 -0
- data/modules/emscripten/system/include/libc/wchar.h +194 -0
- data/modules/emscripten/system/include/libc/wctype.h +47 -0
- data/modules/emscripten/system/include/libc/wordexp.h +53 -0
- data/modules/emscripten/system/include/libcxx/CREDITS.TXT +91 -0
- data/modules/emscripten/system/include/libcxx/LICENSE.txt +76 -0
- data/modules/emscripten/system/include/libcxx/__bit_reference +1268 -0
- data/modules/emscripten/system/include/libcxx/__config +485 -0
- data/modules/emscripten/system/include/libcxx/__debug +193 -0
- data/modules/emscripten/system/include/libcxx/__functional_03 +2130 -0
- data/modules/emscripten/system/include/libcxx/__functional_base +437 -0
- data/modules/emscripten/system/include/libcxx/__functional_base_03 +1087 -0
- data/modules/emscripten/system/include/libcxx/__hash_table +1945 -0
- data/modules/emscripten/system/include/libcxx/__locale +1435 -0
- data/modules/emscripten/system/include/libcxx/__mutex_base +438 -0
- data/modules/emscripten/system/include/libcxx/__split_buffer +654 -0
- data/modules/emscripten/system/include/libcxx/__sso_allocator +77 -0
- data/modules/emscripten/system/include/libcxx/__std_stream +317 -0
- data/modules/emscripten/system/include/libcxx/__tree +2293 -0
- data/modules/emscripten/system/include/libcxx/__tuple +305 -0
- data/modules/emscripten/system/include/libcxx/__tuple_03 +27 -0
- data/modules/emscripten/system/include/libcxx/__undef_min_max +19 -0
- data/modules/emscripten/system/include/libcxx/algorithm +5458 -0
- data/modules/emscripten/system/include/libcxx/array +341 -0
- data/modules/emscripten/system/include/libcxx/atomic +1521 -0
- data/modules/emscripten/system/include/libcxx/bitset +1081 -0
- data/modules/emscripten/system/include/libcxx/cassert +25 -0
- data/modules/emscripten/system/include/libcxx/ccomplex +29 -0
- data/modules/emscripten/system/include/libcxx/cctype +164 -0
- data/modules/emscripten/system/include/libcxx/cerrno +393 -0
- data/modules/emscripten/system/include/libcxx/cfenv +82 -0
- data/modules/emscripten/system/include/libcxx/cfloat +78 -0
- data/modules/emscripten/system/include/libcxx/chrono +898 -0
- data/modules/emscripten/system/include/libcxx/cinttypes +259 -0
- data/modules/emscripten/system/include/libcxx/ciso646 +25 -0
- data/modules/emscripten/system/include/libcxx/climits +48 -0
- data/modules/emscripten/system/include/libcxx/clocale +53 -0
- data/modules/emscripten/system/include/libcxx/cmath +1683 -0
- data/modules/emscripten/system/include/libcxx/codecvt +547 -0
- data/modules/emscripten/system/include/libcxx/complex +1526 -0
- data/modules/emscripten/system/include/libcxx/complex.h +35 -0
- data/modules/emscripten/system/include/libcxx/condition_variable +256 -0
- data/modules/emscripten/system/include/libcxx/csetjmp +52 -0
- data/modules/emscripten/system/include/libcxx/csignal +58 -0
- data/modules/emscripten/system/include/libcxx/cstdarg +48 -0
- data/modules/emscripten/system/include/libcxx/cstdbool +32 -0
- data/modules/emscripten/system/include/libcxx/cstddef +103 -0
- data/modules/emscripten/system/include/libcxx/cstdint +191 -0
- data/modules/emscripten/system/include/libcxx/cstdio +175 -0
- data/modules/emscripten/system/include/libcxx/cstdlib +172 -0
- data/modules/emscripten/system/include/libcxx/cstring +112 -0
- data/modules/emscripten/system/include/libcxx/ctgmath +29 -0
- data/modules/emscripten/system/include/libcxx/ctime +72 -0
- data/modules/emscripten/system/include/libcxx/cwchar +208 -0
- data/modules/emscripten/system/include/libcxx/cwctype +213 -0
- data/modules/emscripten/system/include/libcxx/deque +2846 -0
- data/modules/emscripten/system/include/libcxx/exception +250 -0
- data/modules/emscripten/system/include/libcxx/ext/__hash +46 -0
- data/modules/emscripten/system/include/libcxx/ext/hash_map +1003 -0
- data/modules/emscripten/system/include/libcxx/ext/hash_set +657 -0
- data/modules/emscripten/system/include/libcxx/forward_list +1636 -0
- data/modules/emscripten/system/include/libcxx/fstream +1415 -0
- data/modules/emscripten/system/include/libcxx/functional +2063 -0
- data/modules/emscripten/system/include/libcxx/future +2505 -0
- data/modules/emscripten/system/include/libcxx/initializer_list +105 -0
- data/modules/emscripten/system/include/libcxx/iomanip +504 -0
- data/modules/emscripten/system/include/libcxx/ios +988 -0
- data/modules/emscripten/system/include/libcxx/iosfwd +194 -0
- data/modules/emscripten/system/include/libcxx/iostream +60 -0
- data/modules/emscripten/system/include/libcxx/istream +1713 -0
- data/modules/emscripten/system/include/libcxx/iterator +1869 -0
- data/modules/emscripten/system/include/libcxx/limits +809 -0
- data/modules/emscripten/system/include/libcxx/list +2275 -0
- data/modules/emscripten/system/include/libcxx/locale +4591 -0
- data/modules/emscripten/system/include/libcxx/map +1924 -0
- data/modules/emscripten/system/include/libcxx/memory +5437 -0
- data/modules/emscripten/system/include/libcxx/mutex +566 -0
- data/modules/emscripten/system/include/libcxx/new +117 -0
- data/modules/emscripten/system/include/libcxx/numeric +197 -0
- data/modules/emscripten/system/include/libcxx/ostream +1286 -0
- data/modules/emscripten/system/include/libcxx/queue +717 -0
- data/modules/emscripten/system/include/libcxx/random +6750 -0
- data/modules/emscripten/system/include/libcxx/ratio +487 -0
- data/modules/emscripten/system/include/libcxx/readme.txt +1 -0
- data/modules/emscripten/system/include/libcxx/regex +6439 -0
- data/modules/emscripten/system/include/libcxx/scoped_allocator +578 -0
- data/modules/emscripten/system/include/libcxx/set +1025 -0
- data/modules/emscripten/system/include/libcxx/sstream +888 -0
- data/modules/emscripten/system/include/libcxx/stack +292 -0
- data/modules/emscripten/system/include/libcxx/stdexcept +162 -0
- data/modules/emscripten/system/include/libcxx/streambuf +564 -0
- data/modules/emscripten/system/include/libcxx/string +3987 -0
- data/modules/emscripten/system/include/libcxx/strstream +400 -0
- data/modules/emscripten/system/include/libcxx/support/solaris/floatingpoint.h +5 -0
- data/modules/emscripten/system/include/libcxx/support/solaris/wchar.h +38 -0
- data/modules/emscripten/system/include/libcxx/support/solaris/xlocale.h +146 -0
- data/modules/emscripten/system/include/libcxx/support/win32/limits_win32.h +79 -0
- data/modules/emscripten/system/include/libcxx/support/win32/locale_win32.h +116 -0
- data/modules/emscripten/system/include/libcxx/support/win32/math_win32.h +113 -0
- data/modules/emscripten/system/include/libcxx/support/win32/support.h +115 -0
- data/modules/emscripten/system/include/libcxx/system_error +636 -0
- data/modules/emscripten/system/include/libcxx/tgmath.h +29 -0
- data/modules/emscripten/system/include/libcxx/thread +459 -0
- data/modules/emscripten/system/include/libcxx/tuple +1092 -0
- data/modules/emscripten/system/include/libcxx/type_traits +3040 -0
- data/modules/emscripten/system/include/libcxx/typeindex +103 -0
- data/modules/emscripten/system/include/libcxx/typeinfo +124 -0
- data/modules/emscripten/system/include/libcxx/unordered_map +1864 -0
- data/modules/emscripten/system/include/libcxx/unordered_set +1144 -0
- data/modules/emscripten/system/include/libcxx/utility +583 -0
- data/modules/emscripten/system/include/libcxx/valarray +4779 -0
- data/modules/emscripten/system/include/libcxx/vector +3228 -0
- data/modules/emscripten/system/include/memory.h +10 -0
- data/modules/emscripten/system/include/mntent.h +23 -0
- data/modules/emscripten/system/include/net/arpa/inet.h +32 -0
- data/modules/emscripten/system/include/net/arpa/nameser.h +535 -0
- data/modules/emscripten/system/include/net/arpa/nameser_compat.h +187 -0
- data/modules/emscripten/system/include/net/if.h +87 -0
- data/modules/emscripten/system/include/net/netinet/in.h +166 -0
- data/modules/emscripten/system/include/net/netinet/tcp.h +246 -0
- data/modules/emscripten/system/include/net/resolv.h +389 -0
- data/modules/emscripten/system/include/netdb.h +94 -0
- data/modules/emscripten/system/include/nl_types.h +19 -0
- data/modules/emscripten/system/include/poll.h +3 -0
- data/modules/emscripten/system/include/pty.h +6 -0
- data/modules/emscripten/system/include/semaphore.h +31 -0
- data/modules/emscripten/system/include/spawn.h +105 -0
- data/modules/emscripten/system/include/stdbool.h +16 -0
- data/modules/emscripten/system/include/sys/bitypes.h +3 -0
- data/modules/emscripten/system/include/sys/io.h +14 -0
- data/modules/emscripten/system/include/sys/ioctl.h +26 -0
- data/modules/emscripten/system/include/sys/poll.h +31 -0
- data/modules/emscripten/system/include/sys/select.h +14 -0
- data/modules/emscripten/system/include/sys/socket.h +101 -0
- data/modules/emscripten/system/include/sys/socketvar.h +3 -0
- data/modules/emscripten/system/include/sys/statvfs.h +32 -0
- data/modules/emscripten/system/include/sys/sysctl.h +14 -0
- data/modules/emscripten/system/include/sys/uio.h +22 -0
- data/modules/emscripten/system/include/sys/un.h +66 -0
- data/modules/emscripten/system/include/sysexits.h +108 -0
- data/modules/emscripten/system/include/unwind.h +154 -0
- data/modules/emscripten/system/include/xlocale.h +47 -0
- data/modules/emscripten/system/include/zconf.h +428 -0
- data/modules/emscripten/system/include/zlib.h +1613 -0
- data/modules/emscripten/system/lib/compiler-rt/LICENSE.TXT +97 -0
- data/modules/emscripten/system/lib/compiler-rt/divdi3.c +47 -0
- data/modules/emscripten/system/lib/compiler-rt/int_endianness.h +116 -0
- data/modules/emscripten/system/lib/compiler-rt/int_lib.h +46 -0
- data/modules/emscripten/system/lib/compiler-rt/int_math.h +67 -0
- data/modules/emscripten/system/lib/compiler-rt/int_types.h +140 -0
- data/modules/emscripten/system/lib/compiler-rt/int_util.h +29 -0
- data/modules/emscripten/system/lib/compiler-rt/muldi3.c +56 -0
- data/modules/emscripten/system/lib/compiler-rt/readme.txt +20 -0
- data/modules/emscripten/system/lib/compiler-rt/udivdi3.c +36 -0
- data/modules/emscripten/system/lib/compiler-rt/udivmoddi4.c +251 -0
- data/modules/emscripten/system/lib/debugging.cpp +24 -0
- data/modules/emscripten/system/lib/dlmalloc.c +6299 -0
- data/modules/emscripten/system/lib/embind/bind.cpp +63 -0
- data/modules/emscripten/system/lib/libc/gen/err.c +49 -0
- data/modules/emscripten/system/lib/libc/gen/errx.c +49 -0
- data/modules/emscripten/system/lib/libc/gen/verr.c +58 -0
- data/modules/emscripten/system/lib/libc/gen/verrx.c +51 -0
- data/modules/emscripten/system/lib/libc/gen/vwarn.c +55 -0
- data/modules/emscripten/system/lib/libc/gen/vwarnx.c +48 -0
- data/modules/emscripten/system/lib/libc/gen/warn.c +49 -0
- data/modules/emscripten/system/lib/libc/gen/warnx.c +49 -0
- data/modules/emscripten/system/lib/libc/musl/COPYRIGHT +92 -0
- data/modules/emscripten/system/lib/libc/musl/readme.txt +1 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/alpha.h +125 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswalnum.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswalpha.c +14 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswblank.c +8 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswcntrl.c +10 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswctype.c +63 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswdigit.c +9 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswgraph.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswlower.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswprint.c +19 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswpunct.c +12 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswspace.c +19 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswupper.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswxdigit.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/nonspacing.h +62 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/punct.h +109 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/towctrans.c +268 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/wcswidth.c +8 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/wctrans.c +16 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/wcwidth.c +29 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/wide.h +42 -0
- data/modules/emscripten/system/lib/libc/musl/src/internal/libc.c +22 -0
- data/modules/emscripten/system/lib/libc/musl/src/internal/libc.h +71 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/btowc.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/internal.c +38 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/internal.h +22 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mblen.c +17 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbrlen.c +18 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbrtowc.c +57 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbsinit.c +17 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbsnrtowcs.c +65 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbsrtowcs.c +100 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbstowcs.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbtowc.c +53 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/wcrtomb.c +38 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/wcsnrtombs.c +52 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/wcsrtombs.c +58 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/wcstombs.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/wctob.c +8 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/wctomb.c +18 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcpcpy.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcpncpy.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcscasecmp.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcscasecmp_l.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcscat.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcschr.c +8 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcscmp.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcscpy.c +8 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcscspn.c +10 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsdup.c +11 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcslen.c +8 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsncasecmp.c +9 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsncasecmp_l.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsncat.c +10 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsncmp.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsncpy.c +9 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsnlen.c +8 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcspbrk.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsrchr.c +8 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsspn.c +8 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsstr.c +108 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcstok.c +12 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcswcs.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wmemchr.c +8 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wmemcmp.c +8 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wmemcpy.c +9 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wmemmove.c +12 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wmemset.c +9 -0
- data/modules/emscripten/system/lib/libc/stdlib/getopt_long.c +511 -0
- data/modules/emscripten/system/lib/libc/stdlib/strtod.c +305 -0
- data/modules/emscripten/system/lib/libc.symbols +81 -0
- data/modules/emscripten/system/lib/libcextra.symbols +61 -0
- data/modules/emscripten/system/lib/libcxx/CREDITS.TXT +91 -0
- data/modules/emscripten/system/lib/libcxx/LICENSE.txt +76 -0
- data/modules/emscripten/system/lib/libcxx/algorithm.cpp +83 -0
- data/modules/emscripten/system/lib/libcxx/bind.cpp +30 -0
- data/modules/emscripten/system/lib/libcxx/chrono.cpp +132 -0
- data/modules/emscripten/system/lib/libcxx/condition_variable.cpp +81 -0
- data/modules/emscripten/system/lib/libcxx/debug.cpp +504 -0
- data/modules/emscripten/system/lib/libcxx/exception.cpp +226 -0
- data/modules/emscripten/system/lib/libcxx/future.cpp +285 -0
- data/modules/emscripten/system/lib/libcxx/hash.cpp +564 -0
- data/modules/emscripten/system/lib/libcxx/ios.cpp +455 -0
- data/modules/emscripten/system/lib/libcxx/iostream.cpp +68 -0
- data/modules/emscripten/system/lib/libcxx/locale.cpp +6093 -0
- data/modules/emscripten/system/lib/libcxx/memory.cpp +223 -0
- data/modules/emscripten/system/lib/libcxx/mutex.cpp +250 -0
- data/modules/emscripten/system/lib/libcxx/new.cpp +205 -0
- data/modules/emscripten/system/lib/libcxx/random.cpp +48 -0
- data/modules/emscripten/system/lib/libcxx/readme.txt +1 -0
- data/modules/emscripten/system/lib/libcxx/regex.cpp +325 -0
- data/modules/emscripten/system/lib/libcxx/stdexcept.cpp +196 -0
- data/modules/emscripten/system/lib/libcxx/string.cpp +687 -0
- data/modules/emscripten/system/lib/libcxx/strstream.cpp +329 -0
- data/modules/emscripten/system/lib/libcxx/support/solaris/README +4 -0
- data/modules/emscripten/system/lib/libcxx/support/solaris/mbsnrtowcs.inc +76 -0
- data/modules/emscripten/system/lib/libcxx/support/solaris/wcsnrtombs.inc +93 -0
- data/modules/emscripten/system/lib/libcxx/support/solaris/xlocale.c +245 -0
- data/modules/emscripten/system/lib/libcxx/support/win32/locale_win32.cpp +94 -0
- data/modules/emscripten/system/lib/libcxx/support/win32/support.cpp +70 -0
- data/modules/emscripten/system/lib/libcxx/symbols +2927 -0
- data/modules/emscripten/system/lib/libcxx/system_error.cpp +201 -0
- data/modules/emscripten/system/lib/libcxx/thread.cpp +208 -0
- data/modules/emscripten/system/lib/libcxx/typeinfo.cpp +60 -0
- data/modules/emscripten/system/lib/libcxx/utility.cpp +17 -0
- data/modules/emscripten/system/lib/libcxx/valarray.cpp +54 -0
- data/modules/emscripten/system/lib/libcxxabi/CREDITS.TXT +38 -0
- data/modules/emscripten/system/lib/libcxxabi/LICENSE.TXT +76 -0
- data/modules/emscripten/system/lib/libcxxabi/include/cxa_demangle.h +167 -0
- data/modules/emscripten/system/lib/libcxxabi/include/cxxabi.h +175 -0
- data/modules/emscripten/system/lib/libcxxabi/lib/buildit +99 -0
- data/modules/emscripten/system/lib/libcxxabi/readme.txt +1 -0
- data/modules/emscripten/system/lib/libcxxabi/src/abort_message.cpp +50 -0
- data/modules/emscripten/system/lib/libcxxabi/src/abort_message.h +33 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_aux_runtime.cpp +34 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_demangle.cpp +11036 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_exception.cpp +622 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_exception.hpp +123 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_exception_storage.cpp +91 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_guard.cpp +231 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_handlers.cpp +125 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_handlers.hpp +54 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_new_delete.cpp +242 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_personality.cpp +1055 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_unexpected.cpp +27 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_vector.cpp +367 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_virtual.cpp +31 -0
- data/modules/emscripten/system/lib/libcxxabi/src/exception.cpp +41 -0
- data/modules/emscripten/system/lib/libcxxabi/src/fallback_malloc.ipp +174 -0
- data/modules/emscripten/system/lib/libcxxabi/src/private_typeinfo.cpp +1146 -0
- data/modules/emscripten/system/lib/libcxxabi/src/private_typeinfo.h +248 -0
- data/modules/emscripten/system/lib/libcxxabi/src/stdexcept.cpp +169 -0
- data/modules/emscripten/system/lib/libcxxabi/src/typeinfo.cpp +53 -0
- data/modules/emscripten/system/lib/libcxxabi/symbols +236 -0
- data/modules/emscripten/system/lib/sdl.cpp +13 -0
- data/modules/emscripten/system/lib/sdl.symbols +1 -0
- data/modules/emscripten/tests/hello_world.js +92 -0
- data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/CppHeaderParser.py +2347 -0
- data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/__init__.py +4 -0
- data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/doc/CppHeaderParser.html +657 -0
- data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/examples/SampleClass.h +147 -0
- data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/examples/readSampleClass.py +74 -0
- data/modules/emscripten/third_party/CppHeaderParser/PKG-INFO +249 -0
- data/modules/emscripten/third_party/CppHeaderParser/README.html +544 -0
- data/modules/emscripten/third_party/CppHeaderParser/README.txt +226 -0
- data/modules/emscripten/third_party/CppHeaderParser/setup.py +43 -0
- data/modules/emscripten/third_party/ansidecl.h +371 -0
- data/modules/emscripten/third_party/closure-compiler/COPYING +202 -0
- data/modules/emscripten/third_party/closure-compiler/README +292 -0
- data/modules/emscripten/third_party/closure-compiler/compiler.jar +0 -0
- data/modules/emscripten/third_party/closure-compiler/readme.txt +3 -0
- data/modules/emscripten/third_party/cp-demangle.h +161 -0
- data/modules/emscripten/third_party/demangle.h +549 -0
- data/modules/emscripten/third_party/demangler.py +49 -0
- data/modules/emscripten/third_party/gcc_demangler.c +4226 -0
- data/modules/emscripten/third_party/gcc_demangler.js +21282 -0
- data/modules/emscripten/third_party/jni/emjvm.cpp +133 -0
- data/modules/emscripten/third_party/jni/emjvm.h +8 -0
- data/modules/emscripten/third_party/jni/emjvm.js +185 -0
- data/modules/emscripten/third_party/jni/jni.h +1154 -0
- data/modules/emscripten/third_party/libiberty.h +634 -0
- data/modules/emscripten/third_party/lzma.js/README.markdown +37 -0
- data/modules/emscripten/third_party/lzma.js/doit.sh +37 -0
- data/modules/emscripten/third_party/lzma.js/lzip/AUTHORS +7 -0
- data/modules/emscripten/third_party/lzma.js/lzip/COPYING +676 -0
- data/modules/emscripten/third_party/lzma.js/lzip/ChangeLog +201 -0
- data/modules/emscripten/third_party/lzma.js/lzip/INSTALL +56 -0
- data/modules/emscripten/third_party/lzma.js/lzip/Makefile +160 -0
- data/modules/emscripten/third_party/lzma.js/lzip/Makefile.in +138 -0
- data/modules/emscripten/third_party/lzma.js/lzip/NEWS +22 -0
- data/modules/emscripten/third_party/lzma.js/lzip/README +77 -0
- data/modules/emscripten/third_party/lzma.js/lzip/arg_parser.cc +204 -0
- data/modules/emscripten/third_party/lzma.js/lzip/arg_parser.h +106 -0
- data/modules/emscripten/third_party/lzma.js/lzip/configure +192 -0
- data/modules/emscripten/third_party/lzma.js/lzip/decoder.cc +252 -0
- data/modules/emscripten/third_party/lzma.js/lzip/decoder.h +268 -0
- data/modules/emscripten/third_party/lzma.js/lzip/encoder.cc +643 -0
- data/modules/emscripten/third_party/lzma.js/lzip/encoder.h +582 -0
- data/modules/emscripten/third_party/lzma.js/lzip/fast_encoder.cc +378 -0
- data/modules/emscripten/third_party/lzma.js/lzip/fast_encoder.h +171 -0
- data/modules/emscripten/third_party/lzma.js/lzip/lzip.h +264 -0
- data/modules/emscripten/third_party/lzma.js/lzip/main.cc +545 -0
- data/modules/emscripten/third_party/lzma.js/lzma-decoder.js +27 -0
- data/modules/emscripten/third_party/lzma.js/lzma-full.js +27 -0
- data/modules/emscripten/third_party/lzma.js/native_test.sh +5 -0
- data/modules/emscripten/third_party/lzma.js/post.js +13 -0
- data/modules/emscripten/third_party/lzma.js/pre.js +13 -0
- data/modules/emscripten/third_party/lzma.js/test-decoder.js +39 -0
- data/modules/emscripten/third_party/lzma.js/test-full.html +9 -0
- data/modules/emscripten/third_party/lzma.js/test-full.js +78 -0
- data/modules/emscripten/third_party/ply/ANNOUNCE +40 -0
- data/modules/emscripten/third_party/ply/CHANGES +1093 -0
- data/modules/emscripten/third_party/ply/PKG-INFO +22 -0
- data/modules/emscripten/third_party/ply/README +271 -0
- data/modules/emscripten/third_party/ply/TODO +16 -0
- data/modules/emscripten/third_party/ply/doc/internal.html +874 -0
- data/modules/emscripten/third_party/ply/doc/makedoc.py +194 -0
- data/modules/emscripten/third_party/ply/doc/ply.html +3262 -0
- data/modules/emscripten/third_party/ply/example/BASIC/README +79 -0
- data/modules/emscripten/third_party/ply/example/BASIC/basic.py +71 -0
- data/modules/emscripten/third_party/ply/example/BASIC/basiclex.py +74 -0
- data/modules/emscripten/third_party/ply/example/BASIC/basiclog.py +79 -0
- data/modules/emscripten/third_party/ply/example/BASIC/basinterp.py +441 -0
- data/modules/emscripten/third_party/ply/example/BASIC/basparse.py +424 -0
- data/modules/emscripten/third_party/ply/example/BASIC/dim.bas +14 -0
- data/modules/emscripten/third_party/ply/example/BASIC/func.bas +5 -0
- data/modules/emscripten/third_party/ply/example/BASIC/gcd.bas +22 -0
- data/modules/emscripten/third_party/ply/example/BASIC/gosub.bas +13 -0
- data/modules/emscripten/third_party/ply/example/BASIC/hello.bas +4 -0
- data/modules/emscripten/third_party/ply/example/BASIC/linear.bas +17 -0
- data/modules/emscripten/third_party/ply/example/BASIC/maxsin.bas +12 -0
- data/modules/emscripten/third_party/ply/example/BASIC/powers.bas +13 -0
- data/modules/emscripten/third_party/ply/example/BASIC/rand.bas +4 -0
- data/modules/emscripten/third_party/ply/example/BASIC/sales.bas +20 -0
- data/modules/emscripten/third_party/ply/example/BASIC/sears.bas +18 -0
- data/modules/emscripten/third_party/ply/example/BASIC/sqrt1.bas +5 -0
- data/modules/emscripten/third_party/ply/example/BASIC/sqrt2.bas +4 -0
- data/modules/emscripten/third_party/ply/example/GardenSnake/GardenSnake.py +709 -0
- data/modules/emscripten/third_party/ply/example/GardenSnake/README +5 -0
- data/modules/emscripten/third_party/ply/example/README +10 -0
- data/modules/emscripten/third_party/ply/example/ansic/README +2 -0
- data/modules/emscripten/third_party/ply/example/ansic/clex.py +164 -0
- data/modules/emscripten/third_party/ply/example/ansic/cparse.py +863 -0
- data/modules/emscripten/third_party/ply/example/calc/calc.py +107 -0
- data/modules/emscripten/third_party/ply/example/calcdebug/calc.py +113 -0
- data/modules/emscripten/third_party/ply/example/classcalc/calc.py +157 -0
- data/modules/emscripten/third_party/ply/example/cleanup.sh +2 -0
- data/modules/emscripten/third_party/ply/example/closurecalc/calc.py +130 -0
- data/modules/emscripten/third_party/ply/example/hedit/hedit.py +48 -0
- data/modules/emscripten/third_party/ply/example/newclasscalc/calc.py +160 -0
- data/modules/emscripten/third_party/ply/example/optcalc/README +9 -0
- data/modules/emscripten/third_party/ply/example/optcalc/calc.py +119 -0
- data/modules/emscripten/third_party/ply/example/unicalc/calc.py +117 -0
- data/modules/emscripten/third_party/ply/example/yply/README +41 -0
- data/modules/emscripten/third_party/ply/example/yply/ylex.py +112 -0
- data/modules/emscripten/third_party/ply/example/yply/yparse.py +217 -0
- data/modules/emscripten/third_party/ply/example/yply/yply.py +53 -0
- data/modules/emscripten/third_party/ply/ply/__init__.py +4 -0
- data/modules/emscripten/third_party/ply/ply/cpp.py +898 -0
- data/modules/emscripten/third_party/ply/ply/ctokens.py +133 -0
- data/modules/emscripten/third_party/ply/ply/lex.py +1058 -0
- data/modules/emscripten/third_party/ply/ply/yacc.py +3276 -0
- data/modules/emscripten/third_party/ply/setup.py +31 -0
- data/modules/emscripten/third_party/ply/test/README +7 -0
- data/modules/emscripten/third_party/ply/test/calclex.py +49 -0
- data/modules/emscripten/third_party/ply/test/cleanup.sh +4 -0
- data/modules/emscripten/third_party/ply/test/lex_closure.py +54 -0
- data/modules/emscripten/third_party/ply/test/lex_doc1.py +26 -0
- data/modules/emscripten/third_party/ply/test/lex_dup1.py +29 -0
- data/modules/emscripten/third_party/ply/test/lex_dup2.py +33 -0
- data/modules/emscripten/third_party/ply/test/lex_dup3.py +31 -0
- data/modules/emscripten/third_party/ply/test/lex_empty.py +20 -0
- data/modules/emscripten/third_party/ply/test/lex_error1.py +24 -0
- data/modules/emscripten/third_party/ply/test/lex_error2.py +26 -0
- data/modules/emscripten/third_party/ply/test/lex_error3.py +27 -0
- data/modules/emscripten/third_party/ply/test/lex_error4.py +27 -0
- data/modules/emscripten/third_party/ply/test/lex_hedit.py +47 -0
- data/modules/emscripten/third_party/ply/test/lex_ignore.py +31 -0
- data/modules/emscripten/third_party/ply/test/lex_ignore2.py +29 -0
- data/modules/emscripten/third_party/ply/test/lex_literal1.py +25 -0
- data/modules/emscripten/third_party/ply/test/lex_literal2.py +25 -0
- data/modules/emscripten/third_party/ply/test/lex_many_tokens.py +27 -0
- data/modules/emscripten/third_party/ply/test/lex_module.py +10 -0
- data/modules/emscripten/third_party/ply/test/lex_module_import.py +42 -0
- data/modules/emscripten/third_party/ply/test/lex_object.py +55 -0
- data/modules/emscripten/third_party/ply/test/lex_opt_alias.py +54 -0
- data/modules/emscripten/third_party/ply/test/lex_optimize.py +50 -0
- data/modules/emscripten/third_party/ply/test/lex_optimize2.py +50 -0
- data/modules/emscripten/third_party/ply/test/lex_optimize3.py +52 -0
- data/modules/emscripten/third_party/ply/test/lex_re1.py +27 -0
- data/modules/emscripten/third_party/ply/test/lex_re2.py +27 -0
- data/modules/emscripten/third_party/ply/test/lex_re3.py +29 -0
- data/modules/emscripten/third_party/ply/test/lex_rule1.py +27 -0
- data/modules/emscripten/third_party/ply/test/lex_rule2.py +29 -0
- data/modules/emscripten/third_party/ply/test/lex_rule3.py +27 -0
- data/modules/emscripten/third_party/ply/test/lex_state1.py +40 -0
- data/modules/emscripten/third_party/ply/test/lex_state2.py +40 -0
- data/modules/emscripten/third_party/ply/test/lex_state3.py +42 -0
- data/modules/emscripten/third_party/ply/test/lex_state4.py +41 -0
- data/modules/emscripten/third_party/ply/test/lex_state5.py +40 -0
- data/modules/emscripten/third_party/ply/test/lex_state_noerror.py +39 -0
- data/modules/emscripten/third_party/ply/test/lex_state_norule.py +40 -0
- data/modules/emscripten/third_party/ply/test/lex_state_try.py +45 -0
- data/modules/emscripten/third_party/ply/test/lex_token1.py +19 -0
- data/modules/emscripten/third_party/ply/test/lex_token2.py +22 -0
- data/modules/emscripten/third_party/ply/test/lex_token3.py +24 -0
- data/modules/emscripten/third_party/ply/test/lex_token4.py +26 -0
- data/modules/emscripten/third_party/ply/test/lex_token5.py +31 -0
- data/modules/emscripten/third_party/ply/test/lex_token_dup.py +29 -0
- data/modules/emscripten/third_party/ply/test/testlex.py +606 -0
- data/modules/emscripten/third_party/ply/test/testyacc.py +347 -0
- data/modules/emscripten/third_party/ply/test/yacc_badargs.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_badid.py +77 -0
- data/modules/emscripten/third_party/ply/test/yacc_badprec.py +64 -0
- data/modules/emscripten/third_party/ply/test/yacc_badprec2.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_badprec3.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_badrule.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_badtok.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_dup.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_error1.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_error2.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_error3.py +67 -0
- data/modules/emscripten/third_party/ply/test/yacc_error4.py +72 -0
- data/modules/emscripten/third_party/ply/test/yacc_inf.py +56 -0
- data/modules/emscripten/third_party/ply/test/yacc_literal.py +69 -0
- data/modules/emscripten/third_party/ply/test/yacc_misplaced.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_missing1.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_nested.py +33 -0
- data/modules/emscripten/third_party/ply/test/yacc_nodoc.py +67 -0
- data/modules/emscripten/third_party/ply/test/yacc_noerror.py +66 -0
- data/modules/emscripten/third_party/ply/test/yacc_nop.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_notfunc.py +66 -0
- data/modules/emscripten/third_party/ply/test/yacc_notok.py +67 -0
- data/modules/emscripten/third_party/ply/test/yacc_prec1.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_rr.py +72 -0
- data/modules/emscripten/third_party/ply/test/yacc_rr_unused.py +30 -0
- data/modules/emscripten/third_party/ply/test/yacc_simple.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_sr.py +63 -0
- data/modules/emscripten/third_party/ply/test/yacc_term1.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_unused.py +77 -0
- data/modules/emscripten/third_party/ply/test/yacc_unused_rule.py +72 -0
- data/modules/emscripten/third_party/ply/test/yacc_uprec.py +63 -0
- data/modules/emscripten/third_party/ply/test/yacc_uprec2.py +63 -0
- data/modules/emscripten/third_party/readme.txt +7 -0
- data/modules/emscripten/third_party/websockify/CHANGES.txt +23 -0
- data/modules/emscripten/third_party/websockify/LICENSE.txt +16 -0
- data/modules/emscripten/third_party/websockify/MANIFEST.in +1 -0
- data/modules/emscripten/third_party/websockify/Makefile +11 -0
- data/modules/emscripten/third_party/websockify/README.md +168 -0
- data/modules/emscripten/third_party/websockify/Windows/Windows Service Readme.txt +39 -0
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/Program.cs +24 -0
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/ProjectInstaller.Designer.cs +61 -0
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/ProjectInstaller.cs +19 -0
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/ProjectInstaller.resx +129 -0
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/Properties/AssemblyInfo.cs +36 -0
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/Service1.Designer.cs +37 -0
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/Service1.cs +41 -0
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/noVNC Websocket.csproj +75 -0
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/noVNC Websocket.sln +20 -0
- data/modules/emscripten/third_party/websockify/docs/LICENSE.GPL-3 +621 -0
- data/modules/emscripten/third_party/websockify/docs/LICENSE.LGPL-3 +165 -0
- data/modules/emscripten/third_party/websockify/docs/LICENSE.MPL-2.0 +373 -0
- data/modules/emscripten/third_party/websockify/docs/TODO +9 -0
- data/modules/emscripten/third_party/websockify/docs/flash_policy.txt +4 -0
- data/modules/emscripten/third_party/websockify/docs/latency_results.txt +114 -0
- data/modules/emscripten/third_party/websockify/docs/notes +17 -0
- data/modules/emscripten/third_party/websockify/docs/release.txt +9 -0
- data/modules/emscripten/third_party/websockify/docs/websockify.1 +110 -0
- data/modules/emscripten/third_party/websockify/include/VT100.js +919 -0
- data/modules/emscripten/third_party/websockify/include/base64.js +114 -0
- data/modules/emscripten/third_party/websockify/include/keysym.js +99 -0
- data/modules/emscripten/third_party/websockify/include/util.js +359 -0
- data/modules/emscripten/third_party/websockify/include/web-socket-js/README.txt +109 -0
- data/modules/emscripten/third_party/websockify/include/web-socket-js/WebSocketMain.swf +0 -0
- data/modules/emscripten/third_party/websockify/include/web-socket-js/swfobject.js +4 -0
- data/modules/emscripten/third_party/websockify/include/web-socket-js/web_socket.js +391 -0
- data/modules/emscripten/third_party/websockify/include/websock.js +422 -0
- data/modules/emscripten/third_party/websockify/include/webutil.js +216 -0
- data/modules/emscripten/third_party/websockify/include/wsirc.js +235 -0
- data/modules/emscripten/third_party/websockify/include/wstelnet.js +335 -0
- data/modules/emscripten/third_party/websockify/other/Makefile +14 -0
- data/modules/emscripten/third_party/websockify/other/README.md +51 -0
- data/modules/emscripten/third_party/websockify/other/launch.sh +108 -0
- data/modules/emscripten/third_party/websockify/other/project.clj +13 -0
- data/modules/emscripten/third_party/websockify/other/websocket.c +802 -0
- data/modules/emscripten/third_party/websockify/other/websocket.h +84 -0
- data/modules/emscripten/third_party/websockify/other/websocket.rb +456 -0
- data/modules/emscripten/third_party/websockify/other/websockify.c +385 -0
- data/modules/emscripten/third_party/websockify/other/websockify.clj +233 -0
- data/modules/emscripten/third_party/websockify/other/websockify.js +196 -0
- data/modules/emscripten/third_party/websockify/other/websockify.rb +171 -0
- data/modules/emscripten/third_party/websockify/other/wswrap +22 -0
- data/modules/emscripten/third_party/websockify/rebind +18 -0
- data/modules/emscripten/third_party/websockify/rebind.c +94 -0
- data/modules/emscripten/third_party/websockify/run +5 -0
- data/modules/emscripten/third_party/websockify/setup.py +30 -0
- data/modules/emscripten/third_party/websockify/tests/b64_vs_utf8.py +29 -0
- data/modules/emscripten/third_party/websockify/tests/base64.html +91 -0
- data/modules/emscripten/third_party/websockify/tests/base64.js +12 -0
- data/modules/emscripten/third_party/websockify/tests/echo.html +148 -0
- data/modules/emscripten/third_party/websockify/tests/echo.py +75 -0
- data/modules/emscripten/third_party/websockify/tests/echo.rb +62 -0
- data/modules/emscripten/third_party/websockify/tests/latency.html +290 -0
- data/modules/emscripten/third_party/websockify/tests/latency.py +75 -0
- data/modules/emscripten/third_party/websockify/tests/load.html +250 -0
- data/modules/emscripten/third_party/websockify/tests/load.py +167 -0
- data/modules/emscripten/third_party/websockify/tests/plain_echo.html +168 -0
- data/modules/emscripten/third_party/websockify/tests/simple.html +68 -0
- data/modules/emscripten/third_party/websockify/tests/utf8-list.py +22 -0
- data/modules/emscripten/third_party/websockify/websockify/__init__.py +2 -0
- data/modules/emscripten/third_party/websockify/websockify/websocket.py +982 -0
- data/modules/emscripten/third_party/websockify/websockify/websocketproxy.py +393 -0
- data/modules/emscripten/third_party/websockify/websockify.py +5 -0
- data/modules/emscripten/third_party/websockify/wsirc.html +99 -0
- data/modules/emscripten/third_party/websockify/wstelnet.html +74 -0
- data/modules/emscripten/tools/__init__.py +0 -0
- data/modules/emscripten/tools/__init__.pyc +0 -0
- data/modules/emscripten/tools/autodebugger.py +289 -0
- data/modules/emscripten/tools/autodebugger_c.py +37 -0
- data/modules/emscripten/tools/autodebugger_indenter.py +18 -0
- data/modules/emscripten/tools/autodebugger_js.py +47 -0
- data/modules/emscripten/tools/autodediffer.py +60 -0
- data/modules/emscripten/tools/bindings_generator.py +832 -0
- data/modules/emscripten/tools/bisect_pair.py +88 -0
- data/modules/emscripten/tools/cache.py +198 -0
- data/modules/emscripten/tools/cache.pyc +0 -0
- data/modules/emscripten/tools/clean_webconsole.py +34 -0
- data/modules/emscripten/tools/crunch-worker.js +124 -0
- data/modules/emscripten/tools/diff_autodebugger.py +15 -0
- data/modules/emscripten/tools/eliminator/asm-eliminator-test-output.js +5129 -0
- data/modules/emscripten/tools/eliminator/asm-eliminator-test.js +6861 -0
- data/modules/emscripten/tools/eliminator/eliminator-test-output.js +6122 -0
- data/modules/emscripten/tools/eliminator/eliminator-test.js +8856 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/README.html +888 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/README.org +463 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/bin/uglifyjs +317 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/docstyle.css +75 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/lib/object-ast.js +75 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/lib/parse-js.js +1363 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/lib/process.js +2005 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/lib/squeeze-more.js +51 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/package.json +22 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/beautify.js +28 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/testparser.js +402 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/array1.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/array2.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/array3.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/array4.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/assignment.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/concatstring.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/const.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/empty-blocks.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/forstatement.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/if.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/ifreturn.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/ifreturn2.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue10.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue11.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue13.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue14.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue16.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue17.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue20.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue21.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue25.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue27.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue28.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue29.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue30.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue34.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue4.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue48.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue50.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue53.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue54.1.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue68.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue69.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue9.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/mangle.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/strict-equals.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/var.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/with.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/array1.js +3 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/array2.js +4 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/array3.js +4 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/array4.js +6 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/assignment.js +20 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/concatstring.js +3 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/const.js +5 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/empty-blocks.js +4 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/forstatement.js +10 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/if.js +6 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/ifreturn.js +9 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/ifreturn2.js +16 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue10.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue11.js +3 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue13.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue14.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue16.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue17.js +4 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue20.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue21.js +6 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue25.js +7 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue27.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue28.js +3 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue29.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue30.js +3 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue34.js +3 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue4.js +3 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue48.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue50.js +9 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue53.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue54.1.js +3 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue68.js +5 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue69.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue9.js +4 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/mangle.js +5 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/strict-equals.js +3 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/var.js +3 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/with.js +2 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/scripts.js +55 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/tmp/hoist.js +33 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/tmp/instrument.js +97 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/tmp/instrument2.js +138 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/tmp/test.js +16 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/uglify-js.js +17 -0
- data/modules/emscripten/tools/eliminator/safe-eliminator-test-output.js +85 -0
- data/modules/emscripten/tools/eliminator/safe-eliminator-test.js +103 -0
- data/modules/emscripten/tools/emconfiguren.py +19 -0
- data/modules/emscripten/tools/emmaken.py +230 -0
- data/modules/emscripten/tools/emmakenxx.py +18 -0
- data/modules/emscripten/tools/exec_llvm.py +50 -0
- data/modules/emscripten/tools/file2json.py +49 -0
- data/modules/emscripten/tools/file_packager.py +649 -0
- data/modules/emscripten/tools/find_bigfuncs.py +23 -0
- data/modules/emscripten/tools/find_bigis.py +18 -0
- data/modules/emscripten/tools/fix_closure.py +88 -0
- data/modules/emscripten/tools/ie7_fix.py +14 -0
- data/modules/emscripten/tools/js-optimizer.js +3440 -0
- data/modules/emscripten/tools/js_optimizer.py +341 -0
- data/modules/emscripten/tools/js_optimizer.pyc +0 -0
- data/modules/emscripten/tools/jsrun.py +27 -0
- data/modules/emscripten/tools/jsrun.pyc +0 -0
- data/modules/emscripten/tools/ll-strip.py +56 -0
- data/modules/emscripten/tools/make_file.py +19 -0
- data/modules/emscripten/tools/make_minigzip.py +13 -0
- data/modules/emscripten/tools/namespacer.py +95 -0
- data/modules/emscripten/tools/nativize_llvm.py +34 -0
- data/modules/emscripten/tools/node_modules/source-map/CHANGELOG.md +58 -0
- data/modules/emscripten/tools/node_modules/source-map/LICENSE +28 -0
- data/modules/emscripten/tools/node_modules/source-map/Makefile.dryice.js +166 -0
- data/modules/emscripten/tools/node_modules/source-map/README.md +347 -0
- data/modules/emscripten/tools/node_modules/source-map/build/assert-shim.js +56 -0
- data/modules/emscripten/tools/node_modules/source-map/build/mini-require.js +152 -0
- data/modules/emscripten/tools/node_modules/source-map/build/prefix-source-map.jsm +20 -0
- data/modules/emscripten/tools/node_modules/source-map/build/prefix-utils.jsm +18 -0
- data/modules/emscripten/tools/node_modules/source-map/build/suffix-browser.js +8 -0
- data/modules/emscripten/tools/node_modules/source-map/build/suffix-source-map.jsm +6 -0
- data/modules/emscripten/tools/node_modules/source-map/build/suffix-utils.jsm +21 -0
- data/modules/emscripten/tools/node_modules/source-map/build/test-prefix.js +8 -0
- data/modules/emscripten/tools/node_modules/source-map/build/test-suffix.js +3 -0
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/array-set.js +96 -0
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/base64-vlq.js +144 -0
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/base64.js +42 -0
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/binary-search.js +81 -0
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/source-map-consumer.js +430 -0
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/source-map-generator.js +381 -0
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/source-node.js +353 -0
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/util.js +117 -0
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map.js +8 -0
- data/modules/emscripten/tools/node_modules/source-map/node_modules/amdefine/LICENSE +58 -0
- data/modules/emscripten/tools/node_modules/source-map/node_modules/amdefine/README.md +119 -0
- data/modules/emscripten/tools/node_modules/source-map/node_modules/amdefine/amdefine.js +299 -0
- data/modules/emscripten/tools/node_modules/source-map/node_modules/amdefine/package.json +33 -0
- data/modules/emscripten/tools/node_modules/source-map/package.json +74 -0
- data/modules/emscripten/tools/node_modules/source-map/test/run-tests.js +73 -0
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-api.js +26 -0
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-array-set.js +71 -0
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-base64-vlq.js +24 -0
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-base64.js +35 -0
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-binary-search.js +54 -0
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-dog-fooding.js +72 -0
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-source-map-consumer.js +306 -0
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-source-map-generator.js +391 -0
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-source-node.js +282 -0
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/util.js +152 -0
- data/modules/emscripten/tools/reproduceriter.js +216 -0
- data/modules/emscripten/tools/reproduceriter.py +160 -0
- data/modules/emscripten/tools/response_file.py +28 -0
- data/modules/emscripten/tools/response_file.pyc +0 -0
- data/modules/emscripten/tools/scan_js.py +20 -0
- data/modules/emscripten/tools/scan_ll.py +18 -0
- data/modules/emscripten/tools/scons/site_scons/site_tools/emscripten/__init__.py +3 -0
- data/modules/emscripten/tools/scons/site_scons/site_tools/emscripten/emscripten.py +46 -0
- data/modules/emscripten/tools/settings_template_readonly.py +47 -0
- data/modules/emscripten/tools/shared.py +1437 -0
- data/modules/emscripten/tools/shared.pyc +0 -0
- data/modules/emscripten/tools/source-maps/sourcemap2json.js +15 -0
- data/modules/emscripten/tools/source-maps/sourcemapper.js +177 -0
- data/modules/emscripten/tools/split.py +97 -0
- data/modules/emscripten/tools/tempfiles.py +40 -0
- data/modules/emscripten/tools/tempfiles.pyc +0 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-last-output.js +75 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-last.js +91 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-outline-output.js +570 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-outline.js +606 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-pre-output.js +540 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-pre.js +550 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-regs-min-output.js +36 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-regs-min.js +37 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-regs-output.js +106 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-regs.js +110 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-relocate-output.js +9 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-relocate.js +12 -0
- data/modules/emscripten/tools/test-js-optimizer-output.js +291 -0
- data/modules/emscripten/tools/test-js-optimizer-regs-output.js +232 -0
- data/modules/emscripten/tools/test-js-optimizer-regs.js +237 -0
- data/modules/emscripten/tools/test-js-optimizer-t2-output.js +91 -0
- data/modules/emscripten/tools/test-js-optimizer-t2.js +92 -0
- data/modules/emscripten/tools/test-js-optimizer-t2c-output.js +17 -0
- data/modules/emscripten/tools/test-js-optimizer-t2c.js +18 -0
- data/modules/emscripten/tools/test-js-optimizer-t3-output.js +49 -0
- data/modules/emscripten/tools/test-js-optimizer-t3.js +50 -0
- data/modules/emscripten/tools/test-js-optimizer.js +401 -0
- data/modules/mruby/AUTHORS +18 -0
- data/modules/mruby/CONTRIBUTING.md +65 -0
- data/modules/mruby/ChangeLog +15 -0
- data/modules/mruby/INSTALL +29 -0
- data/modules/mruby/LEGAL +6 -0
- data/modules/mruby/MITL +20 -0
- data/modules/mruby/Makefile +18 -0
- data/modules/mruby/NEWS +13 -0
- data/modules/mruby/README.md +116 -0
- data/modules/mruby/Rakefile +114 -0
- data/modules/mruby/TODO +11 -0
- data/modules/mruby/benchmark/ao-render.rb +315 -0
- data/modules/mruby/benchmark/bm_so_lists.rb +47 -0
- data/modules/mruby/benchmark/fib39.rb +8 -0
- data/modules/mruby/build_config.rb +88 -0
- data/modules/mruby/doc/compile/README.md +376 -0
- data/modules/mruby/doc/mrbgems/README.md +254 -0
- data/modules/mruby/examples/mrbgems/c_and_ruby_extension_example/README.md +4 -0
- data/modules/mruby/examples/mrbgems/c_and_ruby_extension_example/mrbgem.rake +23 -0
- data/modules/mruby/examples/mrbgems/c_and_ruby_extension_example/mrblib/example.rb +5 -0
- data/modules/mruby/examples/mrbgems/c_and_ruby_extension_example/src/example.c +20 -0
- data/modules/mruby/examples/mrbgems/c_and_ruby_extension_example/test/example.rb +7 -0
- data/modules/mruby/examples/mrbgems/c_extension_example/README.md +4 -0
- data/modules/mruby/examples/mrbgems/c_extension_example/mrbgem.rake +23 -0
- data/modules/mruby/examples/mrbgems/c_extension_example/src/example.c +20 -0
- data/modules/mruby/examples/mrbgems/c_extension_example/test/example.c +7 -0
- data/modules/mruby/examples/mrbgems/c_extension_example/test/example.rb +3 -0
- data/modules/mruby/examples/mrbgems/ruby_extension_example/README.md +4 -0
- data/modules/mruby/examples/mrbgems/ruby_extension_example/mrbgem.rake +23 -0
- data/modules/mruby/examples/mrbgems/ruby_extension_example/mrblib/example.rb +5 -0
- data/modules/mruby/examples/mrbgems/ruby_extension_example/test/example.rb +3 -0
- data/modules/mruby/examples/targets/ArduinoDue.rb +65 -0
- data/modules/mruby/examples/targets/chipKitMax32.rb +68 -0
- data/modules/mruby/include/mrbconf.h +87 -0
- data/modules/mruby/include/mruby/array.h +63 -0
- data/modules/mruby/include/mruby/class.h +75 -0
- data/modules/mruby/include/mruby/compile.h +176 -0
- data/modules/mruby/include/mruby/data.h +53 -0
- data/modules/mruby/include/mruby/dump.h +151 -0
- data/modules/mruby/include/mruby/gc.h +17 -0
- data/modules/mruby/include/mruby/hash.h +54 -0
- data/modules/mruby/include/mruby/irep.h +40 -0
- data/modules/mruby/include/mruby/khash.h +257 -0
- data/modules/mruby/include/mruby/numeric.h +32 -0
- data/modules/mruby/include/mruby/proc.h +62 -0
- data/modules/mruby/include/mruby/range.h +35 -0
- data/modules/mruby/include/mruby/string.h +78 -0
- data/modules/mruby/include/mruby/value.h +483 -0
- data/modules/mruby/include/mruby/variable.h +78 -0
- data/modules/mruby/include/mruby.h +388 -0
- data/modules/mruby/minirake +477 -0
- data/modules/mruby/mrbgems/default.gembox +61 -0
- data/modules/mruby/mrbgems/full-core.gembox +9 -0
- data/modules/mruby/mrbgems/mruby-array-ext/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-array-ext/mrblib/array.rb +204 -0
- data/modules/mruby/mrbgems/mruby-array-ext/src/array.c +140 -0
- data/modules/mruby/mrbgems/mruby-array-ext/test/array.rb +109 -0
- data/modules/mruby/mrbgems/mruby-bin-mirb/mrbgem.rake +5 -0
- data/modules/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c +365 -0
- data/modules/mruby/mrbgems/mruby-bin-mruby/mrbgem.rake +5 -0
- data/modules/mruby/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c +243 -0
- data/modules/mruby/mrbgems/mruby-enum-ext/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-enum-ext/mrblib/enum.rb +164 -0
- data/modules/mruby/mrbgems/mruby-enum-ext/test/enum.rb +44 -0
- data/modules/mruby/mrbgems/mruby-eval/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-eval/src/eval.c +23 -0
- data/modules/mruby/mrbgems/mruby-fiber/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-fiber/src/fiber.c +251 -0
- data/modules/mruby/mrbgems/mruby-fiber/test/fiber.rb +64 -0
- data/modules/mruby/mrbgems/mruby-hash-ext/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-hash-ext/mrblib/hash.rb +13 -0
- data/modules/mruby/mrbgems/mruby-hash-ext/src/hash-ext.c +62 -0
- data/modules/mruby/mrbgems/mruby-hash-ext/test/hash.rb +26 -0
- data/modules/mruby/mrbgems/mruby-math/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-math/src/math.c +685 -0
- data/modules/mruby/mrbgems/mruby-math/test/math.rb +136 -0
- data/modules/mruby/mrbgems/mruby-numeric-ext/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-numeric-ext/src/numeric_ext.c +31 -0
- data/modules/mruby/mrbgems/mruby-numeric-ext/test/numeric.rb +10 -0
- data/modules/mruby/mrbgems/mruby-object-ext/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-object-ext/src/object.c +108 -0
- data/modules/mruby/mrbgems/mruby-object-ext/test/nil.rb +11 -0
- data/modules/mruby/mrbgems/mruby-object-ext/test/object.rb +9 -0
- data/modules/mruby/mrbgems/mruby-objectspace/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-objectspace/src/mruby_objectspace.c +117 -0
- data/modules/mruby/mrbgems/mruby-objectspace/test/objectspace.rb +38 -0
- data/modules/mruby/mrbgems/mruby-print/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-print/mrblib/print.rb +64 -0
- data/modules/mruby/mrbgems/mruby-print/src/print.c +44 -0
- data/modules/mruby/mrbgems/mruby-proc-ext/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-proc-ext/mrblib/proc.rb +40 -0
- data/modules/mruby/mrbgems/mruby-proc-ext/src/proc.c +97 -0
- data/modules/mruby/mrbgems/mruby-proc-ext/test/proc.rb +41 -0
- data/modules/mruby/mrbgems/mruby-random/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-random/src/mt19937ar.c +193 -0
- data/modules/mruby/mrbgems/mruby-random/src/mt19937ar.h +48 -0
- data/modules/mruby/mrbgems/mruby-random/src/random.c +231 -0
- data/modules/mruby/mrbgems/mruby-random/src/random.h +12 -0
- data/modules/mruby/mrbgems/mruby-random/test/random.rb +32 -0
- data/modules/mruby/mrbgems/mruby-range-ext/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-range-ext/src/range.c +141 -0
- data/modules/mruby/mrbgems/mruby-range-ext/test/range.rb +20 -0
- data/modules/mruby/mrbgems/mruby-sprintf/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-sprintf/src/kernel.c +30 -0
- data/modules/mruby/mrbgems/mruby-sprintf/src/sprintf.c +1102 -0
- data/modules/mruby/mrbgems/mruby-sprintf/test/sprintf.rb +3 -0
- data/modules/mruby/mrbgems/mruby-string-ext/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-string-ext/mrblib/string.rb +52 -0
- data/modules/mruby/mrbgems/mruby-string-ext/src/string.c +175 -0
- data/modules/mruby/mrbgems/mruby-string-ext/test/string.rb +112 -0
- data/modules/mruby/mrbgems/mruby-struct/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-struct/mrblib/struct.rb +50 -0
- data/modules/mruby/mrbgems/mruby-struct/src/struct.c +818 -0
- data/modules/mruby/mrbgems/mruby-struct/test/struct.rb +77 -0
- data/modules/mruby/mrbgems/mruby-symbol-ext/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-symbol-ext/mrblib/symbol.rb +9 -0
- data/modules/mruby/mrbgems/mruby-symbol-ext/src/symbol.c +55 -0
- data/modules/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb +12 -0
- data/modules/mruby/mrbgems/mruby-time/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-time/src/time.c +749 -0
- data/modules/mruby/mrbgems/mruby-time/test/time.rb +201 -0
- data/modules/mruby/mrbgems/mruby-toplevel-ext/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-toplevel-ext/mrblib/toplevel.rb +11 -0
- data/modules/mruby/mrbgems/mruby-toplevel-ext/test/toplevel.rb +24 -0
- data/modules/mruby/mrblib/array.rb +111 -0
- data/modules/mruby/mrblib/class.rb +26 -0
- data/modules/mruby/mrblib/compar.rb +104 -0
- data/modules/mruby/mrblib/enum.rb +398 -0
- data/modules/mruby/mrblib/error.rb +66 -0
- data/modules/mruby/mrblib/hash.rb +193 -0
- data/modules/mruby/mrblib/init_mrblib.c +14 -0
- data/modules/mruby/mrblib/kernel.rb +46 -0
- data/modules/mruby/mrblib/mrblib.rake +18 -0
- data/modules/mruby/mrblib/numeric.rb +101 -0
- data/modules/mruby/mrblib/print.rb +18 -0
- data/modules/mruby/mrblib/range.rb +40 -0
- data/modules/mruby/mrblib/string.rb +145 -0
- data/modules/mruby/src/array.c +1150 -0
- data/modules/mruby/src/backtrace.c +73 -0
- data/modules/mruby/src/class.c +1942 -0
- data/modules/mruby/src/codegen.c +2864 -0
- data/modules/mruby/src/compar.c +13 -0
- data/modules/mruby/src/crc.c +38 -0
- data/modules/mruby/src/dump.c +542 -0
- data/modules/mruby/src/enum.c +14 -0
- data/modules/mruby/src/error.c +454 -0
- data/modules/mruby/src/error.h +18 -0
- data/modules/mruby/src/etc.c +204 -0
- data/modules/mruby/src/gc.c +1542 -0
- data/modules/mruby/src/hash.c +1261 -0
- data/modules/mruby/src/init.c +62 -0
- data/modules/mruby/src/kernel.c +1105 -0
- data/modules/mruby/src/keywords +50 -0
- data/modules/mruby/src/lex.def +212 -0
- data/modules/mruby/src/load.c +629 -0
- data/modules/mruby/src/mruby_core.rake +28 -0
- data/modules/mruby/src/node.h +117 -0
- data/modules/mruby/src/numeric.c +1418 -0
- data/modules/mruby/src/object.c +593 -0
- data/modules/mruby/src/opcode.h +160 -0
- data/modules/mruby/src/parse.y +6050 -0
- data/modules/mruby/src/pool.c +190 -0
- data/modules/mruby/src/print.c +71 -0
- data/modules/mruby/src/proc.c +209 -0
- data/modules/mruby/src/range.c +442 -0
- data/modules/mruby/src/re.h +13 -0
- data/modules/mruby/src/state.c +200 -0
- data/modules/mruby/src/string.c +2580 -0
- data/modules/mruby/src/symbol.c +456 -0
- data/modules/mruby/src/value_array.h +27 -0
- data/modules/mruby/src/variable.c +1147 -0
- data/modules/mruby/src/vm.c +2129 -0
- data/modules/mruby/tasks/libmruby.rake +18 -0
- data/modules/mruby/tasks/mrbgem_spec.rake +297 -0
- data/modules/mruby/tasks/mrbgems.rake +85 -0
- data/modules/mruby/tasks/mrbgems_test.rake +88 -0
- data/modules/mruby/tasks/mruby_build.rake +211 -0
- data/modules/mruby/tasks/mruby_build_commands.rake +287 -0
- data/modules/mruby/tasks/mruby_build_gem.rake +67 -0
- data/modules/mruby/tasks/ruby_ext.rake +70 -0
- data/modules/mruby/tasks/toolchains/androideabi.rake +126 -0
- data/modules/mruby/tasks/toolchains/clang.rake +8 -0
- data/modules/mruby/tasks/toolchains/gcc.rake +21 -0
- data/modules/mruby/tasks/toolchains/vs2010.rake +3 -0
- data/modules/mruby/tasks/toolchains/vs2012.rake +44 -0
- data/modules/mruby/test/README.md +7 -0
- data/modules/mruby/test/assert.rb +238 -0
- data/modules/mruby/test/driver.c +118 -0
- data/modules/mruby/test/init_mrbtest.c +24 -0
- data/modules/mruby/test/mrbtest.rake +47 -0
- data/modules/mruby/test/report.rb +4 -0
- data/modules/mruby/test/t/argumenterror.rb +21 -0
- data/modules/mruby/test/t/array.rb +309 -0
- data/modules/mruby/test/t/basicobject.rb +11 -0
- data/modules/mruby/test/t/bs_block.rb +489 -0
- data/modules/mruby/test/t/bs_literal.rb +38 -0
- data/modules/mruby/test/t/class.rb +219 -0
- data/modules/mruby/test/t/comparable.rb +72 -0
- data/modules/mruby/test/t/enumerable.rb +108 -0
- data/modules/mruby/test/t/exception.rb +337 -0
- data/modules/mruby/test/t/false.rb +33 -0
- data/modules/mruby/test/t/float.rb +145 -0
- data/modules/mruby/test/t/gc.rb +45 -0
- data/modules/mruby/test/t/hash.rb +310 -0
- data/modules/mruby/test/t/indexerror.rb +10 -0
- data/modules/mruby/test/t/integer.rb +222 -0
- data/modules/mruby/test/t/kernel.rb +425 -0
- data/modules/mruby/test/t/literals.rb +287 -0
- data/modules/mruby/test/t/localjumperror.rb +13 -0
- data/modules/mruby/test/t/methods.rb +109 -0
- data/modules/mruby/test/t/module.rb +344 -0
- data/modules/mruby/test/t/nameerror.rb +32 -0
- data/modules/mruby/test/t/nil.rb +29 -0
- data/modules/mruby/test/t/nomethoderror.rb +13 -0
- data/modules/mruby/test/t/numeric.rb +29 -0
- data/modules/mruby/test/t/object.rb +11 -0
- data/modules/mruby/test/t/proc.rb +56 -0
- data/modules/mruby/test/t/range.rb +82 -0
- data/modules/mruby/test/t/rangeerror.rb +10 -0
- data/modules/mruby/test/t/regexperror.rb +4 -0
- data/modules/mruby/test/t/runtimeerror.rb +6 -0
- data/modules/mruby/test/t/standarderror.rb +10 -0
- data/modules/mruby/test/t/string.rb +483 -0
- data/modules/mruby/test/t/symbol.rb +27 -0
- data/modules/mruby/test/t/syntax.rb +67 -0
- data/modules/mruby/test/t/true.rb +33 -0
- data/modules/mruby/test/t/typeerror.rb +11 -0
- data/modules/mruby/tools/mrbc/mrbc.c +318 -0
- data/modules/mruby/tools/mrbc/mrbc.rake +14 -0
- data/modules/mruby/travis_config.rb +6 -0
- data/modules/mrubymix/LICENSE +21 -0
- data/modules/mrubymix/README.md +6 -0
- data/modules/mrubymix/bin/mrubymix +29 -0
- data/modules/mrubymix/lib/mrubymix.rb +93 -0
- data/modules/mrubymix/mrubymix.gemspec +13 -0
- data/scripts/gen_gems_config.rb +185 -0
- data/scripts/gen_post.rb +104 -0
- data/templates/minimal/Rakefile +36 -0
- data/templates/minimal/app/app.rb +3 -0
- metadata +1408 -0
@@ -0,0 +1,1437 @@
|
|
1
|
+
import shutil, time, os, sys, json, tempfile, copy, shlex, atexit, subprocess, hashlib, cPickle, re
|
2
|
+
from subprocess import Popen, PIPE, STDOUT
|
3
|
+
from tempfile import mkstemp
|
4
|
+
from distutils.spawn import find_executable
|
5
|
+
import jsrun, cache, tempfiles
|
6
|
+
from response_file import create_response_file
|
7
|
+
import logging, platform
|
8
|
+
|
9
|
+
def listify(x):
|
10
|
+
if type(x) is not list: return [x]
|
11
|
+
return x
|
12
|
+
|
13
|
+
# Temp file utilities
|
14
|
+
from tempfiles import try_delete
|
15
|
+
|
16
|
+
# On Windows python suffers from a particularly nasty bug if python is spawning new processes while python itself is spawned from some other non-console process.
|
17
|
+
# Use a custom replacement for Popen on Windows to avoid the "WindowsError: [Error 6] The handle is invalid" errors when emcc is driven through cmake or mingw32-make.
|
18
|
+
# See http://bugs.python.org/issue3905
|
19
|
+
class WindowsPopen:
|
20
|
+
def __init__(self, args, bufsize=0, executable=None, stdin=None, stdout=None, stderr=None, preexec_fn=None, close_fds=False,
|
21
|
+
shell=False, cwd=None, env=None, universal_newlines=False, startupinfo=None, creationflags=0):
|
22
|
+
self.stdin = stdin
|
23
|
+
self.stdout = stdout
|
24
|
+
self.stderr = stderr
|
25
|
+
|
26
|
+
# (stdin, stdout, stderr) store what the caller originally wanted to be done with the streams.
|
27
|
+
# (stdin_, stdout_, stderr_) will store the fixed set of streams that workaround the bug.
|
28
|
+
self.stdin_ = stdin
|
29
|
+
self.stdout_ = stdout
|
30
|
+
self.stderr_ = stderr
|
31
|
+
|
32
|
+
# If the caller wants one of these PIPEd, we must PIPE them all to avoid the 'handle is invalid' bug.
|
33
|
+
if self.stdin_ == PIPE or self.stdout_ == PIPE or self.stderr_ == PIPE:
|
34
|
+
if self.stdin_ == None:
|
35
|
+
self.stdin_ = PIPE
|
36
|
+
if self.stdout_ == None:
|
37
|
+
self.stdout_ = PIPE
|
38
|
+
if self.stderr_ == None:
|
39
|
+
self.stderr_ = PIPE
|
40
|
+
|
41
|
+
# emscripten.py supports reading args from a response file instead of cmdline.
|
42
|
+
# Use .rsp to avoid cmdline length limitations on Windows.
|
43
|
+
if len(args) >= 2 and args[1].endswith("emscripten.py"):
|
44
|
+
self.response_filename = create_response_file(args[2:], TEMP_DIR)
|
45
|
+
args = args[0:2] + ['@' + self.response_filename]
|
46
|
+
|
47
|
+
try:
|
48
|
+
# Call the process with fixed streams.
|
49
|
+
self.process = subprocess.Popen(args, bufsize, executable, self.stdin_, self.stdout_, self.stderr_, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags)
|
50
|
+
except Exception, e:
|
51
|
+
logging.error('\nsubprocess.Popen(args=%s) failed! Exception %s\n' % (' '.join(args), str(e)))
|
52
|
+
raise e
|
53
|
+
|
54
|
+
def communicate(self, input=None):
|
55
|
+
output = self.process.communicate(input)
|
56
|
+
self.returncode = self.process.returncode
|
57
|
+
|
58
|
+
# If caller never wanted to PIPE stdout or stderr, route the output back to screen to avoid swallowing output.
|
59
|
+
if self.stdout == None and self.stdout_ == PIPE and len(output[0].strip()) > 0:
|
60
|
+
print >> sys.stdout, output[0]
|
61
|
+
if self.stderr == None and self.stderr_ == PIPE and len(output[1].strip()) > 0:
|
62
|
+
print >> sys.stderr, output[1]
|
63
|
+
|
64
|
+
# Return a mock object to the caller. This works as long as all emscripten code immediately .communicate()s the result, and doesn't
|
65
|
+
# leave the process object around for longer/more exotic uses.
|
66
|
+
if self.stdout == None and self.stderr == None:
|
67
|
+
return (None, None)
|
68
|
+
if self.stdout == None:
|
69
|
+
return (None, output[1])
|
70
|
+
if self.stderr == None:
|
71
|
+
return (output[0], None)
|
72
|
+
return (output[0], output[1])
|
73
|
+
|
74
|
+
def poll(self):
|
75
|
+
return self.process.poll()
|
76
|
+
|
77
|
+
def kill(self):
|
78
|
+
return self.process.kill()
|
79
|
+
|
80
|
+
def __del__(self):
|
81
|
+
try:
|
82
|
+
# Clean up the temporary response file that was used to spawn this process, so that we don't leave temp files around.
|
83
|
+
tempfiles.try_delete(self.response_filename)
|
84
|
+
except:
|
85
|
+
pass # Mute all exceptions in dtor, particularly if we didn't use a response file, self.response_filename doesn't exist.
|
86
|
+
|
87
|
+
# Install our replacement Popen handler if we are running on Windows to avoid python spawn process function.
|
88
|
+
if os.name == 'nt':
|
89
|
+
Popen = WindowsPopen
|
90
|
+
|
91
|
+
__rootpath__ = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
92
|
+
def path_from_root(*pathelems):
|
93
|
+
return os.path.join(__rootpath__, *pathelems)
|
94
|
+
|
95
|
+
def add_coloring_to_emit_windows(fn):
|
96
|
+
def _out_handle(self):
|
97
|
+
import ctypes
|
98
|
+
return ctypes.windll.kernel32.GetStdHandle(self.STD_OUTPUT_HANDLE)
|
99
|
+
out_handle = property(_out_handle)
|
100
|
+
|
101
|
+
def _set_color(self, code):
|
102
|
+
import ctypes
|
103
|
+
# Constants from the Windows API
|
104
|
+
self.STD_OUTPUT_HANDLE = -11
|
105
|
+
hdl = ctypes.windll.kernel32.GetStdHandle(self.STD_OUTPUT_HANDLE)
|
106
|
+
ctypes.windll.kernel32.SetConsoleTextAttribute(hdl, code)
|
107
|
+
|
108
|
+
setattr(logging.StreamHandler, '_set_color', _set_color)
|
109
|
+
|
110
|
+
def new(*args):
|
111
|
+
FOREGROUND_BLUE = 0x0001 # text color contains blue.
|
112
|
+
FOREGROUND_GREEN = 0x0002 # text color contains green.
|
113
|
+
FOREGROUND_RED = 0x0004 # text color contains red.
|
114
|
+
FOREGROUND_INTENSITY = 0x0008 # text color is intensified.
|
115
|
+
FOREGROUND_WHITE = FOREGROUND_BLUE|FOREGROUND_GREEN |FOREGROUND_RED
|
116
|
+
# winbase.h
|
117
|
+
STD_INPUT_HANDLE = -10
|
118
|
+
STD_OUTPUT_HANDLE = -11
|
119
|
+
STD_ERROR_HANDLE = -12
|
120
|
+
|
121
|
+
# wincon.h
|
122
|
+
FOREGROUND_BLACK = 0x0000
|
123
|
+
FOREGROUND_BLUE = 0x0001
|
124
|
+
FOREGROUND_GREEN = 0x0002
|
125
|
+
FOREGROUND_CYAN = 0x0003
|
126
|
+
FOREGROUND_RED = 0x0004
|
127
|
+
FOREGROUND_MAGENTA = 0x0005
|
128
|
+
FOREGROUND_YELLOW = 0x0006
|
129
|
+
FOREGROUND_GREY = 0x0007
|
130
|
+
FOREGROUND_INTENSITY = 0x0008 # foreground color is intensified.
|
131
|
+
|
132
|
+
BACKGROUND_BLACK = 0x0000
|
133
|
+
BACKGROUND_BLUE = 0x0010
|
134
|
+
BACKGROUND_GREEN = 0x0020
|
135
|
+
BACKGROUND_CYAN = 0x0030
|
136
|
+
BACKGROUND_RED = 0x0040
|
137
|
+
BACKGROUND_MAGENTA = 0x0050
|
138
|
+
BACKGROUND_YELLOW = 0x0060
|
139
|
+
BACKGROUND_GREY = 0x0070
|
140
|
+
BACKGROUND_INTENSITY = 0x0080 # background color is intensified.
|
141
|
+
levelno = args[1].levelno
|
142
|
+
if(levelno >= 50):
|
143
|
+
color = BACKGROUND_YELLOW | FOREGROUND_RED | FOREGROUND_INTENSITY | BACKGROUND_INTENSITY
|
144
|
+
elif(levelno >= 40):
|
145
|
+
color = FOREGROUND_RED | FOREGROUND_INTENSITY
|
146
|
+
elif(levelno >= 30):
|
147
|
+
color = FOREGROUND_YELLOW | FOREGROUND_INTENSITY
|
148
|
+
elif(levelno >= 20):
|
149
|
+
color = FOREGROUND_GREEN
|
150
|
+
elif(levelno >= 10):
|
151
|
+
color = FOREGROUND_MAGENTA
|
152
|
+
else:
|
153
|
+
color = FOREGROUND_WHITE
|
154
|
+
args[0]._set_color(color)
|
155
|
+
ret = fn(*args)
|
156
|
+
args[0]._set_color( FOREGROUND_WHITE )
|
157
|
+
#print "after"
|
158
|
+
return ret
|
159
|
+
return new
|
160
|
+
|
161
|
+
def add_coloring_to_emit_ansi(fn):
|
162
|
+
# add methods we need to the class
|
163
|
+
def new(*args):
|
164
|
+
levelno = args[1].levelno
|
165
|
+
if(levelno >= 50):
|
166
|
+
color = '\x1b[31m' # red
|
167
|
+
elif(levelno >= 40):
|
168
|
+
color = '\x1b[31m' # red
|
169
|
+
elif(levelno >= 30):
|
170
|
+
color = '\x1b[33m' # yellow
|
171
|
+
elif(levelno >= 20):
|
172
|
+
color = '\x1b[32m' # green
|
173
|
+
elif(levelno >= 10):
|
174
|
+
color = '\x1b[35m' # pink
|
175
|
+
else:
|
176
|
+
color = '\x1b[0m' # normal
|
177
|
+
args[1].msg = color + args[1].msg + '\x1b[0m' # normal
|
178
|
+
#print "after"
|
179
|
+
return fn(*args)
|
180
|
+
return new
|
181
|
+
|
182
|
+
WINDOWS = sys.platform.startswith('win')
|
183
|
+
|
184
|
+
if WINDOWS:
|
185
|
+
logging.StreamHandler.emit = add_coloring_to_emit_windows(logging.StreamHandler.emit)
|
186
|
+
else:
|
187
|
+
logging.StreamHandler.emit = add_coloring_to_emit_ansi(logging.StreamHandler.emit)
|
188
|
+
|
189
|
+
# Emscripten configuration is done through the EM_CONFIG environment variable.
|
190
|
+
# If the string value contained in this environment variable contains newline
|
191
|
+
# separated definitions, then these definitions will be used to configure
|
192
|
+
# Emscripten. Otherwise, the string is understood to be a path to a settings
|
193
|
+
# file that contains the required definitions.
|
194
|
+
|
195
|
+
EM_CONFIG = os.environ.get('EM_CONFIG')
|
196
|
+
if not EM_CONFIG:
|
197
|
+
EM_CONFIG = '~/.emscripten'
|
198
|
+
if '\n' in EM_CONFIG:
|
199
|
+
CONFIG_FILE = None
|
200
|
+
else:
|
201
|
+
CONFIG_FILE = os.path.expanduser(EM_CONFIG)
|
202
|
+
if not os.path.exists(CONFIG_FILE):
|
203
|
+
config_file = open(path_from_root('tools', 'settings_template_readonly.py')).read().split('\n')
|
204
|
+
config_file = config_file[1:] # remove "this file will be copied..."
|
205
|
+
config_file = '\n'.join(config_file)
|
206
|
+
# autodetect some default paths
|
207
|
+
config_file = config_file.replace('{{{ EMSCRIPTEN_ROOT }}}', __rootpath__)
|
208
|
+
llvm_root = os.path.dirname(find_executable('llvm-dis') or '/usr/bin/llvm-dis')
|
209
|
+
config_file = config_file.replace('{{{ LLVM_ROOT }}}', llvm_root)
|
210
|
+
node = find_executable('node') or find_executable('nodejs') or 'node'
|
211
|
+
config_file = config_file.replace('{{{ NODE }}}', node)
|
212
|
+
python = find_executable('python2') or find_executable('python') or \
|
213
|
+
sys.executable or 'python'
|
214
|
+
config_file = config_file.replace('{{{ PYTHON }}}', python)
|
215
|
+
|
216
|
+
# write
|
217
|
+
open(CONFIG_FILE, 'w').write(config_file)
|
218
|
+
print >> sys.stderr, '''
|
219
|
+
==============================================================================
|
220
|
+
Welcome to Emscripten!
|
221
|
+
|
222
|
+
This is the first time any of the Emscripten tools has been run.
|
223
|
+
|
224
|
+
A settings file has been copied to %s, at absolute path: %s
|
225
|
+
|
226
|
+
It contains our best guesses for the important paths, which are:
|
227
|
+
|
228
|
+
LLVM_ROOT = %s
|
229
|
+
PYTHON = %s
|
230
|
+
NODE_JS = %s
|
231
|
+
EMSCRIPTEN_ROOT = %s
|
232
|
+
|
233
|
+
Please edit the file if any of those are incorrect.
|
234
|
+
|
235
|
+
This command will now exit. When you are done editing those paths, re-run it.
|
236
|
+
==============================================================================
|
237
|
+
''' % (EM_CONFIG, CONFIG_FILE, llvm_root, python, node, __rootpath__)
|
238
|
+
sys.exit(0)
|
239
|
+
try:
|
240
|
+
config_text = open(CONFIG_FILE, 'r').read() if CONFIG_FILE else EM_CONFIG
|
241
|
+
exec(config_text)
|
242
|
+
except Exception, e:
|
243
|
+
logging.error('Error in evaluating %s (at %s): %s, text: %s' % (EM_CONFIG, CONFIG_FILE, str(e), config_text))
|
244
|
+
sys.exit(1)
|
245
|
+
|
246
|
+
# Expectations
|
247
|
+
|
248
|
+
EXPECTED_LLVM_VERSION = (3,2)
|
249
|
+
|
250
|
+
def check_clang_version():
|
251
|
+
expected = 'clang version ' + '.'.join(map(str, EXPECTED_LLVM_VERSION))
|
252
|
+
actual = Popen([CLANG, '-v'], stderr=PIPE).communicate()[1].split('\n')[0]
|
253
|
+
if expected in actual:
|
254
|
+
return True
|
255
|
+
logging.warning('LLVM version appears incorrect (seeing "%s", expected "%s")' % (actual, expected))
|
256
|
+
return False
|
257
|
+
|
258
|
+
def check_llvm_version():
|
259
|
+
try:
|
260
|
+
check_clang_version()
|
261
|
+
except Exception, e:
|
262
|
+
logging.warning('Could not verify LLVM version: %s' % str(e))
|
263
|
+
|
264
|
+
EXPECTED_NODE_VERSION = (0,8,0)
|
265
|
+
|
266
|
+
def check_node_version():
|
267
|
+
try:
|
268
|
+
node = listify(NODE_JS)
|
269
|
+
actual = Popen(node + ['--version'], stdout=PIPE).communicate()[0].strip()
|
270
|
+
version = tuple(map(int, actual.replace('v', '').split('.')))
|
271
|
+
if version >= EXPECTED_NODE_VERSION:
|
272
|
+
return True
|
273
|
+
logging.warning('node version appears too old (seeing "%s", expected "%s")' % (actual, 'v' + ('.'.join(map(str, EXPECTED_NODE_VERSION)))))
|
274
|
+
return False
|
275
|
+
except Exception, e:
|
276
|
+
logging.warning('cannot check node version: %s', e)
|
277
|
+
return False
|
278
|
+
|
279
|
+
# Check that basic stuff we need (a JS engine to compile, Node.js, and Clang and LLVM)
|
280
|
+
# exists.
|
281
|
+
# The test runner always does this check (through |force|). emcc does this less frequently,
|
282
|
+
# only when ${EM_CONFIG}_sanity does not exist or is older than EM_CONFIG (so,
|
283
|
+
# we re-check sanity when the settings are changed)
|
284
|
+
# We also re-check sanity and clear the cache when the version changes
|
285
|
+
|
286
|
+
EMSCRIPTEN_VERSION = '1.5.3'
|
287
|
+
|
288
|
+
def generate_sanity():
|
289
|
+
return EMSCRIPTEN_VERSION + '|' + get_llvm_target()
|
290
|
+
|
291
|
+
def check_sanity(force=False):
|
292
|
+
try:
|
293
|
+
reason = None
|
294
|
+
if not CONFIG_FILE:
|
295
|
+
if not force: return # config stored directly in EM_CONFIG => skip sanity checks
|
296
|
+
else:
|
297
|
+
settings_mtime = os.stat(CONFIG_FILE).st_mtime
|
298
|
+
sanity_file = CONFIG_FILE + '_sanity'
|
299
|
+
if os.path.exists(sanity_file):
|
300
|
+
try:
|
301
|
+
sanity_mtime = os.stat(sanity_file).st_mtime
|
302
|
+
if sanity_mtime <= settings_mtime:
|
303
|
+
reason = 'settings file has changed'
|
304
|
+
else:
|
305
|
+
sanity_data = open(sanity_file).read()
|
306
|
+
if sanity_data != generate_sanity():
|
307
|
+
reason = 'system change: %s vs %s' % (generate_sanity(), sanity_data)
|
308
|
+
else:
|
309
|
+
if not force: return # all is well
|
310
|
+
except Exception, e:
|
311
|
+
reason = 'unknown: ' + str(e)
|
312
|
+
if reason:
|
313
|
+
logging.warning('(Emscripten: %s, clearing cache)' % reason)
|
314
|
+
Cache.erase()
|
315
|
+
force = False # the check actually failed, so definitely write out the sanity file, to avoid others later seeing failures too
|
316
|
+
|
317
|
+
# some warning, not fatal checks - do them even if EM_IGNORE_SANITY is on
|
318
|
+
check_llvm_version()
|
319
|
+
check_node_version()
|
320
|
+
|
321
|
+
if os.environ.get('EM_IGNORE_SANITY'):
|
322
|
+
logging.info('EM_IGNORE_SANITY set, ignoring sanity checks')
|
323
|
+
return
|
324
|
+
|
325
|
+
logging.info('(Emscripten: Running sanity checks)')
|
326
|
+
|
327
|
+
if not check_engine(COMPILER_ENGINE):
|
328
|
+
logging.critical('The JavaScript shell used for compiling (%s) does not seem to work, check the paths in %s' % (COMPILER_ENGINE, EM_CONFIG))
|
329
|
+
sys.exit(1)
|
330
|
+
|
331
|
+
if NODE_JS != COMPILER_ENGINE:
|
332
|
+
if not check_engine(NODE_JS):
|
333
|
+
logging.critical('Node.js (%s) does not seem to work, check the paths in %s' % (NODE_JS, EM_CONFIG))
|
334
|
+
sys.exit(1)
|
335
|
+
|
336
|
+
for cmd in [CLANG, LLVM_LINK, LLVM_AR, LLVM_OPT, LLVM_AS, LLVM_DIS, LLVM_NM]:
|
337
|
+
if not os.path.exists(cmd) and not os.path.exists(cmd + '.exe'): # .exe extension required for Windows
|
338
|
+
logging.critical('Cannot find %s, check the paths in %s' % (cmd, EM_CONFIG))
|
339
|
+
sys.exit(1)
|
340
|
+
|
341
|
+
try:
|
342
|
+
subprocess.call([JAVA, '-version'], stdout=PIPE, stderr=PIPE)
|
343
|
+
except:
|
344
|
+
logging.warning('java does not seem to exist, required for closure compiler. -O2 and above will fail. You need to define JAVA in ~/.emscripten')
|
345
|
+
|
346
|
+
if not os.path.exists(CLOSURE_COMPILER):
|
347
|
+
logging.warning('Closure compiler (%s) does not exist, check the paths in %s. -O2 and above will fail' % (CLOSURE_COMPILER, EM_CONFIG))
|
348
|
+
|
349
|
+
# Sanity check passed!
|
350
|
+
|
351
|
+
if not force:
|
352
|
+
# Only create/update this file if the sanity check succeeded, i.e., we got here
|
353
|
+
f = open(sanity_file, 'w')
|
354
|
+
f.write(generate_sanity())
|
355
|
+
f.close()
|
356
|
+
|
357
|
+
except Exception, e:
|
358
|
+
# Any error here is not worth failing on
|
359
|
+
print 'WARNING: sanity check failed to run', e
|
360
|
+
|
361
|
+
# Tools/paths
|
362
|
+
|
363
|
+
LLVM_ADD_VERSION = os.getenv('LLVM_ADD_VERSION')
|
364
|
+
CLANG_ADD_VERSION = os.getenv('CLANG_ADD_VERSION')
|
365
|
+
|
366
|
+
# Some distributions ship with multiple llvm versions so they add
|
367
|
+
# the version to the binaries, cope with that
|
368
|
+
def build_llvm_tool_path(tool):
|
369
|
+
if LLVM_ADD_VERSION:
|
370
|
+
return os.path.join(LLVM_ROOT, tool + "-" + LLVM_ADD_VERSION)
|
371
|
+
else:
|
372
|
+
return os.path.join(LLVM_ROOT, tool)
|
373
|
+
|
374
|
+
# Some distributions ship with multiple clang versions so they add
|
375
|
+
# the version to the binaries, cope with that
|
376
|
+
def build_clang_tool_path(tool):
|
377
|
+
if CLANG_ADD_VERSION:
|
378
|
+
return os.path.join(LLVM_ROOT, tool + "-" + CLANG_ADD_VERSION)
|
379
|
+
else:
|
380
|
+
return os.path.join(LLVM_ROOT, tool)
|
381
|
+
|
382
|
+
CLANG_CC=os.path.expanduser(build_clang_tool_path('clang'))
|
383
|
+
CLANG_CPP=os.path.expanduser(build_clang_tool_path('clang++'))
|
384
|
+
CLANG=CLANG_CPP
|
385
|
+
LLVM_LINK=build_llvm_tool_path('llvm-link')
|
386
|
+
LLVM_AR=build_llvm_tool_path('llvm-ar')
|
387
|
+
LLVM_OPT=os.path.expanduser(build_llvm_tool_path('opt'))
|
388
|
+
LLVM_AS=os.path.expanduser(build_llvm_tool_path('llvm-as'))
|
389
|
+
LLVM_DIS=os.path.expanduser(build_llvm_tool_path('llvm-dis'))
|
390
|
+
LLVM_NM=os.path.expanduser(build_llvm_tool_path('llvm-nm'))
|
391
|
+
LLVM_INTERPRETER=os.path.expanduser(build_llvm_tool_path('lli'))
|
392
|
+
LLVM_COMPILER=os.path.expanduser(build_llvm_tool_path('llc'))
|
393
|
+
|
394
|
+
EMSCRIPTEN = path_from_root('emscripten.py')
|
395
|
+
DEMANGLER = path_from_root('third_party', 'demangler.py')
|
396
|
+
NAMESPACER = path_from_root('tools', 'namespacer.py')
|
397
|
+
EMCC = path_from_root('emcc')
|
398
|
+
EMXX = path_from_root('em++')
|
399
|
+
EMAR = path_from_root('emar')
|
400
|
+
EMRANLIB = path_from_root('emranlib')
|
401
|
+
EMLIBTOOL = path_from_root('emlibtool')
|
402
|
+
EMCONFIG = path_from_root('em-config')
|
403
|
+
EMLINK = path_from_root('emlink.py')
|
404
|
+
EMMAKEN = path_from_root('tools', 'emmaken.py')
|
405
|
+
AUTODEBUGGER = path_from_root('tools', 'autodebugger.py')
|
406
|
+
BINDINGS_GENERATOR = path_from_root('tools', 'bindings_generator.py')
|
407
|
+
EXEC_LLVM = path_from_root('tools', 'exec_llvm.py')
|
408
|
+
FILE_PACKAGER = path_from_root('tools', 'file_packager.py')
|
409
|
+
|
410
|
+
# Temp dir. Create a random one, unless EMCC_DEBUG is set, in which case use TEMP_DIR/emscripten_temp
|
411
|
+
|
412
|
+
class Configuration:
|
413
|
+
def __init__(self, environ=os.environ):
|
414
|
+
self.DEBUG = environ.get('EMCC_DEBUG')
|
415
|
+
if self.DEBUG == "0":
|
416
|
+
self.DEBUG = None
|
417
|
+
self.DEBUG_CACHE = self.DEBUG and "cache" in self.DEBUG
|
418
|
+
self.EMSCRIPTEN_TEMP_DIR = None
|
419
|
+
|
420
|
+
try:
|
421
|
+
self.TEMP_DIR = TEMP_DIR
|
422
|
+
except NameError:
|
423
|
+
logging.debug('TEMP_DIR not defined in ~/.emscripten, using /tmp')
|
424
|
+
self.TEMP_DIR = '/tmp'
|
425
|
+
|
426
|
+
self.CANONICAL_TEMP_DIR = os.path.join(self.TEMP_DIR, 'emscripten_temp')
|
427
|
+
|
428
|
+
if self.DEBUG:
|
429
|
+
try:
|
430
|
+
self.EMSCRIPTEN_TEMP_DIR = self.CANONICAL_TEMP_DIR
|
431
|
+
if not os.path.exists(self.EMSCRIPTEN_TEMP_DIR):
|
432
|
+
os.makedirs(self.EMSCRIPTEN_TEMP_DIR)
|
433
|
+
except Exception, e:
|
434
|
+
logging.debug(e + 'Could not create canonical temp dir. Check definition of TEMP_DIR in ~/.emscripten')
|
435
|
+
|
436
|
+
def get_temp_files(self):
|
437
|
+
return tempfiles.TempFiles(
|
438
|
+
tmp=self.TEMP_DIR if not self.DEBUG else self.EMSCRIPTEN_TEMP_DIR,
|
439
|
+
save_debug_files=os.environ.get('EMCC_DEBUG_SAVE'))
|
440
|
+
|
441
|
+
def apply_configuration():
|
442
|
+
global configuration, DEBUG, EMSCRIPTEN_TEMP_DIR, DEBUG_CACHE, CANONICAL_TEMP_DIR
|
443
|
+
configuration = Configuration()
|
444
|
+
DEBUG = configuration.DEBUG
|
445
|
+
EMSCRIPTEN_TEMP_DIR = configuration.EMSCRIPTEN_TEMP_DIR
|
446
|
+
DEBUG_CACHE = configuration.DEBUG_CACHE
|
447
|
+
CANONICAL_TEMP_DIR = configuration.CANONICAL_TEMP_DIR
|
448
|
+
apply_configuration()
|
449
|
+
|
450
|
+
logging.basicConfig(format='%(levelname)-8s %(name)s: %(message)s')
|
451
|
+
def set_logging():
|
452
|
+
logger = logging.getLogger()
|
453
|
+
logger.setLevel(logging.DEBUG if os.environ.get('EMCC_DEBUG') else logging.INFO)
|
454
|
+
set_logging()
|
455
|
+
|
456
|
+
if not EMSCRIPTEN_TEMP_DIR:
|
457
|
+
EMSCRIPTEN_TEMP_DIR = tempfile.mkdtemp(prefix='emscripten_temp_', dir=configuration.TEMP_DIR)
|
458
|
+
def prepare_to_clean_temp(d):
|
459
|
+
def clean_temp():
|
460
|
+
try_delete(d)
|
461
|
+
atexit.register(clean_temp)
|
462
|
+
prepare_to_clean_temp(EMSCRIPTEN_TEMP_DIR) # this global var might change later
|
463
|
+
|
464
|
+
# EM_CONFIG stuff
|
465
|
+
|
466
|
+
try:
|
467
|
+
JS_ENGINES
|
468
|
+
except:
|
469
|
+
try:
|
470
|
+
JS_ENGINES = [JS_ENGINE]
|
471
|
+
except Exception, e:
|
472
|
+
print 'ERROR: %s does not seem to have JS_ENGINES or JS_ENGINE set up' % EM_CONFIG
|
473
|
+
raise
|
474
|
+
|
475
|
+
try:
|
476
|
+
CLOSURE_COMPILER
|
477
|
+
except:
|
478
|
+
CLOSURE_COMPILER = path_from_root('third_party', 'closure-compiler', 'compiler.jar')
|
479
|
+
|
480
|
+
try:
|
481
|
+
PYTHON
|
482
|
+
except:
|
483
|
+
logging.debug('PYTHON not defined in ~/.emscripten, using "python"')
|
484
|
+
PYTHON = 'python'
|
485
|
+
|
486
|
+
try:
|
487
|
+
JAVA
|
488
|
+
except:
|
489
|
+
logging.debug('JAVA not defined in ~/.emscripten, using "java"')
|
490
|
+
JAVA = 'java'
|
491
|
+
|
492
|
+
# Additional compiler options
|
493
|
+
|
494
|
+
# Target choice. Must be synced with src/settings.js (TARGET_*)
|
495
|
+
def get_llvm_target():
|
496
|
+
return os.environ.get('EMCC_LLVM_TARGET') or 'le32-unknown-nacl' # 'i386-pc-linux-gnu'
|
497
|
+
LLVM_TARGET = get_llvm_target()
|
498
|
+
|
499
|
+
try:
|
500
|
+
COMPILER_OPTS # Can be set in EM_CONFIG, optionally
|
501
|
+
except:
|
502
|
+
COMPILER_OPTS = []
|
503
|
+
# Force a simple, standard target as much as possible: target 32-bit linux, and disable various flags that hint at other platforms
|
504
|
+
COMPILER_OPTS = COMPILER_OPTS + ['-m32', '-U__i386__', '-U__i386', '-Ui386',
|
505
|
+
'-U__SSE__', '-U__SSE_MATH__', '-U__SSE2__', '-U__SSE2_MATH__', '-U__MMX__',
|
506
|
+
'-DEMSCRIPTEN', '-D__EMSCRIPTEN__', '-U__STRICT_ANSI__',
|
507
|
+
'-D__IEEE_LITTLE_ENDIAN', '-fno-math-errno',
|
508
|
+
#'-fno-threadsafe-statics', # disabled due to issue 1289
|
509
|
+
'-target', LLVM_TARGET]
|
510
|
+
|
511
|
+
if LLVM_TARGET == 'le32-unknown-nacl':
|
512
|
+
COMPILER_OPTS += ['-U__native_client__', '-U__pnacl__', '-U__ELF__'] # The nacl target is originally used for Google Native Client. Emscripten is not NaCl, so remove the platform #define, when using their triple.
|
513
|
+
|
514
|
+
USE_EMSDK = not os.environ.get('EMMAKEN_NO_SDK')
|
515
|
+
|
516
|
+
if USE_EMSDK:
|
517
|
+
# Disable system C and C++ include directories, and add our own (using -idirafter so they are last, like system dirs, which
|
518
|
+
# allows projects to override them)
|
519
|
+
EMSDK_OPTS = ['-nostdinc', '-nostdinc++', '-Xclang', '-nobuiltininc', '-Xclang', '-nostdsysteminc',
|
520
|
+
'-Xclang', '-isystem' + path_from_root('system', 'local', 'include'),
|
521
|
+
'-Xclang', '-isystem' + path_from_root('system', 'include', 'libcxx'),
|
522
|
+
'-Xclang', '-isystem' + path_from_root('system', 'include'),
|
523
|
+
'-Xclang', '-isystem' + path_from_root('system', 'include', 'emscripten'),
|
524
|
+
'-Xclang', '-isystem' + path_from_root('system', 'include', 'bsd'), # posix stuff
|
525
|
+
'-Xclang', '-isystem' + path_from_root('system', 'include', 'libc'),
|
526
|
+
'-Xclang', '-isystem' + path_from_root('system', 'include', 'gfx'),
|
527
|
+
'-Xclang', '-isystem' + path_from_root('system', 'include', 'net'),
|
528
|
+
'-Xclang', '-isystem' + path_from_root('system', 'include', 'SDL'),
|
529
|
+
] + [
|
530
|
+
'-U__APPLE__', '-U__linux__'
|
531
|
+
]
|
532
|
+
COMPILER_OPTS += EMSDK_OPTS
|
533
|
+
else:
|
534
|
+
EMSDK_OPTS = []
|
535
|
+
|
536
|
+
#print >> sys.stderr, 'SDK opts', ' '.join(EMSDK_OPTS)
|
537
|
+
#print >> sys.stderr, 'Compiler opts', ' '.join(COMPILER_OPTS)
|
538
|
+
|
539
|
+
# Engine tweaks
|
540
|
+
|
541
|
+
try:
|
542
|
+
if 'gcparam' not in str(SPIDERMONKEY_ENGINE):
|
543
|
+
if type(SPIDERMONKEY_ENGINE) is str:
|
544
|
+
SPIDERMONKEY_ENGINE = [SPIDERMONKEY_ENGINE]
|
545
|
+
SPIDERMONKEY_ENGINE += ['-e', "gcparam('maxBytes', 1024*1024*1024);"] # Our very large files need lots of gc heap
|
546
|
+
except NameError:
|
547
|
+
pass
|
548
|
+
|
549
|
+
# If we have 'env', we should use that to find python, because |python| may fail while |env python| may work
|
550
|
+
# (For example, if system python is 3.x while we need 2.x, and env gives 2.x if told to do so.)
|
551
|
+
ENV_PREFIX = []
|
552
|
+
if not WINDOWS:
|
553
|
+
try:
|
554
|
+
assert 'Python' in Popen(['env', 'python', '-V'], stdout=PIPE, stderr=STDOUT).communicate()[0]
|
555
|
+
ENV_PREFIX = ['env']
|
556
|
+
except:
|
557
|
+
pass
|
558
|
+
|
559
|
+
# Utilities
|
560
|
+
|
561
|
+
def check_engine(engine):
|
562
|
+
# TODO: we call this several times, perhaps cache the results?
|
563
|
+
try:
|
564
|
+
if not CONFIG_FILE:
|
565
|
+
return True # config stored directly in EM_CONFIG => skip engine check
|
566
|
+
return 'hello, world!' in run_js(path_from_root('tests', 'hello_world.js'), engine)
|
567
|
+
except Exception, e:
|
568
|
+
print 'Checking JS engine %s failed. Check %s. Details: %s' % (str(engine), EM_CONFIG, str(e))
|
569
|
+
return False
|
570
|
+
|
571
|
+
def run_js(filename, engine=None, *args, **kw):
|
572
|
+
if engine is None:
|
573
|
+
engine = JS_ENGINES[0]
|
574
|
+
return jsrun.run_js(filename, engine, *args, **kw)
|
575
|
+
|
576
|
+
def to_cc(cxx):
|
577
|
+
# By default, LLVM_GCC and CLANG are really the C++ versions. This gets an explicit C version
|
578
|
+
return cxx.replace('clang++', 'clang').replace('g++', 'gcc')
|
579
|
+
|
580
|
+
def line_splitter(data):
|
581
|
+
"""Silly little tool to split JSON arrays over many lines."""
|
582
|
+
|
583
|
+
out = ''
|
584
|
+
counter = 0
|
585
|
+
|
586
|
+
for i in range(len(data)):
|
587
|
+
out += data[i]
|
588
|
+
if data[i] == ' ' and counter > 60:
|
589
|
+
out += '\n'
|
590
|
+
counter = 0
|
591
|
+
else:
|
592
|
+
counter += 1
|
593
|
+
|
594
|
+
return out
|
595
|
+
|
596
|
+
def limit_size(string, MAX=80*20):
|
597
|
+
if len(string) < MAX: return string
|
598
|
+
return string[0:MAX/2] + '\n[..]\n' + string[-MAX/2:]
|
599
|
+
|
600
|
+
def read_pgo_data(filename):
|
601
|
+
'''
|
602
|
+
Reads the output of PGO and generates proper information for CORRECT_* == 2 's *_LINES options
|
603
|
+
'''
|
604
|
+
signs_lines = []
|
605
|
+
overflows_lines = []
|
606
|
+
|
607
|
+
for line in open(filename, 'r'):
|
608
|
+
try:
|
609
|
+
if line.rstrip() == '': continue
|
610
|
+
if '%0 failures' in line: continue
|
611
|
+
left, right = line.split(' : ')
|
612
|
+
signature = left.split('|')[1]
|
613
|
+
if 'Sign' in left:
|
614
|
+
signs_lines.append(signature)
|
615
|
+
elif 'Overflow' in left:
|
616
|
+
overflows_lines.append(signature)
|
617
|
+
except:
|
618
|
+
pass
|
619
|
+
|
620
|
+
return {
|
621
|
+
'signs_lines': signs_lines,
|
622
|
+
'overflows_lines': overflows_lines
|
623
|
+
}
|
624
|
+
|
625
|
+
def unique_ordered(values): # return a list of unique values in an input list, without changing order (list(set(.)) would change order randomly)
|
626
|
+
seen = set()
|
627
|
+
def check(value):
|
628
|
+
if value in seen: return False
|
629
|
+
seen.add(value)
|
630
|
+
return True
|
631
|
+
return filter(check, values)
|
632
|
+
|
633
|
+
def expand_response(data):
|
634
|
+
if type(data) == str and data[0] == '@':
|
635
|
+
return json.loads(open(data[1:]).read())
|
636
|
+
return data
|
637
|
+
|
638
|
+
# Settings. A global singleton. Not pretty, but nicer than passing |, settings| everywhere
|
639
|
+
|
640
|
+
class Settings:
|
641
|
+
@classmethod
|
642
|
+
def reset(self):
|
643
|
+
class Settings2:
|
644
|
+
QUANTUM_SIZE = 4
|
645
|
+
reset = Settings.reset
|
646
|
+
|
647
|
+
# Given some emcc-type args (-O3, -s X=Y, etc.), fill Settings with the right settings
|
648
|
+
@classmethod
|
649
|
+
def load(self, args=[]):
|
650
|
+
# Load the JS defaults into python
|
651
|
+
settings = open(path_from_root('src', 'settings.js')).read().replace('var ', 'Settings.').replace('//', '#')
|
652
|
+
exec settings in globals()
|
653
|
+
|
654
|
+
# Apply additional settings. First -O, then -s
|
655
|
+
for i in range(len(args)):
|
656
|
+
if args[i].startswith('-O'):
|
657
|
+
level = eval(args[i][2])
|
658
|
+
Settings.apply_opt_level(level)
|
659
|
+
for i in range(len(args)):
|
660
|
+
if args[i] == '-s':
|
661
|
+
exec 'Settings.' + args[i+1] in globals() # execute the setting
|
662
|
+
|
663
|
+
# Transforms the Settings information into emcc-compatible args (-s X=Y, etc.). Basically
|
664
|
+
# the reverse of load_settings, except for -Ox which is relevant there but not here
|
665
|
+
@classmethod
|
666
|
+
def serialize(self):
|
667
|
+
ret = []
|
668
|
+
for key, value in Settings.__dict__.iteritems():
|
669
|
+
if key == key.upper(): # this is a hack. all of our settings are ALL_CAPS, python internals are not
|
670
|
+
jsoned = json.dumps(value, sort_keys=True)
|
671
|
+
ret += ['-s', key + '=' + jsoned]
|
672
|
+
return ret
|
673
|
+
|
674
|
+
@classmethod
|
675
|
+
def apply_opt_level(self, opt_level, noisy=False):
|
676
|
+
if opt_level >= 1:
|
677
|
+
Settings.ASM_JS = 1
|
678
|
+
Settings.ASSERTIONS = 0
|
679
|
+
Settings.DISABLE_EXCEPTION_CATCHING = 1
|
680
|
+
Settings.EMIT_GENERATED_FUNCTIONS = 1
|
681
|
+
if opt_level >= 2:
|
682
|
+
Settings.RELOOP = 1
|
683
|
+
Settings.ALIASING_FUNCTION_POINTERS = 1
|
684
|
+
if opt_level >= 3:
|
685
|
+
# Aside from these, -O3 also runs closure compiler and llvm lto
|
686
|
+
Settings.FORCE_ALIGNED_MEMORY = 1
|
687
|
+
Settings.DOUBLE_MODE = 0
|
688
|
+
Settings.PRECISE_I64_MATH = 0
|
689
|
+
if noisy: logging.warning('Applying some potentially unsafe optimizations! (Use -O2 if this fails.)')
|
690
|
+
|
691
|
+
global Settings
|
692
|
+
Settings = Settings2
|
693
|
+
Settings.load() # load defaults
|
694
|
+
|
695
|
+
Settings.reset()
|
696
|
+
|
697
|
+
# Building
|
698
|
+
|
699
|
+
class Building:
|
700
|
+
COMPILER = CLANG
|
701
|
+
LLVM_OPTS = False
|
702
|
+
COMPILER_TEST_OPTS = [] # For use of the test runner
|
703
|
+
|
704
|
+
@staticmethod
|
705
|
+
def get_building_env(native=False):
|
706
|
+
env = os.environ.copy()
|
707
|
+
if native:
|
708
|
+
env['CC'] = CLANG_CC
|
709
|
+
env['CXX'] = CLANG_CPP
|
710
|
+
env['LD'] = CLANG
|
711
|
+
env['CFLAGS'] = '-O2 -fno-math-errno'
|
712
|
+
return env
|
713
|
+
env['CC'] = EMCC if not WINDOWS else 'python %r' % EMCC
|
714
|
+
env['CXX'] = EMXX if not WINDOWS else 'python %r' % EMXX
|
715
|
+
env['AR'] = EMAR if not WINDOWS else 'python %r' % EMAR
|
716
|
+
env['LD'] = EMCC if not WINDOWS else 'python %r' % EMCC
|
717
|
+
env['LDSHARED'] = EMCC if not WINDOWS else 'python %r' % EMCC
|
718
|
+
env['RANLIB'] = EMRANLIB if not WINDOWS else 'python %r' % EMRANLIB
|
719
|
+
#env['LIBTOOL'] = EMLIBTOOL if not WINDOWS else 'python %r' % EMLIBTOOL
|
720
|
+
env['EMMAKEN_COMPILER'] = Building.COMPILER
|
721
|
+
env['EMSCRIPTEN_TOOLS'] = path_from_root('tools')
|
722
|
+
env['CFLAGS'] = env['EMMAKEN_CFLAGS'] = ' '.join(Building.COMPILER_TEST_OPTS)
|
723
|
+
env['HOST_CC'] = CLANG_CC
|
724
|
+
env['HOST_CXX'] = CLANG_CPP
|
725
|
+
env['HOST_CFLAGS'] = "-W" #if set to nothing, CFLAGS is used, which we don't want
|
726
|
+
env['HOST_CXXFLAGS'] = "-W" #if set to nothing, CXXFLAGS is used, which we don't want
|
727
|
+
env['PKG_CONFIG_LIBDIR'] = path_from_root('system', 'local', 'lib', 'pkgconfig') + os.path.pathsep + path_from_root('system', 'lib', 'pkgconfig')
|
728
|
+
env['PKG_CONFIG_PATH'] = os.environ.get ('EM_PKG_CONFIG_PATH') or ''
|
729
|
+
env['EMSCRIPTEN'] = '1'
|
730
|
+
return env
|
731
|
+
|
732
|
+
@staticmethod
|
733
|
+
def handle_CMake_toolchain(args, env):
|
734
|
+
CMakeToolchain = ('''# the name of the target operating system
|
735
|
+
SET(CMAKE_SYSTEM_NAME Linux)
|
736
|
+
|
737
|
+
# which C and C++ compiler to use
|
738
|
+
SET(CMAKE_C_COMPILER %(winfix)s$EMSCRIPTEN_ROOT/emcc)
|
739
|
+
SET(CMAKE_CXX_COMPILER %(winfix)s$EMSCRIPTEN_ROOT/em++)
|
740
|
+
SET(CMAKE_AR %(winfix)s$EMSCRIPTEN_ROOT/emar)
|
741
|
+
SET(CMAKE_RANLIB %(winfix)s$EMSCRIPTEN_ROOT/emranlib)
|
742
|
+
SET(CMAKE_C_FLAGS $CFLAGS)
|
743
|
+
SET(CMAKE_CXX_FLAGS $CXXFLAGS)
|
744
|
+
|
745
|
+
# here is the target environment located
|
746
|
+
SET(CMAKE_FIND_ROOT_PATH $EMSCRIPTEN_ROOT/system/include )
|
747
|
+
|
748
|
+
# adjust the default behaviour of the FIND_XXX() commands:
|
749
|
+
# search headers and libraries in the target environment, search
|
750
|
+
# programs in the host environment
|
751
|
+
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
752
|
+
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
753
|
+
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
|
754
|
+
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)''' % { 'winfix': '' if not WINDOWS else 'python ' }) \
|
755
|
+
.replace('$EMSCRIPTEN_ROOT', path_from_root('').replace('\\', '/')) \
|
756
|
+
.replace('$CFLAGS', env['CFLAGS']) \
|
757
|
+
.replace('$CXXFLAGS', env['CFLAGS'])
|
758
|
+
toolchainFile = mkstemp(suffix='.cmaketoolchain.txt', dir=configuration.TEMP_DIR)[1]
|
759
|
+
open(toolchainFile, 'w').write(CMakeToolchain)
|
760
|
+
args.append('-DCMAKE_TOOLCHAIN_FILE=%s' % os.path.abspath(toolchainFile))
|
761
|
+
return args
|
762
|
+
|
763
|
+
@staticmethod
|
764
|
+
def configure(args, stdout=None, stderr=None, env=None):
|
765
|
+
if not args:
|
766
|
+
return
|
767
|
+
if env is None:
|
768
|
+
env = Building.get_building_env()
|
769
|
+
env['EMMAKEN_JUST_CONFIGURE'] = '1'
|
770
|
+
if 'cmake' in args[0]:
|
771
|
+
args = Building.handle_CMake_toolchain(args, env)
|
772
|
+
try:
|
773
|
+
process = Popen(args, stdout=stdout, stderr=stderr, env=env)
|
774
|
+
process.communicate()
|
775
|
+
except Exception, e:
|
776
|
+
logging.error('Exception thrown when invoking Popen in configure with args: "%s"!' % ' '.join(args))
|
777
|
+
raise
|
778
|
+
del env['EMMAKEN_JUST_CONFIGURE']
|
779
|
+
if process.returncode is not 0:
|
780
|
+
raise subprocess.CalledProcessError(cmd=args, returncode=process.returncode)
|
781
|
+
|
782
|
+
@staticmethod
|
783
|
+
def make(args, stdout=None, stderr=None, env=None):
|
784
|
+
if env is None:
|
785
|
+
env = Building.get_building_env()
|
786
|
+
if not args:
|
787
|
+
logging.error('Executable to run not specified.')
|
788
|
+
sys.exit(1)
|
789
|
+
#args += ['VERBOSE=1']
|
790
|
+
try:
|
791
|
+
process = Popen(args, stdout=stdout, stderr=stderr, env=env)
|
792
|
+
process.communicate()
|
793
|
+
except Exception, e:
|
794
|
+
logging.error('Exception thrown when invoking Popen in make with args: "%s"!' % ' '.join(args))
|
795
|
+
raise
|
796
|
+
if process.returncode is not 0:
|
797
|
+
raise subprocess.CalledProcessError(cmd=args, returncode=process.returncode)
|
798
|
+
|
799
|
+
|
800
|
+
@staticmethod
|
801
|
+
def build_library(name, build_dir, output_dir, generated_libs, configure=['sh', './configure'], configure_args=[], make=['make'], make_args=['-j', '2'], cache=None, cache_name=None, copy_project=False, env_init={}, source_dir=None, native=False):
|
802
|
+
''' Build a library into a .bc file. We build the .bc file once and cache it for all our tests. (We cache in
|
803
|
+
memory since the test directory is destroyed and recreated for each test. Note that we cache separately
|
804
|
+
for different compilers).
|
805
|
+
This cache is just during the test runner. There is a different concept of caching as well, see |Cache|. '''
|
806
|
+
|
807
|
+
if type(generated_libs) is not list: generated_libs = [generated_libs]
|
808
|
+
if source_dir is None: source_dir = path_from_root('tests', name.replace('_native', ''))
|
809
|
+
|
810
|
+
temp_dir = build_dir
|
811
|
+
if copy_project:
|
812
|
+
project_dir = os.path.join(temp_dir, name)
|
813
|
+
if os.path.exists(project_dir):
|
814
|
+
shutil.rmtree(project_dir)
|
815
|
+
shutil.copytree(source_dir, project_dir) # Useful in debugging sometimes to comment this out, and two lines above
|
816
|
+
else:
|
817
|
+
project_dir = build_dir
|
818
|
+
try:
|
819
|
+
old_dir = os.getcwd()
|
820
|
+
except:
|
821
|
+
old_dir = None
|
822
|
+
os.chdir(project_dir)
|
823
|
+
generated_libs = map(lambda lib: os.path.join(project_dir, lib), generated_libs)
|
824
|
+
#for lib in generated_libs:
|
825
|
+
# try:
|
826
|
+
# os.unlink(lib) # make sure compilation completed successfully
|
827
|
+
# except:
|
828
|
+
# pass
|
829
|
+
env = Building.get_building_env(native)
|
830
|
+
for k, v in env_init.iteritems():
|
831
|
+
env[k] = v
|
832
|
+
if configure: # Useful in debugging sometimes to comment this out (and the lines below up to and including the |link| call)
|
833
|
+
try:
|
834
|
+
Building.configure(configure + configure_args, stdout=open(os.path.join(project_dir, 'configure_'), 'w'),
|
835
|
+
stderr=open(os.path.join(project_dir, 'configure_err'), 'w'), env=env)
|
836
|
+
except subprocess.CalledProcessError, e:
|
837
|
+
pass # Ignore exit code != 0
|
838
|
+
def open_make_out(i, mode='r'):
|
839
|
+
return open(os.path.join(project_dir, 'make_' + str(i)), mode)
|
840
|
+
|
841
|
+
def open_make_err(i, mode='r'):
|
842
|
+
return open(os.path.join(project_dir, 'make_err' + str(i)), mode)
|
843
|
+
|
844
|
+
for i in range(2): # FIXME: Sad workaround for some build systems that need to be run twice to succeed (e.g. poppler)
|
845
|
+
with open_make_out(i, 'w') as make_out:
|
846
|
+
with open_make_err(i, 'w') as make_err:
|
847
|
+
try:
|
848
|
+
Building.make(make + make_args, stdout=make_out,
|
849
|
+
stderr=make_err, env=env)
|
850
|
+
except subprocess.CalledProcessError, e:
|
851
|
+
pass # Ignore exit code != 0
|
852
|
+
try:
|
853
|
+
if cache is not None:
|
854
|
+
cache[cache_name] = []
|
855
|
+
for f in generated_libs:
|
856
|
+
basename = os.path.basename(f)
|
857
|
+
cache[cache_name].append((basename, open(f, 'rb').read()))
|
858
|
+
break
|
859
|
+
except Exception, e:
|
860
|
+
if i > 0:
|
861
|
+
# Due to the ugly hack above our best guess is to output the first run
|
862
|
+
with open_make_err(0) as ferr:
|
863
|
+
for line in ferr:
|
864
|
+
sys.stderr.write(line)
|
865
|
+
raise Exception('could not build library ' + name + ' due to exception ' + str(e))
|
866
|
+
if old_dir:
|
867
|
+
os.chdir(old_dir)
|
868
|
+
return generated_libs
|
869
|
+
|
870
|
+
@staticmethod
|
871
|
+
def link(files, target, force_archive_contents=False):
|
872
|
+
actual_files = []
|
873
|
+
unresolved_symbols = set(['main']) # tracking unresolveds is necessary for .a linking, see below. (and main is always a necessary symbol)
|
874
|
+
resolved_symbols = set()
|
875
|
+
temp_dirs = []
|
876
|
+
files = map(os.path.abspath, files)
|
877
|
+
has_ar = False
|
878
|
+
for f in files:
|
879
|
+
has_ar = has_ar or Building.is_ar(f)
|
880
|
+
for f in files:
|
881
|
+
if not Building.is_ar(f):
|
882
|
+
if Building.is_bitcode(f):
|
883
|
+
if has_ar:
|
884
|
+
new_symbols = Building.llvm_nm(f)
|
885
|
+
resolved_symbols = resolved_symbols.union(new_symbols.defs)
|
886
|
+
unresolved_symbols = unresolved_symbols.union(new_symbols.undefs.difference(resolved_symbols)).difference(new_symbols.defs)
|
887
|
+
actual_files.append(f)
|
888
|
+
else:
|
889
|
+
# Extract object files from ar archives, and link according to gnu ld semantics
|
890
|
+
# (link in an entire .o from the archive if it supplies symbols still unresolved)
|
891
|
+
cwd = os.getcwd()
|
892
|
+
try:
|
893
|
+
temp_dir = os.path.join(EMSCRIPTEN_TEMP_DIR, 'ar_output_' + str(os.getpid()) + '_' + str(len(temp_dirs)))
|
894
|
+
temp_dirs.append(temp_dir)
|
895
|
+
if not os.path.exists(temp_dir):
|
896
|
+
os.makedirs(temp_dir)
|
897
|
+
os.chdir(temp_dir)
|
898
|
+
contents = filter(lambda x: len(x) > 0, Popen([LLVM_AR, 't', f], stdout=PIPE).communicate()[0].split('\n'))
|
899
|
+
#print >> sys.stderr, ' considering archive', f, ':', contents
|
900
|
+
if len(contents) == 0:
|
901
|
+
logging.debug('Archive %s appears to be empty (recommendation: link an .so instead of .a)' % f)
|
902
|
+
else:
|
903
|
+
for content in contents: # ar will silently fail if the directory for the file does not exist, so make all the necessary directories
|
904
|
+
dirname = os.path.dirname(content)
|
905
|
+
if dirname and not os.path.exists(dirname):
|
906
|
+
os.makedirs(dirname)
|
907
|
+
Popen([LLVM_AR, 'x', f], stdout=PIPE).communicate() # if absolute paths, files will appear there. otherwise, in this directory
|
908
|
+
contents = map(lambda content: os.path.join(temp_dir, content), contents)
|
909
|
+
contents = filter(os.path.exists, map(os.path.abspath, contents))
|
910
|
+
added_contents = set()
|
911
|
+
added = True
|
912
|
+
#print >> sys.stderr, ' initial undef are now ', unresolved_symbols, '\n'
|
913
|
+
while added: # recursively traverse until we have everything we need
|
914
|
+
#print >> sys.stderr, ' running loop of archive including for', f
|
915
|
+
added = False
|
916
|
+
for content in contents:
|
917
|
+
if content in added_contents: continue
|
918
|
+
new_symbols = Building.llvm_nm(content)
|
919
|
+
# Link in the .o if it provides symbols, *or* this is a singleton archive (which is apparently an exception in gcc ld)
|
920
|
+
#print >> sys.stderr, 'need', content, '?', unresolved_symbols, 'and we can supply', new_symbols.defs
|
921
|
+
#print >> sys.stderr, content, 'DEF', new_symbols.defs, '\n'
|
922
|
+
if new_symbols.defs.intersection(unresolved_symbols) or len(files) == 1 or force_archive_contents:
|
923
|
+
if Building.is_bitcode(content):
|
924
|
+
#print >> sys.stderr, ' adding object', content, '\n'
|
925
|
+
resolved_symbols = resolved_symbols.union(new_symbols.defs)
|
926
|
+
unresolved_symbols = unresolved_symbols.union(new_symbols.undefs.difference(resolved_symbols)).difference(new_symbols.defs)
|
927
|
+
#print >> sys.stderr, ' undef are now ', unresolved_symbols, '\n'
|
928
|
+
actual_files.append(content)
|
929
|
+
added_contents.add(content)
|
930
|
+
added = True
|
931
|
+
#print >> sys.stderr, ' done running loop of archive including for', f
|
932
|
+
finally:
|
933
|
+
os.chdir(cwd)
|
934
|
+
try_delete(target)
|
935
|
+
|
936
|
+
# Finish link
|
937
|
+
actual_files = unique_ordered(actual_files) # tolerate people trying to link a.so a.so etc.
|
938
|
+
logging.debug('emcc: llvm-linking: %s to %s', actual_files, target)
|
939
|
+
|
940
|
+
# check for too-long command line
|
941
|
+
link_cmd = [LLVM_LINK] + actual_files + ['-o', target]
|
942
|
+
# 8k is a bit of an arbitrary limit, but a reasonable one
|
943
|
+
# for max command line size before we use a respose file
|
944
|
+
response_file = None
|
945
|
+
if WINDOWS and len(' '.join(link_cmd)) > 8192:
|
946
|
+
logging.debug('using response file for llvm-link')
|
947
|
+
[response_fd, response_file] = mkstemp(suffix='.response', dir=TEMP_DIR)
|
948
|
+
|
949
|
+
link_cmd = [LLVM_LINK, "@" + response_file]
|
950
|
+
|
951
|
+
response_fh = os.fdopen(response_fd, 'w')
|
952
|
+
for arg in actual_files:
|
953
|
+
# we can't put things with spaces in the response file
|
954
|
+
if " " in arg:
|
955
|
+
link_cmd.append(arg)
|
956
|
+
else:
|
957
|
+
response_fh.write(arg + "\n")
|
958
|
+
response_fh.close()
|
959
|
+
link_cmd.append("-o")
|
960
|
+
link_cmd.append(target)
|
961
|
+
|
962
|
+
if len(' '.join(link_cmd)) > 8192:
|
963
|
+
logging.warning('emcc: link command line is very long, even with response file -- use paths with no spaces')
|
964
|
+
|
965
|
+
output = Popen(link_cmd, stdout=PIPE).communicate()[0]
|
966
|
+
|
967
|
+
if response_file:
|
968
|
+
os.unlink(response_file)
|
969
|
+
|
970
|
+
assert os.path.exists(target) and (output is None or 'Could not open input file' not in output), 'Linking error: ' + output
|
971
|
+
for temp_dir in temp_dirs:
|
972
|
+
try_delete(temp_dir)
|
973
|
+
|
974
|
+
# Emscripten optimizations that we run on the .ll file
|
975
|
+
@staticmethod
|
976
|
+
def ll_opts(filename):
|
977
|
+
## Remove target info. This helps LLVM opts, if we run them later
|
978
|
+
#cleaned = filter(lambda line: not line.startswith('target datalayout = ') and not line.startswith('target triple = '),
|
979
|
+
# open(filename + '.o.ll', 'r').readlines())
|
980
|
+
#os.unlink(filename + '.o.ll')
|
981
|
+
#open(filename + '.o.ll.orig', 'w').write(''.join(cleaned))
|
982
|
+
pass
|
983
|
+
|
984
|
+
# LLVM optimizations
|
985
|
+
# @param opt Either an integer, in which case it is the optimization level (-O1, -O2, etc.), or a list of raw
|
986
|
+
# optimization passes passed to llvm opt
|
987
|
+
@staticmethod
|
988
|
+
def llvm_opt(filename, opts):
|
989
|
+
if type(opts) is int:
|
990
|
+
opts = Building.pick_llvm_opts(opts)
|
991
|
+
#opts += ['-debug-pass=Arguments']
|
992
|
+
logging.debug('emcc: LLVM opts: ' + str(opts))
|
993
|
+
output = Popen([LLVM_OPT, filename] + opts + ['-o=' + filename + '.opt.bc'], stdout=PIPE).communicate()[0]
|
994
|
+
assert os.path.exists(filename + '.opt.bc'), 'Failed to run llvm optimizations: ' + output
|
995
|
+
shutil.move(filename + '.opt.bc', filename)
|
996
|
+
|
997
|
+
@staticmethod
|
998
|
+
def llvm_opts(filename): # deprecated version, only for test runner. TODO: remove
|
999
|
+
if Building.LLVM_OPTS:
|
1000
|
+
shutil.move(filename + '.o', filename + '.o.pre')
|
1001
|
+
output = Popen([LLVM_OPT, filename + '.o.pre'] + Building.LLVM_OPT_OPTS + ['-o=' + filename + '.o'], stdout=PIPE).communicate()[0]
|
1002
|
+
assert os.path.exists(filename + '.o'), 'Failed to run llvm optimizations: ' + output
|
1003
|
+
|
1004
|
+
@staticmethod
|
1005
|
+
def llvm_dis(input_filename, output_filename=None):
|
1006
|
+
# LLVM binary ==> LLVM assembly
|
1007
|
+
if output_filename is None:
|
1008
|
+
# use test runner conventions
|
1009
|
+
output_filename = input_filename + '.o.ll'
|
1010
|
+
input_filename = input_filename + '.o'
|
1011
|
+
try_delete(output_filename)
|
1012
|
+
output = Popen([LLVM_DIS, input_filename, '-o=' + output_filename], stdout=PIPE).communicate()[0]
|
1013
|
+
assert os.path.exists(output_filename), 'Could not create .ll file: ' + output
|
1014
|
+
return output_filename
|
1015
|
+
|
1016
|
+
@staticmethod
|
1017
|
+
def llvm_as(input_filename, output_filename=None):
|
1018
|
+
# LLVM assembly ==> LLVM binary
|
1019
|
+
if output_filename is None:
|
1020
|
+
# use test runner conventions
|
1021
|
+
output_filename = input_filename + '.o'
|
1022
|
+
input_filename = input_filename + '.o.ll'
|
1023
|
+
try_delete(output_filename)
|
1024
|
+
output = Popen([LLVM_AS, input_filename, '-o=' + output_filename], stdout=PIPE).communicate()[0]
|
1025
|
+
assert os.path.exists(output_filename), 'Could not create bc file: ' + output
|
1026
|
+
return output_filename
|
1027
|
+
|
1028
|
+
nm_cache = {} # cache results of nm - it can be slow to run
|
1029
|
+
|
1030
|
+
@staticmethod
|
1031
|
+
def llvm_nm(filename, stdout=PIPE, stderr=None):
|
1032
|
+
if filename in Building.nm_cache:
|
1033
|
+
#logging.debug('loading nm results for %s from cache' % filename)
|
1034
|
+
return Building.nm_cache[filename]
|
1035
|
+
|
1036
|
+
# LLVM binary ==> list of symbols
|
1037
|
+
output = Popen([LLVM_NM, filename], stdout=stdout, stderr=stderr).communicate()[0]
|
1038
|
+
class ret:
|
1039
|
+
defs = []
|
1040
|
+
undefs = []
|
1041
|
+
commons = []
|
1042
|
+
for line in output.split('\n'):
|
1043
|
+
if len(line) == 0: continue
|
1044
|
+
parts = filter(lambda seg: len(seg) > 0, line.split(' '))
|
1045
|
+
if len(parts) == 2: # ignore lines with absolute offsets, these are not bitcode anyhow (e.g. |00000630 t d_source_name|)
|
1046
|
+
status, symbol = parts
|
1047
|
+
if status == 'U':
|
1048
|
+
ret.undefs.append(symbol)
|
1049
|
+
elif status != 'C':
|
1050
|
+
ret.defs.append(symbol)
|
1051
|
+
else:
|
1052
|
+
ret.commons.append(symbol)
|
1053
|
+
ret.defs = set(ret.defs)
|
1054
|
+
ret.undefs = set(ret.undefs)
|
1055
|
+
ret.commons = set(ret.commons)
|
1056
|
+
Building.nm_cache[filename] = ret
|
1057
|
+
return ret
|
1058
|
+
|
1059
|
+
@staticmethod
|
1060
|
+
def emcc(filename, args=[], output_filename=None, stdout=None, stderr=None, env=None):
|
1061
|
+
if output_filename is None:
|
1062
|
+
output_filename = filename + '.o'
|
1063
|
+
try_delete(output_filename)
|
1064
|
+
Popen([PYTHON, EMCC, filename] + args + ['-o', output_filename], stdout=stdout, stderr=stderr, env=env).communicate()
|
1065
|
+
assert os.path.exists(output_filename), 'emcc could not create output file: ' + output_filename
|
1066
|
+
|
1067
|
+
@staticmethod
|
1068
|
+
def emar(action, output_filename, filenames, stdout=None, stderr=None, env=None):
|
1069
|
+
try_delete(output_filename)
|
1070
|
+
Popen([PYTHON, EMAR, action, output_filename] + filenames, stdout=stdout, stderr=stderr, env=env).communicate()
|
1071
|
+
if 'c' in action:
|
1072
|
+
assert os.path.exists(output_filename), 'emar could not create output file: ' + output_filename
|
1073
|
+
|
1074
|
+
@staticmethod
|
1075
|
+
def emscripten(filename, append_ext=True, extra_args=[]):
|
1076
|
+
# Allow usage of emscripten.py without warning
|
1077
|
+
os.environ['EMSCRIPTEN_SUPPRESS_USAGE_WARNING'] = '1'
|
1078
|
+
|
1079
|
+
# Run Emscripten
|
1080
|
+
Settings.RELOOPER = Cache.get_path('relooper.js')
|
1081
|
+
settings = Settings.serialize()
|
1082
|
+
compiler_output = jsrun.timeout_run(Popen([PYTHON, EMSCRIPTEN, filename + ('.o.ll' if append_ext else ''), '-o', filename + '.o.js'] + settings + extra_args, stdout=PIPE), None, 'Compiling')
|
1083
|
+
#print compiler_output
|
1084
|
+
|
1085
|
+
# Detect compilation crashes and errors
|
1086
|
+
if compiler_output is not None and 'Traceback' in compiler_output and 'in test_' in compiler_output: print compiler_output; assert 0
|
1087
|
+
assert os.path.exists(filename + '.o.js') and len(open(filename + '.o.js', 'r').read()) > 0, 'Emscripten failed to generate .js: ' + str(compiler_output)
|
1088
|
+
|
1089
|
+
return filename + '.o.js'
|
1090
|
+
|
1091
|
+
@staticmethod
|
1092
|
+
def can_build_standalone():
|
1093
|
+
return not Settings.BUILD_AS_SHARED_LIB and not Settings.LINKABLE and not Settings.EXPORT_ALL
|
1094
|
+
|
1095
|
+
@staticmethod
|
1096
|
+
def can_use_unsafe_opts():
|
1097
|
+
return Settings.USE_TYPED_ARRAYS == 2
|
1098
|
+
|
1099
|
+
@staticmethod
|
1100
|
+
def can_inline():
|
1101
|
+
return Settings.INLINING_LIMIT == 0
|
1102
|
+
|
1103
|
+
@staticmethod
|
1104
|
+
def get_safe_internalize():
|
1105
|
+
if not Building.can_build_standalone(): return [] # do not internalize anything
|
1106
|
+
exps = expand_response(Settings.EXPORTED_FUNCTIONS)
|
1107
|
+
if '_malloc' not in exps: exps.append('_malloc') # needed internally, even if user did not add to EXPORTED_FUNCTIONS
|
1108
|
+
if '_free' not in exps: exps.append('_free')
|
1109
|
+
exports = ','.join(map(lambda exp: exp[1:], exps))
|
1110
|
+
# internalize carefully, llvm 3.2 will remove even main if not told not to
|
1111
|
+
return ['-internalize', '-internalize-public-api-list=' + exports]
|
1112
|
+
|
1113
|
+
@staticmethod
|
1114
|
+
def pick_llvm_opts(optimization_level):
|
1115
|
+
'''
|
1116
|
+
It may be safe to use nonportable optimizations (like -OX) if we remove the platform info from the .ll
|
1117
|
+
(which we do in do_ll_opts) - but even there we have issues (even in TA2) with instruction combining
|
1118
|
+
into i64s. In any case, the handpicked ones here should be safe and portable. They are also tuned for
|
1119
|
+
things that look useful.
|
1120
|
+
|
1121
|
+
An easy way to see LLVM's standard list of passes is
|
1122
|
+
|
1123
|
+
llvm-as < /dev/null | opt -std-compile-opts -disable-output -debug-pass=Arguments
|
1124
|
+
'''
|
1125
|
+
assert 0 <= optimization_level <= 3
|
1126
|
+
unsafe = Building.can_use_unsafe_opts()
|
1127
|
+
opts = []
|
1128
|
+
if optimization_level > 0:
|
1129
|
+
if unsafe:
|
1130
|
+
if not Building.can_inline():
|
1131
|
+
opts.append('-disable-inlining')
|
1132
|
+
if not Building.can_build_standalone():
|
1133
|
+
# -O1 does not have -gobaldce, which removes stuff that is needed for libraries and linkables
|
1134
|
+
optimization_level = min(1, optimization_level)
|
1135
|
+
opts.append('-O%d' % optimization_level)
|
1136
|
+
#print '[unsafe: %s]' % ','.join(opts)
|
1137
|
+
else:
|
1138
|
+
allow_nonportable = False
|
1139
|
+
optimize_size = True
|
1140
|
+
use_aa = False
|
1141
|
+
|
1142
|
+
# PassManagerBuilder::populateModulePassManager
|
1143
|
+
if allow_nonportable and use_aa: # ammo.js results indicate this can be nonportable
|
1144
|
+
opts.append('-tbaa')
|
1145
|
+
opts.append('-basicaa') # makes fannkuch slow but primes fast
|
1146
|
+
|
1147
|
+
if Building.can_build_standalone():
|
1148
|
+
opts += Building.get_safe_internalize()
|
1149
|
+
|
1150
|
+
opts.append('-globalopt')
|
1151
|
+
opts.append('-ipsccp')
|
1152
|
+
opts.append('-deadargelim')
|
1153
|
+
if allow_nonportable: opts.append('-instcombine')
|
1154
|
+
opts.append('-simplifycfg')
|
1155
|
+
|
1156
|
+
opts.append('-prune-eh')
|
1157
|
+
if Building.can_inline(): opts.append('-inline')
|
1158
|
+
opts.append('-functionattrs')
|
1159
|
+
if optimization_level > 2:
|
1160
|
+
opts.append('-argpromotion')
|
1161
|
+
|
1162
|
+
# XXX Danger: Can turn a memcpy into something that violates the
|
1163
|
+
# load-store consistency hypothesis. See hashnum() in Lua.
|
1164
|
+
# Note: this opt is of great importance for raytrace...
|
1165
|
+
if allow_nonportable: opts.append('-scalarrepl')
|
1166
|
+
|
1167
|
+
if allow_nonportable: opts.append('-early-cse') # ?
|
1168
|
+
opts.append('-simplify-libcalls')
|
1169
|
+
opts.append('-jump-threading')
|
1170
|
+
if allow_nonportable: opts.append('-correlated-propagation') # ?
|
1171
|
+
opts.append('-simplifycfg')
|
1172
|
+
if allow_nonportable: opts.append('-instcombine')
|
1173
|
+
|
1174
|
+
opts.append('-tailcallelim')
|
1175
|
+
opts.append('-simplifycfg')
|
1176
|
+
opts.append('-reassociate')
|
1177
|
+
opts.append('-loop-rotate')
|
1178
|
+
opts.append('-licm')
|
1179
|
+
opts.append('-loop-unswitch') # XXX should depend on optimize_size
|
1180
|
+
if allow_nonportable: opts.append('-instcombine')
|
1181
|
+
if Settings.QUANTUM_SIZE == 4: opts.append('-indvars') # XXX this infinite-loops raytrace on q1 (loop in |new node_t[count]| has 68 hardcoded ¬ fixed)
|
1182
|
+
if allow_nonportable: opts.append('-loop-idiom') # ?
|
1183
|
+
opts.append('-loop-deletion')
|
1184
|
+
opts.append('-loop-unroll')
|
1185
|
+
|
1186
|
+
##### not in llvm-3.0. but have | #addExtensionsToPM(EP_LoopOptimizerEnd, MPM);| if allow_nonportable: opts.append('-instcombine')
|
1187
|
+
|
1188
|
+
# XXX Danger: Messes up Lua output for unknown reasons
|
1189
|
+
# Note: this opt is of minor importance for raytrace...
|
1190
|
+
if optimization_level > 1 and allow_nonportable: opts.append('-gvn')
|
1191
|
+
|
1192
|
+
opts.append('-memcpyopt') # Danger?
|
1193
|
+
opts.append('-sccp')
|
1194
|
+
|
1195
|
+
if allow_nonportable: opts.append('-instcombine')
|
1196
|
+
opts.append('-jump-threading')
|
1197
|
+
opts.append('-correlated-propagation')
|
1198
|
+
opts.append('-dse')
|
1199
|
+
#addExtensionsToPM(EP_ScalarOptimizerLate, MPM)
|
1200
|
+
|
1201
|
+
opts.append('-adce')
|
1202
|
+
opts.append('-simplifycfg')
|
1203
|
+
if allow_nonportable: opts.append('-instcombine')
|
1204
|
+
|
1205
|
+
opts.append('-strip-dead-prototypes')
|
1206
|
+
|
1207
|
+
if Building.can_build_standalone():
|
1208
|
+
opts.append('-globaldce')
|
1209
|
+
|
1210
|
+
if optimization_level > 1: opts.append('-constmerge')
|
1211
|
+
|
1212
|
+
Building.LLVM_OPT_OPTS = opts
|
1213
|
+
return opts
|
1214
|
+
|
1215
|
+
@staticmethod
|
1216
|
+
def js_optimizer(filename, passes, jcache=False, debug=False, extra_info=None):
|
1217
|
+
return js_optimizer.run(filename, passes, listify(NODE_JS), jcache, debug, extra_info)
|
1218
|
+
|
1219
|
+
@staticmethod
|
1220
|
+
def closure_compiler(filename, pretty=True):
|
1221
|
+
if not os.path.exists(CLOSURE_COMPILER):
|
1222
|
+
raise Exception('Closure compiler appears to be missing, looked at: ' + str(CLOSURE_COMPILER))
|
1223
|
+
|
1224
|
+
# Something like this (adjust memory as needed):
|
1225
|
+
# java -Xmx1024m -jar CLOSURE_COMPILER --compilation_level ADVANCED_OPTIMIZATIONS --variable_map_output_file src.cpp.o.js.vars --js src.cpp.o.js --js_output_file src.cpp.o.cc.js
|
1226
|
+
args = [JAVA,
|
1227
|
+
'-Xmx' + (os.environ.get('JAVA_HEAP_SIZE') or '1024m'), # if you need a larger Java heap, use this environment variable
|
1228
|
+
'-jar', CLOSURE_COMPILER,
|
1229
|
+
'--compilation_level', 'ADVANCED_OPTIMIZATIONS',
|
1230
|
+
'--language_in', 'ECMASCRIPT5',
|
1231
|
+
#'--variable_map_output_file', filename + '.vars',
|
1232
|
+
'--js', filename, '--js_output_file', filename + '.cc.js']
|
1233
|
+
if pretty: args += ['--formatting', 'PRETTY_PRINT']
|
1234
|
+
if os.environ.get('EMCC_CLOSURE_ARGS'):
|
1235
|
+
args += shlex.split(os.environ.get('EMCC_CLOSURE_ARGS'))
|
1236
|
+
process = Popen(args, stdout=PIPE, stderr=STDOUT)
|
1237
|
+
cc_output = process.communicate()[0]
|
1238
|
+
if process.returncode != 0 or not os.path.exists(filename + '.cc.js'):
|
1239
|
+
raise Exception('closure compiler error: ' + cc_output + ' (rc: %d)' % process.returncode)
|
1240
|
+
|
1241
|
+
return filename + '.cc.js'
|
1242
|
+
|
1243
|
+
_is_ar_cache = {}
|
1244
|
+
@staticmethod
|
1245
|
+
def is_ar(filename):
|
1246
|
+
try:
|
1247
|
+
if Building._is_ar_cache.get(filename):
|
1248
|
+
return Building._is_ar_cache[filename]
|
1249
|
+
b = open(filename, 'r').read(8)
|
1250
|
+
sigcheck = b[0] == '!' and b[1] == '<' and \
|
1251
|
+
b[2] == 'a' and b[3] == 'r' and \
|
1252
|
+
b[4] == 'c' and b[5] == 'h' and \
|
1253
|
+
b[6] == '>' and ord(b[7]) == 10
|
1254
|
+
Building._is_ar_cache[filename] = sigcheck
|
1255
|
+
return sigcheck
|
1256
|
+
except Exception, e:
|
1257
|
+
logging.debug('Building.is_ar failed to test whether file \'%s\' is a llvm archive file! Failed on exception: %s' % (filename, e))
|
1258
|
+
return False
|
1259
|
+
|
1260
|
+
@staticmethod
|
1261
|
+
def is_bitcode(filename):
|
1262
|
+
# look for magic signature
|
1263
|
+
b = open(filename, 'r').read(4)
|
1264
|
+
if b[0] == 'B' and b[1] == 'C':
|
1265
|
+
return True
|
1266
|
+
# look for ar signature
|
1267
|
+
elif Building.is_ar(filename):
|
1268
|
+
return True
|
1269
|
+
# on OS X, there is a 20-byte prefix
|
1270
|
+
elif ord(b[0]) == 222 and ord(b[1]) == 192 and ord(b[2]) == 23 and ord(b[3]) == 11:
|
1271
|
+
b = open(filename, 'r').read(24)
|
1272
|
+
return b[20] == 'B' and b[21] == 'C'
|
1273
|
+
|
1274
|
+
return False
|
1275
|
+
|
1276
|
+
# Make sure the relooper exists. If it does not, check out the relooper code and bootstrap it
|
1277
|
+
@staticmethod
|
1278
|
+
def ensure_relooper(relooper):
|
1279
|
+
if os.path.exists(relooper): return
|
1280
|
+
Cache.ensure()
|
1281
|
+
curr = os.getcwd()
|
1282
|
+
try:
|
1283
|
+
ok = False
|
1284
|
+
logging.info('=======================================')
|
1285
|
+
logging.info('bootstrapping relooper...')
|
1286
|
+
os.chdir(path_from_root('src'))
|
1287
|
+
|
1288
|
+
emcc_debug = os.environ.get('EMCC_DEBUG')
|
1289
|
+
if emcc_debug: del os.environ['EMCC_DEBUG']
|
1290
|
+
|
1291
|
+
def make(opt_level):
|
1292
|
+
raw = relooper + '.raw.js'
|
1293
|
+
Building.emcc(os.path.join('relooper', 'Relooper.cpp'), ['-I' + os.path.join('relooper'), '--post-js',
|
1294
|
+
os.path.join('relooper', 'emscripten', 'glue.js'),
|
1295
|
+
'--memory-init-file', '0',
|
1296
|
+
'-s', 'TOTAL_MEMORY=67108864',
|
1297
|
+
'-s', 'EXPORTED_FUNCTIONS=["_rl_set_output_buffer","_rl_make_output_buffer","_rl_new_block","_rl_delete_block","_rl_block_add_branch_to","_rl_new_relooper","_rl_delete_relooper","_rl_relooper_add_block","_rl_relooper_calculate","_rl_relooper_render", "_rl_set_asm_js_mode"]',
|
1298
|
+
'-s', 'DEFAULT_LIBRARY_FUNCS_TO_INCLUDE=["memcpy", "memset", "malloc", "free", "puts"]',
|
1299
|
+
'-s', 'RELOOPER="' + relooper + '"',
|
1300
|
+
'-O' + str(opt_level), '--closure', '0'], raw)
|
1301
|
+
f = open(relooper, 'w')
|
1302
|
+
f.write("// Relooper, (C) 2012 Alon Zakai, MIT license, https://github.com/kripken/Relooper\n")
|
1303
|
+
f.write("var Relooper = (function() {\n")
|
1304
|
+
f.write(open(raw).read())
|
1305
|
+
f.write('\n return Module.Relooper;\n')
|
1306
|
+
f.write('})();\n')
|
1307
|
+
f.close()
|
1308
|
+
|
1309
|
+
# bootstrap phase 1: generate unrelooped relooper, for which we do not need a relooper (so we cannot recurse infinitely in this function)
|
1310
|
+
logging.info(' bootstrap phase 1')
|
1311
|
+
make(1)
|
1312
|
+
# bootstrap phase 2: generate relooped relooper, using the unrelooped relooper (we see relooper.js exists so we cannot recurse infinitely in this function)
|
1313
|
+
logging.info(' bootstrap phase 2')
|
1314
|
+
make(2)
|
1315
|
+
logging.info('bootstrapping relooper succeeded')
|
1316
|
+
logging.info('=======================================')
|
1317
|
+
ok = True
|
1318
|
+
finally:
|
1319
|
+
os.chdir(curr)
|
1320
|
+
if emcc_debug: os.environ['EMCC_DEBUG'] = emcc_debug
|
1321
|
+
if not ok:
|
1322
|
+
logging.error('bootstrapping relooper failed. You may need to manually create relooper.js by compiling it, see src/relooper/emscripten')
|
1323
|
+
1/0
|
1324
|
+
|
1325
|
+
@staticmethod
|
1326
|
+
def preprocess(infile, outfile):
|
1327
|
+
'''
|
1328
|
+
Preprocess source C/C++ in some special ways that emscripten needs. Returns
|
1329
|
+
a filename (potentially the same one if nothing was changed).
|
1330
|
+
|
1331
|
+
Currently this only does emscripten_jcache_printf(..) rewriting.
|
1332
|
+
'''
|
1333
|
+
src = open(infile).read() # stack warning on jcacheprintf! in docs # add jcache printf test separatrely, for content of printf
|
1334
|
+
if 'emscripten_jcache_printf' not in src: return infile
|
1335
|
+
def fix(m):
|
1336
|
+
text = m.groups(0)[0]
|
1337
|
+
assert text.count('(') == 1 and text.count(')') == 1, 'must have simple expressions in emscripten_jcache_printf calls, no parens'
|
1338
|
+
assert text.count('"') == 2, 'must have simple expressions in emscripten_jcache_printf calls, no strings as varargs parameters'
|
1339
|
+
start = text.index('(')
|
1340
|
+
end = text.rindex(')')
|
1341
|
+
args = text[start+1:end].split(',')
|
1342
|
+
args = map(lambda x: x.strip(), args)
|
1343
|
+
if args[0][0] == '"':
|
1344
|
+
# flatten out
|
1345
|
+
args = map(lambda x: str(ord(x)), args[0][1:len(args[0])-1]) + ['0'] + args[1:]
|
1346
|
+
return 'emscripten_jcache_printf_(' + ','.join(args) + ')'
|
1347
|
+
src = re.sub(r'(emscripten_jcache_printf\([^)]+\))', lambda m: fix(m), src)
|
1348
|
+
open(outfile, 'w').write(src)
|
1349
|
+
return outfile
|
1350
|
+
|
1351
|
+
# compatibility with existing emcc, etc. scripts
|
1352
|
+
Cache = cache.Cache(debug=DEBUG_CACHE)
|
1353
|
+
JCache = cache.JCache(Cache)
|
1354
|
+
chunkify = cache.chunkify
|
1355
|
+
|
1356
|
+
class JS:
|
1357
|
+
memory_initializer_pattern = '/\* memory initializer \*/ allocate\(([\d,\.concat\(\)\[\]\\n ]+)"i8", ALLOC_NONE, ([\dRuntime\.GLOBAL_BASE+]+)\)'
|
1358
|
+
no_memory_initializer_pattern = '/\* no memory initializer \*/'
|
1359
|
+
|
1360
|
+
memory_staticbump_pattern = 'STATICTOP = STATIC_BASE \+ (\d+);'
|
1361
|
+
|
1362
|
+
global_initializers_pattern = '/\* global initializers \*/ __ATINIT__.push\((.+)\);'
|
1363
|
+
|
1364
|
+
@staticmethod
|
1365
|
+
def to_nice_ident(ident): # limited version of the JS function toNiceIdent
|
1366
|
+
return ident.replace('%', '$').replace('@', '_')
|
1367
|
+
|
1368
|
+
@staticmethod
|
1369
|
+
def make_invoke(sig, named=True):
|
1370
|
+
args = ','.join(['a' + str(i) for i in range(1, len(sig))])
|
1371
|
+
args = 'index' + (',' if args else '') + args
|
1372
|
+
# C++ exceptions are numbers, and longjmp is a string 'longjmp'
|
1373
|
+
return '''function%s(%s) {
|
1374
|
+
try {
|
1375
|
+
%sModule["dynCall_%s"](%s);
|
1376
|
+
} catch(e) {
|
1377
|
+
if (typeof e !== 'number' && e !== 'longjmp') throw e;
|
1378
|
+
asm["setThrew"](1, 0);
|
1379
|
+
}
|
1380
|
+
}''' % ((' invoke_' + sig) if named else '', args, 'return ' if sig[0] != 'v' else '', sig, args)
|
1381
|
+
|
1382
|
+
@staticmethod
|
1383
|
+
def align(x, by):
|
1384
|
+
while x % by != 0: x += 1
|
1385
|
+
return x
|
1386
|
+
|
1387
|
+
# Compression of code and data for smaller downloads
|
1388
|
+
class Compression:
|
1389
|
+
on = False
|
1390
|
+
|
1391
|
+
@staticmethod
|
1392
|
+
def compressed_name(filename):
|
1393
|
+
return filename + '.compress'
|
1394
|
+
|
1395
|
+
@staticmethod
|
1396
|
+
def compress(filename):
|
1397
|
+
execute(Compression.encoder, stdin=open(filename, 'rb'), stdout=open(Compression.compressed_name(filename), 'wb'))
|
1398
|
+
|
1399
|
+
@staticmethod
|
1400
|
+
def worth_it(original, compressed):
|
1401
|
+
return compressed < original - 1500 # save at least one TCP packet or so
|
1402
|
+
|
1403
|
+
def execute(cmd, *args, **kw):
|
1404
|
+
try:
|
1405
|
+
return Popen(cmd, *args, **kw).communicate() # let compiler frontend print directly, so colors are saved (PIPE kills that)
|
1406
|
+
except:
|
1407
|
+
if not isinstance(cmd, str):
|
1408
|
+
cmd = ' '.join(cmd)
|
1409
|
+
logging.error('Invoking Process failed: <<< ' + cmd + ' >>>')
|
1410
|
+
raise
|
1411
|
+
|
1412
|
+
def check_execute(cmd, *args, **kw):
|
1413
|
+
# TODO: use in more places. execute doesn't actually check that return values
|
1414
|
+
# are nonzero
|
1415
|
+
try:
|
1416
|
+
kw['stderr'] = STDOUT
|
1417
|
+
subprocess.check_output(cmd, *args, **kw)
|
1418
|
+
logging.debug("Successfuly executed %s" % " ".join(cmd))
|
1419
|
+
except subprocess.CalledProcessError as e:
|
1420
|
+
logging.error("'%s' failed with output:\n%s" % (" ".join(e.cmd), e.output))
|
1421
|
+
raise
|
1422
|
+
|
1423
|
+
def suffix(name):
|
1424
|
+
parts = name.split('.')
|
1425
|
+
if len(parts) > 1:
|
1426
|
+
return parts[-1]
|
1427
|
+
else:
|
1428
|
+
return None
|
1429
|
+
|
1430
|
+
def unsuffixed(name):
|
1431
|
+
return '.'.join(name.split('.')[:-1])
|
1432
|
+
|
1433
|
+
def unsuffixed_basename(name):
|
1434
|
+
return os.path.basename(unsuffixed(name))
|
1435
|
+
|
1436
|
+
import js_optimizer
|
1437
|
+
|