@@ -32,10 +32,14 @@ BULK_MEMORY_THRESHOLD ?= 32
32
32
# Variables from this point on are not meant to be overridable via the
33
33
# make command-line.
34
34
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.
37
36
TARGET_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
39
43
40
44
# These variables describe the locations of various files and directories in
41
45
# the source tree.
@@ -365,9 +369,9 @@ LIBWASI_EMULATED_SIGNAL_MUSL_OBJS = $(call objs,$(LIBWASI_EMULATED_SIGNAL_MUSL_S
365
369
366
370
# These variables describe the locations of various files and
367
371
# directories in the generated sysroot tree.
368
- SYSROOT_LIB := $(SYSROOT ) /lib/$(MULTIARCH_TRIPLE )
372
+ SYSROOT_LIB := $(SYSROOT ) /lib/$(TARGET_TRIPLE )
369
373
SYSROOT_INC = $(SYSROOT ) /include
370
- SYSROOT_SHARE = $(SYSROOT ) /share/$(MULTIARCH_TRIPLE )
374
+ SYSROOT_SHARE = $(SYSROOT ) /share/$(TARGET_TRIPLE )
371
375
372
376
# Files from musl's include directory that we don't want to install in the
373
377
# sysroot's include directory.
@@ -692,7 +696,7 @@ check-symbols: startup_files libc
692
696
693
697
# Check that the computed metadata matches the expected metadata.
694
698
# 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)"
696
700
697
701
install : finish
698
702
mkdir -p " $( INSTALL_DIR) "
0 commit comments