From fab3862bfcc0641265aa6a53098c231ecc1f038d Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Tue, 13 Aug 2024 21:15:30 +0900 Subject: [PATCH] fix compiler-rt for shared libraries when building a shared library, specify all CFLAGS because it can contain options like -resource-dir. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 8c4ee9d3..b96f45bb 100644 --- a/Makefile +++ b/Makefile @@ -619,12 +619,12 @@ PIC_OBJS = \ # Note: libc.so is special because it shouldn't link to libc.so. $(SYSROOT_LIB)/libc.so: $(OBJDIR)/libc.so.a $(BUILTINS_LIB) - $(CC) --target=$(TARGET_TRIPLE) -nodefaultlibs -shared --sysroot=$(SYSROOT) \ + $(CC) $(CFLAGS) -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) --target=$(TARGET_TRIPLE) -shared --sysroot=$(SYSROOT) \ + $(CC) $(CFLAGS) -shared --sysroot=$(SYSROOT) \ -o $@ -Wl,--whole-archive $< -Wl,--no-whole-archive \ -Wl,--allow-undefined-file=linker-provided-symbols.txt