Skip to content

Commit

Permalink
x86, boot: Restrict CFLAGS for hostprogs
Browse files Browse the repository at this point in the history
Currently tools/build has access to all the kernel headers in
$(srctree). This is unnecessary and could potentially allow
tools/build to erroneously include kernel headers when it should only
be including userspace-exported headers.

Unfortunately, mkcpustr still needs access to some of the asm kernel
headers, so explicitly special case that hostprog.

Cc: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Link: http://lkml.kernel.org/r/1330436245-24875-5-git-send-email-matt@console-pimps.org
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
  • Loading branch information
Matt Fleming authored and H. Peter Anvin committed Feb 28, 2012
1 parent 12871c5 commit d40f833
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arch/x86/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ setup-y += video-bios.o
targets += $(setup-y)
hostprogs-y := mkcpustr tools/build

HOST_EXTRACFLAGS += $(LINUXINCLUDE)

HOSTCFLAGS_mkcpustr.o := -I$(srctree)/arch/$(SRCARCH)/include
HOST_EXTRACFLAGS += -I$(objtree)/include -I$(srctree)/tools/include \
-include $(srctree)/include/linux/kconfig.h
$(obj)/cpu.o: $(obj)/cpustr.h

quiet_cmd_cpustr = CPUSTR $@
Expand Down

0 comments on commit d40f833

Please sign in to comment.