https://bugs.gentoo.org/show_bug.cgi?id=352265 Make sure LDFLAGS comes first, such that all libraries are considered, and not discarded when --as-needed is in effect. --- OS/Makefile-Base +++ OS/Makefile-Base @@ -327,12 +327,12 @@ $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) version.c rm -f exim @echo "$(LNCC) -o exim" - $(FE)$(PURIFY) $(LNCC) -o exim $(LFLAGS) $(OBJ_EXIM) version.o \ + $(FE)$(PURIFY) $(LNCC) -o exim $(LDFLAGS) $(OBJ_EXIM) version.o \ routers/routers.a transports/transports.a lookups/lookups.a \ auths/auths.a pdkim/pdkim.a \ $(LIBRESOLV) $(LIBS) $(LIBS_EXIM) $(IPV6_LIBS) $(EXTRALIBS) \ $(EXTRALIBS_EXIM) $(DBMLIB) $(LOOKUP_LIBS) $(AUTH_LIBS) \ - $(PERL_LIBS) $(TLS_LIBS) $(PCRE_LIBS) $(LDFLAGS) + $(PERL_LIBS) $(TLS_LIBS) $(PCRE_LIBS) $(LFLAGS) @if [ x"$(STRIP_COMMAND)" != x"" ]; then \ echo $(STRIP_COMMAND) exim; \ $(STRIP_COMMAND) exim; \