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 21:37:40 +0100
User-agent: mu4e 1.1.0; emacs 26.1

Murilo Opsfelder Araujo <address@hidden> writes:

> On Wed, May 16, 2018 at 04:18:56PM +0100, Alex Bennée wrote:
>>
>> 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.
>
> Hi, Alex.
>
> User can mistakenly pass, for example, --cross-cc-ppc64el= instead of the
> expected --cross-cc-ppc64le=. I was wondering if we need to validate this kind
> of input (inexistent $cross_cc_* variable) and consider --cross-cc-ppc64el= an
> invalid option, in this example.

OK I understand. I'm not sure how to do this without having a whole bunch of
additional boilerplate code though. I guess there is likely to be churn
each time a new guest architecture is added though.

We do currently dump the list of enabled compilers at the end of
configure so that at least should give the user some indication of what
didn't work?

> By the way, are you updating the --help text explaining these new --cross-cc-*
> options?

Yes.

--
Alex Bennée



reply via email to

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