From owner-svn-src-all@freebsd.org Sat Dec 2 00:06:59 2017 Return-Path: Delivered-To: svn-src-all@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 9C2B5DBB15B; Sat, 2 Dec 2017 00:06:59 +0000 (UTC) (envelope-from imp@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 76C6077759; Sat, 2 Dec 2017 00:06:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vB206wHi033553; Sat, 2 Dec 2017 00:06:58 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vB206wUE033547; Sat, 2 Dec 2017 00:06:58 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712020006.vB206wUE033547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 2 Dec 2017 00:06:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326441 - in head/stand: . libsa mips/beri/boot2 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand: . libsa mips/beri/boot2 X-SVN-Commit-Revision: 326441 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.25 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: Sat, 02 Dec 2017 00:06:59 -0000 Author: imp Date: Sat Dec 2 00:06:58 2017 New Revision: 326441 URL: https://svnweb.freebsd.org/changeset/base/326441 Log: Minor flags cleanup Move kernel includes and libsa includes together at the top of defs.mk Move all machine specific defines from Makefile.inc to their friends in defs.mk. Add comments and remove now useless junk after the move. Sponsored by: Netflix Modified: head/stand/Makefile.inc head/stand/defs.mk head/stand/libsa/Makefile head/stand/mips/beri/boot2/Makefile Modified: head/stand/Makefile.inc ============================================================================== --- head/stand/Makefile.inc Sat Dec 2 00:06:52 2017 (r326440) +++ head/stand/Makefile.inc Sat Dec 2 00:06:58 2017 (r326441) @@ -1,53 +1,3 @@ # $FreeBSD$ .include "defs.mk" - -.if !defined(__BOOT_MAKEFILE_INC__) -__BOOT_MAKEFILE_INC__=${MFILE} - -CFLAGS+=-I${SASRC} - -SSP_CFLAGS= - -# Add in the no float / no SIMD stuff and announce we're freestanding -# aarch64 and riscv don't have -msoft-float, but all others do. riscv -# currently has no /boot/loader, but may soon. -CFLAGS+= -ffreestanding ${CFLAGS_NO_SIMD} -.if ${MACHINE_CPUARCH} == "aarch64" -CFLAGS+= -mgeneral-regs-only -.elif ${MACHINE_CPUARCH} != "riscv" -CFLAGS+= -msoft-float -.endif - -.if ${MACHINE_CPUARCH} == "i386" || (${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 1) -CFLAGS+= -march=i386 -CFLAGS.gcc+= -mpreferred-stack-boundary=2 -.endif - - -.if ${MACHINE_CPUARCH} == "arm" -# Do not generate movt/movw, because the relocation fixup for them does not -# translate to the -Bsymbolic -pie format required by self_reloc() in loader(8). -# Also, the fpu is not available in a standalone environment. -.if ${COMPILER_VERSION} < 30800 -CFLAGS.clang+= -mllvm -arm-use-movt=0 -.else -CFLAGS.clang+= -mno-movt -.endif -CFLAGS.clang+= -mfpu=none -.endif - -# The boot loader build uses dd status=none, where possible, for reproducible -# build output (since performance varies from run to run). Trouble is that -# option was recently (10.3) added to FreeBSD and is non-standard. Only use it -# when this test succeeds rather than require dd to be a bootstrap tool. -DD_NOSTATUS!=(dd status=none count=0 2> /dev/null && echo status=none) || true -DD=dd ${DD_NOSTATUS} - -.if ${MK_LOADER_FORCE_LE} != "no" -.if ${MACHINE_ARCH} == "powerpc64" -CFLAGS+= -mlittle-endian -.endif -.endif - -.endif Modified: head/stand/defs.mk ============================================================================== --- head/stand/defs.mk Sat Dec 2 00:06:52 2017 (r326440) +++ head/stand/defs.mk Sat Dec 2 00:06:58 2017 (r326441) @@ -39,6 +39,8 @@ LIBSA32= ${BOOTOBJ}/libsa32/libsa32.a .endif # Standard options: +CFLAGS+= -I${SASRC} +CFLAGS+= -I${SYSDIR} # Filesystem support .if ${LOADER_CD9660_SUPPORT:Uno} == "yes" @@ -104,7 +106,7 @@ LIBGELIBOOT= ${BOOTOBJ}/geli/libgeliboot.a .endif .endif -CFLAGS+= -I${SYSDIR} +# Machine specific flags for all builds here # All PowerPC builds are 32 bit. We have no 64-bit loaders on powerpc # or powerpc64. @@ -120,6 +122,49 @@ CFLAGS+= -m32 -mcpu=i386 # LD_FLAGS is passed directly to ${LD}, not via ${CC}: LD_FLAGS+= -m elf_i386_fbsd AFLAGS+= --32 +.endif + +SSP_CFLAGS= + +# Add in the no float / no SIMD stuff and announce we're freestanding +# aarch64 and riscv don't have -msoft-float, but all others do. riscv +# currently has no /boot/loader, but may soon. +CFLAGS+= -ffreestanding ${CFLAGS_NO_SIMD} +.if ${MACHINE_CPUARCH} == "aarch64" +CFLAGS+= -mgeneral-regs-only +.elif ${MACHINE_CPUARCH} != "riscv" +CFLAGS+= -msoft-float +.endif + +.if ${MACHINE_CPUARCH} == "i386" || (${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 1) +CFLAGS+= -march=i386 +CFLAGS.gcc+= -mpreferred-stack-boundary=2 +.endif + + +.if ${MACHINE_CPUARCH} == "arm" +# Do not generate movt/movw, because the relocation fixup for them does not +# translate to the -Bsymbolic -pie format required by self_reloc() in loader(8). +# Also, the fpu is not available in a standalone environment. +.if ${COMPILER_VERSION} < 30800 +CFLAGS.clang+= -mllvm -arm-use-movt=0 +.else +CFLAGS.clang+= -mno-movt +.endif +CFLAGS.clang+= -mfpu=none +.endif + +# The boot loader build uses dd status=none, where possible, for reproducible +# build output (since performance varies from run to run). Trouble is that +# option was recently (10.3) added to FreeBSD and is non-standard. Only use it +# when this test succeeds rather than require dd to be a bootstrap tool. +DD_NOSTATUS!=(dd status=none count=0 2> /dev/null && echo status=none) || true +DD=dd ${DD_NOSTATUS} + +.if ${MK_LOADER_FORCE_LE} != "no" +.if ${MACHINE_ARCH} == "powerpc64" +CFLAGS+= -mlittle-endian +.endif .endif # Make sure we use the machine link we're about to create Modified: head/stand/libsa/Makefile ============================================================================== --- head/stand/libsa/Makefile Sat Dec 2 00:06:52 2017 (r326440) +++ head/stand/libsa/Makefile Sat Dec 2 00:06:58 2017 (r326441) @@ -19,8 +19,6 @@ LIB?= sa NO_PIC= WARNS?= 0 -CFLAGS+= -I${SASRC} - # standalone components and stuff we have modified locally SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c environment.c getopt.c gets.c \ globals.c pager.c panic.c printf.c strdup.c strerror.c strtol.c strtoul.c \ Modified: head/stand/mips/beri/boot2/Makefile ============================================================================== --- head/stand/mips/beri/boot2/Makefile Sat Dec 2 00:06:52 2017 (r326440) +++ head/stand/mips/beri/boot2/Makefile Sat Dec 2 00:06:58 2017 (r326441) @@ -48,7 +48,6 @@ MAN= AFLAGS= -G0 CFLAGS+= -I${.CURDIR} \ - -I${SASRC} \ -I${LDRSRC} \ -D_KERNEL \ -Wall \