Skip to contentSkip to conversation

python-six: put python2/3 variant together

PATCH New Khem Raj 1 participant 4 messages May 29, 2019 RISC-V

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH v2 1/4 python-six: put python2/3 variant together

From: Andreas Müller <[email protected]>

Upcoming 60.2.3 mozjs (meta-oe) requires python(2)-six-native for its configuration. Currently python(2)-six lives in meta-python and it could be moved to mozjs's home meta-oe but that would be just further clutter.

Once applied here patch to meta-python will be send.

---
v2: No change

 meta-oe/recipes-devtools/python/python-six_1.12.0.bb | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 meta-oe/recipes-devtools/python/python-six_1.12.0.bb
meta-oe/recipes-devtools/python/python-six_1.12.0.bb new file +2 -0
new file mode 100644
index 0000000000..af26e83d60
@@ -0,0 +1,2 @@
+inherit pypi setuptools
+require recipes-devtools/python/python-six.inc
Signature · 1 line
2.21.0
author
#1 lore raw

PATCH v2 2/4 python-jsmin, python-pytoml, python-which: Add recipes

These packages are needed for mozjs 60.x to build

---
v2: No change

 .../python/python-jsmin_2.2.2.bb              | 11 +++++++++++
 .../recipes-devtools/python/python-pytoml.inc | 12 ++++++++++++
 .../python/python-pytoml_0.1.20.bb            |  2 ++
 .../python/python-which_1.1.0.bb              | 19 +++++++++++++++++++
 4 files changed, 44 insertions(+)
 create mode 100644 meta-oe/recipes-devtools/python/python-jsmin_2.2.2.bb
 create mode 100644 meta-oe/recipes-devtools/python/python-pytoml.inc
 create mode 100644 meta-oe/recipes-devtools/python/python-pytoml_0.1.20.bb
 create mode 100644 meta-oe/recipes-devtools/python/python-which_1.1.0.bb
meta-oe/recipes-devtools/python/python-jsmin_2.2.2.bb new file +11 -0
new file mode 100644
index 0000000000..d00d1e2a08
@@ -0,0 +1,11 @@
+DESCRIPTION = "JavaScript minifier."
+HOMEPAGE = "https://github.com/tikitu/jsmin/"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=3a3301ce2ad647e172f4a1016c67324d"
+
+inherit setuptools pypi
+SRC_URI[md5sum] = "00e7a3179a4591aab2ee707b3214e2fd"
+SRC_URI[sha256sum] = "b6df99b2cd1c75d9d342e4335b535789b8da9107ec748212706ef7bbe5c2553b"
+
+BBCLASSEXTEND = "native nativesdk"
meta-oe/recipes-devtools/python/python-pytoml.inc new file +12 -0
new file mode 100644
index 0000000000..1019c09d03
@@ -0,0 +1,12 @@
+SUMMARY = "A TOML-0.4.0 parser/writer for Python"
+HOMEPAGE = "https://pypi.python.org/pypi/pytoml/"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=cfff423699bdaef24331933ac4f56078"
+
+SRC_URI[md5sum] = "a11d8a4859b53f6ebe2f782314428911"
+SRC_URI[sha256sum] = "ca2d0cb127c938b8b76a9a0d0f855cf930c1d50cc3a0af6d3595b566519a1013"
+
+inherit pypi
+
+BBCLASSEXTEND = "native nativesdk"
meta-oe/recipes-devtools/python/python-pytoml_0.1.20.bb new file +2 -0
new file mode 100644
index 0000000000..88fa95317f
@@ -0,0 +1,2 @@
+inherit pypi setuptools
+require python-pytoml.inc
meta-oe/recipes-devtools/python/python-which_1.1.0.bb new file +19 -0
new file mode 100644
index 0000000000..901fdc7637
@@ -0,0 +1,19 @@
+DESCRIPTION = "which.py -- a portable GNU which replacement"
+HOMEPAGE = "http://code.google.com/p/which/"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=030b09798681482b9ad12ac47be496ea"
+
+inherit setuptools pypi python-dir
+
+SRCREV = "425bdeeb2d87c36e2313dc4b8d69ff2bb5a02ee9"
+PYPI_SRC_URI = "git://github.com/trentm/which"
+
+S = "${WORKDIR}/git"
+
+do_install_append() {
+    rmdir -p --ignore-fail-on-non-empty ${D}${STAGING_BINDIR_NATIVE}
+    rmdir -p --ignore-fail-on-non-empty ${D}${datadir}
+}
+
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.21.0
author
#2 lore raw

PATCH v2 3/4 mozjs: Upgrade to version 60.x

In reply to Khem Raj

Disable JIT (ion) on all mips

It fails to compile in first place, even if we fix the compilation next it assert failures and runtime test failures, its best to disable it for mips for now

Fix build on riscv

---
v2: Fix build on mips and riscv64

 .../0001-To-fix-build-error-on-arm32BE.patch  |   8 +-
 ...001-do-not-create-python-environment.patch |  28 +---
 ...-compiling-failure-on-mips64-n32-bsp.patch |  19 +--
 .../mozjs/0001-js-Fix-build-with-musl.patch   |  31 +++++
 ...include-RequiredDefines.h-for-depend.patch |   8 +-
 ...0001-riscv-Disable-atomic-operations.patch |  38 ++++++
 .../0005-fix-do_compile-failed-on-mips.patch  |  11 +-
 .../mozjs/mozjs/0006-support-musl.patch       | 124 +++++-------------
 ...ix-cross-compilation-on-i586-targets.patch |   9 +-
 .../mozjs/mozjs/JS_PUBLIC_API.patch           |  48 ++++---
 .../mozjs/mozjs/add-riscv-support.patch       |  38 ++----
 ...isable-mozglue-in-stand-alone-builds.patch |  74 -----------
 .../mozjs/mozjs/format-overflow.patch         |  12 +-
 .../{mozjs_52.9.1.bb => mozjs_60.5.2.bb}      |  25 ++--
 14 files changed, 188 insertions(+), 285 deletions(-)
 create mode 100644 meta-oe/recipes-extended/mozjs/mozjs/0001-js-Fix-build-with-musl.patch
 create mode 100644 meta-oe/recipes-extended/mozjs/mozjs/0001-riscv-Disable-atomic-operations.patch
 delete mode 100644 meta-oe/recipes-extended/mozjs/mozjs/disable-mozglue-in-stand-alone-builds.patch
 rename meta-oe/recipes-extended/mozjs/{mozjs_52.9.1.bb => mozjs_60.5.2.bb} (84%)
meta-oe/recipes-extended/mozjs/mozjs/0001-To-fix-build-error-on-arm32BE.patch +4 -4
index 3bbd10a173..056f74a529 100644
@@ -7,13 +7,13 @@ error: #error Target architecture was not detected as supported by Double-Conver
 
 Signed-off-by: Lei Maohui <[email protected]>
 ---
- mfbt/double-conversion/utils.h | 2 +-
+ mfbt/double-conversion/double-conversion/utils.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/mfbt/double-conversion/utils.h b/mfbt/double-conversion/utils.h
+diff --git a/mfbt/double-conversion/double-conversion/utils.h b/mfbt/double-conversion/double-conversion/utils.h
 index 4f37218..93575cb 100644
---- a/mfbt/double-conversion/utils.h
-+++ b/mfbt/double-conversion/utils.h
+--- a/mfbt/double-conversion/double-conversion/utils.h
++++ b/mfbt/double-conversion/double-conversion/utils.h
 @@ -53,7 +53,7 @@
  // disabled.)
  // On Linux,x86 89255e-22 != Div_double(89255.0/1e22)
meta-oe/recipes-extended/mozjs/mozjs/0001-do-not-create-python-environment.patch +5 -23
index ba317bc0c5..a3c1b69e29 100644
@@ -14,11 +14,9 @@ Signed-off-by: Hongxu Jia <[email protected]>
  js/src/old-configure               |  4 ++--
  3 files changed, 11 insertions(+), 21 deletions(-)
 
-diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure
-index 2123beb..6fe6591 100644
 --- a/build/moz.configure/init.configure
 +++ b/build/moz.configure/init.configure
-@@ -179,24 +179,6 @@ def virtualenv_python(env_python, build_env, mozconfig, help):
+@@ -250,24 +250,6 @@ def virtualenv_python(env_python, build_
      else:
          python = sys.executable
  
@@ -42,9 +40,7 @@ index 2123beb..6fe6591 100644
 -
      return python
  
- set_config('PYTHON', virtualenv_python)
-diff --git a/configure.py b/configure.py
-index f7392d0..45323a5 100644
+ 
 --- a/configure.py
 +++ b/configure.py
 @@ -12,7 +12,15 @@ import textwrap
@@ -62,22 +58,11 @@ index f7392d0..45323a5 100644
 +        sys.path.insert(0, os.path.join(sub_dir, module_dir))
 +
  from mozbuild.configure import ConfigureSandbox
- from mozbuild.util import (
-     indented_repr,
-diff --git a/js/src/old-configure b/js/src/old-configure
-index ee4527b..75b00e1 100644
+ from mozbuild.makeutil import Makefile
+ from mozbuild.pythonutil import iter_modules_in_path
 --- a/js/src/old-configure
 +++ b/js/src/old-configure
-@@ -10512,7 +10512,7 @@ if test "$MOZ_BUILD_APP" != js -o -n "$JS_STANDALONE"; then
-     ;;
-   esac
- 
--  eval $dumpenv $PYTHON $_topsrcdir/build/subconfigure.py --prepare "$srcdir" "$moz_config_dir" "$_CONFIG_SHELL" $ac_configure_args 
-+  eval $dumpenv PYTHONPATH=$_topsrcdir/python/mozbuild/ $PYTHON $_topsrcdir/build/subconfigure.py --prepare "$srcdir" "$moz_config_dir" "$_CONFIG_SHELL" $ac_configure_args
- 
-   done
- 
-@@ -10931,7 +10931,7 @@ if test "$JS_STANDALONE"; then
+@@ -9974,7 +9974,7 @@ if test "$JS_STANDALONE"; then
    
  if test "$no_recursion" != yes; then
    trap '' EXIT
@@ -86,6 +71,3 @@ index ee4527b..75b00e1 100644
        exit 1
    fi
  fi
--- 
-2.7.4
-
meta-oe/recipes-extended/mozjs/mozjs/0001-fix-compiling-failure-on-mips64-n32-bsp.patch +5 -14
index bc1af3c702..a36478bfba 100644
@@ -22,11 +22,9 @@ Signed-off-by: Hongxu Jia <[email protected]>
  python/mozbuild/mozbuild/configure/constants.py   | 2 +-
  3 files changed, 8 insertions(+), 3 deletions(-)
 
-diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure
-index 6fe6591..a77b46c 100644
 --- a/build/moz.configure/init.configure
 +++ b/build/moz.configure/init.configure
-@@ -357,7 +357,10 @@ def split_triplet(triplet):
+@@ -650,7 +650,10 @@ def split_triplet(triplet, allow_unknown
          canonical_cpu = 'mips32'
          endianness = 'little' if 'el' in cpu else 'big'
      elif cpu in ('mips64', 'mips64el'):
@@ -38,11 +36,9 @@ index 6fe6591..a77b46c 100644
          endianness = 'little' if 'el' in cpu else 'big'
      elif cpu.startswith('aarch64'):
          canonical_cpu = 'aarch64'
-diff --git a/js/src/jit/mips-shared/Architecture-mips-shared.h b/js/src/jit/mips-shared/Architecture-mips-shared.h
-index 7afe305..c6e29dc 100644
 --- a/js/src/jit/mips-shared/Architecture-mips-shared.h
 +++ b/js/src/jit/mips-shared/Architecture-mips-shared.h
-@@ -24,6 +24,8 @@
+@@ -26,6 +26,8 @@
  #define USES_O32_ABI
  #elif (defined(_MIPS_SIM) && (_MIPS_SIM == _ABI64)) || defined(JS_SIMULATOR_MIPS64)
  #define USES_N64_ABI
@@ -51,7 +47,7 @@ index 7afe305..c6e29dc 100644
  #else
  #error "Unsupported ABI"
  #endif
-@@ -91,7 +93,7 @@ class Registers
+@@ -93,7 +95,7 @@ class Registers
          ta1 = t5,
          ta2 = t6,
          ta3 = t7,
@@ -60,20 +56,15 @@ index 7afe305..c6e29dc 100644
          a4 = r8,
          a5 = r9,
          a6 = r10,
-diff --git a/python/mozbuild/mozbuild/configure/constants.py b/python/mozbuild/mozbuild/configure/constants.py
-index dfc7cf8..27f83ab 100644
 --- a/python/mozbuild/mozbuild/configure/constants.py
 +++ b/python/mozbuild/mozbuild/configure/constants.py
-@@ -83,8 +83,8 @@ CPU_preprocessor_checks = OrderedDict((
+@@ -90,8 +90,8 @@ CPU_preprocessor_checks = OrderedDict((
      ('hppa', '__hppa__'),
      ('sparc64', '__sparc__ && __arch64__'),
      ('sparc', '__sparc__'),
 -    ('mips64', '__mips64'),
      ('mips32', '__mips__'),
 +    ('mips64', '__mips64'),
+     ('sh4', '__sh__'),
  ))
  
- assert sorted(CPU_preprocessor_checks.keys()) == sorted(CPU.POSSIBLE_VALUES)
--- 
-2.7.4
-
meta-oe/recipes-extended/mozjs/mozjs/0001-js-Fix-build-with-musl.patch new file +31 -0
new file mode 100644
index 0000000000..f4c6e2768d
@@ -0,0 +1,31 @@
+From 0c9e8f586ba52a9aef5ed298e8315b2598b8fb72 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 25 May 2019 16:54:45 -0700
+Subject: [PATCH] js: Fix build with musl
+
+The MIPS specific header <sgidefs.h> is not provided by musl
+linux kernel headers provide <asm/sgidefs.h> which has same definitions
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ js/src/jsmath.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/js/src/jsmath.cpp b/js/src/jsmath.cpp
+index a28968be..8facaa81 100644
+--- a/js/src/jsmath.cpp
++++ b/js/src/jsmath.cpp
+@@ -71,7 +71,7 @@
+ #elif defined(__s390__)
+ #define GETRANDOM_NR 349
+ #elif defined(__mips__)
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #if _MIPS_SIM == _MIPS_SIM_ABI32
+ #define GETRANDOM_NR 4353
+ #elif _MIPS_SIM == _MIPS_SIM_ABI64
+-- 
+2.21.0
+
meta-oe/recipes-extended/mozjs/mozjs/0001-js.pc.in-do-not-include-RequiredDefines.h-for-depend.patch +4 -4
index c111ea5eae..e3f1883a99 100644
@@ -15,13 +15,13 @@ Signed-off-by: Andreas Müller <[email protected]>
 Rebase to 52.8.1
 Signed-off-by: Hongxu Jia <[email protected]>
 ---
- js/src/js.pc.in | 2 +-
+ js/src/build/js.pc.in | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/js/src/js.pc.in b/js/src/js.pc.in
+diff --git a/js/src/build/js.pc.in b/js/src/build/js.pc.in
 index 2eae393..c2dea62 100644
---- a/js/src/js.pc.in
-+++ b/js/src/js.pc.in
+--- a/js/src/build/js.pc.in
++++ b/js/src/build/js.pc.in
 @@ -8,4 +8,4 @@ Description: The Mozilla library for JavaScript
  Version: @MOZILLA_VERSION@
  @PKGCONF_REQUIRES_PRIVATE@
meta-oe/recipes-extended/mozjs/mozjs/0001-riscv-Disable-atomic-operations.patch new file +38 -0
new file mode 100644
index 0000000000..2e810c87f9
@@ -0,0 +1,38 @@
+From 64ad80e6d95871f17be4cd01da15581f41ac0b2b Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Mon, 27 May 2019 21:10:34 -0700
+Subject: [PATCH] riscv: Disable atomic operations
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ js/src/jit/AtomicOperations.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/js/src/jit/AtomicOperations.h
++++ b/js/src/jit/AtomicOperations.h
+@@ -393,6 +393,8 @@ inline bool AtomicOperations::isLockfree
+ #include "jit/none/AtomicOperations-feeling-lucky.h"
+ #elif defined(__s390__) || defined(__s390x__)
+ #include "jit/none/AtomicOperations-feeling-lucky.h"
++#elif defined(__riscv)
++#include "jit/none/AtomicOperations-feeling-lucky.h"
+ #else
+ #error "No AtomicOperations support provided for this platform"
+ #endif
+--- a/js/src/jit/none/AtomicOperations-feeling-lucky.h
++++ b/js/src/jit/none/AtomicOperations-feeling-lucky.h
+@@ -80,6 +80,14 @@
+ #define GNUC_COMPATIBLE
+ #endif
+ 
++#ifdef __riscv
++#define GNUC_COMPATIBLE
++#ifdef __riscv_xlen == 64
++#define HAS_64BIT_ATOMICS
++#define HAS_64BIT_LOCKFREE
++#endif
++#endif
++
+ // The default implementation tactic for gcc/clang is to use the newer
+ // __atomic intrinsics added for use in C++11 <atomic>.  Where that
+ // isn't available, we use GCC's older __sync functions instead.
meta-oe/recipes-extended/mozjs/mozjs/0005-fix-do_compile-failed-on-mips.patch +3 -8
index 38e4698f29..d1da109720 100644
@@ -20,19 +20,14 @@ Signed-off-by: Hongxu Jia <[email protected]>
  config/config.mk | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/config/config.mk b/config/config.mk
-index 4e3fd1a..d847ffa 100644
 --- a/config/config.mk
 +++ b/config/config.mk
-@@ -523,7 +523,7 @@ EXPAND_MKSHLIB_ARGS = --uselist
+@@ -423,7 +423,7 @@ EXPAND_MKSHLIB_ARGS = --uselist
  ifdef SYMBOL_ORDER
  EXPAND_MKSHLIB_ARGS += --symbol-order $(SYMBOL_ORDER)
  endif
 -EXPAND_MKSHLIB = $(EXPAND_LIBS_EXEC) $(EXPAND_MKSHLIB_ARGS) -- $(MKSHLIB)
 +EXPAND_MKSHLIB = $(EXPAND_LIBS_EXEC) $(EXPAND_MKSHLIB_ARGS) -- $(MKSHLIB) $(OS_LDFLAGS)
  
- # $(call CHECK_SYMBOLS,lib,PREFIX,dep_name,test)
- # Checks that the given `lib` doesn't contain dependency on symbols with a
--- 
-2.7.4
-
+ # autoconf.mk sets OBJ_SUFFIX to an error to avoid use before including
+ # this file
meta-oe/recipes-extended/mozjs/mozjs/0006-support-musl.patch +32 -92

172 lines not on this page · raw message

meta-oe/recipes-extended/mozjs/mozjs/0010-fix-cross-compilation-on-i586-targets.patch +2 -7
index 9194e346a3..3ac25f6aed 100644
@@ -17,12 +17,10 @@ Signed-off-by: Hongxu Jia <[email protected]>
  js/src/old-configure | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/js/src/old-configure b/js/src/old-configure
-index 8a8ef52..d7afcff 100644
 --- a/js/src/old-configure
 +++ b/js/src/old-configure
-@@ -3964,7 +3964,7 @@ IMPORT_LIB_SUFFIX=
- DIRENT_INO=d_ino
+@@ -3833,7 +3833,7 @@ AS='$(CC)'
+ AS_DASH_C_FLAG='-c'
  MOZ_USER_DIR=".mozilla"
  
 -MOZ_FIX_LINK_PATHS="-Wl,-rpath-link,${DIST}/bin -Wl,-rpath-link,${prefix}/lib"
@@ -30,6 +28,3 @@ index 8a8ef52..d7afcff 100644
  
  
  
--- 
-2.7.4
-
meta-oe/recipes-extended/mozjs/mozjs/JS_PUBLIC_API.patch +33 -15

69 lines not on this page · raw message

meta-oe/recipes-extended/mozjs/mozjs/add-riscv-support.patch +9 -29
index 4354a9dee6..0a41485610 100644
@@ -4,8 +4,6 @@ Upstream-Status: Submitted [https://bugzilla.mozilla.org/show_bug.cgi?id=1318905
 
 Signed-off-by: Ricardo Salveti <[email protected]>
 
-diff --git a/build/autoconf/config.guess b/build/autoconf/config.guess
-index d5d667d..1277a86 100755
 --- a/build/autoconf/config.guess
 +++ b/build/autoconf/config.guess
 @@ -1029,6 +1029,9 @@ EOF
@@ -18,39 +16,21 @@ index d5d667d..1277a86 100755
      s390:Linux:*:* | s390x:Linux:*:*)
  	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
  	exit ;;
-diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure
-index 6fe6591..56e6730 100644
 --- a/build/moz.configure/init.configure
 +++ b/build/moz.configure/init.configure
-@@ -362,6 +362,9 @@ def split_triplet(triplet):
-     elif cpu.startswith('aarch64'):
-         canonical_cpu = 'aarch64'
+@@ -658,6 +658,9 @@ def split_triplet(triplet, allow_unknown
+     elif cpu == 'sh4':
+         canonical_cpu = 'sh4'
          endianness = 'little'
 +    elif cpu in ('riscv32', 'riscv64'):
 +        canonical_cpu = cpu
 +        endianness = 'little'
-     else:
-         die('Unknown CPU type: %s' % cpu)
- 
-diff --git a/mfbt/double-conversion/utils.h b/mfbt/double-conversion/utils.h
-index 15dd4bf..4f37218 100644
---- a/mfbt/double-conversion/utils.h
-+++ b/mfbt/double-conversion/utils.h
-@@ -60,7 +60,8 @@
-     defined(__sparc__) || defined(__sparc) || defined(__s390__) || \
-     defined(__SH4__) || defined(__alpha__) || \
-     defined(_MIPS_ARCH_MIPS32R2) || \
--    defined(__AARCH64EL__) || defined(__aarch64__)
-+    defined(__AARCH64EL__) || defined(__aarch64__) || \
-+    defined(__riscv)
- #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
- #elif defined(_M_IX86) || defined(__i386__) || defined(__i386)
- #if defined(_WIN32)
-diff --git a/python/mozbuild/mozbuild/configure/constants.py b/python/mozbuild/mozbuild/configure/constants.py
-index dfc7cf8..4f8d666 100644
+     elif allow_unknown:
+         canonical_cpu = cpu
+         endianness = 'unknown'
 --- a/python/mozbuild/mozbuild/configure/constants.py
 +++ b/python/mozbuild/mozbuild/configure/constants.py
-@@ -48,6 +48,8 @@ CPU_bitness = {
+@@ -50,6 +50,8 @@ CPU_bitness = {
      'mips64': 64,
      'ppc': 32,
      'ppc64': 64,
@@ -58,8 +38,8 @@ index dfc7cf8..4f8d666 100644
 +    'riscv64': 64,
      's390': 32,
      's390x': 64,
-     'sparc': 32,
-@@ -79,6 +81,8 @@ CPU_preprocessor_checks = OrderedDict((
+     'sh4': 32,
+@@ -82,6 +84,8 @@ CPU_preprocessor_checks = OrderedDict((
      ('s390', '__s390__'),
      ('ppc64', '__powerpc64__'),
      ('ppc', '__powerpc__'),
meta-oe/recipes-extended/mozjs/mozjs/disable-mozglue-in-stand-alone-builds.patch deleted +0 -74

74 lines not on this page · raw message

meta-oe/recipes-extended/mozjs/mozjs/format-overflow.patch +6 -6
index 29c6a7b69c..e257fc6f62 100644
@@ -11,11 +11,11 @@ Signed-off-by: Khem Raj <[email protected]>
 --- a/js/src/moz.build
 +++ b/js/src/moz.build
 @@ -785,7 +785,7 @@ if CONFIG['JS_HAS_CTYPES']:
-         DEFINES['FFI_BUILDING'] = True
- 
- if CONFIG['GNU_CXX']:
--    CXXFLAGS += ['-Wno-shadow', '-Werror=format']
-+    CXXFLAGS += ['-Wno-shadow']
+ if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
+     # Also disable strict-aliasing for GCC compiler, that is enabled by default
+     # starting with version 7.1, see Bug 1363009
+-    CXXFLAGS += ['-Wno-shadow', '-Werror=format', '-fno-strict-aliasing']
++    CXXFLAGS += ['-Wno-shadow', '-fno-strict-aliasing']
  
  # Suppress warnings in third-party code.
- if CONFIG['CLANG_CXX']:
+ if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
meta-oe/recipes-extended/mozjs/mozjs_60.5.2.bb renamed from meta-oe/recipes-extended/mozjs/mozjs_52.9.1.bb +16 -9
similarity index 84%
rename from meta-oe/recipes-extended/mozjs/mozjs_52.9.1.bb
rename to meta-oe/recipes-extended/mozjs/mozjs_60.5.2.bb
index 5e67eeea71..70bdbc1688 100644
@@ -1,9 +1,9 @@
 SUMMARY = "SpiderMonkey is Mozilla's JavaScript engine written in C/C++"
 HOMEPAGE = "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey"
 LICENSE = "MPL-2.0"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=815ca599c9df247a0c7f619bab123dad"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=dc9b6ecd19a14a54a628edaaf23733bf"
 
-SRC_URI = "http://archive.ubuntu.com/ubuntu/pool/main/m/mozjs52/mozjs52_52.9.1.orig.tar.xz \
+SRC_URI = "https://dev.gentoo.org/~axs/distfiles/mozjs-60.5.2.tar.bz2 \
            file://0001-js.pc.in-do-not-include-RequiredDefines.h-for-depend.patch \
            file://0010-fix-cross-compilation-on-i586-targets.patch \
            file://0001-do-not-create-python-environment.patch \
@@ -11,29 +11,31 @@ SRC_URI = "http://archive.ubuntu.com/ubuntu/pool/main/m/mozjs52/mozjs52_52.9.1.o
            file://0003-workaround-autoconf-2.13-detection-failed.patch \
            file://0004-do-not-use-autoconf-2.13-to-refresh-old.configure.patch \
            file://0005-fix-do_compile-failed-on-mips.patch \
-           file://disable-mozglue-in-stand-alone-builds.patch \
            file://add-riscv-support.patch \
            file://0001-mozjs-fix-coredump-caused-by-getenv.patch \
            file://format-overflow.patch \
-           file://JS_PUBLIC_API.patch \
            file://0001-To-fix-build-error-on-arm32BE.patch \
+           file://JS_PUBLIC_API.patch \
+           file://0001-riscv-Disable-atomic-operations.patch \
            "
 SRC_URI_append_libc-musl = " \
            file://0006-support-musl.patch \
+           file://0001-js-Fix-build-with-musl.patch \
            "
 SRC_URI_append_mipsarchn32 = " \
            file://0001-fix-compiling-failure-on-mips64-n32-bsp.patch \
            "
-
-SRC_URI[md5sum] = "c9473c625ee0a9edaaac8b742ff24c5f"
-SRC_URI[sha256sum] = "f9324a6724233ab15f10381fe13e635e89d725ef1e78025a0a7d36c58a84a0f9"
+SRC_URI[md5sum] = "023ed014e9e93d01620d121bc06a3589"
+SRC_URI[sha256sum] = "f51039c997415fd0f13f8e01966b4a8ff80cbf90deb8b14c18827104a369cc0d"
 
 inherit autotools pkgconfig perlnative pythonnative
 
 inherit distro_features_check
 CONFLICT_DISTRO_FEATURES_mipsarchn32 = "ld-is-gold"
 
-DEPENDS += "nspr zlib"
+DEPENDS += "nspr zlib python-six-native python-pytoml-native \
+            python-jsmin-native python-futures-native \
+            python-which-native"
 
 # Disable null pointer optimization in gcc >= 6
 # https://bugzilla.redhat.com/show_bug.cgi?id=1328045
@@ -47,10 +49,15 @@ EXTRA_OECONF = " \
     --prefix=${prefix} \
     --libdir=${libdir} \
     --disable-tests --disable-strip --disable-optimize \
+    --disable-jemalloc \
     --with-nspr-libs='-lplds4 -lplc4 -lnspr4' \
     ${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', "--enable-gold", '--disable-gold', d)} \
 "
 
+EXTRA_OECONF_append_mipsarch = " --disable-ion"
+EXTRA_OECONF_append_riscv64 = " --disable-ion"
+EXTRA_OECONF_append_riscv32 = " --disable-ion"
+
 PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
 PACKAGECONFIG[x11] = "--x-includes=${STAGING_INCDIR} --x-libraries=${STAGING_LIBDIR},--x-includes=no --x-libraries=no,virtual/libx11"
 
@@ -105,7 +112,7 @@ do_install_prepend() {
 
 PACKAGES =+ "lib${BPN}"
 FILES_lib${BPN} += "${libdir}/lib*.so"
-FILES_${PN}-dev += "${bindir}/js52-config"
+FILES_${PN}-dev += "${bindir}/js60-config"
 
 # Fails to build with thumb-1 (qemuarm)
 #| {standard input}: Assembler messages:
Signature · 1 line
2.21.0
author
#3 lore raw

PATCH v2 4/4 polkit: Upgrade to 0.116

In reply to Khem Raj

Make netgroup support optional so it can be disabled on musl
Drop backported patch 0001-backend-Compare-PolkitUnixProcess-uids-for-temporary.patch

---
v2: No change

 ...PolkitUnixProcess-uids-for-temporary.patch | 186 --------------
 ...1-make-netgroup-support-configurable.patch |  93 -------
 .../0003-make-netgroup-support-optional.patch | 232 ++++++++++++++++++
 .../{polkit_0.115.bb => polkit_0.116.bb}      |   7 +-
 4 files changed, 235 insertions(+), 283 deletions(-)
 delete mode 100644 meta-oe/recipes-extended/polkit/polkit/0001-backend-Compare-PolkitUnixProcess-uids-for-temporary.patch
 delete mode 100644 meta-oe/recipes-extended/polkit/polkit/0001-make-netgroup-support-configurable.patch
 create mode 100644 meta-oe/recipes-extended/polkit/polkit/0003-make-netgroup-support-optional.patch
 rename meta-oe/recipes-extended/polkit/{polkit_0.115.bb => polkit_0.116.bb} (88%)
meta-oe/recipes-extended/polkit/polkit/0001-backend-Compare-PolkitUnixProcess-uids-for-temporary.patch deleted +0 -186
deleted file mode 100644
index ae314e3c17..0000000000
@@ -1,186 +0,0 @@
-From eb1f1336e8e49b4db6243b543e0a71f7c0c9b5b1 Mon Sep 17 00:00:00 2001
-From: Colin Walters <[email protected]>
-Date: Fri, 4 Jan 2019 14:24:48 -0500
-Subject: [PATCH] backend: Compare PolkitUnixProcess uids for temporary
- authorizations
-
-It turns out that the combination of `(pid, start time)` is not
-enough to be unique.  For temporary authorizations, we can avoid
-separate users racing on pid reuse by simply comparing the uid.
-
-https://bugs.chromium.org/p/project-zero/issues/detail?id=1692
-
-And the above original email report is included in full in a new comment.
-
-Reported-by: Jann Horn <[email protected]>
-
-Closes: https://gitlab.freedesktop.org/polkit/polkit/issues/75
-
-Upstream-Status: Backport
-CVE: CVE-2019-6133
-Signed-off-by: Chen Qi <[email protected]>
----
- src/polkit/polkitsubject.c                         |  2 +
- src/polkit/polkitunixprocess.c                     | 71 +++++++++++++++++++++-
- .../polkitbackendinteractiveauthority.c            | 39 +++++++++++-
- 3 files changed, 110 insertions(+), 2 deletions(-)
-
-diff --git a/src/polkit/polkitsubject.c b/src/polkit/polkitsubject.c
-index d4c1182..ccabd0a 100644
---- a/src/polkit/polkitsubject.c
-+++ b/src/polkit/polkitsubject.c
-@@ -99,6 +99,8 @@ polkit_subject_hash (PolkitSubject *subject)
-  * @b: A #PolkitSubject.
-  *
-  * Checks if @a and @b are equal, ie. represent the same subject.
-+ * However, avoid calling polkit_subject_equal() to compare two processes;
-+ * for more information see the `PolkitUnixProcess` documentation.
-  *
-  * This function can be used in e.g. g_hash_table_new().
-  *
-diff --git a/src/polkit/polkitunixprocess.c b/src/polkit/polkitunixprocess.c
-index 972b777..7a6d48b 100644
---- a/src/polkit/polkitunixprocess.c
-+++ b/src/polkit/polkitunixprocess.c
-@@ -51,7 +51,10 @@
-  * @title: PolkitUnixProcess
-  * @short_description: Unix processs
-  *
-- * An object for representing a UNIX process.
-+ * An object for representing a UNIX process.  NOTE: This object as
-+ * designed is now known broken; a mechanism to exploit a delay in
-+ * start time in the Linux kernel was identified.  Avoid
-+ * calling polkit_subject_equal() to compare two processes.
-  *
-  * To uniquely identify processes, both the process id and the start
-  * time of the process (a monotonic increasing value representing the
-@@ -66,6 +69,72 @@
-  * polkit_unix_process_new_for_owner() with trusted data.
-  */
- 
-+/* See https://gitlab.freedesktop.org/polkit/polkit/issues/75
-+
-+  But quoting the original email in full here to ensure it's preserved:
-+
-+  From: Jann Horn <[email protected]>
-+  Subject: [SECURITY] polkit: temporary auth hijacking via PID reuse and non-atomic fork
-+  Date: Wednesday, October 10, 2018 5:34 PM
-+
-+When a (non-root) user attempts to e.g. control systemd units in the system
-+instance from an active session over DBus, the access is gated by a polkit
-+policy that requires "auth_admin_keep" auth. This results in an auth prompt
-+being shown to the user, asking the user to confirm the action by entering the
-+password of an administrator account.
-+
-+After the action has been confirmed, the auth decision for "auth_admin_keep" is
-+cached for up to five minutes. Subject to some restrictions, similar actions can
-+then be performed in this timespan without requiring re-auth:
-+
-+ - The PID of the DBus client requesting the new action must match the PID of
-+   the DBus client requesting the old action (based on SO_PEERCRED information
-+   forwarded by the DBus daemon).
-+ - The "start time" of the client's PID (as seen in /proc/$pid/stat, field 22)
-+   must not have changed. The granularity of this timestamp is in the
-+   millisecond range.
-+ - polkit polls every two seconds whether a process with the expected start time
-+   still exists. If not, the temporary auth entry is purged.
-+
-+Without the start time check, this would obviously be buggy because an attacker
-+could simply wait for the legitimate client to disappear, then create a new
-+client with the same PID.
-+
-+Unfortunately, the start time check is bypassable because fork() is not atomic.
-+Looking at the source code of copy_process() in the kernel:
-+
-+        p->start_time = ktime_get_ns();
-+        p->real_start_time = ktime_get_boot_ns();
-+        [...]
-+        retval = copy_thread_tls(clone_flags, stack_start, stack_size, p, tls);
-+        if (retval)
-+                goto bad_fork_cleanup_io;
-+
-+        if (pid != &init_struct_pid) {
-+                pid = alloc_pid(p->nsproxy->pid_ns_for_children);
-+                if (IS_ERR(pid)) {
-+                        retval = PTR_ERR(pid);
-+                        goto bad_fork_cleanup_thread;
-+                }
-+        }
-+
-+The ktime_get_boot_ns() call is where the "start time" of the process is
-+recorded. The alloc_pid() call is where a free PID is allocated. In between
-+these, some time passes; and because the copy_thread_tls() call between them can
-+access userspace memory when sys_clone() is invoked through the 32-bit syscall
-+entry point, an attacker can even stall the kernel arbitrarily long at this
-+point (by supplying a pointer into userspace memory that is associated with a
-+userfaultfd or is backed by a custom FUSE filesystem).
-+
-+This means that an attacker can immediately call sys_clone() when the victim
-+process is created, often resulting in a process that has the exact same start
-+time reported in procfs; and then the attacker can delay the alloc_pid() call
-+until after the victim process has died and the PID assignment has cycled
-+around. This results in an attacker process that polkit can't distinguish from
-+the victim process.
-+*/
-+
-+
- /**
-  * PolkitUnixProcess:
-  *
-diff --git a/src/polkitbackend/polkitbackendinteractiveauthority.c b/src/polkitbackend/polkitbackendinteractiveauthority.c
-index de3f752..098d343 100644
---- a/src/polkitbackend/polkitbackendinteractiveauthority.c
-+++ b/src/polkitbackend/polkitbackendinteractiveauthority.c
-@@ -3035,6 +3035,43 @@ temporary_authorization_store_free (TemporaryAuthorizationStore *store)
-   g_free (store);
- }
- 
-+/* See the comment at the top of polkitunixprocess.c */
-+static gboolean
-+subject_equal_for_authz (PolkitSubject *a,
-+                         PolkitSubject *b)
-+{
-+  if (!polkit_subject_equal (a, b))
-+    return FALSE;
-+
-+  /* Now special case unix processes, as we want to protect against
-+   * pid reuse by including the UID.
-+   */
-+  if (POLKIT_IS_UNIX_PROCESS (a) && POLKIT_IS_UNIX_PROCESS (b)) {
-+    PolkitUnixProcess *ap = (PolkitUnixProcess*)a;
-+    int uid_a = polkit_unix_process_get_uid ((PolkitUnixProcess*)a);
-+    PolkitUnixProcess *bp = (PolkitUnixProcess*)b;
-+    int uid_b = polkit_unix_process_get_uid ((PolkitUnixProcess*)b);
-+
-+    if (uid_a != -1 && uid_b != -1)
-+      {
-+        if (uid_a == uid_b)
-+          {
-+            return TRUE;
-+          }
-+        else
-+          {
-+            g_printerr ("denying slowfork; pid %d uid %d != %d!\n",
-+                        polkit_unix_process_get_pid (ap),
-+                        uid_a, uid_b);
-+            return FALSE;
-+          }
-+      }
-+    /* Fall through; one of the uids is unset so we can't reliably compare */
-+  }
-+
-+  return TRUE;
-+}
-+
- static gboolean
- temporary_authorization_store_has_authorization (TemporaryAuthorizationStore *store,
-                                                  PolkitSubject               *subject,
-@@ -3077,7 +3114,7 @@ temporary_authorization_store_has_authorization (TemporaryAuthorizationStore *st
-     TemporaryAuthorization *authorization = l->data;
- 
-     if (strcmp (action_id, authorization->action_id) == 0 &&
--        polkit_subject_equal (subject_to_use, authorization->subject))
-+        subject_equal_for_authz (subject_to_use, authorization->subject))
-       {
-         ret = TRUE;
-         if (out_tmp_authz_id != NULL)
meta-oe/recipes-extended/polkit/polkit/0001-make-netgroup-support-configurable.patch deleted +0 -93

93 lines not on this page · raw message

meta-oe/recipes-extended/polkit/polkit/0003-make-netgroup-support-optional.patch new file +232 -0

232 lines not on this page · raw message

meta-oe/recipes-extended/polkit/polkit_0.116.bb renamed from meta-oe/recipes-extended/polkit/polkit_0.115.bb +3 -4
similarity index 88%
rename from meta-oe/recipes-extended/polkit/polkit_0.115.bb
rename to meta-oe/recipes-extended/polkit/polkit_0.116.bb
index 562a754b21..8754383efa 100644
@@ -23,12 +23,11 @@ PACKAGECONFIG[consolekit] = ",,,consolekit"
 
 PAM_SRC_URI = "file://polkit-1_pam.patch"
 SRC_URI = "http://www.freedesktop.org/software/polkit/releases/polkit-${PV}.tar.gz \
-           file://0001-make-netgroup-support-configurable.patch \
            ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
-           file://0001-backend-Compare-PolkitUnixProcess-uids-for-temporary.patch \
+           file://0003-make-netgroup-support-optional.patch \
            "
-SRC_URI[md5sum] = "f03b055d6ae5fc8eac76838c7d83d082"
-SRC_URI[sha256sum] = "2f87ecdabfbd415c6306673ceadc59846f059b18ef2fce42bac63fe283f12131"
+SRC_URI[md5sum] = "4b37258583393e83069a0e2e89c0162a"
+SRC_URI[sha256sum] = "88170c9e711e8db305a12fdb8234fac5706c61969b94e084d0f117d8ec5d34b1"
 
 EXTRA_OECONF = "--with-os-type=moblin \
                 --disable-man-pages \
Signature · 1 line
2.21.0