aboutsummaryrefslogtreecommitdiff
path: root/emcc
diff options
context:
space:
mode:
Diffstat (limited to 'emcc')
-rwxr-xr-xemcc48
1 files changed, 36 insertions, 12 deletions
diff --git a/emcc b/emcc
index ff443389..bc76b01d 100755
--- a/emcc
+++ b/emcc
@@ -993,6 +993,8 @@ try:
# Apply effects from settings
if shared.Settings.ASM_JS:
+ assert opt_level == 2, 'asm.js requires -O2'
+
if closure:
print >> sys.stderr, 'emcc: warning: disabling closure because it is not compatible with asm.js code generation'
closure = False
@@ -1142,9 +1144,34 @@ try:
def create_libcxx():
if DEBUG: print >> sys.stderr, 'emcc: building libcxx for cache'
os = []
- for src in ['algorithm.cpp', 'condition_variable.cpp', 'future.cpp', 'iostream.cpp', 'memory.cpp', 'random.cpp', 'stdexcept.cpp', 'system_error.cpp', 'utility.cpp', 'bind.cpp', 'debug.cpp', 'hash.cpp', 'mutex.cpp', 'string.cpp', 'thread.cpp', 'valarray.cpp', 'chrono.cpp', 'exception.cpp', 'ios.cpp', 'locale.cpp', 'regex.cpp', 'strstream.cpp']:
+ libcxx_files = [
+ 'algorithm.cpp',
+ 'condition_variable.cpp',
+ 'future.cpp',
+ 'iostream.cpp',
+ 'memory.cpp',
+ 'random.cpp',
+ 'stdexcept.cpp',
+ 'system_error.cpp',
+ 'utility.cpp',
+ 'bind.cpp',
+ 'debug.cpp',
+ 'hash.cpp',
+ 'mutex.cpp',
+ 'string.cpp',
+ 'thread.cpp',
+ 'valarray.cpp',
+ 'chrono.cpp',
+ 'exception.cpp',
+ 'ios.cpp',
+ 'locale.cpp',
+ 'regex.cpp',
+ 'strstream.cpp'
+ ]
+ for src in libcxx_files:
o = in_temp(src + '.o')
- execute([shared.PYTHON, shared.EMXX, shared.path_from_root('system', 'lib', 'libcxx', src), '-o', o], stdout=stdout, stderr=stderr)
+ srcfile = shared.path_from_root('system', 'lib', 'libcxx', src)
+ execute([shared.PYTHON, shared.EMXX, srcfile, '-o', o, '-std=c++11'], stdout=stdout, stderr=stderr)
os.append(o)
shared.Building.link(os, in_temp('libcxx.bc'))
return in_temp('libcxx.bc')
@@ -1161,9 +1188,14 @@ try:
def create_libcxxabi():
if DEBUG: print >> sys.stderr, 'emcc: building libcxxabi for cache'
os = []
- for src in ['private_typeinfo.cpp', 'typeinfo.cpp']:
+ libcxxabi_files = [
+ 'typeinfo.cpp',
+ 'private_typeinfo.cpp'
+ ]
+ for src in libcxxabi_files:
o = in_temp(src + '.o')
- execute([shared.PYTHON, shared.EMXX, shared.path_from_root('system', 'lib', 'libcxxabi', 'src', src), '-o', o], stdout=stdout, stderr=stderr)
+ srcfile = shared.path_from_root('system', 'lib', 'libcxxabi', 'src', src)
+ execute([shared.PYTHON, shared.EMXX, srcfile, '-o', o, '-std=c++11'], stdout=stdout, stderr=stderr)
os.append(o)
shared.Building.link(os, in_temp('libcxxabi.bc'))
return in_temp('libcxxabi.bc')
@@ -1200,14 +1232,6 @@ try:
# We need to build and link the library in
if DEBUG: print >> sys.stderr, 'emcc: including %s' % name
libfile = shared.Cache.get(name, create)
- if has and len(has) > 0:
- # remove the symbols we do not need
- fixed = in_temp(uniquename(libfile)) + '.bc'
- shutil.copyfile(libfile, fixed)
- for haz in has:
- if DEBUG: print >> sys.stderr, 'emcc: including: removing symbol "%s" that we have' % haz
- shared.Building.remove_symbol(fixed, haz)
- libfile = fixed
extra_files_to_link.append(libfile)
force = True
if fix and need: