mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Darren Hart <dvhart@linux.intel.com>
Cc: David Sharp <dhsharp@google.com>,
	linux-kernel@vger.kernel.org, mrubin@google.com
Subject: Re: [PATCH trace-cmd 3/3] Revert "trace-cmd: Use conditional assignment of CC and AR"
Date: Wed, 09 Mar 2011 21:42:17 -0500	[thread overview]
Message-ID: <1299724937.15854.277.camel@gandalf.stny.rr.com> (raw)
In-Reply-To: <4D783038.8080103@linux.intel.com>

On Wed, 2011-03-09 at 17:58 -0800, Darren Hart wrote:
> On 03/09/2011 05:36 PM, Steven Rostedt wrote:
> > On Wed, 2011-03-09 at 17:27 -0800, Darren Hart wrote:
> >> On 03/09/2011 03:58 PM, David Sharp wrote:
> >>> This reverts commit 6c696cec3f264a9399241b6e648f58bc97117d49.
> >>>
> >>> Make has default values CC and AR of 'cc' and 'ar' respectively. This means
> >>> that "CC ?= anything" will never have effect, because CC is always already set.
> >>> Because of this, 6c696cec makes setting CROSS_COMPILE from the command line or
> >>> environment useless.
> >>
> >> The problem with this approach is it prevents the user from setting CC
> >> explicitly with the environment which is a very common way of using a
> >> specific version of gcc (for example). It also places restrictions on
> >> the filename of the compiler (it must end in gcc - so gcc-4.5.1 cannot
> >> work), this isn't acceptable.
> >>
> >> You could use CC=your-cross-compiler, and if that doesn't work for you,
> >> you could prepare a patch that conditionally sets CC only if
> >> CROSS_COMPILE is set, but please do not simply revert this patch which
> >> solved a real problem with the Makefile.
> >
> > Hmm, but the thing is, the change did not work,
> 
> It did work for me as I was setting CC= on the command line.
> 
> unless your environment
> > for some reason does not supply a 'cc'. Or that 'cc' defaulted to the
> > compiler that you wanted, where 'gcc' would not.
> >
> > Thus, would you be fine with something like:
> >
> > 	BUILD_CC ?=	$(CROSS_COMPILE)gcc
> > 	CC	 =	$(BUILD_CC)
> 
> This would also work, but what is wrong with:
> 
> dvhart@doubt:templates$ cat Makefile
> ifdef CROSS_COMPILE
> CC = $(CROSS_COMPILE)gcc
> AR = $(CROSS_COMPILE)ar
> endif
> 
> all:
> 	echo "CC: $(CC)"
> 
> dvhart@doubt:templates$ make -s
> CC: cc
> 
> dvhart@doubt:templates$ CC=gcc-4.5.1 make -s
> CC: gcc-4.5.1
> 
> dvhart@doubt:templates$ CROSS_COMPILE=my-cross- make -s
> CC: my-cross-gcc
> 
> 
> Seems to meet everyone's needs without changing any tools/scripts/etc 
> that have used trace-cmd before or after the CC ?= wreckage.
> 

OK, I'm fine with this.

David, want to send another patch with Darren's suggestion?

-- Steve



      parent reply	other threads:[~2011-03-10  2:42 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-09 23:58 [PATCH trace-cmd 1/3] parse-events: Add support for printing short fields David Sharp
2011-03-09 23:58 ` [PATCH trace-cmd 2/3] parse-events: support additional operators: '!', '~', and '!=' David Sharp
2011-03-09 23:58 ` [PATCH trace-cmd 3/3] Revert "trace-cmd: Use conditional assignment of CC and AR" David Sharp
2011-03-10  1:21   ` Steven Rostedt
2011-03-10  1:28     ` Steven Rostedt
2011-03-10  1:29       ` Darren Hart
2011-03-10  1:27   ` Darren Hart
2011-03-10  1:36     ` Steven Rostedt
2011-03-10  1:58       ` Darren Hart
2011-03-10  2:27         ` David Sharp
2011-03-10  2:51           ` Steven Rostedt
2011-03-10  3:26             ` Steven Rostedt
2011-03-10  5:25               ` David Sharp
2011-03-10  6:46                 ` Darren Hart
2011-03-10 13:02                   ` Steven Rostedt
2011-03-10  6:41               ` Darren Hart
2011-03-10 13:07                 ` Steven Rostedt
2011-03-10  6:34             ` Darren Hart
2011-03-10  6:32           ` Darren Hart
2011-03-10  6:43           ` Darren Hart
2011-03-10 13:11             ` Steven Rostedt
2011-03-10 17:50               ` Darren Hart
2011-03-10 18:11                 ` Steven Rostedt
2011-03-10 21:11                   ` [PATCH trace-cmd v2] trace-cmd: allow setting CC and AR, or CROSS_COMPILE from command line David Sharp
2011-03-10 21:30                     ` Steven Rostedt
2011-03-10  2:42         ` Steven Rostedt [this message]

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=1299724937.15854.277.camel@gandalf.stny.rr.com \
    --to=rostedt@goodmis.org \
    --cc=dhsharp@google.com \
    --cc=dvhart@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mrubin@google.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

all inboxes | Powered by JetHome®