All of lore.kernel.org
 help / color / mirror / Atom feed
From: bage@linutronix.de
To: Masahiro Yamada <masahiroy@kernel.org>,
	Michal Marek <michal.lkml@markovi.net>
Cc: Bastian Germann <bage@linutronix.de>,
	linux-kbuild@vger.kernel.org, tglx@linutronix.de
Subject: [PATCH v2 2/5] builddeb: set CC on cross build to prefixed gcc
Date: Wed, 26 May 2021 01:01:36 +0200	[thread overview]
Message-ID: <20210525230139.6165-3-bage@linutronix.de> (raw)
In-Reply-To: <20210525230139.6165-1-bage@linutronix.de>

From: Bastian Germann <bage@linutronix.de>

Building the generated package with CC unset will fail for cross
compilation. Detect that and set CC to a sane default prefixed by
dpkg-architecture's DEB_HOST_GNU_TYPE variable.

Signed-off-by: Bastian Germann <bage@linutronix.de>
---
 scripts/package/mkdebian | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index b317d26e2bbf..449e284a449c 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -223,6 +223,14 @@ fi
 cat <<EOF > debian/rules
 #!$(command -v $MAKE) -f
 
+include /usr/share/dpkg/architecture.mk
+
+ifneq (\$(DEB_BUILD_GNU_TYPE),\$(DEB_HOST_GNU_TYPE))
+ifeq (\$(origin CC),default)
+CC := \$(DEB_HOST_GNU_TYPE)-gcc
+endif
+endif
+
 srctree ?= .
 
 build-indep:
-- 
2.30.2


  parent reply	other threads:[~2021-05-25 23:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-25 23:01 [PATCH v2 0/5] builddeb: make deb building more flexible bage
2021-05-25 23:01 ` [PATCH v2 1/5] builddeb: ignore or export files for clean pkg build bage
2021-05-25 23:01 ` bage [this message]
2021-05-25 23:01 ` [PATCH v2 3/5] builddeb: clean generated package content bage
2021-05-25 23:01 ` [PATCH v2 4/5] builddeb: introduce profile excluding the dbg pkg bage
2021-05-25 23:01 ` [PATCH v2 5/5] kbuild: introduce srcdeb-pkg target bage
2021-06-28 18:46 ` [PATCH v2 0/5] builddeb: make deb building more flexible Bastian Germann

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=20210525230139.6165-3-bage@linutronix.de \
    --to=bage@linutronix.de \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=tglx@linutronix.de \
    /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.