Skip to content

Commit bab3f12

Browse files
authored
Fix handling -Xclang arguments (#11173)
Fixes: #11172
1 parent deaa2cb commit bab3f12

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

emcc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,7 @@ def add_link_flag(i, f):
989989
'-isysroot', '-imultilib', '-A', '-isystem', '-iquote',
990990
'-install_name', '-compatibility_version',
991991
'-current_version', '-I', '-L', '-include-pch',
992-
'-Xlinker'):
992+
'-Xlinker', '-Xclang'):
993993
skip = True
994994

995995
if options.expand_symlinks and os.path.islink(arg) and get_file_suffix(os.path.realpath(arg)) in SOURCE_ENDINGS + OBJECT_FILE_ENDINGS + DYNAMICLIB_ENDINGS + ASSEMBLY_ENDINGS + HEADER_ENDINGS:

tests/test_other.py

+4
Original file line numberDiff line numberDiff line change
@@ -10854,3 +10854,7 @@ def test_linker_version(self):
1085410854
def test_chained_js_error_diagnostics(self):
1085510855
err = self.expect_fail([PYTHON, EMCC, path_from_root('tests', 'test_chained_js_error_diagnostics.c'), '--js-library', path_from_root('tests', 'test_chained_js_error_diagnostics.js')])
1085610856
self.assertContained("error: undefined symbol: nonexistent_function (referenced by bar__deps: ['nonexistent_function'], referenced by foo__deps: ['bar'], referenced by top-level compiled C/C++ code)", err)
10857+
10858+
def test_xclang_flag(self):
10859+
create_test_file('foo.h', ' ')
10860+
run_process([PYTHON, EMCC, '-c', '-o', 'out.o', '-Xclang', '-include', '-Xclang', 'foo.h', path_from_root('tests', 'hello_world.c')])

0 commit comments

Comments
 (0)