We already build the amd64 kernel with -ffreestanding.  Should we
also do this for the boot code?  It would make clang happier, and
conceptually it makes sense.

I've successfully tested the resulting gcc-built pxeboot(8) as well
as boot(8) with root on crypto softraid.

Index: arch/amd64/stand/Makefile.inc
===================================================================
RCS file: /cvs/src/sys/arch/amd64/stand/Makefile.inc,v
retrieving revision 1.15
diff -u -p -r1.15 Makefile.inc
--- arch/amd64/stand/Makefile.inc       6 Nov 2016 16:04:20 -0000       1.15
+++ arch/amd64/stand/Makefile.inc       27 May 2017 14:55:59 -0000
@@ -1,6 +1,7 @@
 #      $OpenBSD: Makefile.inc,v 1.15 2016/11/06 16:04:20 tb Exp $
 
 CFLAGS=${DEBUG} ${COPTS} -Os -Wall -Werror
+CFLAGS+=       -ffreestanding
 CFLAGS+=       -fno-stack-protector -DMDRANDOM
 CPPFLAGS+=-I${S} -I${SADIR}/libsa -I. -I${.CURDIR}
 SACFLAGS=-D_STANDALONE
-- 
Christian "naddy" Weisgerber                          na...@mips.inka.de

Reply via email to