Skip to content

Commit

Permalink
Fix wasi-sdk windows job
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
yamt committed Aug 24, 2024
1 parent b115390 commit 10d410c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 10d410c

Please sign in to comment.