Skip to content

clang_nowarn_wstack_usage_262144

Tsukasa OI edited this page Sep 14, 2022 · 2 revisions

Clang: Stop using -Wstack-usage=262144 when built with Clang

Issue Solved

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 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.

With this patchset, GNU Binutils no longer appends -Wstack-usage=262144 if the compiler is identified as Clang (when __clang__ is defined).

I also regenerated related configure scripts with maintainer mode.

Clone this wiki locally