From 70f1e5f668efe202692d45d63356e233aa5f2dc7 Mon Sep 17 00:00:00 2001 From: Ricardo Salveti Date: Wed, 25 Jul 2018 18:45:15 -0300 Subject: mozjs: disable MOZ_GLUE_IN_PROGRAM in standalone builds Otherwise anyone consuming mozjs will fail to start with a segmentation fault (e.g. polkitd). Patch also used by Fedora and Debian. Signed-off-by: Ricardo Salveti Signed-off-by: Khem Raj --- .../disable-mozglue-in-stand-alone-builds.patch | 74 ++++++++++++++++++++++ meta-oe/recipes-extended/mozjs/mozjs_52.8.1.bb | 1 + 2 files changed, 75 insertions(+) create mode 100644 meta-oe/recipes-extended/mozjs/mozjs/disable-mozglue-in-stand-alone-builds.patch diff --git a/meta-oe/recipes-extended/mozjs/mozjs/disable-mozglue-in-stand-alone-builds.patch b/meta-oe/recipes-extended/mozjs/mozjs/disable-mozglue-in-stand-alone-builds.patch new file mode 100644 index 000000000..5487cdbe6 --- /dev/null +++ b/meta-oe/recipes-extended/mozjs/mozjs/disable-mozglue-in-stand-alone-builds.patch @@ -0,0 +1,74 @@ +From 2fb531ac753500314336ccd508cb2d53f5e768e5 Mon Sep 17 00:00:00 2001 +From: Till Schneidereit +Date: Thu, 1 Oct 2015 12:59:09 +0200 +Subject: Disable MOZ_GLUE_IN_PROGRAM in stand-alone builds on all platforms + +Otherwise, build fails not being able to find HashBytes. + +Patch ported forward to mozjs52 by Philip Chimento +. + +https://bugzilla.mozilla.org/show_bug.cgi?id=1176787 + +Upstream-Status: Backport + +Signed-off-by: Ricardo Salveti +--- + js/src/old-configure | 20 ++++++++++++-------- + mozglue/build/moz.build | 2 +- + 2 files changed, 13 insertions(+), 9 deletions(-) + +diff --git a/js/src/old-configure b/js/src/old-configure +index d7afcff..8a6f142 100644 +--- a/js/src/old-configure ++++ b/js/src/old-configure +@@ -8546,21 +8546,25 @@ if test -z "$MOZ_ENABLE_WARNINGS_AS_ERRORS"; then + fi + + +-case "${OS_TARGET}" in +-Android|WINNT|Darwin) ++if test "$JS_STANDALONE"; then + MOZ_GLUE_IN_PROGRAM= +- ;; +-*) +- MOZ_GLUE_IN_PROGRAM=1 +- cat >> confdefs.pytmp <<\EOF ++else ++ case "${OS_TARGET}" in ++ Android|WINNT|Darwin) ++ MOZ_GLUE_IN_PROGRAM= ++ ;; ++ *) ++ MOZ_GLUE_IN_PROGRAM=1 ++ cat >> confdefs.pytmp <<\EOF + (''' MOZ_GLUE_IN_PROGRAM ''', ' 1 ') + EOF + cat >> confdefs.h <<\EOF + #define MOZ_GLUE_IN_PROGRAM 1 + EOF + +- ;; +-esac ++ ;; ++ esac ++fi + + if test "$MOZ_MEMORY"; then + if test "x$MOZ_DEBUG" = "x1"; then +diff --git a/mozglue/build/moz.build b/mozglue/build/moz.build +index d289747..e3be5a2 100644 +--- a/mozglue/build/moz.build ++++ b/mozglue/build/moz.build +@@ -6,7 +6,7 @@ + + # Build mozglue as a shared lib on Windows, OSX and Android. + # If this is ever changed, update MOZ_SHARED_MOZGLUE in browser/installer/Makefile.in +-if CONFIG['OS_TARGET'] in ('WINNT', 'Darwin', 'Android'): ++if CONFIG['OS_TARGET'] in ('WINNT', 'Darwin', 'Android') and not CONFIG['JS_STANDALONE']: + SharedLibrary('mozglue') + else: + Library('mozglue') +-- +2.7.4 + diff --git a/meta-oe/recipes-extended/mozjs/mozjs_52.8.1.bb b/meta-oe/recipes-extended/mozjs/mozjs_52.8.1.bb index 599681215..da80b63c5 100644 --- a/meta-oe/recipes-extended/mozjs/mozjs_52.8.1.bb +++ b/meta-oe/recipes-extended/mozjs/mozjs_52.8.1.bb @@ -11,6 +11,7 @@ SRC_URI = "http://archive.ubuntu.com/ubuntu/pool/main/m/mozjs52/mozjs52_52.8.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 \ " SRC_URI_append_libc-musl = " \ file://0006-support-musl.patch \ -- cgit v1.2.3-54-g00ecf