Skip to content

Commit

Permalink
fix compiler-rt for shared libraries
Browse files Browse the repository at this point in the history
when building a shared library, specify all CFLAGS because
it can contain options like -resource-dir.
  • Loading branch information
yamt committed Aug 13, 2024
1 parent cd882ed commit fab3862
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit fab3862

Please sign in to comment.