Skip to content

Commit 4fd5b60

Browse files
authored
Switch wasm llvm target to 'wasm32-unknown-unkown-elf' (#5778)
This will allow us to change the upstream default to wasm32-unknown-unkown-wasm without breaking emscripten. Also, remove check of LLVM_TARGET in general in favor of Settings.WASM_BACKEND which is how we should be checking for this.
1 parent 6fb043b commit 4fd5b60

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

tests/runner.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def is_emterpreter(self):
173173
return False
174174

175175
def is_wasm_backend(self):
176-
return LLVM_TARGET == WASM_TARGET
176+
return Settings.WASM_BACKEND
177177

178178
def uses_memory_init_file(self):
179179
if self.emcc_args is None:

tests/test_sanity.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -868,9 +868,9 @@ def make_fake(report):
868868
try:
869869
os.environ['EMCC_DEBUG'] = '1'
870870
os.environ['EMCC_WASM_BACKEND'] = '1'
871-
make_fake('wasm32-unknown-unknown')
871+
make_fake('wasm32-unknown-unknown-elf')
872872
# see that we request the right backend from llvm
873-
self.check_working([EMCC, 'tests/hello_world.c', '-c'], 'wasm32-unknown-unknown')
873+
self.check_working([EMCC, 'tests/hello_world.c', '-c'], 'wasm32-unknown-unknown-elf')
874874
os.environ['EMCC_WASM_BACKEND'] = '0'
875875
make_fake('asmjs-unknown-emscripten')
876876
self.check_working([EMCC, 'tests/hello_world.c', '-c'], 'asmjs-unknown-emscripten')
@@ -880,7 +880,7 @@ def make_fake(report):
880880
self.check_working(EMCC)
881881
output = self.check_working(EMCC, 'check tells us to use')
882882
if 'wasm backend' in output:
883-
self.check_working([EMCC, 'tests/hello_world.c', '-c'], 'wasm32-unknown-unknown')
883+
self.check_working([EMCC, 'tests/hello_world.c', '-c'], 'wasm32-unknown-unknown-elf')
884884
else:
885885
assert 'asm.js backend' in output
886886
self.check_working([EMCC, 'tests/hello_world.c', '-c'], 'asmjs-unknown-emscripten')

tools/shared.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ def set_logging():
905905

906906
# Target choice.
907907
ASM_JS_TARGET = 'asmjs-unknown-emscripten'
908-
WASM_TARGET = 'wasm32-unknown-unknown'
908+
WASM_TARGET = 'wasm32-unknown-unknown-elf'
909909

910910
def check_vanilla():
911911
global LLVM_TARGET
@@ -957,7 +957,6 @@ def get_vanilla_file():
957957
check_vanilla()
958958

959959
def get_llvm_target():
960-
global LLVM_TARGET
961960
assert LLVM_TARGET is not None
962961
return LLVM_TARGET
963962

@@ -976,7 +975,7 @@ def get_llvm_target():
976975
'-D__EMSCRIPTEN_tiny__=' + str(EMSCRIPTEN_VERSION_TINY),
977976
'-D_LIBCPP_ABI_VERSION=2']
978977

979-
if LLVM_TARGET == WASM_TARGET:
978+
if get_llvm_target() == WASM_TARGET:
980979
# wasm target does not automatically define emscripten stuff, so do it here.
981980
COMPILER_OPTS = COMPILER_OPTS + ['-D__EMSCRIPTEN__',
982981
'-Dunix',

0 commit comments

Comments
 (0)