Browse Source

mozilla rel-257 rebase part 19

Ian Neal 4 years ago
parent
commit
dd93e2127e
38 changed files with 1656 additions and 584 deletions
  1. 0 223
      comm-esr60/mozilla-esr60/patches/1562388-1-72a1.patch
  2. 0 257
      comm-esr60/mozilla-esr60/patches/1562388-2-72a1.patch
  3. 0 16
      comm-esr60/mozilla-esr60/patches/series
  4. 346 0
      rel-257/mozilla-esr60/patches/1255485-1-61a1.patch
  5. 78 0
      rel-257/mozilla-esr60/patches/1255485-2-61a1.patch
  6. 31 0
      rel-257/mozilla-esr60/patches/1255485-3-61a1.patch
  7. 38 0
      rel-257/mozilla-esr60/patches/1255485-4-61a1.patch
  8. 224 0
      rel-257/mozilla-esr60/patches/1255485-5-61a1.patch
  9. 45 0
      rel-257/mozilla-esr60/patches/1255485-6-61a1.patch
  10. 2 2
      rel-257/mozilla-esr60/patches/1372381-3-61a1.patch
  11. 2 2
      rel-257/mozilla-esr60/patches/1397263-5-64a1.patch
  12. 8 8
      rel-257/mozilla-esr60/patches/1429875-1-61a1.patch
  13. 1 1
      rel-257/mozilla-esr60/patches/1429875-2-61a1.patch
  14. 4 4
      rel-257/mozilla-esr60/patches/1429875-3-61a1.patch
  15. 11 10
      rel-257/mozilla-esr60/patches/1429875-4-61a1.patch
  16. 8 8
      rel-257/mozilla-esr60/patches/1429875-5-61a1.patch
  17. 3 3
      rel-257/mozilla-esr60/patches/1457524-1-61a1.patch
  18. 1 1
      rel-257/mozilla-esr60/patches/1457524-2-61a1.patch
  19. 1 1
      rel-257/mozilla-esr60/patches/1458161-61a1.patch
  20. 5 5
      rel-257/mozilla-esr60/patches/1469091-63a1.patch
  21. 5 5
      rel-257/mozilla-esr60/patches/1512882-centos_bootstrap.patch
  22. 218 0
      rel-257/mozilla-esr60/patches/1562388-1-72a1.patch
  23. 239 0
      rel-257/mozilla-esr60/patches/1562388-2-72a1.patch
  24. 317 0
      rel-257/mozilla-esr60/patches/1576755-71a1.patch
  25. 1 2
      rel-257/mozilla-esr60/patches/1591887-1-NSPR424-72a1.patch
  26. 6 7
      rel-257/mozilla-esr60/patches/1591887-2-NSPR424-72a1.patch
  27. 2 3
      rel-257/mozilla-esr60/patches/1592007-1-NSS348-72a1.patch
  28. 1 2
      rel-257/mozilla-esr60/patches/1592007-2-NSS348-72a1.patch
  29. 1 2
      rel-257/mozilla-esr60/patches/1592007-3-NSS348-72a1.patch
  30. 1 2
      rel-257/mozilla-esr60/patches/1592007-4-NSS348-72a1.patch
  31. 1 2
      rel-257/mozilla-esr60/patches/1592007-5-NSS348-72a1.patch
  32. 1 2
      rel-257/mozilla-esr60/patches/1592007-6-NSS348-72a1.patch
  33. 3 4
      rel-257/mozilla-esr60/patches/1592007-7-NSS348-72a1.patch
  34. 14 2
      rel-257/mozilla-esr60/patches/1592007-8-NSS348-72a1.patch
  35. 1 1
      rel-257/mozilla-esr60/patches/1592007-9-NSS348-72a1.patch
  36. 12 7
      rel-257/mozilla-esr60/patches/1602263-buildfixes-257.patch
  37. 2 2
      rel-257/mozilla-esr60/patches/1605729-buildconfig-gitlab.patch
  38. 23 0
      rel-257/mozilla-esr60/patches/series

+ 0 - 223
comm-esr60/mozilla-esr60/patches/1562388-1-72a1.patch

@@ -1,223 +0,0 @@
-# HG changeset patch
-# User Valentin Gosu <valentin.gosu@gmail.com>
-# Date 1573582701 0
-# Node ID 3b98d7dcb7066c220a0c378d83a103535d98d93b
-# Parent  d133f95a59c1325362920e2ed951e72d5565b182
-Bug 1562388 - Remove XP legacy NotifyAddrChange call from nsNotifyAddrListener r=mayhemer
-
-Old code needed to dynamically load a DLL - which was not available
-for windows versions prior to Vista, and if that failed it would
-fall back to using an older API.
-
-This patch now calls the methods directly, since we don't have to
-worry about the library not being there; we also remove the
-fallback, meaning we always call NotifyIpInterfaceChange instead
-of falling back to NotifyAddrChange.
-
-Differential Revision: https://phabricator.services.mozilla.com/D52573
-
-diff --git a/netwerk/system/win32/nsNotifyAddrListener.cpp b/netwerk/system/win32/nsNotifyAddrListener.cpp
---- a/netwerk/system/win32/nsNotifyAddrListener.cpp
-+++ b/netwerk/system/win32/nsNotifyAddrListener.cpp
-@@ -42,43 +42,23 @@
- using namespace mozilla;
- 
- static LazyLogModule gNotifyAddrLog("nsNotifyAddr");
- #define LOG(args) MOZ_LOG(gNotifyAddrLog, mozilla::LogLevel::Debug, args)
- 
- static HMODULE sNetshell;
- static decltype(NcFreeNetconProperties)* sNcFreeNetconProperties;
- 
--static HMODULE sIphlpapi;
--static decltype(NotifyIpInterfaceChange)* sNotifyIpInterfaceChange;
--static decltype(CancelMibChangeNotify2)* sCancelMibChangeNotify2;
--
- #define NETWORK_NOTIFY_CHANGED_PREF "network.notify.changed"
- #define NETWORK_NOTIFY_IPV6_PREF "network.notify.IPv6"
- 
- // period during which to absorb subsequent network change events, in
- // milliseconds
- static const unsigned int kNetworkChangeCoalescingPeriod  = 1000;
- 
--static void InitIphlpapi(void)
--{
--    if (!sIphlpapi) {
--        sIphlpapi = LoadLibraryW(L"Iphlpapi.dll");
--        if (sIphlpapi) {
--            sNotifyIpInterfaceChange = (decltype(NotifyIpInterfaceChange)*)
--                GetProcAddress(sIphlpapi, "NotifyIpInterfaceChange");
--            sCancelMibChangeNotify2 = (decltype(CancelMibChangeNotify2)*)
--                GetProcAddress(sIphlpapi, "CancelMibChangeNotify2");
--        } else {
--            NS_WARNING("Failed to load Iphlpapi.dll - cannot detect network"
--                       " changes!");
--        }
--    }
--}
--
- static void InitNetshellLibrary(void)
- {
-     if (!sNetshell) {
-         sNetshell = LoadLibraryW(L"Netshell.dll");
-         if (sNetshell) {
-             sNcFreeNetconProperties = (decltype(NcFreeNetconProperties)*)
-                 GetProcAddress(sNetshell, "NcFreeNetconProperties");
-         }
-@@ -87,42 +67,33 @@ static void InitNetshellLibrary(void)
- 
- static void FreeDynamicLibraries(void)
- {
-     if (sNetshell) {
-         sNcFreeNetconProperties = nullptr;
-         FreeLibrary(sNetshell);
-         sNetshell = nullptr;
-     }
--    if (sIphlpapi) {
--        sNotifyIpInterfaceChange = nullptr;
--        sCancelMibChangeNotify2 = nullptr;
--        FreeLibrary(sIphlpapi);
--        sIphlpapi = nullptr;
--    }
- }
- 
- NS_IMPL_ISUPPORTS(nsNotifyAddrListener,
-                   nsINetworkLinkService,
-                   nsIRunnable,
-                   nsIObserver)
- 
- nsNotifyAddrListener::nsNotifyAddrListener()
-     : mLinkUp(true)  // assume true by default
-     , mStatusKnown(false)
-     , mCheckAttempted(false)
-     , mCheckEvent(nullptr)
-     , mShutdown(false)
-     , mIPInterfaceChecksum(0)
-     , mAllowChangedEvent(true)
-     , mIPv6Changes(false)
--    , mCoalescingActive(false)
--{
--    InitIphlpapi();
--}
-+    , mCoalescingActive(false) {}
- 
- nsNotifyAddrListener::~nsNotifyAddrListener()
- {
-     NS_ASSERTION(!mThread, "nsNotifyAddrListener thread shutdown failed");
-     FreeDynamicLibraries();
- }
- 
- NS_IMETHODIMP
-@@ -313,72 +284,43 @@ NS_IMETHODIMP
- nsNotifyAddrListener::Run()
- {
-     mStartTime = TimeStamp::Now();
- 
-     calculateNetworkId();
- 
-     DWORD waitTime = INFINITE;
- 
--    if (!sNotifyIpInterfaceChange || !sCancelMibChangeNotify2 || !mIPv6Changes) {
--        // For Windows versions which are older than Vista which lack
--        // NotifyIpInterfaceChange. Note this means no IPv6 support.
--        HANDLE ev = CreateEvent(nullptr, FALSE, FALSE, nullptr);
--        NS_ENSURE_TRUE(ev, NS_ERROR_OUT_OF_MEMORY);
--
--        HANDLE handles[2] = { ev, mCheckEvent };
--        OVERLAPPED overlapped = { 0 };
--        bool shuttingDown = false;
-+    // Windows Vista and newer versions.
-+    HANDLE interfacechange;
-+    // The callback will simply invoke CheckLinkStatus()
-+    DWORD ret = NotifyIpInterfaceChange(
-+        mIPv6Changes ? AF_UNSPEC
-+                     : AF_INET,  // IPv4 and IPv6
-+        (PIPINTERFACE_CHANGE_CALLBACK)OnInterfaceChange,
-+        this,  // pass to callback
-+        false, // no initial notification
-+        &interfacechange);
- 
--        overlapped.hEvent = ev;
--        while (!shuttingDown) {
--            HANDLE h;
--            DWORD ret = NotifyAddrChange(&h, &overlapped);
--
--            if (ret == ERROR_IO_PENDING) {
--                ret = WaitForMultipleObjects(2, handles, FALSE, waitTime);
--                if (ret == WAIT_OBJECT_0) {
--                    CheckLinkStatus();
--                } else if (!mShutdown) {
--                    waitTime = nextCoalesceWaitTime();
--                } else {
--                    shuttingDown = true;
--                }
--            } else {
--                shuttingDown = true;
-+    if (ret == NO_ERROR) {
-+        do {
-+            ret = WaitForSingleObject(mCheckEvent, waitTime);
-+            if (!mShutdown) {
-+                waitTime = nextCoalesceWaitTime();
-             }
--        }
--        CloseHandle(ev);
-+            else {
-+                break;
-+            }
-+        } while (ret != WAIT_FAILED);
-+        CancelMibChangeNotify2(interfacechange);
-     } else {
--        // Windows Vista and newer versions.
--        HANDLE interfacechange;
--        // The callback will simply invoke CheckLinkStatus()
--        DWORD ret = sNotifyIpInterfaceChange(
--            AF_UNSPEC, // IPv4 and IPv6
--            (PIPINTERFACE_CHANGE_CALLBACK)OnInterfaceChange,
--            this,  // pass to callback
--            false, // no initial notification
--            &interfacechange);
-+        LOG(("Link Monitor: NotifyIpInterfaceChange returned %d\n",
-+             (int)ret));
-+    }
- 
--        if (ret == NO_ERROR) {
--            do {
--                ret = WaitForSingleObject(mCheckEvent, waitTime);
--                if (!mShutdown) {
--                    waitTime = nextCoalesceWaitTime();
--                }
--                else {
--                    break;
--                }
--            } while (ret != WAIT_FAILED);
--            sCancelMibChangeNotify2(interfacechange);
--        } else {
--            LOG(("Link Monitor: sNotifyIpInterfaceChange returned %d\n",
--                 (int)ret));
--        }
--    }
-     return NS_OK;
- }
- 
- NS_IMETHODIMP
- nsNotifyAddrListener::Observe(nsISupports *subject,
-                               const char *topic,
-                               const char16_t *data)
- {
-@@ -519,17 +461,16 @@ nsNotifyAddrListener::CheckICSGateway(PI
- 
-     return isGateway;
- }
- 
- bool
- nsNotifyAddrListener::CheckICSStatus(PWCHAR aAdapterName)
- {
-     InitNetshellLibrary();
--
-     // This method enumerates all privately shared connections and checks if some
-     // of them has the same name as the one provided in aAdapterName. If such
-     // connection is found in the collection the adapter is used as ICS gateway
-     bool isICSGatewayAdapter = false;
- 
-     HRESULT hr;
-     RefPtr<INetSharingManager> netSharingManager;
-     hr = CoCreateInstance(

+ 0 - 257
comm-esr60/mozilla-esr60/patches/1562388-2-72a1.patch

@@ -1,257 +0,0 @@
-# HG changeset patch
-# User Valentin Gosu <valentin.gosu@gmail.com>
-# Date 1573582908 0
-# Node ID 8171a4e575e2d06a6240ad67b72574ced6e57ca8
-# Parent  c0c1aec76ebede60b197f9f1f907104b3df28065
-Bug 1562388 - Remove legacy ICS handling from nsNotifyAddrListener r=mayhemer
-
-This code was added in bug 465158 to deal with on-demand dial-up
-connections. That scenario is hopefully not common anymore.
-One benefit of the code was that it excludes network adapters
-that share the computers network from being part of network
-change notifications, network ID, etc. However, the code assumed
-that only adapters with the address 192.168.0.1 would be a ICS
-adapter, but trying to set up ICS on Windows 10 actually set the
-LAN interface with 192.168.137.1 - so that assumption isn't
-valid anymore. So the code is likely not even running for
-adapters that are ICS. It may run for adapters which have the
-IP 192.168.0.1, but probably that's quite rare as that's more
-often a gateway IP than a client IP.
-
-In any case, it's better to just get rid of it and if needed,
-however unlikely, we'll replace it with a more modern API.
-
-Depends on D52573
-
-Differential Revision: https://phabricator.services.mozilla.com/D52574
-
-diff --git a/netwerk/system/win32/nsNotifyAddrListener.cpp b/netwerk/system/win32/nsNotifyAddrListener.cpp
---- a/netwerk/system/win32/nsNotifyAddrListener.cpp
-+++ b/netwerk/system/win32/nsNotifyAddrListener.cpp
-@@ -39,46 +39,23 @@
- #include <iptypes.h>
- #include <iphlpapi.h>
- 
- using namespace mozilla;
- 
- static LazyLogModule gNotifyAddrLog("nsNotifyAddr");
- #define LOG(args) MOZ_LOG(gNotifyAddrLog, mozilla::LogLevel::Debug, args)
- 
--static HMODULE sNetshell;
--static decltype(NcFreeNetconProperties)* sNcFreeNetconProperties;
--
- #define NETWORK_NOTIFY_CHANGED_PREF "network.notify.changed"
- #define NETWORK_NOTIFY_IPV6_PREF "network.notify.IPv6"
- 
- // period during which to absorb subsequent network change events, in
- // milliseconds
- static const unsigned int kNetworkChangeCoalescingPeriod  = 1000;
- 
--static void InitNetshellLibrary(void)
--{
--    if (!sNetshell) {
--        sNetshell = LoadLibraryW(L"Netshell.dll");
--        if (sNetshell) {
--            sNcFreeNetconProperties = (decltype(NcFreeNetconProperties)*)
--                GetProcAddress(sNetshell, "NcFreeNetconProperties");
--        }
--    }
--}
--
--static void FreeDynamicLibraries(void)
--{
--    if (sNetshell) {
--        sNcFreeNetconProperties = nullptr;
--        FreeLibrary(sNetshell);
--        sNetshell = nullptr;
--    }
--}
--
- NS_IMPL_ISUPPORTS(nsNotifyAddrListener,
-                   nsINetworkLinkService,
-                   nsIRunnable,
-                   nsIObserver)
- 
- nsNotifyAddrListener::nsNotifyAddrListener()
-     : mLinkUp(true)  // assume true by default
-     , mStatusKnown(false)
-@@ -88,17 +65,16 @@ nsNotifyAddrListener::nsNotifyAddrListen
-     , mIPInterfaceChecksum(0)
-     , mAllowChangedEvent(true)
-     , mIPv6Changes(false)
-     , mCoalescingActive(false) {}
- 
- nsNotifyAddrListener::~nsNotifyAddrListener()
- {
-     NS_ASSERTION(!mThread, "nsNotifyAddrListener thread shutdown failed");
--    FreeDynamicLibraries();
- }
- 
- NS_IMETHODIMP
- nsNotifyAddrListener::GetIsLinkUp(bool *aIsUp)
- {
-     if (!mCheckAttempted && !mStatusKnown) {
-         mCheckAttempted = true;
-         CheckLinkStatus();
-@@ -430,117 +406,16 @@ nsNotifyAddrListener::ChangeEvent::Run()
-         mozilla::services::GetObserverService();
-     if (observerService)
-         observerService->NotifyObservers(
-                 mService, NS_NETWORK_LINK_TOPIC,
-                 NS_ConvertASCIItoUTF16(mEventID).get());
-     return NS_OK;
- }
- 
--
--// Bug 465158 features an explanation for this check. ICS being "Internet
--// Connection Sharing). The description says it is always IP address
--// 192.168.0.1 for this case.
--bool
--nsNotifyAddrListener::CheckICSGateway(PIP_ADAPTER_ADDRESSES aAdapter)
--{
--    if (!aAdapter->FirstUnicastAddress)
--        return false;
--
--    LPSOCKADDR aAddress = aAdapter->FirstUnicastAddress->Address.lpSockaddr;
--    if (!aAddress)
--        return false;
--
--    PSOCKADDR_IN in_addr = (PSOCKADDR_IN)aAddress;
--    bool isGateway = (aAddress->sa_family == AF_INET &&
--        in_addr->sin_addr.S_un.S_un_b.s_b1 == 192 &&
--        in_addr->sin_addr.S_un.S_un_b.s_b2 == 168 &&
--        in_addr->sin_addr.S_un.S_un_b.s_b3 == 0 &&
--        in_addr->sin_addr.S_un.S_un_b.s_b4 == 1);
--
--    if (isGateway)
--      isGateway = CheckICSStatus(aAdapter->FriendlyName);
--
--    return isGateway;
--}
--
--bool
--nsNotifyAddrListener::CheckICSStatus(PWCHAR aAdapterName)
--{
--    InitNetshellLibrary();
--    // This method enumerates all privately shared connections and checks if some
--    // of them has the same name as the one provided in aAdapterName. If such
--    // connection is found in the collection the adapter is used as ICS gateway
--    bool isICSGatewayAdapter = false;
--
--    HRESULT hr;
--    RefPtr<INetSharingManager> netSharingManager;
--    hr = CoCreateInstance(
--                CLSID_NetSharingManager,
--                nullptr,
--                CLSCTX_INPROC_SERVER,
--                IID_INetSharingManager,
--                getter_AddRefs(netSharingManager));
--
--    RefPtr<INetSharingPrivateConnectionCollection> privateCollection;
--    if (SUCCEEDED(hr)) {
--        hr = netSharingManager->get_EnumPrivateConnections(
--                    ICSSC_DEFAULT,
--                    getter_AddRefs(privateCollection));
--    }
--
--    RefPtr<IEnumNetSharingPrivateConnection> privateEnum;
--    if (SUCCEEDED(hr)) {
--        RefPtr<IUnknown> privateEnumUnknown;
--        hr = privateCollection->get__NewEnum(getter_AddRefs(privateEnumUnknown));
--        if (SUCCEEDED(hr)) {
--            hr = privateEnumUnknown->QueryInterface(
--                        IID_IEnumNetSharingPrivateConnection,
--                        getter_AddRefs(privateEnum));
--        }
--    }
--
--    if (SUCCEEDED(hr)) {
--        ULONG fetched;
--        VARIANT connectionVariant;
--        while (!isICSGatewayAdapter &&
--               SUCCEEDED(hr = privateEnum->Next(1, &connectionVariant,
--               &fetched)) &&
--               fetched) {
--            if (connectionVariant.vt != VT_UNKNOWN) {
--                // We should call VariantClear here but it needs to link
--                // with oleaut32.lib that produces a Ts incrase about 10ms
--                // that is undesired. As it is quit unlikely the result would
--                // be of a different type anyway, let's pass the variant
--                // unfreed here.
--                NS_ERROR("Variant of unexpected type, expecting VT_UNKNOWN, we probably leak it!");
--                continue;
--            }
--
--            RefPtr<INetConnection> connection;
--            if (SUCCEEDED(connectionVariant.punkVal->QueryInterface(
--                              IID_INetConnection,
--                              getter_AddRefs(connection)))) {
--                connectionVariant.punkVal->Release();
--
--                NETCON_PROPERTIES *properties;
--                if (SUCCEEDED(connection->GetProperties(&properties))) {
--                    if (!wcscmp(properties->pszwName, aAdapterName))
--                        isICSGatewayAdapter = true;
--
--                    if (sNcFreeNetconProperties)
--                        sNcFreeNetconProperties(properties);
--                }
--            }
--        }
--    }
--
--    return isICSGatewayAdapter;
--}
--
- DWORD
- nsNotifyAddrListener::CheckAdaptersAddresses(void)
- {
-     ULONG len = 16384;
- 
-     PIP_ADAPTER_ADDRESSES adapterList = (PIP_ADAPTER_ADDRESSES) moz_xmalloc(len);
- 
-     ULONG flags = GAA_FLAG_SKIP_DNS_SERVER|GAA_FLAG_SKIP_MULTICAST|
-@@ -570,18 +445,17 @@ nsNotifyAddrListener::CheckAdaptersAddre
-     if (ret == ERROR_SUCCESS) {
-         bool linkUp = false;
-         ULONG sum = 0;
- 
-         for (PIP_ADAPTER_ADDRESSES adapter = adapterList; adapter;
-              adapter = adapter->Next) {
-             if (adapter->OperStatus != IfOperStatusUp ||
-                 !adapter->FirstUnicastAddress ||
--                adapter->IfType == IF_TYPE_SOFTWARE_LOOPBACK ||
--                CheckICSGateway(adapter) ) {
-+                adapter->IfType == IF_TYPE_SOFTWARE_LOOPBACK) {
-                 continue;
-             }
- 
-             sum <<= 2;
-             // Add chars from AdapterName to the checksum.
-             for (int i = 0; adapter->AdapterName[i]; ++i) {
-                 sum += adapter->AdapterName[i];
-             }
-diff --git a/netwerk/system/win32/nsNotifyAddrListener.h b/netwerk/system/win32/nsNotifyAddrListener.h
---- a/netwerk/system/win32/nsNotifyAddrListener.h
-+++ b/netwerk/system/win32/nsNotifyAddrListener.h
-@@ -51,20 +51,16 @@ protected:
-     bool mStatusKnown;
-     bool mCheckAttempted;
- 
-     nsresult Shutdown(void);
-     nsresult SendEvent(const char *aEventID);
- 
-     DWORD CheckAdaptersAddresses(void);
- 
--    // Checks for an Internet Connection Sharing (ICS) gateway.
--    bool  CheckICSGateway(PIP_ADAPTER_ADDRESSES aAdapter);
--    bool  CheckICSStatus(PWCHAR aAdapterName);
--
-     nsCOMPtr<nsIThread> mThread;
- 
- private:
-     // Returns the new timeout period for coalescing (or INFINITE)
-     DWORD nextCoalesceWaitTime();
- 
-     // Called for every detected network change
-     nsresult NetworkChanged();

+ 0 - 16
comm-esr60/mozilla-esr60/patches/series

@@ -217,22 +217,6 @@ NOBUG-BACKOUT-1439860-60.patch
 TOP-9999999-rust133-257.patch
 TOP-9999999-fixlangpack-257.patch
 mozilla-esr60-top-nonexisting.patch
-1562388-1-72a1.patch
-1562388-2-72a1.patch
-1512882-centos_bootstrap.patch
-1602263-buildfixes-257.patch
-1605729-buildconfig-gitlab.patch
-1591887-1-NSPR424-72a1.patch
-1591887-2-NSPR424-72.patch
-1592007-1-NSS348-72.patch
-1592007-2-NSS348-72.patch
-1592007-3-NSS348-72.patch
-1592007-4-NSS348-72.patch
-1592007-5-NSS348-72.patch
-1592007-6-NSS348-72.patch
-1592007-7-NSS348-72.patch
-1592007-8-NSS348-72.patch
-1592007-9-NSS348-72.patch
 1594510-72a1.patch
 488725-63a1.patch
 1558522-68.patch

+ 346 - 0
rel-257/mozilla-esr60/patches/1255485-1-61a1.patch

@@ -0,0 +1,346 @@
+# HG changeset patch
+# User Ted Mielczarek <ted@mielczarek.org>
+# Date 1515612372 18000
+# Node ID ad09b92fb875944ba775ef452a245669b567619d
+# Parent  200b8243af2a9ea3ea79a4a1a12c9e1e26d262ec
+bug 1255485 - build PROGRAMs directly in dist/bin instead of copying them. r=nalexander
+
+Historically we built all our binaries in directories in the objdir, then
+symlinked them into dist/bin. Some binaries needed to be copied instead
+so that certain relative path lookups work properly, so we resorted to
+sprinkling `NSDISTMODE=copy` around Makefiles.
+
+This change makes it so we build PROGRAMs (not any other sort of targets)
+directly in dist/bin instead. We could do the same for our other targets
+with a little more work.
+
+There were several places in the tree that were copying built binaries to
+some other place and needed fixup to match the new location of binaries.
+
+On Windows pdb files are left in the objdir where the program was
+originally linked. symbolstore.py needs to locate the pdb file both to
+determine whether it should dump symbols for a binary and also to copy
+the pdb file into the symbol package. We fix this by simply looking for
+the pdb file in the current working directory if it isn't present next
+to the binary, which matches how we invoke symbolstore.py.
+
+MozReview-Commit-ID: 8TOD1uTXD5e
+
+diff --git a/browser/app/Makefile.in b/browser/app/Makefile.in
+--- a/browser/app/Makefile.in
++++ b/browser/app/Makefile.in
+@@ -41,17 +41,17 @@ endif
+ PROGRAMS_DEST = $(DIST)/bin
+ 
+ include $(topsrcdir)/config/rules.mk
+ 
+ ifneq (,$(filter-out WINNT,$(OS_ARCH)))
+ 
+ ifdef COMPILE_ENVIRONMENT
+ libs::
+-	cp -p $(MOZ_APP_NAME)$(BIN_SUFFIX) $(DIST)/bin/$(MOZ_APP_NAME)-bin$(BIN_SUFFIX)
++	cp -p $(DIST)/bin/$(MOZ_APP_NAME)$(BIN_SUFFIX) $(DIST)/bin/$(MOZ_APP_NAME)-bin$(BIN_SUFFIX)
+ endif
+ 
+ GARBAGE += $(addprefix $(FINAL_TARGET)/defaults/pref/, firefox.js)
+ 
+ endif
+ 
+ # channel-prefs.js is handled separate from other prefs due to bug 756325
+ # DO NOT change the content of channel-prefs.js without taking the appropriate
+diff --git a/config/makefiles/target_binaries.mk b/config/makefiles/target_binaries.mk
+--- a/config/makefiles/target_binaries.mk
++++ b/config/makefiles/target_binaries.mk
+@@ -2,18 +2,18 @@
+ # vim:set ts=8 sw=8 sts=8 noet:
+ #
+ # 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/.
+ 
+ ifndef NO_DIST_INSTALL
+ 
+-ifneq (,$(strip $(PROGRAM)$(SIMPLE_PROGRAMS)$(RUST_PROGRAMS)))
+-PROGRAMS_EXECUTABLES = $(SIMPLE_PROGRAMS) $(PROGRAM) $(RUST_PROGRAMS)
++ifneq (,$(strip $(SIMPLE_PROGRAMS)$(RUST_PROGRAMS)))
++PROGRAMS_EXECUTABLES = $(SIMPLE_PROGRAMS) $(RUST_PROGRAMS)
+ PROGRAMS_DEST ?= $(FINAL_TARGET)
+ PROGRAMS_TARGET := target
+ INSTALL_TARGETS += PROGRAMS
+ endif
+ 
+ 
+ ifdef SHARED_LIBRARY
+ SHARED_LIBRARY_FILES = $(SHARED_LIBRARY)
+diff --git a/config/rules.mk b/config/rules.mk
+--- a/config/rules.mk
++++ b/config/rules.mk
+@@ -562,17 +562,17 @@ LINKER_OUT=$(subst /,\,$1)
+ else
+ LINKER_OUT=$1
+ endif
+ 
+ #
+ # PROGRAM = Foo
+ # creates OBJS, links with LIBS to create Foo
+ #
+-$(PROGRAM): $(PROGOBJS) $(STATIC_LIBS_DEPS) $(EXTRA_DEPS) $(RESFILE) $(GLOBAL_DEPS)
++$(PROGRAM): $(PROGOBJS) $(STATIC_LIBS_DEPS) $(EXTRA_DEPS) $(RESFILE) $(GLOBAL_DEPS) $(call mkdir_deps,$(FINAL_TARGET))
+ 	$(REPORT_BUILD)
+ 	@$(RM) $@.manifest
+ ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
+ 	$(EXPAND_LINK) -NOLOGO -OUT:$(call LINKER_OUT,$@) -PDB:$(LINK_PDBFILE) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(MOZ_PROGRAM_LDFLAGS) $(PROGOBJS) $(RESFILE) $(STATIC_LIBS) $(SHARED_LIBS) $(OS_LIBS)
+ ifdef MSMANIFEST_TOOL
+ 	@if test -f $@.manifest; then \
+ 		if test -f '$(srcdir)/$@.manifest'; then \
+ 			echo 'Embedding manifest from $(srcdir)/$@.manifest and $@.manifest'; \
+diff --git a/js/src/shell/moz.build b/js/src/shell/moz.build
+--- a/js/src/shell/moz.build
++++ b/js/src/shell/moz.build
+@@ -59,9 +59,9 @@ if CONFIG['CC_TYPE'] in ('msvc', 'clang-
+ 
+ # Place a GDB Python auto-load file next to the shell executable, both in
+ # the build directory and in the dist/bin directory.
+ DEFINES['topsrcdir'] = '%s/js/src' % TOPSRCDIR
+ FINAL_TARGET_PP_FILES += ['js-gdb.py.in']
+ OBJDIR_FILES.js.src.shell += ['!/dist/bin/js-gdb.py']
+ 
+ # People expect the js shell to wind up in the top-level JS dir.
+-OBJDIR_FILES.js.src += ['!js%s' % CONFIG['BIN_SUFFIX']]
++OBJDIR_FILES.js.src += ['!/dist/bin/js%s' % CONFIG['BIN_SUFFIX']]
+diff --git a/modules/libmar/tests/moz.build b/modules/libmar/tests/moz.build
+--- a/modules/libmar/tests/moz.build
++++ b/modules/libmar/tests/moz.build
+@@ -3,10 +3,10 @@
+ # 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/.
+ 
+ XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini']
+ 
+ if CONFIG['OS_TARGET'] != 'Android':
+     TEST_HARNESS_FILES.xpcshell.modules.libmar.tests.unit += [
+-        '!../tool/signmar%s' % CONFIG['BIN_SUFFIX'],
++        '!/dist/bin/signmar%s' % CONFIG['BIN_SUFFIX'],
+     ]
+diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py
+--- a/python/mozbuild/mozbuild/backend/recursivemake.py
++++ b/python/mozbuild/mozbuild/backend/recursivemake.py
+@@ -1119,17 +1119,17 @@ class RecursiveMakeBackend(CommonBackend
+             interfaces_manifests = ' '.join(interfaces_manifests),
+             xpidl_rules=rules.getvalue(),
+             xpidl_modules=' '.join(xpt_modules),
+             xpt_files=' '.join(sorted(xpt_files - registered_xpt_files)),
+             registered_xpt_files=' '.join(sorted(registered_xpt_files)),
+         ))
+ 
+     def _process_program(self, obj, backend_file):
+-        backend_file.write('PROGRAM = %s\n' % obj.program)
++        backend_file.write('PROGRAM = %s\n' % self._pretty_path(obj.output_path, backend_file))
+         if not obj.cxx_link and not self.environment.bin_suffix:
+             backend_file.write('PROG_IS_C_ONLY_%s := 1\n' % obj.program)
+ 
+     def _process_host_program(self, program, backend_file):
+         backend_file.write('HOST_PROGRAM = %s\n' % program)
+ 
+     def _process_rust_program_base(self, obj, backend_file,
+                                    target_variable,
+diff --git a/python/mozbuild/mozbuild/frontend/data.py b/python/mozbuild/mozbuild/frontend/data.py
+--- a/python/mozbuild/mozbuild/frontend/data.py
++++ b/python/mozbuild/mozbuild/frontend/data.py
+@@ -12,16 +12,17 @@ All data structures of interest are chil
+ Logic for populating these data structures is not defined in this class.
+ Instead, what we have here are dumb container classes. The emitter module
+ contains the code for converting executed mozbuild files into these data
+ structures.
+ """
+ 
+ from __future__ import absolute_import, unicode_literals
+ 
++from mozbuild.frontend.context import ObjDirPath
+ from mozbuild.util import StrictOrderingOnAppendList
+ from mozpack.chrome.manifest import ManifestEntry
+ 
+ import mozpack.path as mozpath
+ from .context import FinalTargetValue
+ 
+ from collections import defaultdict, OrderedDict
+ import itertools
+@@ -81,16 +82,20 @@ class ContextDerived(TreeMetadata):
+ 
+         self._context = context
+ 
+     @property
+     def install_target(self):
+         return self._context['FINAL_TARGET']
+ 
+     @property
++    def installed(self):
++        return self._context['DIST_INSTALL'] is not False
++
++    @property
+     def defines(self):
+         defines = self._context['DEFINES']
+         return Defines(self._context, defines) if defines else None
+ 
+     @property
+     def relobjdir(self):
+         return mozpath.relpath(self.objdir, self.topobjdir)
+ 
+@@ -467,16 +472,23 @@ class BaseProgram(Linkable):
+         Linkable.__init__(self, context)
+ 
+         bin_suffix = context.config.substs.get(self.SUFFIX_VAR, '')
+         if not program.endswith(bin_suffix):
+             program += bin_suffix
+         self.program = program
+         self.is_unit_test = is_unit_test
+ 
++    @property
++    def output_path(self):
++        if self.installed:
++            return ObjDirPath(self._context, '!/' + mozpath.join(self.install_target, self.program))
++        else:
++            return ObjDirPath(self._context, '!' + self.program)
++
+     def __repr__(self):
+         return '<%s: %s/%s>' % (type(self).__name__, self.relobjdir, self.program)
+ 
+ 
+ class Program(BaseProgram):
+     """Context derived container object for PROGRAM"""
+     SUFFIX_VAR = 'BIN_SUFFIX'
+     KIND = 'target'
+diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozbuild/frontend/emitter.py
+--- a/python/mozbuild/mozbuild/frontend/emitter.py
++++ b/python/mozbuild/mozbuild/frontend/emitter.py
+@@ -779,17 +779,18 @@ class TreeMetadataEmitter(LoggingMixin):
+                              'GENERATED_FILES: %s') % (symbols_file,), context)
+                     shared_args['symbols_file'] = symbols_file.target_basename
+ 
+             if shared_lib:
+                 lib = SharedLibrary(context, libname, **shared_args)
+                 self._libs[libname].append(lib)
+                 self._linkage.append((context, lib, 'USE_LIBS'))
+                 linkables.append(lib)
+-                generated_files.add(lib.lib_name)
++                if not lib.installed:
++                    generated_files.add(lib.lib_name)
+                 if symbols_file and isinstance(symbols_file, SourcePath):
+                     script = mozpath.join(
+                         mozpath.dirname(mozpath.dirname(__file__)),
+                         'action', 'generate_symbols_file.py')
+                     defines = ()
+                     if lib.defines:
+                         defines = lib.defines.get_defines()
+                     yield GeneratedFile(context, script,
+diff --git a/toolkit/crashreporter/tools/symbolstore.py b/toolkit/crashreporter/tools/symbolstore.py
+--- a/toolkit/crashreporter/tools/symbolstore.py
++++ b/toolkit/crashreporter/tools/symbolstore.py
+@@ -607,31 +607,50 @@ class Dumper:
+ 
+         elapsed = time.time() - t_start
+         print('Finished processing %s in %.2fs' % (file, elapsed),
+               file=sys.stderr)
+ 
+ # Platform-specific subclasses.  For the most part, these just have
+ # logic to determine what files to extract symbols from.
+ 
++def locate_pdb(path):
++    '''Given a path to a binary, attempt to locate the matching pdb file with simple heuristics:
++    * Look for a pdb file with the same base name next to the binary
++    * Look for a pdb file with the same base name in the cwd
++
++    Returns the path to the pdb file if it exists, or None if it could not be located.
++    '''
++    path, ext = os.path.splitext(path)
++    pdb = path + '.pdb'
++    if os.path.isfile(pdb):
++        return pdb
++    # If there's no pdb next to the file, see if there's a pdb with the same root name
++    # in the cwd. We build some binaries directly into dist/bin, but put the pdb files
++    # in the relative objdir, which is the cwd when running this script.
++    base = os.path.basename(pdb)
++    pdb = os.path.join(os.getcwd(), base)
++    if os.path.isfile(pdb):
++        return pdb
++    return None
++
+ class Dumper_Win32(Dumper):
+     fixedFilenameCaseCache = {}
+ 
+     def ShouldProcess(self, file):
+         """This function will allow processing of exe or dll files that have pdb
+         files with the same base name next to them."""
+         if file.endswith(".exe") or file.endswith(".dll"):
+-            path, ext = os.path.splitext(file)
+-            if os.path.isfile(path + ".pdb"):
++            if locate_pdb(file) is not None:
+                 return True
+         return False
+ 
+ 
+     def CopyDebug(self, file, debug_file, guid, code_file, code_id):
+-        file = "%s.pdb" % os.path.splitext(file)[0]
++        file = locate_pdb(file)
+         def compress(path):
+             compressed_file = path[:-1] + '_'
+             # ignore makecab's output
+             makecab = buildconfig.substs['MAKECAB']
+             success = subprocess.call([makecab, "-D",
+                                        "CompressionType=MSZIP",
+                                        path, compressed_file],
+                                       stdout=open(os.devnull, 'w'),
+diff --git a/toolkit/crashreporter/tools/unit-symbolstore.py b/toolkit/crashreporter/tools/unit-symbolstore.py
+--- a/toolkit/crashreporter/tools/unit-symbolstore.py
++++ b/toolkit/crashreporter/tools/unit-symbolstore.py
+@@ -479,18 +479,17 @@ class TestFunctional(HelperMixin, unitte
+             else:
+                 self.dump_syms = os.path.join(self.topsrcdir,
+                                               'toolkit',
+                                               'crashreporter',
+                                               'tools',
+                                               'win32',
+                                               'dump_syms_vc{_MSC_VER}.exe'.format(**buildconfig.substs))
+             self.target_bin = os.path.join(buildconfig.topobjdir,
+-                                           'browser',
+-                                           'app',
++                                           'dist', 'bin',
+                                            'firefox.exe')
+         else:
+             self.dump_syms = os.path.join(buildconfig.topobjdir,
+                                           'dist', 'host', 'bin',
+                                           'dump_syms')
+             self.target_bin = os.path.join(buildconfig.topobjdir,
+                                            'dist', 'bin', 'firefox')
+ 
+@@ -499,26 +498,28 @@ class TestFunctional(HelperMixin, unitte
+         HelperMixin.tearDown(self)
+ 
+     def testSymbolstore(self):
+         if self.skip_test:
+             raise unittest.SkipTest('Skipping test in non-Firefox product')
+         dist_include_manifest = os.path.join(buildconfig.topobjdir,
+                                              '_build_manifests/install/dist_include')
+         dist_include = os.path.join(buildconfig.topobjdir, 'dist/include')
++        browser_app = os.path.join(buildconfig.topobjdir, 'browser/app')
+         output = subprocess.check_output([sys.executable,
+                                           self.script_path,
+                                           '--vcs-info',
+                                           '-s', self.topsrcdir,
+                                           '--install-manifest=%s,%s' % (dist_include_manifest,
+                                                                         dist_include),
+                                           self.dump_syms,
+                                           self.test_dir,
+                                           self.target_bin],
+-                                         stderr=open(os.devnull, 'w'))
++                                         stderr=open(os.devnull, 'w'),
++                                         cwd=browser_app)
+         lines = filter(lambda x: x.strip(), output.splitlines())
+         self.assertEqual(1, len(lines),
+                          'should have one filename in the output')
+         symbol_file = os.path.join(self.test_dir, lines[0])
+         self.assertTrue(os.path.isfile(symbol_file))
+         symlines = open(symbol_file, 'r').readlines()
+         file_lines = [l for l in symlines if l.startswith('FILE')]
+         def check_hg_path(lines, match):

+ 78 - 0
rel-257/mozilla-esr60/patches/1255485-2-61a1.patch

@@ -0,0 +1,78 @@
+# HG changeset patch
+# User Ted Mielczarek <ted@mielczarek.org>
+# Date 1511382606 18000
+# Node ID 6fffc6fbb8c9fab9b61c3fe54894e85e116f30df
+# Parent  adc0e66cba9e0dd113853367ea12ae4a2ed3583d
+bug 1255485 - Remove NSDISTMODE=copy from Makefiles. r=nalexander
+
+MozReview-Commit-ID: GJV2O6zvEx2
+
+diff --git a/browser/app/Makefile.in b/browser/app/Makefile.in
+--- a/browser/app/Makefile.in
++++ b/browser/app/Makefile.in
+@@ -12,20 +12,16 @@ AB_CD = en-US
+ ifndef MOZ_WINCONSOLE
+ ifneq (,$(MOZ_DEBUG)$(MOZ_ASAN))
+ MOZ_WINCONSOLE = 1
+ else
+ MOZ_WINCONSOLE = 0
+ endif
+ endif
+ 
+-# This switches $(INSTALL) to copy mode, like $(SYSINSTALL), so things that
+-# shouldn't get 755 perms need $(IFLAGS1) for either way of calling nsinstall.
+-NSDISTMODE = copy
+-
+ include $(topsrcdir)/config/config.mk
+ 
+ # If we are trying to show an error dialog about the lack of SSE2 support,
+ # make sure that code itself doesn't use SSE2.
+ ifdef MOZ_LINUX_32_SSE2_STARTUP_ERROR
+ CXX := $(filter-out -march=% -msse -msse2 -mfpmath=sse,$(CXX))
+ CXX += -march=pentiumpro
+ endif
+diff --git a/ipc/app/Makefile.in b/ipc/app/Makefile.in
+--- a/ipc/app/Makefile.in
++++ b/ipc/app/Makefile.in
+@@ -5,20 +5,16 @@
+ ifndef MOZ_WINCONSOLE
+ ifdef MOZ_DEBUG
+ MOZ_WINCONSOLE = 1
+ else
+ MOZ_WINCONSOLE = 0
+ endif
+ endif
+ 
+-# This switches $(INSTALL) to copy mode, like $(SYSINSTALL), so things that
+-# shouldn't get 755 perms need $(IFLAGS1) for either way of calling nsinstall.
+-NSDISTMODE = copy
+-
+ include $(topsrcdir)/config/config.mk
+ 
+ include $(topsrcdir)/config/rules.mk
+ 
+ ifneq ($(MOZ_WIDGET_TOOLKIT),android)
+ #LIBS += ../contentproc/$(LIB_PREFIX)plugin-container.$(LIB_SUFFIX)
+ endif
+ 
+diff --git a/ipc/ipdl/test/cxx/app/Makefile.in b/ipc/ipdl/test/cxx/app/Makefile.in
+deleted file mode 100644
+--- a/ipc/ipdl/test/cxx/app/Makefile.in
++++ /dev/null
+@@ -1,5 +0,0 @@
+-# 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/.
+-
+-NSDISTMODE = copy
+diff --git a/js/xpconnect/shell/Makefile.in b/js/xpconnect/shell/Makefile.in
+deleted file mode 100644
+--- a/js/xpconnect/shell/Makefile.in
++++ /dev/null
+@@ -1,6 +0,0 @@
+-#
+-# 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/.
+-
+-NSDISTMODE = copy

+ 31 - 0
rel-257/mozilla-esr60/patches/1255485-3-61a1.patch

@@ -0,0 +1,31 @@
+# HG changeset patch
+# User Ted Mielczarek <ted@mielczarek.org>
+# Date 1511382661 18000
+# Node ID 5888578c22f8dc006cfd6a405c9fc53b2df73b44
+# Parent  be723540f9d92976929304da57c3da2cb33780eb
+bug 1255485 - Remove NSDISTMODE=copy support from config.mk. r=nalexander
+
+MozReview-Commit-ID: L5Pe4NexbJD
+
+diff --git a/config/config.mk b/config/config.mk
+--- a/config/config.mk
++++ b/config/config.mk
+@@ -316,17 +316,17 @@ endif # WINNT
+ 
+ ifeq (,$(CROSS_COMPILE)$(filter-out WINNT, $(OS_ARCH)))
+ INSTALL = $(NSINSTALL) -t
+ 
+ else
+ 
+ # This isn't laid out as conditional directives so that NSDISTMODE can be
+ # target-specific.
+-INSTALL         = $(if $(filter copy, $(NSDISTMODE)), $(NSINSTALL) -t, $(if $(filter absolute_symlink, $(NSDISTMODE)), $(NSINSTALL) -L $(PWD), $(NSINSTALL) -R))
++INSTALL         = $(if $(filter absolute_symlink, $(NSDISTMODE)), $(NSINSTALL) -L $(PWD), $(NSINSTALL) -R)
+ 
+ endif # WINNT
+ 
+ # The default for install_cmd is simply INSTALL
+ install_cmd ?= $(INSTALL) $(1)
+ 
+ # Use nsinstall in copy mode to install files on the system
+ SYSINSTALL	= $(NSINSTALL) -t

+ 38 - 0
rel-257/mozilla-esr60/patches/1255485-4-61a1.patch

@@ -0,0 +1,38 @@
+# HG changeset patch
+# User Ted Mielczarek <ted@mielczarek.org>
+# Date 1511791411 18000
+# Node ID 465358fef0d2f6074595d70918d5393bbbbd77d9
+# Parent  748610a122ba51bb44544eacb95bc14d6b8365d0
+bug 1255485 - force import libraries to be generated in objdir, not dist/bin. r=chmanchester
+
+The MSVC linker winds up generating import libraries when linking some of
+our executables, presumably because they contain functions that are
+__declspec(dllexport). By default the import libraries get written
+alongside the exe, so we force them to be written to the objdir so they don't
+clutter up dist/bin.
+
+MozReview-Commit-ID: 7DTfCo3OdDQ
+
+diff --git a/config/rules.mk b/config/rules.mk
+--- a/config/rules.mk
++++ b/config/rules.mk
+@@ -566,17 +566,18 @@ endif
+ #
+ # PROGRAM = Foo
+ # creates OBJS, links with LIBS to create Foo
+ #
+ $(PROGRAM): $(PROGOBJS) $(STATIC_LIBS_DEPS) $(EXTRA_DEPS) $(RESFILE) $(GLOBAL_DEPS) $(call mkdir_deps,$(FINAL_TARGET))
+ 	$(REPORT_BUILD)
+ 	@$(RM) $@.manifest
+ ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
+-	$(EXPAND_LINK) -NOLOGO -OUT:$(call LINKER_OUT,$@) -PDB:$(LINK_PDBFILE) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(MOZ_PROGRAM_LDFLAGS) $(PROGOBJS) $(RESFILE) $(STATIC_LIBS) $(SHARED_LIBS) $(OS_LIBS)
++	$(EXPAND_LINK) -NOLOGO -OUT:$(call LINKER_OUT,$@) -PDB:$(LINK_PDBFILE) -IMPLIB:$(basename $(@F)).lib $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(MOZ_PROGRAM_LDFLAGS) $(PROGOBJS) $(RESFILE) $(STATIC_LIBS) $(SHARED_LIBS) $(OS_LIBS)
++
+ ifdef MSMANIFEST_TOOL
+ 	@if test -f $@.manifest; then \
+ 		if test -f '$(srcdir)/$@.manifest'; then \
+ 			echo 'Embedding manifest from $(srcdir)/$@.manifest and $@.manifest'; \
+ 			$(MT) -NOLOGO -MANIFEST '$(win_srcdir)/$@.manifest' $@.manifest -OUTPUTRESOURCE:$@\;1; \
+ 		else \
+ 			echo 'Embedding manifest from $@.manifest'; \
+ 			$(MT) -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \

+ 224 - 0
rel-257/mozilla-esr60/patches/1255485-5-61a1.patch

@@ -0,0 +1,224 @@
+# HG changeset patch
+# User Ted Mielczarek <ted@mielczarek.org>
+# Date 1516205959 18000
+# Node ID 02e71426ed3e13eecc04ba8184c18b398dca3f67
+# Parent  c1d6bc7887c3d0311ec0e8b3a1de1856188e23fe
+bug 1255485 - add some tests for building programs in dist/bin. r=nalexander
+
+MozReview-Commit-ID: 94uOsInnWmT
+
+diff --git a/python/mozbuild/mozbuild/test/backend/common.py b/python/mozbuild/mozbuild/test/backend/common.py
+--- a/python/mozbuild/mozbuild/test/backend/common.py
++++ b/python/mozbuild/mozbuild/test/backend/common.py
+@@ -192,16 +192,24 @@ CONFIGS = defaultdict(lambda: {
+         'defines': {},
+         'non_global_defines': [],
+         'substs': {
+             'COMPILE_ENVIRONMENT': '1',
+             'LIB_SUFFIX': '.a',
+             'BIN_SUFFIX': '',
+         },
+     },
++    'program-paths': {
++        'defines': {},
++        'non_global_defines': [],
++        'substs': {
++            'COMPILE_ENVIRONMENT': '1',
++            'BIN_SUFFIX': '.prog',
++        },
++    },
+ })
+ 
+ 
+ class BackendTester(unittest.TestCase):
+     def setUp(self):
+         self._old_env = dict(os.environ)
+         os.environ.pop('MOZ_OBJDIR', None)
+ 
+diff --git a/python/mozbuild/mozbuild/test/backend/data/program-paths/dist-bin/moz.build b/python/mozbuild/mozbuild/test/backend/data/program-paths/dist-bin/moz.build
+new file mode 100644
+--- /dev/null
++++ b/python/mozbuild/mozbuild/test/backend/data/program-paths/dist-bin/moz.build
+@@ -0,0 +1,4 @@
++# Any copyright is dedicated to the Public Domain.
++# http://creativecommons.org/publicdomain/zero/1.0/
++
++Program('dist-bin')
+\ No newline at end of file
+diff --git a/python/mozbuild/mozbuild/test/backend/data/program-paths/dist-subdir/moz.build b/python/mozbuild/mozbuild/test/backend/data/program-paths/dist-subdir/moz.build
+new file mode 100644
+--- /dev/null
++++ b/python/mozbuild/mozbuild/test/backend/data/program-paths/dist-subdir/moz.build
+@@ -0,0 +1,5 @@
++# Any copyright is dedicated to the Public Domain.
++# http://creativecommons.org/publicdomain/zero/1.0/
++
++DIST_SUBDIR = 'foo'
++Program('dist-subdir')
+\ No newline at end of file
+diff --git a/python/mozbuild/mozbuild/test/backend/data/program-paths/final-target/moz.build b/python/mozbuild/mozbuild/test/backend/data/program-paths/final-target/moz.build
+new file mode 100644
+--- /dev/null
++++ b/python/mozbuild/mozbuild/test/backend/data/program-paths/final-target/moz.build
+@@ -0,0 +1,5 @@
++# Any copyright is dedicated to the Public Domain.
++# http://creativecommons.org/publicdomain/zero/1.0/
++
++FINAL_TARGET = 'final/target'
++Program('final-target')
+diff --git a/python/mozbuild/mozbuild/test/backend/data/program-paths/moz.build b/python/mozbuild/mozbuild/test/backend/data/program-paths/moz.build
+new file mode 100644
+--- /dev/null
++++ b/python/mozbuild/mozbuild/test/backend/data/program-paths/moz.build
+@@ -0,0 +1,13 @@
++# Any copyright is dedicated to the Public Domain.
++# http://creativecommons.org/publicdomain/zero/1.0/
++
++@template
++def Program(name):
++    PROGRAM = name
++
++DIRS += [
++    'dist-bin',
++    'dist-subdir',
++    'final-target',
++    'not-installed',
++]
+diff --git a/python/mozbuild/mozbuild/test/backend/data/program-paths/not-installed/moz.build b/python/mozbuild/mozbuild/test/backend/data/program-paths/not-installed/moz.build
+new file mode 100644
+--- /dev/null
++++ b/python/mozbuild/mozbuild/test/backend/data/program-paths/not-installed/moz.build
+@@ -0,0 +1,5 @@
++# Any copyright is dedicated to the Public Domain.
++# http://creativecommons.org/publicdomain/zero/1.0/
++
++DIST_INSTALL = False
++Program('not-installed')
+\ No newline at end of file
+diff --git a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
+--- a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
++++ b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
+@@ -1021,11 +1021,30 @@ class TestRecursiveMakeBackend(BackendTe
+         # Only mochitest.js should be in the install manifest.
+         self.assertTrue('testing/mochitest/tests/mochitest.js' in m)
+ 
+         # The path is odd here because we do not normalize at test manifest
+         # processing time.  This is a fragile test because there's currently no
+         # way to iterate the manifest.
+         self.assertFalse('instrumentation/./not_packaged.java' in m)
+ 
++    def test_program_paths(self):
++        """PROGRAMs with various moz.build settings that change the destination should produce
++        the expected paths in backend.mk."""
++        env = self._consume('program-paths', RecursiveMakeBackend)
++
++        expected = [
++            ('dist-bin', '$(DEPTH)/dist/bin/dist-bin.prog'),
++            ('dist-subdir', '$(DEPTH)/dist/bin/foo/dist-subdir.prog'),
++            ('final-target', '$(DEPTH)/final/target/final-target.prog'),
++            ('not-installed', 'not-installed.prog'),
++        ]
++        prefix = 'PROGRAM = '
++        for (subdir, expected_program) in expected:
++            with open(os.path.join(env.topobjdir, subdir, 'backend.mk'), 'rb') as fh:
++                lines = fh.readlines()
++                program = [line.rstrip().split(prefix, 1)[1] for line in lines
++                           if line.startswith(prefix)][0]
++                self.assertEqual(program, expected_program)
++
+ 
+ if __name__ == '__main__':
+     main()
+diff --git a/python/mozbuild/mozbuild/test/frontend/data/program-paths/dist-bin/moz.build b/python/mozbuild/mozbuild/test/frontend/data/program-paths/dist-bin/moz.build
+new file mode 100644
+--- /dev/null
++++ b/python/mozbuild/mozbuild/test/frontend/data/program-paths/dist-bin/moz.build
+@@ -0,0 +1,4 @@
++# Any copyright is dedicated to the Public Domain.
++# http://creativecommons.org/publicdomain/zero/1.0/
++
++Program('dist-bin')
+\ No newline at end of file
+diff --git a/python/mozbuild/mozbuild/test/frontend/data/program-paths/dist-subdir/moz.build b/python/mozbuild/mozbuild/test/frontend/data/program-paths/dist-subdir/moz.build
+new file mode 100644
+--- /dev/null
++++ b/python/mozbuild/mozbuild/test/frontend/data/program-paths/dist-subdir/moz.build
+@@ -0,0 +1,5 @@
++# Any copyright is dedicated to the Public Domain.
++# http://creativecommons.org/publicdomain/zero/1.0/
++
++DIST_SUBDIR = 'foo'
++Program('dist-subdir')
+\ No newline at end of file
+diff --git a/python/mozbuild/mozbuild/test/frontend/data/program-paths/final-target/moz.build b/python/mozbuild/mozbuild/test/frontend/data/program-paths/final-target/moz.build
+new file mode 100644
+--- /dev/null
++++ b/python/mozbuild/mozbuild/test/frontend/data/program-paths/final-target/moz.build
+@@ -0,0 +1,5 @@
++# Any copyright is dedicated to the Public Domain.
++# http://creativecommons.org/publicdomain/zero/1.0/
++
++FINAL_TARGET = 'final/target'
++Program('final-target')
+diff --git a/python/mozbuild/mozbuild/test/frontend/data/program-paths/moz.build b/python/mozbuild/mozbuild/test/frontend/data/program-paths/moz.build
+new file mode 100644
+--- /dev/null
++++ b/python/mozbuild/mozbuild/test/frontend/data/program-paths/moz.build
+@@ -0,0 +1,13 @@
++# Any copyright is dedicated to the Public Domain.
++# http://creativecommons.org/publicdomain/zero/1.0/
++
++@template
++def Program(name):
++    PROGRAM = name
++
++DIRS += [
++    'dist-bin',
++    'dist-subdir',
++    'final-target',
++    'not-installed',
++]
+diff --git a/python/mozbuild/mozbuild/test/frontend/data/program-paths/not-installed/moz.build b/python/mozbuild/mozbuild/test/frontend/data/program-paths/not-installed/moz.build
+new file mode 100644
+--- /dev/null
++++ b/python/mozbuild/mozbuild/test/frontend/data/program-paths/not-installed/moz.build
+@@ -0,0 +1,5 @@
++# Any copyright is dedicated to the Public Domain.
++# http://creativecommons.org/publicdomain/zero/1.0/
++
++DIST_INSTALL = False
++Program('not-installed')
+\ No newline at end of file
+diff --git a/python/mozbuild/mozbuild/test/frontend/test_emitter.py b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
+--- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py
++++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
+@@ -658,16 +658,29 @@ class TestEmitterBasic(unittest.TestCase
+                          [mozpath.join(reader.config.topobjdir,
+                                        'test_program1.%s' %
+                                        reader.config.substs['OBJ_SUFFIX'])])
+         self.assertEqual(objs[5].objs,
+                          [mozpath.join(reader.config.topobjdir,
+                                        'test_program2.%s' %
+                                        reader.config.substs['OBJ_SUFFIX'])])
+ 
++    def test_program_paths(self):
++        """Various moz.build settings that change the destination of PROGRAM should be
++        accurately reflected in Program.output_path."""
++        reader = self.reader('program-paths')
++        objs = self.read_topsrcdir(reader)
++        prog_paths = [o.output_path for o in objs if isinstance(o, Program)]
++        self.assertEqual(prog_paths, [
++            '!/dist/bin/dist-bin.prog',
++            '!/dist/bin/foo/dist-subdir.prog',
++            '!/final/target/final-target.prog',
++            '!not-installed.prog',
++        ])
++
+     def test_test_manifest_missing_manifest(self):
+         """A missing manifest file should result in an error."""
+         reader = self.reader('test-manifest-missing-manifest')
+ 
+         with self.assertRaisesRegexp(BuildReaderError, 'IOError: Missing files'):
+             self.read_topsrcdir(reader)
+ 
+     def test_empty_test_manifest_rejected(self):

+ 45 - 0
rel-257/mozilla-esr60/patches/1255485-6-61a1.patch

@@ -0,0 +1,45 @@
+# HG changeset patch
+# User Chris Manchester <cmanchester@mozilla.com>
+# Date 1521493652 25200
+# Node ID 7862033a42ab4689c373b64bd363db081ffaee0d
+# Parent  b742821457c98bb767cd5b3bbfd155f274569521
+Bug 1255485 - Don't assume target path is srcdir relative when locating a program's manifest on windows. r=ted
+
+MozReview-Commit-ID: L5BVxWGtpeN
+
+diff --git a/config/rules.mk b/config/rules.mk
+--- a/config/rules.mk
++++ b/config/rules.mk
+@@ -570,26 +570,26 @@ endif
+ $(PROGRAM): $(PROGOBJS) $(STATIC_LIBS_DEPS) $(EXTRA_DEPS) $(RESFILE) $(GLOBAL_DEPS) $(call mkdir_deps,$(FINAL_TARGET))
+ 	$(REPORT_BUILD)
+ 	@$(RM) $@.manifest
+ ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
+ 	$(EXPAND_LINK) -NOLOGO -OUT:$(call LINKER_OUT,$@) -PDB:$(LINK_PDBFILE) -IMPLIB:$(basename $(@F)).lib $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(MOZ_PROGRAM_LDFLAGS) $(PROGOBJS) $(RESFILE) $(STATIC_LIBS) $(SHARED_LIBS) $(OS_LIBS)
+ 
+ ifdef MSMANIFEST_TOOL
+ 	@if test -f $@.manifest; then \
+-		if test -f '$(srcdir)/$@.manifest'; then \
+-			echo 'Embedding manifest from $(srcdir)/$@.manifest and $@.manifest'; \
+-			$(MT) -NOLOGO -MANIFEST '$(win_srcdir)/$@.manifest' $@.manifest -OUTPUTRESOURCE:$@\;1; \
++		if test -f '$(srcdir)/$(notdir $@).manifest'; then \
++			echo 'Embedding manifest from $(srcdir)/$(notdir $@).manifest and $@.manifest'; \
++			$(MT) -NOLOGO -MANIFEST '$(win_srcdir)/$(notdir $@).manifest' $@.manifest -OUTPUTRESOURCE:$@\;1; \
+ 		else \
+ 			echo 'Embedding manifest from $@.manifest'; \
+ 			$(MT) -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \
+ 		fi; \
+-	elif test -f '$(srcdir)/$@.manifest'; then \
+-		echo 'Embedding manifest from $(srcdir)/$@.manifest'; \
+-		$(MT) -NOLOGO -MANIFEST '$(win_srcdir)/$@.manifest' -OUTPUTRESOURCE:$@\;1; \
++	elif test -f '$(srcdir)/$(notdir $@).manifest'; then \
++		echo 'Embedding manifest from $(srcdir)/$(notdir $@).manifest'; \
++		$(MT) -NOLOGO -MANIFEST '$(win_srcdir)/$(notdir $@).manifest' -OUTPUTRESOURCE:$@\;1; \
+ 	fi
+ endif	# MSVC with manifest tool
+ ifdef MOZ_PROFILE_GENERATE
+ # touch it a few seconds into the future to work around FAT's
+ # 2-second granularity
+ 	touch -t `date +%Y%m%d%H%M.%S -d 'now+5seconds'` pgo.relink
+ endif
+ else # !WINNT || GNU_CC

+ 2 - 2
rel-257/mozilla-esr60/patches/1372381-3-61a1.patch

@@ -2,7 +2,7 @@
 # User Chris Manchester <cmanchester@mozilla.com>
 # Date 1525111844 25200
 # Node ID 539a4a607ef98975ae0cde61c793723a6b1e19c5
-# Parent  4c0bf9cb831bcfdc520c138996420ebde3b594c4
+# Parent  f6962675bb16129403f2b24b6f8f32eccd033bd9
 Bug 1372381 - Compile host libraries, host programs, and simple programs in the Tup backend. r=mshal
 
 MozReview-Commit-ID: 2AcpqiOqSSf
@@ -356,7 +356,7 @@ diff --git a/python/mozbuild/mozbuild/backend/tup.py b/python/mozbuild/mozbuild/
 diff --git a/python/mozbuild/mozbuild/frontend/data.py b/python/mozbuild/mozbuild/frontend/data.py
 --- a/python/mozbuild/mozbuild/frontend/data.py
 +++ b/python/mozbuild/mozbuild/frontend/data.py
-@@ -516,16 +516,24 @@ class SimpleProgram(BaseProgram):
+@@ -528,16 +528,24 @@ class SimpleProgram(BaseProgram):
  
  
  class HostSimpleProgram(HostMixin, BaseProgram):

+ 2 - 2
rel-257/mozilla-esr60/patches/1397263-5-64a1.patch

@@ -2,7 +2,7 @@
 # User Nathan Froyd <froydnj@mozilla.com>
 # Date 1538612969 14400
 # Node ID 237dbec378d81d707afbf97e1818fea97c972844
-# Parent  3c6e70777b996db8f24ec0b2b07e05ad73122e9c
+# Parent  606ff2b449f30e8bdb869d0a65df8df1663afcfc
 Bug 1397263 - move ASOUTOPTION to moz.configure; r=mshal
 
 diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure
@@ -66,7 +66,7 @@ diff --git a/config/rules.mk b/config/rules.mk
 diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozbuild/frontend/emitter.py
 --- a/python/mozbuild/mozbuild/frontend/emitter.py
 +++ b/python/mozbuild/mozbuild/frontend/emitter.py
-@@ -1293,16 +1293,17 @@ class TreeMetadataEmitter(LoggingMixin):
+@@ -1294,16 +1294,17 @@ class TreeMetadataEmitter(LoggingMixin):
                                          context.get('ASFLAGS'))
  
          if context.get('USE_YASM') is True:

+ 8 - 8
rel-257/mozilla-esr60/patches/1429875-1-61a1.patch

@@ -2,7 +2,7 @@
 # User Chris Manchester <cmanchester@mozilla.com>
 # Date 1521588665 25200
 # Node ID 36f505b0e0da72cbcd109ec7eeb2fb449f6da927
-# Parent  16485dd5b222edabfd7a86d4a1cc3e2ea2efa8b1
+# Parent  2294c711e2cbca1c3c2eaae5c3e1199794694034
 Bug 1429875 - Add a "name" property to Library and Program objects that corresponds to the output basename. r=glandium
 
 MozReview-Commit-ID: J4gt1fGUzOa
@@ -10,11 +10,11 @@ MozReview-Commit-ID: J4gt1fGUzOa
 diff --git a/python/mozbuild/mozbuild/frontend/data.py b/python/mozbuild/mozbuild/frontend/data.py
 --- a/python/mozbuild/mozbuild/frontend/data.py
 +++ b/python/mozbuild/mozbuild/frontend/data.py
-@@ -470,16 +470,19 @@ class BaseProgram(Linkable):
-         if not program.endswith(bin_suffix):
-             program += bin_suffix
-         self.program = program
-         self.is_unit_test = is_unit_test
+@@ -482,16 +482,19 @@ class BaseProgram(Linkable):
+         if self.installed:
+             return ObjDirPath(self._context, '!/' + mozpath.join(self.install_target, self.program))
+         else:
+             return ObjDirPath(self._context, '!' + self.program)
  
      def __repr__(self):
          return '<%s: %s/%s>' % (type(self).__name__, self.relobjdir, self.program)
@@ -30,7 +30,7 @@ diff --git a/python/mozbuild/mozbuild/frontend/data.py b/python/mozbuild/mozbuil
  
  
  class HostProgram(HostMixin, BaseProgram):
-@@ -584,16 +587,20 @@ class BaseLibrary(Linkable):
+@@ -596,16 +599,20 @@ class BaseLibrary(Linkable):
              )
              self.import_name = self.lib_name
  
@@ -75,7 +75,7 @@ diff --git a/python/mozbuild/mozbuild/test/frontend/test_emitter.py b/python/moz
                           [mozpath.join(reader.config.topobjdir,
                                         'test_program2.%s' %
                                         reader.config.substs['OBJ_SUFFIX'])])
-@@ -1163,19 +1167,25 @@ class TestEmitterBasic(unittest.TestCase
+@@ -1176,19 +1180,25 @@ class TestEmitterBasic(unittest.TestCase
  
      def test_linkables_cxx_link(self):
          """Test that linkables transitively set cxx_link properly."""

+ 1 - 1
rel-257/mozilla-esr60/patches/1429875-2-61a1.patch

@@ -2,7 +2,7 @@
 # User Chris Manchester <cmanchester@mozilla.com>
 # Date 1521588665 25200
 # Node ID 4cdc60a9f06ee184973d888f7013a4ab30fe4e99
-# Parent  aff558e26f4e9a6152cbdff745407bc9c91f849c
+# Parent  d56542ab61fe486d03ca5b0faee11173351e631c
 Bug 1429875 - Do not take DIST_INSTALL into account when deciding to build static libraries. r=glandium
 
 Now that we're no longer shipping the SDK we no longer need real libraries for

+ 4 - 4
rel-257/mozilla-esr60/patches/1429875-3-61a1.patch

@@ -2,7 +2,7 @@
 # User Chris Manchester <cmanchester@mozilla.com>
 # Date 1521588665 25200
 # Node ID decbe4a4cdc77b610f7b9bae8622dbfcd00f2694
-# Parent  58b5ccfbef2a6e87add725909625a0bdbc8a7ac9
+# Parent  a85771c6ff58c57782962c99a57b9a688306e209
 Bug 1429875 - Add a unit test for linkage variables in the make backend. r=glandium
 
 MozReview-Commit-ID: HREobMhWTwg
@@ -10,13 +10,13 @@ MozReview-Commit-ID: HREobMhWTwg
 diff --git a/python/mozbuild/mozbuild/test/backend/common.py b/python/mozbuild/mozbuild/test/backend/common.py
 --- a/python/mozbuild/mozbuild/test/backend/common.py
 +++ b/python/mozbuild/mozbuild/test/backend/common.py
-@@ -192,16 +192,27 @@ CONFIGS = defaultdict(lambda: {
+@@ -200,16 +200,27 @@ CONFIGS = defaultdict(lambda: {
+     'program-paths': {
          'defines': {},
          'non_global_defines': [],
          'substs': {
              'COMPILE_ENVIRONMENT': '1',
-             'LIB_SUFFIX': '.a',
-             'BIN_SUFFIX': '',
+             'BIN_SUFFIX': '.prog',
          },
      },
 +    'linkage': {

+ 11 - 10
rel-257/mozilla-esr60/patches/1429875-4-61a1.patch

@@ -2,7 +2,7 @@
 # User Chris Manchester <cmanchester@mozilla.com>
 # Date 1521588665 25200
 # Node ID 7547d66e0f518d20f61b492eac027d5a34ac6fb4
-# Parent  7c6a1aeeb4dfc8fa4ab38927c17cead8d5f39988
+# Parent  69a2fcd14b36bab49849d2f63507b8ad7e0b0a7c
 Bug 1429875 - Remove expandlibs and instead generate list files in the mozbuild backend. r=glandium
 
 MozReview-Commit-ID: 5eLwnh1HHGj
@@ -713,7 +713,7 @@ diff --git a/config/rules.mk b/config/rules.mk
  ##############################################
  ifneq (1,$(NO_PROFILE_GUIDED_OPTIMIZE))
  ifdef MOZ_PROFILE_USE
-@@ -533,35 +535,35 @@ distclean::
+@@ -533,36 +535,35 @@ distclean::
  	$(wildcard *.$(LIB_SUFFIX)) $(wildcard *$(DLL_SUFFIX)) \
  	$(wildcard *.$(IMPORT_LIB_SUFFIX))
  
@@ -737,22 +737,23 @@ diff --git a/config/rules.mk b/config/rules.mk
  # PROGRAM = Foo
  # creates OBJS, links with LIBS to create Foo
  #
--$(PROGRAM): $(PROGOBJS) $(STATIC_LIBS_DEPS) $(EXTRA_DEPS) $(RESFILE) $(GLOBAL_DEPS)
-+$(PROGRAM): $(PROGOBJS) $(STATIC_LIBS) $(EXTRA_DEPS) $(RESFILE) $(GLOBAL_DEPS)
+-$(PROGRAM): $(PROGOBJS) $(STATIC_LIBS_DEPS) $(EXTRA_DEPS) $(RESFILE) $(GLOBAL_DEPS) $(call mkdir_deps,$(FINAL_TARGET))
++$(PROGRAM): $(PROGOBJS) $(STATIC_LIBS) $(EXTRA_DEPS) $(RESFILE) $(GLOBAL_DEPS) $(call mkdir_deps,$(FINAL_TARGET))
  	$(REPORT_BUILD)
  	@$(RM) $@.manifest
  ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
--	$(EXPAND_LINK) -NOLOGO -OUT:$(call LINKER_OUT,$@) -PDB:$(LINK_PDBFILE) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(MOZ_PROGRAM_LDFLAGS) $(PROGOBJS) $(RESFILE) $(STATIC_LIBS) $(SHARED_LIBS) $(OS_LIBS)
+-	$(EXPAND_LINK) -NOLOGO -OUT:$(call LINKER_OUT,$@) -PDB:$(LINK_PDBFILE) -IMPLIB:$(basename $(@F)).lib $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(MOZ_PROGRAM_LDFLAGS) $(PROGOBJS) $(RESFILE) $(STATIC_LIBS) $(SHARED_LIBS) $(OS_LIBS)
+-
 +	$(LINKER) -NOLOGO -OUT:$(call LINKER_OUT,$@) -PDB:$(LINK_PDBFILE) -IMPLIB:$(basename $(@F)).lib $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(MOZ_PROGRAM_LDFLAGS) $($(notdir $@)_OBJS) $(RESFILE) $(STATIC_LIBS) $(SHARED_LIBS) $(OS_LIBS)
  ifdef MSMANIFEST_TOOL
  	@if test -f $@.manifest; then \
- 		if test -f '$(srcdir)/$@.manifest'; then \
- 			echo 'Embedding manifest from $(srcdir)/$@.manifest and $@.manifest'; \
- 			$(MT) -NOLOGO -MANIFEST '$(win_srcdir)/$@.manifest' $@.manifest -OUTPUTRESOURCE:$@\;1; \
+ 		if test -f '$(srcdir)/$(notdir $@).manifest'; then \
+ 			echo 'Embedding manifest from $(srcdir)/$(notdir $@).manifest and $@.manifest'; \
+ 			$(MT) -NOLOGO -MANIFEST '$(win_srcdir)/$(notdir $@).manifest' $@.manifest -OUTPUTRESOURCE:$@\;1; \
  		else \
  			echo 'Embedding manifest from $@.manifest'; \
  			$(MT) -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \
-@@ -572,140 +574,133 @@ ifdef MSMANIFEST_TOOL
+@@ -573,140 +574,133 @@ ifdef MSMANIFEST_TOOL
  	fi
  endif	# MSVC with manifest tool
  ifdef MOZ_PROFILE_GENERATE
@@ -1621,7 +1622,7 @@ diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild
 diff --git a/python/mozbuild/mozbuild/test/backend/common.py b/python/mozbuild/mozbuild/test/backend/common.py
 --- a/python/mozbuild/mozbuild/test/backend/common.py
 +++ b/python/mozbuild/mozbuild/test/backend/common.py
-@@ -201,16 +201,17 @@ CONFIGS = defaultdict(lambda: {
+@@ -209,16 +209,17 @@ CONFIGS = defaultdict(lambda: {
          'defines': {},
          'non_global_defines': [],
          'substs': {

+ 8 - 8
rel-257/mozilla-esr60/patches/1429875-5-61a1.patch

@@ -2,7 +2,7 @@
 # User Chris Manchester <cmanchester@mozilla.com>
 # Date 1521589452 25200
 # Node ID cd90d8ccc5be982afb1bab0a2f2a649e10491817
-# Parent  163ba7d41603d79603f7f6a03b6cc21c246267d5
+# Parent  af91387c51716e6fbd3774083cce06a93328a606
 Bug 1429875 - Implement OBJ_SUFFIX overriding for the profile generation phase on linux in mozbuild. r=glandium
 
 MozReview-Commit-ID: 8PtgxfbxuE
@@ -48,7 +48,7 @@ diff --git a/config/rules.mk b/config/rules.mk
  # PROGRAM = Foo
  # creates OBJS, links with LIBS to create Foo
  #
- $(PROGRAM): $(PROGOBJS) $(STATIC_LIBS) $(EXTRA_DEPS) $(RESFILE) $(GLOBAL_DEPS)
+ $(PROGRAM): $(PROGOBJS) $(STATIC_LIBS) $(EXTRA_DEPS) $(RESFILE) $(GLOBAL_DEPS) $(call mkdir_deps,$(FINAL_TARGET))
  	$(REPORT_BUILD)
  	@$(RM) $@.manifest
  ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
@@ -56,9 +56,9 @@ diff --git a/config/rules.mk b/config/rules.mk
 +	$(LINKER) -NOLOGO -OUT:$(call LINKER_OUT,$@) -PDB:$(LINK_PDBFILE) -IMPLIB:$(basename $(@F)).lib $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(MOZ_PROGRAM_LDFLAGS) $($(notdir $@)_$(OBJS_VAR_SUFFIX)) $(RESFILE) $(STATIC_LIBS) $(SHARED_LIBS) $(OS_LIBS)
  ifdef MSMANIFEST_TOOL
  	@if test -f $@.manifest; then \
- 		if test -f '$(srcdir)/$@.manifest'; then \
- 			echo 'Embedding manifest from $(srcdir)/$@.manifest and $@.manifest'; \
- 			$(MT) -NOLOGO -MANIFEST '$(win_srcdir)/$@.manifest' $@.manifest -OUTPUTRESOURCE:$@\;1; \
+ 		if test -f '$(srcdir)/$(notdir $@).manifest'; then \
+ 			echo 'Embedding manifest from $(srcdir)/$(notdir $@).manifest and $@.manifest'; \
+ 			$(MT) -NOLOGO -MANIFEST '$(win_srcdir)/$(notdir $@).manifest' $@.manifest -OUTPUTRESOURCE:$@\;1; \
  		else \
  			echo 'Embedding manifest from $@.manifest'; \
  			$(MT) -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \
@@ -292,7 +292,7 @@ diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild
 diff --git a/python/mozbuild/mozbuild/frontend/data.py b/python/mozbuild/mozbuild/frontend/data.py
 --- a/python/mozbuild/mozbuild/frontend/data.py
 +++ b/python/mozbuild/mozbuild/frontend/data.py
-@@ -378,26 +378,30 @@ class LinkageMultipleRustLibrariesError(
+@@ -383,26 +383,30 @@ class LinkageMultipleRustLibrariesError(
  
  class Linkable(ContextDerived):
      """Generic context derived container object for programs and libraries"""
@@ -323,7 +323,7 @@ diff --git a/python/mozbuild/mozbuild/frontend/data.py b/python/mozbuild/mozbuil
          # Linking multiple Rust libraries into an object would result in
          # multiple copies of the Rust standard library, as well as linking
          # errors from duplicate symbols.
-@@ -427,26 +431,33 @@ class Linkable(ContextDerived):
+@@ -432,26 +436,33 @@ class Linkable(ContextDerived):
      def source_files(self):
          all_sources = []
          # This is ordered for reproducibility and consistently w/
@@ -363,7 +363,7 @@ diff --git a/python/mozbuild/mozbuild/frontend/data.py b/python/mozbuild/mozbuil
 diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozbuild/frontend/emitter.py
 --- a/python/mozbuild/mozbuild/frontend/emitter.py
 +++ b/python/mozbuild/mozbuild/frontend/emitter.py
-@@ -945,16 +945,20 @@ class TreeMetadataEmitter(LoggingMixin):
+@@ -946,16 +946,20 @@ class TreeMetadataEmitter(LoggingMixin):
                      ctxt_sources[variable][canonical_suffix] += sorted(srcs)
                      yield obj
  

+ 3 - 3
rel-257/mozilla-esr60/patches/1457524-1-61a1.patch

@@ -2,7 +2,7 @@
 # User Xidorn Quan <me@upsuper.org>
 # Date 1525225885 -36000
 # Node ID 619efecc323332781743562873290a894ee6bd29
-# Parent  acf54fd131992d757d122b00437653838a84a5ac
+# Parent  4eae86081a017bcf898fc742964968290dd096fc
 Bug 1457524 part 1 - Use a list for rust tests. r=froydnj
 
 MozReview-Commit-ID: 6A0hHClXDUE
@@ -165,7 +165,7 @@ diff --git a/python/mozbuild/mozbuild/frontend/context.py b/python/mozbuild/mozb
 diff --git a/python/mozbuild/mozbuild/frontend/data.py b/python/mozbuild/mozbuild/frontend/data.py
 --- a/python/mozbuild/mozbuild/frontend/data.py
 +++ b/python/mozbuild/mozbuild/frontend/data.py
-@@ -560,25 +560,25 @@ class RustProgram(BaseRustProgram):
+@@ -572,25 +572,25 @@ class RustProgram(BaseRustProgram):
  
  
  class HostRustProgram(BaseRustProgram):
@@ -217,7 +217,7 @@ diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozb
      TestManifest,
      UnifiedSources,
      VariablePassthru,
-@@ -1262,23 +1262,23 @@ class TreeMetadataEmitter(LoggingMixin):
+@@ -1263,23 +1263,23 @@ class TreeMetadataEmitter(LoggingMixin):
  
          for c in components:
              if c.endswith('.manifest'):

+ 1 - 1
rel-257/mozilla-esr60/patches/1457524-2-61a1.patch

@@ -2,7 +2,7 @@
 # User Xidorn Quan <me@upsuper.org>
 # Date 1525245205 -36000
 # Node ID e8616e9830d785506c79ed0280dc8486067c9d46
-# Parent  64fd09ce83eed7697114fb12eee971aba1de813a
+# Parent  0706b55eb372d53678271a9404fd177f1b3d0c19
 Bug 1457524 part 2 - Run all rust tests regardless of failures. r=froydnj
 
 MozReview-Commit-ID: K4ZhFOWd6gd

+ 1 - 1
rel-257/mozilla-esr60/patches/1458161-61a1.patch

@@ -2,7 +2,7 @@
 # User Mike Hommey <mh+mozilla@glandium.org>
 # Date 1525138203 -32400
 # Node ID b115bb8f62e31ceb53e9f5c30e0224da0a8c603b
-# Parent  818c0f8c207d035ae2a2443b00b8296a86dbf1e8
+# Parent  178c4b8e980e4e84ae928d1b89451ad48b11a0da
 Bug 1458161 - Hook rust OOM handler. r=froydnj
 
 OOM rust crashes are currently not identified as such in crash reports

+ 5 - 5
rel-257/mozilla-esr60/patches/1469091-63a1.patch

@@ -2,7 +2,7 @@
 # User Mike Hommey <mh+mozilla@glandium.org>
 # Date 1530770289 -32400
 # Node ID 531b966781e6b2c086a798b18cec231a26a9d3e5
-# Parent  44b9237f4c15de15f0e8282174113c39ddc59bca
+# Parent  693f90cc08d97f7a064b489d5d8738b93f4ae1c5
 Bug 1469091 - Build the clang plugin as a host shared library. r=ted
 
 This adds just enough host shared library support for this one use case,
@@ -529,7 +529,7 @@ diff --git a/python/mozbuild/mozbuild/frontend/context.py b/python/mozbuild/mozb
 diff --git a/python/mozbuild/mozbuild/frontend/data.py b/python/mozbuild/mozbuild/frontend/data.py
 --- a/python/mozbuild/mozbuild/frontend/data.py
 +++ b/python/mozbuild/mozbuild/frontend/data.py
-@@ -743,16 +743,32 @@ class SharedLibrary(Library):
+@@ -755,16 +755,32 @@ class SharedLibrary(Library):
                  self.symbols_file = '%s.def' % self.lib_name
              else:
                  self.symbols_file = '%s.symbols' % self.lib_name
@@ -562,7 +562,7 @@ diff --git a/python/mozbuild/mozbuild/frontend/data.py b/python/mozbuild/mozbuil
  class ExternalStaticLibrary(StaticLibrary, ExternalLibrary):
      """Context derived container for static libraries built by an external
      build system."""
-@@ -977,16 +993,23 @@ class GeneratedSources(BaseSources):
+@@ -989,16 +1005,23 @@ class GeneratedSources(BaseSources):
  
  class HostSources(HostMixin, BaseSources):
      """Represents files to be compiled for the host during the build."""
@@ -651,7 +651,7 @@ diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozb
  
          final_lib = context.get('FINAL_LIBRARY')
          if not libname and final_lib:
-@@ -852,19 +858,18 @@ class TreeMetadataEmitter(LoggingMixin):
+@@ -853,19 +859,18 @@ class TreeMetadataEmitter(LoggingMixin):
                      flags = context_srcs[f]
                      if flags:
                          all_flags[full_path] = flags
@@ -673,7 +673,7 @@ diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozb
          if no_pgo:
              if no_pgo_sources:
                  raise SandboxValidationError('NO_PGO and SOURCES[...].no_pgo '
-@@ -898,17 +903,17 @@ class TreeMetadataEmitter(LoggingMixin):
+@@ -899,17 +904,17 @@ class TreeMetadataEmitter(LoggingMixin):
          def canonical_suffix_for_file(f):
              return canonicalized_suffix_map[mozpath.splitext(f)[1]]
  

+ 5 - 5
comm-esr60/mozilla-esr60/patches/1512882-centos_bootstrap.patch → rel-257/mozilla-esr60/patches/1512882-centos_bootstrap.patch

@@ -1,13 +1,13 @@
 # HG changeset patch
 # User Ian Neal <iann_cvs@blueyonder.co.uk>
 # Date 1563199680 -7200
-# Parent  07f623c8d628d303fae71bcd7778574a13efa1eb
+# Parent  17a329ded85a7ff1ca759af513d92a61d4851940
 Bug 1512882 - CentOS 7 Bootstrap Fix. r=frg a=frg
 
 diff --git a/python/mozboot/mozboot/centosfedora.py b/python/mozboot/mozboot/centosfedora.py
 --- a/python/mozboot/mozboot/centosfedora.py
 +++ b/python/mozboot/mozboot/centosfedora.py
-@@ -8,17 +8,17 @@ from mozboot.base import BaseBootstrappe
+@@ -10,17 +10,17 @@ from mozboot.base import BaseBootstrappe
  from mozboot.linux_common import StyloInstall
  
  
@@ -25,8 +25,8 @@ diff --git a/python/mozboot/mozboot/centosfedora.py b/python/mozboot/mozboot/cen
          self.packages = [
              'autoconf213',
              'mercurial',
-             'which',
-@@ -47,28 +47,42 @@ class CentOSFedoraBootstrapper(StyloInst
+             'nodejs',
+@@ -50,28 +50,42 @@ class CentOSFedoraBootstrapper(StyloInst
              'java-1.8.0-openjdk-devel',
              # For downloading the Android SDK and NDK.
              'wget',
@@ -71,7 +71,7 @@ diff --git a/python/mozboot/mozboot/centosfedora.py b/python/mozboot/mozboot/cen
              self.packages += [
                  'python2-devel',
                  'redhat-rpm-config',
-@@ -95,17 +109,17 @@ class CentOSFedoraBootstrapper(StyloInst
+@@ -102,17 +116,17 @@ class CentOSFedoraBootstrapper(StyloInst
      def install_mobile_android_artifact_mode_packages(self):
          self.ensure_mobile_android_packages(artifact_mode=True)
  

+ 218 - 0
rel-257/mozilla-esr60/patches/1562388-1-72a1.patch

@@ -0,0 +1,218 @@
+# HG changeset patch
+# User Valentin Gosu <valentin.gosu@gmail.com>
+# Date 1573582701 0
+# Node ID 3b98d7dcb7066c220a0c378d83a103535d98d93b
+# Parent  31b6b03f03e695af5aacebce227242b72c550dfc
+Bug 1562388 - Remove XP legacy NotifyAddrChange call from nsNotifyAddrListener r=mayhemer
+
+Old code needed to dynamically load a DLL - which was not available
+for windows versions prior to Vista, and if that failed it would
+fall back to using an older API.
+
+This patch now calls the methods directly, since we don't have to
+worry about the library not being there; we also remove the
+fallback, meaning we always call NotifyIpInterfaceChange instead
+of falling back to NotifyAddrChange.
+
+Differential Revision: https://phabricator.services.mozilla.com/D52573
+
+diff --git a/netwerk/system/win32/nsNotifyAddrListener.cpp b/netwerk/system/win32/nsNotifyAddrListener.cpp
+--- a/netwerk/system/win32/nsNotifyAddrListener.cpp
++++ b/netwerk/system/win32/nsNotifyAddrListener.cpp
+@@ -43,45 +43,20 @@
+ using namespace mozilla;
+ 
+ static LazyLogModule gNotifyAddrLog("nsNotifyAddr");
+ #define LOG(args) MOZ_LOG(gNotifyAddrLog, mozilla::LogLevel::Debug, args)
+ 
+ static HMODULE sNetshell;
+ static decltype(NcFreeNetconProperties) *sNcFreeNetconProperties;
+ 
+-static HMODULE sIphlpapi;
+-static decltype(NotifyIpInterfaceChange) *sNotifyIpInterfaceChange;
+-static decltype(CancelMibChangeNotify2) *sCancelMibChangeNotify2;
+-
+-#define NETWORK_NOTIFY_CHANGED_PREF "network.notify.changed"
+-#define NETWORK_NOTIFY_IPV6_PREF "network.notify.IPv6"
+-
+ // period during which to absorb subsequent network change events, in
+ // milliseconds
+ static const unsigned int kNetworkChangeCoalescingPeriod = 1000;
+ 
+-static void InitIphlpapi(void) {
+-  if (!sIphlpapi) {
+-    sIphlpapi = LoadLibraryW(L"Iphlpapi.dll");
+-    if (sIphlpapi) {
+-      sNotifyIpInterfaceChange =
+-          (decltype(NotifyIpInterfaceChange) *)GetProcAddress(
+-              sIphlpapi, "NotifyIpInterfaceChange");
+-      sCancelMibChangeNotify2 =
+-          (decltype(CancelMibChangeNotify2) *)GetProcAddress(
+-              sIphlpapi, "CancelMibChangeNotify2");
+-    } else {
+-      NS_WARNING(
+-          "Failed to load Iphlpapi.dll - cannot detect network"
+-          " changes!");
+-    }
+-  }
+-}
+-
+ static void InitNetshellLibrary(void) {
+   if (!sNetshell) {
+     sNetshell = LoadLibraryW(L"Netshell.dll");
+     if (sNetshell) {
+       sNcFreeNetconProperties =
+           (decltype(NcFreeNetconProperties) *)GetProcAddress(
+               sNetshell, "NcFreeNetconProperties");
+     }
+@@ -89,40 +64,32 @@ static void InitNetshellLibrary(void) {
+ }
+ 
+ static void FreeDynamicLibraries(void) {
+   if (sNetshell) {
+     sNcFreeNetconProperties = nullptr;
+     FreeLibrary(sNetshell);
+     sNetshell = nullptr;
+   }
+-  if (sIphlpapi) {
+-    sNotifyIpInterfaceChange = nullptr;
+-    sCancelMibChangeNotify2 = nullptr;
+-    FreeLibrary(sIphlpapi);
+-    sIphlpapi = nullptr;
+-  }
+ }
+ 
+ NS_IMPL_ISUPPORTS(nsNotifyAddrListener, nsINetworkLinkService, nsIRunnable,
+                   nsIObserver)
+ 
+ nsNotifyAddrListener::nsNotifyAddrListener()
+     : mLinkUp(true)  // assume true by default
+       ,
+       mStatusKnown(false),
+       mCheckAttempted(false),
+       mCheckEvent(nullptr),
+       mShutdown(false),
+       mIPInterfaceChecksum(0),
+       mAllowChangedEvent(true),
+       mIPv6Changes(false),
+-      mCoalescingActive(false) {
+-  InitIphlpapi();
+-}
++      mCoalescingActive(false) {}
+ 
+ nsNotifyAddrListener::~nsNotifyAddrListener() {
+   NS_ASSERTION(!mThread, "nsNotifyAddrListener thread shutdown failed");
+   FreeDynamicLibraries();
+ }
+ 
+ NS_IMETHODIMP
+ nsNotifyAddrListener::GetIsLinkUp(bool *aIsUp) {
+@@ -312,70 +279,41 @@ nsNotifyAddrListener::nextCoalesceWaitTi
+ NS_IMETHODIMP
+ nsNotifyAddrListener::Run() {
+   mStartTime = TimeStamp::Now();
+ 
+   calculateNetworkId();
+ 
+   DWORD waitTime = INFINITE;
+ 
+-  if (!sNotifyIpInterfaceChange || !sCancelMibChangeNotify2 || !mIPv6Changes) {
+-    // For Windows versions which are older than Vista which lack
+-    // NotifyIpInterfaceChange. Note this means no IPv6 support.
+-    HANDLE ev = CreateEvent(nullptr, FALSE, FALSE, nullptr);
+-    NS_ENSURE_TRUE(ev, NS_ERROR_OUT_OF_MEMORY);
+-
+-    HANDLE handles[2] = {ev, mCheckEvent};
+-    OVERLAPPED overlapped = {0};
+-    bool shuttingDown = false;
++  // Windows Vista and newer versions.
++  HANDLE interfacechange;
++  // The callback will simply invoke CheckLinkStatus()
++  DWORD ret = NotifyIpInterfaceChange(
++      StaticPrefs::network_notify_IPv6() ? AF_UNSPEC
++                                         : AF_INET,  // IPv4 and IPv6
++      (PIPINTERFACE_CHANGE_CALLBACK)OnInterfaceChange,
++      this,   // pass to callback
++      false,  // no initial notification
++      &interfacechange);
+ 
+-    overlapped.hEvent = ev;
+-    while (!shuttingDown) {
+-      HANDLE h;
+-      DWORD ret = NotifyAddrChange(&h, &overlapped);
+-
+-      if (ret == ERROR_IO_PENDING) {
+-        ret = WaitForMultipleObjects(2, handles, FALSE, waitTime);
+-        if (ret == WAIT_OBJECT_0) {
+-          CheckLinkStatus();
+-        } else if (!mShutdown) {
+-          waitTime = nextCoalesceWaitTime();
+-        } else {
+-          shuttingDown = true;
+-        }
++  if (ret == NO_ERROR) {
++    do {
++      ret = WaitForSingleObject(mCheckEvent, waitTime);
++      if (!mShutdown) {
++        waitTime = nextCoalesceWaitTime();
+       } else {
+-        shuttingDown = true;
++        break;
+       }
+-    }
+-    CloseHandle(ev);
++    } while (ret != WAIT_FAILED);
++    CancelMibChangeNotify2(interfacechange);
+   } else {
+-    // Windows Vista and newer versions.
+-    HANDLE interfacechange;
+-    // The callback will simply invoke CheckLinkStatus()
+-    DWORD ret = sNotifyIpInterfaceChange(
+-        AF_UNSPEC,  // IPv4 and IPv6
+-        (PIPINTERFACE_CHANGE_CALLBACK)OnInterfaceChange,
+-        this,   // pass to callback
+-        false,  // no initial notification
+-        &interfacechange);
++    LOG(("Link Monitor: NotifyIpInterfaceChange returned %d\n", (int)ret));
++  }
+ 
+-    if (ret == NO_ERROR) {
+-      do {
+-        ret = WaitForSingleObject(mCheckEvent, waitTime);
+-        if (!mShutdown) {
+-          waitTime = nextCoalesceWaitTime();
+-        } else {
+-          break;
+-        }
+-      } while (ret != WAIT_FAILED);
+-      sCancelMibChangeNotify2(interfacechange);
+-    } else {
+-      LOG(("Link Monitor: sNotifyIpInterfaceChange returned %d\n", (int)ret));
+-    }
+-  }
+   return NS_OK;
+ }
+ 
+ NS_IMETHODIMP
+ nsNotifyAddrListener::Observe(nsISupports *subject, const char *topic,
+                               const char16_t *data) {
+   if (!strcmp("xpcom-shutdown-threads", topic)) Shutdown();
+ 
+@@ -491,17 +429,16 @@ bool nsNotifyAddrListener::CheckICSGatew
+ 
+   if (isGateway) isGateway = CheckICSStatus(aAdapter->FriendlyName);
+ 
+   return isGateway;
+ }
+ 
+ bool nsNotifyAddrListener::CheckICSStatus(PWCHAR aAdapterName) {
+   InitNetshellLibrary();
+-
+   // This method enumerates all privately shared connections and checks if some
+   // of them has the same name as the one provided in aAdapterName. If such
+   // connection is found in the collection the adapter is used as ICS gateway
+   bool isICSGatewayAdapter = false;
+ 
+   HRESULT hr;
+   RefPtr<INetSharingManager> netSharingManager;
+   hr = CoCreateInstance(CLSID_NetSharingManager, nullptr, CLSCTX_INPROC_SERVER,

+ 239 - 0
rel-257/mozilla-esr60/patches/1562388-2-72a1.patch

@@ -0,0 +1,239 @@
+# HG changeset patch
+# User Valentin Gosu <valentin.gosu@gmail.com>
+# Date 1573582908 0
+# Node ID 8171a4e575e2d06a6240ad67b72574ced6e57ca8
+# Parent  e9a8ba5731470471f8385466d0be366d9c59cec7
+Bug 1562388 - Remove legacy ICS handling from nsNotifyAddrListener r=mayhemer
+
+This code was added in bug 465158 to deal with on-demand dial-up
+connections. That scenario is hopefully not common anymore.
+One benefit of the code was that it excludes network adapters
+that share the computers network from being part of network
+change notifications, network ID, etc. However, the code assumed
+that only adapters with the address 192.168.0.1 would be a ICS
+adapter, but trying to set up ICS on Windows 10 actually set the
+LAN interface with 192.168.137.1 - so that assumption isn't
+valid anymore. So the code is likely not even running for
+adapters that are ICS. It may run for adapters which have the
+IP 192.168.0.1, but probably that's quite rare as that's more
+often a gateway IP than a client IP.
+
+In any case, it's better to just get rid of it and if needed,
+however unlikely, we'll replace it with a more modern API.
+
+Depends on D52573
+
+Differential Revision: https://phabricator.services.mozilla.com/D52574
+
+diff --git a/netwerk/system/win32/nsNotifyAddrListener.cpp b/netwerk/system/win32/nsNotifyAddrListener.cpp
+--- a/netwerk/system/win32/nsNotifyAddrListener.cpp
++++ b/netwerk/system/win32/nsNotifyAddrListener.cpp
+@@ -40,42 +40,20 @@
+ #include <iptypes.h>
+ #include <iphlpapi.h>
+ 
+ using namespace mozilla;
+ 
+ static LazyLogModule gNotifyAddrLog("nsNotifyAddr");
+ #define LOG(args) MOZ_LOG(gNotifyAddrLog, mozilla::LogLevel::Debug, args)
+ 
+-static HMODULE sNetshell;
+-static decltype(NcFreeNetconProperties) *sNcFreeNetconProperties;
+-
+ // period during which to absorb subsequent network change events, in
+ // milliseconds
+ static const unsigned int kNetworkChangeCoalescingPeriod = 1000;
+ 
+-static void InitNetshellLibrary(void) {
+-  if (!sNetshell) {
+-    sNetshell = LoadLibraryW(L"Netshell.dll");
+-    if (sNetshell) {
+-      sNcFreeNetconProperties =
+-          (decltype(NcFreeNetconProperties) *)GetProcAddress(
+-              sNetshell, "NcFreeNetconProperties");
+-    }
+-  }
+-}
+-
+-static void FreeDynamicLibraries(void) {
+-  if (sNetshell) {
+-    sNcFreeNetconProperties = nullptr;
+-    FreeLibrary(sNetshell);
+-    sNetshell = nullptr;
+-  }
+-}
+-
+ NS_IMPL_ISUPPORTS(nsNotifyAddrListener, nsINetworkLinkService, nsIRunnable,
+                   nsIObserver)
+ 
+ nsNotifyAddrListener::nsNotifyAddrListener()
+     : mLinkUp(true)  // assume true by default
+       ,
+       mStatusKnown(false),
+       mCheckAttempted(false),
+@@ -83,17 +61,16 @@ nsNotifyAddrListener::nsNotifyAddrListen
+       mShutdown(false),
+       mIPInterfaceChecksum(0),
+       mAllowChangedEvent(true),
+       mIPv6Changes(false),
+       mCoalescingActive(false) {}
+ 
+ nsNotifyAddrListener::~nsNotifyAddrListener() {
+   NS_ASSERTION(!mThread, "nsNotifyAddrListener thread shutdown failed");
+-  FreeDynamicLibraries();
+ }
+ 
+ NS_IMETHODIMP
+ nsNotifyAddrListener::GetIsLinkUp(bool *aIsUp) {
+   if (!mCheckAttempted && !mStatusKnown) {
+     mCheckAttempted = true;
+     CheckLinkStatus();
+   }
+@@ -406,103 +383,16 @@ nsNotifyAddrListener::ChangeEvent::Run()
+   nsCOMPtr<nsIObserverService> observerService =
+       mozilla::services::GetObserverService();
+   if (observerService)
+     observerService->NotifyObservers(mService, NS_NETWORK_LINK_TOPIC,
+                                      NS_ConvertASCIItoUTF16(mEventID).get());
+   return NS_OK;
+ }
+ 
+-// Bug 465158 features an explanation for this check. ICS being "Internet
+-// Connection Sharing). The description says it is always IP address
+-// 192.168.0.1 for this case.
+-bool nsNotifyAddrListener::CheckICSGateway(PIP_ADAPTER_ADDRESSES aAdapter) {
+-  if (!aAdapter->FirstUnicastAddress) return false;
+-
+-  LPSOCKADDR aAddress = aAdapter->FirstUnicastAddress->Address.lpSockaddr;
+-  if (!aAddress) return false;
+-
+-  PSOCKADDR_IN in_addr = (PSOCKADDR_IN)aAddress;
+-  bool isGateway = (aAddress->sa_family == AF_INET &&
+-                    in_addr->sin_addr.S_un.S_un_b.s_b1 == 192 &&
+-                    in_addr->sin_addr.S_un.S_un_b.s_b2 == 168 &&
+-                    in_addr->sin_addr.S_un.S_un_b.s_b3 == 0 &&
+-                    in_addr->sin_addr.S_un.S_un_b.s_b4 == 1);
+-
+-  if (isGateway) isGateway = CheckICSStatus(aAdapter->FriendlyName);
+-
+-  return isGateway;
+-}
+-
+-bool nsNotifyAddrListener::CheckICSStatus(PWCHAR aAdapterName) {
+-  InitNetshellLibrary();
+-  // This method enumerates all privately shared connections and checks if some
+-  // of them has the same name as the one provided in aAdapterName. If such
+-  // connection is found in the collection the adapter is used as ICS gateway
+-  bool isICSGatewayAdapter = false;
+-
+-  HRESULT hr;
+-  RefPtr<INetSharingManager> netSharingManager;
+-  hr = CoCreateInstance(CLSID_NetSharingManager, nullptr, CLSCTX_INPROC_SERVER,
+-                        IID_INetSharingManager,
+-                        getter_AddRefs(netSharingManager));
+-
+-  RefPtr<INetSharingPrivateConnectionCollection> privateCollection;
+-  if (SUCCEEDED(hr)) {
+-    hr = netSharingManager->get_EnumPrivateConnections(
+-        ICSSC_DEFAULT, getter_AddRefs(privateCollection));
+-  }
+-
+-  RefPtr<IEnumNetSharingPrivateConnection> privateEnum;
+-  if (SUCCEEDED(hr)) {
+-    RefPtr<IUnknown> privateEnumUnknown;
+-    hr = privateCollection->get__NewEnum(getter_AddRefs(privateEnumUnknown));
+-    if (SUCCEEDED(hr)) {
+-      hr = privateEnumUnknown->QueryInterface(
+-          IID_IEnumNetSharingPrivateConnection, getter_AddRefs(privateEnum));
+-    }
+-  }
+-
+-  if (SUCCEEDED(hr)) {
+-    ULONG fetched;
+-    VARIANT connectionVariant;
+-    while (!isICSGatewayAdapter &&
+-           SUCCEEDED(hr = privateEnum->Next(1, &connectionVariant, &fetched)) &&
+-           fetched) {
+-      if (connectionVariant.vt != VT_UNKNOWN) {
+-        // We should call VariantClear here but it needs to link
+-        // with oleaut32.lib that produces a Ts incrase about 10ms
+-        // that is undesired. As it is quit unlikely the result would
+-        // be of a different type anyway, let's pass the variant
+-        // unfreed here.
+-        NS_ERROR(
+-            "Variant of unexpected type, expecting VT_UNKNOWN, we probably "
+-            "leak it!");
+-        continue;
+-      }
+-
+-      RefPtr<INetConnection> connection;
+-      if (SUCCEEDED(connectionVariant.punkVal->QueryInterface(
+-              IID_INetConnection, getter_AddRefs(connection)))) {
+-        connectionVariant.punkVal->Release();
+-
+-        NETCON_PROPERTIES *properties;
+-        if (SUCCEEDED(connection->GetProperties(&properties))) {
+-          if (!wcscmp(properties->pszwName, aAdapterName))
+-            isICSGatewayAdapter = true;
+-
+-          if (sNcFreeNetconProperties) sNcFreeNetconProperties(properties);
+-        }
+-      }
+-    }
+-  }
+-
+-  return isICSGatewayAdapter;
+-}
+-
+ DWORD
+ nsNotifyAddrListener::CheckAdaptersAddresses(void) {
+   ULONG len = 16384;
+ 
+   PIP_ADAPTER_ADDRESSES adapterList = (PIP_ADAPTER_ADDRESSES)moz_xmalloc(len);
+ 
+   ULONG flags = GAA_FLAG_SKIP_DNS_SERVER | GAA_FLAG_SKIP_MULTICAST |
+                 GAA_FLAG_SKIP_ANYCAST;
+@@ -532,18 +422,17 @@ nsNotifyAddrListener::CheckAdaptersAddre
+   if (ret == ERROR_SUCCESS) {
+     bool linkUp = false;
+     ULONG sum = 0;
+ 
+     for (PIP_ADAPTER_ADDRESSES adapter = adapterList; adapter;
+          adapter = adapter->Next) {
+       if (adapter->OperStatus != IfOperStatusUp ||
+           !adapter->FirstUnicastAddress ||
+-          adapter->IfType == IF_TYPE_SOFTWARE_LOOPBACK ||
+-          CheckICSGateway(adapter)) {
++          adapter->IfType == IF_TYPE_SOFTWARE_LOOPBACK) {
+         continue;
+       }
+ 
+       sum <<= 2;
+       // Add chars from AdapterName to the checksum.
+       for (int i = 0; adapter->AdapterName[i]; ++i) {
+         sum += adapter->AdapterName[i];
+       }
+diff --git a/netwerk/system/win32/nsNotifyAddrListener.h b/netwerk/system/win32/nsNotifyAddrListener.h
+--- a/netwerk/system/win32/nsNotifyAddrListener.h
++++ b/netwerk/system/win32/nsNotifyAddrListener.h
+@@ -50,20 +50,16 @@ class nsNotifyAddrListener : public nsIN
+   bool mStatusKnown;
+   bool mCheckAttempted;
+ 
+   nsresult Shutdown(void);
+   nsresult SendEvent(const char *aEventID);
+ 
+   DWORD CheckAdaptersAddresses(void);
+ 
+-  // Checks for an Internet Connection Sharing (ICS) gateway.
+-  bool CheckICSGateway(PIP_ADAPTER_ADDRESSES aAdapter);
+-  bool CheckICSStatus(PWCHAR aAdapterName);
+-
+   nsCOMPtr<nsIThread> mThread;
+ 
+  private:
+   // Returns the new timeout period for coalescing (or INFINITE)
+   DWORD nextCoalesceWaitTime();
+ 
+   // Called for every detected network change
+   nsresult NetworkChanged();

+ 317 - 0
rel-257/mozilla-esr60/patches/1576755-71a1.patch

@@ -0,0 +1,317 @@
+# HG changeset patch
+# User Dana Keeler <dkeeler@mozilla.com>
+# Date 1567549154 0
+# Node ID d55c56bc0e576d753ce724593d439e79646d7e48
+# Parent  3edd753ff6a964443d86c9bd11f09490641838bc
+bug 1576755 - split "unknown" bucket in CERT_VALIDATION_SUCCESS_BY_CA (and other _BY_CA probes) r=jcj,kjacobs
+
+The "unknown" bucket is inconsistent and often much higher than we expect. This
+patch splits that bucket by adding the categories "from softoken (cert9.db)",
+"from an external PKCS#11 token", and "imported from the OS via the 'Enterprise
+Roots' feature". Hopefully this will give us more insight into this data.
+
+Differential Revision: https://phabricator.services.mozilla.com/D44065
+
+diff --git a/security/manager/ssl/PublicKeyPinningService.cpp b/security/manager/ssl/PublicKeyPinningService.cpp
+--- a/security/manager/ssl/PublicKeyPinningService.cpp
++++ b/security/manager/ssl/PublicKeyPinningService.cpp
+@@ -309,17 +309,18 @@ static nsresult CheckPinsForHostname(
+       return rv;
+     }
+ 
+     // Only log telemetry if the certificate list is non-empty.
+     if (rootCert && !enforceTestModeResult && pinningTelemetryInfo) {
+       UniqueCERTCertificate rootCertObj =
+           UniqueCERTCertificate(rootCert.get()->GetCert());
+       if (rootCertObj) {
+-        int32_t binNumber = RootCABinNumber(&rootCertObj->derCert);
++        int32_t binNumber =
++            RootCABinNumber(&rootCertObj->derCert, rootCertObj->slot);
+         if (binNumber != ROOT_CERTIFICATE_UNKNOWN) {
+           pinningTelemetryInfo->accumulateForRoot = true;
+           pinningTelemetryInfo->rootBucket = binNumber;
+         }
+       }
+     }
+ 
+     MOZ_LOG(gPublicKeyPinningLog, LogLevel::Debug,
+diff --git a/security/manager/ssl/RootCertificateTelemetryUtils.cpp b/security/manager/ssl/RootCertificateTelemetryUtils.cpp
+--- a/security/manager/ssl/RootCertificateTelemetryUtils.cpp
++++ b/security/manager/ssl/RootCertificateTelemetryUtils.cpp
+@@ -34,17 +34,21 @@ class BinaryHashSearchArrayComparator {
+   }
+ 
+  private:
+   const uint8_t* mTarget;
+ };
+ 
+ // Perform a hash of the provided cert, then search in the RootHashes.inc data
+ // structure for a matching bin number.
+-int32_t RootCABinNumber(const SECItem* cert) {
++// If no matching root is found, this may be a CA from the softoken (cert9.db),
++// it may be a CA from an external PKCS#11 token, or it may be a CA from OS
++// storage (Enterprise Root). The slot argument is used to attempt to determine
++// this. See also the constants in RootCertificateTelemetryUtils.h.
++int32_t RootCABinNumber(const SECItem* cert, PK11SlotInfo* slot) {
+   Digest digest;
+ 
+   // Compute SHA256 hash of the certificate
+   nsresult rv = digest.DigestBuf(SEC_OID_SHA256, cert->data, cert->len);
+   if (NS_WARN_IF(NS_FAILED(rv))) {
+     return ROOT_CERTIFICATE_HASH_FAILURE;
+   }
+ 
+@@ -62,25 +66,59 @@ int32_t RootCABinNumber(const SECItem* c
+               static_cast<uint8_t*>(digest.get().data), digest.get().len),
+           &idx)) {
+     MOZ_LOG(gPublicKeyPinningTelemetryLog, LogLevel::Debug,
+             ("pkpinTelem: Telemetry index was %zu, bin is %d\n", idx,
+              ROOT_TABLE[idx].binNumber));
+     return (int32_t)ROOT_TABLE[idx].binNumber;
+   }
+ 
+-  // Didn't match.
++  // Didn't match. It may be from the softoken, an external PKCS#11 token, or
++  // imported from the OS as an "Enterprise Root".
++  UniquePK11SlotInfo softokenSlot(PK11_GetInternalKeySlot());
++  if (!softokenSlot) {
++    return ROOT_CERTIFICATE_UNKNOWN;
++  }
++  if (slot == softokenSlot.get()) {
++    return ROOT_CERTIFICATE_SOFTOKEN;
++  }
++  UniquePK11SlotInfo nssInternalSlot(PK11_GetInternalSlot());
++  UniqueSECMODModule rootsModule(SECMOD_FindModule(kRootModuleName));
++  if (!rootsModule || rootsModule->slotCount != 1) {
++    return ROOT_CERTIFICATE_UNKNOWN;
++  }
++  if (slot && slot != nssInternalSlot.get() && slot != rootsModule->slots[0]) {
++    return ROOT_CERTIFICATE_EXTERNAL_TOKEN;
++  }
++  nsCOMPtr<nsINSSComponent> component(do_GetService(PSM_COMPONENT_CONTRACTID));
++  if (!component) {
++    return ROOT_CERTIFICATE_UNKNOWN;
++  }
++  nsTArray<nsTArray<uint8_t>> enterpriseRoots;
++  rv = component->GetEnterpriseRoots(enterpriseRoots);
++  if (NS_FAILED(rv)) {
++    return ROOT_CERTIFICATE_UNKNOWN;
++  }
++  for (const auto& enterpriseRoot : enterpriseRoots) {
++    if (enterpriseRoot.Length() == cert->len &&
++        memcmp(enterpriseRoot.Elements(), cert->data,
++               enterpriseRoot.Length()) == 0) {
++      return ROOT_CERTIFICATE_ENTERPRISE_ROOT;
++    }
++  }
++
++  // We have no idea what this is.
+   return ROOT_CERTIFICATE_UNKNOWN;
+ }
+ 
+ // Attempt to increment the appropriate bin in the provided Telemetry probe ID.
+ // If there was a hash failure, we do nothing.
+ void AccumulateTelemetryForRootCA(mozilla::Telemetry::HistogramID probe,
+                                   const CERTCertificate* cert) {
+-  int32_t binId = RootCABinNumber(&cert->derCert);
++  int32_t binId = RootCABinNumber(&cert->derCert, cert->slot);
+ 
+   if (binId != ROOT_CERTIFICATE_HASH_FAILURE) {
+     Accumulate(probe, binId);
+   }
+ }
+ 
+ }  // namespace psm
+ }  // namespace mozilla
+diff --git a/security/manager/ssl/RootCertificateTelemetryUtils.h b/security/manager/ssl/RootCertificateTelemetryUtils.h
+--- a/security/manager/ssl/RootCertificateTelemetryUtils.h
++++ b/security/manager/ssl/RootCertificateTelemetryUtils.h
+@@ -12,19 +12,26 @@
+ 
+ namespace mozilla {
+ namespace psm {
+ 
+ // Note: New CAs will show up as UNKNOWN_ROOT until
+ // RootHashes.inc is updated to include them. 0 is reserved by
+ // genRootCAHashes.js for the unknowns.
+ #define ROOT_CERTIFICATE_UNKNOWN 0
++// 1 indicates the CA is not a built-in and comes from the softoken (cert9.db)
++#define ROOT_CERTIFICATE_SOFTOKEN 1
++// 2 indicates the CA is not a bilt-in and comes from an external PKCS#11 token
++#define ROOT_CERTIFICATE_EXTERNAL_TOKEN 2
++// 3 indicates the CA is not a built-in and comes from the OS via the
++// "Enterprise Roots" feature
++#define ROOT_CERTIFICATE_ENTERPRISE_ROOT 3
+ #define ROOT_CERTIFICATE_HASH_FAILURE -1
+ 
+-int32_t RootCABinNumber(const SECItem* cert);
++int32_t RootCABinNumber(const SECItem* cert, PK11SlotInfo* slot);
+ 
+ void AccumulateTelemetryForRootCA(mozilla::Telemetry::HistogramID probe,
+                                   const CERTCertificate* cert);
+ 
+ }  // namespace psm
+ }  // namespace mozilla
+ 
+ #endif  // RootCertificateTelemetryUtils_h
+diff --git a/security/manager/ssl/RootHashes.inc b/security/manager/ssl/RootHashes.inc
+--- a/security/manager/ssl/RootHashes.inc
++++ b/security/manager/ssl/RootHashes.inc
+@@ -839,52 +839,34 @@ static const struct CertAuthorityHash RO
+   },
+   {
+     /* QuoVadis_Root_Certification_Authority */
+     { 0xA4, 0x5E, 0xDE, 0x3B, 0xBB, 0xF0, 0x9C, 0x8A, 0xE1, 0x5C, 0x72, 0xEF, 0xC0, 0x72, 0x68, 0xD6,
+       0x93, 0xA2, 0x1C, 0x99, 0x6F, 0xD5, 0x1E, 0x67, 0xCA, 0x07, 0x94, 0x60, 0xFD, 0x6D, 0x88, 0x73 },
+       31 /* Bin Number */
+   },
+   {
+-    /* GTE_CyberTrust_Global_Root */
+-    { 0xA5, 0x31, 0x25, 0x18, 0x8D, 0x21, 0x10, 0xAA, 0x96, 0x4B, 0x02, 0xC7, 0xB7, 0xC6, 0xDA, 0x32,
+-      0x03, 0x17, 0x08, 0x94, 0xE5, 0xFB, 0x71, 0xFF, 0xFB, 0x66, 0x67, 0xD5, 0xE6, 0x81, 0x0A, 0x36 },
+-      1 /* Bin Number */
+-  },
+-  {
+     /* WellsSecure_Public_Root_Certificate_Authority */
+     { 0xA7, 0x12, 0x72, 0xAE, 0xAA, 0xA3, 0xCF, 0xE8, 0x72, 0x7F, 0x7F, 0xB3, 0x9F, 0x0F, 0xB3, 0xD1,
+       0xE5, 0x42, 0x6E, 0x90, 0x60, 0xB0, 0x6E, 0xE6, 0xF1, 0x3E, 0x9A, 0x3C, 0x58, 0x33, 0xCD, 0x43 },
+       65 /* Bin Number */
+   },
+   {
+-    /* Thawte_Premium_Server_CA */
+-    { 0xAB, 0x70, 0x36, 0x36, 0x5C, 0x71, 0x54, 0xAA, 0x29, 0xC2, 0xC2, 0x9F, 0x5D, 0x41, 0x91, 0x16,
+-      0x3B, 0x16, 0x2A, 0x22, 0x25, 0x01, 0x13, 0x57, 0xD5, 0x6D, 0x07, 0xFF, 0xA7, 0xBC, 0x1F, 0x72 },
+-      3 /* Bin Number */
+-  },
+-  {
+     /* OU_RSA_Security_2048_V3_O_RSA_Security_Inc */
+     { 0xAF, 0x8B, 0x67, 0x62, 0xA1, 0xE5, 0x28, 0x22, 0x81, 0x61, 0xA9, 0x5D, 0x5C, 0x55, 0x9E, 0xE2,
+       0x66, 0x27, 0x8F, 0x75, 0xD7, 0x9E, 0x83, 0x01, 0x89, 0xA5, 0x03, 0x50, 0x6A, 0xBD, 0x6B, 0x4C },
+       19 /* Bin Number */
+   },
+   {
+     /* E_Tugra_Certification_Authority */
+     { 0xB0, 0xBF, 0xD5, 0x2B, 0xB0, 0xD7, 0xD9, 0xBD, 0x92, 0xBF, 0x5D, 0x4D, 0xC1, 0x3D, 0xA2, 0x55,
+       0xC0, 0x2C, 0x54, 0x2F, 0x37, 0x83, 0x65, 0xEA, 0x89, 0x39, 0x11, 0xF5, 0x5E, 0x55, 0xF2, 0x3C },
+       141 /* Bin Number */
+   },
+   {
+-    /* Thawte_Server_CA */
+-    { 0xB4, 0x41, 0x0B, 0x73, 0xE2, 0xE6, 0xEA, 0xCA, 0x47, 0xFB, 0xC4, 0x2F, 0x8F, 0xA4, 0x01, 0x8A,
+-      0xF4, 0x38, 0x1D, 0xC5, 0x4C, 0xFA, 0xA8, 0x44, 0x50, 0x46, 0x1E, 0xED, 0x09, 0x45, 0x4D, 0xE9 },
+-      2 /* Bin Number */
+-  },
+-  {
+     /* GeoTrust_Primary_Certification_Authority___G3 */
+     { 0xB4, 0x78, 0xB8, 0x12, 0x25, 0x0D, 0xF8, 0x78, 0x63, 0x5C, 0x2A, 0xA7, 0xEC, 0x7D, 0x15, 0x5E,
+       0xAA, 0x62, 0x5E, 0xE8, 0x29, 0x16, 0xE2, 0xCD, 0x29, 0x43, 0x61, 0x88, 0x6C, 0xD1, 0xFB, 0xD4 },
+       86 /* Bin Number */
+   },
+   {
+     /* Deutsche_Telekom_Root_CA_2 */
+     { 0xB6, 0x19, 0x1A, 0x50, 0xD0, 0xC3, 0x97, 0x7F, 0x7D, 0xA9, 0x9B, 0xCD, 0xAA, 0xC8, 0x6A, 0x22,
+diff --git a/security/manager/tools/KnownRootHashes.json b/security/manager/tools/KnownRootHashes.json
+--- a/security/manager/tools/KnownRootHashes.json
++++ b/security/manager/tools/KnownRootHashes.json
+@@ -2,34 +2,33 @@
+ // 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 is an automatically generated file. It's used to maintain state for
+ // runs of genRootCAHashes.js; you should never need to manually edit it
+ //***************************************************************************
+ 
++// Notes:
++// binNumber 1 used to be for "GTE_CyberTrust_Global_Root", but that root was
++// removed from the built-in roots module, so now it is used to indicate that
++// the certificate is not a built-in and was found in the softoken (cert9.db).
++
++// binNumber 2 used to be for "Thawte_Server_CA", but that root was removed from
++// the built-in roots module, so now it is used to indicate that the certificate
++// is not a built-in and was found on an external PKCS#11 token.
++
++// binNumber 3 used to be for "Thawte_Premium_Server_CA", but that root was
++// removed from the built-in roots module, so now it is used to indicate that
++// the certificate is not a built-in and was temporarily imported from the OS as
++// part of the "Enterprise Roots" feature.
++
+ {
+   "roots": [
+     {
+-      "label": "GTE_CyberTrust_Global_Root",
+-      "binNumber": 1,
+-      "sha256Fingerprint": "pTElGI0hEKqWSwLHt8baMgMXCJTl+3H/+2Zn1eaBCjY="
+-    },
+-    {
+-      "label": "Thawte_Server_CA",
+-      "binNumber": 2,
+-      "sha256Fingerprint": "tEELc+Lm6spH+8Qvj6QBivQ4HcVM+qhEUEYe7QlFTek="
+-    },
+-    {
+-      "label": "Thawte_Premium_Server_CA",
+-      "binNumber": 3,
+-      "sha256Fingerprint": "q3A2NlxxVKopwsKfXUGRFjsWKiIlARNX1W0H/6e8H3I="
+-    },
+-    {
+       "label": "OU_Equifax_Secure_Certificate_Authority_O_Equifax_C_US",
+       "binNumber": 4,
+       "sha256Fingerprint": "CCl6QEfbojaAxzHbbjF2U8p4SOG+vToLAXmnB/ks8Xg="
+     },
+     {
+       "label": "OU_VeriSign_Trust_Network_OU___c__1998_VeriSign__Inc____For_authorized_use_only__OU_Class_3_Public_Primary_Certification_Authority___G2_O__VeriSign__Inc___C_US",
+       "binNumber": 5,
+       "sha256Fingerprint": "g848Eiloilk9SF+BlzwPkZVDHto3zF42Qw55x6iIY4s="
+diff --git a/security/manager/tools/genRootCAHashes.js b/security/manager/tools/genRootCAHashes.js
+--- a/security/manager/tools/genRootCAHashes.js
++++ b/security/manager/tools/genRootCAHashes.js
+@@ -16,25 +16,40 @@ ChromeUtils.import("resource://gre/modul
+ ChromeUtils.import("resource://gre/modules/FileUtils.jsm");
+ ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
+ const { CommonUtils } = ChromeUtils.import("resource://services-common/utils.js", {});
+ 
+ const FILENAME_OUTPUT = "RootHashes.inc";
+ const FILENAME_TRUST_ANCHORS = "KnownRootHashes.json";
+ const ROOT_NOT_ASSIGNED = -1;
+ 
+-const JSON_HEADER = "// This Source Code Form is subject to the terms of the Mozilla Public\n" +
+-"// License, v. 2.0. If a copy of the MPL was not distributed with this\n" +
+-"// file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n" +
+-"//\n" +
+-"//***************************************************************************\n" +
+-"// This is an automatically generated file. It's used to maintain state for\n" +
+-"// runs of genRootCAHashes.js; you should never need to manually edit it\n" +
+-"//***************************************************************************\n" +
+-"\n";
++const JSON_HEADER = `// 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 is an automatically generated file. It's used to maintain state for
++// runs of genRootCAHashes.js; you should never need to manually edit it
++//***************************************************************************
++
++// Notes:
++// binNumber 1 used to be for "GTE_CyberTrust_Global_Root", but that root was
++// removed from the built-in roots module, so now it is used to indicate that
++// the certificate is not a built-in and was found in the softoken (cert9.db).
++
++// binNumber 2 used to be for "Thawte_Server_CA", but that root was removed from
++// the built-in roots module, so now it is used to indicate that the certificate
++// is not a built-in and was found on an external PKCS#11 token.
++
++// binNumber 3 used to be for "Thawte_Premium_Server_CA", but that root was
++// removed from the built-in roots module, so now it is used to indicate that
++// the certificate is not a built-in and was temporarily imported from the OS as
++// part of the "Enterprise Roots" feature.
++
++`;
+ 
+ const FILE_HEADER = "/* This Source Code Form is subject to the terms of the Mozilla Public\n" +
+ " * License, v. 2.0. If a copy of the MPL was not distributed with this\n" +
+ " * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n" +
+ "\n" +
+ "/*****************************************************************************/\n" +
+ "/* This is an automatically generated file. If you're not                    */\n" +
+ "/* RootCertificateTelemetryUtils.cpp, you shouldn't be #including it.        */\n" +

+ 1 - 2
comm-esr60/mozilla-esr60/patches/1591887-1-NSPR424-72a1.patch → rel-257/mozilla-esr60/patches/1591887-1-NSPR424-72a1.patch

@@ -1,9 +1,8 @@
 # HG changeset patch
 # User Kai Engert <kaie@kuix.de>
 # Date 1572287718 0
-#      Mon Oct 28 18:35:18 2019 +0000
 # Node ID 6db64ff6f63b52347f6f088878f1a68666904822
-# Parent  e7377220a5ad237fe67bca8edfc5f04588435870
+# Parent  ca5795ce333483f21c2b0e65871f265545d74917
 Bug 1591887 - NSPR_4_24_BETA1. r=jcj
 
 UPGRADE_NSPR_RELEASE

+ 6 - 7
comm-esr60/mozilla-esr60/patches/1591887-2-NSPR424-72.patch → rel-257/mozilla-esr60/patches/1591887-2-NSPR424-72a1.patch

@@ -1,14 +1,13 @@
 # HG changeset patch
 # User Kai Engert <kaie@kuix.de>
-# Date 1575311253 -7200
-#      Mon Dec 02 20:27:33 2019 +0200
-# Node ID f7c6c838e79df777942723c5abdd0662acf8b04d
-# Parent  1b75e2c677827286c574cae5e35b739f796be694
-Bug 1591887 - Uplift NSPR 4.24 RTM, only version number changes. r?jcj a=jcristau
+# Date 1575311253 0
+# Node ID 10b295d8c610b7807f45b04c7a20d9e387874b65
+# Parent  0c7bd3154585796633090053ee6f25c87fa16513
+Bug 1591887 - Uplift NSPR 4.24 RTM, only version number changes. r=jcj
 
 UPGRADE_NSPR_RELEASE
 
-Differential Revision: https://phabricator.services.mozilla.com//D55523
+Differential Revision: https://phabricator.services.mozilla.com/D55523
 
 diff --git a/nsprpub/TAG-INFO b/nsprpub/TAG-INFO
 --- a/nsprpub/TAG-INFO
@@ -68,7 +67,7 @@ diff --git a/old-configure.in b/old-configure.in
  dnl Set the version number of the libs included with mozilla
  dnl ========================================================
  MOZJPEG=62
- MOZPNG=10635
+ MOZPNG=10637
  NSPR_VERSION=4
 -NSPR_MINVER=4.23
 +NSPR_MINVER=4.24

+ 2 - 3
comm-esr60/mozilla-esr60/patches/1592007-1-NSS348-72.patch → rel-257/mozilla-esr60/patches/1592007-1-NSS348-72a1.patch

@@ -1,9 +1,8 @@
 # HG changeset patch
 # User J.C. Jones <jc@mozilla.com>
 # Date 1572495273 0
-#      Thu Oct 31 04:14:33 2019 +0000
 # Node ID 60244e31ea1d74b38eafe4ec3dcbf4e9a551fa0c
-# Parent  ad2dc026568a0b6118997a414af5d5456db796c6
+# Parent  267642518899c9f0805fa13574b1286eeb50e4a8
 Bug 1592007 - land NSS fcdda17cdc36 UPGRADE_NSS_RELEASE, r=kjacobs
 
 2019-10-28  Kevin Jacobs  <kjacobs@mozilla.com>
@@ -108,7 +107,7 @@ Differential Revision: https://phabricator.services.mozilla.com/D50840
 diff --git a/old-configure.in b/old-configure.in
 --- a/old-configure.in
 +++ b/old-configure.in
-@@ -1803,17 +1803,17 @@ dnl = If NSS was not detected in the sys
+@@ -1699,17 +1699,17 @@ dnl = If NSS was not detected in the sys
  dnl = use the one in the source tree (mozilla/security/nss)
  dnl ========================================================
  

+ 1 - 2
comm-esr60/mozilla-esr60/patches/1592007-2-NSS348-72.patch → rel-257/mozilla-esr60/patches/1592007-2-NSS348-72a1.patch

@@ -1,9 +1,8 @@
 # HG changeset patch
 # User J.C. Jones <jc@mozilla.com>
 # Date 1573250440 0
-#      Fri Nov 08 22:00:40 2019 +0000
 # Node ID 56cb51a605640ebb245234edec8caeb94dc46b93
-# Parent  66a4e2b62124889abd7f14489f8d1652f1643424
+# Parent  2af47eccf75bf7bb1049f3bdee8fa37f30078f8b
 Bug 1592007 - land NSS dc9552c2aa77 UPGRADE_NSS_RELEASE, r=kjacobs
 
 2019-11-04  Marcus Burghardt  <mburghardt@mozilla.com>

+ 1 - 2
comm-esr60/mozilla-esr60/patches/1592007-3-NSS348-72.patch → rel-257/mozilla-esr60/patches/1592007-3-NSS348-72a1.patch

@@ -1,9 +1,8 @@
 # HG changeset patch
 # User J.C. Jones <jc@mozilla.com>
 # Date 1573752747 0
-#      Thu Nov 14 17:32:27 2019 +0000
 # Node ID 9ba180fee075f942198a5e6cc9c40a48e0b1072c
-# Parent  418dd9da108a7581493691a6663e16d97978e1e0
+# Parent  06a742c6531609a4c2ec13a6b0a70e27cb10f0d0
 Bug 1592007 - land NSS 87f35ba4c82f UPGRADE_NSS_RELEASE, r=keeler
 
 2019-11-13  J.C. Jones  <jjones@mozilla.com>

+ 1 - 2
comm-esr60/mozilla-esr60/patches/1592007-4-NSS348-72.patch → rel-257/mozilla-esr60/patches/1592007-4-NSS348-72a1.patch

@@ -1,9 +1,8 @@
 # HG changeset patch
 # User J.C. Jones <jc@mozilla.com>
 # Date 1573837689 -3600
-#      Fri Nov 15 18:08:09 2019 +0100
 # Node ID f3ce2609c3f30a4473054e4a76fd96e735c46176
-# Parent  dc2fad2fabb4ba0261d4d27d1c0d4647c1cef561
+# Parent  3f689effae72922d95cf4db88042ff11d1191074
 Bug 1592007 - land NSS e8f2720c8254 UPGRADE_NSS_RELEASE, r=kjacobs CLOSED TREE
 
 2019-11-09  Dana Keeler  <dkeeler@mozilla.com>

+ 1 - 2
comm-esr60/mozilla-esr60/patches/1592007-5-NSS348-72.patch → rel-257/mozilla-esr60/patches/1592007-5-NSS348-72a1.patch

@@ -1,9 +1,8 @@
 # HG changeset patch
 # User J.C. Jones <jc@mozilla.com>
 # Date 1574200800 0
-#      Tue Nov 19 22:00:00 2019 +0000
 # Node ID ba91226fa7b999bb9c6585c79e9834e959e40d0f
-# Parent  0582212f26e390030913c5fbe97b4c3a9282b0fa
+# Parent  072ad40c5b818d94fed1190d343afe7cdd841b39
 Bug 1592007 - land NSS 1e22a0c93afe UPGRADE_NSS_RELEASE, r=kjacobs
 
 2019-11-19  Craig Disselkoen  <cdisselk@cs.ucsd.edu>

+ 1 - 2
comm-esr60/mozilla-esr60/patches/1592007-6-NSS348-72.patch → rel-257/mozilla-esr60/patches/1592007-6-NSS348-72a1.patch

@@ -1,9 +1,8 @@
 # HG changeset patch
 # User J.C. Jones <jc@mozilla.com>
 # Date 1574725726 0
-#      Mon Nov 25 23:48:46 2019 +0000
 # Node ID 8a2358762789286d20bdd549796094d9d18d2aa1
-# Parent  f6cfc4f40896b1573250b1917044dafbb3379dc3
+# Parent  1efbce918fa5c603c24f9dcf1f0109c48dc64740
 Bug 1592007 - land NSS d64102b76a43 UPGRADE_NSS_RELEASE, r=kjacobs
 
 2019-11-20  Kevin Jacobs  <kjacobs@mozilla.com>

+ 3 - 4
comm-esr60/mozilla-esr60/patches/1592007-7-NSS348-72.patch → rel-257/mozilla-esr60/patches/1592007-7-NSS348-72a1.patch

@@ -1,9 +1,8 @@
 # HG changeset patch
 # User J.C. Jones <jc@mozilla.com>
 # Date 1574798351 0
-#      Tue Nov 26 19:59:11 2019 +0000
 # Node ID dc8776ff47594e025f7cd07a5d7eefb00cbc9770
-# Parent  61e75b3fd2f1a1e0228136b613190fd67583c638
+# Parent  e62574bd0238e8060c46633c79302531247d50f5
 Bug 1592007 - land NSS 10722c590949 UPGRADE_NSS_RELEASE, r=kjacobs
 
 2019-11-26  J.C. Jones  <jjones@mozilla.com>
@@ -26,7 +25,7 @@ Differential Revision: https://phabricator.services.mozilla.com/D54785
 diff --git a/security/manager/ssl/RootHashes.inc b/security/manager/ssl/RootHashes.inc
 --- a/security/manager/ssl/RootHashes.inc
 +++ b/security/manager/ssl/RootHashes.inc
-@@ -1097,16 +1097,22 @@ static const struct CertAuthorityHash RO
+@@ -1079,16 +1079,22 @@ static const struct CertAuthorityHash RO
    },
    {
      /* Swisscom_Root_EV_CA_2 */
@@ -52,7 +51,7 @@ diff --git a/security/manager/ssl/RootHashes.inc b/security/manager/ssl/RootHash
 diff --git a/security/manager/tools/KnownRootHashes.json b/security/manager/tools/KnownRootHashes.json
 --- a/security/manager/tools/KnownRootHashes.json
 +++ b/security/manager/tools/KnownRootHashes.json
-@@ -1053,12 +1053,17 @@
+@@ -1052,12 +1052,17 @@
        "label": "emSign_ECC_Root_CA___C3",
        "binNumber": 209,
        "sha256Fingerprint": "vE2AmxUYnXjbPh2M9PlyanldoWQ8pfE1jh3bDtwNfrM="

+ 14 - 2
comm-esr60/mozilla-esr60/patches/1592007-8-NSS348-72.patch → rel-257/mozilla-esr60/patches/1592007-8-NSS348-72a1.patch

@@ -1,9 +1,8 @@
 # HG changeset patch
 # User J.C. Jones <jc@mozilla.com>
 # Date 1575346748 0
-#      Tue Dec 03 04:19:08 2019 +0000
 # Node ID 529ad04d3eb2589babe395245590449590cb9f56
-# Parent  00e4154e26ab3def5c3a415388604ba20f513c48
+# Parent  46e7b21a3c6ff4cc1e569f14d80b338321401ff6
 Bug 1592007 - land NSS NSS_3_48_BETA1 UPGRADE_NSS_RELEASE, r=kjacobs
 
 2019-12-02  Kevin Jacobs  <kjacobs@mozilla.com>
@@ -75,6 +74,19 @@ diff --git a/security/nss/automation/release/nspr-version.txt b/security/nss/aut
  # This information is used by release automation,
  # when creating an NSS source archive.
  #
+diff --git a/security/nss/coreconf/coreconf.dep b/security/nss/coreconf/coreconf.dep
+--- a/security/nss/coreconf/coreconf.dep
++++ b/security/nss/coreconf/coreconf.dep
+@@ -6,8 +6,9 @@
+ /*
+  * A dummy header file that is a dependency for all the object files.
+  * Used to force a full recompilation of NSS in Mozilla's Tinderbox
+  * depend builds.  See comments in rules.mk.
+  */
+ 
+ #error "Do not include this header file."
+ 
++
 diff --git a/security/nss/cpputil/tls_parser.h b/security/nss/cpputil/tls_parser.h
 --- a/security/nss/cpputil/tls_parser.h
 +++ b/security/nss/cpputil/tls_parser.h

+ 1 - 1
comm-esr60/mozilla-esr60/patches/1592007-9-NSS348-72.patch → rel-257/mozilla-esr60/patches/1592007-9-NSS348-72a1.patch

@@ -1,7 +1,6 @@
 # HG changeset patch
 # User J.C. Jones <jc@mozilla.com>
 # Date 1575566160 0
-#      Thu Dec 05 17:16:00 2019 +0000
 # Node ID 3a71e98c94b276fcb5b3990efaf55cc091c7d101
 # Parent  9437a98ef1f1ef95681a9d620c40f77200f6b3f0
 Bug 1592007 - land NSS NSS_3_48_RTM UPGRADE_NSS_RELEASE, r=kjacobs
@@ -119,3 +118,4 @@ diff --git a/security/nss/lib/util/nssutil.h b/security/nss/lib/util/nssutil.h
   */
  extern const char *NSSUTIL_GetVersion(void);
  
+

+ 12 - 7
comm-esr60/mozilla-esr60/patches/1602263-buildfixes-257.patch → rel-257/mozilla-esr60/patches/1602263-buildfixes-257.patch

@@ -1,18 +1,18 @@
 # HG changeset patch
 # User Frank-Rainer Grahl <frgrahl@gmx.net>
 # Date 1569347760 -7200
-# Parent  afb1cff049d5c9cd384a1d1476b82c82396e3615
+# Parent  0b84451e77ad64e4d025f7dd003536ae49a5907c
 Bug 1602263 - Fix VS2017 compiler warning. r=IanN a=IanN
 
 diff --git a/gfx/webrender_bindings/WebRenderAPI.cpp b/gfx/webrender_bindings/WebRenderAPI.cpp
 --- a/gfx/webrender_bindings/WebRenderAPI.cpp
 +++ b/gfx/webrender_bindings/WebRenderAPI.cpp
-@@ -7,19 +7,23 @@
+@@ -9,24 +9,28 @@
  #include "LayersLogging.h"
  #include "mozilla/webrender/RendererOGL.h"
  #include "mozilla/gfx/gfxVars.h"
  #include "mozilla/layers/CompositorThread.h"
- #include "mozilla/widget/CompositorWidget.h"
+ #include "mozilla/webrender/RenderCompositor.h"
  #include "mozilla/widget/CompositorWidget.h"
  #include "mozilla/layers/SynchronousTask.h"
  
@@ -20,7 +20,12 @@ diff --git a/gfx/webrender_bindings/WebRenderAPI.cpp b/gfx/webrender_bindings/We
 +#pragma warning(disable:4722)
 +#endif
  #define WRDL_LOG(...)
- //#define WRDL_LOG(...) printf_stderr("WRDL: " __VA_ARGS__)
+ /*
+ #define WRDL_LOG(...) printf_stderr("WRDL(%p): " __VA_ARGS__)
+ #define WRDL_LOG(...) if (XRE_IsContentProcess()) {              \
+                         printf_stderr("WRDL(%p): " __VA_ARGS__); \
+                       }
+ */
  
 +
  namespace mozilla {
@@ -28,6 +33,6 @@ diff --git a/gfx/webrender_bindings/WebRenderAPI.cpp b/gfx/webrender_bindings/We
  
  using layers::Stringify;
  
- class NewRenderer : public RendererEvent
- {
- public:
+ class NewRenderer : public RendererEvent {
+  public:
+   NewRenderer(wr::DocumentHandle** aDocHandle,

+ 2 - 2
comm-esr60/mozilla-esr60/patches/1605729-buildconfig-gitlab.patch → rel-257/mozilla-esr60/patches/1605729-buildconfig-gitlab.patch

@@ -1,12 +1,12 @@
 # HG changeset patch
 # User Ian Neal <iann_cvs@blueyonder.co.uk>
-# Parent  e8ad4683e96ad5c142ce1cc44b9cc05638baad80
+# Parent  0667a6a5dad1e154fdb968b3979f02f7aba789e5
 Bug 1605729 - Extend variables.py to understand gitlab repos. r=frg a=frg
 
 diff --git a/build/variables.py b/build/variables.py
 --- a/build/variables.py
 +++ b/build/variables.py
-@@ -85,17 +85,20 @@ def source_repo_header(output):
+@@ -89,17 +89,20 @@ def source_repo_header(output):
          if not changeset:
              raise Exception('could not resolve changeset; '
                              'try setting MOZ_SOURCE_CHANGESET')

+ 23 - 0
rel-257/mozilla-esr60/patches/series

@@ -32,6 +32,12 @@
 1591803-1only-72a1.patch
 1445766-61a1.patch
 1515550-66a1.patch
+1255485-1-61a1.patch
+1255485-2-61a1.patch
+1255485-3-61a1.patch
+1255485-4-61a1.patch
+1255485-5-61a1.patch
+1255485-6-61a1.patch
 1429875-1-61a1.patch
 1429875-2-61a1.patch
 1429875-3-61a1.patch
@@ -112,3 +118,20 @@
 1465709-2-62a1.patch
 1471096-1-63a1.patch
 1471096-2-63a1.patch
+1562388-1-72a1.patch
+1562388-2-72a1.patch
+1512882-centos_bootstrap.patch
+1602263-buildfixes-257.patch
+1605729-buildconfig-gitlab.patch
+1576755-71a1.patch
+1591887-1-NSPR424-72a1.patch
+1591887-2-NSPR424-72a1.patch
+1592007-1-NSS348-72a1.patch
+1592007-2-NSS348-72a1.patch
+1592007-3-NSS348-72a1.patch
+1592007-4-NSS348-72a1.patch
+1592007-5-NSS348-72a1.patch
+1592007-6-NSS348-72a1.patch
+1592007-7-NSS348-72a1.patch
+1592007-8-NSS348-72a1.patch
+1592007-9-NSS348-72a1.patch