# HG changeset patch
# Parent  17b476a3f9acf9f5838036728ee207cb07837ed3

diff --git a/mozglue/build/ppc.cpp b/mozglue/build/ppc.cpp
--- a/mozglue/build/ppc.cpp
+++ b/mozglue/build/ppc.cpp
@@ -9,17 +9,17 @@
 #include "mozilla/Unused.h"
 
 #include <stdio.h>
 #include <stdlib.h>
 
 #if defined(XP_LINUX)
 // Use the getauxval() function if available.
 // ARCH_3_00 wasn't defined until glibc 2.23, so include just in case.
-#  include <sys/auxv.h>
+//#  include <sys/auxv.h>
 #  ifndef PPC_FEATURE2_ARCH_3_00
 #    define PPC_FEATURE2_ARCH_3_00 0x00800000
 #  endif
 #endif
 
 const unsigned PPC_FLAG_VMX = 1;
 const unsigned PPC_FLAG_VSX = 2;
 const unsigned PPC_FLAG_VSX3 = 4;
@@ -30,28 +30,28 @@ static signed get_ppc_cpu_flags(void) {
 
   if (cpu_flags > -1) {  // already checked
     return cpu_flags;
   }
   cpu_flags = 0;
 
 #if defined(XP_LINUX)
   // Try getauxval().
-  unsigned long int cap = getauxval(AT_HWCAP);
-  unsigned long int cap2 = getauxval(AT_HWCAP2);
+//  unsigned long int cap = getauxval(AT_HWCAP);
+//  unsigned long int cap2 = getauxval(AT_HWCAP2);
 
-  if (cap & PPC_FEATURE_HAS_ALTIVEC) {
-    cpu_flags |= PPC_FLAG_VMX;
-  }
-  if (cap & PPC_FEATURE_HAS_VSX) {
-    cpu_flags |= PPC_FLAG_VSX;
-  }
-  if (cap2 & PPC_FEATURE2_ARCH_3_00) {
-    cpu_flags |= PPC_FLAG_VSX3;
-  }
+//  if (cap & PPC_FEATURE_HAS_ALTIVEC) {
+//    cpu_flags |= PPC_FLAG_VMX;
+//  }
+//  if (cap & PPC_FEATURE_HAS_VSX) {
+//    cpu_flags |= PPC_FLAG_VSX;
+//  }
+//  if (cap2 & PPC_FEATURE2_ARCH_3_00) {
+//    cpu_flags |= PPC_FLAG_VSX3;
+//  }
 #else
   // Non-Linux detection here. Currently, on systems other than Linux,
   // no CPU SIMD features will be detected.
 #endif
 
   return cpu_flags;
 }
 
diff --git a/python/mozbuild/mozpack/executables.py b/python/mozbuild/mozpack/executables.py
--- a/python/mozbuild/mozpack/executables.py
+++ b/python/mozbuild/mozpack/executables.py
@@ -1,13 +1,14 @@
 # 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/.
 
-from __future__ import absolute_import, print_function, unicode_literals
+#from __future__ import absolute_import, print_function, unicode_literals
+from __future__ import absolute_import, print_function
 
 import os
 import struct
 import subprocess
 from mozpack.errors import errors
 
 MACHO_SIGNATURES = [
     0xFEEDFACE,  # mach-o 32-bits big endian
diff --git a/remote/mach_commands.py b/remote/mach_commands.py
--- a/remote/mach_commands.py
+++ b/remote/mach_commands.py
@@ -30,17 +30,16 @@ from mach.decorators import (
 
 from mozbuild.base import (
     MachCommandBase,
     MozbuildObject,
     BinaryNotFoundException,
 )
 from mozbuild import nodeutil
 import mozlog
-import mozprofile
 
 
 EX_CONFIG = 78
 EX_SOFTWARE = 70
 EX_USAGE = 64
 
 
 def setup():
@@ -446,16 +445,17 @@ class PuppeteerRunner(MozbuildObject):
 
             env["MOZ_WEBRENDER"] = "%d" % params.get("enable_webrender", False)
 
         command = ["run", "unit", "--"] + mocha_options
 
         env["HEADLESS"] = str(params.get("headless", False))
 
         prefs = {}
+        import mozprofile
         for k, v in params.get("extra_prefs", {}).items():
             prefs[k] = mozprofile.Preferences.cast(v)
 
         if prefs:
             extra_options["extraPrefsFirefox"] = prefs
 
         if extra_options:
             env["EXTRA_LAUNCH_OPTIONS"] = json.dumps(extra_options)
diff --git a/security/sandbox/linux/SandboxFilter.h b/security/sandbox/linux/SandboxFilter.h
--- a/security/sandbox/linux/SandboxFilter.h
+++ b/security/sandbox/linux/SandboxFilter.h
@@ -7,16 +7,32 @@
 #ifndef mozilla_SandboxFilter_h
 #define mozilla_SandboxFilter_h
 
 #include <vector>
 #include "mozilla/Atomics.h"
 #include "mozilla/Range.h"
 #include "mozilla/UniquePtr.h"
 
+#ifndef AT_NO_AUTOMOUNT
+// SLE-11 SP1 glibc is too old and doesn't have this define.
+// The kernel already knows it, though. And glibc 2.11.3 added only
+// this define and nothing else. So instead of patching glibc,
+// we just put that define here.
+# define AT_NO_AUTOMOUNT    0x800    /* Suppress terminal automount traversal.  */
+#endif
+
+#ifndef AT_EMPTY_PATH
+// SLE-11 glibc is too old and doesn't have this define. 
+// The kernel already knows it, though. And glibc 2.14 added only 
+// this define and nothing else. So instead of patching glibc, 
+// we just put that define here.
+# define AT_EMPTY_PATH     0x1000  /* Allow empty relative pathname.  */
+#endif
+
 namespace sandbox {
 namespace bpf_dsl {
 class Policy;
 }
 }  // namespace sandbox
 
 namespace mozilla {
 class SandboxBrokerClient;
diff --git a/third_party/libwebrtc/webrtc/modules/video_capture/linux/device_info_linux.cc b/third_party/libwebrtc/webrtc/modules/video_capture/linux/device_info_linux.cc
--- a/third_party/libwebrtc/webrtc/modules/video_capture/linux/device_info_linux.cc
+++ b/third_party/libwebrtc/webrtc/modules/video_capture/linux/device_info_linux.cc
@@ -381,21 +381,23 @@ bool DeviceInfoLinux::IsDeviceNameMatche
                                           const char* deviceUniqueIdUTF8) {
   if (strncmp(deviceUniqueIdUTF8, name, strlen(name)) == 0)
     return true;
   return false;
 }
 
 bool DeviceInfoLinux::IsVideoCaptureDevice(struct v4l2_capability* cap)
 {
-  if (cap->capabilities & V4L2_CAP_DEVICE_CAPS) {
-    return cap->device_caps & V4L2_CAP_VIDEO_CAPTURE;
-  } else {
+// SLE-11 doesn't define V4L2_CAP_DEVICE_CAPS, so its obviously not available
+// so we use the fallback by default.
+//  if (cap->capabilities & V4L2_CAP_DEVICE_CAPS) {
+//    return cap->device_caps & V4L2_CAP_VIDEO_CAPTURE;
+//  } else {
     return cap->capabilities & V4L2_CAP_VIDEO_CAPTURE;
-  }
+//  }
 }
 
 int32_t DeviceInfoLinux::FillCapabilities(int fd) {
   // set image format
   struct v4l2_format video_fmt;
   memset(&video_fmt, 0, sizeof(struct v4l2_format));
 
   video_fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
diff --git a/toolkit/system/unixproxy/nsLibProxySettings.cpp b/toolkit/system/unixproxy/nsLibProxySettings.cpp
--- a/toolkit/system/unixproxy/nsLibProxySettings.cpp
+++ b/toolkit/system/unixproxy/nsLibProxySettings.cpp
@@ -51,18 +51,18 @@ nsresult nsUnixSystemProxySettings::GetP
   nsresult rv;
 
   if (!mProxyFactory) {
     mProxyFactory = px_proxy_factory_new();
   }
   NS_ENSURE_TRUE(mProxyFactory, NS_ERROR_NOT_AVAILABLE);
 
   char** proxyArray = nullptr;
-  proxyArray = px_proxy_factory_get_proxies(mProxyFactory,
-                                            PromiseFlatCString(aSpec).get());
+  proxyArray = px_proxy_factory_get_proxies(
+      mProxyFactory, (char*)PromiseFlatCString(aSpec).get());
   NS_ENSURE_TRUE(proxyArray, NS_ERROR_NOT_AVAILABLE);
 
   // Translate libproxy's output to PAC string as expected
   // libproxy returns an array of proxies in the format:
   // <procotol>://[username:password@]proxy:port
   // or
   // direct://
   //
diff --git a/xpcom/threads/nsThread.cpp b/xpcom/threads/nsThread.cpp
--- a/xpcom/threads/nsThread.cpp
+++ b/xpcom/threads/nsThread.cpp
@@ -494,17 +494,22 @@ void nsThread::InitCommon() {
     // already been faulted in existence, and NSPR doesn't give us a way to set
     // it beforehand.
     //
     // What this does get us, however, is a different set of VM flags on our
     // thread stacks compared to normal heap memory. Which makes the Linux
     // kernel report them as separate regions, even when they are adjacent to
     // heap memory. This allows us to accurately track the actual memory
     // consumption of our allocated stacks.
+
+// On SLE-11 SP1, this macro is not available. We don't really need to
+// "accurately track memory consumption" so hopefully deactivating that is ok
+#  if defined(MADV_NOHUGEPAGE)
     madvise(mStackBase, stackSize, MADV_NOHUGEPAGE);
+#  endif
 
     pthread_attr_destroy(&attr);
 #elif defined(XP_WIN)
     static const StaticDynamicallyLinkedFunctionPtr<
         GetCurrentThreadStackLimitsFn>
         sGetStackLimits(L"kernel32.dll", "GetCurrentThreadStackLimits");
 
     if (sGetStackLimits) {
