Skip to content
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: 2 additions & 15 deletions tools/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,8 @@ def get_clang_flags(user_args):
# to be exported to other DSO's by default.
flags.append('-fvisibility=default')

if settings.LTO:
if not any(a.startswith('-flto') for a in user_args):

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this probably dates back to when users could do -sLTO maybe, so the setting might be enabled without -flto being on the command line.

flags.append('-flto=' + settings.LTO)
# setjmp/longjmp handling using Wasm EH
# For non-LTO, '-mllvm -wasm-enable-eh' added in
# building.llvm_backend_args() sets this feature in clang. But in LTO, the
# argument is added to wasm-ld instead, so clang needs to know that EH is
# enabled so that it can be added to the attributes in LLVM IR.
if settings.SUPPORT_LONGJMP == 'wasm':
flags.append('-mexception-handling')

else:
# In LTO mode these args get passed instead at link time when the backend runs.
for a in building.llvm_backend_args():
flags += ['-mllvm', a]
for a in building.llvm_backend_args():
flags += ['-mllvm', a]

return flags

Expand Down
Loading