From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Henrik Austad <henrik@austad.us>
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:42:53 +0100 [thread overview]
Message-ID: <20160105214253.GA27414@pengutronix.de> (raw)
In-Reply-To: <20160105211556.GA7561@icarus.home.austad.us>
Hello Henrik,
On Tue, Jan 05, 2016 at 10:15:56PM +0100, Henrik Austad wrote:
> 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.
No, the normal thing to trigger a cross-compile is
./configure --build=amd64 --host=mips-elf
:-)
For plain make project with no special support for cross compiling
(which is the norm today), the right incarnation is:
make CC=arm-v5te-linux-gnueabi-gcc
and IMHO that's good enough. (Sometimes you also have to pass CXX, in
rare cases even more.)
> 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 :)
I don't care much, because if I cross compile rt-tests someone else
already found out for me how to do it, I only have to enable it in my
config :-)
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-01-05 21:43 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
2016-01-05 21:20 ` Khem Raj
2016-01-05 21:42 ` Uwe Kleine-König [this message]
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=20160105214253.GA27414@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=henrik@austad.us \
--cc=jepler@unpythonic.net \
--cc=jkacur@redhat.com \
--cc=linux-rt-users@vger.kernel.org \
--cc=raj.khem@gmail.com \
--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).