From owner-svn-src-head@freebsd.org Mon Nov 6 15:22:26 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 56087E60AAD; Mon, 6 Nov 2017 15:22:26 +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 3003173346; Mon, 6 Nov 2017 15:22:26 +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 vA6FMP4B036636; Mon, 6 Nov 2017 15:22:25 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA6FMOtZ036626; Mon, 6 Nov 2017 15:22:24 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711061522.vA6FMOtZ036626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 6 Nov 2017 15:22:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325485 - in head/sys/boot: . fdt ficl geli i386 libsa32 ofw uboot zfs X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: . fdt ficl geli i386 libsa32 ofw uboot zfs X-SVN-Commit-Revision: 325485 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.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: Mon, 06 Nov 2017 15:22:26 -0000 Author: imp Date: Mon Nov 6 15:22:24 2017 New Revision: 325485 URL: https://svnweb.freebsd.org/changeset/base/325485 Log: Centralize all 32-bit builds on 64-bit platform stuff. Move the addition of the -m32 and other flags to defs.mk. Remove redunant copies of -m32 that come from multiple locations. Sponsored by: Netflix Modified: head/sys/boot/defs.mk head/sys/boot/fdt/Makefile head/sys/boot/ficl.mk head/sys/boot/ficl/Makefile head/sys/boot/geli/Makefile head/sys/boot/i386/Makefile.inc head/sys/boot/libsa32/Makefile head/sys/boot/ofw/Makefile.inc head/sys/boot/uboot/Makefile.inc head/sys/boot/zfs/Makefile Modified: head/sys/boot/defs.mk ============================================================================== --- head/sys/boot/defs.mk Mon Nov 6 15:22:17 2017 (r325484) +++ head/sys/boot/defs.mk Mon Nov 6 15:22:24 2017 (r325485) @@ -96,6 +96,16 @@ CFLAGS+= -DLOADER_GELI_SUPPORT CFLAGS+= -m32 -mcpu=powerpc .endif +# For amd64, there's a bit of mixed bag. Some of the tree (i386, lib*32) is +# build 32-bit and some 64-bit (lib*, efi). Centralize all the 32-bit magic here +# and activate it when DO32 is explicitly defined to be 1. +.if ${MACHINE_ARCH} == "amd64" && ${DO32:U0} == 1 +CFLAGS+= -m32 -mcpu=i386 +# LD_FLAGS is passed directly to ${LD}, not via ${CC}: +LD_FLAGS+= -m elf_i386_fbsd +AFLAGS+= --32 +.endif + _ILINKS=machine .if ${MACHINE} != ${MACHINE_CPUARCH} && ${MACHINE} != "arm64" _ILINKS+=${MACHINE_CPUARCH} Modified: head/sys/boot/fdt/Makefile ============================================================================== --- head/sys/boot/fdt/Makefile Mon Nov 6 15:22:17 2017 (r325484) +++ head/sys/boot/fdt/Makefile Mon Nov 6 15:22:24 2017 (r325485) @@ -22,10 +22,6 @@ CFLAGS+= -ffreestanding CFLAGS+= -msoft-float .endif -.if ${MACHINE_ARCH} == "powerpc64" -CFLAGS+= -m32 -.endif - CFLAGS+= -Wformat -Wall .include Modified: head/sys/boot/ficl.mk ============================================================================== --- head/sys/boot/ficl.mk Mon Nov 6 15:22:17 2017 (r325484) +++ head/sys/boot/ficl.mk Mon Nov 6 15:22:24 2017 (r325485) @@ -14,16 +14,8 @@ FICL_CPUARCH= ${MACHINE_CPUARCH} .PATH: ${FICLSRC} ${FICLSRC}/${FICL_CPUARCH} -.if ${MACHINE_CPUARCH} == "amd64" -.if ${DO32:U0} == 1 -CFLAGS+= -m32 -I. -.else +.if ${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 0 CFLAGS+= -fPIC -.endif -.endif - -.if ${MACHINE_ARCH} == "powerpc64" -CFLAGS+= -m32 -mcpu=powerpc -I. .endif CFLAGS+= -I${FICLSRC} -I${FICLSRC}/${FICL_CPUARCH} -I${LDRSRC} Modified: head/sys/boot/ficl/Makefile ============================================================================== --- head/sys/boot/ficl/Makefile Mon Nov 6 15:22:17 2017 (r325484) +++ head/sys/boot/ficl/Makefile Mon Nov 6 15:22:24 2017 (r325485) @@ -9,13 +9,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 -.if ${MACHINE_CPUARCH} == "i386" || \ - (${MACHINE_CPUARCH} == "amd64" && defined(DO32)) -CFLAGS+= -march=i386 -.endif -.if ${MACHINE_CPUARCH} == "amd64" && defined(DO32) -CFLAGS+= -m32 -.endif .if defined(HAVE_PNP) CFLAGS+= -DHAVE_PNP Modified: head/sys/boot/geli/Makefile ============================================================================== --- head/sys/boot/geli/Makefile Mon Nov 6 15:22:17 2017 (r325484) +++ head/sys/boot/geli/Makefile Mon Nov 6 15:22:24 2017 (r325485) @@ -14,7 +14,7 @@ NO_PIC= .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -march=i386 .endif -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64" +.if ${MACHINE_ARCH} == "amd64" CFLAGS+= -m32 .endif Modified: head/sys/boot/i386/Makefile.inc ============================================================================== --- head/sys/boot/i386/Makefile.inc Mon Nov 6 15:22:17 2017 (r325484) +++ head/sys/boot/i386/Makefile.inc Mon Nov 6 15:22:24 2017 (r325485) @@ -25,11 +25,6 @@ LDFLAGS_BIN=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat LD_FLAGS_BIN=-static -N --gc-sections .if ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -m32 -ACFLAGS+= -m32 -# LD_FLAGS is passed directly to ${LD}, not via ${CC}: -LD_FLAGS+= -m elf_i386_fbsd -AFLAGS+= --32 DO32=1 .endif Modified: head/sys/boot/libsa32/Makefile ============================================================================== --- head/sys/boot/libsa32/Makefile Mon Nov 6 15:22:17 2017 (r325484) +++ head/sys/boot/libsa32/Makefile Mon Nov 6 15:22:24 2017 (r325485) @@ -5,15 +5,9 @@ DO32=1 .include LIB=sa32 -.if ${MACHINE_CPUARCH} == "amd64" -LIBSA_CPUARCH=i386 -.else -LIBSA_CPUARCH=${MACHINE_CPUARCH} -.endif +LIBSA_CPUARCH=${MACHINE_CPUARCH:C/amd64/i386/} -.if ${MACHINE_ARCH} == "amd64" -CFLAGS+= -m32 -I. -.endif +CFLAGS+= -I. .PATH: ${SASRC} .include "${SASRC}/Makefile" Modified: head/sys/boot/ofw/Makefile.inc ============================================================================== --- head/sys/boot/ofw/Makefile.inc Mon Nov 6 15:22:17 2017 (r325484) +++ head/sys/boot/ofw/Makefile.inc Mon Nov 6 15:22:24 2017 (r325485) @@ -1,8 +1,3 @@ # $FreeBSD$ -.if ${MACHINE_ARCH} == "powerpc64" -CFLAGS+= -m32 -mcpu=powerpc -LDFLAGS+= -m elf32ppc_fbsd -.endif - .include "../Makefile.inc" Modified: head/sys/boot/uboot/Makefile.inc ============================================================================== --- head/sys/boot/uboot/Makefile.inc Mon Nov 6 15:22:17 2017 (r325484) +++ head/sys/boot/uboot/Makefile.inc Mon Nov 6 15:22:24 2017 (r325485) @@ -1,8 +1,3 @@ # $FreeBSD$ -.if ${MACHINE_ARCH} == "powerpc64" -CFLAGS+= -m32 -mcpu=powerpc -LDFLAGS+= -m elf32ppc_fbsd -.endif - .include "../Makefile.inc" Modified: head/sys/boot/zfs/Makefile ============================================================================== --- head/sys/boot/zfs/Makefile Mon Nov 6 15:22:17 2017 (r325484) +++ head/sys/boot/zfs/Makefile Mon Nov 6 15:22:24 2017 (r325485) @@ -16,14 +16,6 @@ CFLAGS+= -I${LDRSRC} -I${SYSDIR} -I. CFLAGS+= -I${SYSDIR}/cddl/boot/zfs CFLAGS+= -I${SYSDIR}/crypto/skein -.if ${MACHINE_CPUARCH} == "i386" || \ - (${MACHINE_CPUARCH} == "amd64" && defined(DO32)) -CFLAGS+= -march=i386 -.endif -.if ${MACHINE_CPUARCH} == "amd64" && defined(DO32) -CFLAGS+= -m32 -.endif - CFLAGS+= -Wformat -Wall .include