From: Sascha Hauer <s.hauer@pengutronix.de>
To: "Marcin Niestrój" <m.niestroj@grinn-global.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 5/5] scripts: imx: Do not include autoconf.h
Date: Fri, 7 Sep 2018 10:39:45 +0200 [thread overview]
Message-ID: <20180907083945.brzrswndrzdlx33w@pengutronix.de> (raw)
In-Reply-To: <8736upfvq1.fsf@grinn-global.com>
On Tue, Sep 04, 2018 at 11:38:46AM +0200, Marcin Niestrój wrote:
> Hi Sasha,
>
> Sascha Hauer <s.hauer@pengutronix.de> writes:
>
> > On Mon, Sep 03, 2018 at 12:57:15PM +0200, Marcin Niestroj wrote:
> >> All required defines are passed with command line -D options, so there
> >> is no need to include full autoconf.h header. Additionally there were
> >> compile time warnings printed when passed variables (CONFIG_HABV*) had
> >> embedded environment variables, because macros in autoconf.h were
> >> redefining these passed as command line arguments (-include is
> >> processed later than -D option).
> >>
> >> Remove including autoconf.h header, so CONFIG_HABV* macros are only
> >> defined with command line arguments, properly expanding embedded
> >> variables.
> >>
> >> Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
> >> ---
> >> Changes rfc -> v1: new patch
> >>
> >> scripts/Makefile.lib | 1 -
> >> 1 file changed, 1 deletion(-)
> >>
> >> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> >> index 3b1308605..c254b5b79 100644
> >> --- a/scripts/Makefile.lib
> >> +++ b/scripts/Makefile.lib
> >> @@ -433,7 +433,6 @@ cmd_imximage_S_dcd= \
> >>
> >> imxcfg_cpp_flags = -Wp,-MD,$(depfile) -nostdinc -x assembler-with-cpp \
> >> -I $(srctree)/include -I $(srctree)/arch/arm/mach-imx/include \
> >> - -include include/generated/autoconf.h \
> >> -DCONFIG_HABV3_SRK_PEM=\"$(CONFIG_HABV3_SRK_PEM)\" \
> >> -DCONFIG_HABV3_CSF_CRT_DER=\"$(CONFIG_HABV3_CSF_CRT_DER)\" \
> >> -DCONFIG_HABV3_IMG_CRT_DER=\"$(CONFIG_HABV3_IMG_CRT_DER)\" \
> >
> > the inclusion of autoconf.h is there so that we can use the CONFIG_*
> > macros. See for example rch/arm/boards/tqma53/flash-header.imxcfg:36
> >
> > #ifdef CONFIG_MACH_TQMA53_1GB_RAM
>
> Okay, so we cannot drop autoconf.h inclusion. That also means that we
> need some other way to expand embedded variables in CONFIG_HAB* Kconfig
> options. The problem is that autoconf.h overwrites (redefines) all
> macros specified at command line.
>
> >
> > What we can do instead is replace the -include with "-I
> > $(objtree)/include" so that we can do a "#include
> > <generated/autoconf.h>" in arch/arm/boards/tqma53/flash-header.imxcfg.
> > Would that be fine aswell?
>
> This will also result in autoconf.h redefining macros specified at
> command line, but only for that board (because of explicit "include
> <generated/autoconf.h>"). Problem will surface once again when someone
> will start using HAB for that board.
>
> Maybe we should expand all macros from autoconf.h? For example process
> autoconf.h *somehow* and produce autoconf-expanded.h, which we could use
> with "-include" option. This is just an idea, I do not know how to
> implement that. Any other ideas?
FYI I just posted another idea.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2018-09-07 8:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-03 10:57 [PATCH 0/5] ARM: imx: HAB improvements Marcin Niestroj
2018-09-03 10:57 ` [PATCH 1/5] scripts: imx: add optional argument to hab_blocks command Marcin Niestroj
2018-09-03 10:57 ` [PATCH 2/5] ARM: imx: Update default image certificate for CST tool Marcin Niestroj
2018-09-03 10:57 ` [PATCH 3/5] scripts: imx: Support encrypted boot with HABv4 Marcin Niestroj
2018-09-03 10:57 ` [PATCH 4/5] images: imx: Add targets for signed encrypted images Marcin Niestroj
2018-09-03 10:57 ` [PATCH 5/5] scripts: imx: Do not include autoconf.h Marcin Niestroj
2018-09-04 7:54 ` Sascha Hauer
2018-09-04 9:38 ` Marcin Niestrój
2018-09-07 8:39 ` Sascha Hauer [this message]
2018-09-04 8:17 ` [PATCH 0/5] ARM: imx: HAB improvements Sascha Hauer
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-all 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=20180907083945.brzrswndrzdlx33w@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=m.niestroj@grinn-global.com \
/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