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
This commit is contained in:
Dimitry Andric 2018-05-31 14:38:13 +00:00
parent 2a9836a508
commit 073193ed51
7 changed files with 9 additions and 7 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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}

View File

@ -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"