csh(1): Allow to bootstrap with -flto.
authorzrj <rimvydas.jasinskas@gmail.com>
Wed, 5 Oct 2016 11:35:30 +0000 (14:35 +0300)
committerzrj <zrj@dragonflybsd.org>
Wed, 19 Oct 2016 15:45:44 +0000 (18:45 +0300)
tcsh(1) replaces malloc, thus with LTO sees multiple symbols.

bin/csh/Makefile

index d7f32a9..d577e56 100644 (file)
@@ -51,6 +51,12 @@ LDADD=       -lprivate_ncurses -lcrypt
 LDFLAGS+=      -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
 .endif
 
+.if defined(BOOTSTRAPPING)
+. if ${CFLAGS:M-flto}
+LDFLAGS+=      -Wl,--allow-multiple-definition
+. endif
+.endif
+
 LINKS= ${BINDIR}/csh ${BINDIR}/tcsh
 
 CLEANFILES= ${GENHDRS} gethost.nx csh.1