On 4/3/25 18:28, Roman Bogorodskiy wrote:
>   Michal Prívozník wrote:
> 
>> On 4/2/25 19:24, Roman Bogorodskiy wrote:
>>> The 'plain' optimization type also triggers the clang stack frame size
>>> issues, so increase limit for it as well.
>>>
>>> Signed-off-by: Roman Bogorodskiy <bogorods...@gmail.com>
>>> ---
>>>  meson.build | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/meson.build b/meson.build
>>> index 56823ca25b..0a402a19a2 100644
>>> --- a/meson.build
>>> +++ b/meson.build
>>> @@ -259,7 +259,7 @@ alloc_max = run_command(
>>>  stack_frame_size = 2048
>>>  
>>>  # clang without optimization enlarges stack frames in certain corner cases
>>> -if cc.get_id() == 'clang' and get_option('optimization') == '0'
>>> +if cc.get_id() == 'clang' and get_option('optimization') in ['plain', '0']
>>>      stack_frame_size = 4096
>>>  endif
>>>  
>>
>> Funny, with clang I hit this issue for all possible values of
>> --optimization {plain,0,g,1,2,3,s}.
> 
> That's interesting indeed.
> 
> Currently, "plain" is the only value that triggers the issue for me:
> 
> Problematic file is the following:
> 
> ../src/remote/remote_driver.c:790:1: error: stack frame size (2344) exceeds 
> limit (2048) in 'doRemoteOpen' [-Werror,-Wframe-larger-than]
>   790 | doRemoteOpen(virConnectPtr conn,
>       | ^
> 1 error generated.
> 
> Clang version is 19.1.7. 

Same here:

clang version 19.1.7
Target: x86_64-pc-linux-gnu

except I'm running Linux and I assume you're running *BSD. Given what
also Dan said, are you willing to post a v2 where the condition is
simplified to just 'clang' and no get_option('optimization')?

Actually, give me a minute or to - maybe there's something I can do
about doRemoteOpen() so that its stack isn't that huge.

Michal

Reply via email to