Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inject compiler flags as part of get_clang_flags. NFC #22764

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading