From owner-svn-src-head@freebsd.org Fri Apr 7 19:53:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC6A1D330B7; Fri, 7 Apr 2017 19:53:16 +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 mx1.freebsd.org (Postfix) with ESMTPS id C4268A98; Fri, 7 Apr 2017 19:53:16 +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 v37JrFv9029934; Fri, 7 Apr 2017 19:53:15 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v37JrF4H029926; Fri, 7 Apr 2017 19:53:15 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201704071953.v37JrF4H029926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 7 Apr 2017 19:53:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316620 - in head/lib/csu: aarch64 amd64 arm i386 mips powerpc powerpc64 riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Apr 2017 19:53:17 -0000 Author: jhb Date: Fri Apr 7 19:53:14 2017 New Revision: 316620 URL: https://svnweb.freebsd.org/changeset/base/316620 Log: Rework r234502 to include a modified CFLAGS along with ACFLAGS. On most architectures crt objects are compiled in a multiple-step process so that sed can be run on the generated assembly. As the final step, the C compiler generates an object file from the modified assembly output. Currently this last step uses $CC with only $ACFLAGS. However, for other uses in the tree, $ACFLAGS is meant to include assembly-specific compiler flags that are in addition to $CFLAGS (see default .S.o rules bsd.suffixes.mk). In particular, external toolchains may require additional flags to select a non-default target which will be present in CFLAGS but not ACFLAGS. To support this while still mitigating the issue with CFLAGS described in r234502, include a modified CFLAGS that excludes "-g" when assembling the modified assembly files. Note that normally an assembler ($AS) is used to assemble .s flags to object files (see bsd.suffixes.mk). However, llvm-based toolchains do not currently have a stand-alone assembler. Reviewed by: imp Sponsored by: DARPA / AFRL Differential Revision: https://reviews.freebsd.org/D10085 Modified: 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/aarch64/Makefile ============================================================================== --- head/lib/csu/aarch64/Makefile Fri Apr 7 18:31:31 2017 (r316619) +++ head/lib/csu/aarch64/Makefile Fri Apr 7 19:53:14 2017 (r316620) @@ -27,20 +27,20 @@ crt1.s: crt1.c sed ${SED_FIX_NOTE} ${.TARGET} crt1.o: crt1.s - ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s + ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} crt1.s gcrt1.s: crt1.c ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c sed ${SED_FIX_NOTE} ${.TARGET} gcrt1.o: gcrt1.s - ${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s + ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s Scrt1.s: crt1.c ${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c sed ${SED_FIX_NOTE} ${.TARGET} Scrt1.o: Scrt1.s - ${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s + ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s .include Modified: head/lib/csu/amd64/Makefile ============================================================================== --- head/lib/csu/amd64/Makefile Fri Apr 7 18:31:31 2017 (r316619) +++ head/lib/csu/amd64/Makefile Fri Apr 7 19:53:14 2017 (r316620) @@ -28,20 +28,20 @@ crt1.s: crt1.c sed ${SED_FIX_NOTE} ${.TARGET} crt1.o: crt1.s - ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s + ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} crt1.s gcrt1.s: crt1.c ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c sed ${SED_FIX_NOTE} ${.TARGET} gcrt1.o: gcrt1.s - ${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s + ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s Scrt1.s: crt1.c ${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c sed ${SED_FIX_NOTE} ${.TARGET} Scrt1.o: Scrt1.s - ${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s + ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s .include Modified: head/lib/csu/arm/Makefile ============================================================================== --- head/lib/csu/arm/Makefile Fri Apr 7 18:31:31 2017 (r316619) +++ head/lib/csu/arm/Makefile Fri Apr 7 19:53:14 2017 (r316620) @@ -28,20 +28,20 @@ crt1.s: crt1.c sed ${SED_FIX_NOTE} ${.TARGET} crt1.o: crt1.s - ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s + ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} crt1.s gcrt1.s: crt1.c ${CC} ${CFLAGS} ${STATIC_CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c sed ${SED_FIX_NOTE} ${.TARGET} gcrt1.o: gcrt1.s - ${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s + ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s Scrt1.s: crt1.c ${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c sed ${SED_FIX_NOTE} ${.TARGET} Scrt1.o: Scrt1.s - ${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s + ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s .include Modified: head/lib/csu/i386/Makefile ============================================================================== --- head/lib/csu/i386/Makefile Fri Apr 7 18:31:31 2017 (r316619) +++ head/lib/csu/i386/Makefile Fri Apr 7 19:53:14 2017 (r316620) @@ -27,7 +27,7 @@ gcrt1_c.s: crt1_c.c sed ${SED_FIX_NOTE} ${.TARGET} gcrt1_c.o: gcrt1_c.s - ${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1_c.s + ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} gcrt1_c.s gcrt1.o: gcrt1_c.o crt1_s.o ${LD} ${_LDFLAGS} -o gcrt1.o -r crt1_s.o gcrt1_c.o @@ -37,7 +37,7 @@ crt1_c.s: crt1_c.c sed ${SED_FIX_NOTE} ${.TARGET} crt1_c.o: crt1_c.s - ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1_c.s + ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} crt1_c.s crt1.o: crt1_c.o crt1_s.o ${LD} ${_LDFLAGS} -o crt1.o -r crt1_s.o crt1_c.o @@ -48,7 +48,7 @@ Scrt1_c.s: crt1_c.c sed ${SED_FIX_NOTE} ${.TARGET} Scrt1_c.o: Scrt1_c.s - ${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1_c.s + ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} Scrt1_c.s Scrt1.o: Scrt1_c.o crt1_s.o ${LD} ${_LDFLAGS} -o Scrt1.o -r crt1_s.o Scrt1_c.o Modified: head/lib/csu/mips/Makefile ============================================================================== --- head/lib/csu/mips/Makefile Fri Apr 7 18:31:31 2017 (r316619) +++ head/lib/csu/mips/Makefile Fri Apr 7 19:53:14 2017 (r316620) @@ -27,20 +27,20 @@ crt1.s: crt1.c sed ${SED_FIX_NOTE} ${.TARGET} crt1.o: crt1.s - ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s + ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} crt1.s gcrt1.s: crt1.c ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c sed ${SED_FIX_NOTE} ${.TARGET} gcrt1.o: gcrt1.s - ${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s + ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s Scrt1.s: crt1.c ${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c sed ${SED_FIX_NOTE} ${.TARGET} Scrt1.o: Scrt1.s - ${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s + ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s .include Modified: head/lib/csu/powerpc/Makefile ============================================================================== --- head/lib/csu/powerpc/Makefile Fri Apr 7 18:31:31 2017 (r316619) +++ head/lib/csu/powerpc/Makefile Fri Apr 7 19:53:14 2017 (r316620) @@ -27,20 +27,20 @@ crt1.s: crt1.c sed ${SED_FIX_NOTE} ${.TARGET} crt1.o: crt1.s - ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s + ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} crt1.s gcrt1.s: crt1.c ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c sed ${SED_FIX_NOTE} ${.TARGET} gcrt1.o: gcrt1.s - ${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s + ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s Scrt1.s: crt1.c ${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c sed ${SED_FIX_NOTE} ${.TARGET} Scrt1.o: Scrt1.s - ${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s + ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s .include Modified: head/lib/csu/powerpc64/Makefile ============================================================================== --- head/lib/csu/powerpc64/Makefile Fri Apr 7 18:31:31 2017 (r316619) +++ head/lib/csu/powerpc64/Makefile Fri Apr 7 19:53:14 2017 (r316620) @@ -28,20 +28,20 @@ crt1.s: crt1.c sed ${SED_FIX_NOTE} ${.TARGET} crt1.o: crt1.s - ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s + ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} crt1.s gcrt1.s: crt1.c ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c sed ${SED_FIX_NOTE} ${.TARGET} gcrt1.o: gcrt1.s - ${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s + ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s Scrt1.s: crt1.c ${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c sed ${SED_FIX_NOTE} ${.TARGET} Scrt1.o: Scrt1.s - ${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s + ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s .include Modified: head/lib/csu/riscv/Makefile ============================================================================== --- head/lib/csu/riscv/Makefile Fri Apr 7 18:31:31 2017 (r316619) +++ head/lib/csu/riscv/Makefile Fri Apr 7 19:53:14 2017 (r316620) @@ -27,20 +27,20 @@ crt1.s: crt1.c sed ${SED_FIX_NOTE} ${.TARGET} crt1.o: crt1.s - ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s + ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} crt1.s gcrt1.s: crt1.c ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c sed ${SED_FIX_NOTE} ${.TARGET} gcrt1.o: gcrt1.s - ${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s + ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s Scrt1.s: crt1.c ${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c sed ${SED_FIX_NOTE} ${.TARGET} Scrt1.o: Scrt1.s - ${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s + ${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s .include