From 10d410c205cccb4b51f0ea8625c8c01ae82b8d89 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Sat, 24 Aug 2024 18:03:28 +0900 Subject: [PATCH] Fix wasi-sdk windows job In the wasi-sdk windows job, when building libc.so, for some reasons, the -isystem option in CFLAGS here seems to prevent the linker from finding compiler-rt. I don't understand how it happens because: * Afaik, -isystem should not affect how the linker search objects * The compiler-rt path is explicitly given as BUILTINS_LIB Anyway, this commit tries to work it around by passing only a subset of the options. --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 63134117..952c267a 100644 --- a/Makefile +++ b/Makefile @@ -621,12 +621,14 @@ PIC_OBJS = \ # Note: --allow-undefined-file=linker-provided-symbols.txt is # a workaround for https://github.com/llvm/llvm-project/issues/103592 $(SYSROOT_LIB)/libc.so: $(OBJDIR)/libc.so.a $(BUILTINS_LIB) - $(CC) $(CFLAGS) -nodefaultlibs -shared --sysroot=$(SYSROOT) \ + $(CC) $(EXTRA_CFLAGS) --target=${TARGET_TRIPLE} -nodefaultlibs \ + -shared --sysroot=$(SYSROOT) \ -o $@ -Wl,--whole-archive $< -Wl,--no-whole-archive $(BUILTINS_LIB) \ -Wl,--allow-undefined-file=linker-provided-symbols.txt $(SYSROOT_LIB)/%.so: $(OBJDIR)/%.so.a $(SYSROOT_LIB)/libc.so - $(CC) $(CFLAGS) -shared --sysroot=$(SYSROOT) \ + $(CC) $(EXTRA_CFLAGS) --target=${TARGET_TRIPLE} \ + -shared --sysroot=$(SYSROOT) \ -o $@ -Wl,--whole-archive $< -Wl,--no-whole-archive \ -Wl,--allow-undefined-file=linker-provided-symbols.txt