1From c5cfb8aa591afd5ad3aedc58fe7f410e89013605 Mon Sep 17 00:00:00 2001
2From: Kai Kang <kai.kang@windriver.com>
3Date: Fri, 22 Sep 2023 22:59:59 +0000
4Subject: [PATCH] Backport patch from firefox bugzilla to fix compile error for
5 qemuarm with some armv7ve tunes such as 'armv7vethf' and 'armv7vet-vfpv3d16':
6
7| /path/to/build/tmp/work/armv7vet2hf-vfp-poky-linux-gnueabi/mozjs-102/102.5.0-r0/build/js/src/jit/AtomicOperationsGenerated.h:240:17:
8  error: 'asm' operand has impossible constraints
9|  240 |                 asm volatile (
10|      |                 ^~~
11
12Upstream-Status: Submitted [https://bugzilla.mozilla.org/show_bug.cgi?id=1761665]
13
14Signed-off-by: Kai Kang <kai.kang@windriver.com>
15
16---
17 js/src/jit/GenerateAtomicOperations.py | 2 +-
18 1 file changed, 1 insertion(+), 1 deletion(-)
19
20diff --git a/js/src/jit/GenerateAtomicOperations.py b/js/src/jit/GenerateAtomicOperations.py
21index 24b5a191cf..e41948c5af 100644
22--- a/js/src/jit/GenerateAtomicOperations.py
23+++ b/js/src/jit/GenerateAtomicOperations.py
24@@ -860,7 +860,7 @@ def generate_atomics_header(c_out):
25
26         # Work around a GCC issue on 32-bit x86 by adding MOZ_NEVER_INLINE.
27         # See bug 1756347.
28-        if is_gcc and cpu_arch == "x86":
29+        if is_gcc and cpu_arch in ("x86", "arm"):
30             contents = contents.replace("INLINE_ATTR", "MOZ_NEVER_INLINE inline")
31         else:
32             contents = contents.replace("INLINE_ATTR", "inline")
33