All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
Cc: Thomas Perrot <thomas.perrot@bootlin.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [Buildroot] [PATCH 2/2] package/imx-cst: add new package
Date: Tue, 19 Apr 2022 21:38:13 +0200	[thread overview]
Message-ID: <20220419213813.018a7601@windsurf> (raw)
In-Reply-To: <20220419142635.008ac004@windsurf>

On Tue, 19 Apr 2022 14:26:35 +0200
Thomas Petazzoni via buildroot <buildroot@buildroot.org> wrote:

> This looks strange. Flags are normally passed using CFLAGS, and $(CC)
> in Buildroot doesn't exist, it's $(HOSTCC) that should be used.
> 
> Also, I think the list of header paths is properly set with:
> 
> CINCLUDES := $(SUBSYS:%=-I$(CST_CODE_PATH)/%/hdr)
> 
> but it gets overridden by the fact that you override CFLAGS.
> 
> I believe there's a better way, let me have a look.

Here is what I could come up with:

ifneq ($(filter %64,$(HOSTARCH)),)
HOST_IMX_CST_OSTYPE = linux64
else
HOST_IMX_CST_OSTYPE = linux32
endif

# We don't use HOST_CONFIGURE_OPTS when building cst, because we need
# to preserve the CFLAGS/LDFLAGS used by their Makefile.
define HOST_IMX_CST_BUILD_CMDS
	$(HOST_MAKE_ENV) $(MAKE) \
		OSTYPE=$(HOST_IMX_CST_OSTYPE) \
		ENCRYPTION=yes \
		AR="$(HOSTAR)" \
		CC="$(HOSTCC)" \
		LD="$(HOSTCC)" \
		OBJCOPY="$(HOSTOBJCOPY)" \
		RANLIB="$(HOSTRANLIB)" \
		EXTRACFLAGS="$(HOST_CFLAGS) $(HOST_CPPFLAGS)" \
		EXTRALDFLAGS="$(HOST_LDFLAGS)" \
		PWD=$(@D)/code/cst \
		-C $(@D)/code/cst \
		build
	$(HOST_MAKE_ENV) $(MAKE) $(HOST_CONFIGURE_OPTS) \
		COPTS="$(HOST_CFLAGS) $(HOST_CPPFLAGS) $(HOST_LDFLAGS)" \
		-C $(@D)/code/hab_csf_parser
endef

define HOST_IMX_CST_INSTALL_CMDS
	$(INSTALL) -D -m 755 $(@D)/code/cst/code/obj.$(HOST_IMX_CST_OSTYPE)/cst $(HOST_DIR)/bin/cst
	$(INSTALL) -D -m 755 $(@D)/code/cst/code/obj.$(HOST_IMX_CST_OSTYPE)/srktool $(HOST_DIR)/bin/srktool
	$(INSTALL) -D -m 755 $(@D)/code/hab_csf_parser/csf_parser $(HOST_DIR)/bin/csf_parser
endef

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2022-04-19 19:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-19  9:21 [Buildroot] [PATCH 0/2] Support for i.MX Code Signing Tools Thomas Perrot via buildroot
2022-04-19  9:21 ` [Buildroot] [PATCH 1/2] package/byacc: add new package Thomas Perrot via buildroot
2022-04-19 12:12   ` Thomas Petazzoni via buildroot
2022-04-19  9:21 ` [Buildroot] [PATCH 2/2] package/imx-cst: " Thomas Perrot via buildroot
2022-04-19 12:26   ` Thomas Petazzoni via buildroot
2022-04-19 19:38     ` Thomas Petazzoni via buildroot [this message]
2022-04-20  8:39     ` Thomas Perrot via buildroot
2022-04-20 11:25       ` Thomas Petazzoni via buildroot

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=20220419213813.018a7601@windsurf \
    --to=buildroot@buildroot.org \
    --cc=thomas.perrot@bootlin.com \
    --cc=thomas.petazzoni@bootlin.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.