aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-02-07 13:36:50 -0500
committerAlon Zakai <alonzakai@gmail.com>2014-02-07 13:36:50 -0500
commit534faf153030cbb7efba9751e640ee0de6896c31 (patch)
tree20bd27660e6d5df0ae00b43a148e1d78d3174fed
parentf546a415cce6679c7cf30010c175b8ced164896f (diff)
add mechanism to add a C library dependency from a JS library, in emcc
-rwxr-xr-xemcc14
1 files changed, 13 insertions, 1 deletions
diff --git a/emcc b/emcc
index cb505682..5bd37594 100755
--- a/emcc
+++ b/emcc
@@ -1748,8 +1748,20 @@ try:
force_all = force == '1'
# Scan symbols
- all_needed = set()
symbolses = map(lambda temp_file: shared.Building.llvm_nm(temp_file), temp_files)
+
+ # Add in some hacks for js libraries. If a js lib depends on a symbol provided by a C library, it must be
+ # added to here, because our deps go only one way (each library here is checked, then we check the next
+ # in order - libcxx, libcxextra, etc. - and then we run the JS compiler and provide extra symbols from
+ # library*.js files. But we cannot then go back to the C libraries if a new dep was added!
+ def add_back_needs(need):
+ if 'uuid_compare' in need.undefs:
+ need.undefs.add('memcmp')
+ shared.Settings.EXPORTED_FUNCTIONS.append('_memcmp')
+ for symbols in symbolses:
+ add_back_needs(symbols)
+
+ all_needed = set()
for symbols in symbolses:
all_needed.update(symbols.undefs)
for symbols in symbolses: