Skip to content
Open
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
2 changes: 1 addition & 1 deletion emcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def phase_setup(state):
'unused-command-line-argument',
"linker setting ignored during compilation: '%s'" % key)
for arg in state.orig_args:
if arg in LINK_ONLY_FLAGS:
if arg.split('=')[0] in LINK_ONLY_FLAGS:
diagnostics.warning(
'unused-command-line-argument',
"linker flag ignored during compilation: '%s'" % arg)
Expand Down
2 changes: 1 addition & 1 deletion test/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ def get_cflags(self, main_file=False, compile_only=False, asm_only=False):
def is_ldflag(f):
return f.startswith(('-l', '-sEXPORT_ES6', '-sGL_TESTING', '-sPROXY_TO_PTHREAD',
'-sENVIRONMENT=', '--pre-js=', '--post-js=', '-sPTHREAD_POOL_SIZE=',
'--profiling-funcs'))
'--profiling-funcs', '--closure'))

args = self.serialize_settings(compile_only or asm_only) + self.cflags
if asm_only:
Expand Down
2 changes: 1 addition & 1 deletion test/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -6940,7 +6940,7 @@ def test_zlib(self, use_cmake):
zlib = self.get_zlib_library(use_cmake)

# example.c uses K&R style function declarations
self.cflags += ['-Wno-deprecated-non-prototype']
self.cflags += ['-Wno-deprecated-non-prototype', '-Wno-unused-command-line-argument']
self.do_core_test('test_zlib.c', libraries=zlib, includes=[test_file('third_party/zlib')])

@needs_make('make')
Expand Down
4 changes: 4 additions & 0 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -13106,6 +13106,10 @@ def test_link_only_flag_warning(self):
err = self.run_process([EMCC, '--embed-file', 'file', '-c', test_file('hello_world.c')], stderr=PIPE).stderr
self.assertContained("warning: linker flag ignored during compilation: '--embed-file' [-Wunused-command-line-argument]", err)

# Also test for the format that includes an =arg suffix
err = self.run_process([EMCC, '--embed-file=file', '-c', test_file('hello_world.c')], stderr=PIPE).stderr
self.assertContained("warning: linker flag ignored during compilation: '--embed-file=file' [-Wunused-command-line-argument]", err)

def test_no_deprecated(self):
# Test that -Wno-deprecated is passed on to clang driver
create_file('test.c', '''\
Expand Down
Loading