Граф коммитов

933 Коммитов

Автор SHA1 Сообщение Дата
Alon Zakai 3282559735 Merge branch 'incoming' into musl-syscall
Conflicts:
	emcc
	src/deps_info.json
	src/library.js
	system/lib/libc/musl/arch/emscripten/atomic.h
	system/lib/libc/musl/src/internal/pthread_impl.h
	system/lib/libc/musl/src/thread/__timedwait.c
	system/lib/libc/musl/src/thread/__wait.c
	system/lib/libc/musl/src/thread/pthread_attr_get.c
	system/lib/libc/musl/src/thread/pthread_attr_setschedpolicy.c
	system/lib/libc/musl/src/thread/pthread_barrier_wait.c
	system/lib/libc/musl/src/thread/pthread_cond_broadcast.c
	system/lib/libc/musl/src/thread/pthread_cond_timedwait.c
	system/lib/libc/musl/src/thread/pthread_condattr_setpshared.c
	system/lib/libc/musl/src/thread/pthread_getspecific.c
	system/lib/libc/musl/src/thread/pthread_key_create.c
	system/lib/libc/musl/src/thread/pthread_mutex_trylock.c
	system/lib/libc/musl/src/thread/pthread_once.c
	system/lib/libc/musl/src/thread/pthread_rwlock_timedwrlock.c
	system/lib/libc/musl/src/thread/pthread_rwlock_trywrlock.c
	system/lib/libc/musl/src/thread/pthread_rwlock_unlock.c
	system/lib/libc/musl/src/thread/pthread_setspecific.c
	system/lib/libc/musl/src/thread/sem_timedwait.c
	tests/test_browser.py
	tests/test_other.py
	tools/gen_struct_info.py
	tools/system_libs.py
2015-07-08 13:57:24 -07:00
Alon Zakai 7646de8540 return an error code when no input files to emcc 2015-06-19 15:50:32 -07:00
Alon Zakai 4e9da1053d refactor string memory initializer into tools/shared.py 2015-06-15 17:25:25 -07:00
Alon Zakai 472555477e Merge branch 'strMemInit' of https://github.com/gagern/emscripten into incoming 2015-06-15 17:25:11 -07:00
Martin von Gagern f5bc4226bf Incorporate suggestions from code review
* MEM_INIT_METHOD != 1 with --with-memory-file 1 now triggers an assertion
* Consistently return '' instead of m.group(0) if there is no initializer
* Strip trailing zeros for emterpreter as well
* Include crc32 in literal only if it gets verified
* Enable assertions for the asm2m test run in general
* Disable assertions for one test case, fnmatch, to cover that as well
* Include the asm2m run name in two lists of run modes
* Add browser test to verify all pairs of bytes get encoded correctly
* Add browser test to verify that a >32M initializer works without chunking
* Omit duplicate var declaration for the memoryInitializer variable
* Minor comments and syntax improvements
* Capture the memory_init_file setting by its MEM_INIT_METHOD value.
* Drop special handling for emterpreter, which shouldn't be needed any more.
2015-06-15 22:46:10 +02:00
Martin von Gagern e2d59af99d Use hex escapes for non-ASCII bytes
This makes the resulting literals more independent from the character
encoding the environment assumes for the resulting file.
It requires slightly more memory, but large bytes are far less common than
small bytes (zero in particular), so the cost should not be too much.
If we want to, we can still make this optional later on.
2015-06-15 22:46:10 +02:00
Martin von Gagern 6d3b9ff87a Verify integrity of memory initializer using CRC-32
This is almost the standard CRC-32 algorithm, except that we omit the final
XOR with -1 so that we can easily compare the result against zero.
The length of the initializer is included in the data so that we don't have
to worry about leading zeros (after XOR with the init value of -1).

Useful read: http://www.ross.net/crc/download/crc_v3.txt
2015-06-15 22:46:10 +02:00
Martin von Gagern c388aeebe7 Avoid octal escapes, use raw bytes instead
There was a bug where the hex-to-oct conversion would match \\x01.  But
support for octal escape sequences is optional in any case, and forbidden in
strict mode, so we should avoid using these.

As per the ECMAScript 5.1 spec, any source character (which may be any
unicode code point) can be used inside a string literal, with the exception
of backslash, line terminator or the quoting character.  So we do just that:
dump a lot of raw bytes into the string literal and escape only what needs
to be escaped.

There is one catch, though: sources are usually encoded in UTF-8, in which
case we can't exactly plug in raw bytes, but have to use UTF-8 sequences for
the range \x80 through \xff.  This may cause problems if the source file is
NOT interpreted as UTF-8.
2015-06-15 22:46:10 +02:00
Martin von Gagern 8f44c9f77a Store memory initialization in string literal if requested
With “--memory-init-file 0 -s MEM_INIT_METHOD=2” on the command line, the
generated JavaScript file will contain a string literal representing the
initial content of the memory buffer.

The MEM_INIT_METHOD defaults to 0 but gets set to 1 if --memory-init-file is
being used.  Setting it to 1 without --memory-init-file will cause an error.
That way, we can use the setting in the postamble, without too many changes
in other places.

Since memory is initialized to all zero, trailing zeros can be omitted.
This change affects the file-based initialization as well.
2015-06-15 22:46:09 +02:00
Alon Zakai 4b77826aef Merge branch 'linux-shared-fix' of https://github.com/brion/emscripten into incoming 2015-06-15 13:05:52 -07:00
Brion Vibber b424dc0d85 Fix shared libraries in autoconf projects on Linux host
Partial revert of commit 53a969d, plus addition of comment
explaining why the verbiage about ld compatibility is there.

Added a check for the 'GNU' token in 'emcc -v' output to tests.
2015-06-15 12:25:05 -07:00
Alon Zakai fe87592d33 remove emterpreter YIELDLIST - it complicates the mental model and is not worth it for the rather slim amount of benefit it provides 2015-06-10 15:50:06 -07:00
Yao Wei Tjong 姚伟忠 b294035510 Handle '-M' and '-MM' compiler flags similar to '-E'. 2015-06-06 12:01:39 +08:00
Alon Zakai 7adf0e8815 Merge branch 'incoming' into musl-syscall
Conflicts:
	tests/test_core.py
	tests/test_other.py
2015-06-01 13:36:39 -07:00
Jukka Jylänki f87bd74eb4 Mark linker options for dynamic linking unsupported with -s USE_PTHREADS=1 (todo for later). 2015-06-01 15:11:51 +03:00
Jukka Jylänki e0cff8ccd6 Clean up -s USE_PTHREADS detection in emcc. 2015-06-01 15:11:49 +03:00
Jukka Jylänki c223827533 Abort compilation if PROXY_TO_WORKER=1 is attempted with USE_PTHREADS=1. 2015-06-01 15:11:46 +03:00
Jukka Jylänki ccafa0a39d Remove the -lpthread setting, and only use -s USE_PTHREADS=1 to have only one build and link flag for threads. 2015-06-01 15:11:46 +03:00
Jukka Jylänki 3eac3399e2 Whitespace cleanup in emcc. 2015-06-01 15:11:11 +03:00
Jukka Jylänki ebbe6b7b48 Add the original dummy implementation of pthread functions as src/library_pthread_stub.js to be used in the case when not compiling with pthreads support enabled. 2015-06-01 15:11:09 +03:00
Jukka Jylänki b997dea667 Build dlmalloc either as thread safe or thread unsafe depending on whether compiling with pthreads support (-s USE_PTHREADS=1 or -lpthread) or not. 2015-06-01 15:11:07 +03:00
Jukka Jylänki 41783a0239 Preprocess proxyClient.js when importing it. 2015-06-01 15:11:04 +03:00
Jukka Jylänki 67a69784d0 Build pthread libraries as part of musl libc instead of rebuilding them each time as part of the source build. 2015-06-01 15:10:29 +03:00
Jukka Jylänki d71ec47757 Add new link setting -s PTHREAD_POOL_SIZE=<int> which specifies the number of web workers that are warmed up at startup. Default=0. 2015-06-01 15:10:04 +03:00
Jukka Jylänki da98c3fca2 Remove the old unnecessary atomics polyfill. 2015-06-01 15:09:50 +03:00
Jukka Jylänki cffba53f4a Commit initial working implementation of basic pthreading support with thread creation, atomics and mutexes. Link your application with -lpthread to use it. Implement a custom Emscripten API for calling to browser directly for atomics and futex. 2015-06-01 15:09:24 +03:00
Alon Zakai 3697088c3a do not include library_syscall.js when NO_FILESYSTEM 2015-05-28 17:52:07 -07:00
Alon Zakai 11fcb231d6 pass extra_info to all passes when splitting in EMCC_DEBUG=2 mode 2015-05-28 16:26:04 -07:00
Alon Zakai 26c4b46c96 accept .lo suffixes as representing bitcode, these are PIC object files used e.g. in new zlib #3470 2015-05-28 16:18:16 -07:00
Alon Zakai 9388ce0ff7 set up errno passing from syscalls 2015-05-23 22:13:09 -07:00
Alon Zakai 74a50b6d39 don't link system libs during struct info bootstrapping 2015-05-22 19:45:45 -07:00
Alon Zakai c331681967 support -dumpmachine in emcc 2015-05-22 10:52:23 -07:00
Alon Zakai 8140f30d2f accept failure to make a configure executable executable 2015-05-22 10:49:36 -07:00
Alon Zakai 53a969dd14 clean up emcc self-description 2015-05-16 12:27:33 -07:00
Alon Zakai 6ef983adfa clean up .a forcing logic 2015-05-12 13:51:31 -07:00
Alon Zakai f5ca680080 allow shared modules to be minified; it is just closure we must avoid 2015-05-07 14:44:00 -07:00
Alon Zakai 02cd97005b allow main module shell code to be cleaned up 2015-05-07 13:52:55 -07:00
Alon Zakai a33064f577 finalize side modules 2015-05-07 11:41:01 -07:00
Alon Zakai ad40339092 always include precise i64 code in shared modules 2015-05-07 11:41:01 -07:00
Alon Zakai 65a0f11e2c support memory init files in main modules, and remove dlfcn testing stuff no longer needed 2015-05-04 17:48:27 -07:00
Alon Zakai a0f34e7330 force .a archive content inclusion when building shared modules 2015-05-04 13:38:17 -07:00
Alon Zakai 3dde1610b1 enable shared modules in emterpreter 2015-05-03 17:58:07 -07:00
Alon Zakai 0cf78ae339 reduce notifications about enabling js opts automatically to debugs 2015-05-03 10:48:52 -07:00
Alon Zakai ba1fd81be0 make emterpretify more modular by not appending to an existing memory init file; generate its own memory init, and relocate it at runtime 2015-05-02 21:35:32 -07:00
Alon Zakai c3f81bd292 harmonize the RELOCATABLE and *_MODULE settings 2015-04-30 16:40:08 -07:00
Alon Zakai 5f32b2b1c1 Merge branch 'respect-dash-o-while-preprocessing' of https://github.com/weitjong/emscripten into incoming
Conflicts:
	AUTHORS
2015-04-29 14:18:36 -07:00
Bruce Mitchener 6aff92f69a Remove most of NAMED_GLOBALS. 2015-04-29 20:01:10 +07:00
Alon Zakai ba0ab00f64 Merge pull request #3421 from waywardmonkeys/remove-INIT_HEAP
Remove INIT_HEAP.
2015-04-28 17:00:37 -07:00
Alon Zakai e2a5c55582 do not emit an eval for closure from the file packager, if closure is not being called 2015-04-28 16:04:09 -07:00
Bruce Mitchener ceccc7a6eb Remove INIT_HEAP.
This removes not just INIT_HEAP but also the init parameter to
RuntimeGenerator.alloc() as it is no longer needed. All callsites
for that function are updated.

The sanity test for LLVM fastcomp is also updated to pass something
else since INIT_HEAP is gone now.
2015-04-28 12:33:47 +07:00