lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4D787084.3000402@linux.intel.com>
Date:	Wed, 09 Mar 2011 22:32:36 -0800
From:	Darren Hart <dvhart@...ux.intel.com>
To:	David Sharp <dhsharp@...gle.com>
CC:	Steven Rostedt <rostedt@...dmis.org>, linux-kernel@...r.kernel.org,
	mrubin@...gle.com
Subject: Re: [PATCH trace-cmd 3/3] Revert "trace-cmd: Use conditional assignment
 of CC and AR"

On 03/09/2011 06:27 PM, David Sharp wrote:
> On Wed, Mar 9, 2011 at 5:58 PM, Darren Hart<dvhart@...ux.intel.com>  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@...bt:templates$ cat Makefile
>> ifdef CROSS_COMPILE
>> CC = $(CROSS_COMPILE)gcc
>> AR = $(CROSS_COMPILE)ar
>> endif
>>
>> all:
>>         echo "CC: $(CC)"
>>
>> dvhart@...bt:templates$ make -s
>> CC: cc
>>
>> dvhart@...bt:templates$ CC=gcc-4.5.1 make -s
>> CC: gcc-4.5.1
>>
>> dvhart@...bt: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.
>
> It's a little odd that the default CC is "cc" unless you supply
> CROSS_COMPILE, then it's "gcc". I'd probably be okay with this, but I
> would think it's weird.

Note that I don't specify cc anywhere, that is what Make uses as the 
default CC, and at least on Ubuntu 10.10 /usr/bin/cc is in the path and 
points to gcc (eventually). So this seems pretty no

-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ