aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xemcc3
-rw-r--r--src/library.js24
-rwxr-xr-xtests/runner.py18
-rw-r--r--tools/file_packager.py2
-rw-r--r--tools/shared.py2
5 files changed, 46 insertions, 3 deletions
diff --git a/emcc b/emcc
index e92dac87..8f71883d 100755
--- a/emcc
+++ b/emcc
@@ -787,6 +787,7 @@ try:
newargs[i+1] = ''
elif newargs[i].startswith('--minify'):
check_bad_eq(newargs[i])
+ assert newargs[i+1] == '0', '0 is the only supported option for --minify; 1 has been deprecated'
debug_level = max(1, debug_level)
newargs[i] = ''
newargs[i+1] = ''
@@ -1010,7 +1011,7 @@ try:
logging.error('no input files\nnote that input files without a known suffix are ignored, make sure your input files end with one of: ' + str(SOURCE_SUFFIXES + BITCODE_SUFFIXES + DYNAMICLIB_SUFFIXES + STATICLIB_SUFFIXES + ASSEMBLY_SUFFIXES))
exit(0)
- newargs += CC_ADDITIONAL_ARGS
+ newargs = CC_ADDITIONAL_ARGS + newargs
assert not (Compression.on and final_suffix != 'html'), 'Compression only works when generating HTML'
diff --git a/src/library.js b/src/library.js
index d8e16fbd..7978e9cb 100644
--- a/src/library.js
+++ b/src/library.js
@@ -1413,6 +1413,16 @@ LibraryManager.library = {
},
// ==========================================================================
+ // sys/file.h
+ // ==========================================================================
+
+ flock: function(fd, operation) {
+ // int flock(int fd, int operation);
+ // Pretend to succeed
+ return 0;
+ },
+
+ // ==========================================================================
// poll.h
// ==========================================================================
@@ -3849,6 +3859,20 @@ LibraryManager.library = {
// TODO: Implement mremap.
+ mprotect: function(addr, len, prot) {
+ // int mprotect(void *addr, size_t len, int prot);
+ // http://pubs.opengroup.org/onlinepubs/7908799/xsh/mprotect.html
+ // Pretend to succeed
+ return 0;
+ },
+
+ msync: function(addr, len, flags) {
+ // int msync(void *addr, size_t len, int flags);
+ // http://pubs.opengroup.org/onlinepubs/009696799/functions/msync.html
+ // Pretend to succeed
+ return 0;
+ },
+
// ==========================================================================
// stdlib.h
// ==========================================================================
diff --git a/tests/runner.py b/tests/runner.py
index ed4f334c..9f037164 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -14927,12 +14927,30 @@ fi
finally:
del os.environ['EMCC_DEBUG']
+ restore()
+
+ def ensure_cache():
+ self.do([EMCC, '-O2', path_from_root('tests', 'hello_world.c')])
+
# Manual cache clearing
+ ensure_cache()
assert os.path.exists(EMCC_CACHE)
output = self.do([EMCC, '--clear-cache'])
assert ERASING_MESSAGE in output
assert not os.path.exists(EMCC_CACHE)
+ # Changing LLVM_ROOT, even without altering .emscripten, clears the cache
+ ensure_cache()
+ old = os.environ.get('LLVM')
+ try:
+ os.environ['LLVM'] = 'waka'
+ assert os.path.exists(EMCC_CACHE)
+ output = self.do([EMCC])
+ assert ERASING_MESSAGE in output
+ assert not os.path.exists(EMCC_CACHE)
+ finally:
+ if old: os.environ['LLVM'] = old
+
try_delete(CANONICAL_TEMP_DIR)
def test_relooper(self):
diff --git a/tools/file_packager.py b/tools/file_packager.py
index 0fa6a529..0097c473 100644
--- a/tools/file_packager.py
+++ b/tools/file_packager.py
@@ -203,7 +203,7 @@ curr_abspath = os.path.abspath(os.getcwd())
for file_ in data_files:
path = file_['dstpath']
abspath = os.path.abspath(path)
- print >> sys.stderr, path, abspath, curr_abspath
+ if DEBUG: print >> sys.stderr, path, abspath, curr_abspath
if not abspath.startswith(curr_abspath):
print >> sys.stderr, 'Error: Embedding "%s" which is below the current directory. This is invalid since the current directory becomes the root that the generated code will see' % path
sys.exit(1)
diff --git a/tools/shared.py b/tools/shared.py
index ba926f72..250c018d 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -286,7 +286,7 @@ def check_node_version():
EMSCRIPTEN_VERSION = '1.5.3'
def generate_sanity():
- return EMSCRIPTEN_VERSION + '|' + get_llvm_target()
+ return EMSCRIPTEN_VERSION + '|' + get_llvm_target() + '|' + LLVM_ROOT
def check_sanity(force=False):
try: