qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 03/46] configure: add support for --cross-cc-


From: Alex Bennée
Subject: Re: [Qemu-devel] [PATCH v3 03/46] configure: add support for --cross-cc-FOO
Date: Wed, 16 May 2018 16:18:56 +0100
User-agent: mu4e 1.1.0; emacs 26.1

Murilo Opsfelder Araujo <address@hidden> writes:

> On 04/24/2018 12:23 PM, Alex Bennée wrote:
>> This allows us to specify cross compilers for our guests. This is
>> useful for building test images/programs. Currently we re-run the
>> compile test for each target. I couldn't think of a way to cache the
>> value for a given arch without getting messier configure code.
>>
>> The cross compiler for the guest is visible to each target as
>> CROSS_CC_GUEST in config-target.mak.
>>
>> Signed-off-by: Alex Bennée <address@hidden>
>>
>> ---
>> v3
>>   - --cross-cc-*[!a-zA-Z0-9_-]*=*) error_exit...
>>   - --cross-cc-*) cc_arch=${opt#--cross-cc-}; cc_arch=${cc_arch%%=*}
>>   - add remaining target_compiler definitions
>> ---
>>  configure | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 79 insertions(+)
>>
>> diff --git a/configure b/configure
>> index b0ae632ee4..caa838a0d0 100755
>> --- a/configure
>> +++ b/configure
>> @@ -453,6 +453,13 @@ vxhs=""
>>  libxml2=""
>>  docker="no"
>>
>> +# cross compilers defaults, can be overridden with --cross-cc-ARCH
>> +cross_cc_aarch64="aarch64-linux-gnu-gcc"
>> +cross_cc_arm="arm-linux-gnueabihf-gcc"
>> +cross_cc_powerpc="powerpc-linux-gnu-gcc"
>
> Do we need to have default values for all targets?
>
>> +
>> +enabled_cross_compilers=""
>> +
>>  supported_cpu="no"
>>  supported_os="no"
>>  bogus_os="no"
>> @@ -483,6 +490,11 @@ for opt do
>>    ;;
>>    --disable-debug-info) debug_info="no"
>>    ;;
>> +  --cross-cc-*[!a-zA-Z0-9_-]*=*) error_exit "Passed bad --cross-cc-FOO 
>> option"
>> +  ;;
>> +  --cross-cc-*) cc_arch=${opt#--cross-cc-}; cc_arch=${cc_arch%%=*}
>> +                eval "cross_cc_${cc_arch}=\$optarg"
>> +  ;;
>
> Do we need to verify if a valid --cross-cc-FOO was passed, in case of a
> typo?

How so? We do attempt to build with these options later.

>>
>> +# Do we have a cross compiler for this target?
>> +if has $target_compiler; then
>> +
>> +    cat > $TMPC << EOF
>> +#include <stdio.h>
>> +int main(void) {
>> +    printf("Hello World!\n");
>> +}
>> +EOF
>
> Can this be replaced by write_c_skeleton?

Sure. Thanks.

--
Alex Bennée



reply via email to

[Prev in Thread] Current Thread [Next in Thread]