On 9/25/2026 2:38 AM, Daniel P. Berrangé wrote:
> On Thu, Sep 24, 2026 at 09:39:40PM +0000, Pierrick Bouvier wrote:
>> This allows each target to provide an additional list of cross
>> compilers to check. With this, we can detect default cc for common
>> setups (debian/fedora/macos) without user having to provide a
>> --cross-cc-* option.
>>
>> In addition, it allows us to pick up host compilers for various hosts.
>> (debian and archlinux have $arch-linux-gnu-gcc installed
>> with gcc package by default, but not fedora).
>>
>> Signed-off-by: Pierrick Bouvier <[email protected]>
>> ---
>>  tests/tcg/meson.build | 46 +++++++++++++++++++++++++------------------
>>  1 file changed, 27 insertions(+), 19 deletions(-)
>>
>> diff --git a/tests/tcg/meson.build b/tests/tcg/meson.build
>> index 0006d192cab..59ab73e1d10 100644
>> --- a/tests/tcg/meson.build
>> +++ b/tests/tcg/meson.build
>> @@ -21,6 +21,7 @@ tcg_tests = {}
>>  # {
>>  #   'name_of_target': {
>>  #     'cc': 'cross_compiler',
>> +#     'cc_alt': ['list of alternative cross compilers', ...]
>>  #     'cc_dockerfile': 'name_of_dockerfile',
>>  #     'cc_feat_cflags': {
>>  #       'name': ['feature cflags'],
>> @@ -210,7 +211,7 @@ foreach target, plan: tcg_tests
>>  
>>    # return a clear error if user misspell a target entry
>>    foreach key, _ : plan
>> -    allowed = ['cc', 'cc_dockerfile', 'cc_feat_cflags',
>> +    allowed = ['cc', 'cc_alt', 'cc_dockerfile', 'cc_feat_cflags',
>>                 'folder', 'gdb_arch', 'gdb_feat_version', 'qemu', 'tests']
>>      if key not in allowed
>>        error('unknown tcg test plan entry \'' + key + '\' for target ' + 
>> target +
>> @@ -218,15 +219,18 @@ foreach target, plan: tcg_tests
>>      endif
>>    endforeach
>>  
>> -  cc = find_program(plan['cc'], required : false)
>> +  cc_list = [plan['cc']]
>> +  if 'cc_alt' in plan
>> +    cc_list += plan['cc_alt']
>> +  endif
> 
> If you're combining these into a list anyway, why not just
> have 'cc' be a list of CC names to begin with and not bother
> with a separate 'cc_alt' field ?
> 

It's just a semantic choice, since cc has to be provided in docker
container, while cc_alt do not. I can add a comment if it makes sense
for you with this explanation.

> With regards,
> Daniel


Reply via email to