From fab6097f33d7576bd2a918bebaf3e28413242308 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 26 Jul 2011 12:25:34 -0700 Subject: [PATCH] PR12895: Use NOSTDINC_FLAGS in kernel stapconf checks We should never be looking in /usr/include/ for headers when building for the kernel. This particularly bit us in a case where RHEL6 gained blk_types.h in newer kernels. So if the system had kernel-headers.rpm with this new header in /usr/include/, but was still running an older kernel that lacked it in /lib/modules/`uname -r`/build/, then we'd misidentify that header's availability in stapconf. * buildrun.cxx (compile_pass): Add NOSTDINC_FLAGS to CHECK_BUILD. --- buildrun.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildrun.cxx b/buildrun.cxx index ecdf77bc7..86e988c8d 100644 --- a/buildrun.cxx +++ b/buildrun.cxx @@ -169,7 +169,7 @@ compile_pass (systemtap_session& s) o << "_KBUILD_CFLAGS := $(call flags,KBUILD_CFLAGS)" << endl; o << "stap_check_gcc = $(shell " << superverbose << " if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo \"$(1)\"; else echo \"$(2)\"; fi)" << endl; - o << "CHECK_BUILD := $(CC) $(KBUILD_CPPFLAGS) $(CPPFLAGS) $(LINUXINCLUDE) $(_KBUILD_CFLAGS) $(CFLAGS_KERNEL) $(EXTRA_CFLAGS) $(CFLAGS) -DKBUILD_BASENAME=\\\"" << s.module_name << "\\\"" << (s.omit_werror ? "" : " -Werror") << " -S -o /dev/null -xc " << endl; + o << "CHECK_BUILD := $(CC) $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) $(CPPFLAGS) $(LINUXINCLUDE) $(_KBUILD_CFLAGS) $(CFLAGS_KERNEL) $(EXTRA_CFLAGS) $(CFLAGS) -DKBUILD_BASENAME=\\\"" << s.module_name << "\\\"" << (s.omit_werror ? "" : " -Werror") << " -S -o /dev/null -xc " << endl; o << "stap_check_build = $(shell " << superverbose << " if $(CHECK_BUILD) $(1) " << redirecterrors << " ; then echo \"$(2)\"; else echo \"$(3)\"; fi)" << endl; o << "SYSTEMTAP_RUNTIME = \"" << s.runtime_path << "\"" << endl; -- 2.43.5