diff --git a/src/library_pthread.js b/src/library_pthread.js index 41877b1c212b7..414be3e9eea27 100644 --- a/src/library_pthread.js +++ b/src/library_pthread.js @@ -1242,6 +1242,12 @@ var LibraryPThread = { } } }, +#elif RELOCATABLE + // Provide a dummy version of _emscripten_thread_exit_joinable when + // RELOCATABLE is used without MAIN_MODULE. This is because the call + // site in pthread_create.c is not able to distinguish between these + // two cases. + _emscripten_thread_exit_joinable: (thread) => {}, #endif // MAIN_MODULE $checkMailbox__deps: ['$callUserCallback', diff --git a/test/test_other.py b/test/test_other.py index dad05a14252d7..7dbd652875d2e 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -11922,6 +11922,10 @@ def test_pthread_reuse(self): self.set_setting('PTHREAD_POOL_SIZE', 1) self.do_run_in_out_file_test('other/test_pthread_reuse.c') + @node_pthreads + def test_pthread_relocatable(self): + self.do_runf('hello_world.c', 'hello, world!', emcc_args=['-sRELOCATABLE']) + def test_stdin_preprocess(self): create_file('temp.h', '#include ') outputStdin = self.run_process([EMCC, '-x', 'c++', '-dM', '-E', '-'], input="#include ", stdout=PIPE).stdout