Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove check for file type of .a files. NFC #21513

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions emcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
from tools.shared import unsuffixed, unsuffixed_basename, get_file_suffix
from tools.shared import run_process, exit_with_error, DEBUG
from tools.shared import in_temp, OFormat
from tools.shared import DYNAMICLIB_ENDINGS, STATICLIB_ENDINGS
from tools.shared import DYNAMICLIB_ENDINGS
from tools.response_file import substitute_response_files
from tools import config
from tools import cache
Expand Down 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
Loading