Backed out 2 changesets (bug 1449051, bug 1447475) for MnH and en-US failures on a CLOSED TREE
authorshindli <shindli@mozilla.com>
Wed, 28 Mar 2018 02:05:38 +0300
changeset 773624 7fabe2630df68ea746ede62b951a27ca782b71fb
parent 773623 b09e7b25bcbeb5ece5ee280d2037983f98267d75
child 773625 d76c6788d40a2de7616b81ba619343427ef2e30d
child 773952 d672b622f865596a2522d1cf91b0a898f9fed3c6
child 774758 c8722b7560536df2b0ddc651034c5b215abfed96
push id104266
push userbmo:hsivonen@hsivonen.fi
push dateWed, 28 Mar 2018 07:33:03 +0000
bugs1449051, 1447475
milestone61.0a1
backs outd9a446d356da021876e540db7884907ef6ffdaad
851ed02cdac10ef8038cf73d0df080f393530546
Backed out 2 changesets (bug 1449051, bug 1447475) for MnH and en-US failures on a CLOSED TREE Backed out changeset d9a446d356da (bug 1449051) Backed out changeset 851ed02cdac1 (bug 1447475)
browser/installer/Makefile.in
browser/installer/package-manifest.in
build/autoconf/icu.m4
config/external/icu/data/moz.build
config/external/icu/moz.build
config/external/icu/stubdata/moz.build
js/public/Value.h
js/src/build/moz.build
js/src/fuzz-tests/moz.build
js/src/gdb/moz.build
js/src/jsapi-tests/moz.build
js/src/shell/moz.build
xpcom/build/XPCOMInit.cpp
xpcom/build/moz.build
--- a/browser/installer/Makefile.in
+++ b/browser/installer/Makefile.in
@@ -127,19 +127,25 @@ DEFINES += -DRESPATH='$(RESPATH)'
 LPROJ_ROOT = $(firstword $(subst -, ,$(AB_CD)))
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 ifeq (zh-TW,$(AB_CD))
 LPROJ_ROOT := $(subst -,_,$(AB_CD))
 endif
 endif
 DEFINES += -DLPROJ_ROOT=$(LPROJ_ROOT)
 
+DEFINES += -DMOZ_ICU_VERSION=$(MOZ_ICU_VERSION)
 ifdef MOZ_SYSTEM_ICU
 DEFINES += -DMOZ_SYSTEM_ICU
 endif
+ifdef MOZ_ICU_DATA_ARCHIVE
+DEFINES += -DMOZ_ICU_DATA_ARCHIVE
+endif
+DEFINES += -DMOZ_ICU_DBG_SUFFIX=$(MOZ_ICU_DBG_SUFFIX)
+DEFINES += -DICU_DATA_FILE=$(ICU_DATA_FILE)
 ifdef CLANG_CXX
 DEFINES += -DCLANG_CXX
 endif
 ifdef CLANG_CL
 DEFINES += -DCLANG_CL
 endif
 
 ifdef LLVM_SYMBOLIZER
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -92,16 +92,19 @@
 @BINPATH@/@MSVC_C_RUNTIME_DLL@
 @BINPATH@/@MSVC_CXX_RUNTIME_DLL@
 #endif
 #if MOZ_PACKAGE_WIN_UCRT_DLLS
 @BINPATH@/api-ms-win-*.dll
 @BINPATH@/ucrtbase.dll
 #endif
 #endif
+#ifdef MOZ_ICU_DATA_ARCHIVE
+@RESPATH@/@ICU_DATA_FILE@
+#endif
 #ifdef MOZ_GTK3
 @BINPATH@/@DLL_PREFIX@mozgtk@DLL_SUFFIX@
 @BINPATH@/gtk2/@DLL_PREFIX@mozgtk@DLL_SUFFIX@
 #ifdef MOZ_WAYLAND
 @BINPATH@/@DLL_PREFIX@mozwayland@DLL_SUFFIX@
 #endif
 #endif
 
--- a/build/autoconf/icu.m4
+++ b/build/autoconf/icu.m4
@@ -2,16 +2,17 @@ dnl This Source Code Form is subject to 
 dnl License, v. 2.0. If a copy of the MPL was not distributed with this
 dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 dnl Set the MOZ_ICU_VERSION variable to denote the current version of the
 dnl ICU library, as well as a few other things.
 
 AC_DEFUN([MOZ_CONFIG_ICU], [
 
+ICU_LIB_NAMES=
 MOZ_SYSTEM_ICU=
 MOZ_ARG_WITH_BOOL(system-icu,
 [  --with-system-icu
                           Use system ICU (located with pkgconfig)],
     MOZ_SYSTEM_ICU=1)
 
 if test -n "$MOZ_SYSTEM_ICU"; then
     PKG_CHECK_MODULES(MOZ_ICU, icu-i18n >= 59.1)
@@ -73,22 +74,25 @@ if test -n "$USE_ICU"; then
        AC_MSG_ERROR([cannot determine icu version number from uvernum.h header file $lineno])
     fi
     MOZ_ICU_VERSION="$version"
 
     # TODO: the l is actually endian-dependent
     # We could make this set as 'l' or 'b' for little or big, respectively,
     # but we'd need to check in a big-endian version of the file.
     ICU_DATA_FILE="icudt${version}l.dat"
+
+    MOZ_ICU_DATA_ARCHIVE=
 fi
 
 AC_SUBST(MOZ_ICU_VERSION)
 AC_SUBST(ENABLE_INTL_API)
 AC_SUBST(USE_ICU)
 AC_SUBST(ICU_DATA_FILE)
+AC_SUBST(MOZ_ICU_DATA_ARCHIVE)
 
 if test -n "$USE_ICU"; then
     dnl Source files that use ICU should have control over which parts of the ICU
     dnl namespace they want to use.
     AC_DEFINE(U_USING_ICU_NAMESPACE,0)
 
     if test -z "$MOZ_SYSTEM_ICU"; then
         if test -z "$YASM" -a -z "$GNU_AS" -a "$COMPILE_ENVIRONMENT"; then
--- a/config/external/icu/data/moz.build
+++ b/config/external/icu/data/moz.build
@@ -1,14 +1,18 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+if CONFIG['MOZ_ICU_DATA_ARCHIVE']:
+    # Copy the pre-built ICU data file to dist/bin.
+    FINAL_TARGET_FILES += [CONFIG['ICU_DATA_FILE']]
+
 # Build a library containing the ICU data for use in the JS shell, so that
 # JSAPI consumers don't have to deal with setting ICU's data path.
 Library('icudata')
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     if CONFIG['CPU_ARCH'] == 'x86':
         ASFLAGS += ['-DPREFIX']
 elif CONFIG['OS_ARCH'] == 'Darwin':
--- a/config/external/icu/moz.build
+++ b/config/external/icu/moz.build
@@ -9,9 +9,13 @@ Library('icu')
 if CONFIG['MOZ_SYSTEM_ICU']:
     OS_LIBS += CONFIG['MOZ_ICU_LIBS']
 else:
     DIRS += [
         'common',
         'data',
         'i18n',
     ]
-    USE_LIBS += ['icudata']
+    if CONFIG['MOZ_ICU_DATA_ARCHIVE']:
+        DIRS += ['stubdata']
+        USE_LIBS += ['icustubdata']
+    else:
+        USE_LIBS += ['icudata']
new file mode 100644
--- /dev/null
+++ b/config/external/icu/stubdata/moz.build
@@ -0,0 +1,13 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+# This builds the ICU stubdata library, since we are shipping ICU
+# data in a separate data file. ICU needs a data symbol to link against
+# even if you're loading its data from a file.
+
+Library('icustubdata')
+
+SOURCES += ['/intl/icu/source/stubdata/stubdata.cpp']
--- a/js/public/Value.h
+++ b/js/public/Value.h
@@ -807,89 +807,146 @@ class MOZ_NON_PARAM alignas(8) Value
 #endif
         data.asBits = bitsFromTagAndPayload(JSVAL_TAG_PRIVATE_GCTHING, PayloadType(cell));
     }
 
     bool isPrivateGCThing() const {
         return toTag() == JSVAL_TAG_PRIVATE_GCTHING;
     }
 
+    const size_t* payloadWord() const {
+#if defined(JS_NUNBOX32)
+        return &data.s.payload.word;
+#elif defined(JS_PUNBOX64)
+        return &data.asWord;
+#endif
+    }
+
     const uintptr_t* payloadUIntPtr() const {
 #if defined(JS_NUNBOX32)
         return &data.s.payload.uintptr;
 #elif defined(JS_PUNBOX64)
         return &data.asUIntPtr;
 #endif
     }
 
 #if !defined(_MSC_VER) && !defined(__sparc)
   // Value must be POD so that MSVC will pass it by value and not in memory
   // (bug 689101); the same is true for SPARC as well (bug 737344).  More
   // precisely, we don't want Value return values compiled as out params.
   private:
 #endif
 
+#if MOZ_LITTLE_ENDIAN
+# if defined(JS_NUNBOX32)
     union layout {
         uint64_t asBits;
-        double asDouble;
-        void* asPtr;
-#if defined(JS_PUNBOX64)
-        uintptr_t asUIntPtr;
-#endif // defined(JS_PUNBOX64)
-
-#if defined(JS_PUNBOX64) && !defined(_WIN64)
-        /* MSVC does not pack these correctly :-( */
         struct {
-#  if MOZ_LITTLE_ENDIAN
-            uint64_t   payload47 : 47;
-            JSValueTag tag : 17;
-#  else
-            JSValueTag tag : 17;
-            uint64_t   payload47 : 47;
-#  endif // MOZ_LITTLE_ENDIAN
-        } debugView;
-#endif // defined(JS_PUNBOX64) && !defined(_WIN64)
-
-        struct {
-#if defined(JS_PUNBOX64)
-#  if MOZ_BIG_ENDIAN
-            uint32_t padding;
-#  endif // MOZ_BIG_ENDIAN
-            union {
-                int32_t    i32;
-                uint32_t   u32;
-                JSWhyMagic why;
-            } payload;
-#else
-#  if MOZ_BIG_ENDIAN
-            JSValueTag tag;
-#  endif // MOZ_BIG_ENDIAN
             union {
                 int32_t        i32;
                 uint32_t       u32;
                 uint32_t       boo;     // Don't use |bool| -- it must be four bytes.
                 JSString*      str;
                 JS::Symbol*    sym;
                 JSObject*      obj;
                 js::gc::Cell*  cell;
                 void*          ptr;
                 JSWhyMagic     why;
                 size_t         word;
                 uintptr_t      uintptr;
             } payload;
-#  if MOZ_LITTLE_ENDIAN
             JSValueTag tag;
-#  endif // MOZ_LITTLE_ENDIAN
-#endif // defined(JS_PUNBOX64)
         } s;
+        double asDouble;
+        void* asPtr;
+
+        layout() : asBits(JSVAL_RAW64_UNDEFINED) {}
+        explicit constexpr layout(uint64_t bits) : asBits(bits) {}
+        explicit constexpr layout(double d) : asDouble(d) {}
+    } data;
+# elif defined(JS_PUNBOX64)
+    union layout {
+        uint64_t asBits;
+#if !defined(_WIN64)
+        /* MSVC does not pack these correctly :-( */
+        struct {
+            uint64_t           payload47 : 47;
+            JSValueTag         tag : 17;
+        } debugView;
+#endif
+        struct {
+            union {
+                int32_t        i32;
+                uint32_t       u32;
+                JSWhyMagic     why;
+            } payload;
+        } s;
+        double asDouble;
+        void* asPtr;
+        size_t asWord;
+        uintptr_t asUIntPtr;
 
         layout() : asBits(JSVAL_RAW64_UNDEFINED) {}
         explicit constexpr layout(uint64_t bits) : asBits(bits) {}
         explicit constexpr layout(double d) : asDouble(d) {}
     } data;
+# endif  /* JS_PUNBOX64 */
+#else   /* MOZ_LITTLE_ENDIAN */
+# if defined(JS_NUNBOX32)
+    union layout {
+        uint64_t asBits;
+        struct {
+            JSValueTag tag;
+            union {
+                int32_t        i32;
+                uint32_t       u32;
+                uint32_t       boo;     // Don't use |bool| -- it must be four bytes.
+                JSString*      str;
+                JS::Symbol*    sym;
+                JSObject*      obj;
+                js::gc::Cell*  cell;
+                void*          ptr;
+                JSWhyMagic     why;
+                size_t         word;
+                uintptr_t      uintptr;
+            } payload;
+        } s;
+        double asDouble;
+        void* asPtr;
+
+        layout() : asBits(JSVAL_RAW64_UNDEFINED) {}
+        explicit constexpr layout(uint64_t bits) : asBits(bits) {}
+        explicit constexpr layout(double d) : asDouble(d) {}
+    } data;
+# elif defined(JS_PUNBOX64)
+    union layout {
+        uint64_t asBits;
+        struct {
+            JSValueTag         tag : 17;
+            uint64_t           payload47 : 47;
+        } debugView;
+        struct {
+            uint32_t           padding;
+            union {
+                int32_t        i32;
+                uint32_t       u32;
+                JSWhyMagic     why;
+            } payload;
+        } s;
+        double asDouble;
+        void* asPtr;
+        size_t asWord;
+        uintptr_t asUIntPtr;
+
+        layout() : asBits(JSVAL_RAW64_UNDEFINED) {}
+        explicit constexpr layout(uint64_t bits) : asBits(bits) {}
+        explicit constexpr layout(double d) : asDouble(d) {}
+    } data;
+# endif /* JS_PUNBOX64 */
+#endif  /* MOZ_LITTLE_ENDIAN */
 
   private:
     explicit constexpr Value(uint64_t asBits) : data(asBits) {}
     explicit constexpr Value(double d) : data(d) {}
 
     void staticAssertions() {
         JS_STATIC_ASSERT(sizeof(JSValueType) == 1);
         JS_STATIC_ASSERT(sizeof(JSValueTag) == 4);
@@ -967,24 +1024,20 @@ struct MOZ_NON_PARAM alignas(8) Uninitia
         return asValueRef();
     }
 
     inline void operator=(Value const& other) {
         asValueRef() = other;
     }
 };
 
-static_assert(sizeof(Value) == 8,
-              "Value size must leave three tag bits, be a binary power, and "
-              "is ubiquitously depended upon everywhere");
+static_assert(sizeof(Value) == 8, "Value size must leave three tag bits, be a binary power, and is ubiquitously depended upon everywhere");
 
-static_assert(sizeof(UninitializedValue) == sizeof(Value),
-              "Value and UninitializedValue must be the same size");
-static_assert(alignof(UninitializedValue) == alignof(Value),
-              "Value and UninitializedValue must have same alignment");
+static_assert(sizeof(UninitializedValue) == sizeof(Value), "Value and UninitializedValue must be the same size");
+static_assert(alignof(UninitializedValue) == alignof(Value), "Value and UninitializedValue must have same alignment");
 
 inline bool
 IsOptimizedPlaceholderMagicValue(const Value& v)
 {
     if (v.isMagic()) {
         MOZ_ASSERT(v.whyMagic() == JS_OPTIMIZED_ARGUMENTS || v.whyMagic() == JS_OPTIMIZED_OUT);
         return true;
     }
--- a/js/src/build/moz.build
+++ b/js/src/build/moz.build
@@ -25,19 +25,27 @@ if CONFIG['JS_SHARED_LIBRARY']:
     SHARED_LIBRARY_NAME = CONFIG['JS_LIBRARY_NAME']
 else:
     Library('js')
 
 FORCE_STATIC_LIB = True
 STATIC_LIBRARY_NAME = 'js_static'
 
 if CONFIG['ENABLE_INTL_API']:
-    USE_LIBS += [
-        'icu',
-    ]
+    if not CONFIG['MOZ_ICU_DATA_ARCHIVE']:
+        USE_LIBS += [
+            'icu',
+        ]
+    else:
+        # Linking 'icu' will pull in the stubdata library,
+        # which the shell doesn't want, so link the other bits.
+        USE_LIBS += [
+            'icui18n',
+            'icuuc',
+        ]
 
 USE_LIBS += [
     'nspr',
     'zlib',
 ]
 
 if CONFIG['OS_ARCH'] not in ('WINNT', 'HP-UX'):
     OS_LIBS += [
--- a/js/src/fuzz-tests/moz.build
+++ b/js/src/fuzz-tests/moz.build
@@ -18,16 +18,21 @@ if CONFIG['JS_BUILD_BINAST']:
 
 DEFINES['EXPORT_JS_API'] = True
 
 LOCAL_INCLUDES += [
     '!..',
     '..',
 ]
 
+if CONFIG['ENABLE_INTL_API'] and CONFIG['MOZ_ICU_DATA_ARCHIVE']:
+    # The ICU libraries linked into libmozjs will not include the ICU data,
+    # so link it directly.
+    USE_LIBS += ['icudata']
+
 if CONFIG['FUZZING']:
     USE_LIBS += [
         'static:fuzzer-registry',
     ]
 
 if CONFIG['LIBFUZZER']:
     USE_LIBS += [
         'static:fuzzer',
--- a/js/src/gdb/moz.build
+++ b/js/src/gdb/moz.build
@@ -34,16 +34,21 @@ LOCAL_INCLUDES += [
     '!..',
     '..',
 ]
 
 USE_LIBS += [
     'static:js',
 ]
 
+if CONFIG['ENABLE_INTL_API'] and CONFIG['MOZ_ICU_DATA_ARCHIVE']:
+    # The ICU libraries linked into libmozjs will not include the ICU data,
+    # so link it directly.
+    USE_LIBS += ['icudata']
+
 OS_LIBS += CONFIG['MOZ_ZLIB_LIBS']
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-shadow', '-fno-strict-aliasing']
 
 # This is intended as a temporary workaround to enable VS2015.
 if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     CXXFLAGS += ['-wd4312']
--- a/js/src/jsapi-tests/moz.build
+++ b/js/src/jsapi-tests/moz.build
@@ -158,16 +158,21 @@ if CONFIG['JS_BUILD_BINAST'] and CONFIG[
 DEFINES['EXPORT_JS_API'] = True
 DEFINES['ENABLE_WASM_GLOBAL'] = True
 
 LOCAL_INCLUDES += [
     '!..',
     '..',
 ]
 
+if CONFIG['ENABLE_INTL_API'] and CONFIG['MOZ_ICU_DATA_ARCHIVE']:
+    # The ICU libraries linked into libmozjs will not include the ICU data,
+    # so link it directly.
+    USE_LIBS += ['icudata']
+
 USE_LIBS += [
     'static:js',
 ]
 
 if CONFIG['MOZ_NEEDS_LIBATOMIC']:
     OS_LIBS += ['atomic']
 
 OS_LIBS += CONFIG['MOZ_ZLIB_LIBS']
--- a/js/src/shell/moz.build
+++ b/js/src/shell/moz.build
@@ -32,16 +32,21 @@ if CONFIG['CC_TYPE'] in ('msvc', 'clang-
 LOCAL_INCLUDES += [
     '!..',
     '..',
 ]
 
 OS_LIBS += CONFIG['EDITLINE_LIBS']
 OS_LIBS += CONFIG['MOZ_ZLIB_LIBS']
 
+if CONFIG['ENABLE_INTL_API'] and CONFIG['MOZ_ICU_DATA_ARCHIVE']:
+    # The ICU libraries linked into libmozjs will not include the ICU data,
+    # so link it directly.
+    USE_LIBS += ['icudata']
+
 # Prepare module loader JS code for embedding
 GENERATED_FILES += [('shellmoduleloader.out.h', 'shellmoduleloader.js')]
 shellmoduleloader = GENERATED_FILES[('shellmoduleloader.out.h', 'shellmoduleloader.js')]
 shellmoduleloader.script = '../builtin/embedjs.py:generate_shellmoduleloader'
 shellmoduleloader.inputs = [
     '../js.msg',
     'ModuleLoader.js',
 ]
--- a/xpcom/build/XPCOMInit.cpp
+++ b/xpcom/build/XPCOMInit.cpp
@@ -150,16 +150,20 @@ extern nsresult nsStringInputStreamConst
 
 #include "GeckoProfiler.h"
 
 #include "jsapi.h"
 #include "js/Initialization.h"
 
 #include "gfxPlatform.h"
 
+#if EXPOSE_INTL_API
+#include "unicode/putil.h"
+#endif
+
 using namespace mozilla;
 using base::AtExitManager;
 using mozilla::ipc::BrowserProcessSubThread;
 
 namespace {
 
 static AtExitManager* sExitManager;
 static MessageLoop* sMessageLoop;
@@ -646,16 +650,27 @@ NS_InitXPCOM2(nsIServiceManager** aResul
                         VPXReporter::CountingCalloc,
                         VPXReporter::CountingRealloc,
                         VPXReporter::CountingFree,
                         memcpy,
                         memset,
                         memmove);
 #endif
 
+#if EXPOSE_INTL_API && defined(MOZ_ICU_DATA_ARCHIVE)
+  nsCOMPtr<nsIFile> greDir;
+  nsDirectoryService::gService->Get(NS_GRE_DIR,
+                                    NS_GET_IID(nsIFile),
+                                    getter_AddRefs(greDir));
+  MOZ_ASSERT(greDir);
+  nsAutoCString nativeGREPath;
+  greDir->GetNativePath(nativeGREPath);
+  u_setDataDirectory(nativeGREPath.get());
+#endif
+
   // Initialize the JS engine.
   const char* jsInitFailureReason = JS_InitWithFailureDiagnostic();
   if (jsInitFailureReason) {
     MOZ_CRASH_UNSAFE_OOL(jsInitFailureReason);
   }
   sInitializedJS = true;
 
   rv = nsComponentManagerImpl::gComponentManager->Init();
--- a/xpcom/build/moz.build
+++ b/xpcom/build/moz.build
@@ -78,16 +78,18 @@ GENERATED_FILES['Services.h'].script = '
 GENERATED_FILES['services.rs'].script = 'Services.py:services_rs'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 DEFINES['_IMPL_NS_STRINGAPI'] = True
 DEFINES['OMNIJAR_NAME'] = CONFIG['OMNIJAR_NAME']
+if CONFIG['MOZ_ICU_DATA_ARCHIVE']:
+    DEFINES['MOZ_ICU_DATA_ARCHIVE'] = True
 
 LOCAL_INCLUDES += [
     '!..',
     '../base',
     '../components',
     '../ds',
     '../glue',
     '../io',