From 46bb027d1462d04ee60ab7960cf14bd8e6e3e82d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 15 Jan 2024 11:23:42 +0530 Subject: [PATCH] Fix building on old gcc/clang --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a41ccd873..c3b479fed 100755 --- a/setup.py +++ b/setup.py @@ -451,7 +451,8 @@ def init_env( # Using -mbranch-protection=standard causes crashes on Linux ARM, reported # in https://github.com/kovidgoyal/kitty/issues/6845#issuecomment-1835886938 arm_control_flow_protection = '-mbranch-protection=standard' if is_macos else '' - control_flow_protection = arm_control_flow_protection if is_arm else '-fcf-protection=full' + intel_control_flow_protection = '-fcf-protection=full' if ccver >= (9, 0) else '' + control_flow_protection = arm_control_flow_protection if is_arm else intel_control_flow_protection cflags_ = os.environ.get( 'OVERRIDE_CFLAGS', ( f'-Wextra {float_conversion} -Wno-missing-field-initializers -Wall -Wstrict-prototypes {std}'