Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Apr 2017 19:53:15 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
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
Message-ID:  <201704071953.v37JrF4H029926@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <bsd.lib.mk>

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 <bsd.lib.mk>

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 <bsd.lib.mk>

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 <bsd.lib.mk>

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 <bsd.lib.mk>

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 <bsd.lib.mk>

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 <bsd.lib.mk>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201704071953.v37JrF4H029926>