aboutsummaryrefslogtreecommitdiff
path: root/emcc
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-01-17 18:10:40 -0800
committerAlon Zakai <alonzakai@gmail.com>2012-01-17 18:10:40 -0800
commita0a27646bdd805a92cd4c5b1c4b560c273e54d66 (patch)
tree63d9026c3be33cddbeb7be0dc1a20087592b9dfb /emcc
parente8c81abd954d7a044c718b540bee6c26a66e0a76 (diff)
cache for dlmalloc and soon libc++
Diffstat (limited to 'emcc')
-rwxr-xr-xemcc9
1 files changed, 5 insertions, 4 deletions
diff --git a/emcc b/emcc
index 2a575559..56b70c8d 100755
--- a/emcc
+++ b/emcc
@@ -458,10 +458,11 @@ try:
if need_dlmalloc and not has_dlmalloc:
# We need to build and link dlmalloc in
if DEBUG: print >> sys.stderr, 'emcc: including dlmalloc'
- Popen([shared.EMCC, shared.path_from_root('src', 'dlmalloc.c'), '-g', '-o', in_temp('dlmalloc.o')], stdout=PIPE, stderr=PIPE).communicate()
- if llvm_opt_level > 0:
- shared.Building.llvm_opt(in_temp('dlmalloc.o'), LLVM_INTERNAL_OPT_LEVEL, safe=llvm_opt_level < 2)
- extra_files_to_link.append(in_temp('dlmalloc.o'))
+ def create_dlmalloc():
+ print >> sys.stderr, 'emcc: building dlmalloc for cache'
+ Popen([shared.EMCC, shared.path_from_root('src', 'dlmalloc.c'), '-g', '-o', in_temp('dlmalloc.o')], stdout=PIPE, stderr=PIPE).communicate()
+ return in_temp('dlmalloc.o')
+ extra_files_to_link.append(shared.Cache.get('dlmalloc', create_dlmalloc))
# dlmalloc needs some sign correction. # If we are in mode 0, switch to 2. We will add our lines
try: