pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/www/firefox



Module Name:    pkgsrc
Committed By:   martin
Date:           Thu Jun 29 08:07:59 UTC 2017

Modified Files:
        pkgsrc/www/firefox: Makefile distinfo
Added Files:
        pkgsrc/www/firefox/patches: patch-ipc_glue_CrossProcessSemaphore.h
            patch-ipc_glue_CrossProcessSemaphore__posix.cpp

Log Message:
Add patch from PR 51966.


To generate a diff of this commit:
cvs rdiff -u -r1.297 -r1.298 pkgsrc/www/firefox/Makefile
cvs rdiff -u -r1.282 -r1.283 pkgsrc/www/firefox/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/www/firefox/patches/patch-ipc_glue_CrossProcessSemaphore.h \
    pkgsrc/www/firefox/patches/patch-ipc_glue_CrossProcessSemaphore__posix.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/www/firefox/Makefile
diff -u pkgsrc/www/firefox/Makefile:1.297 pkgsrc/www/firefox/Makefile:1.298
--- pkgsrc/www/firefox/Makefile:1.297   Wed Jun 14 11:28:44 2017
+++ pkgsrc/www/firefox/Makefile Thu Jun 29 08:07:59 2017
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.297 2017/06/14 11:28:44 ryoon Exp $
+# $NetBSD: Makefile,v 1.298 2017/06/29 08:07:59 martin Exp $
 
 FIREFOX_VER=           ${MOZ_BRANCH}${MOZ_BRANCH_MINOR}
 MOZ_BRANCH=            54.0
@@ -6,6 +6,7 @@ MOZ_BRANCH_MINOR=       
 
 DISTNAME=      firefox-${FIREFOX_VER}.source
 PKGNAME=       firefox-${MOZ_BRANCH}${MOZ_BRANCH_MINOR:S/b/beta/:S/esr//}
+PKGREVISION=   1
 CATEGORIES=    www
 MASTER_SITES+= ${MASTER_SITE_MOZILLA:=firefox/releases/${FIREFOX_VER}/source/}
 MASTER_SITES+= ${MASTER_SITE_MOZILLA_ALL:=firefox/releases/${FIREFOX_VER}/source/}

Index: pkgsrc/www/firefox/distinfo
diff -u pkgsrc/www/firefox/distinfo:1.282 pkgsrc/www/firefox/distinfo:1.283
--- pkgsrc/www/firefox/distinfo:1.282   Wed Jun 14 11:28:44 2017
+++ pkgsrc/www/firefox/distinfo Thu Jun 29 08:07:59 2017
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.282 2017/06/14 11:28:44 ryoon Exp $
+$NetBSD: distinfo,v 1.283 2017/06/29 08:07:59 martin Exp $
 
 SHA1 (firefox-54.0.source.tar.xz) = 44e40c77f58e3b203dc60f51c5a02993f6c38ee5
 RMD160 (firefox-54.0.source.tar.xz) = 310f21498bc69939049d3ca881674a40fba8da21
@@ -49,6 +49,8 @@ SHA1 (patch-ipc_chromium_src_base_sys__i
 SHA1 (patch-ipc_chromium_src_base_time__posix.cc) = ba4e0872490f870e7d2f468e1fe87c33cf9a3500
 SHA1 (patch-ipc_chromium_src_build_build__config.h) = 9e4f15226c494f5015dbea3a0df6af851449ae15
 SHA1 (patch-ipc_chromium_src_chrome_common_transport__dib.h) = 33ea11a8c23f2fefcb318342ac9e94d3885cb3b1
+SHA1 (patch-ipc_glue_CrossProcessSemaphore.h) = 778a569887d8ad082abc2fa2fe89a0a943e84d64
+SHA1 (patch-ipc_glue_CrossProcessSemaphore__posix.cpp) = fc07bb12aa304c184e523072ad496a3863cb7f07
 SHA1 (patch-ipc_glue_GeckoChildProcessHost.cpp) = 37fca99dc5359a7c1403b7674080bd27b0a5eafe
 SHA1 (patch-js_src_jit_arm_Architecture-arm.cpp) = f0b554c169643b8447b4f29168d61ea257b18782
 SHA1 (patch-js_src_jit_none_AtomicOperations-sparc.h) = b44992a869d6d08809a9edc28f1ad6f40632d392

Added files:

Index: pkgsrc/www/firefox/patches/patch-ipc_glue_CrossProcessSemaphore.h
diff -u /dev/null pkgsrc/www/firefox/patches/patch-ipc_glue_CrossProcessSemaphore.h:1.1
--- /dev/null   Thu Jun 29 08:07:59 2017
+++ pkgsrc/www/firefox/patches/patch-ipc_glue_CrossProcessSemaphore.h   Thu Jun 29 08:07:59 2017
@@ -0,0 +1,21 @@
+$NetBSD: patch-ipc_glue_CrossProcessSemaphore.h,v 1.1 2017/06/29 08:07:59 martin Exp $
+
+- avoid use of sem_t on NetBSD
+  http://mail-index.netbsd.org/pkgsrc-bugs/2017/06/23/msg062225.html
+
+--- ipc/glue/CrossProcessSemaphore.h.orig      2017-06-05 20:45:20.000000000 +0000
++++ ipc/glue/CrossProcessSemaphore.h
+@@ -91,7 +91,13 @@ private:
+   HANDLE mSemaphore;
+ #elif !defined(OS_MACOSX)
+   RefPtr<mozilla::ipc::SharedMemoryBasic> mSharedBuffer;
++#if defined(__NetBSD__)
++  pthread_mutex_t* mMutex;
++  pthread_cond_t* mNotZero;
++  uint32_t* mValue;
++#else
+   sem_t* mSemaphore;
++#endif
+   mozilla::Atomic<int32_t>* mRefCount;
+ #endif
+ };
Index: pkgsrc/www/firefox/patches/patch-ipc_glue_CrossProcessSemaphore__posix.cpp
diff -u /dev/null pkgsrc/www/firefox/patches/patch-ipc_glue_CrossProcessSemaphore__posix.cpp:1.1
--- /dev/null   Thu Jun 29 08:07:59 2017
+++ pkgsrc/www/firefox/patches/patch-ipc_glue_CrossProcessSemaphore__posix.cpp  Thu Jun 29 08:07:59 2017
@@ -0,0 +1,191 @@
+$NetBSD: patch-ipc_glue_CrossProcessSemaphore__posix.cpp,v 1.1 2017/06/29 08:07:59 martin Exp $
+
+- avoid use of sem_t on NetBSD
+  http://mail-index.netbsd.org/pkgsrc-bugs/2017/06/23/msg062225.html
+
+--- ipc/glue/CrossProcessSemaphore_posix.cpp.orig      2017-06-25 05:29:49.000000000 +0000
++++ ipc/glue/CrossProcessSemaphore_posix.cpp
+@@ -9,6 +9,11 @@
+ #include "nsDebug.h"
+ #include "nsISupportsImpl.h"
+ #include <errno.h>
++#if defined(__NetBSD__)
++#include <iostream>
++#include <unistd.h>
++#include <limits>
++#endif
+ 
+ static const uint64_t kNsPerMs = 1000000;
+ static const uint64_t kNsPerSec = 1000000000;
+@@ -17,7 +22,13 @@ namespace {
+ 
+ 
+ struct SemaphoreData {
++#if defined(__NetBSD__)
++  pthread_mutex_t mMutex;
++  pthread_cond_t mNotZero;
++  uint32_t mValue;
++#else
+   sem_t mSemaphore;
++#endif
+   mozilla::Atomic<int32_t> mRefCount;
+   uint32_t mInitialValue;
+ };
+@@ -44,13 +55,27 @@ CrossProcessSemaphore::Create(const char
+     return nullptr;
+   }
+ 
++#if defined(__NetBSD__)
++  data->mValue = aInitialValue;
++  if (pthread_mutex_init(&data->mMutex, NULL) ||
++      pthread_cond_init(&data->mNotZero, NULL) ) {
++    return nullptr;
++  }
++#else
+   if (sem_init(&data->mSemaphore, 1, aInitialValue)) {
+     return nullptr;
+   }
++#endif
+ 
+   CrossProcessSemaphore* sem = new CrossProcessSemaphore;
+   sem->mSharedBuffer = sharedBuffer;
++#if defined(__NetBSD__)
++  sem->mMutex = &data->mMutex;  
++  sem->mNotZero = &data->mNotZero;  
++  sem->mValue = &data->mValue;
++#else
+   sem->mSemaphore = &data->mSemaphore;
++#endif
+   sem->mRefCount = &data->mRefCount;
+   *sem->mRefCount = 1;
+ 
+@@ -84,24 +109,44 @@ CrossProcessSemaphore::Create(CrossProce
+ 
+   int32_t oldCount = data->mRefCount++;
+   if (oldCount == 0) {
++#if defined(__NetBSD__)
++    if (pthread_mutex_init(&data->mMutex, NULL) ||
++        pthread_cond_init(&data->mNotZero, NULL) ) {
++      data->mRefCount--;
++      return nullptr;
++    }
++#else
+     // The other side has already let go of their CrossProcessSemaphore, so now
+     // mSemaphore is garbage. We need to re-initialize it.
+     if (sem_init(&data->mSemaphore, 1, data->mInitialValue)) {
+       data->mRefCount--;
+       return nullptr;
+     }
++#endif
+   }
+ 
+   CrossProcessSemaphore* sem = new CrossProcessSemaphore;
+   sem->mSharedBuffer = sharedBuffer;
++#if defined(__NetBSD__)
++  sem->mMutex = &data->mMutex;  
++  sem->mNotZero = &data->mNotZero;  
++  sem->mValue = &data->mValue;
++#else
+   sem->mSemaphore = &data->mSemaphore;
++#endif
+   sem->mRefCount = &data->mRefCount;
+   return sem;
+ }
+ 
+ 
+ CrossProcessSemaphore::CrossProcessSemaphore()
++#if defined(__NetBSD__)
++  : mMutex (nullptr)
++  , mNotZero (nullptr)
++  , mValue (nullptr)
++#else
+   : mSemaphore(nullptr)
++#endif
+   , mRefCount(nullptr)
+ {
+   MOZ_COUNT_CTOR(CrossProcessSemaphore);
+@@ -113,17 +158,58 @@ CrossProcessSemaphore::~CrossProcessSema
+ 
+   if (oldCount == 0) {
+     // Nothing can be done if the destroy fails so ignore return code.
++#if defined(__NetBSD__)
++    (void)pthread_cond_destroy(mNotZero);
++    (void)pthread_mutex_destroy(mMutex);
++#else
+     Unused << sem_destroy(mSemaphore);
++#endif
+   }
+ 
+   MOZ_COUNT_DTOR(CrossProcessSemaphore);
+ }
+ 
++#if defined(__NetBSD__)
++static struct timespec
++makeAbsTime(const Maybe<TimeDuration>& aWaitTime) {
++  struct timespec ts;
++  if (aWaitTime.isSome()) {
++    clock_gettime(CLOCK_REALTIME, &ts);
++    ts.tv_nsec += (kNsPerMs * aWaitTime->ToMilliseconds());
++    ts.tv_sec += ts.tv_nsec / kNsPerSec;
++    ts.tv_nsec %= kNsPerSec;
++  }
++  else {
++    ts.tv_sec = std::numeric_limits<time_t>::max();
++    ts.tv_nsec = 0;
++  }
++  return ts;
++}
++#endif
++
+ bool
+ CrossProcessSemaphore::Wait(const Maybe<TimeDuration>& aWaitTime)
+ {
+   MOZ_ASSERT(*mRefCount > 0, "Attempting to wait on a semaphore with zero ref count");
+   int ret;
++#if defined(__NetBSD__)
++  struct timespec ts = makeAbsTime(aWaitTime);
++
++  ret = pthread_mutex_lock(mMutex);
++
++  if (ret == 0) {
++    while (ret == 0 && mValue == 0) {
++      ret = pthread_cond_timedwait(mNotZero, mMutex, &ts);
++      while (ret == -1 && errno == EINTR) {
++        ret = pthread_cond_timedwait(mNotZero, mMutex, &ts);
++      }
++    }
++    if (ret == 0) {
++      --(*mValue);
++    }
++    pthread_mutex_unlock(mMutex);
++  }
++#else
+   if (aWaitTime.isSome()) {
+     struct timespec ts;
+     if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {
+@@ -142,6 +228,7 @@ CrossProcessSemaphore::Wait(const Maybe<
+       continue;
+     }
+   }
++#endif
+   return ret == 0;
+ }
+ 
+@@ -149,7 +236,17 @@ void
+ CrossProcessSemaphore::Signal()
+ {
+   MOZ_ASSERT(*mRefCount > 0, "Attempting to signal a semaphore with zero ref count");
++#if defined(__NetBSD__)
++  int ret;
++  ret = pthread_mutex_lock(mMutex);
++  if (ret == 0) {
++    ++(*mValue);
++    pthread_cond_signal(mNotZero);
++    pthread_mutex_unlock(mMutex);
++  }
++#else
+   sem_post(mSemaphore);
++#endif
+ }
+ 
+ CrossProcessSemaphoreHandle



Home | Main Index | Thread Index | Old Index