[packages/mozjs60] - fix building on x32

baggins baggins at pld-linux.org
Sun Mar 31 11:09:24 CEST 2019


commit 9ffe278059e3ca2faf221361ea4231a8cbd29432
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sun Mar 31 11:09:10 2019 +0200

    - fix building on x32

 mozjs60.spec |  4 +++-
 x32.patch    | 45 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+), 1 deletion(-)
---
diff --git a/mozjs60.spec b/mozjs60.spec
index 7bda75d..677caf2 100644
--- a/mozjs60.spec
+++ b/mozjs60.spec
@@ -14,6 +14,7 @@ Source0:	http://ftp.gnome.org/pub/gnome/teams/releng/tarballs-needing-help/mozjs
 Patch0:		copy-headers.patch
 Patch1:		system-virtualenv.patch
 Patch2:		include-configure-script.patch
+Patch3:		x32.patch
 URL:		https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey
 BuildRequires:	autoconf2_13 >= 2.13
 # "TestWrappingOperations.cpp:27:1: error: non-constant condition for static assertion" with -fwrapv on gcc 6
@@ -66,13 +67,14 @@ Pliki nagłówkowe do biblioteki JavaScript.
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
 
 %build
 export PYTHON="%{__python}"
 export AUTOCONF="%{_bindir}/autoconf2_13"
 export SHELL="/bin/sh"
 cd js/src
-mkdir obj
+mkdir -p obj
 cd obj
 
 %define configuredir ".."
diff --git a/x32.patch b/x32.patch
new file mode 100644
index 0000000..7d86f33
--- /dev/null
+++ b/x32.patch
@@ -0,0 +1,45 @@
+diff -ur mozjs-60.1.0/build/moz.configure/init.configure mozjs-60.1.0-x32/build/moz.configure/init.configure
+--- mozjs-60.1.0/build/moz.configure/init.configure	2018-06-19 00:23:55.000000000 +0200
++++ mozjs-60.1.0-x32/build/moz.configure/init.configure	2019-03-31 10:40:40.743730317 +0200
+@@ -630,6 +630,8 @@
+         endianness = 'little'
+     elif cpu in ('x86_64', 'ia64'):
+         canonical_cpu = cpu
++        if os.endswith('gnux32'):
++            canonical_cpu = 'x32'
+         endianness = 'little'
+     elif cpu in ('s390', 's390x'):
+         canonical_cpu = cpu
+diff -ur mozjs-60.1.0/js/src/jsmath.cpp mozjs-60.1.0-x32/js/src/jsmath.cpp
+--- mozjs-60.1.0/js/src/jsmath.cpp	2018-06-19 00:23:59.000000000 +0200
++++ mozjs-60.1.0-x32/js/src/jsmath.cpp	2019-03-31 11:02:09.300861938 +0200
+@@ -58,7 +58,9 @@
+ 
+ // Older glibc versions don't define SYS_getrandom, so we define it here if
+ // it's not available. See bug 995069.
+-# if defined(__x86_64__)
++# if defined(__x86_64__) && defined(__ILP32__)
++#  define GETRANDOM_NR (__X32_SYSCALL_BIT + 318)
++# elif defined(__x86_64__)
+ #  define GETRANDOM_NR 318
+ # elif defined(__i386__)
+ #  define GETRANDOM_NR 355
+diff -ur mozjs-60.1.0/python/mozbuild/mozbuild/configure/constants.py mozjs-60.1.0-x32/python/mozbuild/mozbuild/configure/constants.py
+--- mozjs-60.1.0/python/mozbuild/mozbuild/configure/constants.py	2018-06-19 00:24:03.000000000 +0200
++++ mozjs-60.1.0-x32/python/mozbuild/mozbuild/configure/constants.py	2019-03-31 10:39:21.792681467 +0200
+@@ -57,6 +57,7 @@
+     'sparc64': 64,
+     'x86': 32,
+     'x86_64': 64,
++    'x32': 32,
+ }
+ 
+ CPU = EnumString.subclass(*CPU_bitness.keys())
+@@ -73,6 +74,7 @@
+ 
+ # The order of those checks matter
+ CPU_preprocessor_checks = OrderedDict((
++    ('x32', '__x86_64__ && __ILP32__'),
+     ('x86', '__i386__ || _M_IX86'),
+     ('x86_64', '__x86_64__ || _M_X64'),
+     ('arm', '__arm__ || _M_ARM'),
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/mozjs60.git/commitdiff/9ffe278059e3ca2faf221361ea4231a8cbd29432



More information about the pld-cvs-commit mailing list