public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "WANG Xuerui" <xen0n@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/spidermonkey/, dev-lang/spidermonkey/files/
Date: Thu, 26 May 2022 00:58:48 +0000 (UTC)	[thread overview]
Message-ID: <1653526536.ba4514f5b434a0a974c6d5ad759f4f6bde11eaaf.xen0n@gentoo> (raw)

commit:     ba4514f5b434a0a974c6d5ad759f4f6bde11eaaf
Author:     WANG Xuerui <xen0n <AT> gentoo <DOT> org>
AuthorDate: Wed May 25 14:32:30 2022 +0000
Commit:     WANG Xuerui <xen0n <AT> gentoo <DOT> org>
CommitDate: Thu May 26 00:55:36 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ba4514f5

dev-lang/spidermonkey: fix build on loong for 68.12.0-r1

Patch applied here has been running on real loong hardware since late
2021, simple and no problems so far.

See: https://github.com/gentoo/gentoo/pull/25632
Acked-by: Joonas Niilola <juippis <AT> gentoo.org>
Signed-off-by: WANG Xuerui <xen0n <AT> gentoo.org>

 .../files/spidermonkey-68.0-loong-support.patch    | 103 +++++++++++++++++++++
 .../spidermonkey/spidermonkey-68.12.0-r1.ebuild    |   1 +
 2 files changed, 104 insertions(+)

diff --git a/dev-lang/spidermonkey/files/spidermonkey-68.0-loong-support.patch b/dev-lang/spidermonkey/files/spidermonkey-68.0-loong-support.patch
new file mode 100644
index 000000000000..f7010d5ebf32
--- /dev/null
+++ b/dev-lang/spidermonkey/files/spidermonkey-68.0-loong-support.patch
@@ -0,0 +1,103 @@
+https://raw.githubusercontent.com/xen0n/loongson-overlay/00901fd4c599ec320c7852cbd30b40d3f6aa8971/dev-lang/spidermonkey/files/spidermonkey-68.0-add-loongarch64-support.patch
+
+--- a/build/moz.configure/init.configure
++++ b/build/moz.configure/init.configure
+@@ -734,6 +734,9 @@ def split_triplet(triplet, allow_unknown
+     elif cpu == 'sh4':
+         canonical_cpu = 'sh4'
+         endianness = 'little'
++    elif cpu == 'loongarch64':
++        canonical_cpu = 'loongarch64'
++        endianness = 'little'
+     elif allow_unknown:
+         canonical_cpu = cpu
+         endianness = 'unknown'
+--- a/js/src/jit/AtomicOperations.h
++++ b/js/src/jit/AtomicOperations.h
+@@ -382,6 +382,9 @@ inline bool AtomicOperations::isLockfree
+ #  else
+ #    include "jit/shared/AtomicOperations-feeling-lucky.h"
+ #  endif
++#elif defined(__loongarch64)
++// This is only here to avoid merge conflict with spidermonkey-68.0-add-riscv-support.patch.
++#  include "jit/shared/AtomicOperations-feeling-lucky.h"
+ #elif defined(__mips__)
+ #  if defined(__clang__) || defined(__GNUC__)
+ #    include "jit/mips-shared/AtomicOperations-mips-shared.h"
+--- a/js/src/jit/shared/AtomicOperations-feeling-lucky-gcc.h
++++ b/js/src/jit/shared/AtomicOperations-feeling-lucky-gcc.h
+@@ -57,6 +57,11 @@
+ #  define HAS_64BIT_LOCKFREE
+ #endif
+ 
++#ifdef __loongarch64
++#  define HAS_64BIT_ATOMICS
++#  define HAS_64BIT_LOCKFREE
++#endif
++
+ #if defined(__ppc64__) || defined(__PPC64__) || defined(__ppc64le__) || \
+     defined(__PPC64LE__)
+ #  define HAS_64BIT_ATOMICS
+--- a/mfbt/tests/TestPoisonArea.cpp
++++ b/mfbt/tests/TestPoisonArea.cpp
+@@ -127,6 +127,9 @@
+ #elif defined __arm__ || defined _M_ARM
+ #  define RETURN_INSTR 0xE12FFF1E /* bx lr */
+ 
++#elif defined __loongarch__
++#  define RETURN_INSTR 0x4c000020 /* jirl zero, ra, 0 */
++
+ // PPC has its own style of CPU-id #defines.  There is no Windows for
+ // PPC as far as I know, so no _M_ variant.
+ #elif defined _ARCH_PPC || defined _ARCH_PWR || defined _ARCH_PWR2
+--- a/python/mozbuild/mozbuild/configure/constants.py
++++ b/python/mozbuild/mozbuild/configure/constants.py
+@@ -46,6 +46,7 @@ CPU_bitness = {
+     'arm': 32,
+     'hppa': 32,
+     'ia64': 64,
++    'loongarch64': 64,
+     'mips32': 32,
+     'mips64': 64,
+     'ppc': 32,
+@@ -78,6 +79,7 @@ CPU_preprocessor_checks = OrderedDict((
+     ('arm', '__arm__ || _M_ARM'),
+     ('aarch64', '__aarch64__ || _M_ARM64'),
+     ('ia64', '__ia64__'),
++    ('loongarch64', '__loongarch64'),
+     ('s390x', '__s390x__'),
+     ('s390', '__s390__'),
+     ('ppc64', '__powerpc64__'),
+--- a/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py
++++ b/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py
+@@ -1068,6 +1068,10 @@ class LinuxCrossCompileToolchainTest(Bas
+         'ia64-unknown-linux-gnu': little_endian + {
+             '__ia64__': 1,
+         },
++        'loongarch64-unknown-linux-gnu': little_endian + {
++            '__loongarch__': 1,
++            '__loongarch64': 1,
++        },
+         's390x-unknown-linux-gnu': big_endian + {
+             '__s390x__': 1,
+             '__s390__': 1,
+--- a/intl/icu/source/i18n/double-conversion-utils.h
++++ b/intl/icu/source/i18n/double-conversion-utils.h
+@@ -117,6 +117,7 @@ int main(int argc, char** argv) {
+ #if defined(_M_X64) || defined(__x86_64__) || \
+     defined(__ARMEL__) || defined(__avr32__) || defined(_M_ARM) || defined(_M_ARM64) || \
+     defined(__hppa__) || defined(__ia64__) || \
++    defined(__loongarch__) || \
+     defined(__mips__) || \
+     defined(__nios2__) || defined(__ghs) || \
+     defined(__powerpc__) || defined(__ppc__) || defined(__ppc64__) || \
+--- a/mfbt/double-conversion/double-conversion/utils.h
++++ b/mfbt/double-conversion/double-conversion/utils.h
+@@ -117,6 +117,7 @@ int main(int argc, char** argv) {
+ #if defined(_M_X64) || defined(__x86_64__) || \
+     defined(__ARMEL__) || defined(__avr32__) || defined(_M_ARM) || defined(_M_ARM64) || \
+     defined(__hppa__) || defined(__ia64__) || \
++    defined(__loongarch__) || \
+     defined(__mips__) || \
+     defined(__nios2__) || defined(__ghs) || \
+     defined(__powerpc__) || defined(__ppc__) || defined(__ppc64__) || \

diff --git a/dev-lang/spidermonkey/spidermonkey-68.12.0-r1.ebuild b/dev-lang/spidermonkey/spidermonkey-68.12.0-r1.ebuild
index a836814ad075..46cc4b1b3634 100644
--- a/dev-lang/spidermonkey/spidermonkey-68.12.0-r1.ebuild
+++ b/dev-lang/spidermonkey/spidermonkey-68.12.0-r1.ebuild
@@ -101,6 +101,7 @@ src_prepare() {
 	eapply "${WORKDIR}"/firefox
 	eapply "${WORKDIR}"/spidermonkey-patches
 	eapply "${FILESDIR}"/spidermonkey-68.0-add-riscv-support.patch
+	eapply "${FILESDIR}"/spidermonkey-68.0-loong-support.patch
 
 	default
 


             reply	other threads:[~2022-05-26  0:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-26  0:58 WANG Xuerui [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-06-03 13:16 [gentoo-commits] repo/gentoo:master commit in: dev-lang/spidermonkey/, dev-lang/spidermonkey/files/ Joonas Niilola
2025-06-03 13:08 Joonas Niilola
2024-10-09  6:09 Joonas Niilola
2024-03-21  7:03 Joonas Niilola
2024-02-23  8:23 Joonas Niilola
2023-08-12  8:38 Joonas Niilola
2023-05-10 12:14 Joonas Niilola
2022-12-15 11:40 Joonas Niilola
2022-10-23  6:27 Joonas Niilola
2022-08-16  7:55 Joonas Niilola
2021-09-06 14:03 Thomas Deutschmann
2020-08-14  9:29 Thomas Deutschmann
2020-04-21 11:50 Thomas Deutschmann
2018-11-17 16:52 Ian Stakenvicius
2017-05-11 20:53 Ian Stakenvicius

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1653526536.ba4514f5b434a0a974c6d5ad759f4f6bde11eaaf.xen0n@gentoo \
    --to=xen0n@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox