@@ -32,10 +32,14 @@ BULK_MEMORY_THRESHOLD ?= 32
3232# Variables from this point on are not meant to be overridable via the
3333# make command-line.
3434
35- # Set the target variables. Multiarch triples notably omit the vendor field,
36- # which happens to be what we do for the main target triple too.
35+ # Set the default WASI target triple.
3736TARGET_TRIPLE = wasm32-wasi
38- MULTIARCH_TRIPLE = wasm32-wasi
37+
38+ # Threaded version necessitates a different traget, as objects from different
39+ # targets can't be mixed together while linking.
40+ ifeq ($(THREAD_MODEL ) , posix)
41+ TARGET_TRIPLE = wasm32-wasi-pthread
42+ endif
3943
4044# These variables describe the locations of various files and directories in
4145# the source tree.
@@ -365,9 +369,9 @@ LIBWASI_EMULATED_SIGNAL_MUSL_OBJS = $(call objs,$(LIBWASI_EMULATED_SIGNAL_MUSL_S
365369
366370# These variables describe the locations of various files and
367371# directories in the generated sysroot tree.
368- SYSROOT_LIB := $(SYSROOT ) /lib/$(MULTIARCH_TRIPLE )
372+ SYSROOT_LIB := $(SYSROOT ) /lib/$(TARGET_TRIPLE )
369373SYSROOT_INC = $(SYSROOT ) /include
370- SYSROOT_SHARE = $(SYSROOT ) /share/$(MULTIARCH_TRIPLE )
374+ SYSROOT_SHARE = $(SYSROOT ) /share/$(TARGET_TRIPLE )
371375
372376# Files from musl's include directory that we don't want to install in the
373377# sysroot's include directory.
@@ -692,7 +696,7 @@ check-symbols: startup_files libc
692696
693697 # Check that the computed metadata matches the expected metadata.
694698 # This ignores whitespace because on Windows the output has CRLF line endings.
695- diff -wur "$(CURDIR)/expected/$(MULTIARCH_TRIPLE)/$(THREAD_MODEL )" "$(SYSROOT_SHARE)"
699+ diff -wur "$(CURDIR)/expected/$(TARGET_TRIPLE )" "$(SYSROOT_SHARE)"
696700
697701install : finish
698702 mkdir -p " $( INSTALL_DIR) "
0 commit comments