From 4ce1300f41c9d29de08c7f65a34faaff275322d6 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Tue, 9 Apr 2019 12:45:16 -0700 Subject: [PATCH] Remove unused JS globals for stdin/stdout/stderr (#8410) These globals are defined in musl C code so as far as I can tell are never used. --- src/library.js | 6 ------ src/library_fs.js | 2 +- tests/test_other.py | 2 +- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/library.js b/src/library.js index 272b0364b669..74369234cf83 100644 --- a/src/library.js +++ b/src/library.js @@ -25,15 +25,9 @@ LibraryManager.library = { // keep this low in memory, because we flatten arrays with them in them #if USE_PTHREADS - stdin: '; if (ENVIRONMENT_IS_PTHREAD) _stdin = PthreadWorkerInit._stdin; else PthreadWorkerInit._stdin = _stdin = {{{ makeStaticAlloc(4) }}}', - stdout: '; if (ENVIRONMENT_IS_PTHREAD) _stdout = PthreadWorkerInit._stdout; else PthreadWorkerInit._stdout = _stdout = {{{ makeStaticAlloc(4) }}}', - stderr: '; if (ENVIRONMENT_IS_PTHREAD) _stderr = PthreadWorkerInit._stderr; else PthreadWorkerInit._stderr = _stderr = {{{ makeStaticAlloc(4) }}}', _impure_ptr: '; if (ENVIRONMENT_IS_PTHREAD) __impure_ptr = PthreadWorkerInit.__impure_ptr; else PthreadWorkerInit.__impure_ptr __impure_ptr = {{{ makeStaticAlloc(4) }}}', __dso_handle: '; if (ENVIRONMENT_IS_PTHREAD) ___dso_handle = PthreadWorkerInit.___dso_handle; else PthreadWorkerInit.___dso_handle = ___dso_handle = {{{ makeStaticAlloc(4) }}}', #else - stdin: '{{{ makeStaticAlloc(1) }}}', - stdout: '{{{ makeStaticAlloc(1) }}}', - stderr: '{{{ makeStaticAlloc(1) }}}', _impure_ptr: '{{{ makeStaticAlloc(1) }}}', __dso_handle: '{{{ makeStaticAlloc(1) }}}', #endif diff --git a/src/library_fs.js b/src/library_fs.js index f9bcce701af8..379aa23dbba9 100644 --- a/src/library_fs.js +++ b/src/library_fs.js @@ -20,7 +20,7 @@ mergeInto(LibraryManager.library, { #if ASSERTIONS '$ERRNO_MESSAGES', '$ERRNO_CODES', #endif - 'stdin', 'stdout', 'stderr'], + ], $FS__postset: function() { // TODO: do we need noFSInit? addAtInit('if (!Module["noFSInit"] && !FS.init.initialized) FS.init();'); diff --git a/tests/test_other.py b/tests/test_other.py index d39ebc9baf82..87942ce0b4b6 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -8252,7 +8252,7 @@ def test_clear_error_on_massive_static_data(self): if self.is_wasm_backend(): self.assertContained('wasm-ld: error: initial memory too small', err) else: - self.assertContained('Memory is not large enough for static data (134032) plus the stack (1024), please increase TOTAL_MEMORY (65536)', err) + self.assertContained('Memory is not large enough for static data (133984) plus the stack (1024), please increase TOTAL_MEMORY (65536)', err) def test_o_level_clamp(self): for level in [3, 4, 20]: