Skip to content

Commit

Permalink
[emcc.py] Always pass -c when compiling + linking. NFC (#23324)
Browse files Browse the repository at this point in the history
In this part of the code we know that the user didn't pass `-c` so we
always want to add it.
  • Loading branch information
sbc100 authored Jan 7, 2025
1 parent 1668690 commit 7eb7d79
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions emcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,8 @@ def get_clang_command_asm():

# In COMPILE_AND_LINK we need to compile source files too, but we also need to
# filter out the link flags
assert state.mode == Mode.COMPILE_AND_LINK
assert not state.has_dash_c
compile_args = filter_out_link_flags(compile_args)
linker_inputs = []
seen_names = {}
Expand All @@ -1058,10 +1060,7 @@ def compile_source_file(i, input_file):
cmd = get_clang_command()
if get_file_suffix(input_file) in ['.pcm']:
cmd = [c for c in cmd if not c.startswith('-fprebuilt-module-path=')]
cmd += [input_file]
if not state.has_dash_c:
cmd += ['-c']
cmd += ['-o', output_file]
cmd += ['-c', input_file, '-o', output_file]
if state.mode == Mode.COMPILE_AND_LINK and '-gsplit-dwarf' in newargs:
# When running in COMPILE_AND_LINK mode we compile to temporary location
# but we want the `.dwo` file to be generated in the current working directory,
Expand Down

0 comments on commit 7eb7d79

Please sign in to comment.