Date: Sun, 3 Jun 2018 17:17:45 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334572 - in stable/11/stand: . common i386/gptboot i386/gptzfsboot i386/isoboot i386/zfsboot Message-ID: <201806031717.w53HHjob006624@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Sun Jun 3 17:17:45 2018 New Revision: 334572 URL: https://svnweb.freebsd.org/changeset/base/334572 Log: MFC r334432: 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 Differential Revision: https://reviews.freebsd.org/D15628 Modified: stable/11/stand/common/boot.c stable/11/stand/common/bootstrap.h stable/11/stand/defs.mk stable/11/stand/i386/gptboot/Makefile stable/11/stand/i386/gptzfsboot/Makefile stable/11/stand/i386/isoboot/Makefile stable/11/stand/i386/zfsboot/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/common/boot.c ============================================================================== --- stable/11/stand/common/boot.c Sun Jun 3 17:11:01 2018 (r334571) +++ stable/11/stand/common/boot.c Sun Jun 3 17:17:45 2018 (r334572) @@ -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: stable/11/stand/common/bootstrap.h ============================================================================== --- stable/11/stand/common/bootstrap.h Sun Jun 3 17:11:01 2018 (r334571) +++ stable/11/stand/common/bootstrap.h Sun Jun 3 17:17:45 2018 (r334572) @@ -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: stable/11/stand/defs.mk ============================================================================== --- stable/11/stand/defs.mk Sun Jun 3 17:11:01 2018 (r334571) +++ stable/11/stand/defs.mk Sun Jun 3 17:17:45 2018 (r334572) @@ -89,7 +89,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: stable/11/stand/i386/gptboot/Makefile ============================================================================== --- stable/11/stand/i386/gptboot/Makefile Sun Jun 3 17:11:01 2018 (r334571) +++ stable/11/stand/i386/gptboot/Makefile Sun Jun 3 17:17:45 2018 (r334572) @@ -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: stable/11/stand/i386/gptzfsboot/Makefile ============================================================================== --- stable/11/stand/i386/gptzfsboot/Makefile Sun Jun 3 17:11:01 2018 (r334571) +++ stable/11/stand/i386/gptzfsboot/Makefile Sun Jun 3 17:17:45 2018 (r334572) @@ -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: stable/11/stand/i386/isoboot/Makefile ============================================================================== --- stable/11/stand/i386/isoboot/Makefile Sun Jun 3 17:11:01 2018 (r334571) +++ stable/11/stand/i386/isoboot/Makefile Sun Jun 3 17:17:45 2018 (r334572) @@ -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: stable/11/stand/i386/zfsboot/Makefile ============================================================================== --- stable/11/stand/i386/zfsboot/Makefile Sun Jun 3 17:11:01 2018 (r334571) +++ stable/11/stand/i386/zfsboot/Makefile Sun Jun 3 17:17:45 2018 (r334572) @@ -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"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806031717.w53HHjob006624>