From owner-svn-src-all@freebsd.org Fri Jul 3 00:09:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4C2D4363586; Fri, 3 Jul 2020 00:09:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49yb1h189Vz4RYl; Fri, 3 Jul 2020 00:09:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E1CE122C9C; Fri, 3 Jul 2020 00:09:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06309hhb099590; Fri, 3 Jul 2020 00:09:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06309gcC099579; Fri, 3 Jul 2020 00:09:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202007030009.06309gcC099579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 3 Jul 2020 00:09:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362902 - in head/lib/csu: . aarch64 amd64 arm i386 mips powerpc powerpc64 riscv X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/lib/csu: . aarch64 amd64 arm i386 mips powerpc powerpc64 riscv X-SVN-Commit-Revision: 362902 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2020 00:09:44 -0000 Author: jhb Date: Fri Jul 3 00:09:41 2020 New Revision: 362902 URL: https://svnweb.freebsd.org/changeset/base/362902 Log: Consolidate duplicated logic in csu Makefiles to lib/csu/Makefile.inc. Reviewed by: kib Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25537 Modified: head/lib/csu/Makefile.inc head/lib/csu/aarch64/Makefile head/lib/csu/amd64/Makefile head/lib/csu/arm/Makefile head/lib/csu/i386/Makefile head/lib/csu/mips/Makefile head/lib/csu/powerpc/Makefile head/lib/csu/powerpc64/Makefile head/lib/csu/riscv/Makefile Modified: head/lib/csu/Makefile.inc ============================================================================== --- head/lib/csu/Makefile.inc Thu Jul 2 22:59:05 2020 (r362901) +++ head/lib/csu/Makefile.inc Fri Jul 3 00:09:41 2020 (r362902) @@ -8,15 +8,52 @@ NO_WMISSING_VARIABLE_DECLARATIONS= .if !defined(BUILDING_TESTS) +OBJS+= Scrt1.o crt1.o gcrt1.o OBJS+= crtbegin.o crtbeginS.o crtbeginT.o OBJS+= crtend.o crtendS.o +OBJS+= crti.o crtn.o +CRT1OBJS+= crtbrand.o ignore_init_note.o + ACFLAGS+= -DLOCORE CFLAGS+= -fno-asynchronous-unwind-tables CFLAGS+= -fno-omit-frame-pointer +CFLAGS+= -I${.CURDIR:H}/common \ + -I${SRCTOP}/lib/libc/include CFLAGS_CRTS= -DSHARED ${PICFLAG} + +FILES= ${OBJS} +FILESMODE= ${LIBMODE} +FILESOWN= ${LIBOWN} +FILESGRP= ${LIBGRP} +FILESDIR= ${LIBDIR} +# These FILES qualify as libraries for the purpose of LIBRARIES_ONLY. +.undef LIBRARIES_ONLY + +CLEANFILES+= ${OBJS} ${CRT1OBJS} crt1_c.o gcrt1_c.o Scrt1_c.o + +crt1.o: crt1_c.o ${CRT1OBJS} + ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC:M*.o} +.if ${MACHINE_ARCH} == "i386" + ${OBJCOPY} --localize-symbol _start1 crt1.o +.endif + +gcrt1_c.o: crt1_c.c + ${CC} ${CFLAGS} -DGCRT -c -o ${.TARGET} ${.CURDIR}/crt1_c.c + +gcrt1.o: gcrt1_c.o ${CRT1OBJS} + ${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 ${CRT1OBJS} + ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC:M*.o} +.if ${MACHINE_ARCH} == "i386" + ${OBJCOPY} --localize-symbol _start1 crt1.o +.endif crtbegin.o: crtbegin.c crtbeginS.o: crtbegin.c Modified: head/lib/csu/aarch64/Makefile ============================================================================== --- head/lib/csu/aarch64/Makefile Thu Jul 2 22:59:05 2020 (r362901) +++ head/lib/csu/aarch64/Makefile Fri Jul 3 00:09:41 2020 (r362902) @@ -2,37 +2,8 @@ .PATH: ${.CURDIR:H}/common -SRCS= crti.S crtn.S -OBJS= ${SRCS:N*.h:R:S/$/.o/g} -OBJS+= Scrt1.o crt1.o gcrt1.o -CFLAGS+= -I${.CURDIR:H}/common \ - -I${SRCTOP}/lib/libc/include CFLAGS+= -DCRT_IRELOC_SUPPRESS -FILES= ${OBJS} -FILESMODE= ${LIBMODE} -FILESOWN= ${LIBOWN} -FILESGRP= ${LIBGRP} -FILESDIR= ${LIBDIR} -# These FILES qualify as libraries for the purpose of LIBRARIES_ONLY. -.undef LIBRARIES_ONLY - -CLEANFILES= ${OBJS} crt1_c.o crt1_s.o gcrt1_c.o Scrt1_c.o -CLEANFILES+= crtbrand.o ignore_init_note.o - -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:M*.o} - -crt1.o: crt1_c.o crt1_s.o crtbrand.o ignore_init_note.o - ${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:M*.o} +CRT1OBJS+= crt1_s.o .include Modified: head/lib/csu/amd64/Makefile ============================================================================== --- head/lib/csu/amd64/Makefile Thu Jul 2 22:59:05 2020 (r362901) +++ head/lib/csu/amd64/Makefile Fri Jul 3 00:09:41 2020 (r362902) @@ -2,37 +2,7 @@ .PATH: ${.CURDIR:H}/common -SRCS= crti.S crtn.S -OBJS= ${SRCS:N*.h:R:S/$/.o/g} -OBJS+= Scrt1.o crt1.o gcrt1.o -CFLAGS+= -I${.CURDIR} -I${.CURDIR:H}/common \ - -I${SRCTOP}/lib/libc/include +CFLAGS+= -I${.CURDIR} CFLAGS+= -fno-omit-frame-pointer -DCRT_IRELOC_RELA - -FILES= ${OBJS} -FILESMODE= ${LIBMODE} -FILESOWN= ${LIBOWN} -FILESGRP= ${LIBGRP} -FILESDIR= ${LIBDIR} -# These FILES qualify as libraries for the purpose of LIBRARIES_ONLY. -.undef LIBRARIES_ONLY - -CLEANFILES= ${OBJS} crt1_c.o gcrt1_c.o Scrt1_c.o -CLEANFILES+= crtbrand.o ignore_init_note.o - -gcrt1_c.o: crt1_c.c - ${CC} ${CFLAGS} -DGCRT -c -o ${.TARGET} ${.CURDIR}/crt1_c.c - -gcrt1.o: gcrt1_c.o crtbrand.o ignore_init_note.o - ${LD} ${_LDFLAGS} -o gcrt1.o -r crtbrand.o ignore_init_note.o gcrt1_c.o - -crt1.o: crt1_c.o crtbrand.o ignore_init_note.o - ${LD} ${_LDFLAGS} -o crt1.o -r crtbrand.o ignore_init_note.o crt1_c.o - -Scrt1_c.o: crt1_c.c - ${CC} ${CFLAGS} -fPIC -DPIC -c -o ${.TARGET} ${.CURDIR}/crt1_c.c - -Scrt1.o: Scrt1_c.o crtbrand.o ignore_init_note.o - ${LD} ${_LDFLAGS} -o Scrt1.o -r crtbrand.o ignore_init_note.o Scrt1_c.o .include Modified: head/lib/csu/arm/Makefile ============================================================================== --- head/lib/csu/arm/Makefile Thu Jul 2 22:59:05 2020 (r362901) +++ head/lib/csu/arm/Makefile Fri Jul 3 00:09:41 2020 (r362902) @@ -2,40 +2,8 @@ .PATH: ${.CURDIR:H}/common -SRCS= crti.S crtn.S -OBJS= ${SRCS:N*.h:R:S/$/.o/g} -OBJS+= Scrt1.o crt1.o gcrt1.o -CFLAGS+= -I${.CURDIR:H}/common \ - -I${SRCTOP}/lib/libc/include CFLAGS+= -DCRT_IRELOC_SUPPRESS -FILES= ${OBJS} -FILESMODE= ${LIBMODE} -FILESOWN= ${LIBOWN} -FILESGRP= ${LIBGRP} -FILESDIR= ${LIBDIR} -# These FILES qualify as libraries for the purpose of LIBRARIES_ONLY. -.undef LIBRARIES_ONLY - -CLEANFILES= ${OBJS} crt1_c.o crt1_s.o gcrt1_c.o Scrt1_c.o -CLEANFILES+= crtbrand.o ignore_init_note.o - -crt1_c.o: crt1_c.c - ${CC} ${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:M*.o} - -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: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:M*.o} +CRT1OBJS+= crt1_s.o .include Modified: head/lib/csu/i386/Makefile ============================================================================== --- head/lib/csu/i386/Makefile Thu Jul 2 22:59:05 2020 (r362901) +++ head/lib/csu/i386/Makefile Fri Jul 3 00:09:41 2020 (r362902) @@ -2,39 +2,9 @@ .PATH: ${.CURDIR:H}/common -SRCS= crti.S crtn.S -OBJS= ${SRCS:N*.h:R:S/$/.o/g} -OBJS+= Scrt1.o crt1.o gcrt1.o -CFLAGS+= -I${.CURDIR} -I${.CURDIR:H}/common \ - -I${SRCTOP}/lib/libc/include +CFLAGS+= -I${.CURDIR} CFLAGS+= -DCRT_IRELOC_REL -FILES= ${OBJS} -FILESMODE= ${LIBMODE} -FILESOWN= ${LIBOWN} -FILESGRP= ${LIBGRP} -FILESDIR= ${LIBDIR} -# These FILES qualify as libraries for the purpose of LIBRARIES_ONLY. -.undef LIBRARIES_ONLY - -CLEANFILES= ${OBJS} crt1_c.o crt1_s.o gcrt1_c.o Scrt1_c.o -CLEANFILES+= crtbrand.o ignore_init_note.o - -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:M*.o} - -crt1.o: crt1_c.o crt1_s.o crtbrand.o ignore_init_note.o - ${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:M*.o} - ${OBJCOPY} --localize-symbol _start1 Scrt1.o +CRT1OBJS+= crt1_s.o .include Modified: head/lib/csu/mips/Makefile ============================================================================== --- head/lib/csu/mips/Makefile Thu Jul 2 22:59:05 2020 (r362901) +++ head/lib/csu/mips/Makefile Fri Jul 3 00:09:41 2020 (r362902) @@ -2,37 +2,6 @@ .PATH: ${.CURDIR:H}/common -SRCS= crti.S crtn.S -OBJS= ${SRCS:N*.h:R:S/$/.o/g} -OBJS+= Scrt1.o crt1.o gcrt1.o -CFLAGS+= -I${.CURDIR:H}/common \ - -I${SRCTOP}/lib/libc/include CFLAGS+= -DCRT_IRELOC_SUPPRESS - -FILES= ${OBJS} -FILESMODE= ${LIBMODE} -FILESOWN= ${LIBOWN} -FILESGRP= ${LIBGRP} -FILESDIR= ${LIBDIR} -# These FILES qualify as libraries for the purpose of LIBRARIES_ONLY. -.undef LIBRARIES_ONLY - -CLEANFILES= ${OBJS} crt1_c.o gcrt1_c.o Scrt1_c.o -CLEANFILES+= crtbrand.o ignore_init_note.o - -gcrt1_c.o: crt1_c.c - ${CC} ${CFLAGS} -DGCRT -c -o ${.TARGET} ${.CURDIR}/crt1_c.c - -gcrt1.o: gcrt1_c.o crtbrand.o ignore_init_note.o - ${LD} ${_LDFLAGS} -o gcrt1.o -r crtbrand.o ignore_init_note.o gcrt1_c.o - -crt1.o: crt1_c.o crtbrand.o ignore_init_note.o - ${LD} ${_LDFLAGS} -o crt1.o -r crtbrand.o ignore_init_note.o crt1_c.o - -Scrt1_c.o: crt1_c.c - ${CC} ${CFLAGS} -fPIC -DPIC -c -o ${.TARGET} ${.CURDIR}/crt1_c.c - -Scrt1.o: Scrt1_c.o crtbrand.o ignore_init_note.o - ${LD} ${_LDFLAGS} -o Scrt1.o -r crtbrand.o ignore_init_note.o Scrt1_c.o .include Modified: head/lib/csu/powerpc/Makefile ============================================================================== --- head/lib/csu/powerpc/Makefile Thu Jul 2 22:59:05 2020 (r362901) +++ head/lib/csu/powerpc/Makefile Fri Jul 3 00:09:41 2020 (r362902) @@ -2,37 +2,7 @@ .PATH: ${.CURDIR:H}/common -SRCS= crti.S crtn.S crtsavres.S -OBJS= ${SRCS:N*.h:R:S/$/.o/g} -OBJS+= Scrt1.o crt1.o gcrt1.o -CFLAGS+= -I${.CURDIR:H}/common \ - -I${SRCTOP}/lib/libc/include +OBJS+= crtsavres.o CFLAGS+= -DCRT_IRELOC_SUPPRESS - -FILES= ${OBJS} -FILESMODE= ${LIBMODE} -FILESOWN= ${LIBOWN} -FILESGRP= ${LIBGRP} -FILESDIR= ${LIBDIR} -# These FILES qualify as libraries for the purpose of LIBRARIES_ONLY. -.undef LIBRARIES_ONLY - -CLEANFILES= ${OBJS} crt1_c.o gcrt1_c.o Scrt1_c.o -CLEANFILES+= crtbrand.o ignore_init_note.o - -gcrt1_c.o: crt1_c.c - ${CC} ${CFLAGS} -DGCRT -c -o ${.TARGET} ${.CURDIR}/crt1_c.c - -gcrt1.o: gcrt1_c.o crtbrand.o ignore_init_note.o - ${LD} ${_LDFLAGS} -o gcrt1.o -r crtbrand.o ignore_init_note.o gcrt1_c.o - -crt1.o: crt1_c.o crtbrand.o ignore_init_note.o - ${LD} ${_LDFLAGS} -o crt1.o -r crtbrand.o ignore_init_note.o crt1_c.o - -Scrt1_c.o: crt1_c.c - ${CC} ${CFLAGS} -fPIC -DPIC -c -o ${.TARGET} ${.CURDIR}/crt1_c.c - -Scrt1.o: Scrt1_c.o crtbrand.o ignore_init_note.o - ${LD} ${_LDFLAGS} -o Scrt1.o -r crtbrand.o ignore_init_note.o Scrt1_c.o .include Modified: head/lib/csu/powerpc64/Makefile ============================================================================== --- head/lib/csu/powerpc64/Makefile Thu Jul 2 22:59:05 2020 (r362901) +++ head/lib/csu/powerpc64/Makefile Fri Jul 3 00:09:41 2020 (r362902) @@ -2,42 +2,14 @@ .PATH: ${.CURDIR:H}/common -SRCS= crti.S crtn.S -OBJS= ${SRCS:N*.h:R:S/$/.o/g} -OBJS+= Scrt1.o crt1.o crtsavres.o gcrt1.o -CFLAGS+= -I${.CURDIR} -I${.CURDIR:H}/common \ - -I${SRCTOP}/lib/libc/include \ +OBJS+= crtsavres.o +CFLAGS+= -I${.CURDIR} \ -mlongcall -DCRT_IRELOC_RELA -FILES= ${OBJS} -FILESMODE= ${LIBMODE} -FILESOWN= ${LIBOWN} -FILESGRP= ${LIBGRP} -FILESDIR= ${LIBDIR} -# These FILES qualify as libraries for the purpose of LIBRARIES_ONLY. -.undef LIBRARIES_ONLY - -CLEANFILES= ${OBJS} crt1_c.o gcrt1_c.o Scrt1_c.o -CLEANFILES+= crtbrand.o ignore_init_note.o CLEANFILES+= crtsavres.S # On powerpc64 crtsavres is an empty file crtsavres.S: touch ${.TARGET} - -gcrt1_c.o: crt1_c.c - ${CC} ${CFLAGS} -DGCRT -c -o ${.TARGET} ${.CURDIR}/crt1_c.c - -gcrt1.o: gcrt1_c.o crtbrand.o ignore_init_note.o - ${LD} ${_LDFLAGS} -o gcrt1.o -r crtbrand.o ignore_init_note.o gcrt1_c.o - -crt1.o: crt1_c.o crtbrand.o ignore_init_note.o - ${LD} ${_LDFLAGS} -o crt1.o -r crtbrand.o ignore_init_note.o crt1_c.o - -Scrt1_c.o: crt1_c.c - ${CC} ${CFLAGS} -fPIC -DPIC -c -o ${.TARGET} ${.CURDIR}/crt1_c.c - -Scrt1.o: Scrt1_c.o crtbrand.o ignore_init_note.o - ${LD} ${_LDFLAGS} -o Scrt1.o -r crtbrand.o ignore_init_note.o Scrt1_c.o .include Modified: head/lib/csu/riscv/Makefile ============================================================================== --- head/lib/csu/riscv/Makefile Thu Jul 2 22:59:05 2020 (r362901) +++ head/lib/csu/riscv/Makefile Fri Jul 3 00:09:41 2020 (r362902) @@ -2,37 +2,8 @@ .PATH: ${.CURDIR:H}/common -SRCS= crti.S crtn.S -OBJS= ${SRCS:N*.h:R:S/$/.o/g} -OBJS+= Scrt1.o crt1.o gcrt1.o -CFLAGS+= -I${.CURDIR:H}/common \ - -I${SRCTOP}/lib/libc/include CFLAGS+= -DCRT_IRELOC_SUPPRESS -FILES= ${OBJS} -FILESMODE= ${LIBMODE} -FILESOWN= ${LIBOWN} -FILESGRP= ${LIBGRP} -FILESDIR= ${LIBDIR} -# These FILES qualify as libraries for the purpose of LIBRARIES_ONLY. -.undef LIBRARIES_ONLY - -CLEANFILES= ${OBJS} crt1_c.o crt1_s.o gcrt1_c.o Scrt1_c.o -CLEANFILES+= crtbrand.o ignore_init_note.o - -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:M*.o} - -crt1.o: crt1_c.o crt1_s.o crtbrand.o ignore_init_note.o - ${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:M*.o} +CRT1OBJS+= crt1_s.o .include