public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gao, Liming" <liming.gao@intel.com>
To: Leif Lindholm <leif.lindholm@linaro.org>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
	"Zhu, Yonghong" <yonghong.zhu@intel.com>
Subject: Re: [PATCH] BaseTools/tools_def: use separate PP definition for DTC
Date: Wed, 28 Feb 2018 02:41:07 +0000	[thread overview]
Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E1D47B8@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <20180227200107.6degkvddcd46dlba@bivouac.eciton.net>

Reviewed-by: Liming Gao <liming.gao@intel.com>

> -----Original Message-----
> From: Leif Lindholm [mailto:leif.lindholm@linaro.org]
> Sent: Wednesday, February 28, 2018 4:01 AM
> To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: edk2-devel@lists.01.org; Gao, Liming <liming.gao@intel.com>; Zhu, Yonghong <yonghong.zhu@intel.com>
> Subject: Re: [PATCH] BaseTools/tools_def: use separate PP definition for DTC
> 
> On Tue, Feb 27, 2018 at 07:02:06PM +0000, Ard Biesheuvel wrote:
> > On 27 February 2018 at 18:58, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> > > On Tue, Feb 27, 2018 at 06:36:08PM +0000, Ard Biesheuvel wrote:
> > >> On 27 February 2018 at 18:33, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> > >> > On Tue, Feb 27, 2018 at 05:51:32PM +0000, Ard Biesheuvel wrote:
> > >> >> Clang's preprocessor behaves differently from GCC's, and produces
> > >> >> intermediate device tree source that still contains #pragma pack()
> > >> >> and other directives that the device tree compiler chokes on.
> > >> >>
> > >> >> For assembling device tree sources, it matters very little which
> > >> >> preprocessor is being used, so let's just use GNU CPP explicitly.
> > >> >
> > >> > Ah, right, same fundamental issue as
> > >> > 5b8766bb92debfa7b2f45a4a6d683b4227360d66.
> > >>
> > >> Yes, and I fail to see why changing just those two files makes a
> > >> meaningful difference.
> > >
> > > Probably because Secure96Dxe.inf has a lot more [Packages] and
> > > [LibraryClasses] dependencies than DeveloperBox.inf.
> > >
> > > This patch would undoubtedly also have resolved that issue.
> > > (As would clang preprocessor not throwing out C syntax when explicitly
> > > asked to provide asm.)
> > >
> > >> > However, this time triggered by autogen seemingly forcing inclusion of
> > >> > lots of central header files that are not even used, like
> > >> > MdePkg/Include/IndustryStandard/Bluetooth.h
> > >> > MdePkg/Include/IndustryStandard/Acpi10.h
> > >> > and so on.
> > >> >
> > >> > Is there any way to suppress these implicit includes from .dts
> > >> > processing?
> > >>
> > >> There is 'Trim', which can filter #include'd content, but using that
> > >> also robs us of the ability to #include .dtsi files, which was kind of
> > >> the point of using the preprocessor in the first place.
> > >
> > > Yeah, that'd definitely be missing the point slightly.
> > >
> > > I was thinking more along the lines of either excluding the autogen
> > > bits from the preprocessing or using a separate .inf for the .dts.
> > >
> >
> > We need the AutoGen.h bits for the fixed PCD values, which was the
> > other reason for using the preprocessor in the first place.
> 
> Yeah, I was afraid of that.
> 
> > Separate .inf would mean registering file GUIDs in the package .DEC,
> > so that the driver can find the binary image at runtime, which is what
> > I was trying to get away from by pulling it into the driver,
> > especially because we are dealing with overlay DT snippets, of which
> > there may be many, rather than a single DT (with a well known file
> > GUID) for the entire platform.
> >
> > > If neither of those feels practical, the proposed patch is fine.
> > > It just feels a little bit clunky.
> >
> > Yeah, I don't see any unclunky solutions, unfortunately.
> 
> Fair enough.
> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>


  reply	other threads:[~2018-02-28  2:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-27 17:51 [PATCH] BaseTools/tools_def: use separate PP definition for DTC Ard Biesheuvel
2018-02-27 18:33 ` Leif Lindholm
2018-02-27 18:36   ` Ard Biesheuvel
2018-02-27 18:58     ` Leif Lindholm
2018-02-27 19:02       ` Ard Biesheuvel
2018-02-27 20:01         ` Leif Lindholm
2018-02-28  2:41           ` Gao, Liming [this message]
2018-02-28  8:13             ` Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A89E2EF3DFEDB4C8BFDE51014F606A14E1D47B8@SHSMSX104.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox