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:	Thu, 4 Sep 2014 09:23:10 +0400
From:	Konstantin Khlebnikov <koct9i@...il.com>
To:	Paul Bolle <pebolle@...cali.nl>
Cc:	Michal Marek <mmarek@...e.cz>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	linux-kbuild <linux-kbuild@...r.kernel.org>,
	Geert Uytterhoeven <geert@...ux-m68k.org>
Subject: Re: [PATCH v2 4/4] kconfig: link CONFIG_CROSS_COMPILE with
 environment variable

On Thu, Sep 4, 2014 at 1:11 AM, Paul Bolle <pebolle@...cali.nl> wrote:
> Hi Konstantin,
>
> On Mon, 2014-09-01 at 11:16 +0400, Konstantin Khlebnikov wrote:
>> Cross-compiler tool prefix can be set in command line, in the environment
>> variable CROSS_COMPILE or in config file, in option CONFIG_COROSS_COMPILE.
>> Also some arch/*/Makefile provides default value.
>>
>> This patch links config option CONFIG_CROSS_COMPILE and variable CROSS_COMPILE
>> in both directions: environment/command line has higher priority and updates
>> value saved in the config file, config option acts as default value for it.
>>
>> This is especially useful together with option O=dir which allows to create
>> separate directory for each target architecture and kernel flavor:
>>
>> # make O=build/arm ARCH=arm CROSS_COMPILE=arm-none-eabi- defconfig
>> # make -C build/arm
>>
>> Signed-off-by: Konstantin Khlebnikov <koct9i@...il.com>
>
> I have only had a quick glance at this series. Just a quick question to
> help me understand where it is going.
>
> Would this patch mean that, if a (def)config file has both ARCH and
> CROSS_COMPILE set, one could use that (def)config file and invoke "make
> $whatever_target" and expect it to do the right thing (provided a
> suitable cross compiler is installed)?
>
> This implies cross compiler prefixes are standardized across
> distributions, I guess. Maybe they're not.

As I know they are not strictly standardized.
Naming convention is arch[-vendor][-os]-abi, but there is a lot of
possible combinations.

>
>> ---
>>  Makefile     |    6 +++++-
>>  init/Kconfig |    1 +
>>  2 files changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/Makefile b/Makefile
>> index f648405..1044f40 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -263,7 +263,11 @@ endif
>>  # "make" in the configured kernel build directory always uses that.
>>  # Default value for CROSS_COMPILE is not to prefix executables
>>  # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
>> -CROSS_COMPILE        ?= $(CONFIG_CROSS_COMPILE:"%"=%)
>> +ifndef CROSS_COMPILE
>> +     CROSS_COMPILE := $(shell $(srctree)/scripts/config \
>> +                             --file $(KBUILD_OUTPUT)$(KCONFIG_CONFIG) \
>> +                             --if-undef "" --state "CROSS_COMPILE")
>> +endif
>>
>>  # Architecture as present in compile.h
>>  UTS_MACHINE  := $(ARCH)
>> diff --git a/init/Kconfig b/init/Kconfig
>> index e84c642..1c2f621 100644
>> --- a/init/Kconfig
>> +++ b/init/Kconfig
>> @@ -47,6 +47,7 @@ config INIT_ENV_ARG_LIMIT
>>
>>  config CROSS_COMPILE
>>       string "Cross-compiler tool prefix"
>> +     option env="CROSS_COMPILE"
>>       help
>>         Same as running 'make CROSS_COMPILE=prefix-' but stored for
>>         default make runs in this kernel build directory.  You don't
>>
>
>
> Paul Bolle
>
--
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