Fix PR pkg/48240 and PR pkg/48370

* Add forgotten patch for NetBSD's cpuset(3), fix build
* Use __fstat50 etc instead of fstat on NetBSD. Based on martin@'s patch
  for firefox 27.0.
  Restore session is recovered on NetBSD/amd64.
This commit is contained in:
ryoon 2013-11-08 12:55:51 +00:00
parent d05c281284
commit d149a06f2a
7 changed files with 211 additions and 2 deletions

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.104 2013/11/04 06:01:46 ryoon Exp $
$NetBSD: distinfo,v 1.105 2013/11/08 12:55:51 ryoon Exp $
SHA1 (enigmail-1.6.tar.gz) = 51a7eb7d86ce24d8199f741a0079f0d56ecd6368
RMD160 (enigmail-1.6.tar.gz) = a854bb37a6a7f298f6cc268110dcb21d00909fa4
@ -40,7 +40,7 @@ SHA1 (patch-mozilla_extensions_spellcheck_hunspell_src_mozHunspell.cpp) = 5f4c28
SHA1 (patch-mozilla_gfx_graphite2_src_Bidi.cpp) = fb97becdfeeea742e8c0bc51e10efc124a2a11f3
SHA1 (patch-mozilla_gfx_skia_include_core_SkPreConfig.h) = 5a45df0ec2be71f9406333488632bb7c42cafa68
SHA1 (patch-mozilla_gfx_skia_moz.build) = d74b274c0a1cfa02804c154669e200c764a900e5
SHA1 (patch-mozilla_gfx_skia_src_utils_SkThreadUtils__pthread__linux.cpp) = 7345c4535876933c16e2257cf5da0115e43aa39e
SHA1 (patch-mozilla_gfx_skia_src_utils_SkThreadUtils__pthread__linux.cpp) = a25edef88cb3a7d905acdf0267a75eb666eac6d6
SHA1 (patch-mozilla_image_decoders_nsJPEGDecoder.cpp) = 316bfe765e20f188c847efa30cfa0ccc9f4fc7e5
SHA1 (patch-mozilla_intl_hyphenation_src_hnjalloc.h) = 8b670bca826d17e373c1c09893e335c1bb3d4546
SHA1 (patch-mozilla_ipc_chromium_Makefile.in) = 076293610dc66961d8179863b056eb666f10391e
@ -118,6 +118,8 @@ SHA1 (patch-mozilla_netwerk_wifi_moz.build) = f2232f82ee267fdbbcf1c4090390a6bea9
SHA1 (patch-mozilla_netwerk_wifi_nsWifiScannerFreeBSD.cpp) = 780dabd37ea0eab07932489181de4cdfe0a5b4a3
SHA1 (patch-mozilla_security_manager_ssl_src_JARSignatureVerification.cpp) = 9f265784d23be668dbb1fcb4e09185670a298293
SHA1 (patch-mozilla_security_manager_ssl_src_nsNSSComponent.cpp) = 56531146315f3eac703a02ed23ef90f7ac4917b9
SHA1 (patch-mozilla_toolkit_components_osfile_modules_osfile__unix__back.jsm) = ffe3a1c0915cab3d0f14b47a57925e79c13bd3d5
SHA1 (patch-mozilla_toolkit_components_osfile_modules_osfile__unix__front.jsm) = 84c7aeeab671115c99f9b9afa7b0958830167e49
SHA1 (patch-mozilla_toolkit_library_Makefile.in) = e7915dacee2a0bd3983cafd421ffe55ed54a5874
SHA1 (patch-mozilla_toolkit_mozapps_update_updater_updater.cpp) = 2d4769262671a41950d872f46806374efbbccb37
SHA1 (patch-mozilla_toolkit_toolkit.mozbuild) = d0510df2e3fb3a7c5dd713b36351e72961788345

View file

@ -0,0 +1,12 @@
$NetBSD: patch-mozilla_config_stl-headers,v 1.1 2013/11/08 12:55:52 ryoon Exp $
--- mozilla/config/stl-headers.orig 2013-10-29 01:20:42.000000000 +0000
+++ mozilla/config/stl-headers
@@ -21,6 +21,7 @@ algorithm
atomic
deque
ios
+iosfwd
iostream
iterator
limits

View file

@ -0,0 +1,9 @@
$NetBSD: patch-mozilla_config_system__wrappers_unwind.h,v 1.3 2013/11/08 12:55:52 ryoon Exp $
--- mozilla/config/system_wrappers/unwind.h.orig 2013-11-04 05:52:46.000000000 +0000
+++ mozilla/config/system_wrappers/unwind.h
@@ -0,0 +1,4 @@
+#pragma GCC system_header
+#pragma GCC visibility push(default)
+#include_next <unwind.h>
+#pragma GCC visibility pop

View file

@ -0,0 +1,89 @@
$NetBSD: patch-mozilla_gfx_skia_src_utils_SkThreadUtils__pthread__linux.cpp,v 1.1 2013/11/08 12:55:52 ryoon Exp $
* Use cpuset(3) for NetBSD. From rmind@.
--- mozilla/gfx/skia/src/utils/SkThreadUtils_pthread_linux.cpp.orig 2013-10-29 01:20:50.000000000 +0000
+++ mozilla/gfx/skia/src/utils/SkThreadUtils_pthread_linux.cpp
@@ -12,26 +12,47 @@
#include "SkThreadUtils.h"
#include "SkThreadUtils_pthread.h"
+#include <unistd.h>
#include <pthread.h>
#ifdef __FreeBSD__
#include <pthread_np.h>
#endif
+#ifdef __NetBSD__
+#include <sched.h>
+#endif
#if defined(__FreeBSD__) || defined(__NetBSD__)
#define cpu_set_t cpuset_t
#endif
-#ifndef CPU_COUNT
+#if !defined(CPU_COUNT) && !defined(__NetBSD__)
static int CPU_COUNT(cpu_set_t *set) {
int count = 0;
for (int i = 0; i < CPU_SETSIZE; i++) {
if (CPU_ISSET(i, set)) {
count++;
- }
+ }
+ }
+ return count;
+}
+#endif
+
+#if defined(__NetBSD__)
+
+#define CPU_ISSET(c, s) cpuset_isset(c, s)
+
+static int CPU_COUNT(cpuset_t *set) {
+ static const int ncpu = sysconf(_SC_NPROCESSORS_CONF);
+ int count = 0;
+
+ for (int i = 0; i < ncpu; i++) {
+ if (cpuset_isset(i, set)) {
+ count++;
+ }
}
return count;
}
-#endif /* !CPU_COUNT */
+#endif
static int nth_set_cpu(unsigned int n, cpu_set_t* cpuSet) {
n %= CPU_COUNT(cpuSet);
@@ -51,6 +72,7 @@ bool SkThread::setProcessorAffinity(unsi
return false;
}
+#if !defined(__NetBSD__)
cpu_set_t parentCpuset;
if (0 != pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &parentCpuset)) {
return false;
@@ -62,4 +84,23 @@ bool SkThread::setProcessorAffinity(unsi
return 0 == pthread_setaffinity_np(pthreadData->fPThread,
sizeof(cpu_set_t),
&cpuset);
+#else
+ cpuset_t *cpuset = cpuset_create();
+ if (!cpuset) {
+ return false;
+ }
+ size_t csize = cpuset_size(cpuset);
+ if (0 != pthread_getaffinity_np(pthread_self(), csize, cpuset)) {
+ cpuset_destroy(cpuset);
+ return false;
+ }
+
+ int nthcpu = nth_set_cpu(processor, cpuset);
+ cpuset_zero(cpuset);
+ cpuset_set(nthcpu, cpuset);
+
+ bool ok = 0 == pthread_setaffinity_np(pthreadData->fPThread, csize, cpuset);
+ cpuset_destroy(cpuset);
+ return ok;
+#endif
}

View file

@ -0,0 +1,14 @@
$NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.1 2013/11/08 12:55:52 ryoon Exp $
--- mozilla/media/libcubeb/src/cubeb_alsa.c.orig 2013-10-29 01:21:03.000000000 +0000
+++ mozilla/media/libcubeb/src/cubeb_alsa.c
@@ -6,6 +6,9 @@
*/
#undef NDEBUG
#define _BSD_SOURCE
+#if defined(__NetBSD__)
+#define _NETBSD_SOURCE
+#endif
#define _XOPEN_SOURCE 500
#include <pthread.h>
#include <sys/time.h>

View file

@ -0,0 +1,70 @@
$NetBSD: patch-mozilla_toolkit_components_osfile_modules_osfile__unix__back.jsm,v 1.1 2013/11/08 12:55:52 ryoon Exp $
--- mozilla/toolkit/components/osfile/modules/osfile_unix_back.jsm.orig 2013-10-29 01:21:11.000000000 +0000
+++ mozilla/toolkit/components/osfile/modules/osfile_unix_back.jsm
@@ -170,7 +170,7 @@
}
stat.add_field_at(OS.Constants.libc.OSFILE_OFFSETOF_STAT_ST_SIZE,
- "st_size", Types.size_t.implementation);
+ "st_size", Types.off_t.implementation);
Types.stat = stat.getType();
}
@@ -397,10 +397,17 @@
/*oflags*/Types.int,
/*mode*/ Types.int);
+ if (OS.Constants.Sys.Name == "NetBSD") {
+ UnixFile.opendir =
+ declareFFI("__opendir30", ctypes.default_abi,
+ /*return*/ Types.null_or_DIR_ptr,
+ /*path*/ Types.path);
+ } else {
UnixFile.opendir =
declareFFI("opendir", ctypes.default_abi,
/*return*/ Types.null_or_DIR_ptr,
/*path*/ Types.path);
+ }
UnixFile.pread =
declareFFI("pread", ctypes.default_abi,
@@ -434,6 +441,11 @@
declareFFI("readdir$INODE64", ctypes.default_abi,
/*return*/Types.null_or_dirent_ptr,
/*dir*/ Types.DIR.in_ptr); // For MacOS X
+ } else if (OS.Constants.Sys.Name == "NetBSD") {
+ UnixFile.readdir =
+ declareFFI("__readdir30", ctypes.default_abi,
+ /*return*/Types.null_or_dirent_ptr,
+ /*dir*/ Types.DIR.in_ptr);
} else {
UnixFile.readdir =
declareFFI("readdir", ctypes.default_abi,
@@ -553,6 +565,26 @@
UnixFile.fstat = function stat(fd, buf) {
return fxstat(ver, fd, buf);
};
+ } else if (OS.Constants.Sys.Name == "NetBSD") {
+ // NetBSD 5.0 and newer
+ UnixFile.stat =
+ declareFFI("__stat50", ctypes.default_abi,
+ /*return*/ Types.negativeone_or_nothing,
+ /*path*/ Types.path,
+ /*buf*/ Types.stat.out_ptr
+ );
+ UnixFile.lstat =
+ declareFFI("__lstat50", ctypes.default_abi,
+ /*return*/ Types.negativeone_or_nothing,
+ /*path*/ Types.path,
+ /*buf*/ Types.stat.out_ptr
+ );
+ UnixFile.fstat =
+ declareFFI("__fstat50", ctypes.default_abi,
+ /*return*/ Types.negativeone_or_nothing,
+ /*fd*/ Types.fd,
+ /*buf*/ Types.stat.out_ptr
+ );
} else {
// Mac OS X 32-bits, other Unix
UnixFile.stat =

View file

@ -0,0 +1,13 @@
$NetBSD: patch-mozilla_toolkit_components_osfile_modules_osfile__unix__front.jsm,v 1.1 2013/11/08 12:55:52 ryoon Exp $
--- mozilla/toolkit/components/osfile/modules/osfile_unix_front.jsm.orig 2013-10-29 01:21:11.000000000 +0000
+++ mozilla/toolkit/components/osfile/modules/osfile_unix_front.jsm
@@ -734,7 +734,7 @@
File.Info = function Info(stat) {
let isDir = (stat.st_mode & OS.Constants.libc.S_IFMT) == OS.Constants.libc.S_IFDIR;
let isSymLink = (stat.st_mode & OS.Constants.libc.S_IFMT) == OS.Constants.libc.S_IFLNK;
- let size = exports.OS.Shared.Type.size_t.importFromC(stat.st_size);
+ let size = exports.OS.Shared.Type.off_t.importFromC(stat.st_size);
let lastAccessDate = new Date(stat.st_atime * 1000);
let lastModificationDate = new Date(stat.st_mtime * 1000);