Skip to content

Commit 29cb1f5

Browse files
authored
Stop requiring DYNAMIC_EXECUTION when building with RELOCATABLE (#19295)
I tracked this error all the way back to when it was first added back in 2015: 38157ef. Its not longer true that `loadDynamicLibrary` requires `eval()`. It is true that if you have EM_ASM in your side modules that would require `eval()` but that usage is guarded using the `makeEval` helper (and also not common).
1 parent e102f6f commit 29cb1f5

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

ChangeLog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ See docs/process.md for more on how version tagging works.
2020

2121
3.1.38 (in development)
2222
-----------------------
23+
- The restriction preventing the use of dynamic linking in combination with
24+
`-sDYNAMIC_EXECUTION=0` was removed. This restriction was being enforced
25+
unnecessarily since dynamic linking has not depended on `eval()` for a while
26+
now.
2327
- Remove extra code for falling back to long-deprecated BlobBuilder browser API
2428
when Blob constructor is missing. This was a fix for an issue that has long
2529
been fixed. (#19277)

emcc.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2359,9 +2359,6 @@ def phase_linker_setup(options, state, newargs):
23592359
# llvm change lands
23602360
settings.EXPORT_IF_DEFINED.append('__wasm_apply_data_relocs')
23612361

2362-
if settings.RELOCATABLE and not settings.DYNAMIC_EXECUTION:
2363-
exit_with_error('cannot have both DYNAMIC_EXECUTION=0 and RELOCATABLE enabled at the same time, since RELOCATABLE needs to eval()')
2364-
23652362
if settings.SIDE_MODULE and 'GLOBAL_BASE' in user_settings:
23662363
exit_with_error('GLOBAL_BASE is not compatible with SIDE_MODULE')
23672364

test/test_other.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4585,10 +4585,8 @@ def test_no_dynamic_execution(self):
45854585
self.assertNotContained('new Function', src)
45864586
delete_file('a.out.js')
45874587

4588-
# Test that -sDYNAMIC_EXECUTION and -sRELOCATABLE are not allowed together.
4589-
self.expect_fail([EMCC, test_file('hello_world.c'), '-O1',
4590-
'-sDYNAMIC_EXECUTION=0', '-sRELOCATABLE'])
4591-
delete_file('a.out.js')
4588+
# Test that -sDYNAMIC_EXECUTION=0 and -sRELOCATABLE are allowed together.
4589+
self.do_runf(test_file('hello_world.c'), emcc_args=['-O1', '-sDYNAMIC_EXECUTION=0', '-sRELOCATABLE'])
45924590

45934591
create_file('test.c', r'''
45944592
#include <emscripten/emscripten.h>

0 commit comments

Comments
 (0)