boost 1.36: various ARM fixups:
authorKoen Kooi <koen@openembedded.org>
Wed, 4 Nov 2009 21:03:23 +0000 (22:03 +0100)
committerKoen Kooi <koen@openembedded.org>
Wed, 4 Nov 2009 21:03:23 +0000 (22:03 +0100)
* changed intrinsics patch to work for armv6 and armv7a
* disabled atomic ops for arm versions <6
* fix associated build damage
* pass in correct gcc version

recipes/boost/boost-36.inc
recipes/boost/boost_1.36.0.bb
recipes/boost/files/01-no-serialization-test.patch [new file with mode: 0644]
recipes/boost/files/02-atomic-count-pthreads-on-arm.patch [new file with mode: 0644]
recipes/boost/files/03-exception-clone-destructor-fix.patch [new file with mode: 0644]
recipes/boost/files/arm-intrinsics.patch

index 4bd065f..1200e9a 100644 (file)
@@ -128,7 +128,7 @@ BJAM_OPTS    = '${BJAM_TOOLS} \
 do_configure_prepend() {
        cp -f boost/config/platform/linux.hpp boost/config/platform/linux-gnueabi.hpp
 
-       echo 'using gcc : 4.3.1 : ${CXX} : compileflags -DBOOST_SP_USE_PTHREADS -I${includedir} linkflags -L${libdir} ;' >> ${S}/tools/build/v2/user-config.jam
+       echo "using gcc : $(${CXX} -dumpversion) : ${CXX} : compileflags -DBOOST_SP_USE_PTHREADS -I${includedir} linkflags -L${libdir} ;" >> ${S}/tools/build/v2/user-config.jam
 }
 
 do_compile() {
index 140ab29..898d1b1 100644 (file)
@@ -1,9 +1,12 @@
 include boost-36.inc
 
-PR = "r6"
+PR = "r7"
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/boost/${BOOST_P}.tar.bz2 \
            file://arm-intrinsics.patch;patch=1 \
+           file://01-no-serialization-test.patch;patch=1 \
+           file://02-atomic-count-pthreads-on-arm.patch;patch=1 \
+           file://03-exception-clone-destructor-fix.patch;patch=1 \
           "
 
 BJAM_OPTS    = '${BJAM_TOOLS} \
diff --git a/recipes/boost/files/01-no-serialization-test.patch b/recipes/boost/files/01-no-serialization-test.patch
new file mode 100644 (file)
index 0000000..f1c9ca8
--- /dev/null
@@ -0,0 +1,12 @@
+diff -purN orig/libs/serialization/build/Jamfile.v2 boost_1_36_0/libs/serialization/build/Jamfile.v2
+--- orig/libs/serialization/build/Jamfile.v2   2008-09-11 18:45:03.000000000 -0400
++++ boost_1_36_0/libs/serialization/build/Jamfile.v2   2008-09-11 18:45:40.000000000 -0400
+@@ -8,7 +8,7 @@
+ project boost/serialization
+     : source-location ../src
+-    : requirements <dependency>../../config/test/all//BOOST_NO_STD_LOCALE
++    : requirements
+       <conditional>@include-spirit
+ ;
diff --git a/recipes/boost/files/02-atomic-count-pthreads-on-arm.patch b/recipes/boost/files/02-atomic-count-pthreads-on-arm.patch
new file mode 100644 (file)
index 0000000..c6f2e19
--- /dev/null
@@ -0,0 +1,17 @@
+diff -purN orig/boost/detail/atomic_count.hpp boost_1_36_0/boost/detail/atomic_count.hpp
+--- orig/boost/detail/atomic_count.hpp 2008-09-12 11:48:45.000000000 -0400
++++ boost_1_36_0/boost/detail/atomic_count.hpp 2008-09-12 14:36:33.000000000 -0400
+@@ -93,6 +93,13 @@ typedef long atomic_count;
+ #  include <boost/detail/atomic_count_pthreads.hpp>
++#elif defined(BOOST_HAS_PTHREADS) && defined(__arm__) && !defined(__ARM_ARCH_7A__) && !defined(__ARM_ARCH_6J__) 
++
++// MLC: need this on ARM, otherwise it'll attempt to use atomic_count_sync,
++// which has no ARM implementation.
++#  define BOOST_AC_USE_PTHREADS
++#  include <boost/detail/atomic_count_pthreads.hpp>
++
+ #elif defined( __GNUC__ ) && ( defined( __i386__ ) || defined( __x86_64__ ) )
+ # include <boost/detail/atomic_count_gcc_x86.hpp>
diff --git a/recipes/boost/files/03-exception-clone-destructor-fix.patch b/recipes/boost/files/03-exception-clone-destructor-fix.patch
new file mode 100644 (file)
index 0000000..d78759b
--- /dev/null
@@ -0,0 +1,12 @@
+diff -purN orig/boost/exception/enable_current_exception.hpp boost_1_36_0/boost/exception/enable_current_exception.hpp
+--- orig/boost/exception/enable_current_exception.hpp  2008-09-12 11:48:45.000000000 -0400
++++ boost_1_36_0/boost/exception/enable_current_exception.hpp  2008-09-12 15:13:06.000000000 -0400
+@@ -96,6 +96,8 @@ boost
+                         *be1 = *be2;
+                 }
++            ~exception_clone() throw() { }
++
+             private:
+             detail::atomic_count mutable count_;
index 860b6df..1f1eed6 100644 (file)
@@ -5,7 +5,7 @@ diff -Nurd boost_1_36_0.orig/boost/detail/atomic_count_sync.hpp boost_1_36_0.arm
  
      void operator++()
      {
-+#ifdef __ARM_ARCH_7A__
++#if defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_6J__)
 +       int v1, tmp;
 +       asm volatile ("1:                 \n\t"
 +                     "ldrex   %0, %1     \n\t"
@@ -22,7 +22,7 @@ diff -Nurd boost_1_36_0.orig/boost/detail/atomic_count_sync.hpp boost_1_36_0.arm
  
      long operator--()
      {
-+#ifdef __ARM_ARCH_7A__
++#if defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_6J__)
 +       int v1, tmp;
 +       asm volatile ("1:                 \n\t"
 +                     "ldrex   %0, %1     \n\t"
@@ -40,7 +40,7 @@ diff -Nurd boost_1_36_0.orig/boost/detail/atomic_count_sync.hpp boost_1_36_0.arm
  
      operator long() const
      {
-+#if __ARM_ARCH_7A__
++#if defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_6J__)
 +        return value_;
 +#else
          return __sync_fetch_and_add( &value_, 0 );