27
27
import os
28
28
import re
29
29
import shlex
30
- import shutil
31
30
import sys
32
31
import time
33
32
import tarfile
78
77
79
78
SIMD_INTEL_FEATURE_TOWER = ['-msse' , '-msse2' , '-msse3' , '-mssse3' , '-msse4.1' , '-msse4.2' , '-msse4' , '-mavx' ]
80
79
SIMD_NEON_FLAGS = ['-mfpu=neon' ]
81
- COMPILE_ONLY_FLAGS = {'--default-obj-ext' }
82
80
LINK_ONLY_FLAGS = {
83
81
'--bind' , '--closure' , '--cpuprofiler' , '--embed-file' ,
84
82
'--emit-symbol-map' , '--emrun' , '--exclude-file' , '--extern-post-js' ,
@@ -149,7 +147,6 @@ def __init__(self):
149
147
self .memory_init_file = None
150
148
self .use_preload_cache = False
151
149
self .use_preload_plugins = False
152
- self .default_object_extension = '.o'
153
150
self .valid_abspaths = []
154
151
# Specifies the line ending format to use for all generated text files.
155
152
# Defaults to using the native EOL on each platform (\r\n on Windows, \n on
@@ -811,23 +808,6 @@ def phase_setup(options, state, newargs):
811
808
diagnostics .warning (
812
809
'unused-command-line-argument' ,
813
810
"linker flag ignored during compilation: '%s'" % arg )
814
- if state .has_dash_c :
815
- if '-emit-llvm' in newargs :
816
- options .default_object_extension = '.bc'
817
- elif state .has_dash_S :
818
- if '-emit-llvm' in newargs :
819
- options .default_object_extension = '.ll'
820
- else :
821
- options .default_object_extension = '.s'
822
- elif '-M' in newargs or '-MM' in newargs :
823
- options .default_object_extension = '.mout' # not bitcode, not js; but just dependency rule of the input file
824
-
825
- else :
826
- for arg in state .orig_args :
827
- if any (arg .startswith (f ) for f in COMPILE_ONLY_FLAGS ):
828
- diagnostics .warning (
829
- 'unused-command-line-argument' ,
830
- "compiler flag ignored during linking: '%s'" % arg )
831
811
832
812
if settings .MAIN_MODULE or settings .SIDE_MODULE :
833
813
settings .RELOCATABLE = 1
@@ -1006,20 +986,7 @@ def get_clang_command_asm():
1006
986
cmd += ['-o' , options .output_file ]
1007
987
if get_file_suffix (options .output_file ) == '.bc' and not settings .LTO and '-emit-llvm' not in state .orig_args :
1008
988
diagnostics .warning ('emcc' , '.bc output file suffix used without -flto or -emit-llvm. Consider using .o extension since emcc will output an object file, not a bitcode file' )
1009
- ext = get_clang_output_extension (state )
1010
- if not options .output_file and options .default_object_extension != ext :
1011
- # If we are using a non-standard output file extention we cannot use
1012
- # exec_process here since we need to rename the files
1013
- # after clang runs (since clang does not support --default-obj-ext)
1014
- # TODO: Remove '--default-obj-ext' to reduce this complexity
1015
- shared .check_call (cmd )
1016
- for i in inputs :
1017
- output = unsuffixed_basename (i ) + ext
1018
- new_output = unsuffixed_basename (i ) + options .default_object_extension
1019
- shutil .move (output , new_output )
1020
- sys .exit (0 )
1021
- else :
1022
- shared .exec_process (cmd )
989
+ shared .exec_process (cmd )
1023
990
1024
991
# In COMPILE_AND_LINK we need to compile source files too, but we also need to
1025
992
# filter out the link flags
@@ -1039,7 +1006,7 @@ def uniquename(name):
1039
1006
return unsuffixed (name ) + '_' + seen_names [name ] + shared .suffix (name )
1040
1007
1041
1008
def get_object_filename (input_file ):
1042
- return in_temp (unsuffixed (uniquename (input_file )) + options . default_object_extension )
1009
+ return in_temp (shared . replace_suffix (uniquename (input_file ), '.o' ) )
1043
1010
1044
1011
def compile_source_file (i , input_file ):
1045
1012
logger .debug (f'compiling source file: { input_file } ' )
@@ -1384,9 +1351,7 @@ def consume_arg_file():
1384
1351
elif arg == '-fignore-exceptions' :
1385
1352
settings .DISABLE_EXCEPTION_CATCHING = 1
1386
1353
elif check_arg ('--default-obj-ext' ):
1387
- options .default_object_extension = consume_arg ()
1388
- if not options .default_object_extension .startswith ('.' ):
1389
- options .default_object_extension = '.' + options .default_object_extension
1354
+ exit_with_error ('--default-obj-ext is no longer supported by emcc' )
1390
1355
elif arg .startswith ('-fsanitize=cfi' ):
1391
1356
exit_with_error ('emscripten does not currently support -fsanitize=cfi' )
1392
1357
elif check_arg ('--output_eol' ):
0 commit comments