From d6116f74260a53a94aa1a1438a76e67753f63fdc Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 21 Jan 2024 08:33:59 +0530 Subject: [PATCH] Fix #7026 --- setup.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/setup.py b/setup.py index 35e69d00d..e4d8bc851 100755 --- a/setup.py +++ b/setup.py @@ -454,6 +454,9 @@ def init_env( # Universal build fails with -fcf-protection clang is not smart enough to filter it out for the ARM part intel_control_flow_protection = '-fcf-protection=full' if ccver >= (9, 0) and not build_universal_binary else '' control_flow_protection = arm_control_flow_protection if is_arm else intel_control_flow_protection + if control_flow_protection: + if not test_compile(cc, control_flow_protection): + control_flow_protection = '' cflags_ = os.environ.get( 'OVERRIDE_CFLAGS', ( f'-Wextra {float_conversion} -Wno-missing-field-initializers -Wall -Wstrict-prototypes {std}'