mirror of
https://github.com/deneraraujo/OpenVPNAdapter.git
synced 2026-04-24 00:00:05 +08:00
Merge commit '86cc97e55fe346502462284d2e636a2b3708163e' as 'Sources/OpenVPN3'
This commit is contained in:
@@ -0,0 +1,87 @@
|
||||
--- boost/atomic/detail/cas128strong.hpp
|
||||
+++ boost/atomic/detail/cas128strong.hpp
|
||||
@@ -196,15 +196,17 @@ class base_atomic<T, void, 16, Sign>
|
||||
|
||||
public:
|
||||
BOOST_DEFAULTED_FUNCTION(base_atomic(void), {})
|
||||
- explicit base_atomic(value_type const& v) BOOST_NOEXCEPT : v_(0)
|
||||
+ explicit base_atomic(value_type const& v) BOOST_NOEXCEPT
|
||||
{
|
||||
+ memset(&v_, 0, sizeof(v_));
|
||||
memcpy(&v_, &v, sizeof(value_type));
|
||||
}
|
||||
|
||||
void
|
||||
store(value_type const& value, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
|
||||
{
|
||||
- storage_type value_s = 0;
|
||||
+ storage_type value_s;
|
||||
+ memset(&value_s, 0, sizeof(value_s));
|
||||
memcpy(&value_s, &value, sizeof(value_type));
|
||||
platform_fence_before_store(order);
|
||||
platform_store128(value_s, &v_);
|
||||
@@ -247,7 +249,9 @@ class base_atomic<T, void, 16, Sign>
|
||||
memory_order success_order,
|
||||
memory_order failure_order) volatile BOOST_NOEXCEPT
|
||||
{
|
||||
- storage_type expected_s = 0, desired_s = 0;
|
||||
+ storage_type expected_s, desired_s;
|
||||
+ memset(&expected_s, 0, sizeof(expected_s));
|
||||
+ memset(&desired_s, 0, sizeof(desired_s));
|
||||
memcpy(&expected_s, &expected, sizeof(value_type));
|
||||
memcpy(&desired_s, &desired, sizeof(value_type));
|
||||
|
||||
--- boost/atomic/detail/gcc-atomic.hpp
|
||||
+++ boost/atomic/detail/gcc-atomic.hpp
|
||||
@@ -958,14 +958,16 @@ class base_atomic<T, void, 16, Sign>
|
||||
|
||||
public:
|
||||
BOOST_DEFAULTED_FUNCTION(base_atomic(void), {})
|
||||
- explicit base_atomic(value_type const& v) BOOST_NOEXCEPT : v_(0)
|
||||
+ explicit base_atomic(value_type const& v) BOOST_NOEXCEPT
|
||||
{
|
||||
+ memset(&v_, 0, sizeof(v_));
|
||||
memcpy(&v_, &v, sizeof(value_type));
|
||||
}
|
||||
|
||||
void store(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
|
||||
{
|
||||
- storage_type tmp = 0;
|
||||
+ storage_type tmp;
|
||||
+ memset(&tmp, 0, sizeof(tmp));
|
||||
memcpy(&tmp, &v, sizeof(value_type));
|
||||
__atomic_store_n(&v_, tmp, atomics::detail::convert_memory_order_to_gcc(order));
|
||||
}
|
||||
@@ -980,7 +982,8 @@ class base_atomic<T, void, 16, Sign>
|
||||
|
||||
value_type exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
|
||||
{
|
||||
- storage_type tmp = 0;
|
||||
+ storage_type tmp;
|
||||
+ memset(&tmp, 0, sizeof(tmp));
|
||||
memcpy(&tmp, &v, sizeof(value_type));
|
||||
tmp = __atomic_exchange_n(&v_, tmp, atomics::detail::convert_memory_order_to_gcc(order));
|
||||
value_type res;
|
||||
@@ -994,7 +997,9 @@ class base_atomic<T, void, 16, Sign>
|
||||
memory_order success_order,
|
||||
memory_order failure_order) volatile BOOST_NOEXCEPT
|
||||
{
|
||||
- storage_type expected_s = 0, desired_s = 0;
|
||||
+ storage_type expected_s, desired_s;
|
||||
+ memset(&expected_s, 0, sizeof(expected_s));
|
||||
+ memset(&desired_s, 0, sizeof(desired_s));
|
||||
memcpy(&expected_s, &expected, sizeof(value_type));
|
||||
memcpy(&desired_s, &desired, sizeof(value_type));
|
||||
const bool success = __atomic_compare_exchange_n(&v_, &expected_s, desired_s, false,
|
||||
@@ -1010,7 +1015,9 @@ class base_atomic<T, void, 16, Sign>
|
||||
memory_order success_order,
|
||||
memory_order failure_order) volatile BOOST_NOEXCEPT
|
||||
{
|
||||
- storage_type expected_s = 0, desired_s = 0;
|
||||
+ storage_type expected_s, desired_s;
|
||||
+ memset(&expected_s, 0, sizeof(expected_s));
|
||||
+ memset(&desired_s, 0, sizeof(desired_s));
|
||||
memcpy(&expected_s, &expected, sizeof(value_type));
|
||||
memcpy(&desired_s, &desired, sizeof(value_type));
|
||||
const bool success = __atomic_compare_exchange_n(&v_, &expected_s, desired_s, true,
|
||||
--
|
||||
Executable
+75
@@ -0,0 +1,75 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Parameters:
|
||||
# SDK_PATH_SCRIPT -- optional script to set SDK path
|
||||
|
||||
set -e
|
||||
if [ -z "$O3" ]; then
|
||||
echo O3 var must point to ovpn3 tree
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "$TARGETS" ]; then
|
||||
echo TARGETS var must be defined
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# NOTE: in Boost 1.55 and earlier, set BCONF=tools/build/v2
|
||||
BCONF=tools/build/src
|
||||
|
||||
. $O3/core/deps/lib-versions
|
||||
[ -z "$DL" ] && DL=~/Downloads
|
||||
[ -z "$GPP_CMD" ] && export GPP_CMD=g++
|
||||
[ -z "$GCC_CMD" ] && export GCC_CMD=gcc
|
||||
if [ "$NO_WIPE" != "1" ]; then
|
||||
echo WIPE and reunzip source
|
||||
rm -rf boost $BOOST_VERSION
|
||||
mkdir boost
|
||||
tar xfz $DL/$BOOST_VERSION.tar.gz
|
||||
cd $BOOST_VERSION
|
||||
#patch -p1 <$DL/asio-engine.patch
|
||||
#patch -p0 <$O3/core/deps/boost/atomic-1.55.0.patch
|
||||
patch -p1 <$O3/core/deps/boost/intrusive_ptr.patch
|
||||
patch -p1 <$O3/core/deps/boost/page_size.patch
|
||||
|
||||
./bootstrap.sh
|
||||
|
||||
for T in $TARGETS ; do
|
||||
TS="${T//-/}"
|
||||
. $O3/core/vars/vars-$T
|
||||
cat >>$BCONF/user-config.jam <<EOF
|
||||
using $GCC_CMD : $TS : $GPP_CMD
|
||||
:
|
||||
<compileflags>"-Wno-unused-function $PLATFORM_FLAGS $CXX_COMPILER_FLAGS $OTHER_COMPILER_FLAGS $LIB_FPIC $LIB_OPT_LEVEL"
|
||||
;
|
||||
EOF
|
||||
done
|
||||
echo '********** BOOST CONFIG'
|
||||
tail -30 $BCONF/user-config.jam
|
||||
echo '********** END BOOST CONFIG'
|
||||
else
|
||||
echo RETAIN existing source
|
||||
cd $BOOST_VERSION
|
||||
for T in $TARGETS ; do
|
||||
TS="${T//-/}"
|
||||
. $O3/core/vars/vars-$T
|
||||
done
|
||||
fi
|
||||
[ "$SDK_PATH_SCRIPT" ] && . $SDK_PATH_SCRIPT
|
||||
for T in $TARGETS ; do
|
||||
. $O3/core/vars/vars-$T
|
||||
target="${T//-/}"
|
||||
stage=stage-$T
|
||||
if [ "${target:(-3)}" == "dbg" ]; then
|
||||
variant=debug
|
||||
else
|
||||
variant=release
|
||||
fi
|
||||
[ -z "$LINK_MODE" ] && LINK_MODE=static
|
||||
echo "************************ $target $variant $stage"
|
||||
cmd="./bjam -d2 toolset=${GCC_CMD}-${target} --stagedir=$stage --with-system --with-thread --with-atomic variant=$variant link=$LINK_MODE threading=multi runtime-link=$LINK_MODE"
|
||||
echo $cmd
|
||||
$cmd
|
||||
done
|
||||
mv stage-* ../boost/
|
||||
cp -a boost ../boost/
|
||||
exit 0
|
||||
@@ -0,0 +1,29 @@
|
||||
diff -ur boost_1_56_0.orig/boost/smart_ptr/intrusive_ptr.hpp boost_1_56_0/boost/smart_ptr/intrusive_ptr.hpp
|
||||
--- boost_1_56_0.orig/boost/smart_ptr/intrusive_ptr.hpp 2014-07-26 00:44:34.000000000 -0600
|
||||
+++ boost_1_56_0/boost/smart_ptr/intrusive_ptr.hpp 2014-08-15 19:51:11.000000000 -0600
|
||||
@@ -63,7 +63,7 @@
|
||||
{
|
||||
}
|
||||
|
||||
- intrusive_ptr( T * p, bool add_ref = true ): px( p )
|
||||
+ intrusive_ptr( T * p, bool add_ref = true ) BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(intrusive_ptr_add_ref(static_cast<T*>(nullptr)))) : px( p )
|
||||
{
|
||||
if( px != 0 && add_ref ) intrusive_ptr_add_ref( px );
|
||||
}
|
||||
@@ -80,14 +80,14 @@
|
||||
intrusive_ptr( intrusive_ptr<U> const & rhs )
|
||||
|
||||
#endif
|
||||
- : px( rhs.get() )
|
||||
+ BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(intrusive_ptr_add_ref(static_cast<T*>(nullptr)))) : px( rhs.get() )
|
||||
{
|
||||
if( px != 0 ) intrusive_ptr_add_ref( px );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
- intrusive_ptr(intrusive_ptr const & rhs): px( rhs.px )
|
||||
+ intrusive_ptr(intrusive_ptr const & rhs) BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(intrusive_ptr_add_ref(static_cast<T*>(nullptr)))) : px( rhs.px )
|
||||
{
|
||||
if( px != 0 ) intrusive_ptr_add_ref( px );
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
diff -ur boost_1_57_0/boost/thread/pthread/thread_data.hpp boost_1_57_0.new/boost/thread/pthread/thread_data.hpp
|
||||
--- boost_1_57_0/boost/thread/pthread/thread_data.hpp 2014-10-24 10:43:26.000000000 -0600
|
||||
+++ boost_1_57_0.new/boost/thread/pthread/thread_data.hpp 2015-02-26 00:43:26.000000000 -0700
|
||||
@@ -24,8 +24,10 @@
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
|
||||
-#if defined(__ANDROID__)
|
||||
-#include <asm/page.h> // http://code.google.com/p/android/issues/detail?id=39983
|
||||
+// JY modified
|
||||
+#if defined(__ANDROID__) && !defined(PAGE_SIZE)
|
||||
+#define PAGE_SIZE 4096
|
||||
+//#include <asm/page.h> // http://code.google.com/p/android/issues/detail?id=39983
|
||||
#endif
|
||||
|
||||
#include <pthread.h>
|
||||
Reference in New Issue
Block a user