Skip to content

Commit

Permalink
Strip -fPIC compiler flag during compilation
Browse files Browse the repository at this point in the history
This is a partial revert of #9750.

The binaryen change that was designed to allow this to work was
reverted: WebAssembly/binaryen#2513
  • Loading branch information
sbc100 committed Jan 14, 2020
1 parent 0bebbec commit 234a00e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions emcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1937,6 +1937,9 @@ def is_link_flag(flag):
return any(flag.startswith(x) for x in ('-l', '-L', '-Wl,'))

compile_args = [a for a in newargs if a and not is_link_flag(a)]
if '-fPIC' in compile_args and not shared.Settings.RELOCATABLE:
shared.warning('ignoring -fPIC flag when not building with SIDE_MODULE or MAIN_MODULE')
compile_args.remove('-fPIC')

# Bitcode args generation code
def get_clang_command(input_files):
Expand Down
1 change: 1 addition & 0 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -8554,6 +8554,7 @@ def test_undefined_main(self):

def test_fpic_static(self):
self.emcc_args.append('-fPIC')
self.emcc_args.remove('-Werror')
self.do_run_in_out_file_test('tests', 'core', 'test_hello_world')

@node_pthreads
Expand Down

0 comments on commit 234a00e

Please sign in to comment.