Author: jhb
Date: Fri Jun 26 19:46:30 2020
New Revision: 362660
URL: https://svnweb.freebsd.org/changeset/base/362660

Log:
  Only include object files from .ALLSRC when linking crt1 objects.
  
  Reported by:  np, peterj
  Reviewed by:  kib, emaste
  Sponsored by: DARPA
  Differential Revision:        https://reviews.freebsd.org/D25469

Modified:
  head/lib/csu/aarch64/Makefile
  head/lib/csu/arm/Makefile
  head/lib/csu/i386/Makefile
  head/lib/csu/riscv/Makefile

Modified: head/lib/csu/aarch64/Makefile
==============================================================================
--- head/lib/csu/aarch64/Makefile       Fri Jun 26 18:57:01 2020        
(r362659)
+++ head/lib/csu/aarch64/Makefile       Fri Jun 26 19:46:30 2020        
(r362660)
@@ -24,15 +24,15 @@ gcrt1_c.o: crt1_c.c
        ${CC} ${CFLAGS} -DGCRT -c -o ${.TARGET} ${.CURDIR}/crt1_c.c
 
 gcrt1.o: gcrt1_c.o crt1_s.o crtbrand.o ignore_init_note.o
-       ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC}
+       ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC:M*.o}
 
 crt1.o:        crt1_c.o crt1_s.o crtbrand.o ignore_init_note.o
-       ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC}
+       ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC:M*.o}
 
 Scrt1_c.o: crt1_c.c
        ${CC} ${CFLAGS} -fPIC -DPIC -c -o ${.TARGET} ${.CURDIR}/crt1_c.c
 
 Scrt1.o: Scrt1_c.o crt1_s.o crtbrand.o ignore_init_note.o
-       ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC}
+       ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC:M*.o}
 
 .include <bsd.lib.mk>

Modified: head/lib/csu/arm/Makefile
==============================================================================
--- head/lib/csu/arm/Makefile   Fri Jun 26 18:57:01 2020        (r362659)
+++ head/lib/csu/arm/Makefile   Fri Jun 26 19:46:30 2020        (r362660)
@@ -24,18 +24,18 @@ crt1_c.o: crt1_c.c
        ${CC} ${CFLAGS} ${STATIC_CFLAGS} -c -o ${.TARGET} ${.CURDIR}/crt1_c.c
 
 crt1.o:        crt1_c.o crt1_s.o crtbrand.o ignore_init_note.o
-       ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC}
+       ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC:M*.o}
 
 gcrt1_c.o: crt1_c.c
        ${CC} ${CFLAGS} ${STATIC_CFLAGS} -DGCRT -c -o ${.TARGET} 
${.CURDIR}/crt1_c.c
 
 gcrt1.o: gcrt1_c.o crt1_s.o crtbrand.o ignore_init_note.o
-       ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC}
+       ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC:M*.o}
 
 Scrt1_c.o: crt1_c.c
        ${CC} ${CFLAGS} -fPIC -DPIC -c -o ${.TARGET} ${.CURDIR}/crt1_c.c
 
 Scrt1.o: Scrt1_c.o crt1_s.o crtbrand.o ignore_init_note.o
-       ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC}
+       ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC:M*.o}
 
 .include <bsd.lib.mk>

Modified: head/lib/csu/i386/Makefile
==============================================================================
--- head/lib/csu/i386/Makefile  Fri Jun 26 18:57:01 2020        (r362659)
+++ head/lib/csu/i386/Makefile  Fri Jun 26 19:46:30 2020        (r362660)
@@ -24,17 +24,17 @@ gcrt1_c.o: crt1_c.c
        ${CC} ${CFLAGS} -DGCRT -c -o ${.TARGET} ${.CURDIR}/crt1_c.c
 
 gcrt1.o: gcrt1_c.o crt1_s.o crtbrand.o ignore_init_note.o
-       ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC}
+       ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC:M*.o}
 
 crt1.o:        crt1_c.o crt1_s.o crtbrand.o ignore_init_note.o
-       ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC}
+       ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC:M*.o}
        ${OBJCOPY} --localize-symbol _start1 crt1.o
 
 Scrt1_c.o: crt1_c.c
        ${CC} ${CFLAGS} -fPIC -DPIC -c -o ${.TARGET} ${.CURDIR}/crt1_c.c
 
 Scrt1.o: Scrt1_c.o crt1_s.o crtbrand.o ignore_init_note.o
-       ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC}
+       ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC:M*.o}
        ${OBJCOPY} --localize-symbol _start1 Scrt1.o
 
 .include <bsd.lib.mk>

Modified: head/lib/csu/riscv/Makefile
==============================================================================
--- head/lib/csu/riscv/Makefile Fri Jun 26 18:57:01 2020        (r362659)
+++ head/lib/csu/riscv/Makefile Fri Jun 26 19:46:30 2020        (r362660)
@@ -24,15 +24,15 @@ gcrt1_c.o: crt1_c.c
        ${CC} ${CFLAGS} -DGCRT -c -o ${.TARGET} ${.CURDIR}/crt1_c.c
 
 gcrt1.o: gcrt1_c.o crt1_s.o crtbrand.o ignore_init_note.o
-       ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC}
+       ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC:M*.o}
 
 crt1.o:        crt1_c.o crt1_s.o crtbrand.o ignore_init_note.o
-       ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC}
+       ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC:M*.o}
 
 Scrt1_c.o: crt1_c.c
        ${CC} ${CFLAGS} -fPIC -DPIC -c -o ${.TARGET} ${.CURDIR}/crt1_c.c
 
 Scrt1.o: Scrt1_c.o crt1_s.o crtbrand.o ignore_init_note.o
-       ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC}
+       ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC:M*.o}
 
 .include <bsd.lib.mk>
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to