Skip to content

Commit

Permalink
Remove check for file type of .a files. NFC
Browse files Browse the repository at this point in the history
Instead just pass them through the linker like other inputs.
  • Loading branch information
sbc100 committed Mar 11, 2024
1 parent 64feaf1 commit 9e892c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 0 additions & 6 deletions emcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -755,12 +755,6 @@ def phase_setup(options, state, newargs):
file_suffix = get_file_suffix(arg)
if file_suffix in HEADER_ENDINGS:
has_header_inputs = True
if file_suffix in STATICLIB_ENDINGS and not building.is_ar(arg):
if building.is_bitcode(arg):
message = f'{arg}: File has a suffix of a static library {STATICLIB_ENDINGS}, but instead is an LLVM bitcode file! When linking LLVM bitcode files use .bc or .o.'
else:
message = arg + ': Unknown format, not a static library!'
exit_with_error(message)
input_files.append((i, arg))
elif arg.startswith('-L'):
state.add_link_flag(i, arg)
Expand Down
4 changes: 4 additions & 0 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,10 @@ def test_bc_output_warning(self):
err = self.run_process([EMCC, '-c', test_file('hello_world.c'), '-o', 'out.bc'], stderr=PIPE).stderr
self.assertContained('emcc: warning: .bc output file suffix used without -flto or -emit-llvm', err)

def test_bc_as_archive(self):
self.run_process([EMCC, '-c', test_file('hello_world.c'), '-flto', '-o', 'out.a'])
self.run_process([EMCC, 'out.a'])

@parameterized({
'c': [EMCC, '.c'],
'cxx': [EMXX, '.cpp']
Expand Down

0 comments on commit 9e892c2

Please sign in to comment.