Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Aug 2012 06:40:46 GMT
From:      svn-freebsd-gecko@chruetertee.ch
To:        freebsd-gecko@freebsd.org
Subject:   [SVN-Commit] r916 - in branches/experimental: Mk mail/thunderbird-esr/files mail/thunderbird/files www/firefox-esr/files www/firefox-nightly/files www/firefox/files www/libxul/files www/seamonkey/files
Message-ID:  <201208090640.q796ekGT093950@trillian.chruetertee.ch>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Thu Aug  9 06:40:45 2012
New Revision: 916

Log:
sync with bug#753046

Modified:
   branches/experimental/Mk/bsd.gecko.mk
   branches/experimental/mail/thunderbird-esr/files/patch-bug753046
   branches/experimental/mail/thunderbird/files/patch-bug753046
   branches/experimental/www/firefox-esr/files/patch-bug753046
   branches/experimental/www/firefox-nightly/files/patch-bug753046
   branches/experimental/www/firefox/files/patch-bug753046
   branches/experimental/www/libxul/files/patch-bug753046
   branches/experimental/www/seamonkey/files/patch-bug753046

Modified: branches/experimental/Mk/bsd.gecko.mk
==============================================================================
--- branches/experimental/Mk/bsd.gecko.mk	Thu Aug  9 06:40:34 2012	(r915)
+++ branches/experimental/Mk/bsd.gecko.mk	Thu Aug  9 06:40:45 2012	(r916)
@@ -824,12 +824,19 @@
 .endif
 .for subdir in "" nsprpub js/src
 	@if [ -f ${MOZSRC}/${subdir}/config/system-headers ] ; then \
-		${ECHO_CMD} "cairo-qt.h" >> ${MOZSRC}/${subdir}/config/system-headers ; \
-		${ECHO_CMD} "fenv.h" >> ${MOZSRC}/${subdir}/config/system-headers ; \
-		${ECHO_CMD} "malloc_np.h" >> ${MOZSRC}/${subdir}/config/system-headers ; \
-		${ECHO_CMD} "pthread_np.h" >> ${MOZSRC}/${subdir}/config/system-headers ; \
-		${ECHO_CMD} "pulse/pulseaudio.h" >> ${MOZSRC}/${subdir}/config/system-headers ; \
-		${ECHO_CMD} "unwind.h" >> ${MOZSRC}/${subdir}/config/system-headers ; \
+	for f in \
+			cairo-qt.h \
+			fenv.h \
+			kvm.h \
+			malloc_np.h \
+			pthread_np.h \
+			pulse/pulseaudio.h \
+			spawn.h \
+			sys/thr.h \
+			sys/user.h \
+			unwind.h; do \
+		${ECHO_CMD} "$$f" >> ${MOZSRC}/${subdir}/config/system-headers ; \
+	done; \
 	fi
 .endfor
 	@for f in \

Modified: branches/experimental/mail/thunderbird-esr/files/patch-bug753046
==============================================================================
--- branches/experimental/mail/thunderbird-esr/files/patch-bug753046	Thu Aug  9 06:40:34 2012	(r915)
+++ branches/experimental/mail/thunderbird-esr/files/patch-bug753046	Thu Aug  9 06:40:45 2012	(r916)
@@ -4,15 +4,14 @@
 
 --- mozilla/dom/plugins/ipc/PluginModuleChild.cpp.orig	2011-12-20 23:28:14.000000000 +0000
 +++ mozilla/dom/plugins/ipc/PluginModuleChild.cpp
-@@ -33,6 +33,8 @@
- #include "nsPluginsDir.h"
- #include "nsXULAppAPI.h"
+@@ -5,6 +5,7 @@
+  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  
-+#include <unistd.h>
-+
- #ifdef MOZ_X11
- # include "mozilla/X11Util.h"
- #endif
+ #ifdef MOZ_WIDGET_QT
++#include <unistd.h> // for _exit()
+ #include <QtCore/QTimer>
+ #include "nsQAppInstance.h"
+ #include "NestedLoopTimer.h"
 @@ -228,7 +228,7 @@ PluginModuleChild::Init(const std::strin
  
      // TODO: use PluginPRLibrary here
@@ -65,7 +64,7 @@
 +
 +CPPSRCS += \
 +  atomicops_internals_x86_gcc.cc \
-+  file_util_bsd.cc \
++  file_util_linux.cc \
 +  process_util_bsd.cc \
 +  time_posix.cc \
 +  $(NULL)
@@ -244,7 +243,7 @@
  
  // Based on Apple's recommended method as described in
  // http://developer.apple.com/qa/qa2004/qa1361.html
-@@ -71,7 +76,13 @@ bool DebugUtil::BeingDebugged() {
+@@ -71,7 +76,15 @@ bool DebugUtil::BeingDebugged() {
  
    // This process is being debugged if the P_TRACED flag is set.
    is_set = true;
@@ -252,6 +251,8 @@
 +  being_debugged = (info.kp_flags & P_TRACED) != 0;
 +#elif defined(OS_FREEBSD)
 +  being_debugged = (info.ki_flag & P_TRACED) != 0;
++#elif defined(OS_OPENBSD)
++  being_debugged = (info.p_flag & P_TRACED) != 0;
 +#else
    being_debugged = (info.kp_proc.p_flag & P_TRACED) != 0;
 +#endif
@@ -394,105 +395,19 @@
  #else
  typedef DirReaderFallback DirReaderPosix;
  #endif
-$NetBSD: patch-ipc_chromium_src_base_file__util.h,v 1.2 2012/03/06 12:34:09 ryoon Exp $
-
---- mozilla/ipc/chromium/src/base/file_util.h.orig	2011-12-20 23:28:19.000000000 +0000
-+++ mozilla/ipc/chromium/src/base/file_util.h
-@@ -16,8 +16,8 @@
- #include <sys/stat.h>
- #elif defined(OS_POSIX) 
- #include <sys/types.h>
--#include <fts.h>
- #include <sys/stat.h>
-+#include <fts.h>
- #endif
+diff --git mozilla/ipc/chromium/src/base/file_util_linux.cc mozilla/ipc/chromium/src/base/file_util_linux.cc
+index 171e44f..0c6dfcc 100644
+--- mozilla/ipc/chromium/src/base/file_util_linux.cc
++++ mozilla/ipc/chromium/src/base/file_util_linux.cc
+@@ -28,7 +28,7 @@ bool GetTempDir(FilePath* path) {
+ }
  
- #include <stdio.h>
-$NetBSD: patch-ipc_chromium_src_base_file__util__bsd.cc,v 1.1 2012/03/06 12:34:09 ryoon Exp $
-
---- mozilla/ipc/chromium/src/base/file_util_bsd.cc.orig	2012-01-07 18:21:18.000000000 +0000
-+++ mozilla/ipc/chromium/src/base/file_util_bsd.cc
-@@ -0,0 +1,80 @@
-+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style license that can be
-+// found in the LICENSE file.
-+
-+// this is a derivative of file_util_linux.cc
-+
-+#include "base/file_util.h"
-+
-+#include <fcntl.h>
-+#include <unistd.h>
-+
-+#include <string>
-+#include <vector>
-+
-+#include "base/eintr_wrapper.h"
-+#include "base/file_path.h"
-+#include "base/string_util.h"
-+
-+namespace file_util {
-+
-+bool GetTempDir(FilePath* path) {
-+  const char* tmp = getenv("TMPDIR");
-+  if (tmp)
-+    *path = FilePath(tmp);
-+  else
-+    *path = FilePath("/tmp");
-+  return true;
-+}
-+
-+bool GetShmemTempDir(FilePath* path) {
-+  return GetTempDir(path);
-+}
-+
-+bool CopyFile(const FilePath& from_path, const FilePath& to_path) {
-+  int infile = open(from_path.value().c_str(), O_RDONLY);
-+  if (infile < 0)
-+    return false;
-+
-+  int outfile = creat(to_path.value().c_str(), 0666);
-+  if (outfile < 0) {
-+    close(infile);
-+    return false;
-+  }
-+
-+  const size_t kBufferSize = 32768;
-+  std::vector<char> buffer(kBufferSize);
-+  bool result = true;
-+
-+  while (result) {
-+    ssize_t bytes_read = HANDLE_EINTR(read(infile, &buffer[0], buffer.size()));
-+    if (bytes_read < 0) {
-+      result = false;
-+      break;
-+    }
-+    if (bytes_read == 0)
-+      break;
-+    // Allow for partial writes
-+    ssize_t bytes_written_per_read = 0;
-+    do {
-+      ssize_t bytes_written_partial = HANDLE_EINTR(write(
-+          outfile,
-+          &buffer[bytes_written_per_read],
-+          bytes_read - bytes_written_per_read));
-+      if (bytes_written_partial < 0) {
-+        result = false;
-+        break;
-+      }
-+      bytes_written_per_read += bytes_written_partial;
-+    } while (bytes_written_per_read < bytes_read);
-+  }
-+
-+  if (HANDLE_EINTR(close(infile)) < 0)
-+    result = false;
-+  if (HANDLE_EINTR(close(outfile)) < 0)
-+    result = false;
-+
-+  return result;
-+}
-+
-+}  // namespace file_util
+ bool GetShmemTempDir(FilePath* path) {
+-#ifdef ANDROID
++#if defined(ANDROID) || defined(OS_BSD)
+   return GetTempDir(path);
+ #else
+   *path = FilePath("/dev/shm");
 $NetBSD: patch-ipc_chromium_src_base_file__util__posix.cc,v 1.2 2012/03/06 12:34:09 ryoon Exp $
 
 --- mozilla/ipc/chromium/src/base/file_util_posix.cc.orig	2011-12-20 23:28:19.000000000 +0000
@@ -532,11 +447,15 @@
 
 --- mozilla/ipc/chromium/src/base/platform_thread.h.orig	2011-12-20 23:28:19.000000000 +0000
 +++ mozilla/ipc/chromium/src/base/platform_thread.h
-@@ -25,6 +25,8 @@ typedef pthread_t PlatformThreadHandle;
- #if defined(OS_LINUX)
+@@ -22,9 +22,11 @@ typedef void* PlatformThreadHandle;  // HANDLE
+ #elif defined(OS_POSIX)
+ #include <pthread.h>
+ typedef pthread_t PlatformThreadHandle;
+-#if defined(OS_LINUX)
++#if defined(OS_LINUX) || defined(OS_OPENBSD)
  #include <unistd.h>
  typedef pid_t PlatformThreadId;
-+#elif defined(OS_FREEBSD) || defined(OS_DRAGONFLY) || defined (OS_NETBSD)
++#elif defined(OS_BSD)
 +typedef lwpid_t PlatformThreadId;
  #elif defined(OS_MACOSX)
  #include <mach/mach.h>
@@ -545,7 +464,7 @@
 
 --- mozilla/ipc/chromium/src/base/platform_thread_posix.cc.orig	2012-03-13 01:36:53.000000000 +0000
 +++ mozilla/ipc/chromium/src/base/platform_thread_posix.cc
-@@ -9,9 +9,18 @@
+@@ -9,9 +9,23 @@
  
  #if defined(OS_MACOSX)
  #include <mach/mach.h>
@@ -557,14 +476,19 @@
 +#elif defined(OS_DRAGONFLY)
 +#include <unistd.h>
 +#elif defined(OS_FREEBSD)
++#include <sys/param.h>
++#if __FreeBSD_version > 802500
++#include <sys/thr.h>
++#else
 +_Pragma("GCC visibility push(default)")
-+extern "C" int thr_self(long *); // XXX #include <sys/thr.h>
++extern "C" int thr_self(long *);
 +_Pragma("GCC visibility pop")
++#endif
 +#include <pthread_np.h>
  #endif
  
  #if defined(OS_MACOSX)
-@@ -38,7 +45,19 @@
+@@ -38,9 +45,20 @@
    // into the kernel.
  #if defined(OS_MACOSX)
    return mach_thread_self();
@@ -582,9 +506,38 @@
 +    return lwpid;
 +#  endif
 +#elif defined(OS_OPENBSD)
-   // TODO(BSD): find a better thread ID
-   return (intptr_t)(pthread_self());
+-  // TODO(BSD): find a better thread ID
+-  return (intptr_t)(pthread_self());
++  return (intptr_t) (pthread_self());
  #elif defined(OS_LINUX)
+   return syscall(__NR_gettid);
+ #endif
+diff --git mozilla/ipc/chromium/src/base/ref_counted.h mozilla/ipc/chromium/src/base/ref_counted.h
+index 013bd66..18e2794 100644
+--- mozilla/ipc/chromium/src/base/ref_counted.h
++++ mozilla/ipc/chromium/src/base/ref_counted.h
+@@ -28,7 +28,7 @@ class RefCountedBase {
+   bool in_dtor_;
+ #endif
+ 
+-  DFAKE_MUTEX(add_release_);
++  DFAKE_MUTEX(add_release_)
+ 
+   DISALLOW_COPY_AND_ASSIGN(RefCountedBase);
+ };
+diff --git mozilla/ipc/chromium/src/chrome/common/file_descriptor_set_posix.h mozilla/ipc/chromium/src/chrome/common/file_descriptor_set_posix.h
+index 342e6d9..b011baf 100644
+--- mozilla/ipc/chromium/src/chrome/common/file_descriptor_set_posix.h
++++ mozilla/ipc/chromium/src/chrome/common/file_descriptor_set_posix.h
+@@ -30,7 +30,7 @@ class FileDescriptorSet : public base::RefCountedThreadSafe<FileDescriptorSet> {
+   // In debugging mode, it's a fatal error to try and add more than this number
+   // of descriptors to a FileDescriptorSet.
+   enum {
+-    MAX_DESCRIPTORS_PER_MESSAGE = 4,
++    MAX_DESCRIPTORS_PER_MESSAGE = 4
+   };
+ 
+   // ---------------------------------------------------------------------------
 $NetBSD: patch-ipc_chromium_src_base_process__util.h,v 1.1 2012/03/06 12:34:09 ryoon Exp $
 
 --- mozilla/ipc/chromium/src/base/process_util.h.orig	2011-12-21 00:28:19.000000000 +0100
@@ -626,7 +579,7 @@
 
 --- mozilla/ipc/chromium/src/base/process_util_bsd.cc.orig	2012-04-01 00:04:28.000000000 +0000
 +++ mozilla/ipc/chromium/src/base/process_util_bsd.cc
-@@ -0,0 +1,322 @@
+@@ -0,0 +1,320 @@
 +// Copyright (c) 2008 The Chromium Authors. All rights reserved.
 +// Use of this source code is governed by a BSD-style license that can be
 +// found in the LICENSE file.
@@ -635,35 +588,20 @@
 +
 +#include "base/process_util.h"
 +
-+#include <ctype.h>
-+#include <fcntl.h>
-+#include <unistd.h>
-+#include <string>
-+#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD)
-+/* DragonFly, as of v3.0.1, and FreeBSD 9.0-RELEASE do not explicitly mark symbols public */
-+#define PRE_SYS_INCLUDE		_Pragma("GCC visibility push(default)")
-+#define POST_SYS_INCLUDE	_Pragma("GCC visibility pop")
-+#else
-+#define PRE_SYS_INCLUDE
-+#define POST_SYS_INCLUDE
-+#endif
-+PRE_SYS_INCLUDE
-+#include <kvm.h>
-+POST_SYS_INCLUDE
-+#include <sys/sysctl.h>
 +#include <sys/types.h>
++#include <sys/sysctl.h>
 +#include <sys/wait.h>
-+#if defined(OS_DRAGONFLY)
-+PRE_SYS_INCLUDE
-+#include <sys/user.h>
-+POST_SYS_INCLUDE
-+#endif
-+#if defined(OS_FREEBSD)
-+PRE_SYS_INCLUDE
++#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD)
 +#include <sys/user.h>
-+POST_SYS_INCLUDE
 +#endif
 +
++#include <ctype.h>
++#include <fcntl.h>
++#include <kvm.h>
++#include <unistd.h>
++
++#include <string>
++
 +#include "base/debug_util.h"
 +#include "base/eintr_wrapper.h"
 +#include "base/file_util.h"
@@ -671,15 +609,28 @@
 +#include "base/string_tokenizer.h"
 +#include "base/string_util.h"
 +
++#ifdef OS_NETBSD
++#include <sys/param.h>
++#if __NetBSD_Version__ >= 599006500
++#define HAVE_POSIX_SPAWN	1
++#endif
++#endif
++
 +#if defined(_POSIX_SPAWN) && _POSIX_SPAWN > 0
 +#define HAVE_POSIX_SPAWN	1
 +#endif
 +
++#ifndef __dso_public
++# ifdef __exported
++#  define __dso_public	__exported
++# else
++#  define __dso_public	__attribute__((__visibility__("default")))
++# endif
++#endif
++
 +#ifdef HAVE_POSIX_SPAWN
-+PRE_SYS_INCLUDE
 +#include <spawn.h>
-+extern "C" char **environ;
-+POST_SYS_INCLUDE
++extern "C" char **environ __dso_public;
 +#endif
 +
 +namespace {
@@ -1091,24 +1042,30 @@
 
 --- mozilla/ipc/chromium/src/build/build_config.h.orig	2012-03-13 01:36:53.000000000 +0000
 +++ mozilla/ipc/chromium/src/build/build_config.h
-@@ -19,17 +19,23 @@
+@@ -19,6 +19,12 @@
  #define OS_MACOSX 1
  #elif defined(__linux__) || defined(ANDROID)
  #define OS_LINUX 1
-+#elif defined(__NetBSD__)
-+#define OS_NETBSD 1
 +#elif defined(__DragonFly__)
 +#define OS_DRAGONFLY 1
++#elif defined(__FreeBSD__)
++#define OS_FREEBSD 1
++#elif defined(__NetBSD__)
++#define OS_NETBSD 1
  #elif defined(__OpenBSD__)
  #define OS_OPENBSD 1
  #elif defined(_WIN32)
- #define OS_WIN 1
-+#elif defined(__FreeBSD__)
-+#define OS_FREEBSD 1
- #else
+@@ -27,9 +33,16 @@
  #error Please add support for your platform in build/build_config.h
  #endif
  
++// For access to standard BSD features, use OS_BSD instead of a
++// more specific macro.
++#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD)	\
++  || defined(OS_NETBSD) || defined(OS_OPENBSD)
++#define OS_BSD 1
++#endif
++
  // For access to standard POSIX features, use OS_POSIX instead of a more
  // specific macro.
 -#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_OPENBSD)
@@ -1150,7 +1107,7 @@
  #endif
  
 -#if !(defined(OS_MACOSX) || defined(OS_OPENBSD) || defined(OS_WIN) || (defined(OS_LINUX) && defined(ARCH_CPU_64_BITS)) || defined(ARCH_CPU_S390))
-+#if !(defined(OS_MACOSX) || defined(OS_OPENBSD) || defined(OS_WIN) || ((defined(OS_FREEBSD) || defined(OS_DRAGONFLY) || defined(OS_NETBSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS)) || defined(ARCH_CPU_S390))
++#if !(defined(OS_MACOSX) || defined(OS_OPENBSD) || defined(OS_WIN) || ((defined(OS_BSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS)) || defined(ARCH_CPU_S390))
  // There size_t is a synonym for |unsigned long| ...
  template <>
  struct ParamTraits<size_t> {
@@ -1159,7 +1116,7 @@
  #endif  // defined(OS_MACOSX)
  
 -#if !(defined(OS_LINUX) && defined(ARCH_CPU_64_BITS))
-+#if !((defined(OS_FREEBSD) || defined(OS_DRAGONFLY) || defined(OS_NETBSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS))
++#if !((defined(OS_BSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS))
  // int64 is |long int| on 64-bit systems, uint64 is |unsigned long|
  template <>
  struct ParamTraits<int64> {
@@ -1181,7 +1138,7 @@
    };
    typedef HandleAndSequenceNum Id;
 -#elif defined(OS_MACOSX)
-+#elif defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_BSD)
++#elif defined(OS_MACOSX) || defined(OS_BSD)
    typedef base::SharedMemoryHandle Handle;
    // On Mac, the inode number of the backing file is used as an id.
    typedef base::SharedMemoryId Id;
@@ -1259,7 +1216,7 @@
  
 +ifneq (,$(filter DragonFly FreeBSD NetBSD OpenBSD,$(OS_ARCH)))
 +OS_LIBS += $(call EXPAND_LIBNAME,kvm)
-+#EXTRA_DSO_LDOPTS += -Wl,--ignore-unresolved-symbol,environ
++# keep `environ' unresolved, see bug 14426 for binutils
 +EXTRA_DSO_LDOPTS += -Wl,--warn-unresolved-symbols
 +endif
 +

Modified: branches/experimental/mail/thunderbird/files/patch-bug753046
==============================================================================
--- branches/experimental/mail/thunderbird/files/patch-bug753046	Thu Aug  9 06:40:34 2012	(r915)
+++ branches/experimental/mail/thunderbird/files/patch-bug753046	Thu Aug  9 06:40:45 2012	(r916)
@@ -4,15 +4,14 @@
 
 --- mozilla/dom/plugins/ipc/PluginModuleChild.cpp.orig	2011-12-20 23:28:14.000000000 +0000
 +++ mozilla/dom/plugins/ipc/PluginModuleChild.cpp
-@@ -33,6 +33,8 @@
- #include "nsPluginsDir.h"
- #include "nsXULAppAPI.h"
+@@ -5,6 +5,7 @@
+  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  
-+#include <unistd.h>
-+
- #ifdef MOZ_X11
- # include "mozilla/X11Util.h"
- #endif
+ #ifdef MOZ_WIDGET_QT
++#include <unistd.h> // for _exit()
+ #include <QtCore/QTimer>
+ #include "nsQAppInstance.h"
+ #include "NestedLoopTimer.h"
 @@ -228,7 +228,7 @@ PluginModuleChild::Init(const std::strin
  
      // TODO: use PluginPRLibrary here
@@ -65,7 +64,7 @@
 +
 +CPPSRCS += \
 +  atomicops_internals_x86_gcc.cc \
-+  file_util_bsd.cc \
++  file_util_linux.cc \
 +  process_util_bsd.cc \
 +  time_posix.cc \
 +  $(NULL)
@@ -244,7 +243,7 @@
  
  // Based on Apple's recommended method as described in
  // http://developer.apple.com/qa/qa2004/qa1361.html
-@@ -71,7 +76,13 @@ bool DebugUtil::BeingDebugged() {
+@@ -71,7 +76,15 @@ bool DebugUtil::BeingDebugged() {
  
    // This process is being debugged if the P_TRACED flag is set.
    is_set = true;
@@ -252,6 +251,8 @@
 +  being_debugged = (info.kp_flags & P_TRACED) != 0;
 +#elif defined(OS_FREEBSD)
 +  being_debugged = (info.ki_flag & P_TRACED) != 0;
++#elif defined(OS_OPENBSD)
++  being_debugged = (info.p_flag & P_TRACED) != 0;
 +#else
    being_debugged = (info.kp_proc.p_flag & P_TRACED) != 0;
 +#endif
@@ -399,105 +400,19 @@
  #else
  typedef DirReaderFallback DirReaderPosix;
  #endif
-$NetBSD: patch-ipc_chromium_src_base_file__util.h,v 1.2 2012/03/06 12:34:09 ryoon Exp $
-
---- mozilla/ipc/chromium/src/base/file_util.h.orig	2011-12-20 23:28:19.000000000 +0000
-+++ mozilla/ipc/chromium/src/base/file_util.h
-@@ -16,8 +16,8 @@
- #include <sys/stat.h>
- #elif defined(OS_POSIX) 
- #include <sys/types.h>
--#include <fts.h>
- #include <sys/stat.h>
-+#include <fts.h>
- #endif
+diff --git mozilla/ipc/chromium/src/base/file_util_linux.cc mozilla/ipc/chromium/src/base/file_util_linux.cc
+index 171e44f..0c6dfcc 100644
+--- mozilla/ipc/chromium/src/base/file_util_linux.cc
++++ mozilla/ipc/chromium/src/base/file_util_linux.cc
+@@ -28,7 +28,7 @@ bool GetTempDir(FilePath* path) {
+ }
  
- #include <stdio.h>
-$NetBSD: patch-ipc_chromium_src_base_file__util__bsd.cc,v 1.1 2012/03/06 12:34:09 ryoon Exp $
-
---- mozilla/ipc/chromium/src/base/file_util_bsd.cc.orig	2012-01-07 18:21:18.000000000 +0000
-+++ mozilla/ipc/chromium/src/base/file_util_bsd.cc
-@@ -0,0 +1,80 @@
-+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style license that can be
-+// found in the LICENSE file.
-+
-+// this is a derivative of file_util_linux.cc
-+
-+#include "base/file_util.h"
-+
-+#include <fcntl.h>
-+#include <unistd.h>
-+
-+#include <string>
-+#include <vector>
-+
-+#include "base/eintr_wrapper.h"
-+#include "base/file_path.h"
-+#include "base/string_util.h"
-+
-+namespace file_util {
-+
-+bool GetTempDir(FilePath* path) {
-+  const char* tmp = getenv("TMPDIR");
-+  if (tmp)
-+    *path = FilePath(tmp);
-+  else
-+    *path = FilePath("/tmp");
-+  return true;
-+}
-+
-+bool GetShmemTempDir(FilePath* path) {
-+  return GetTempDir(path);
-+}
-+
-+bool CopyFile(const FilePath& from_path, const FilePath& to_path) {
-+  int infile = open(from_path.value().c_str(), O_RDONLY);
-+  if (infile < 0)
-+    return false;
-+
-+  int outfile = creat(to_path.value().c_str(), 0666);
-+  if (outfile < 0) {
-+    close(infile);
-+    return false;
-+  }
-+
-+  const size_t kBufferSize = 32768;
-+  std::vector<char> buffer(kBufferSize);
-+  bool result = true;
-+
-+  while (result) {
-+    ssize_t bytes_read = HANDLE_EINTR(read(infile, &buffer[0], buffer.size()));
-+    if (bytes_read < 0) {
-+      result = false;
-+      break;
-+    }
-+    if (bytes_read == 0)
-+      break;
-+    // Allow for partial writes
-+    ssize_t bytes_written_per_read = 0;
-+    do {
-+      ssize_t bytes_written_partial = HANDLE_EINTR(write(
-+          outfile,
-+          &buffer[bytes_written_per_read],
-+          bytes_read - bytes_written_per_read));
-+      if (bytes_written_partial < 0) {
-+        result = false;
-+        break;
-+      }
-+      bytes_written_per_read += bytes_written_partial;
-+    } while (bytes_written_per_read < bytes_read);
-+  }
-+
-+  if (HANDLE_EINTR(close(infile)) < 0)
-+    result = false;
-+  if (HANDLE_EINTR(close(outfile)) < 0)
-+    result = false;
-+
-+  return result;
-+}
-+
-+}  // namespace file_util
+ bool GetShmemTempDir(FilePath* path) {
+-#ifdef ANDROID
++#if defined(ANDROID) || defined(OS_BSD)
+   return GetTempDir(path);
+ #else
+   *path = FilePath("/dev/shm");
 $NetBSD: patch-ipc_chromium_src_base_file__util__posix.cc,v 1.2 2012/03/06 12:34:09 ryoon Exp $
 
 --- mozilla/ipc/chromium/src/base/file_util_posix.cc.orig	2011-12-20 23:28:19.000000000 +0000
@@ -537,11 +452,15 @@
 
 --- mozilla/ipc/chromium/src/base/platform_thread.h.orig	2011-12-20 23:28:19.000000000 +0000
 +++ mozilla/ipc/chromium/src/base/platform_thread.h
-@@ -25,6 +25,8 @@ typedef pthread_t PlatformThreadHandle;
- #if defined(OS_LINUX)
+@@ -22,9 +22,11 @@ typedef void* PlatformThreadHandle;  // HANDLE
+ #elif defined(OS_POSIX)
+ #include <pthread.h>
+ typedef pthread_t PlatformThreadHandle;
+-#if defined(OS_LINUX)
++#if defined(OS_LINUX) || defined(OS_OPENBSD)
  #include <unistd.h>
  typedef pid_t PlatformThreadId;
-+#elif defined(OS_FREEBSD) || defined(OS_DRAGONFLY) || defined (OS_NETBSD)
++#elif defined(OS_BSD)
 +typedef lwpid_t PlatformThreadId;
  #elif defined(OS_MACOSX)
  #include <mach/mach.h>
@@ -550,7 +469,7 @@
 
 --- mozilla/ipc/chromium/src/base/platform_thread_posix.cc.orig	2012-03-13 01:36:53.000000000 +0000
 +++ mozilla/ipc/chromium/src/base/platform_thread_posix.cc
-@@ -9,9 +9,18 @@
+@@ -9,9 +9,23 @@
  
  #if defined(OS_MACOSX)
  #include <mach/mach.h>
@@ -562,14 +481,19 @@
 +#elif defined(OS_DRAGONFLY)
 +#include <unistd.h>
 +#elif defined(OS_FREEBSD)
++#include <sys/param.h>
++#if __FreeBSD_version > 802500
++#include <sys/thr.h>
++#else
 +_Pragma("GCC visibility push(default)")
-+extern "C" int thr_self(long *); // XXX #include <sys/thr.h>
++extern "C" int thr_self(long *);
 +_Pragma("GCC visibility pop")
++#endif
 +#include <pthread_np.h>
  #endif
  
  #if defined(OS_MACOSX)
-@@ -38,7 +45,19 @@
+@@ -38,9 +45,20 @@
    // into the kernel.
  #if defined(OS_MACOSX)
    return mach_thread_self();
@@ -587,9 +511,38 @@
 +    return lwpid;
 +#  endif
 +#elif defined(OS_OPENBSD)
-   // TODO(BSD): find a better thread ID
-   return (intptr_t)(pthread_self());
+-  // TODO(BSD): find a better thread ID
+-  return (intptr_t)(pthread_self());
++  return (intptr_t) (pthread_self());
  #elif defined(OS_LINUX)
+   return syscall(__NR_gettid);
+ #endif
+diff --git mozilla/ipc/chromium/src/base/ref_counted.h mozilla/ipc/chromium/src/base/ref_counted.h
+index 013bd66..18e2794 100644
+--- mozilla/ipc/chromium/src/base/ref_counted.h
++++ mozilla/ipc/chromium/src/base/ref_counted.h
+@@ -28,7 +28,7 @@ class RefCountedBase {
+   bool in_dtor_;
+ #endif
+ 
+-  DFAKE_MUTEX(add_release_);
++  DFAKE_MUTEX(add_release_)
+ 
+   DISALLOW_COPY_AND_ASSIGN(RefCountedBase);
+ };
+diff --git mozilla/ipc/chromium/src/chrome/common/file_descriptor_set_posix.h mozilla/ipc/chromium/src/chrome/common/file_descriptor_set_posix.h
+index 342e6d9..b011baf 100644
+--- mozilla/ipc/chromium/src/chrome/common/file_descriptor_set_posix.h
++++ mozilla/ipc/chromium/src/chrome/common/file_descriptor_set_posix.h
+@@ -30,7 +30,7 @@ class FileDescriptorSet : public base::RefCountedThreadSafe<FileDescriptorSet> {
+   // In debugging mode, it's a fatal error to try and add more than this number
+   // of descriptors to a FileDescriptorSet.
+   enum {
+-    MAX_DESCRIPTORS_PER_MESSAGE = 4,
++    MAX_DESCRIPTORS_PER_MESSAGE = 4
+   };
+ 
+   // ---------------------------------------------------------------------------
 $NetBSD: patch-ipc_chromium_src_base_process__util.h,v 1.1 2012/03/06 12:34:09 ryoon Exp $
 
 --- mozilla/ipc/chromium/src/base/process_util.h.orig	2011-12-21 00:28:19.000000000 +0100
@@ -631,7 +584,7 @@
 
 --- mozilla/ipc/chromium/src/base/process_util_bsd.cc.orig	2012-04-01 00:04:28.000000000 +0000
 +++ mozilla/ipc/chromium/src/base/process_util_bsd.cc
-@@ -0,0 +1,322 @@
+@@ -0,0 +1,320 @@
 +// Copyright (c) 2008 The Chromium Authors. All rights reserved.
 +// Use of this source code is governed by a BSD-style license that can be
 +// found in the LICENSE file.
@@ -640,35 +593,20 @@
 +
 +#include "base/process_util.h"
 +
-+#include <ctype.h>
-+#include <fcntl.h>
-+#include <unistd.h>
-+#include <string>
-+#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD)
-+/* DragonFly, as of v3.0.1, and FreeBSD 9.0-RELEASE do not explicitly mark symbols public */
-+#define PRE_SYS_INCLUDE		_Pragma("GCC visibility push(default)")
-+#define POST_SYS_INCLUDE	_Pragma("GCC visibility pop")
-+#else
-+#define PRE_SYS_INCLUDE
-+#define POST_SYS_INCLUDE
-+#endif
-+PRE_SYS_INCLUDE
-+#include <kvm.h>
-+POST_SYS_INCLUDE
-+#include <sys/sysctl.h>
 +#include <sys/types.h>
++#include <sys/sysctl.h>
 +#include <sys/wait.h>
-+#if defined(OS_DRAGONFLY)
-+PRE_SYS_INCLUDE
-+#include <sys/user.h>
-+POST_SYS_INCLUDE
-+#endif
-+#if defined(OS_FREEBSD)
-+PRE_SYS_INCLUDE
++#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD)
 +#include <sys/user.h>
-+POST_SYS_INCLUDE
 +#endif
 +
++#include <ctype.h>
++#include <fcntl.h>
++#include <kvm.h>
++#include <unistd.h>
++
++#include <string>
++
 +#include "base/debug_util.h"
 +#include "base/eintr_wrapper.h"
 +#include "base/file_util.h"
@@ -676,15 +614,28 @@
 +#include "base/string_tokenizer.h"
 +#include "base/string_util.h"
 +
++#ifdef OS_NETBSD
++#include <sys/param.h>
++#if __NetBSD_Version__ >= 599006500
++#define HAVE_POSIX_SPAWN	1
++#endif
++#endif
++
 +#if defined(_POSIX_SPAWN) && _POSIX_SPAWN > 0
 +#define HAVE_POSIX_SPAWN	1
 +#endif
 +
++#ifndef __dso_public
++# ifdef __exported
++#  define __dso_public	__exported
++# else
++#  define __dso_public	__attribute__((__visibility__("default")))
++# endif
++#endif
++
 +#ifdef HAVE_POSIX_SPAWN
-+PRE_SYS_INCLUDE
 +#include <spawn.h>
-+extern "C" char **environ;
-+POST_SYS_INCLUDE
++extern "C" char **environ __dso_public;
 +#endif
 +
 +namespace {
@@ -1096,24 +1047,30 @@
 
 --- mozilla/ipc/chromium/src/build/build_config.h.orig	2012-03-13 01:36:53.000000000 +0000
 +++ mozilla/ipc/chromium/src/build/build_config.h
-@@ -19,17 +19,23 @@
+@@ -19,6 +19,12 @@
  #define OS_MACOSX 1
  #elif defined(__linux__) || defined(ANDROID)
  #define OS_LINUX 1
-+#elif defined(__NetBSD__)
-+#define OS_NETBSD 1
 +#elif defined(__DragonFly__)
 +#define OS_DRAGONFLY 1
++#elif defined(__FreeBSD__)
++#define OS_FREEBSD 1
++#elif defined(__NetBSD__)
++#define OS_NETBSD 1
  #elif defined(__OpenBSD__)
  #define OS_OPENBSD 1
  #elif defined(_WIN32)
- #define OS_WIN 1
-+#elif defined(__FreeBSD__)
-+#define OS_FREEBSD 1
- #else
+@@ -27,9 +33,16 @@
  #error Please add support for your platform in build/build_config.h
  #endif
  
++// For access to standard BSD features, use OS_BSD instead of a
++// more specific macro.
++#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD)	\
++  || defined(OS_NETBSD) || defined(OS_OPENBSD)
++#define OS_BSD 1
++#endif
++
  // For access to standard POSIX features, use OS_POSIX instead of a more
  // specific macro.
 -#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_OPENBSD)
@@ -1155,7 +1112,7 @@
  #endif
  
 -#if !(defined(OS_MACOSX) || defined(OS_OPENBSD) || defined(OS_WIN) || (defined(OS_LINUX) && defined(ARCH_CPU_64_BITS)) || defined(ARCH_CPU_S390))
-+#if !(defined(OS_MACOSX) || defined(OS_OPENBSD) || defined(OS_WIN) || ((defined(OS_FREEBSD) || defined(OS_DRAGONFLY) || defined(OS_NETBSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS)) || defined(ARCH_CPU_S390))
++#if !(defined(OS_MACOSX) || defined(OS_OPENBSD) || defined(OS_WIN) || ((defined(OS_BSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS)) || defined(ARCH_CPU_S390))
  // There size_t is a synonym for |unsigned long| ...
  template <>
  struct ParamTraits<size_t> {
@@ -1164,7 +1121,7 @@
  #endif  // defined(OS_MACOSX)
  
 -#if !(defined(OS_LINUX) && defined(ARCH_CPU_64_BITS))
-+#if !((defined(OS_FREEBSD) || defined(OS_DRAGONFLY) || defined(OS_NETBSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS))
++#if !((defined(OS_BSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS))
  // int64 is |long int| on 64-bit systems, uint64 is |unsigned long|
  template <>
  struct ParamTraits<int64> {
@@ -1186,7 +1143,7 @@
    };
    typedef HandleAndSequenceNum Id;
 -#elif defined(OS_MACOSX)
-+#elif defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_BSD)
++#elif defined(OS_MACOSX) || defined(OS_BSD)
    typedef base::SharedMemoryHandle Handle;
    // On Mac, the inode number of the backing file is used as an id.
    typedef base::SharedMemoryId Id;
@@ -1264,7 +1221,7 @@
  
 +ifneq (,$(filter DragonFly FreeBSD NetBSD OpenBSD,$(OS_ARCH)))
 +OS_LIBS += $(call EXPAND_LIBNAME,kvm)
-+#EXTRA_DSO_LDOPTS += -Wl,--ignore-unresolved-symbol,environ
++# keep `environ' unresolved, see bug 14426 for binutils
 +EXTRA_DSO_LDOPTS += -Wl,--warn-unresolved-symbols
 +endif
 +

Modified: branches/experimental/www/firefox-esr/files/patch-bug753046
==============================================================================
--- branches/experimental/www/firefox-esr/files/patch-bug753046	Thu Aug  9 06:40:34 2012	(r915)
+++ branches/experimental/www/firefox-esr/files/patch-bug753046	Thu Aug  9 06:40:45 2012	(r916)
@@ -4,15 +4,14 @@
 
 --- dom/plugins/ipc/PluginModuleChild.cpp.orig	2011-12-20 23:28:14.000000000 +0000
 +++ dom/plugins/ipc/PluginModuleChild.cpp
-@@ -33,6 +33,8 @@
- #include "nsPluginsDir.h"
- #include "nsXULAppAPI.h"
+@@ -5,6 +5,7 @@
+  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  
-+#include <unistd.h>
-+
- #ifdef MOZ_X11
- # include "mozilla/X11Util.h"
- #endif
+ #ifdef MOZ_WIDGET_QT
++#include <unistd.h> // for _exit()
+ #include <QtCore/QTimer>
+ #include "nsQAppInstance.h"
+ #include "NestedLoopTimer.h"
 @@ -228,7 +228,7 @@ PluginModuleChild::Init(const std::strin
  
      // TODO: use PluginPRLibrary here
@@ -65,7 +64,7 @@
 +
 +CPPSRCS += \
 +  atomicops_internals_x86_gcc.cc \
-+  file_util_bsd.cc \
++  file_util_linux.cc \
 +  process_util_bsd.cc \
 +  time_posix.cc \
 +  $(NULL)
@@ -244,7 +243,7 @@
  
  // Based on Apple's recommended method as described in
  // http://developer.apple.com/qa/qa2004/qa1361.html
-@@ -71,7 +76,13 @@ bool DebugUtil::BeingDebugged() {
+@@ -71,7 +76,15 @@ bool DebugUtil::BeingDebugged() {
  
    // This process is being debugged if the P_TRACED flag is set.
    is_set = true;
@@ -252,6 +251,8 @@
 +  being_debugged = (info.kp_flags & P_TRACED) != 0;
 +#elif defined(OS_FREEBSD)
 +  being_debugged = (info.ki_flag & P_TRACED) != 0;
++#elif defined(OS_OPENBSD)
++  being_debugged = (info.p_flag & P_TRACED) != 0;
 +#else
    being_debugged = (info.kp_proc.p_flag & P_TRACED) != 0;
 +#endif
@@ -394,105 +395,19 @@
  #else
  typedef DirReaderFallback DirReaderPosix;
  #endif
-$NetBSD: patch-ipc_chromium_src_base_file__util.h,v 1.2 2012/03/06 12:34:09 ryoon Exp $
-
---- ipc/chromium/src/base/file_util.h.orig	2011-12-20 23:28:19.000000000 +0000
-+++ ipc/chromium/src/base/file_util.h
-@@ -16,8 +16,8 @@
- #include <sys/stat.h>
- #elif defined(OS_POSIX) 
- #include <sys/types.h>
--#include <fts.h>
- #include <sys/stat.h>
-+#include <fts.h>
- #endif
+diff --git ipc/chromium/src/base/file_util_linux.cc ipc/chromium/src/base/file_util_linux.cc
+index 171e44f..0c6dfcc 100644
+--- ipc/chromium/src/base/file_util_linux.cc
++++ ipc/chromium/src/base/file_util_linux.cc
+@@ -28,7 +28,7 @@ bool GetTempDir(FilePath* path) {
+ }
  
- #include <stdio.h>
-$NetBSD: patch-ipc_chromium_src_base_file__util__bsd.cc,v 1.1 2012/03/06 12:34:09 ryoon Exp $
-
---- ipc/chromium/src/base/file_util_bsd.cc.orig	2012-01-07 18:21:18.000000000 +0000
-+++ ipc/chromium/src/base/file_util_bsd.cc
-@@ -0,0 +1,80 @@
-+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style license that can be
-+// found in the LICENSE file.
-+
-+// this is a derivative of file_util_linux.cc
-+
-+#include "base/file_util.h"
-+
-+#include <fcntl.h>
-+#include <unistd.h>
-+
-+#include <string>
-+#include <vector>
-+
-+#include "base/eintr_wrapper.h"
-+#include "base/file_path.h"
-+#include "base/string_util.h"
-+
-+namespace file_util {
-+
-+bool GetTempDir(FilePath* path) {
-+  const char* tmp = getenv("TMPDIR");
-+  if (tmp)
-+    *path = FilePath(tmp);
-+  else
-+    *path = FilePath("/tmp");
-+  return true;
-+}
-+
-+bool GetShmemTempDir(FilePath* path) {
-+  return GetTempDir(path);
-+}
-+
-+bool CopyFile(const FilePath& from_path, const FilePath& to_path) {
-+  int infile = open(from_path.value().c_str(), O_RDONLY);
-+  if (infile < 0)
-+    return false;
-+
-+  int outfile = creat(to_path.value().c_str(), 0666);
-+  if (outfile < 0) {
-+    close(infile);
-+    return false;
-+  }
-+
-+  const size_t kBufferSize = 32768;
-+  std::vector<char> buffer(kBufferSize);
-+  bool result = true;
-+
-+  while (result) {
-+    ssize_t bytes_read = HANDLE_EINTR(read(infile, &buffer[0], buffer.size()));
-+    if (bytes_read < 0) {
-+      result = false;
-+      break;
-+    }
-+    if (bytes_read == 0)
-+      break;
-+    // Allow for partial writes
-+    ssize_t bytes_written_per_read = 0;
-+    do {
-+      ssize_t bytes_written_partial = HANDLE_EINTR(write(
-+          outfile,
-+          &buffer[bytes_written_per_read],
-+          bytes_read - bytes_written_per_read));
-+      if (bytes_written_partial < 0) {
-+        result = false;
-+        break;
-+      }
-+      bytes_written_per_read += bytes_written_partial;
-+    } while (bytes_written_per_read < bytes_read);
-+  }
-+
-+  if (HANDLE_EINTR(close(infile)) < 0)
-+    result = false;
-+  if (HANDLE_EINTR(close(outfile)) < 0)
-+    result = false;
-+
-+  return result;
-+}
-+
-+}  // namespace file_util
+ bool GetShmemTempDir(FilePath* path) {
+-#ifdef ANDROID
++#if defined(ANDROID) || defined(OS_BSD)
+   return GetTempDir(path);
+ #else
+   *path = FilePath("/dev/shm");
 $NetBSD: patch-ipc_chromium_src_base_file__util__posix.cc,v 1.2 2012/03/06 12:34:09 ryoon Exp $
 
 --- ipc/chromium/src/base/file_util_posix.cc.orig	2011-12-20 23:28:19.000000000 +0000
@@ -532,11 +447,15 @@
 
 --- ipc/chromium/src/base/platform_thread.h.orig	2011-12-20 23:28:19.000000000 +0000
 +++ ipc/chromium/src/base/platform_thread.h
-@@ -25,6 +25,8 @@ typedef pthread_t PlatformThreadHandle;
- #if defined(OS_LINUX)
+@@ -22,9 +22,11 @@ typedef void* PlatformThreadHandle;  // HANDLE
+ #elif defined(OS_POSIX)
+ #include <pthread.h>
+ typedef pthread_t PlatformThreadHandle;
+-#if defined(OS_LINUX)
++#if defined(OS_LINUX) || defined(OS_OPENBSD)
  #include <unistd.h>
  typedef pid_t PlatformThreadId;
-+#elif defined(OS_FREEBSD) || defined(OS_DRAGONFLY) || defined (OS_NETBSD)
++#elif defined(OS_BSD)
 +typedef lwpid_t PlatformThreadId;
  #elif defined(OS_MACOSX)
  #include <mach/mach.h>
@@ -545,7 +464,7 @@
 
 --- ipc/chromium/src/base/platform_thread_posix.cc.orig	2012-03-13 01:36:53.000000000 +0000
 +++ ipc/chromium/src/base/platform_thread_posix.cc
-@@ -9,9 +9,18 @@
+@@ -9,9 +9,23 @@
  
  #if defined(OS_MACOSX)
  #include <mach/mach.h>
@@ -557,14 +476,19 @@
 +#elif defined(OS_DRAGONFLY)
 +#include <unistd.h>
 +#elif defined(OS_FREEBSD)
++#include <sys/param.h>
++#if __FreeBSD_version > 802500
++#include <sys/thr.h>
++#else
 +_Pragma("GCC visibility push(default)")
-+extern "C" int thr_self(long *); // XXX #include <sys/thr.h>
++extern "C" int thr_self(long *);
 +_Pragma("GCC visibility pop")
++#endif
 +#include <pthread_np.h>
  #endif
  
  #if defined(OS_MACOSX)
-@@ -38,7 +45,19 @@
+@@ -38,9 +45,20 @@
    // into the kernel.
  #if defined(OS_MACOSX)
    return mach_thread_self();
@@ -582,9 +506,38 @@
 +    return lwpid;
 +#  endif
 +#elif defined(OS_OPENBSD)
-   // TODO(BSD): find a better thread ID
-   return (intptr_t)(pthread_self());
+-  // TODO(BSD): find a better thread ID
+-  return (intptr_t)(pthread_self());
++  return (intptr_t) (pthread_self());
  #elif defined(OS_LINUX)
+   return syscall(__NR_gettid);
+ #endif
+diff --git ipc/chromium/src/base/ref_counted.h ipc/chromium/src/base/ref_counted.h
+index 013bd66..18e2794 100644
+--- ipc/chromium/src/base/ref_counted.h
++++ ipc/chromium/src/base/ref_counted.h
+@@ -28,7 +28,7 @@ class RefCountedBase {
+   bool in_dtor_;
+ #endif
+ 
+-  DFAKE_MUTEX(add_release_);
++  DFAKE_MUTEX(add_release_)
+ 
+   DISALLOW_COPY_AND_ASSIGN(RefCountedBase);
+ };
+diff --git ipc/chromium/src/chrome/common/file_descriptor_set_posix.h ipc/chromium/src/chrome/common/file_descriptor_set_posix.h
+index 342e6d9..b011baf 100644
+--- ipc/chromium/src/chrome/common/file_descriptor_set_posix.h
++++ ipc/chromium/src/chrome/common/file_descriptor_set_posix.h
+@@ -30,7 +30,7 @@ class FileDescriptorSet : public base::RefCountedThreadSafe<FileDescriptorSet> {
+   // In debugging mode, it's a fatal error to try and add more than this number
+   // of descriptors to a FileDescriptorSet.
+   enum {
+-    MAX_DESCRIPTORS_PER_MESSAGE = 4,
++    MAX_DESCRIPTORS_PER_MESSAGE = 4
+   };
+ 
+   // ---------------------------------------------------------------------------
 $NetBSD: patch-ipc_chromium_src_base_process__util.h,v 1.1 2012/03/06 12:34:09 ryoon Exp $
 
 --- ipc/chromium/src/base/process_util.h.orig	2011-12-21 00:28:19.000000000 +0100
@@ -626,7 +579,7 @@
 
 --- ipc/chromium/src/base/process_util_bsd.cc.orig	2012-04-01 00:04:28.000000000 +0000
 +++ ipc/chromium/src/base/process_util_bsd.cc
-@@ -0,0 +1,322 @@
+@@ -0,0 +1,320 @@
 +// Copyright (c) 2008 The Chromium Authors. All rights reserved.
 +// Use of this source code is governed by a BSD-style license that can be
 +// found in the LICENSE file.
@@ -635,35 +588,20 @@
 +
 +#include "base/process_util.h"
 +
-+#include <ctype.h>
-+#include <fcntl.h>
-+#include <unistd.h>
-+#include <string>
-+#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD)
-+/* DragonFly, as of v3.0.1, and FreeBSD 9.0-RELEASE do not explicitly mark symbols public */
-+#define PRE_SYS_INCLUDE		_Pragma("GCC visibility push(default)")
-+#define POST_SYS_INCLUDE	_Pragma("GCC visibility pop")
-+#else
-+#define PRE_SYS_INCLUDE
-+#define POST_SYS_INCLUDE
-+#endif
-+PRE_SYS_INCLUDE
-+#include <kvm.h>
-+POST_SYS_INCLUDE
-+#include <sys/sysctl.h>
 +#include <sys/types.h>
++#include <sys/sysctl.h>
 +#include <sys/wait.h>
-+#if defined(OS_DRAGONFLY)
-+PRE_SYS_INCLUDE
-+#include <sys/user.h>
-+POST_SYS_INCLUDE
-+#endif
-+#if defined(OS_FREEBSD)
-+PRE_SYS_INCLUDE
++#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD)
 +#include <sys/user.h>
-+POST_SYS_INCLUDE
 +#endif
 +
++#include <ctype.h>
++#include <fcntl.h>
++#include <kvm.h>
++#include <unistd.h>
++
++#include <string>
++
 +#include "base/debug_util.h"
 +#include "base/eintr_wrapper.h"
 +#include "base/file_util.h"
@@ -671,15 +609,28 @@
 +#include "base/string_tokenizer.h"
 +#include "base/string_util.h"
 +
++#ifdef OS_NETBSD
++#include <sys/param.h>
++#if __NetBSD_Version__ >= 599006500
++#define HAVE_POSIX_SPAWN	1
++#endif
++#endif
++
 +#if defined(_POSIX_SPAWN) && _POSIX_SPAWN > 0
 +#define HAVE_POSIX_SPAWN	1
 +#endif
 +
++#ifndef __dso_public
++# ifdef __exported
++#  define __dso_public	__exported
++# else
++#  define __dso_public	__attribute__((__visibility__("default")))
++# endif
++#endif
++
 +#ifdef HAVE_POSIX_SPAWN
-+PRE_SYS_INCLUDE
 +#include <spawn.h>
-+extern "C" char **environ;
-+POST_SYS_INCLUDE
++extern "C" char **environ __dso_public;
 +#endif
 +
 +namespace {
@@ -1091,24 +1042,30 @@
 
 --- ipc/chromium/src/build/build_config.h.orig	2012-03-13 01:36:53.000000000 +0000
 +++ ipc/chromium/src/build/build_config.h
-@@ -19,17 +19,23 @@
+@@ -19,6 +19,12 @@
  #define OS_MACOSX 1
  #elif defined(__linux__) || defined(ANDROID)
  #define OS_LINUX 1
-+#elif defined(__NetBSD__)
-+#define OS_NETBSD 1
 +#elif defined(__DragonFly__)
 +#define OS_DRAGONFLY 1
++#elif defined(__FreeBSD__)
++#define OS_FREEBSD 1
++#elif defined(__NetBSD__)
++#define OS_NETBSD 1
  #elif defined(__OpenBSD__)
  #define OS_OPENBSD 1
  #elif defined(_WIN32)
- #define OS_WIN 1
-+#elif defined(__FreeBSD__)
-+#define OS_FREEBSD 1
- #else
+@@ -27,9 +33,16 @@
  #error Please add support for your platform in build/build_config.h
  #endif
  
++// For access to standard BSD features, use OS_BSD instead of a
++// more specific macro.
++#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD)	\
++  || defined(OS_NETBSD) || defined(OS_OPENBSD)
++#define OS_BSD 1
++#endif
++
  // For access to standard POSIX features, use OS_POSIX instead of a more
  // specific macro.
 -#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_OPENBSD)
@@ -1150,7 +1107,7 @@
  #endif
  
 -#if !(defined(OS_MACOSX) || defined(OS_OPENBSD) || defined(OS_WIN) || (defined(OS_LINUX) && defined(ARCH_CPU_64_BITS)) || defined(ARCH_CPU_S390))
-+#if !(defined(OS_MACOSX) || defined(OS_OPENBSD) || defined(OS_WIN) || ((defined(OS_FREEBSD) || defined(OS_DRAGONFLY) || defined(OS_NETBSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS)) || defined(ARCH_CPU_S390))
++#if !(defined(OS_MACOSX) || defined(OS_OPENBSD) || defined(OS_WIN) || ((defined(OS_BSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS)) || defined(ARCH_CPU_S390))
  // There size_t is a synonym for |unsigned long| ...
  template <>
  struct ParamTraits<size_t> {
@@ -1159,7 +1116,7 @@
  #endif  // defined(OS_MACOSX)
  
 -#if !(defined(OS_LINUX) && defined(ARCH_CPU_64_BITS))
-+#if !((defined(OS_FREEBSD) || defined(OS_DRAGONFLY) || defined(OS_NETBSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS))
++#if !((defined(OS_BSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS))
  // int64 is |long int| on 64-bit systems, uint64 is |unsigned long|
  template <>
  struct ParamTraits<int64> {
@@ -1181,7 +1138,7 @@
    };
    typedef HandleAndSequenceNum Id;
 -#elif defined(OS_MACOSX)
-+#elif defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_BSD)
++#elif defined(OS_MACOSX) || defined(OS_BSD)
    typedef base::SharedMemoryHandle Handle;
    // On Mac, the inode number of the backing file is used as an id.
    typedef base::SharedMemoryId Id;
@@ -1259,7 +1216,7 @@
  
 +ifneq (,$(filter DragonFly FreeBSD NetBSD OpenBSD,$(OS_ARCH)))
 +OS_LIBS += $(call EXPAND_LIBNAME,kvm)
-+#EXTRA_DSO_LDOPTS += -Wl,--ignore-unresolved-symbol,environ
++# keep `environ' unresolved, see bug 14426 for binutils
 +EXTRA_DSO_LDOPTS += -Wl,--warn-unresolved-symbols
 +endif
 +

Modified: branches/experimental/www/firefox-nightly/files/patch-bug753046
==============================================================================
--- branches/experimental/www/firefox-nightly/files/patch-bug753046	Thu Aug  9 06:40:34 2012	(r915)
+++ branches/experimental/www/firefox-nightly/files/patch-bug753046	Thu Aug  9 06:40:45 2012	(r916)
@@ -4,15 +4,14 @@
 
 --- dom/plugins/ipc/PluginModuleChild.cpp.orig	2011-12-20 23:28:14.000000000 +0000
 +++ dom/plugins/ipc/PluginModuleChild.cpp
-@@ -33,6 +33,8 @@
- #include "nsPluginsDir.h"
- #include "nsXULAppAPI.h"
+@@ -5,6 +5,7 @@
+  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  
-+#include <unistd.h>
-+
- #ifdef MOZ_X11
- # include "mozilla/X11Util.h"
- #endif
+ #ifdef MOZ_WIDGET_QT
++#include <unistd.h> // for _exit()
+ #include <QtCore/QTimer>
+ #include "nsQAppInstance.h"
+ #include "NestedLoopTimer.h"
 @@ -228,7 +228,7 @@ PluginModuleChild::Init(const std::strin
  
      // TODO: use PluginPRLibrary here
@@ -65,7 +64,7 @@
 +
 +CPPSRCS += \
 +  atomicops_internals_x86_gcc.cc \
-+  file_util_bsd.cc \
++  file_util_linux.cc \
 +  process_util_bsd.cc \
 +  time_posix.cc \
 +  $(NULL)
@@ -244,7 +243,7 @@
  
  // Based on Apple's recommended method as described in
  // http://developer.apple.com/qa/qa2004/qa1361.html
-@@ -71,7 +76,13 @@ bool DebugUtil::BeingDebugged() {
+@@ -71,7 +76,15 @@ bool DebugUtil::BeingDebugged() {
  
    // This process is being debugged if the P_TRACED flag is set.
    is_set = true;
@@ -252,6 +251,8 @@
 +  being_debugged = (info.kp_flags & P_TRACED) != 0;
 +#elif defined(OS_FREEBSD)
 +  being_debugged = (info.ki_flag & P_TRACED) != 0;
++#elif defined(OS_OPENBSD)
++  being_debugged = (info.p_flag & P_TRACED) != 0;
 +#else
    being_debugged = (info.kp_proc.p_flag & P_TRACED) != 0;
 +#endif
@@ -399,105 +400,19 @@
  #else
  typedef DirReaderFallback DirReaderPosix;
  #endif
-$NetBSD: patch-ipc_chromium_src_base_file__util.h,v 1.2 2012/03/06 12:34:09 ryoon Exp $
-
---- ipc/chromium/src/base/file_util.h.orig	2011-12-20 23:28:19.000000000 +0000
-+++ ipc/chromium/src/base/file_util.h
-@@ -16,8 +16,8 @@
- #include <sys/stat.h>
- #elif defined(OS_POSIX) 
- #include <sys/types.h>
--#include <fts.h>
- #include <sys/stat.h>
-+#include <fts.h>
- #endif
+diff --git ipc/chromium/src/base/file_util_linux.cc ipc/chromium/src/base/file_util_linux.cc
+index 171e44f..0c6dfcc 100644
+--- ipc/chromium/src/base/file_util_linux.cc
++++ ipc/chromium/src/base/file_util_linux.cc
+@@ -28,7 +28,7 @@ bool GetTempDir(FilePath* path) {
+ }
  
- #include <stdio.h>
-$NetBSD: patch-ipc_chromium_src_base_file__util__bsd.cc,v 1.1 2012/03/06 12:34:09 ryoon Exp $
-
---- ipc/chromium/src/base/file_util_bsd.cc.orig	2012-01-07 18:21:18.000000000 +0000
-+++ ipc/chromium/src/base/file_util_bsd.cc
-@@ -0,0 +1,80 @@
-+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style license that can be
-+// found in the LICENSE file.
-+
-+// this is a derivative of file_util_linux.cc
-+
-+#include "base/file_util.h"
-+
-+#include <fcntl.h>
-+#include <unistd.h>
-+
-+#include <string>
-+#include <vector>
-+
-+#include "base/eintr_wrapper.h"
-+#include "base/file_path.h"
-+#include "base/string_util.h"
-+
-+namespace file_util {
-+
-+bool GetTempDir(FilePath* path) {
-+  const char* tmp = getenv("TMPDIR");
-+  if (tmp)
-+    *path = FilePath(tmp);
-+  else
-+    *path = FilePath("/tmp");
-+  return true;
-+}
-+
-+bool GetShmemTempDir(FilePath* path) {
-+  return GetTempDir(path);
-+}
-+
-+bool CopyFile(const FilePath& from_path, const FilePath& to_path) {
-+  int infile = open(from_path.value().c_str(), O_RDONLY);
-+  if (infile < 0)
-+    return false;
-+
-+  int outfile = creat(to_path.value().c_str(), 0666);
-+  if (outfile < 0) {
-+    close(infile);
-+    return false;
-+  }
-+
-+  const size_t kBufferSize = 32768;
-+  std::vector<char> buffer(kBufferSize);
-+  bool result = true;
-+
-+  while (result) {
-+    ssize_t bytes_read = HANDLE_EINTR(read(infile, &buffer[0], buffer.size()));
-+    if (bytes_read < 0) {
-+      result = false;
-+      break;
-+    }
-+    if (bytes_read == 0)
-+      break;
-+    // Allow for partial writes
-+    ssize_t bytes_written_per_read = 0;
-+    do {
-+      ssize_t bytes_written_partial = HANDLE_EINTR(write(
-+          outfile,
-+          &buffer[bytes_written_per_read],
-+          bytes_read - bytes_written_per_read));
-+      if (bytes_written_partial < 0) {
-+        result = false;
-+        break;
-+      }
-+      bytes_written_per_read += bytes_written_partial;
-+    } while (bytes_written_per_read < bytes_read);
-+  }
-+
-+  if (HANDLE_EINTR(close(infile)) < 0)
-+    result = false;
-+  if (HANDLE_EINTR(close(outfile)) < 0)
-+    result = false;
-+
-+  return result;
-+}
-+
-+}  // namespace file_util
+ bool GetShmemTempDir(FilePath* path) {
+-#ifdef ANDROID
++#if defined(ANDROID) || defined(OS_BSD)
+   return GetTempDir(path);
+ #else
+   *path = FilePath("/dev/shm");
 $NetBSD: patch-ipc_chromium_src_base_file__util__posix.cc,v 1.2 2012/03/06 12:34:09 ryoon Exp $
 
 --- ipc/chromium/src/base/file_util_posix.cc.orig	2011-12-20 23:28:19.000000000 +0000
@@ -537,11 +452,15 @@
 
 --- ipc/chromium/src/base/platform_thread.h.orig	2011-12-20 23:28:19.000000000 +0000
 +++ ipc/chromium/src/base/platform_thread.h
-@@ -25,6 +25,8 @@ typedef pthread_t PlatformThreadHandle;
- #if defined(OS_LINUX)
+@@ -22,9 +22,11 @@ typedef void* PlatformThreadHandle;  // HANDLE
+ #elif defined(OS_POSIX)
+ #include <pthread.h>
+ typedef pthread_t PlatformThreadHandle;
+-#if defined(OS_LINUX)
++#if defined(OS_LINUX) || defined(OS_OPENBSD)
  #include <unistd.h>
  typedef pid_t PlatformThreadId;
-+#elif defined(OS_FREEBSD) || defined(OS_DRAGONFLY) || defined (OS_NETBSD)
++#elif defined(OS_BSD)
 +typedef lwpid_t PlatformThreadId;
  #elif defined(OS_MACOSX)
  #include <mach/mach.h>
@@ -550,7 +469,7 @@
 
 --- ipc/chromium/src/base/platform_thread_posix.cc.orig	2012-03-13 01:36:53.000000000 +0000
 +++ ipc/chromium/src/base/platform_thread_posix.cc
-@@ -9,16 +9,25 @@
+@@ -9,16 +9,30 @@
  
  #if defined(OS_MACOSX)
  #include <mach/mach.h>
@@ -563,9 +482,14 @@
 -#elif !defined(__NetBSD__)
 -#include <pthread_np.h>
 +#elif defined(OS_FREEBSD)
++#include <sys/param.h>
++#if __FreeBSD_version > 802500
++#include <sys/thr.h>
++#else
 +_Pragma("GCC visibility push(default)")
-+extern "C" int thr_self(long *); // XXX #include <sys/thr.h>
++extern "C" int thr_self(long *);
 +_Pragma("GCC visibility pop")
++#endif
  #endif
 +
 +#if !defined(OS_MACOSX)
@@ -579,7 +503,7 @@
  #if defined(OS_MACOSX)
  namespace base {
  void InitThreading();
-@@ -38,7 +45,19 @@ PlatformThreadId PlatformThread::CurrentId() {
+@@ -38,9 +45,20 @@ PlatformThreadId PlatformThread::CurrentId() {
    // into the kernel.
  #if defined(OS_MACOSX)
    return mach_thread_self();
@@ -597,9 +521,12 @@
 +    return lwpid;
 +#  endif
 +#elif defined(OS_OPENBSD)
-   // TODO(BSD): find a better thread ID
-   return (intptr_t)(pthread_self());
+-  // TODO(BSD): find a better thread ID
+-  return (intptr_t)(pthread_self());
++  return (intptr_t) (pthread_self());
  #elif defined(OS_LINUX)
+   return syscall(__NR_gettid);
+ #endif
 @@ -102,9 +102,9 @@ void PlatformThread::SetName(const char* name) {
    // Note that glibc also has a 'pthread_setname_np' api, but it may not be
    // available everywhere and it's only benefit over using prctl directly is
@@ -612,6 +539,32 @@
    pthread_setname_np(pthread_self(), "%s", name);
  #else
    prctl(PR_SET_NAME, reinterpret_cast<uintptr_t>(name), 0, 0, 0); 
+diff --git ipc/chromium/src/base/ref_counted.h ipc/chromium/src/base/ref_counted.h
+index 013bd66..18e2794 100644
+--- ipc/chromium/src/base/ref_counted.h
++++ ipc/chromium/src/base/ref_counted.h
+@@ -28,7 +28,7 @@ class RefCountedBase {
+   bool in_dtor_;
+ #endif
+ 
+-  DFAKE_MUTEX(add_release_);
++  DFAKE_MUTEX(add_release_)
+ 
+   DISALLOW_COPY_AND_ASSIGN(RefCountedBase);
+ };
+diff --git ipc/chromium/src/chrome/common/file_descriptor_set_posix.h ipc/chromium/src/chrome/common/file_descriptor_set_posix.h
+index 342e6d9..b011baf 100644
+--- ipc/chromium/src/chrome/common/file_descriptor_set_posix.h
++++ ipc/chromium/src/chrome/common/file_descriptor_set_posix.h
+@@ -30,7 +30,7 @@ class FileDescriptorSet : public base::RefCountedThreadSafe<FileDescriptorSet> {
+   // In debugging mode, it's a fatal error to try and add more than this number
+   // of descriptors to a FileDescriptorSet.
+   enum {
+-    MAX_DESCRIPTORS_PER_MESSAGE = 4,
++    MAX_DESCRIPTORS_PER_MESSAGE = 4
+   };
+ 
+   // ---------------------------------------------------------------------------
 $NetBSD: patch-ipc_chromium_src_base_process__util.h,v 1.1 2012/03/06 12:34:09 ryoon Exp $
 
 --- ipc/chromium/src/base/process_util.h.orig	2011-12-21 00:28:19.000000000 +0100
@@ -653,7 +606,7 @@
 
 --- ipc/chromium/src/base/process_util_bsd.cc.orig	2012-04-01 00:04:28.000000000 +0000
 +++ ipc/chromium/src/base/process_util_bsd.cc
-@@ -0,0 +1,371 @@
+@@ -0,0 +1,369 @@
 +// Copyright (c) 2008 The Chromium Authors. All rights reserved.
 +// Use of this source code is governed by a BSD-style license that can be
 +// found in the LICENSE file.
@@ -662,35 +615,20 @@
 +
 +#include "base/process_util.h"
 +
-+#include <ctype.h>
-+#include <fcntl.h>
-+#include <unistd.h>
-+#include <string>
-+#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD)
-+/* DragonFly, as of v3.0.1, and FreeBSD 9.0-RELEASE do not explicitly mark symbols public */
-+#define PRE_SYS_INCLUDE		_Pragma("GCC visibility push(default)")
-+#define POST_SYS_INCLUDE	_Pragma("GCC visibility pop")
-+#else
-+#define PRE_SYS_INCLUDE
-+#define POST_SYS_INCLUDE
-+#endif
-+PRE_SYS_INCLUDE
-+#include <kvm.h>
-+POST_SYS_INCLUDE
-+#include <sys/sysctl.h>
 +#include <sys/types.h>
++#include <sys/sysctl.h>
 +#include <sys/wait.h>
-+#if defined(OS_DRAGONFLY)
-+PRE_SYS_INCLUDE
-+#include <sys/user.h>
-+POST_SYS_INCLUDE
-+#endif
-+#if defined(OS_FREEBSD)
-+PRE_SYS_INCLUDE
++#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD)
 +#include <sys/user.h>
-+POST_SYS_INCLUDE
 +#endif
 +
++#include <ctype.h>
++#include <fcntl.h>
++#include <kvm.h>
++#include <unistd.h>
++
++#include <string>
++
 +#include "base/debug_util.h"
 +#include "base/eintr_wrapper.h"
 +#include "base/file_util.h"
@@ -698,6 +636,17 @@
 +#include "base/string_tokenizer.h"
 +#include "base/string_util.h"
 +
++#ifdef OS_NETBSD
++#include <sys/param.h>
++#if __NetBSD_Version__ >= 599006500
++#define HAVE_POSIX_SPAWN	1
++#endif
++#endif
++
++#if defined(_POSIX_SPAWN) && _POSIX_SPAWN > 0
++#define HAVE_POSIX_SPAWN	1
++#endif
++
 +/*
 + * On platforms that are not gonk based, we fall back to an arbitrary
 + * UID. This is generally the UID for user `nobody', albeit it is not
@@ -712,15 +661,17 @@
 +# define CHILD_UNPRIVILEGED_GID 65534
 +#endif
 +
-+#if defined(_POSIX_SPAWN) && _POSIX_SPAWN > 0
-+#define HAVE_POSIX_SPAWN	1
++#ifndef __dso_public
++# ifdef __exported
++#  define __dso_public	__exported
++# else
++#  define __dso_public	__attribute__((__visibility__("default")))
++# endif
 +#endif
 +
 +#ifdef HAVE_POSIX_SPAWN
-+PRE_SYS_INCLUDE
 +#include <spawn.h>
-+extern "C" char **environ;
-+POST_SYS_INCLUDE
++extern "C" char **environ __dso_public;
 +#endif
 +
 +namespace {
@@ -1116,24 +1067,30 @@
 
 --- ipc/chromium/src/build/build_config.h.orig	2012-03-13 01:36:53.000000000 +0000
 +++ ipc/chromium/src/build/build_config.h
-@@ -19,17 +19,23 @@
+@@ -19,6 +19,12 @@
  #define OS_MACOSX 1
  #elif defined(__linux__) || defined(ANDROID)
  #define OS_LINUX 1
-+#elif defined(__NetBSD__)
-+#define OS_NETBSD 1
 +#elif defined(__DragonFly__)
 +#define OS_DRAGONFLY 1
++#elif defined(__FreeBSD__)
++#define OS_FREEBSD 1
++#elif defined(__NetBSD__)
++#define OS_NETBSD 1
  #elif defined(__OpenBSD__)
  #define OS_OPENBSD 1
  #elif defined(_WIN32)
- #define OS_WIN 1
-+#elif defined(__FreeBSD__)
-+#define OS_FREEBSD 1
- #else
+@@ -27,9 +33,16 @@
  #error Please add support for your platform in build/build_config.h
  #endif
  
++// For access to standard BSD features, use OS_BSD instead of a
++// more specific macro.
++#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD)	\
++  || defined(OS_NETBSD) || defined(OS_OPENBSD)
++#define OS_BSD 1
++#endif
++
  // For access to standard POSIX features, use OS_POSIX instead of a more
  // specific macro.
 -#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_OPENBSD)
@@ -1175,7 +1132,7 @@
  #endif
  
 -#if !(defined(OS_MACOSX) || defined(OS_OPENBSD) || defined(OS_WIN) || (defined(OS_LINUX) && defined(ARCH_CPU_64_BITS)) || defined(ARCH_CPU_S390))
-+#if !(defined(OS_MACOSX) || defined(OS_OPENBSD) || defined(OS_WIN) || ((defined(OS_FREEBSD) || defined(OS_DRAGONFLY) || defined(OS_NETBSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS)) || defined(ARCH_CPU_S390))
++#if !(defined(OS_MACOSX) || defined(OS_OPENBSD) || defined(OS_WIN) || ((defined(OS_BSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS)) || defined(ARCH_CPU_S390))
  // There size_t is a synonym for |unsigned long| ...
  template <>
  struct ParamTraits<size_t> {
@@ -1184,7 +1141,7 @@
  #endif  // defined(OS_MACOSX)
  
 -#if !(defined(OS_LINUX) && defined(ARCH_CPU_64_BITS))
-+#if !((defined(OS_FREEBSD) || defined(OS_DRAGONFLY) || defined(OS_NETBSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS))
++#if !((defined(OS_BSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS))
  // int64 is |long int| on 64-bit systems, uint64 is |unsigned long|
  template <>
  struct ParamTraits<int64> {
@@ -1206,7 +1163,7 @@
    };
    typedef HandleAndSequenceNum Id;
 -#elif defined(OS_MACOSX)
-+#elif defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_BSD)
++#elif defined(OS_MACOSX) || defined(OS_BSD)
    typedef base::SharedMemoryHandle Handle;
    // On Mac, the inode number of the backing file is used as an id.
    typedef base::SharedMemoryId Id;
@@ -1284,7 +1241,7 @@
  
 +ifneq (,$(filter DragonFly FreeBSD NetBSD OpenBSD,$(OS_ARCH)))
 +OS_LIBS += $(call EXPAND_LIBNAME,kvm)
-+#EXTRA_DSO_LDOPTS += -Wl,--ignore-unresolved-symbol,environ
++# keep `environ' unresolved, see bug 14426 for binutils
 +EXTRA_DSO_LDOPTS += -Wl,--warn-unresolved-symbols
 +endif
 +

Modified: branches/experimental/www/firefox/files/patch-bug753046
==============================================================================
--- branches/experimental/www/firefox/files/patch-bug753046	Thu Aug  9 06:40:34 2012	(r915)
+++ branches/experimental/www/firefox/files/patch-bug753046	Thu Aug  9 06:40:45 2012	(r916)
@@ -4,15 +4,14 @@
 
 --- dom/plugins/ipc/PluginModuleChild.cpp.orig	2011-12-20 23:28:14.000000000 +0000
 +++ dom/plugins/ipc/PluginModuleChild.cpp
-@@ -33,6 +33,8 @@
- #include "nsPluginsDir.h"
- #include "nsXULAppAPI.h"
+@@ -5,6 +5,7 @@
+  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  
-+#include <unistd.h>
-+
- #ifdef MOZ_X11
- # include "mozilla/X11Util.h"
- #endif
+ #ifdef MOZ_WIDGET_QT
++#include <unistd.h> // for _exit()
+ #include <QtCore/QTimer>
+ #include "nsQAppInstance.h"
+ #include "NestedLoopTimer.h"
 @@ -228,7 +228,7 @@ PluginModuleChild::Init(const std::strin
  
      // TODO: use PluginPRLibrary here
@@ -65,7 +64,7 @@
 +
 +CPPSRCS += \
 +  atomicops_internals_x86_gcc.cc \
-+  file_util_bsd.cc \
++  file_util_linux.cc \
 +  process_util_bsd.cc \
 +  time_posix.cc \
 +  $(NULL)
@@ -244,7 +243,7 @@
  
  // Based on Apple's recommended method as described in
  // http://developer.apple.com/qa/qa2004/qa1361.html
-@@ -71,7 +76,13 @@ bool DebugUtil::BeingDebugged() {
+@@ -71,7 +76,15 @@ bool DebugUtil::BeingDebugged() {
  
    // This process is being debugged if the P_TRACED flag is set.
    is_set = true;
@@ -252,6 +251,8 @@
 +  being_debugged = (info.kp_flags & P_TRACED) != 0;
 +#elif defined(OS_FREEBSD)
 +  being_debugged = (info.ki_flag & P_TRACED) != 0;
++#elif defined(OS_OPENBSD)
++  being_debugged = (info.p_flag & P_TRACED) != 0;
 +#else
    being_debugged = (info.kp_proc.p_flag & P_TRACED) != 0;
 +#endif
@@ -399,105 +400,19 @@
  #else
  typedef DirReaderFallback DirReaderPosix;
  #endif
-$NetBSD: patch-ipc_chromium_src_base_file__util.h,v 1.2 2012/03/06 12:34:09 ryoon Exp $
-
---- ipc/chromium/src/base/file_util.h.orig	2011-12-20 23:28:19.000000000 +0000
-+++ ipc/chromium/src/base/file_util.h
-@@ -16,8 +16,8 @@
- #include <sys/stat.h>
- #elif defined(OS_POSIX) 
- #include <sys/types.h>
--#include <fts.h>
- #include <sys/stat.h>
-+#include <fts.h>
- #endif
+diff --git ipc/chromium/src/base/file_util_linux.cc ipc/chromium/src/base/file_util_linux.cc
+index 171e44f..0c6dfcc 100644
+--- ipc/chromium/src/base/file_util_linux.cc
++++ ipc/chromium/src/base/file_util_linux.cc
+@@ -28,7 +28,7 @@ bool GetTempDir(FilePath* path) {
+ }
  
- #include <stdio.h>
-$NetBSD: patch-ipc_chromium_src_base_file__util__bsd.cc,v 1.1 2012/03/06 12:34:09 ryoon Exp $
-
---- ipc/chromium/src/base/file_util_bsd.cc.orig	2012-01-07 18:21:18.000000000 +0000
-+++ ipc/chromium/src/base/file_util_bsd.cc
-@@ -0,0 +1,80 @@
-+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style license that can be
-+// found in the LICENSE file.
-+
-+// this is a derivative of file_util_linux.cc
-+
-+#include "base/file_util.h"
-+
-+#include <fcntl.h>
-+#include <unistd.h>
-+
-+#include <string>
-+#include <vector>
-+
-+#include "base/eintr_wrapper.h"
-+#include "base/file_path.h"
-+#include "base/string_util.h"
-+
-+namespace file_util {
-+
-+bool GetTempDir(FilePath* path) {
-+  const char* tmp = getenv("TMPDIR");
-+  if (tmp)
-+    *path = FilePath(tmp);
-+  else
-+    *path = FilePath("/tmp");
-+  return true;
-+}
-+
-+bool GetShmemTempDir(FilePath* path) {
-+  return GetTempDir(path);
-+}
-+
-+bool CopyFile(const FilePath& from_path, const FilePath& to_path) {
-+  int infile = open(from_path.value().c_str(), O_RDONLY);
-+  if (infile < 0)
-+    return false;
-+
-+  int outfile = creat(to_path.value().c_str(), 0666);
-+  if (outfile < 0) {
-+    close(infile);
-+    return false;
-+  }
-+
-+  const size_t kBufferSize = 32768;
-+  std::vector<char> buffer(kBufferSize);
-+  bool result = true;
-+
-+  while (result) {
-+    ssize_t bytes_read = HANDLE_EINTR(read(infile, &buffer[0], buffer.size()));
-+    if (bytes_read < 0) {
-+      result = false;
-+      break;
-+    }
-+    if (bytes_read == 0)
-+      break;
-+    // Allow for partial writes
-+    ssize_t bytes_written_per_read = 0;
-+    do {
-+      ssize_t bytes_written_partial = HANDLE_EINTR(write(
-+          outfile,
-+          &buffer[bytes_written_per_read],
-+          bytes_read - bytes_written_per_read));
-+      if (bytes_written_partial < 0) {
-+        result = false;
-+        break;
-+      }
-+      bytes_written_per_read += bytes_written_partial;
-+    } while (bytes_written_per_read < bytes_read);
-+  }
-+
-+  if (HANDLE_EINTR(close(infile)) < 0)
-+    result = false;
-+  if (HANDLE_EINTR(close(outfile)) < 0)
-+    result = false;
-+
-+  return result;
-+}
-+
-+}  // namespace file_util
+ bool GetShmemTempDir(FilePath* path) {
+-#ifdef ANDROID
++#if defined(ANDROID) || defined(OS_BSD)
+   return GetTempDir(path);
+ #else
+   *path = FilePath("/dev/shm");
 $NetBSD: patch-ipc_chromium_src_base_file__util__posix.cc,v 1.2 2012/03/06 12:34:09 ryoon Exp $
 
 --- ipc/chromium/src/base/file_util_posix.cc.orig	2011-12-20 23:28:19.000000000 +0000
@@ -537,11 +452,15 @@
 
 --- ipc/chromium/src/base/platform_thread.h.orig	2011-12-20 23:28:19.000000000 +0000
 +++ ipc/chromium/src/base/platform_thread.h
-@@ -25,6 +25,8 @@ typedef pthread_t PlatformThreadHandle;
- #if defined(OS_LINUX)
+@@ -22,9 +22,11 @@ typedef void* PlatformThreadHandle;  // HANDLE
+ #elif defined(OS_POSIX)
+ #include <pthread.h>
+ typedef pthread_t PlatformThreadHandle;
+-#if defined(OS_LINUX)
++#if defined(OS_LINUX) || defined(OS_OPENBSD)
  #include <unistd.h>
  typedef pid_t PlatformThreadId;
-+#elif defined(OS_FREEBSD) || defined(OS_DRAGONFLY) || defined (OS_NETBSD)
++#elif defined(OS_BSD)
 +typedef lwpid_t PlatformThreadId;
  #elif defined(OS_MACOSX)
  #include <mach/mach.h>
@@ -550,7 +469,7 @@
 
 --- ipc/chromium/src/base/platform_thread_posix.cc.orig	2012-03-13 01:36:53.000000000 +0000
 +++ ipc/chromium/src/base/platform_thread_posix.cc
-@@ -9,9 +9,18 @@
+@@ -9,9 +9,23 @@
  
  #if defined(OS_MACOSX)
  #include <mach/mach.h>
@@ -562,14 +481,19 @@
 +#elif defined(OS_DRAGONFLY)
 +#include <unistd.h>
 +#elif defined(OS_FREEBSD)
++#include <sys/param.h>
++#if __FreeBSD_version > 802500
++#include <sys/thr.h>
++#else
 +_Pragma("GCC visibility push(default)")
-+extern "C" int thr_self(long *); // XXX #include <sys/thr.h>
++extern "C" int thr_self(long *);
 +_Pragma("GCC visibility pop")
++#endif
 +#include <pthread_np.h>
  #endif
  
  #if defined(OS_MACOSX)
-@@ -38,7 +45,19 @@
+@@ -38,9 +45,20 @@
    // into the kernel.
  #if defined(OS_MACOSX)
    return mach_thread_self();
@@ -587,9 +511,38 @@
 +    return lwpid;
 +#  endif
 +#elif defined(OS_OPENBSD)
-   // TODO(BSD): find a better thread ID
-   return (intptr_t)(pthread_self());
+-  // TODO(BSD): find a better thread ID
+-  return (intptr_t)(pthread_self());
++  return (intptr_t) (pthread_self());
  #elif defined(OS_LINUX)
+   return syscall(__NR_gettid);
+ #endif
+diff --git ipc/chromium/src/base/ref_counted.h ipc/chromium/src/base/ref_counted.h
+index 013bd66..18e2794 100644
+--- ipc/chromium/src/base/ref_counted.h
++++ ipc/chromium/src/base/ref_counted.h
+@@ -28,7 +28,7 @@ class RefCountedBase {
+   bool in_dtor_;
+ #endif
+ 
+-  DFAKE_MUTEX(add_release_);
++  DFAKE_MUTEX(add_release_)
+ 
+   DISALLOW_COPY_AND_ASSIGN(RefCountedBase);
+ };
+diff --git ipc/chromium/src/chrome/common/file_descriptor_set_posix.h ipc/chromium/src/chrome/common/file_descriptor_set_posix.h
+index 342e6d9..b011baf 100644
+--- ipc/chromium/src/chrome/common/file_descriptor_set_posix.h
++++ ipc/chromium/src/chrome/common/file_descriptor_set_posix.h
+@@ -30,7 +30,7 @@ class FileDescriptorSet : public base::RefCountedThreadSafe<FileDescriptorSet> {
+   // In debugging mode, it's a fatal error to try and add more than this number
+   // of descriptors to a FileDescriptorSet.
+   enum {
+-    MAX_DESCRIPTORS_PER_MESSAGE = 4,
++    MAX_DESCRIPTORS_PER_MESSAGE = 4
+   };
+ 
+   // ---------------------------------------------------------------------------
 $NetBSD: patch-ipc_chromium_src_base_process__util.h,v 1.1 2012/03/06 12:34:09 ryoon Exp $
 
 --- ipc/chromium/src/base/process_util.h.orig	2011-12-21 00:28:19.000000000 +0100
@@ -631,7 +584,7 @@
 
 --- ipc/chromium/src/base/process_util_bsd.cc.orig	2012-04-01 00:04:28.000000000 +0000
 +++ ipc/chromium/src/base/process_util_bsd.cc
-@@ -0,0 +1,322 @@
+@@ -0,0 +1,320 @@
 +// Copyright (c) 2008 The Chromium Authors. All rights reserved.
 +// Use of this source code is governed by a BSD-style license that can be
 +// found in the LICENSE file.
@@ -640,35 +593,20 @@
 +
 +#include "base/process_util.h"
 +
-+#include <ctype.h>
-+#include <fcntl.h>
-+#include <unistd.h>
-+#include <string>
-+#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD)
-+/* DragonFly, as of v3.0.1, and FreeBSD 9.0-RELEASE do not explicitly mark symbols public */
-+#define PRE_SYS_INCLUDE		_Pragma("GCC visibility push(default)")
-+#define POST_SYS_INCLUDE	_Pragma("GCC visibility pop")
-+#else
-+#define PRE_SYS_INCLUDE
-+#define POST_SYS_INCLUDE
-+#endif
-+PRE_SYS_INCLUDE
-+#include <kvm.h>
-+POST_SYS_INCLUDE
-+#include <sys/sysctl.h>
 +#include <sys/types.h>
++#include <sys/sysctl.h>
 +#include <sys/wait.h>
-+#if defined(OS_DRAGONFLY)
-+PRE_SYS_INCLUDE
-+#include <sys/user.h>
-+POST_SYS_INCLUDE
-+#endif
-+#if defined(OS_FREEBSD)
-+PRE_SYS_INCLUDE
++#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD)
 +#include <sys/user.h>
-+POST_SYS_INCLUDE
 +#endif
 +
++#include <ctype.h>
++#include <fcntl.h>
++#include <kvm.h>
++#include <unistd.h>
++
++#include <string>
++
 +#include "base/debug_util.h"
 +#include "base/eintr_wrapper.h"
 +#include "base/file_util.h"
@@ -676,15 +614,28 @@
 +#include "base/string_tokenizer.h"
 +#include "base/string_util.h"
 +
++#ifdef OS_NETBSD
++#include <sys/param.h>
++#if __NetBSD_Version__ >= 599006500
++#define HAVE_POSIX_SPAWN	1
++#endif
++#endif
++
 +#if defined(_POSIX_SPAWN) && _POSIX_SPAWN > 0
 +#define HAVE_POSIX_SPAWN	1
 +#endif
 +
++#ifndef __dso_public
++# ifdef __exported
++#  define __dso_public	__exported
++# else
++#  define __dso_public	__attribute__((__visibility__("default")))
++# endif
++#endif
++
 +#ifdef HAVE_POSIX_SPAWN
-+PRE_SYS_INCLUDE
 +#include <spawn.h>
-+extern "C" char **environ;
-+POST_SYS_INCLUDE
++extern "C" char **environ __dso_public;
 +#endif
 +
 +namespace {
@@ -1096,24 +1047,30 @@
 
 --- ipc/chromium/src/build/build_config.h.orig	2012-03-13 01:36:53.000000000 +0000
 +++ ipc/chromium/src/build/build_config.h
-@@ -19,17 +19,23 @@
+@@ -19,6 +19,12 @@
  #define OS_MACOSX 1
  #elif defined(__linux__) || defined(ANDROID)
  #define OS_LINUX 1
-+#elif defined(__NetBSD__)
-+#define OS_NETBSD 1
 +#elif defined(__DragonFly__)
 +#define OS_DRAGONFLY 1
++#elif defined(__FreeBSD__)
++#define OS_FREEBSD 1
++#elif defined(__NetBSD__)
++#define OS_NETBSD 1
  #elif defined(__OpenBSD__)
  #define OS_OPENBSD 1
  #elif defined(_WIN32)
- #define OS_WIN 1
-+#elif defined(__FreeBSD__)
-+#define OS_FREEBSD 1
- #else
+@@ -27,9 +33,16 @@
  #error Please add support for your platform in build/build_config.h
  #endif
  
++// For access to standard BSD features, use OS_BSD instead of a
++// more specific macro.
++#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD)	\
++  || defined(OS_NETBSD) || defined(OS_OPENBSD)
++#define OS_BSD 1
++#endif
++
  // For access to standard POSIX features, use OS_POSIX instead of a more
  // specific macro.
 -#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_OPENBSD)
@@ -1155,7 +1112,7 @@
  #endif
  
 -#if !(defined(OS_MACOSX) || defined(OS_OPENBSD) || defined(OS_WIN) || (defined(OS_LINUX) && defined(ARCH_CPU_64_BITS)) || defined(ARCH_CPU_S390))
-+#if !(defined(OS_MACOSX) || defined(OS_OPENBSD) || defined(OS_WIN) || ((defined(OS_FREEBSD) || defined(OS_DRAGONFLY) || defined(OS_NETBSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS)) || defined(ARCH_CPU_S390))
++#if !(defined(OS_MACOSX) || defined(OS_OPENBSD) || defined(OS_WIN) || ((defined(OS_BSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS)) || defined(ARCH_CPU_S390))
  // There size_t is a synonym for |unsigned long| ...
  template <>
  struct ParamTraits<size_t> {
@@ -1164,7 +1121,7 @@
  #endif  // defined(OS_MACOSX)
  
 -#if !(defined(OS_LINUX) && defined(ARCH_CPU_64_BITS))
-+#if !((defined(OS_FREEBSD) || defined(OS_DRAGONFLY) || defined(OS_NETBSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS))
++#if !((defined(OS_BSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS))
  // int64 is |long int| on 64-bit systems, uint64 is |unsigned long|
  template <>
  struct ParamTraits<int64> {
@@ -1186,7 +1143,7 @@
    };
    typedef HandleAndSequenceNum Id;
 -#elif defined(OS_MACOSX)
-+#elif defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_BSD)
++#elif defined(OS_MACOSX) || defined(OS_BSD)
    typedef base::SharedMemoryHandle Handle;
    // On Mac, the inode number of the backing file is used as an id.
    typedef base::SharedMemoryId Id;
@@ -1264,7 +1221,7 @@
  
 +ifneq (,$(filter DragonFly FreeBSD NetBSD OpenBSD,$(OS_ARCH)))
 +OS_LIBS += $(call EXPAND_LIBNAME,kvm)
-+#EXTRA_DSO_LDOPTS += -Wl,--ignore-unresolved-symbol,environ
++# keep `environ' unresolved, see bug 14426 for binutils
 +EXTRA_DSO_LDOPTS += -Wl,--warn-unresolved-symbols
 +endif
 +

Modified: branches/experimental/www/libxul/files/patch-bug753046
==============================================================================
--- branches/experimental/www/libxul/files/patch-bug753046	Thu Aug  9 06:40:34 2012	(r915)
+++ branches/experimental/www/libxul/files/patch-bug753046	Thu Aug  9 06:40:45 2012	(r916)
@@ -4,15 +4,14 @@
 
 --- dom/plugins/ipc/PluginModuleChild.cpp.orig	2011-12-20 23:28:14.000000000 +0000
 +++ dom/plugins/ipc/PluginModuleChild.cpp
-@@ -33,6 +33,8 @@
- #include "nsPluginsDir.h"
- #include "nsXULAppAPI.h"
+@@ -5,6 +5,7 @@
+  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  
-+#include <unistd.h>
-+
- #ifdef MOZ_X11
- # include "mozilla/X11Util.h"
- #endif
+ #ifdef MOZ_WIDGET_QT
++#include <unistd.h> // for _exit()
+ #include <QtCore/QTimer>
+ #include "nsQAppInstance.h"
+ #include "NestedLoopTimer.h"
 @@ -228,7 +228,7 @@ PluginModuleChild::Init(const std::strin
  
      // TODO: use PluginPRLibrary here
@@ -65,7 +64,7 @@
 +
 +CPPSRCS += \
 +  atomicops_internals_x86_gcc.cc \
-+  file_util_bsd.cc \
++  file_util_linux.cc \
 +  process_util_bsd.cc \
 +  time_posix.cc \
 +  $(NULL)
@@ -244,7 +243,7 @@
  
  // Based on Apple's recommended method as described in
  // http://developer.apple.com/qa/qa2004/qa1361.html
-@@ -71,7 +76,13 @@ bool DebugUtil::BeingDebugged() {
+@@ -71,7 +76,15 @@ bool DebugUtil::BeingDebugged() {
  
    // This process is being debugged if the P_TRACED flag is set.
    is_set = true;
@@ -252,6 +251,8 @@
 +  being_debugged = (info.kp_flags & P_TRACED) != 0;
 +#elif defined(OS_FREEBSD)
 +  being_debugged = (info.ki_flag & P_TRACED) != 0;
++#elif defined(OS_OPENBSD)
++  being_debugged = (info.p_flag & P_TRACED) != 0;
 +#else
    being_debugged = (info.kp_proc.p_flag & P_TRACED) != 0;
 +#endif
@@ -394,105 +395,19 @@
  #else
  typedef DirReaderFallback DirReaderPosix;
  #endif
-$NetBSD: patch-ipc_chromium_src_base_file__util.h,v 1.2 2012/03/06 12:34:09 ryoon Exp $
-
---- ipc/chromium/src/base/file_util.h.orig	2011-12-20 23:28:19.000000000 +0000
-+++ ipc/chromium/src/base/file_util.h
-@@ -16,8 +16,8 @@
- #include <sys/stat.h>
- #elif defined(OS_POSIX) 
- #include <sys/types.h>
--#include <fts.h>
- #include <sys/stat.h>
-+#include <fts.h>
- #endif
+diff --git ipc/chromium/src/base/file_util_linux.cc ipc/chromium/src/base/file_util_linux.cc
+index 171e44f..0c6dfcc 100644
+--- ipc/chromium/src/base/file_util_linux.cc
++++ ipc/chromium/src/base/file_util_linux.cc
+@@ -28,7 +28,7 @@ bool GetTempDir(FilePath* path) {
+ }
  
- #include <stdio.h>
-$NetBSD: patch-ipc_chromium_src_base_file__util__bsd.cc,v 1.1 2012/03/06 12:34:09 ryoon Exp $
-
---- ipc/chromium/src/base/file_util_bsd.cc.orig	2012-01-07 18:21:18.000000000 +0000
-+++ ipc/chromium/src/base/file_util_bsd.cc
-@@ -0,0 +1,80 @@
-+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style license that can be
-+// found in the LICENSE file.
-+
-+// this is a derivative of file_util_linux.cc
-+
-+#include "base/file_util.h"
-+
-+#include <fcntl.h>
-+#include <unistd.h>
-+
-+#include <string>
-+#include <vector>
-+
-+#include "base/eintr_wrapper.h"
-+#include "base/file_path.h"
-+#include "base/string_util.h"
-+
-+namespace file_util {
-+
-+bool GetTempDir(FilePath* path) {
-+  const char* tmp = getenv("TMPDIR");
-+  if (tmp)
-+    *path = FilePath(tmp);
-+  else
-+    *path = FilePath("/tmp");
-+  return true;
-+}
-+
-+bool GetShmemTempDir(FilePath* path) {
-+  return GetTempDir(path);
-+}
-+
-+bool CopyFile(const FilePath& from_path, const FilePath& to_path) {
-+  int infile = open(from_path.value().c_str(), O_RDONLY);
-+  if (infile < 0)
-+    return false;
-+
-+  int outfile = creat(to_path.value().c_str(), 0666);
-+  if (outfile < 0) {
-+    close(infile);
-+    return false;
-+  }
-+
-+  const size_t kBufferSize = 32768;
-+  std::vector<char> buffer(kBufferSize);
-+  bool result = true;
-+
-+  while (result) {
-+    ssize_t bytes_read = HANDLE_EINTR(read(infile, &buffer[0], buffer.size()));
-+    if (bytes_read < 0) {
-+      result = false;
-+      break;
-+    }
-+    if (bytes_read == 0)
-+      break;
-+    // Allow for partial writes
-+    ssize_t bytes_written_per_read = 0;
-+    do {
-+      ssize_t bytes_written_partial = HANDLE_EINTR(write(
-+          outfile,
-+          &buffer[bytes_written_per_read],
-+          bytes_read - bytes_written_per_read));
-+      if (bytes_written_partial < 0) {
-+        result = false;
-+        break;
-+      }
-+      bytes_written_per_read += bytes_written_partial;
-+    } while (bytes_written_per_read < bytes_read);
-+  }
-+
-+  if (HANDLE_EINTR(close(infile)) < 0)
-+    result = false;
-+  if (HANDLE_EINTR(close(outfile)) < 0)
-+    result = false;
-+
-+  return result;
-+}
-+
-+}  // namespace file_util
+ bool GetShmemTempDir(FilePath* path) {
+-#ifdef ANDROID
++#if defined(ANDROID) || defined(OS_BSD)
+   return GetTempDir(path);
+ #else
+   *path = FilePath("/dev/shm");
 $NetBSD: patch-ipc_chromium_src_base_file__util__posix.cc,v 1.2 2012/03/06 12:34:09 ryoon Exp $
 
 --- ipc/chromium/src/base/file_util_posix.cc.orig	2011-12-20 23:28:19.000000000 +0000
@@ -532,11 +447,15 @@
 
 --- ipc/chromium/src/base/platform_thread.h.orig	2011-12-20 23:28:19.000000000 +0000
 +++ ipc/chromium/src/base/platform_thread.h
-@@ -25,6 +25,8 @@ typedef pthread_t PlatformThreadHandle;
- #if defined(OS_LINUX)
+@@ -22,9 +22,11 @@ typedef void* PlatformThreadHandle;  // HANDLE
+ #elif defined(OS_POSIX)
+ #include <pthread.h>
+ typedef pthread_t PlatformThreadHandle;
+-#if defined(OS_LINUX)
++#if defined(OS_LINUX) || defined(OS_OPENBSD)
  #include <unistd.h>
  typedef pid_t PlatformThreadId;
-+#elif defined(OS_FREEBSD) || defined(OS_DRAGONFLY) || defined (OS_NETBSD)
++#elif defined(OS_BSD)
 +typedef lwpid_t PlatformThreadId;
  #elif defined(OS_MACOSX)
  #include <mach/mach.h>
@@ -545,7 +464,7 @@
 
 --- ipc/chromium/src/base/platform_thread_posix.cc.orig	2012-03-13 01:36:53.000000000 +0000
 +++ ipc/chromium/src/base/platform_thread_posix.cc
-@@ -9,9 +9,18 @@
+@@ -9,9 +9,23 @@
  
  #if defined(OS_MACOSX)
  #include <mach/mach.h>
@@ -557,14 +476,19 @@
 +#elif defined(OS_DRAGONFLY)
 +#include <unistd.h>
 +#elif defined(OS_FREEBSD)
++#include <sys/param.h>
++#if __FreeBSD_version > 802500
++#include <sys/thr.h>
++#else
 +_Pragma("GCC visibility push(default)")
-+extern "C" int thr_self(long *); // XXX #include <sys/thr.h>
++extern "C" int thr_self(long *);
 +_Pragma("GCC visibility pop")
++#endif
 +#include <pthread_np.h>
  #endif
  
  #if defined(OS_MACOSX)
-@@ -38,7 +45,19 @@
+@@ -38,9 +45,20 @@
    // into the kernel.
  #if defined(OS_MACOSX)
    return mach_thread_self();
@@ -582,9 +506,38 @@
 +    return lwpid;
 +#  endif
 +#elif defined(OS_OPENBSD)
-   // TODO(BSD): find a better thread ID
-   return (intptr_t)(pthread_self());
+-  // TODO(BSD): find a better thread ID
+-  return (intptr_t)(pthread_self());
++  return (intptr_t) (pthread_self());
  #elif defined(OS_LINUX)
+   return syscall(__NR_gettid);
+ #endif
+diff --git ipc/chromium/src/base/ref_counted.h ipc/chromium/src/base/ref_counted.h
+index 013bd66..18e2794 100644
+--- ipc/chromium/src/base/ref_counted.h
++++ ipc/chromium/src/base/ref_counted.h
+@@ -28,7 +28,7 @@ class RefCountedBase {
+   bool in_dtor_;
+ #endif
+ 
+-  DFAKE_MUTEX(add_release_);
++  DFAKE_MUTEX(add_release_)
+ 
+   DISALLOW_COPY_AND_ASSIGN(RefCountedBase);
+ };
+diff --git ipc/chromium/src/chrome/common/file_descriptor_set_posix.h ipc/chromium/src/chrome/common/file_descriptor_set_posix.h
+index 342e6d9..b011baf 100644
+--- ipc/chromium/src/chrome/common/file_descriptor_set_posix.h
++++ ipc/chromium/src/chrome/common/file_descriptor_set_posix.h
+@@ -30,7 +30,7 @@ class FileDescriptorSet : public base::RefCountedThreadSafe<FileDescriptorSet> {
+   // In debugging mode, it's a fatal error to try and add more than this number
+   // of descriptors to a FileDescriptorSet.
+   enum {
+-    MAX_DESCRIPTORS_PER_MESSAGE = 4,
++    MAX_DESCRIPTORS_PER_MESSAGE = 4
+   };
+ 
+   // ---------------------------------------------------------------------------
 $NetBSD: patch-ipc_chromium_src_base_process__util.h,v 1.1 2012/03/06 12:34:09 ryoon Exp $
 
 --- ipc/chromium/src/base/process_util.h.orig	2011-12-21 00:28:19.000000000 +0100
@@ -626,7 +579,7 @@
 
 --- ipc/chromium/src/base/process_util_bsd.cc.orig	2012-04-01 00:04:28.000000000 +0000
 +++ ipc/chromium/src/base/process_util_bsd.cc
-@@ -0,0 +1,322 @@
+@@ -0,0 +1,320 @@
 +// Copyright (c) 2008 The Chromium Authors. All rights reserved.
 +// Use of this source code is governed by a BSD-style license that can be
 +// found in the LICENSE file.
@@ -635,35 +588,20 @@
 +
 +#include "base/process_util.h"
 +
-+#include <ctype.h>
-+#include <fcntl.h>
-+#include <unistd.h>
-+#include <string>
-+#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD)
-+/* DragonFly, as of v3.0.1, and FreeBSD 9.0-RELEASE do not explicitly mark symbols public */
-+#define PRE_SYS_INCLUDE		_Pragma("GCC visibility push(default)")
-+#define POST_SYS_INCLUDE	_Pragma("GCC visibility pop")
-+#else
-+#define PRE_SYS_INCLUDE
-+#define POST_SYS_INCLUDE
-+#endif
-+PRE_SYS_INCLUDE
-+#include <kvm.h>
-+POST_SYS_INCLUDE
-+#include <sys/sysctl.h>
 +#include <sys/types.h>
++#include <sys/sysctl.h>
 +#include <sys/wait.h>
-+#if defined(OS_DRAGONFLY)
-+PRE_SYS_INCLUDE
-+#include <sys/user.h>
-+POST_SYS_INCLUDE
-+#endif
-+#if defined(OS_FREEBSD)
-+PRE_SYS_INCLUDE
++#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD)
 +#include <sys/user.h>
-+POST_SYS_INCLUDE
 +#endif
 +
++#include <ctype.h>
++#include <fcntl.h>
++#include <kvm.h>
++#include <unistd.h>
++
++#include <string>
++
 +#include "base/debug_util.h"
 +#include "base/eintr_wrapper.h"
 +#include "base/file_util.h"
@@ -671,15 +609,28 @@
 +#include "base/string_tokenizer.h"
 +#include "base/string_util.h"
 +
++#ifdef OS_NETBSD
++#include <sys/param.h>
++#if __NetBSD_Version__ >= 599006500
++#define HAVE_POSIX_SPAWN	1
++#endif
++#endif
++
 +#if defined(_POSIX_SPAWN) && _POSIX_SPAWN > 0
 +#define HAVE_POSIX_SPAWN	1
 +#endif
 +
++#ifndef __dso_public
++# ifdef __exported
++#  define __dso_public	__exported
++# else
++#  define __dso_public	__attribute__((__visibility__("default")))
++# endif
++#endif
++
 +#ifdef HAVE_POSIX_SPAWN
-+PRE_SYS_INCLUDE
 +#include <spawn.h>
-+extern "C" char **environ;
-+POST_SYS_INCLUDE
++extern "C" char **environ __dso_public;
 +#endif
 +
 +namespace {
@@ -1091,24 +1042,30 @@
 
 --- ipc/chromium/src/build/build_config.h.orig	2012-03-13 01:36:53.000000000 +0000
 +++ ipc/chromium/src/build/build_config.h
-@@ -19,17 +19,23 @@
+@@ -19,6 +19,12 @@
  #define OS_MACOSX 1
  #elif defined(__linux__) || defined(ANDROID)
  #define OS_LINUX 1
-+#elif defined(__NetBSD__)
-+#define OS_NETBSD 1
 +#elif defined(__DragonFly__)
 +#define OS_DRAGONFLY 1
++#elif defined(__FreeBSD__)
++#define OS_FREEBSD 1
++#elif defined(__NetBSD__)
++#define OS_NETBSD 1
  #elif defined(__OpenBSD__)
  #define OS_OPENBSD 1
  #elif defined(_WIN32)
- #define OS_WIN 1
-+#elif defined(__FreeBSD__)
-+#define OS_FREEBSD 1
- #else
+@@ -27,9 +33,16 @@
  #error Please add support for your platform in build/build_config.h
  #endif
  
++// For access to standard BSD features, use OS_BSD instead of a
++// more specific macro.
++#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD)	\
++  || defined(OS_NETBSD) || defined(OS_OPENBSD)
++#define OS_BSD 1
++#endif
++
  // For access to standard POSIX features, use OS_POSIX instead of a more
  // specific macro.
 -#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_OPENBSD)
@@ -1150,7 +1107,7 @@
  #endif
  
 -#if !(defined(OS_MACOSX) || defined(OS_OPENBSD) || defined(OS_WIN) || (defined(OS_LINUX) && defined(ARCH_CPU_64_BITS)) || defined(ARCH_CPU_S390))
-+#if !(defined(OS_MACOSX) || defined(OS_OPENBSD) || defined(OS_WIN) || ((defined(OS_FREEBSD) || defined(OS_DRAGONFLY) || defined(OS_NETBSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS)) || defined(ARCH_CPU_S390))
++#if !(defined(OS_MACOSX) || defined(OS_OPENBSD) || defined(OS_WIN) || ((defined(OS_BSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS)) || defined(ARCH_CPU_S390))
  // There size_t is a synonym for |unsigned long| ...
  template <>
  struct ParamTraits<size_t> {
@@ -1159,7 +1116,7 @@
  #endif  // defined(OS_MACOSX)
  
 -#if !(defined(OS_LINUX) && defined(ARCH_CPU_64_BITS))
-+#if !((defined(OS_FREEBSD) || defined(OS_DRAGONFLY) || defined(OS_NETBSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS))
++#if !((defined(OS_BSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS))
  // int64 is |long int| on 64-bit systems, uint64 is |unsigned long|
  template <>
  struct ParamTraits<int64> {
@@ -1181,7 +1138,7 @@
    };
    typedef HandleAndSequenceNum Id;
 -#elif defined(OS_MACOSX)
-+#elif defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_BSD)
++#elif defined(OS_MACOSX) || defined(OS_BSD)
    typedef base::SharedMemoryHandle Handle;
    // On Mac, the inode number of the backing file is used as an id.
    typedef base::SharedMemoryId Id;
@@ -1259,7 +1216,7 @@
  
 +ifneq (,$(filter DragonFly FreeBSD NetBSD OpenBSD,$(OS_ARCH)))
 +OS_LIBS += $(call EXPAND_LIBNAME,kvm)
-+#EXTRA_DSO_LDOPTS += -Wl,--ignore-unresolved-symbol,environ
++# keep `environ' unresolved, see bug 14426 for binutils
 +EXTRA_DSO_LDOPTS += -Wl,--warn-unresolved-symbols
 +endif
 +

Modified: branches/experimental/www/seamonkey/files/patch-bug753046
==============================================================================
--- branches/experimental/www/seamonkey/files/patch-bug753046	Thu Aug  9 06:40:34 2012	(r915)
+++ branches/experimental/www/seamonkey/files/patch-bug753046	Thu Aug  9 06:40:45 2012	(r916)
@@ -4,15 +4,14 @@
 
 --- mozilla/dom/plugins/ipc/PluginModuleChild.cpp.orig	2011-12-20 23:28:14.000000000 +0000
 +++ mozilla/dom/plugins/ipc/PluginModuleChild.cpp
-@@ -33,6 +33,8 @@
- #include "nsPluginsDir.h"
- #include "nsXULAppAPI.h"
+@@ -5,6 +5,7 @@
+  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  
-+#include <unistd.h>
-+
- #ifdef MOZ_X11
- # include "mozilla/X11Util.h"
- #endif
+ #ifdef MOZ_WIDGET_QT
++#include <unistd.h> // for _exit()
+ #include <QtCore/QTimer>
+ #include "nsQAppInstance.h"
+ #include "NestedLoopTimer.h"
 @@ -228,7 +228,7 @@ PluginModuleChild::Init(const std::strin
  
      // TODO: use PluginPRLibrary here
@@ -65,7 +64,7 @@
 +
 +CPPSRCS += \
 +  atomicops_internals_x86_gcc.cc \
-+  file_util_bsd.cc \
++  file_util_linux.cc \
 +  process_util_bsd.cc \
 +  time_posix.cc \
 +  $(NULL)
@@ -244,7 +243,7 @@
  
  // Based on Apple's recommended method as described in
  // http://developer.apple.com/qa/qa2004/qa1361.html
-@@ -71,7 +76,13 @@ bool DebugUtil::BeingDebugged() {
+@@ -71,7 +76,15 @@ bool DebugUtil::BeingDebugged() {
  
    // This process is being debugged if the P_TRACED flag is set.
    is_set = true;
@@ -252,6 +251,8 @@
 +  being_debugged = (info.kp_flags & P_TRACED) != 0;
 +#elif defined(OS_FREEBSD)
 +  being_debugged = (info.ki_flag & P_TRACED) != 0;
++#elif defined(OS_OPENBSD)
++  being_debugged = (info.p_flag & P_TRACED) != 0;
 +#else
    being_debugged = (info.kp_proc.p_flag & P_TRACED) != 0;
 +#endif
@@ -399,105 +400,19 @@
  #else
  typedef DirReaderFallback DirReaderPosix;
  #endif
-$NetBSD: patch-ipc_chromium_src_base_file__util.h,v 1.2 2012/03/06 12:34:09 ryoon Exp $
-
---- mozilla/ipc/chromium/src/base/file_util.h.orig	2011-12-20 23:28:19.000000000 +0000
-+++ mozilla/ipc/chromium/src/base/file_util.h
-@@ -16,8 +16,8 @@
- #include <sys/stat.h>
- #elif defined(OS_POSIX) 
- #include <sys/types.h>
--#include <fts.h>
- #include <sys/stat.h>
-+#include <fts.h>
- #endif
+diff --git mozilla/ipc/chromium/src/base/file_util_linux.cc mozilla/ipc/chromium/src/base/file_util_linux.cc
+index 171e44f..0c6dfcc 100644
+--- mozilla/ipc/chromium/src/base/file_util_linux.cc
++++ mozilla/ipc/chromium/src/base/file_util_linux.cc
+@@ -28,7 +28,7 @@ bool GetTempDir(FilePath* path) {
+ }
  
- #include <stdio.h>
-$NetBSD: patch-ipc_chromium_src_base_file__util__bsd.cc,v 1.1 2012/03/06 12:34:09 ryoon Exp $
-
---- mozilla/ipc/chromium/src/base/file_util_bsd.cc.orig	2012-01-07 18:21:18.000000000 +0000
-+++ mozilla/ipc/chromium/src/base/file_util_bsd.cc
-@@ -0,0 +1,80 @@
-+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style license that can be
-+// found in the LICENSE file.
-+
-+// this is a derivative of file_util_linux.cc
-+
-+#include "base/file_util.h"
-+
-+#include <fcntl.h>
-+#include <unistd.h>
-+
-+#include <string>
-+#include <vector>
-+
-+#include "base/eintr_wrapper.h"
-+#include "base/file_path.h"
-+#include "base/string_util.h"
-+
-+namespace file_util {
-+
-+bool GetTempDir(FilePath* path) {
-+  const char* tmp = getenv("TMPDIR");
-+  if (tmp)
-+    *path = FilePath(tmp);
-+  else
-+    *path = FilePath("/tmp");
-+  return true;
-+}
-+
-+bool GetShmemTempDir(FilePath* path) {
-+  return GetTempDir(path);
-+}
-+
-+bool CopyFile(const FilePath& from_path, const FilePath& to_path) {
-+  int infile = open(from_path.value().c_str(), O_RDONLY);
-+  if (infile < 0)
-+    return false;
-+
-+  int outfile = creat(to_path.value().c_str(), 0666);
-+  if (outfile < 0) {
-+    close(infile);
-+    return false;
-+  }
-+
-+  const size_t kBufferSize = 32768;
-+  std::vector<char> buffer(kBufferSize);
-+  bool result = true;
-+
-+  while (result) {
-+    ssize_t bytes_read = HANDLE_EINTR(read(infile, &buffer[0], buffer.size()));
-+    if (bytes_read < 0) {
-+      result = false;
-+      break;
-+    }
-+    if (bytes_read == 0)
-+      break;
-+    // Allow for partial writes
-+    ssize_t bytes_written_per_read = 0;
-+    do {
-+      ssize_t bytes_written_partial = HANDLE_EINTR(write(
-+          outfile,
-+          &buffer[bytes_written_per_read],
-+          bytes_read - bytes_written_per_read));
-+      if (bytes_written_partial < 0) {
-+        result = false;
-+        break;
-+      }
-+      bytes_written_per_read += bytes_written_partial;
-+    } while (bytes_written_per_read < bytes_read);
-+  }
-+
-+  if (HANDLE_EINTR(close(infile)) < 0)
-+    result = false;
-+  if (HANDLE_EINTR(close(outfile)) < 0)
-+    result = false;
-+
-+  return result;
-+}
-+
-+}  // namespace file_util
+ bool GetShmemTempDir(FilePath* path) {
+-#ifdef ANDROID
++#if defined(ANDROID) || defined(OS_BSD)
+   return GetTempDir(path);
+ #else
+   *path = FilePath("/dev/shm");
 $NetBSD: patch-ipc_chromium_src_base_file__util__posix.cc,v 1.2 2012/03/06 12:34:09 ryoon Exp $
 
 --- mozilla/ipc/chromium/src/base/file_util_posix.cc.orig	2011-12-20 23:28:19.000000000 +0000
@@ -537,11 +452,15 @@
 
 --- mozilla/ipc/chromium/src/base/platform_thread.h.orig	2011-12-20 23:28:19.000000000 +0000
 +++ mozilla/ipc/chromium/src/base/platform_thread.h
-@@ -25,6 +25,8 @@ typedef pthread_t PlatformThreadHandle;
- #if defined(OS_LINUX)
+@@ -22,9 +22,11 @@ typedef void* PlatformThreadHandle;  // HANDLE
+ #elif defined(OS_POSIX)
+ #include <pthread.h>
+ typedef pthread_t PlatformThreadHandle;
+-#if defined(OS_LINUX)
++#if defined(OS_LINUX) || defined(OS_OPENBSD)
  #include <unistd.h>
  typedef pid_t PlatformThreadId;
-+#elif defined(OS_FREEBSD) || defined(OS_DRAGONFLY) || defined (OS_NETBSD)
++#elif defined(OS_BSD)
 +typedef lwpid_t PlatformThreadId;
  #elif defined(OS_MACOSX)
  #include <mach/mach.h>
@@ -550,7 +469,7 @@
 
 --- mozilla/ipc/chromium/src/base/platform_thread_posix.cc.orig	2012-03-13 01:36:53.000000000 +0000
 +++ mozilla/ipc/chromium/src/base/platform_thread_posix.cc
-@@ -9,9 +9,18 @@
+@@ -9,9 +9,23 @@
  
  #if defined(OS_MACOSX)
  #include <mach/mach.h>
@@ -562,14 +481,19 @@
 +#elif defined(OS_DRAGONFLY)
 +#include <unistd.h>
 +#elif defined(OS_FREEBSD)
++#include <sys/param.h>
++#if __FreeBSD_version > 802500
++#include <sys/thr.h>
++#else
 +_Pragma("GCC visibility push(default)")
-+extern "C" int thr_self(long *); // XXX #include <sys/thr.h>
++extern "C" int thr_self(long *);
 +_Pragma("GCC visibility pop")
++#endif
 +#include <pthread_np.h>
  #endif
  
  #if defined(OS_MACOSX)
-@@ -38,7 +45,19 @@
+@@ -38,9 +45,20 @@
    // into the kernel.
  #if defined(OS_MACOSX)
    return mach_thread_self();
@@ -587,9 +511,38 @@
 +    return lwpid;
 +#  endif
 +#elif defined(OS_OPENBSD)
-   // TODO(BSD): find a better thread ID
-   return (intptr_t)(pthread_self());
+-  // TODO(BSD): find a better thread ID
+-  return (intptr_t)(pthread_self());
++  return (intptr_t) (pthread_self());
  #elif defined(OS_LINUX)
+   return syscall(__NR_gettid);
+ #endif
+diff --git mozilla/ipc/chromium/src/base/ref_counted.h mozilla/ipc/chromium/src/base/ref_counted.h
+index 013bd66..18e2794 100644
+--- mozilla/ipc/chromium/src/base/ref_counted.h
++++ mozilla/ipc/chromium/src/base/ref_counted.h
+@@ -28,7 +28,7 @@ class RefCountedBase {
+   bool in_dtor_;
+ #endif
+ 
+-  DFAKE_MUTEX(add_release_);
++  DFAKE_MUTEX(add_release_)
+ 
+   DISALLOW_COPY_AND_ASSIGN(RefCountedBase);
+ };
+diff --git mozilla/ipc/chromium/src/chrome/common/file_descriptor_set_posix.h mozilla/ipc/chromium/src/chrome/common/file_descriptor_set_posix.h
+index 342e6d9..b011baf 100644
+--- mozilla/ipc/chromium/src/chrome/common/file_descriptor_set_posix.h
++++ mozilla/ipc/chromium/src/chrome/common/file_descriptor_set_posix.h
+@@ -30,7 +30,7 @@ class FileDescriptorSet : public base::RefCountedThreadSafe<FileDescriptorSet> {
+   // In debugging mode, it's a fatal error to try and add more than this number
+   // of descriptors to a FileDescriptorSet.
+   enum {
+-    MAX_DESCRIPTORS_PER_MESSAGE = 4,
++    MAX_DESCRIPTORS_PER_MESSAGE = 4
+   };
+ 
+   // ---------------------------------------------------------------------------
 $NetBSD: patch-ipc_chromium_src_base_process__util.h,v 1.1 2012/03/06 12:34:09 ryoon Exp $
 
 --- mozilla/ipc/chromium/src/base/process_util.h.orig	2011-12-21 00:28:19.000000000 +0100
@@ -631,7 +584,7 @@
 
 --- mozilla/ipc/chromium/src/base/process_util_bsd.cc.orig	2012-04-01 00:04:28.000000000 +0000
 +++ mozilla/ipc/chromium/src/base/process_util_bsd.cc
-@@ -0,0 +1,322 @@
+@@ -0,0 +1,320 @@
 +// Copyright (c) 2008 The Chromium Authors. All rights reserved.
 +// Use of this source code is governed by a BSD-style license that can be
 +// found in the LICENSE file.
@@ -640,35 +593,20 @@
 +
 +#include "base/process_util.h"
 +
-+#include <ctype.h>
-+#include <fcntl.h>
-+#include <unistd.h>
-+#include <string>
-+#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD)
-+/* DragonFly, as of v3.0.1, and FreeBSD 9.0-RELEASE do not explicitly mark symbols public */
-+#define PRE_SYS_INCLUDE		_Pragma("GCC visibility push(default)")
-+#define POST_SYS_INCLUDE	_Pragma("GCC visibility pop")
-+#else
-+#define PRE_SYS_INCLUDE
-+#define POST_SYS_INCLUDE
-+#endif
-+PRE_SYS_INCLUDE
-+#include <kvm.h>
-+POST_SYS_INCLUDE
-+#include <sys/sysctl.h>
 +#include <sys/types.h>
++#include <sys/sysctl.h>
 +#include <sys/wait.h>
-+#if defined(OS_DRAGONFLY)
-+PRE_SYS_INCLUDE
-+#include <sys/user.h>
-+POST_SYS_INCLUDE
-+#endif
-+#if defined(OS_FREEBSD)
-+PRE_SYS_INCLUDE
++#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD)
 +#include <sys/user.h>
-+POST_SYS_INCLUDE
 +#endif
 +
++#include <ctype.h>
++#include <fcntl.h>
++#include <kvm.h>
++#include <unistd.h>
++
++#include <string>
++
 +#include "base/debug_util.h"
 +#include "base/eintr_wrapper.h"
 +#include "base/file_util.h"
@@ -676,15 +614,28 @@
 +#include "base/string_tokenizer.h"
 +#include "base/string_util.h"
 +
++#ifdef OS_NETBSD
++#include <sys/param.h>
++#if __NetBSD_Version__ >= 599006500
++#define HAVE_POSIX_SPAWN	1
++#endif
++#endif
++
 +#if defined(_POSIX_SPAWN) && _POSIX_SPAWN > 0
 +#define HAVE_POSIX_SPAWN	1
 +#endif
 +
++#ifndef __dso_public
++# ifdef __exported
++#  define __dso_public	__exported
++# else
++#  define __dso_public	__attribute__((__visibility__("default")))
++# endif
++#endif
++
 +#ifdef HAVE_POSIX_SPAWN
-+PRE_SYS_INCLUDE
 +#include <spawn.h>
-+extern "C" char **environ;
-+POST_SYS_INCLUDE
++extern "C" char **environ __dso_public;
 +#endif
 +
 +namespace {
@@ -1096,24 +1047,30 @@
 
 --- mozilla/ipc/chromium/src/build/build_config.h.orig	2012-03-13 01:36:53.000000000 +0000
 +++ mozilla/ipc/chromium/src/build/build_config.h
-@@ -19,17 +19,23 @@
+@@ -19,6 +19,12 @@
  #define OS_MACOSX 1
  #elif defined(__linux__) || defined(ANDROID)
  #define OS_LINUX 1
-+#elif defined(__NetBSD__)
-+#define OS_NETBSD 1
 +#elif defined(__DragonFly__)
 +#define OS_DRAGONFLY 1
++#elif defined(__FreeBSD__)
++#define OS_FREEBSD 1
++#elif defined(__NetBSD__)
++#define OS_NETBSD 1
  #elif defined(__OpenBSD__)
  #define OS_OPENBSD 1
  #elif defined(_WIN32)
- #define OS_WIN 1
-+#elif defined(__FreeBSD__)
-+#define OS_FREEBSD 1
- #else
+@@ -27,9 +33,16 @@
  #error Please add support for your platform in build/build_config.h
  #endif
  
++// For access to standard BSD features, use OS_BSD instead of a
++// more specific macro.
++#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD)	\
++  || defined(OS_NETBSD) || defined(OS_OPENBSD)
++#define OS_BSD 1
++#endif
++
  // For access to standard POSIX features, use OS_POSIX instead of a more
  // specific macro.
 -#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_OPENBSD)
@@ -1155,7 +1112,7 @@
  #endif
  
 -#if !(defined(OS_MACOSX) || defined(OS_OPENBSD) || defined(OS_WIN) || (defined(OS_LINUX) && defined(ARCH_CPU_64_BITS)) || defined(ARCH_CPU_S390))
-+#if !(defined(OS_MACOSX) || defined(OS_OPENBSD) || defined(OS_WIN) || ((defined(OS_FREEBSD) || defined(OS_DRAGONFLY) || defined(OS_NETBSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS)) || defined(ARCH_CPU_S390))
++#if !(defined(OS_MACOSX) || defined(OS_OPENBSD) || defined(OS_WIN) || ((defined(OS_BSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS)) || defined(ARCH_CPU_S390))
  // There size_t is a synonym for |unsigned long| ...
  template <>
  struct ParamTraits<size_t> {
@@ -1164,7 +1121,7 @@
  #endif  // defined(OS_MACOSX)
  
 -#if !(defined(OS_LINUX) && defined(ARCH_CPU_64_BITS))
-+#if !((defined(OS_FREEBSD) || defined(OS_DRAGONFLY) || defined(OS_NETBSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS))
++#if !((defined(OS_BSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS))
  // int64 is |long int| on 64-bit systems, uint64 is |unsigned long|
  template <>
  struct ParamTraits<int64> {
@@ -1186,7 +1143,7 @@
    };
    typedef HandleAndSequenceNum Id;
 -#elif defined(OS_MACOSX)
-+#elif defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_BSD)
++#elif defined(OS_MACOSX) || defined(OS_BSD)
    typedef base::SharedMemoryHandle Handle;
    // On Mac, the inode number of the backing file is used as an id.
    typedef base::SharedMemoryId Id;
@@ -1264,7 +1221,7 @@
  
 +ifneq (,$(filter DragonFly FreeBSD NetBSD OpenBSD,$(OS_ARCH)))
 +OS_LIBS += $(call EXPAND_LIBNAME,kvm)
-+#EXTRA_DSO_LDOPTS += -Wl,--ignore-unresolved-symbol,environ
++# keep `environ' unresolved, see bug 14426 for binutils
 +EXTRA_DSO_LDOPTS += -Wl,--warn-unresolved-symbols
 +endif
 +



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201208090640.q796ekGT093950>