From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757167Ab3BAQvS (ORCPT ); Fri, 1 Feb 2013 11:51:18 -0500 Received: from mail-ob0-f169.google.com ([209.85.214.169]:62446 "EHLO mail-ob0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756871Ab3BAQvP (ORCPT ); Fri, 1 Feb 2013 11:51:15 -0500 Message-ID: <510BF281.1080309@gmail.com> Date: Fri, 01 Feb 2013 10:51:13 -0600 From: Rob Herring User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 To: srinivas.kandagatla@st.com CC: Stephen Warren , Grant Likely , Michal Marek , Stephen Warren , Sam Ravnborg , Mark Brown , linux-kernel@vger.kernel.org, Scott Wood , devicetree-discuss@lists.ozlabs.org Subject: Re: [PATCH V7] kbuild: create a rule to run the pre-processor on *.dts files References: <1357152215-5845-1-git-send-email-swarren@wwwdotorg.org> <510B8480.7000507@st.com> In-Reply-To: <510B8480.7000507@st.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/01/2013 03:01 AM, Srinivas KANDAGATLA wrote: > Hi Stephen, > Not sure if you have already noticed this but, > I did try this patch on my 3.8, and it looks like the intermediate dts > file replaces all instances of linux with 1 because of predefined macros > in gcc. > As a result > linux,stdout-path = "/soc/stm-asc2"; > is changed to. > 1,stdout-path = "/soc/stm-asc2"; > > On my version of compiler(gcc version 4.6.3) I have > > armv7-linux-gcc -E -dM - < /dev/null | grep -v _ > #define unix 1 > #define linux 1 > > Which might be true with most compiler versions aswell. > As we are using linux as prefix for some device tree properties it makes > sense to undef the linux gcc define. > Adding -Ulinux to cmd_dtc_cpp should fix it. > > -cmd_dtc_cpp = $(CPP) $(cpp_flags) -D__DTS__ -x assembler-with-cpp -o > $(dtc-tmp) $< ; \ > +cmd_dtc_cpp = $(CPP) $(cpp_flags) -D__DTS__ -Ulinux -x > assembler-with-cpp -o $(dtc-tmp) $< ; \ > $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) $(dtc-tmp) That's a hackish solution that seems fragile as well. Is there no way to turn off all built-in defines? Rob