Skip to content

Instantly share code, notes, and snippets.

@satori99
Created June 5, 2021 03:10
Show Gist options
  • Save satori99/167928e4029a47fb2eea29a3fd6735cc to your computer and use it in GitHub Desktop.
Save satori99/167928e4029a47fb2eea29a3fd6735cc to your computer and use it in GitHub Desktop.
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Kleis Auke Wolthuizen <github@kleisauke.nl>
Date: Sat, 31 Oct 2020 13:40:00 +0100
Subject: [PATCH 1/1] Prefer -pthread over -s USE_PTHREADS=1
See https://github.com/emscripten-core/emscripten/issues/12346
Upstream-Status: Pending
diff --git a/mesonbuild/compilers/mixins/emscripten.py b/mesonbuild/compilers/mixins/emscripten.py
index 1111111..2222222 100644
--- a/mesonbuild/compilers/mixins/emscripten.py
+++ b/mesonbuild/compilers/mixins/emscripten.py
@@ -47,10 +47,10 @@ class EmscriptenMixin(Compiler):
return os.path.join(dirname, 'output.' + suffix)
def thread_flags(self, env: 'Environment') -> T.List[str]:
- return ['-s', 'USE_PTHREADS=1']
+ return ['-pthread']
def thread_link_flags(self, env: 'Environment') -> T.List[str]:
- args = ['-s', 'USE_PTHREADS=1']
+ args = ['-pthread']
count: int = env.coredata.options[OptionKey('thread_count', lang=self.language, machine=self.for_machine)].value
if count:
args.extend(['-s', f'PTHREAD_POOL_SIZE={count}'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment