Skip to content

Commit

Permalink
Inject compiler flags as part of get_clang_flags. NFC
Browse files Browse the repository at this point in the history
I noticed these were a little out-of-place in emscripten-core#22751
  • Loading branch information
sbc100 committed Oct 17, 2024
1 parent 257b7d5 commit 9583e77
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions emcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,15 @@ def get_clang_flags(user_args):
if settings.INLINING_LIMIT:
flags.append('-fno-inline-functions')

if settings.PTHREADS:
if '-pthread' not in user_args:
flags.append('-pthread')
elif settings.SHARED_MEMORY:
if '-matomics' not in user_args:
flags.append('-matomics')
if '-mbulk-memory' not in user_args:
flags.append('-mbulk-memory')

if settings.RELOCATABLE and '-fPIC' not in user_args:
flags.append('-fPIC')

Expand Down Expand Up @@ -842,14 +851,6 @@ def phase_setup(options, state, newargs):
if settings.PTHREADS or settings.WASM_WORKERS:
settings.SHARED_MEMORY = 1

if settings.PTHREADS and '-pthread' not in newargs:
newargs += ['-pthread']
elif settings.SHARED_MEMORY:
if '-matomics' not in newargs:
newargs += ['-matomics']
if '-mbulk-memory' not in newargs:
newargs += ['-mbulk-memory']

if settings.SHARED_MEMORY:
settings.BULK_MEMORY = 1

Expand Down

0 comments on commit 9583e77

Please sign in to comment.