From owner-svn-src-head@freebsd.org Fri Feb 16 00:17:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB726F01FD1; Fri, 16 Feb 2018 00:17:33 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 78D2577DF8; Fri, 16 Feb 2018 00:17:33 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73A6025EFD; Fri, 16 Feb 2018 00:17:33 +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 w1G0HXI6094650; Fri, 16 Feb 2018 00:17:33 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1G0HWq8094640; Fri, 16 Feb 2018 00:17:32 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802160017.w1G0HWq8094640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 16 Feb 2018 00:17:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329345 - in head: share/mk stand stand/fdt stand/ficl stand/geli stand/libsa stand/mips/uboot stand/uboot/fdt stand/uboot/lib stand/zfs X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: share/mk stand stand/fdt stand/ficl stand/geli stand/libsa stand/mips/uboot stand/uboot/fdt stand/uboot/lib stand/zfs X-SVN-Commit-Revision: 329345 X-SVN-Commit-Repository: base 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.25 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, 16 Feb 2018 00:17:34 -0000 Author: imp Date: Fri Feb 16 00:17:32 2018 New Revision: 329345 URL: https://svnweb.freebsd.org/changeset/base/329345 Log: Eliminate bsd.stand.mk and -fPIC 32-bit intel builds OK. We don't really need a bsd.stand.mk, and it was causing a -fPIC for the toolchain to be added (bogusly) when building on amd64. Pull all relevant defs back into defs.mk and delete bsd.stand.mk. This saves about 15-20k on i386 loader and zfsloader which when combined with Lua give us a lot more stack space in those constrained environments. Deleted: head/share/mk/bsd.stand.mk Modified: head/stand/defs.mk head/stand/fdt/Makefile head/stand/ficl/Makefile head/stand/geli/Makefile head/stand/libsa/Makefile head/stand/mips/uboot/Makefile head/stand/uboot/fdt/Makefile head/stand/uboot/lib/Makefile head/stand/zfs/Makefile Modified: head/stand/defs.mk ============================================================================== --- head/stand/defs.mk Thu Feb 15 21:30:30 2018 (r329344) +++ head/stand/defs.mk Fri Feb 16 00:17:32 2018 (r329345) @@ -101,8 +101,10 @@ SSP_CFLAGS= # 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+= -mgeneral-regs-only -fPIC +.elif ${MACHINE_CPUARCH} == "riscv" +CFLAGS+= -march=rv64imac -mabi=lp64 +.else CFLAGS+= -msoft-float .endif @@ -110,8 +112,10 @@ CFLAGS+= -msoft-float CFLAGS+= -march=i386 CFLAGS.gcc+= -mpreferred-stack-boundary=2 .endif +.if ${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 0 +CFLAGS+= -fPIC -mno-red-zone +.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). @@ -122,6 +126,7 @@ CFLAGS.clang+= -mllvm -arm-use-movt=0 CFLAGS.clang+= -mno-movt .endif CFLAGS.clang+= -mfpu=none +CFLAGS+= -fPIC .endif # The boot loader build uses dd status=none, where possible, for reproducible @@ -130,6 +135,10 @@ CFLAGS.clang+= -mfpu=none # 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 ${MACHINE_CPUARCH} == "mips" +CFLAGS+= -G0 -fno-pic -mno-abicalls +.endif .if ${MK_LOADER_FORCE_LE} != "no" .if ${MACHINE_ARCH} == "powerpc64" Modified: head/stand/fdt/Makefile ============================================================================== --- head/stand/fdt/Makefile Thu Feb 15 21:30:30 2018 (r329344) +++ head/stand/fdt/Makefile Fri Feb 16 00:17:32 2018 (r329345) @@ -17,5 +17,4 @@ CFLAGS+= -I${SYSDIR}/contrib/libfdt/ -I${LDRSRC} CFLAGS+= -Wformat -Wall -.include .include Modified: head/stand/ficl/Makefile ============================================================================== --- head/stand/ficl/Makefile Thu Feb 15 21:30:30 2018 (r329344) +++ head/stand/ficl/Makefile Fri Feb 16 00:17:32 2018 (r329345) @@ -12,7 +12,6 @@ BASE_SRCS= dict.c ficl.c fileaccess.c float.c loader.c SRCS= ${BASE_SRCS} sysdep.c softcore.c CLEANFILES+= softcore.c testmain testmain.o -.include .ifmake testmain CFLAGS+= -DTESTMAIN -D_TESTMAIN SRCS+= testmain.c Modified: head/stand/geli/Makefile ============================================================================== --- head/stand/geli/Makefile Thu Feb 15 21:30:30 2018 (r329344) +++ head/stand/geli/Makefile Fri Feb 16 00:17:32 2018 (r329345) @@ -34,5 +34,4 @@ SRCS+= geliboot_crypto.c g_eli_hmac.c g_eli_key.c g_e .PATH: ${SYSDIR}/opencrypto SRCS+= xform_aes_xts.c -.include .include Modified: head/stand/libsa/Makefile ============================================================================== --- head/stand/libsa/Makefile Thu Feb 15 21:30:30 2018 (r329344) +++ head/stand/libsa/Makefile Fri Feb 16 00:17:32 2018 (r329345) @@ -151,5 +151,4 @@ CFLAGS.bzipfs.c+= -I${SRCTOP}/contrib/bzip2 .PATH: ${SYSDIR}/libkern SRCS+= explicit_bzero.c -.include .include Modified: head/stand/mips/uboot/Makefile ============================================================================== --- head/stand/mips/uboot/Makefile Thu Feb 15 21:30:30 2018 (r329344) +++ head/stand/mips/uboot/Makefile Fri Feb 16 00:17:32 2018 (r329345) @@ -53,5 +53,4 @@ ubldr: ${OBJS} ldscript.abs ${.CURDIR}/ldscript.${MACH CLEANFILES+= ldscript.abs ldscript.pie ubldr ubldr.pie ubldr.bin -.include .include Modified: head/stand/uboot/fdt/Makefile ============================================================================== --- head/stand/uboot/fdt/Makefile Thu Feb 15 21:30:30 2018 (r329344) +++ head/stand/uboot/fdt/Makefile Fri Feb 16 00:17:32 2018 (r329345) @@ -18,5 +18,4 @@ CFLAGS+= -I${FDTSRC} # Pick up the bootstrap header for some interface items CFLAGS+= -I${LDRSRC} -.include .include Modified: head/stand/uboot/lib/Makefile ============================================================================== --- head/stand/uboot/lib/Makefile Thu Feb 15 21:30:30 2018 (r329344) +++ head/stand/uboot/lib/Makefile Fri Feb 16 00:17:32 2018 (r329345) @@ -24,5 +24,4 @@ CFLAGS+= -I${LDRSRC} CFLAGS+= -DDISK_DEBUG .endif -.include .include Modified: head/stand/zfs/Makefile ============================================================================== --- head/stand/zfs/Makefile Thu Feb 15 21:30:30 2018 (r329344) +++ head/stand/zfs/Makefile Fri Feb 16 00:17:32 2018 (r329345) @@ -17,5 +17,4 @@ CFLAGS+= -I${SYSDIR}/crypto/skein CFLAGS+= -Wformat -Wall -.include .include