Skip to content

Commit 7eb7d79

Browse files
authored
[emcc.py] Always pass -c when compiling + linking. NFC (emscripten-core#23324)
In this part of the code we know that the user didn't pass `-c` so we always want to add it.
1 parent 1668690 commit 7eb7d79

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

emcc.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,6 +1034,8 @@ def get_clang_command_asm():
10341034

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

0 commit comments

Comments
 (0)