mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-03-08 20:58:20 +03:00
build: Use -fstrict-flex-arrays=1 if supported
Due to "historical reasons" both gcc and clang treat *all* trailing arrays members as flexible arrays, this has an evil side effect of inhibiting bounds checks on such members as __builtin_object_size cannot say for sure that: struct { ... type foo[3]; } has a trailing foo member of fixed size rather than unspecified. Ideally we should use -fstrict-flex-arrays as is, but we have to tolerate kernel uapi headers that use [0] and third party libraries written in c89 that may use [1] like curl.
This commit is contained in:
parent
7618ab1b71
commit
afd8e1d945
@ -451,6 +451,7 @@ possible_cc_flags = possible_common_cc_flags + [
|
|||||||
'-fno-strict-aliasing',
|
'-fno-strict-aliasing',
|
||||||
'-fstack-protector',
|
'-fstack-protector',
|
||||||
'-fstack-protector-strong',
|
'-fstack-protector-strong',
|
||||||
|
'-fstrict-flex-arrays=1',
|
||||||
'-fvisibility=hidden',
|
'-fvisibility=hidden',
|
||||||
'--param=ssp-buffer-size=4',
|
'--param=ssp-buffer-size=4',
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user