Date: Sat, 7 Sep 2013 21:19:20 +0000 (UTC) From: Raphael Kubo da Costa <rakuco@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r326688 - head/devel/qt4-script/files Message-ID: <201309072119.r87LJKT9089885@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rakuco Date: Sat Sep 7 21:19:20 2013 New Revision: 326688 URL: http://svnweb.freebsd.org/changeset/ports/326688 Log: Bring in a few more libc++ patches I got upstream a few months ago. While here, rename the patch added in r326562 to reflect the right location it changes. Added: head/devel/qt4-script/files/patch-src__3rdparty__javascriptcore__JavaScriptCore__runtime__Collector.cpp (contents, props changed) head/devel/qt4-script/files/patch-src__3rdparty__javascriptcore__JavaScriptCore__wtf__HashTable.h (contents, props changed) head/devel/qt4-script/files/patch-src__3rdparty__javascriptcore__JavaScriptCore__wtf__Threading.h - copied unchanged from r326687, head/devel/qt4-script/files/patch-src__3rdparty__javascriptcore__wtf__Threading.h Deleted: head/devel/qt4-script/files/patch-src__3rdparty__javascriptcore__wtf__Threading.h Added: head/devel/qt4-script/files/patch-src__3rdparty__javascriptcore__JavaScriptCore__runtime__Collector.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/qt4-script/files/patch-src__3rdparty__javascriptcore__JavaScriptCore__runtime__Collector.cpp Sat Sep 7 21:19:20 2013 (r326688) @@ -0,0 +1,38 @@ +From 952b046ba5bc99986f747729681914e21f8fb8b0 Mon Sep 17 00:00:00 2001 +From: "Bradley T. Hughes" <bradley.hughes@nokia.com> +Date: Wed, 30 May 2012 11:49:40 +0200 +Subject: [PATCH] Compile with clang's libc++ + +An overload for std::swap() what works with std::pair<A,B> is included +in libc++ (but not libstdc++). Avoid ambiguity in HashTable.h by +omitting the version there and using the std::swap() version. + +Collector.cpp needs to include pthread.h directly, as it is not +automatically included by libc++'s headers (libstdc++ does pull in +pthread.h though). + +Cherry-picked from qtscript/48baeef0766ba145d26d374561e152b40245f3b8. + +Change-Id: I4dc88638ce8553bb97037b841fc6cc5e8c9911e2 +Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> +--- + src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp | 2 ++ + src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h | 4 ++-- + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp +index 6af1784..711949b 100644 +--- src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp ++++ src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp +@@ -52,6 +52,8 @@ + #include <mach/task.h> + #include <mach/thread_act.h> + #include <mach/vm_map.h> ++// clang's libc++ headers does not pull in pthread.h (but libstdc++ does) ++#include <pthread.h> + + #elif OS(WINDOWS) + +-- +1.8.4 + Added: head/devel/qt4-script/files/patch-src__3rdparty__javascriptcore__JavaScriptCore__wtf__HashTable.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/qt4-script/files/patch-src__3rdparty__javascriptcore__JavaScriptCore__wtf__HashTable.h Sat Sep 7 21:19:20 2013 (r326688) @@ -0,0 +1,40 @@ +From 952b046ba5bc99986f747729681914e21f8fb8b0 Mon Sep 17 00:00:00 2001 +From: "Bradley T. Hughes" <bradley.hughes@nokia.com> +Date: Wed, 30 May 2012 11:49:40 +0200 +Subject: [PATCH] Compile with clang's libc++ + +An overload for std::swap() what works with std::pair<A,B> is included +in libc++ (but not libstdc++). Avoid ambiguity in HashTable.h by +omitting the version there and using the std::swap() version. + +Collector.cpp needs to include pthread.h directly, as it is not +automatically included by libc++'s headers (libstdc++ does pull in +pthread.h though). + +Cherry-picked from qtscript/48baeef0766ba145d26d374561e152b40245f3b8. + +Change-Id: I4dc88638ce8553bb97037b841fc6cc5e8c9911e2 +Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> +--- + src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp | 2 ++ + src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h | 4 ++-- + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h +index bea9daa..42a9233 100644 +--- src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h ++++ src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h +@@ -257,8 +257,8 @@ namespace WTF { + + using std::swap; + +-#if !COMPILER(MSVC) && !OS(QNX) +- // The Dinkumware C++ library (used by MSVC and QNX) has a swap for pairs defined. ++#if !COMPILER(MSVC) && !OS(QNX) && !defined(_LIBCPP_VERSION) ++ // The Dinkumware C++ library (used by MSVC and QNX) and clang's libc++ have a swap for pairs defined. + + // swap pairs by component, in case of pair members that specialize swap + template<typename T, typename U> inline void swap(pair<T, U>& a, pair<T, U>& b) +-- +1.8.4 + Copied: head/devel/qt4-script/files/patch-src__3rdparty__javascriptcore__JavaScriptCore__wtf__Threading.h (from r326687, head/devel/qt4-script/files/patch-src__3rdparty__javascriptcore__wtf__Threading.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/qt4-script/files/patch-src__3rdparty__javascriptcore__JavaScriptCore__wtf__Threading.h Sat Sep 7 21:19:20 2013 (r326688, copy of r326687, head/devel/qt4-script/files/patch-src__3rdparty__javascriptcore__wtf__Threading.h) @@ -0,0 +1,91 @@ +From 0de22e80ac645afc3793419300d6271d95809196 Mon Sep 17 00:00:00 2001 +From: Raphael Kubo da Costa <rakuco@FreeBSD.org> +Date: Tue, 11 Jun 2013 19:25:08 +0300 +Subject: [PATCH] Bring in WebKit revisions 139553 and 139921. + +They are primarily useful for getting rid of some libstdc++-specific +includes which break the build with libc++, and also for simplifying the +code and removing a Darwin-specific code path. + +r139553 by ossy@webkit.org: + Use sync_add_and_fetch instead of gnu_cxx::exchange_and_add + https://bugs.webkit.org/show_bug.cgi?id=106729 + + After r139514 we need atomicIncrement(int64_t volatile*) for all + platform. Now the GCC implementation of atomicIncrement() is based on + gnu_cxx::exchange_and_add, which doesn't support int64_t type, but + sync_add_and_fetch does. + + Reviewed by Benjamin Poulain. + +r139921 by benjamin@webkit.org: + Use GCC's implementation of atomicIncrement/Decrement on Mac + https://bugs.webkit.org/show_bug.cgi?id=106976 + + Reviewed by Filip Pizlo. + + wtf/Atomics.h: GCC and LLVM have builtin for atomic ADD and SUB: + sync_add_and_fetch, sync_sub_and_fetch. + + Using them let the compiler just generate the atomic operations inline + instead of generating a function call to LibC. It also simplify the + code a bit. + +Cherry-picked from qtscript/184fc178f4c753727445694c4830c250f53da588. + +Change-Id: Id785e35944682691725947e0f329668d17ff6903 +Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> +--- + .../javascriptcore/JavaScriptCore/wtf/Threading.h | 18 ++---------------- + 1 file changed, 2 insertions(+), 16 deletions(-) + +diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h +index 8b76c0f..b3ea7d2 100644 +--- src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h ++++ src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h +@@ -71,18 +71,10 @@ + + #if OS(WINDOWS) && !OS(WINCE) + #include <windows.h> +-#elif OS(DARWIN) +-#include <libkern/OSAtomic.h> + #elif OS(ANDROID) + #include <cutils/atomic.h> + #elif OS(QNX) + #include <atomic.h> +-#elif COMPILER(GCC) && !OS(SYMBIAN) +-#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) +-#include <ext/atomicity.h> +-#else +-#include <bits/atomicity.h> +-#endif + #endif + + #if USE(PTHREADS) +@@ -230,12 +222,6 @@ inline int atomicIncrement(int volatile* addend) { return InterlockedIncrement(r + inline int atomicDecrement(int volatile* addend) { return InterlockedDecrement(reinterpret_cast<long volatile*>(addend)); } + #endif + +-#elif OS(DARWIN) +-#define WTF_USE_LOCKFREE_THREADSAFESHARED 1 +- +-inline int atomicIncrement(int volatile* addend) { return OSAtomicIncrement32Barrier(const_cast<int*>(addend)); } +-inline int atomicDecrement(int volatile* addend) { return OSAtomicDecrement32Barrier(const_cast<int*>(addend)); } +- + #elif OS(ANDROID) + + inline int atomicIncrement(int volatile* addend) { return android_atomic_inc(addend); } +@@ -250,8 +236,8 @@ inline int atomicDecrement(int volatile* addend) { return (int) atomic_sub_value + #elif COMPILER(GCC) && !CPU(SPARC64) && !OS(SYMBIAN) // sizeof(_Atomic_word) != sizeof(int) on sparc64 gcc + #define WTF_USE_LOCKFREE_THREADSAFESHARED 1 + +-inline int atomicIncrement(int volatile* addend) { return __gnu_cxx::__exchange_and_add(addend, 1) + 1; } +-inline int atomicDecrement(int volatile* addend) { return __gnu_cxx::__exchange_and_add(addend, -1) - 1; } ++inline int atomicIncrement(int volatile* addend) { return __sync_add_and_fetch(addend, 1); } ++inline int atomicDecrement(int volatile* addend) { return __sync_sub_and_fetch(addend, 1); } + + #endif + +-- +1.8.4 +
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201309072119.r87LJKT9089885>