Skip to content

Commit

Permalink
Fix for -pthread + -sRELOCATABLE (emscripten-core#22110)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbc100 authored Jun 20, 2024
1 parent daa89dc commit 77448a9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/library_pthread.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 4 additions & 0 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <string>')
outputStdin = self.run_process([EMCC, '-x', 'c++', '-dM', '-E', '-'], input="#include <string>", stdout=PIPE).stdout
Expand Down

0 comments on commit 77448a9

Please sign in to comment.