YJIT: Simplify linker flavor check

By not allowlisting every OS that could have a GNU flavor linker,
it's also a bigger tent
This commit is contained in:
Alan Wu 2023-10-05 17:31:54 -04:00
parent 13bde94a9f
commit 8cb906d706

View File

@ -45,13 +45,11 @@ yjit-libobj: $(YJIT_LIBOBJ)
YJIT_LIB_SYMBOLS = $(YJIT_LIBS:.a=).symbols YJIT_LIB_SYMBOLS = $(YJIT_LIBS:.a=).symbols
$(YJIT_LIBOBJ): $(YJIT_LIBS) $(YJIT_LIBOBJ): $(YJIT_LIBS)
$(ECHO) 'partial linking $(YJIT_LIBS) into $@' $(ECHO) 'partial linking $(YJIT_LIBS) into $@'
ifneq ($(or $(findstring linux,$(target_os)),$(findstring bsd,$(target_os)),$(findstring dragonfly,$(target_os))),) ifneq ($(findstring darwin,$(target_os)),)
$(Q) $(LD) -r -o $@ --whole-archive $(YJIT_LIBS)
-$(Q) $(OBJCOPY) --wildcard --keep-global-symbol='$(SYMBOL_PREFIX)rb_*' $(@)
else ifneq ($(findstring darwin,$(target_os)),)
$(Q) $(CC) -nodefaultlibs -r -o $@ -exported_symbols_list $(YJIT_LIB_SYMBOLS) $(YJIT_LIBS) $(Q) $(CC) -nodefaultlibs -r -o $@ -exported_symbols_list $(YJIT_LIB_SYMBOLS) $(YJIT_LIBS)
else else
false $(Q) $(LD) -r -o $@ --whole-archive $(YJIT_LIBS)
-$(Q) $(OBJCOPY) --wildcard --keep-global-symbol='$(SYMBOL_PREFIX)rb_*' $(@)
endif endif
# For Darwin only: a list of symbols that we want the glommed Rust static lib to export. # For Darwin only: a list of symbols that we want the glommed Rust static lib to export.