@@ -934,17 +934,6 @@ def get_clang_output_extension(state):
934
934
return '.o'
935
935
936
936
937
- def exec_subprocess_and_exit (cmd ):
938
- if utils .WINDOWS :
939
- shared .check_call (cmd )
940
- sys .exit (0 )
941
- else :
942
- shared .print_compiler_stage (cmd )
943
- sys .stdout .flush ()
944
- sys .stderr .flush ()
945
- os .execv (cmd [0 ], cmd )
946
-
947
-
948
937
@ToolchainProfiler .profile_block ('compile inputs' )
949
938
def phase_compile_inputs (options , state , newargs , input_files ):
950
939
if shared .run_via_emxx :
@@ -993,7 +982,7 @@ def get_clang_command_asm():
993
982
# output the dependency rule. Warning: clang and gcc behave differently
994
983
# with -MF! (clang seems to not recognize it)
995
984
logger .debug (('just preprocessor ' if state .has_dash_E else 'just dependencies: ' ) + ' ' .join (cmd ))
996
- exec_subprocess_and_exit (cmd )
985
+ shared . exec_process (cmd )
997
986
998
987
# Precompiled headers support
999
988
if state .mode == Mode .PCH :
@@ -1005,7 +994,7 @@ def get_clang_command_asm():
1005
994
if options .output_file :
1006
995
cmd += ['-o' , options .output_file ]
1007
996
logger .debug (f"running (for precompiled headers): { cmd [0 ]} { ' ' .join (cmd [1 :])} " )
1008
- exec_subprocess_and_exit (cmd )
997
+ shared . exec_process (cmd )
1009
998
1010
999
if state .mode == Mode .COMPILE_ONLY :
1011
1000
inputs = [i [1 ] for i in input_files ]
@@ -1020,7 +1009,7 @@ def get_clang_command_asm():
1020
1009
ext = get_clang_output_extension (state )
1021
1010
if not options .output_file and options .default_object_extension != ext :
1022
1011
# If we are using a non-standard output file extention we cannot use
1023
- # exec_subprocess_and_exit here since we need to rename the files
1012
+ # exec_process here since we need to rename the files
1024
1013
# after clang runs (since clang does not support --default-obj-ext)
1025
1014
# TODO: Remove '--default-obj-ext' to reduce this complexity
1026
1015
shared .check_call (cmd )
@@ -1030,7 +1019,7 @@ def get_clang_command_asm():
1030
1019
shutil .move (output , new_output )
1031
1020
sys .exit (0 )
1032
1021
else :
1033
- exec_subprocess_and_exit (cmd )
1022
+ shared . exec_process (cmd )
1034
1023
1035
1024
# In COMPILE_AND_LINK we need to compile source files too, but we also need to
1036
1025
# filter out the link flags
0 commit comments