Skip to content

Commit fb9c922

Browse files
authored
Add a separate install target for threaded libc (#331)
Produce a different sysroot directory for threaded target. Restructure `expected` directory to correspond to the target.
1 parent f687048 commit fb9c922

File tree

9 files changed

+10
-6
lines changed

9 files changed

+10
-6
lines changed

Makefile

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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.
3736
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
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)
369373
SYSROOT_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

697701
install: finish
698702
mkdir -p "$(INSTALL_DIR)"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)