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]
Date:	Wed, 3 Dec 2014 10:25:49 -0800
From:	Tim Bird <tim.bird@...ymobile.com>
To:	Geert Uytterhoeven <geert@...ux-m68k.org>
CC:	Michael Ellerman <mpe@...erman.id.au>,
	Shuah Khan <shuahkh@....samsung.com>,
	"linux-api@...r.kernel.org" <linux-api@...r.kernel.org>,
	Josh Triplett <josh@...htriplett.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-embedded@...r.kernel.org" <linux-embedded@...r.kernel.org>,
	Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>
Subject: Re: [PATCH v5] selftest: size: Add size test for Linux kernel



On 12/03/2014 10:00 AM, Geert Uytterhoeven wrote:
> On Wed, Dec 3, 2014 at 5:29 PM, Tim Bird <tim.bird@...ymobile.com> wrote:
>>>> diff --git a/tools/testing/selftests/size/Makefile b/tools/testing/selftests/size/Makefile
>>>> new file mode 100644
>>>> index 0000000..47f8e9c
>>>> --- /dev/null
>>>> +++ b/tools/testing/selftests/size/Makefile
>>>> @@ -0,0 +1,15 @@
>>>> +#ifndef CC
>>>> +    CC = $(CROSS_COMPILE)gcc
>>>> +#endif
>>>
>>> I think the following is preferable:
>>>
>>>   CC := $(CROSS_COMPILE)$(CC)
>>>
>>>
>>> It allows optionally setting a custom CC, as well as optionally CROSS_COMPILE.
>>
>> I'm not sure I follow this.
>>
>> If CC is unset, you get only the CROSS_COMPILE prefix.
>> If CC is set to e.g. 'gcc', then you get a nicely formatted toolchain string.
>> But if CC already has the prefix applied, then this will result in
>>   having it duplicated, which surely won't work correctly.
>>
>> In the long run, I would hope that a higher level Makefile or environment setting
>> will be setting the toolchain string appropriately (as well as handling build flags)
>> which is why I wanted to use an ifndef (which Thomas correctly pointed out is just
>> wrong).
>>
>> Actually, after getting this tiny program accepted, my next task was working on a
>> proper fix for handling cross compilation in a more generic (not case-by-case) way.
>>
>> CROSS_COMPILE prefix usage looks a bit uncoordinated in the tools directory, but most
>> tests seem to be favoring $(CROSS_COMPILE)gcc.
>>
>>  $ cd tools ; mgrep CROSS
> 
> [...]
> 
>> I agree it's desirable not to hardcode gcc, but we seem to be doing it all over
>> the place already.
> 
> Seems like it's time to start integrating the tests with the regular Kbuild
> system, which handles cross-compilation fine...

Where possible, yes.  It would be nice to leverage CROSS_COMPILE and CFLAGS, or
a portion thereof, from the Kbuild system (as well a KBUILD_OUTPUT and friends).
It's on my to-do list, after getting my little C program accepted...
 -- Tim
--
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