Skip to content

Commit 186cc80

Browse files
committed
[Bug #19831] Remove duplicate library warning
When building on macOS, we get a warning about duplicate libraries ld: warning: ignoring duplicate libraries: '-ldl', '-lobjc', '-lpthread' To fix it, we now append $(MAINLIBS) to LIBRUBYARG_SHARED (when shared is enabled), matching what's already done for LIBRUBYARG_STATIC. And we remove the now-redundant $(MAINLIBS) from the $(PROGRAM) link line, since $(LIBRUBYARG) carries it in both cases.
1 parent 11e4f99 commit 186cc80

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

configure.ac

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4342,6 +4342,9 @@ AS_IF([test -n "${LIBS}"], [
43424342
MAINFLAGS=`echo " $MAINLIBS " | sed "s|$libspat"'||;s/^ *//;s/ *$//'`
43434343
])
43444344
LIBRUBYARG_STATIC="${LIBRUBYARG_STATIC} \$(MAINLIBS)"
4345+
AS_IF([test "$enable_shared" = yes], [
4346+
LIBRUBYARG_SHARED="${LIBRUBYARG_SHARED} \$(MAINLIBS)"
4347+
])
43454348
CPPFLAGS="$CPPFLAGS "'$(DEFS) ${cppflags}'
43464349
AS_IF([test -n "${cflags+set}"], [
43474350
cflagspat=`eval echo '"'"${cflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/^ *$/ /'`

template/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ miniruby$(EXEEXT):
314314
$(PROGRAM):
315315
@$(RM) $@
316316
$(ECHO) linking $@
317-
$(Q) $(PURIFY) $(CC) $(EXE_LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(MAINLIBS) $(EXTLIBS) $(OUTFLAG)$@
317+
$(Q) $(PURIFY) $(CC) $(EXE_LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(EXTLIBS) $(OUTFLAG)$@
318318
$(Q) $(POSTLINK)
319319

320320
$(PROGRAM): @XRUBY_LIBPATHENV_WRAPPER@

0 commit comments

Comments
 (0)