From 90cdc2c49c1052d34fbb4061a7937ee7b56cb808 Mon Sep 17 00:00:00 2001 From: Savannah Ostrowski Date: Wed, 2 Oct 2024 02:40:59 -0700 Subject: [PATCH] GH-124820: Move `-mno-outline-atomics` flag to aarch64 Linux JIT builds only (GH-124821) (cherry picked from commit 6737333ac5777345d058271621ccb3c2d11dc81e) Co-authored-by: Savannah Ostrowski --- Tools/jit/_targets.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Tools/jit/_targets.py b/Tools/jit/_targets.py index 73d10a128756eb..72d5dbd581516e 100644 --- a/Tools/jit/_targets.py +++ b/Tools/jit/_targets.py @@ -512,7 +512,12 @@ def get_target(host: str) -> _COFF | _ELF | _MachO: args = ["-fms-runtime-lib=dll"] target = _COFF(host, alignment=8, args=args) elif re.fullmatch(r"aarch64-.*-linux-gnu", host): - args = ["-fpic"] + args = [ + "-fpic", + # On aarch64 Linux, intrinsics were being emitted and this flag + # was required to disable them. + "-mno-outline-atomics", + ] target = _ELF(host, alignment=8, args=args) elif re.fullmatch(r"i686-pc-windows-msvc", host): args = ["-DPy_NO_ENABLE_SHARED"]