support memory init files in main modules, and remove dlfcn testing stuff no longer needed

This commit is contained in:
Alon Zakai 2015-05-04 17:48:27 -07:00
Родитель 9c77d0fd9f
Коммит 65a0f11e2c
3 изменённых файлов: 2 добавлений и 8 удалений

2
emcc
Просмотреть файл

@ -935,9 +935,9 @@ try:
elif shared.Settings.SIDE_MODULE:
assert not shared.Settings.MAIN_MODULE
shared.Settings.FINALIZE_ASM_JS = 0 # side modules are not finalized until after relocation
memory_init_file = False # memory init file is not supported with side modules, must be executable synchronously (for dlopen)
if shared.Settings.MAIN_MODULE or shared.Settings.SIDE_MODULE:
memory_init_file = False # memory init file is not supported with module linking
assert shared.Settings.ASM_JS, 'module linking requires asm.js output (-s ASM_JS=1)'
shared.Settings.LINKABLE = 1 # TODO: add FORCE_DCE option for the brave people that do want to dce here and in side modules
debug_level = max(debug_level, 2)

Просмотреть файл

@ -230,7 +230,7 @@ class RunnerCore(unittest.TestCase):
if '--memory-init-file' in self.emcc_args:
memory_init_file = int(self.emcc_args[self.emcc_args.index('--memory-init-file')+1])
else:
memory_init_file = '-O2' in self.emcc_args or '-O3' in self.emcc_args or '-Oz' in self.emcc_args
memory_init_file = ('-O2' in self.emcc_args or '-O3' in self.emcc_args or '-Oz' in self.emcc_args) and not Settings.SIDE_MODULE
src = open(filename + '.o.js').read()
if memory_init_file:
# side memory init file, or an empty one in the js

Просмотреть файл

@ -2838,12 +2838,6 @@ The current type of b is: 9
self.do_run(main, 'supp: 54,2\nmain: 56\nsupp see: 543\nmain see: 76\nok.')
def can_dlfcn(self):
if self.emcc_args:
self.emcc_args += ['--memory-init-file', '0']
Settings.DISABLE_EXCEPTION_CATCHING = 1
return True
def prep_dlfcn_lib(self):