[PATCH 1/1] bfd: Stop using -Wstack-usage=262144 when built with Clang

Tsukasa OI research_trasio@irq.a4lg.com
Tue Sep 13 15:29:20 GMT 2022


On 2022/09/13 22:44, Jan Beulich wrote:
> On 13.09.2022 14:59, Tsukasa OI wrote:
>> Some components of GNU Binutils will pass "-Wstack-usage=262144" when
>> "GCC >= 5.0" is detected.  However, Clang does not support "-Wstack-usage",
>> despite that related configuration part in bfd/warning.m4 handles the latest
>> Clang (15.0.0 as of this writing) as "GCC >= 5.0".
>>
>> The option "-Wstack-usage" was ignored when the first version of Clang is
>> released but even this "ignoring" behavior is removed before Clang 4.0.0.
>> So, if we give Clang "-Wstack-usage=262144", it generates a warning, making
>> the build failure.
> 
> While not exactly the same, how about passing -Wframe-larger-than= when
> it's (new enough) Clang, instead of not passing any such option?

That's a good idea.  But if I do that, that would make another patchset
on top of this (not PATCH v2 of this).
We need to know a good value of -Wframe-larger-than= for Clang and
meanwhile, just removing the -Wstack-usage looks acceptable for me.  For
now, that would be nice to have an approval to apply this patch as is.

> 
> Jan
> 


More information about the Binutils mailing list