From: Henrik Austad <henrik@austad.us>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Khem Raj <raj.khem@gmail.com>, Jeff Epler <jepler@unpythonic.net>,
williams@redhat.com, jkacur@redhat.com,
linux-rt-users@vger.kernel.org
Subject: Re: [PATCH] Makefile: Set CC/AR variable only if it doesn't have a value
Date: Tue, 5 Jan 2016 22:15:56 +0100 [thread overview]
Message-ID: <20160105211556.GA7561@icarus.home.austad.us> (raw)
In-Reply-To: <20160104162507.GE28361@pengutronix.de>
[-- Attachment #1: Type: text/plain, Size: 1517 bytes --]
On Mon, Jan 04, 2016 at 05:25:07PM +0100, Uwe Kleine-König wrote:
> On Mon, Jan 04, 2016 at 08:20:01AM -0800, Khem Raj wrote:
> >
> > > On Jan 4, 2016, at 5:39 AM, Jeff Epler <jepler@unpythonic.net> wrote:
> > >
> > > I believe the patch does not have the desired effect, because make(1)
> > > always sets CC automatically:
> > >
> > > $ cat raj.mk
> > > CROSS_COMPILE=x86_64-linux-gnu-
> > > CC?=$(CROSS_COMPILE)gcc
> > > .PHONY: default
> > > default:
> > > @echo CC=$(CC)
> > > $ make -f raj.mk
> > > CC=cc
> > >
> > > With your patch, those who specify CROSS_COMPILE, or for whom gcc and cc
> > > are different, will get different (worse) behavior.
> >
> > Right. I think if CC was used as such with out constructing out of CROSS_COMPILE
> > in Makefile then my issue would be fixed too. However this would mean that cross compiling users
> > now have to pass CC = <cross-compiler> themselves instead of CROSS_COMPILE prefix. Is that
> > acceptable ?
>
> You could play with something like:
>
> ifeq($(origin CC),default)
> CC=$(CROSS_COMPILE)gcc
> endif
>
> but not sure I'd like the result. If you asked me, I'd drop all that
> CROSS_COMPILE stuff.
Why? Isn't this the normal way of triggering cross-compile? AFIAK, that's
how the kernel does it, and that seems like a pretty sane way.
And yes, I compile rt-tests to several architectures, so I'm quite fond of
the CROSS_COMPILE switch. In fact, I might get cross if you cross it out :)
--
Henrik Austad
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
next prev parent reply other threads:[~2016-01-05 21:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-03 18:54 [PATCH] Makefile: Set CC/AR variable only if it doesn't have a value Khem Raj
2016-01-04 13:39 ` Jeff Epler
2016-01-04 14:40 ` Clark Williams
2016-01-05 3:12 ` Jeff Epler
2016-01-04 16:20 ` Khem Raj
2016-01-04 16:25 ` Uwe Kleine-König
2016-01-05 21:15 ` Henrik Austad [this message]
2016-01-05 21:20 ` Khem Raj
2016-01-05 21:42 ` Uwe Kleine-König
2016-01-04 19:21 ` Arnout Vandecappelle
2016-01-04 23:13 ` Khem Raj
2016-01-05 22:59 ` John Kacur
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=20160105211556.GA7561@icarus.home.austad.us \
--to=henrik@austad.us \
--cc=jepler@unpythonic.net \
--cc=jkacur@redhat.com \
--cc=linux-rt-users@vger.kernel.org \
--cc=raj.khem@gmail.com \
--cc=u.kleine-koenig@pengutronix.de \
--cc=williams@redhat.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;
as well as URLs for NNTP newsgroup(s).