Remove duplication of addition of pthread runtime exports
diff --git a/emcc.py b/emcc.py index 13d8029..b375aea 100755 --- a/emcc.py +++ b/emcc.py
@@ -1622,16 +1622,16 @@ if shared.Settings.EXPORT_NAME == 'Module': exit_with_error('pthreads + MODULARIZE currently require you to set -s EXPORT_NAME=Something (see settings.js) to Something != Module, so that the .worker.js file can work') - # MODULARIZE+USE_PTHREADS mode requires extra exports out to Module so that worker.js - # can access them: + # USE_PTHREADS mode requires extra exports out to Module so that worker.js + # can access them: - # general threading variables: - shared.Settings.EXPORTED_RUNTIME_METHODS += ['PThread'] + # general threading variables: + shared.Settings.EXPORTED_RUNTIME_METHODS += ['PThread', 'wasmMemory'] - # To keep code size to minimum, MINIMAL_RUNTIME does not utilize the global ExitStatus - # object, only regular runtime has it. - if not shared.Settings.MINIMAL_RUNTIME: - shared.Settings.EXPORTED_RUNTIME_METHODS += ['ExitStatus'] + # To keep code size to minimum, MINIMAL_RUNTIME does not utilize the global ExitStatus + # object, only regular runtime has it. + if not shared.Settings.MINIMAL_RUNTIME: + shared.Settings.EXPORTED_RUNTIME_METHODS += ['ExitStatus'] if shared.Settings.LINKABLE: exit_with_error('-s LINKABLE=1 is not supported with -s USE_PTHREADS>0!')
diff --git a/src/modules.js b/src/modules.js index 234dbe3..d1a183b 100644 --- a/src/modules.js +++ b/src/modules.js
@@ -424,6 +424,7 @@ 'setTempRet0', 'callMain', 'abort', + 'wasmMemory', ]; // Add JS library elements such as FS, GL, ENV, etc. These are prefixed with @@ -437,6 +438,7 @@ if (!MINIMAL_RUNTIME) { // MINIMAL_RUNTIME has moved these functions to library_strings.js runtimeElements = runtimeElements.concat([ + 'ExitStatus', 'warnOnce', 'stackSave', 'stackRestore', @@ -460,21 +462,6 @@ runtimeElements.push('checkStackCookie'); } - if (USE_PTHREADS) { - // In pthreads mode, the following functions always need to be exported to - // Module for closure compiler, and also for MODULARIZE (so worker.js can - // access them). - var threadExports = ['PThread', 'wasmMemory']; - if (!MINIMAL_RUNTIME) { - threadExports.push('ExitStatus'); - } - - threadExports.forEach(function(x) { - EXPORTED_RUNTIME_METHODS_SET[x] = 1; - runtimeElements.push(x); - }); - } - if (SUPPORT_BASE64_EMBEDDING) { runtimeElements.push('intArrayFromBase64'); runtimeElements.push('tryParseAsDataURI');