Fix minizip compile on Haiku (#16301)
[mono-project.git] / sdks / builds / emscripten-pr-8457.diff
blob0f051a914551f45818cf59d6b299f67e7c9a572d
1 diff --git a/emcc.py b/emcc.py
2 index c241f396a..1fcffc993 100755
3 --- a/emcc.py
4 +++ b/emcc.py
5 @@ -844,6 +844,9 @@ There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR P
6 lib_dirs = [shared.path_from_root('system', 'local', 'lib'),
7 shared.path_from_root('system', 'lib')]
9 + # -c mean compile to object files(s), don't link
10 + has_dash_c = '-c' in newargs
12 # find input files this a simple heuristic. we should really analyze
13 # based on a full understanding of gcc params, right now we just assume that
14 # what is left contains no more |-x OPT| things
15 @@ -869,7 +872,7 @@ There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR P
16 file_suffix = get_file_suffix(arg)
17 if file_suffix in SOURCE_ENDINGS + BITCODE_ENDINGS + DYNAMICLIB_ENDINGS + ASSEMBLY_ENDINGS + HEADER_ENDINGS or shared.Building.is_ar(arg): # we already removed -o <target>, so all these should be inputs
18 newargs[i] = ''
19 - if file_suffix.endswith(SOURCE_ENDINGS):
20 + if file_suffix.endswith(SOURCE_ENDINGS) or (has_dash_c and file_suffix.endswith(BITCODE_ENDINGS)):
21 input_files.append((i, arg))
22 has_source_inputs = True
23 elif file_suffix.endswith(HEADER_ENDINGS):
24 @@ -938,8 +941,6 @@ There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR P
26 newargs = [a for a in newargs if a is not '']
28 - # -c means do not link in gcc, and for us, the parallel is to not go all the way to JS, but stop at bitcode
29 - has_dash_c = '-c' in newargs
30 if has_dash_c:
31 assert has_source_inputs or has_header_inputs, 'Must have source code or header inputs to use -c'
32 target = target_basename + '.o'
33 @@ -1666,7 +1667,7 @@ There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR P
34 # First, generate LLVM bitcode. For each input file, we get base.o with bitcode
35 for i, input_file in input_files:
36 file_ending = get_file_suffix(input_file)
37 - if file_ending.endswith(SOURCE_ENDINGS):
38 + if file_ending.endswith(SOURCE_ENDINGS) or (has_dash_c and file_ending.endswith(BITCODE_ENDINGS)):
39 compile_source_file(i, input_file)
40 else: # bitcode
41 if file_ending.endswith(BITCODE_ENDINGS):