aboutsummaryrefslogtreecommitdiff
path: root/emcc
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-01-18 21:24:11 -0800
committerAlon Zakai <alonzakai@gmail.com>2012-01-18 21:24:11 -0800
commit30a94d3f6f7c7aa03065d6e73f9e876ea6934e8e (patch)
tree99dc3869b6b7b66632d8e1f83049ccfb4072c4db /emcc
parenteb3b69d8f96c8b2f60a3560b94af7ae1bb9346b5 (diff)
always include dlmalloc if including libcxx, since libcxx uses new internally
Diffstat (limited to 'emcc')
-rwxr-xr-xemcc9
1 files changed, 6 insertions, 3 deletions
diff --git a/emcc b/emcc
index 5ecc3696..3984feb6 100755
--- a/emcc
+++ b/emcc
@@ -482,8 +482,10 @@ try:
libcxx_symbols = filter(lambda symbol: symbol not in dlmalloc_symbols, libcxx_symbols)
libcxx_symbols = set(libcxx_symbols)
- for name, create, fix, library_symbols in [('dlmalloc', create_dlmalloc, fix_dlmalloc, dlmalloc_symbols),
- ('libcxx', create_libcxx, fix_libcxx, libcxx_symbols)]:
+ force = False # If we have libcxx, we must force inclusion of dlmalloc, since libcxx uses new internally. Note: this is kind of hacky
+
+ for name, create, fix, library_symbols in [('libcxx', create_libcxx, fix_libcxx, libcxx_symbols),
+ ('dlmalloc', create_dlmalloc, fix_dlmalloc, dlmalloc_symbols)]:
need = False
has = False
for input_file in input_files:
@@ -493,10 +495,11 @@ try:
need = True
if library_symbol in symbols.defs:
has = True
- if need and not has:
+ if force or (need and not has):
# We need to build and link the library in
if DEBUG: print >> sys.stderr, 'emcc: including %s' % name
extra_files_to_link.append(shared.Cache.get(name, create))
+ force = True
if fix:
fix()