Tue Jun 5 15:37:52 2018 UTC ()
Elide -nostdinc from LINK.c when linking object files since clang complains
about unused argument. Note that we can't remove CPPFLAGS from LINK.c because
it is used in the "shuttle rules" (from .c to executable).


(christos)
diff -r1.373 -r1.374 src/share/mk/bsd.lib.mk

cvs diff -r1.373 -r1.374 src/share/mk/bsd.lib.mk (expand / switch to unified diff)

--- src/share/mk/bsd.lib.mk 2018/06/05 00:56:51 1.373
+++ src/share/mk/bsd.lib.mk 2018/06/05 15:37:52 1.374
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: bsd.lib.mk,v 1.373 2018/06/05 00:56:51 christos Exp $ 1# $NetBSD: bsd.lib.mk,v 1.374 2018/06/05 15:37:52 christos Exp $
2# @(#)bsd.lib.mk 8.3 (Berkeley) 4/22/94 2# @(#)bsd.lib.mk 8.3 (Berkeley) 4/22/94
3 3
4.include <bsd.init.mk> 4.include <bsd.init.mk>
5.include <bsd.shlib.mk> 5.include <bsd.shlib.mk>
6.include <bsd.gcc.mk> 6.include <bsd.gcc.mk>
7# Pull in <bsd.sys.mk> here so we can override its .c.o rule 7# Pull in <bsd.sys.mk> here so we can override its .c.o rule
8.include <bsd.sys.mk> 8.include <bsd.sys.mk>
9 9
10LIBISMODULE?= no 10LIBISMODULE?= no
11LIBISPRIVATE?= no 11LIBISPRIVATE?= no
12LIBISCXX?= no 12LIBISCXX?= no
13 13
14.if ${LIBISMODULE} != "no" 14.if ${LIBISMODULE} != "no"
@@ -550,35 +550,35 @@ __archiveinstall: .USE @@ -550,35 +550,35 @@ __archiveinstall: .USE
550 ${_MKTARGET_INSTALL} 550 ${_MKTARGET_INSTALL}
551 ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ 551 ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
552 ${_INSTRANLIB} ${.ALLSRC} ${.TARGET} 552 ${_INSTRANLIB} ${.ALLSRC} ${.TARGET}
553.endif 553.endif
554 554
555__archivesymlinkpic: .USE 555__archivesymlinkpic: .USE
556 ${_MKTARGET_INSTALL} 556 ${_MKTARGET_INSTALL}
557 ${INSTALL_SYMLINK} ${.ALLSRC} ${.TARGET} 557 ${INSTALL_SYMLINK} ${.ALLSRC} ${.TARGET}
558 558
559.if !target(__buildstdlib) 559.if !target(__buildstdlib)
560__buildstdlib: .USE 560__buildstdlib: .USE
561 @echo building standard ${.TARGET:T:S/.o//:S/lib//} library 561 @echo building standard ${.TARGET:T:S/.o//:S/lib//} library
562 @rm -f ${.TARGET} 562 @rm -f ${.TARGET}
563 @${LINK.c} -nostdlib ${LDFLAGS} -r -o ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}` 563 @${LINK.c:S/-nostdinc//} -nostdlib ${LDFLAGS} -r -o ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}`
564.endif 564.endif
565 565
566.if !target(__buildproflib) 566.if !target(__buildproflib)
567__buildproflib: .USE 567__buildproflib: .USE
568 @echo building profiled ${.TARGET:T:S/.o//:S/lib//} library 568 @echo building profiled ${.TARGET:T:S/.o//:S/lib//} library
569 ${_MKTARGET_BUILD} 569 ${_MKTARGET_BUILD}
570 @rm -f ${.TARGET} 570 @rm -f ${.TARGET}
571 @${LINK.c} -nostdlib ${LDFLAGS} -r -o ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*po} | ${TSORT}` 571 @${LINK.c:S/-nostdinc//} -nostdlib ${LDFLAGS} -r -o ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*po} | ${TSORT}`
572.endif 572.endif
573 573
574DPSRCS+= ${_YLSRCS} 574DPSRCS+= ${_YLSRCS}
575CLEANFILES+= ${_YLSRCS} 575CLEANFILES+= ${_YLSRCS}
576 576
577${STOBJS} ${POBJS} ${GOBJS} ${SOBJS} ${LOBJS}: ${DPSRCS} 577${STOBJS} ${POBJS} ${GOBJS} ${SOBJS} ${LOBJS}: ${DPSRCS}
578 578
579${_LIB.a}:: ${STOBJS} __archivebuild 579${_LIB.a}:: ${STOBJS} __archivebuild
580 580
581${_LIB_p.a}:: ${POBJS} __archivebuild 581${_LIB_p.a}:: ${POBJS} __archivebuild
582 582
583${_LIB_pic.a}:: ${SOBJS} __archivebuild 583${_LIB_pic.a}:: ${SOBJS} __archivebuild
584 584