diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-01-10 10:54:10 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-01-10 10:54:10 -0800 |
commit | 60c6395d05545c8fd8ad277b026d79fe4ffdbd38 (patch) | |
tree | 28c887e58b89ce079fde29e55eb034e5d3e6952d | |
parent | a3c256bf34521cbb250e6a136b2a7c98d1b9b489 (diff) |
fix compiling of postrinsic memcpy when in forced c++ mode for the main file
-rwxr-xr-x | emcc | 3 | ||||
-rwxr-xr-x | tests/runner.py | 1 |
2 files changed, 4 insertions, 0 deletions
@@ -1106,7 +1106,10 @@ try: if need_memcpy and not has_memcpy: if DEBUG: print >> sys.stderr, 'memcpy intrinsic added in optimizations, linking in optimized memcpy' memcpy = in_temp('memcpy.bc') + force_cxx = os.environ.get('EMMAKEN_CXX') + if force_cxx is not None: del os.environ['EMMAKEN_CXX'] # memcpy must be compiled as C execute([shared.PYTHON, shared.EMCC, shared.path_from_root('system', 'lib', 'libc', 'musl', 'memcpy.c'), '-o', memcpy], stdout=stdout, stderr=stderr) + if force_cxx is not None: os.environ['EMMAKEN_CXX'] = force_cxx shared.Building.llvm_opt(memcpy, llvm_opts) # optimize it just like normal code; no point in lto though next = final + '.postrinsics.bc' shared.Building.link([final, memcpy], next) diff --git a/tests/runner.py b/tests/runner.py index ea124c30..24fbee95 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -7992,6 +7992,7 @@ Options that are modified or new in %s include: # dlmalloc. dlmalloc is special in that it is the only part of libc that is (1) hard to write well, and # very speed-sensitive. So we do not implement it in JS in library.js, instead we compile it from source for source, has_malloc in [('hello_world' + suffix, False), ('hello_malloc.cpp', True)]: + print source, has_malloc self.clear() output = Popen([PYTHON, compiler, path_from_root('tests', source)], stdout=PIPE, stderr=PIPE).communicate() assert os.path.exists('a.out.js'), '\n'.join(output) |