From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernhard Reutner-Fischer Date: Thu, 16 Oct 2008 23:09:12 +0200 Subject: [Buildroot] [PATCH 8/9] RFC: Remove HOSTCFLAGS from kernel compile In-Reply-To: <20081016203256.15826.17375.stgit@localhost.localdomain> References: <20081016203220.15826.26173.stgit@localhost.localdomain> <20081016203256.15826.17375.stgit@localhost.localdomain> Message-ID: <20081016210912.GD11249@mx.loc> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: buildroot@busybox.net On Thu, Oct 16, 2008 at 02:32:56PM -0600, Grant Likely wrote: >From: Grant Likely > >Setting HOSTCFLAGS when calling make for the kernel compile messes up >the tools that the kernel builds for itself. Specifically, the >building of the device tree compiler (dtc) in arch/powerpc adds some >required flags to HOSTCFLAGS. However, if HOSTCFLAGS= is specified >when calling make, then the local flags are never added and the kernel >compile fails. One could argue that this is really a bug in the kernel. > >This patch removes the HOSTCFLAGS= from $(LINUX26_MAKE_FLAGS). I've >marked this patch as an RFC because I don't know what is really required >here. Removing it works for me (of course), but it may break other users. >I just don't know if there is a better way to set HOSTCFLAGS so that it >doesn't override the settings that the kernel uses itself. you could append it to HOSTCC, but that didn't work either (at least for some earlier 2.6.x). The problem with HOSTCFLAGS and HOSTCC is that for some hosts the HOSTCFLAGS are integral part of having a working HOSTCC, you can't separate them without rendering your HOSTCC completely dysfunctional (since the stuff is supposed to run, too). >--- > > target/linux/Makefile.in.advanced | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > >diff --git a/target/linux/Makefile.in.advanced b/target/linux/Makefile.in.advanced >index 42384f1..9c6df1f 100644 >--- a/target/linux/Makefile.in.advanced >+++ b/target/linux/Makefile.in.advanced >@@ -186,7 +186,7 @@ LINUX_KERNEL:=$(LINUX26_KERNEL) > LINUX26_BZCAT:=$(BZCAT) > > __LINUX26_NO_PIC=-fPIC -fpic -DPIC -fwrapv -ftrapv >-LINUX26_MAKE_FLAGS = HOSTCC="$(HOSTCC)" HOSTCFLAGS="$(HOSTCFLAGS)" \ >+LINUX26_MAKE_FLAGS = HOSTCC="$(HOSTCC)" \ > ARCH=$(KERNEL_ARCH) \ > CFLAGS_KERNEL="$(filter-out $(__LINUX26_NO_PIC),$(TARGET_CFLAGS))" \ > INSTALL_MOD_PATH=$(TARGET_DIR) \ >