diff --git a/Makefile b/Makefile index 41d4f1f2..7f79c713 100644 --- a/Makefile +++ b/Makefile @@ -506,7 +506,8 @@ PIC_OBJS = \ # to CC. This is a workaround for a Windows command line size limitation. See # the `%.a` rule below for details. $(SYSROOT_LIB)/%.so: $(OBJDIR)/%.so.a $(BUILTINS_LIB) - $(CC) -nodefaultlibs -shared -o $@ -Wl,--whole-archive $< -Wl,--no-whole-archive $(BUILTINS_LIB) + $(CC) -nodefaultlibs -shared --sysroot=$(SYSROOT) \ + -o $@ -Wl,--whole-archive $< -Wl,--no-whole-archive $(BUILTINS_LIB) $(OBJDIR)/libc.so.a: $(LIBC_SO_OBJS) $(MUSL_PRINTSCAN_LONG_DOUBLE_SO_OBJS)