aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-06-28 12:49:02 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-06-28 12:49:02 -0700
commit5453806baeae0109d3806aec26a57bb5970a19ff (patch)
tree0ed53f24b739900ebd194dbbabf1d0f98a82b9e2
parentd887e70b1001d6d543335089ad138f4794cccb3f (diff)
always keep malloc alive; needed internally even if not in EXPORTED_FUNCTIONS
-rw-r--r--tools/shared.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/shared.py b/tools/shared.py
index c9efe6ef..da6d3e57 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -1100,7 +1100,9 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)''' % { 'winfix': '' if not WINDOWS e
@staticmethod
def get_safe_internalize():
- exports = ','.join(map(lambda exp: exp[1:], expand_response(Settings.EXPORTED_FUNCTIONS)))
+ exps = expand_response(Settings.EXPORTED_FUNCTIONS)
+ if '_malloc' not in exps: exps.append('_malloc') # needed internally, even if user did not add to EXPORTED_FUNCTIONS
+ exports = ','.join(map(lambda exp: exp[1:], exps))
# internalize carefully, llvm 3.2 will remove even main if not told not to
return ['-internalize', '-internalize-public-api-list=' + exports]