From de9dec16dd21617a3958cdb0d4a6ab436bf3d125 Mon Sep 17 00:00:00 2001 From: Jung-uk Kim Date: Fri, 9 Mar 2012 23:30:30 +0000 Subject: [PATCH] Make boot2 build with Clang again. Submitted by: dim (bsd.sys.mk) Reviewed by: dim, jhb --- share/mk/bsd.sys.mk | 6 ++++-- sys/boot/i386/boot2/boot2.c | 6 ++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 401e671f22d..a8770cc769d 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -100,8 +100,10 @@ CWARNFLAGS += -Wno-unknown-pragmas .if ${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang" CLANG_NO_IAS = -no-integrated-as -CLANG_OPT_SMALL = -mllvm -stack-alignment=8 -mllvm -inline-threshold=3 \ - -mllvm -enable-load-pre=false +CLANG_OPT_SMALL = -mllvm -stack-alignment=8 \ + -mllvm -inline-threshold=3 \ + -mllvm -enable-load-pre=false \ + -mllvm -simplifycfg-dup-ret .endif .if ${MK_SSP} != "no" && ${MACHINE_CPUARCH} != "ia64" && \ diff --git a/sys/boot/i386/boot2/boot2.c b/sys/boot/i386/boot2/boot2.c index 8291249d0f9..d5ac39e6387 100644 --- a/sys/boot/i386/boot2/boot2.c +++ b/sys/boot/i386/boot2/boot2.c @@ -129,8 +129,8 @@ static struct dsk { int init; } dsk; static char cmd[512], cmddup[512], knamebuf[1024]; -static const char *kname; -static uint32_t opts; +static const char *kname = NULL; +static uint32_t opts = 0; static int comspeed = SIOSPD; static struct bootinfo bootinfo; static uint8_t ioctrl = IO_KEYBOARD; @@ -225,8 +225,6 @@ main(void) ino_t ino; size_t nbyte; - opts = 0; - kname = NULL; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); v86.ctl = V86_FLAGS; v86.efl = PSL_RESERVED_DEFAULT | PSL_I;