From owner-svn-src-head@freebsd.org Thu May 31 14:38:15 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 698ECFD426E; Thu, 31 May 2018 14:38:15 +0000 (UTC) (envelope-from dim@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 1F079690E1; Thu, 31 May 2018 14:38:15 +0000 (UTC) (envelope-from dim@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 F03811B779; Thu, 31 May 2018 14:38:14 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4VEcE5v025481; Thu, 31 May 2018 14:38:14 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4VEcDwa025474; Thu, 31 May 2018 14:38:13 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201805311438.w4VEcDwa025474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 31 May 2018 14:38:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334432 - in head/stand: . common i386/gptboot i386/gptzfsboot i386/isoboot i386/zfsboot X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head/stand: . common i386/gptboot i386/gptzfsboot i386/isoboot i386/zfsboot X-SVN-Commit-Revision: 334432 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.26 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: Thu, 31 May 2018 14:38:15 -0000 Author: dim Date: Thu May 31 14:38:13 2018 New Revision: 334432 URL: https://svnweb.freebsd.org/changeset/base/334432 Log: Fix build of stand with base gcc * Make autoboot() a static function in stand/common/boot.c, so it does not shadow local variables in gptboot.c and zfsboot.c. * Remove -Winline from the Makefiles for gptboot, gptzfsboot and zfsboot, as gcc will always fail to inline some functions, and there is nothing we can do about it. * For gcc <= 4.2.1, silence -Wuninitialized for isoboot, as it produces a false positive warning. * Remove deprecated and unnecessary -mcpu=i386 flag from stand/defs.mk, as there is already a -march=i386 flag further in the file. Reviewed by: imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D15628 Modified: head/stand/common/boot.c head/stand/common/bootstrap.h head/stand/defs.mk head/stand/i386/gptboot/Makefile head/stand/i386/gptzfsboot/Makefile head/stand/i386/isoboot/Makefile head/stand/i386/zfsboot/Makefile Modified: head/stand/common/boot.c ============================================================================== --- head/stand/common/boot.c Thu May 31 14:23:33 2018 (r334431) +++ head/stand/common/boot.c Thu May 31 14:38:13 2018 (r334432) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" +static int autoboot(int timeout, char *prompt); static char *getbootfile(int try); static int loadakernel(int try, int argc, char* argv[]); @@ -157,7 +158,7 @@ autoboot_maybe() autoboot(-1, NULL); /* try to boot automatically */ } -int +static int autoboot(int timeout, char *prompt) { time_t when, otime, ntime; Modified: head/stand/common/bootstrap.h ============================================================================== --- head/stand/common/bootstrap.h Thu May 31 14:23:33 2018 (r334431) +++ head/stand/common/bootstrap.h Thu May 31 14:38:13 2018 (r334432) @@ -61,7 +61,6 @@ char *backslash(const char *str); int parse(int *argc, char ***argv, const char *str); /* boot.c */ -int autoboot(int timeout, char *prompt); void autoboot_maybe(void); int getrootmount(char *rootdev); Modified: head/stand/defs.mk ============================================================================== --- head/stand/defs.mk Thu May 31 14:23:33 2018 (r334431) +++ head/stand/defs.mk Thu May 31 14:38:13 2018 (r334432) @@ -91,7 +91,7 @@ CFLAGS+= -m32 -mcpu=powerpc # 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 +CFLAGS+= -m32 # LD_FLAGS is passed directly to ${LD}, not via ${CC}: LD_FLAGS+= -m elf_i386_fbsd AFLAGS+= --32 Modified: head/stand/i386/gptboot/Makefile ============================================================================== --- head/stand/i386/gptboot/Makefile Thu May 31 14:23:33 2018 (r334431) +++ head/stand/i386/gptboot/Makefile Thu May 31 14:38:13 2018 (r334432) @@ -37,7 +37,7 @@ CFLAGS+=-DBOOTPROG=\"gptboot\" \ -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ - -Winline -Wno-pointer-sign + -Wno-pointer-sign CFLAGS.gcc+= --param max-inline-insns-single=100 Modified: head/stand/i386/gptzfsboot/Makefile ============================================================================== --- head/stand/i386/gptzfsboot/Makefile Thu May 31 14:23:33 2018 (r334431) +++ head/stand/i386/gptzfsboot/Makefile Thu May 31 14:38:13 2018 (r334432) @@ -37,7 +37,7 @@ CFLAGS+=-DBOOTPROG=\"gptzfsboot\" \ -Wall -Waggregate-return -Wbad-function-cast \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ - -Winline -Wno-pointer-sign + -Wno-pointer-sign CFLAGS.clang+= -Wno-tentative-definition-incomplete-type Modified: head/stand/i386/isoboot/Makefile ============================================================================== --- head/stand/i386/isoboot/Makefile Thu May 31 14:23:33 2018 (r334431) +++ head/stand/i386/isoboot/Makefile Thu May 31 14:38:13 2018 (r334432) @@ -36,6 +36,9 @@ CFLAGS+=-DBOOTPROG=\"isoboot\" \ -Winline -Wno-pointer-sign CFLAGS.gcc+= --param max-inline-insns-single=100 +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} <= 40201 +CFLAGS.gcc+= -Wno-uninitialized +.endif CFLAGS.clang+= -Oz ${CLANG_OPT_SMALL} LD_FLAGS+=${LD_FLAGS_BIN} Modified: head/stand/i386/zfsboot/Makefile ============================================================================== --- head/stand/i386/zfsboot/Makefile Thu May 31 14:23:33 2018 (r334431) +++ head/stand/i386/zfsboot/Makefile Thu May 31 14:38:13 2018 (r334432) @@ -34,8 +34,7 @@ CFLAGS+=-DBOOTPROG=\"zfsboot\" \ -I${BOOTSRC}/i386/boot2 \ -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ - -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ - -Winline + -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings CFLAGS.gcc+= --param max-inline-insns-single=100 .if ${MACHINE} == "amd64"