From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::244; helo=mail-wm0-x244.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 685EF2034CF6D for ; Thu, 26 Oct 2017 04:29:27 -0700 (PDT) Received: by mail-wm0-x244.google.com with SMTP id r196so7354913wmf.2 for ; Thu, 26 Oct 2017 04:33:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=nTbTUApRi8fwLppltsslDuep3CqS2yxukmy28XSR4BU=; b=YriNkHRZPqokyAzn6waFnMqiwVREQAmAdXJeYg6V69HChd8MIu/ykdF9tI3khVaDJ0 4/HWpbvHdn6/08UWm4YnH7QUkF97pa0cHJi1iASb8qSP4bp26AAo/8x+uBMm9pDGMrzg Xv1SpFcHkN2RfLUE6VW5n0WJOP7b0/d0dysuE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=nTbTUApRi8fwLppltsslDuep3CqS2yxukmy28XSR4BU=; b=auXgLgensw/LnelwDfFvceKulvDKbPblFDgU7sbboVRuAtf5vcXM52aZ+U6MJLkDYa 9+dS9ONEqmpUp7U5gdH5EAuphqWaGEwWRibjG99z4UwPQnKskkEkKeq/LyKCVgRtxM2L w9DD6kxgfbwnd3HcHxYEWgBZKU87EgGIyLRDA9FhVLqfoa7/T1qeSwvyo9k5cnm4fhQ3 2KRf1jXKmvJLFVVNlAzipcLGd0PZ0igjL7g6yOL6So6x9CgS3aJL5hyv1cFG/sPJBOil z6MQJ6496XmUo3NAi8rrg50yCgXDK5ZMno/kXRWEu9LrpYIfE+nm+YdNM2qMuBBNlj+k RFtQ== X-Gm-Message-State: AMCzsaWUOqGb3mqQIpQ6CiAXcAKCPg0ERRbI5iqwCFq3FOrpXDo5BWUC ACIiQsJ462ZyQ7GPlgzNP5AGrw== X-Google-Smtp-Source: ABhQp+T7FJ1s9Q3oDXNGYtpfil7rS2jqhfMEJDrBBKuvdEIu51jevTrfBlKqELDZo3JUjUXrSk5tKQ== X-Received: by 10.28.54.154 with SMTP id y26mr1425864wmh.15.1509017591932; Thu, 26 Oct 2017 04:33:11 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id o197sm2597979wmg.3.2017.10.26.04.33.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Oct 2017 04:33:10 -0700 (PDT) Date: Thu, 26 Oct 2017 12:33:09 +0100 From: Leif Lindholm To: Ard Biesheuvel Cc: Laszlo Ersek , "edk2-devel@lists.01.org" , "Gao, Liming" Message-ID: <20171026113309.i4thy2ardt2f6fw5@bivouac.eciton.net> References: <20171026101209.31630-1-ard.biesheuvel@linaro.org> <2b0ce401-e334-335f-a352-7ce841041313@redhat.com> MIME-Version: 1.0 In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [PATCH] BaseTools/tools_def: suppress GCC predefined macros in DTB compilation X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Oct 2017 11:29:27 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Oct 26, 2017 at 12:11:16PM +0100, Ard Biesheuvel wrote: > On 26 October 2017 at 12:09, Laszlo Ersek wrote: > > On 10/26/17 12:12, Ard Biesheuvel wrote: > >> The standard GCC preprocessor we use to preprocess device tree sources > >> files has a whole bunch of macros predefined, among which > >> > > > > The example you wanted to paste is missing. > > > > Yeah, the leading # made git-commit throw them away :-) Haha :) > #define __linux 1 > #define __linux__ 1 > #define __gnu_linux__ 1 > #define linux 1 How did you make it not throw them away? (I can find a few suggestions online, neither sounds optimal.) > >> This causes a property like 'linux,code' to be converted into '1,code' > >> which is obviously wrong. So let's get rid of all the predefined macros > >> by passing -undef to the preprocessor command line. > >> > >> Contributed-under: TianoCore Contribution Agreement 1.1 > >> Signed-off-by: Ard Biesheuvel > >> --- > >> BaseTools/Conf/tools_def.template | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template > >> index df7c109438fd..98df0ffc9294 100755 > >> --- a/BaseTools/Conf/tools_def.template > >> +++ b/BaseTools/Conf/tools_def.template > >> @@ -4369,7 +4369,7 @@ DEFINE GCC_VFRPP_FLAGS = -x c -E -P -DVFRCOMPILE --include $(DEST_DI > >> DEFINE GCC_ASLPP_FLAGS = -x c -E -include AutoGen.h > >> DEFINE GCC_ASLCC_FLAGS = -x c > >> DEFINE GCC_WINDRES_FLAGS = -J rc -O coff > >> -DEFINE GCC_DTCPP_FLAGS = -E -x assembler-with-cpp -imacros $(DEST_DIR_DEBUG)/AutoGen.h -nostdinc > >> +DEFINE GCC_DTCPP_FLAGS = -E -x assembler-with-cpp -imacros $(DEST_DIR_DEBUG)/AutoGen.h -nostdinc -undef > >> DEFINE GCC_IA32_RC_FLAGS = -I binary -O elf32-i386 -B i386 --rename-section .data=.hii > >> DEFINE GCC_X64_RC_FLAGS = -I binary -O elf64-x86-64 -B i386 --rename-section .data=.hii > >> DEFINE GCC_IPF_RC_FLAGS = -I binary -O elf64-ia64-little -B ia64 --rename-section .data=.hii > >> > > > > With the commit message fixed: > > > > Acked-by: Laszlo Ersek With the same precondition: Reviewed-by: Leif Lindholm / Leif