compiler: fix fortify for clang

The clang compiler has also defined `__GNUC__`, which can't be used to
decide the compiler version.

And the version used to decide whether the builtin function
`__builtin_dynamic_object_size` exist is not correct.

Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
This commit is contained in:
chenxiaoyi
2024-12-04 18:02:59 +08:00
committed by Alan C. Assis
parent ad422684d4
commit c07d9dc900
-4
View File
@@ -113,10 +113,6 @@
# warning requires compiling with optimization (-O2 or higher)
# endif
# if CONFIG_FORTIFY_SOURCE == 3
# if __GNUC__ < 12 || (defined(__clang__) && __clang_major__ < 12)
# error compiler version less than 12 does not support dynamic object size
# endif
# define fortify_size(__o, type) __builtin_dynamic_object_size(__o, type)
# else
# define fortify_size(__o, type) __builtin_object_size(__o, type)