Squashed 'yocto-poky/' content from commit ea562de

git-subtree-dir: yocto-poky
git-subtree-split: ea562de57590c966cd5a75fda8defecd397e6436
diff --git a/meta/recipes-support/boost/bjam-native_1.58.0.bb b/meta/recipes-support/boost/bjam-native_1.58.0.bb
new file mode 100644
index 0000000..32646d7
--- /dev/null
+++ b/meta/recipes-support/boost/bjam-native_1.58.0.bb
@@ -0,0 +1,18 @@
+include boost-${PV}.inc
+
+SUMMARY = "Portable Boost.Jam build tool for boost"
+SECTION = "devel"
+
+inherit native
+
+SRC_URI += "file://bjam-native-build-bjam.debug.patch"
+
+do_compile() {
+    ./bootstrap.sh --with-toolset=gcc
+}
+
+do_install() {
+    install -d ${D}${bindir}/
+    # install unstripped version for bjam
+    install -c -m 755 bjam.debug ${D}${bindir}/bjam
+}
diff --git a/meta/recipes-support/boost/boost-1.58.0.inc b/meta/recipes-support/boost/boost-1.58.0.inc
new file mode 100644
index 0000000..b47d091
--- /dev/null
+++ b/meta/recipes-support/boost/boost-1.58.0.inc
@@ -0,0 +1,22 @@
+# The Boost web site provides free peer-reviewed portable
+# C++ source libraries. The emphasis is on libraries which
+# work well with the C++ Standard Library. The libraries are
+# intended to be widely useful, and are in regular use by
+# thousands of programmers across a broad spectrum of applications.
+HOMEPAGE = "http://www.boost.org/"
+LICENSE = "BSL-1.0 & MIT & Python-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE_1_0.txt;md5=e4224ccaecb14d942c71d31bef20d78c"
+
+BOOST_VER = "${@"_".join(d.getVar("PV",1).split("."))}"
+BOOST_MAJ = "${@"_".join(d.getVar("PV",1).split(".")[0:2])}"
+BOOST_P = "boost_${BOOST_VER}"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/boost/${BOOST_P}.tar.bz2 \
+           file://0001-mips1-fix-added-gcc.jam-was-passing-the-options-m32-.patch \
+           file://0002-Don-t-pass-m32-m64-where-it-s-not-supported.patch \
+"
+
+SRC_URI[md5sum] = "b8839650e61e9c1c0a89f371dd475546"
+SRC_URI[sha256sum] = "fdfc204fc33ec79c99b9a74944c3e54bd78be4f7f15e260c0e2700a36dc7d3e5"
+
+S = "${WORKDIR}/${BOOST_P}"
diff --git a/meta/recipes-support/boost/boost.inc b/meta/recipes-support/boost/boost.inc
new file mode 100644
index 0000000..3288e84
--- /dev/null
+++ b/meta/recipes-support/boost/boost.inc
@@ -0,0 +1,192 @@
+SUMMARY = "Free peer-reviewed portable C++ source libraries"
+SECTION = "libs"
+DEPENDS = "bjam-native zlib bzip2"
+
+ARM_INSTRUCTION_SET = "arm"
+
+BOOST_LIBS = "\
+	atomic \
+	chrono \
+	date_time \
+	filesystem \
+	graph \
+	iostreams \
+	log \
+	program_options \
+	random \
+	regex \
+	serialization \
+	signals \
+	system \
+	test \
+	thread \
+	"
+
+# optional boost-python library
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[python] = ",,python python3"
+BOOST_LIBS += "${@bb.utils.contains('PACKAGECONFIG', 'python', 'python python3', '', d)}"
+inherit python-dir
+PYTHON_ROOT = "${STAGING_DIR_HOST}/${prefix}"
+
+# Make a package for each library, plus -dev
+PACKAGES = "${PN}-dbg ${BOOST_PACKAGES}"
+python __anonymous () {
+    packages = []
+    extras = []
+    for lib in d.getVar('BOOST_LIBS', True).split( ):
+        # BJAM does not know '--with-python3' (only --with-python)
+        if lib != "python3":
+            extras.append("--with-%s" % lib)
+        pkg = "boost-%s" % lib.replace("_", "-")
+        packages.append(pkg)
+        if lib == "python":
+            # special: python*.so matches python3.so !!
+            if not d.getVar("FILES_%s" % pkg, True):
+                    d.setVar("FILES_%s" % pkg, "${libdir}/libboost_%s.so.*" % lib)
+        else:
+            if not d.getVar("FILES_%s" % pkg, True):
+                    d.setVar("FILES_%s" % pkg, "${libdir}/libboost_%s*.so.*" % lib)
+    d.setVar("BOOST_PACKAGES", " ".join(packages))
+    d.setVar("BJAM_EXTRA", " ".join(extras))
+}
+
+# Override the contents of specific packages
+FILES_boost-serialization = "${libdir}/libboost_serialization*.so.* \
+	${libdir}/libboost_wserialization*.so.*"
+FILES_boost-test = "${libdir}/libboost_prg_exec_monitor*.so.* \
+	${libdir}/libboost_unit_test_framework*.so.*"
+
+# -dev last to pick up the remaining stuff
+PACKAGES += "${PN}-dev ${PN}-staticdev"
+FILES_${PN}-dev = "${includedir} ${libdir}/libboost_*.so"
+FILES_${PN}-staticdev = "${libdir}/libboost_*.a"
+
+# "boost" is a metapackage which pulls in all boost librabries
+PACKAGES += "${PN}"
+RRECOMMENDS_${PN} += "${BOOST_PACKAGES}"
+RRECOMMENDS_${PN}_class-native = ""
+ALLOW_EMPTY_${PN} = "1"
+
+# to avoid GNU_HASH QA errors added LDFLAGS to ARCH; a little bit dirty but at least it works
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+# Oh yippee, a new build system, it's sooo cooool I could eat my own
+# foot.  inlining=on lets the compiler choose, I think.  At least this
+# stuff is documented...
+# NOTE: if you leave <debug-symbols>on then in a debug build the build sys
+# objcopy will be invoked, and that won't work.  Building debug apparently
+# requires hacking gcc-tools.jam
+#
+# Sometimes I wake up screaming.  Famous figures are gathered in the nightmare,
+# Steve Bourne, Larry Wall, the whole of the ANSI C committee.  They're just
+# standing there, waiting, but the truely terrifying thing is what they carry
+# in their hands.  At first sight each seems to bear the same thing, but it is
+# not so for the forms in their grasp are ever so slightly different one from
+# the other.  Each is twisted in some grotesque way from the other to make each
+# an unspeakable perversion impossible to perceive without the onset of madness.
+# True insanity awaits anyone who perceives all of these horrors together.
+#
+# Quotation marks, there might be an easier way to do this, but I can't find
+# it.  The problem is that the user.hpp configuration file must receive a
+# pre-processor macro defined as the appropriate string - complete with "'s
+# around it.  (<> is a possibility here but the danger to that is that the
+# failure case interprets the < and > as shell redirections, creating
+# random files in the source tree.)
+#
+#bjam: '-DBOOST_PLATFORM_CONFIG=\"config\"'
+#do_compile: '-sGCC=... '"'-DBOOST_PLATFORM_CONFIG=\"config\"'"
+SQD = '"'
+EQD = '\"'
+#boost.bb:   "...  '-sGCC=... '${SQD}'-DBOOST_PLATFORM_CONFIG=${EQD}config${EQD}'${SQD} ..."
+BJAM_CONF = "${SQD}'-DBOOST_PLATFORM_CONFIG=${EQD}boost/config/platform/${TARGET_OS}.hpp${EQD}'${SQD}"
+
+BJAM_TOOLS   = "--ignore-site-config \
+		'-sTOOLS=gcc' \
+		'-sGCC=${CC} '${BJAM_CONF} \
+		'-sGXX=${CXX} '${BJAM_CONF} \
+		'-sGCC_INCLUDE_DIRECTORY=${STAGING_INCDIR}' \
+		'-sGCC_STDLIB_DIRECTORY=${STAGING_LIBDIR}' \
+		'-sBUILD=release <optimization>space <threading>multi <inlining>on <debug-symbols>off' \
+		'-sPYTHON_ROOT=${PYTHON_ROOT}' \
+		'--layout=system' \
+		"
+
+# use PARALLEL_MAKE to speed up the build, but limit it by -j 64, greater paralelism causes bjam to segfault or to ignore -j
+# https://svn.boost.org/trac/boost/ticket/7634
+def get_boost_parallel_make(bb, d):
+    pm = d.getVar('PARALLEL_MAKE', True)
+    if pm:
+        # look for '-j' and throw other options (e.g. '-l') away
+        # because they might have different meaning in bjam
+        pm = pm.split()
+        while pm:
+            v = None
+            opt = pm.pop(0)
+            if opt == '-j':
+                v = pm.pop(0)
+            elif opt.startswith('-j'):
+                v = opt[2:].strip()
+            else:
+                v = None
+
+            if v:
+                v = min(64, int(v))
+                return '-j' + str(v)
+
+    return ""
+
+BOOST_PARALLEL_MAKE = "${@get_boost_parallel_make(bb, d)}"
+BJAM_OPTS    = '${BOOST_PARALLEL_MAKE} \
+		${BJAM_TOOLS} \
+		-sBOOST_BUILD_USER_CONFIG=${S}/tools/build/example/user-config.jam \
+		--builddir=${S}/${TARGET_SYS} \
+		--disable-icu \
+		${BJAM_EXTRA}'
+
+# Native compilation of bzip2 isn't working
+BJAM_OPTS_append_class-native = ' -sNO_BZIP2=1'
+
+do_boostconfig() {
+	cp -f boost/config/platform/linux.hpp boost/config/platform/linux-gnueabi.hpp
+
+	# D2194:Fixing the failure of "error: duplicate initialization of gcc with the following parameters" during compilation.
+	sed -i "/^using gcc : 4.3.1/d" ${S}/tools/build/example/user-config.jam
+	sed -i "/^using python : ${PYTHON_BASEVERSION}"/d ${S}/tools/build/example/user-config.jam
+	echo 'using gcc : 4.3.1 : ${CXX} : <cflags>"${CFLAGS}" <cxxflags>"${CXXFLAGS}" <linkflags>"${LDFLAGS}" ;' >> ${S}/tools/build/example/user-config.jam
+	echo "using python : ${PYTHON_BASEVERSION} : : ${STAGING_INCDIR}/python${PYTHON_BASEVERSION} ;" >> ${S}/tools/build/example/user-config.jam
+	echo "using python : 3.4 : : ${STAGING_INCDIR}/python3.4m ;" >> ${S}/tools/build/example/user-config.jam
+
+	CC="${BUILD_CC}" CFLAGS="${BUILD_CFLAGS}" ./bootstrap.sh --with-bjam=bjam --with-toolset=gcc --with-python-root=${PYTHON_ROOT}
+	sed -i '/^using python/d' project-config.jam
+}
+
+do_boostconfig[dirs] = "${S}"
+addtask do_boostconfig after do_patch before do_configure
+
+do_compile() {
+	set -ex
+	bjam ${BJAM_OPTS} --prefix=${prefix} \
+		--exec-prefix=${exec_prefix} \
+		--libdir=${libdir} \
+		--includedir=${includedir}
+}
+
+do_install() {
+	set -ex
+	bjam ${BJAM_OPTS} \
+		--libdir=${D}${libdir} \
+		--includedir=${D}${includedir} \
+		install
+	for lib in ${BOOST_LIBS}; do
+		if [ -e ${D}${libdir}/libboost_${lib}.a ]; then
+			ln -s libboost_${lib}.a ${D}${libdir}/libboost_${lib}-mt.a
+		fi
+		if [ -e ${D}${libdir}/libboost_${lib}.so ]; then
+			ln -s libboost_${lib}.so ${D}${libdir}/libboost_${lib}-mt.so
+		fi
+	done
+
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-support/boost/boost/arm-intrinsics.patch b/meta/recipes-support/boost/boost/arm-intrinsics.patch
new file mode 100644
index 0000000..fe85c69
--- /dev/null
+++ b/meta/recipes-support/boost/boost/arm-intrinsics.patch
@@ -0,0 +1,55 @@
+Upstream-Status: Backport
+
+8/17/2010 - rebased to 1.44 by Qing He <qing.he@intel.com>
+
+diff --git a/boost/smart_ptr/detail/atomic_count_sync.hpp b/boost/smart_ptr/detail/atomic_count_sync.hpp
+index b6359b5..78b1cc2 100644
+--- a/boost/smart_ptr/detail/atomic_count_sync.hpp
++++ b/boost/smart_ptr/detail/atomic_count_sync.hpp
+@@ -33,17 +33,46 @@ public:
+ 
+     long operator++()
+     {
++#ifdef __ARM_ARCH_7A__
++       int v1, tmp;
++       asm volatile ("1:                 \n\t"
++                     "ldrex   %0, %1     \n\t"
++                     "add     %0 ,%0, #1 \n\t"
++                     "strex   %2, %0, %1 \n\t"
++                     "cmp     %2, #0     \n\t"
++                     "bne     1b         \n\t"
++                     : "=&r" (v1), "+Q"(value_), "=&r"(tmp)
++                    );
++#else
+         return __sync_add_and_fetch( &value_, 1 );
++#endif
+     }
+ 
+     long operator--()
+     {
++#ifdef __ARM_ARCH_7A__
++       int v1, tmp;
++       asm volatile ("1:                 \n\t"
++                     "ldrex   %0, %1     \n\t"
++                     "sub     %0 ,%0, #1 \n\t"
++                     "strex   %2, %0, %1 \n\t"
++                     "cmp     %2, #0     \n\t"
++                     "bne     1b         \n\t"
++                     : "=&r" (v1), "+Q"(value_), "=&r"(tmp)
++                    );
++       return value_;
++#else
+         return __sync_add_and_fetch( &value_, -1 );
++#endif
+     }
+ 
+     operator long() const
+     {
++#if __ARM_ARCH_7A__
++        return value_;
++#else
+         return __sync_fetch_and_add( &value_, 0 );
++#endif
+     }
+ 
+ private:
diff --git a/meta/recipes-support/boost/boost_1.58.0.bb b/meta/recipes-support/boost/boost_1.58.0.bb
new file mode 100644
index 0000000..c09d5f4
--- /dev/null
+++ b/meta/recipes-support/boost/boost_1.58.0.bb
@@ -0,0 +1,6 @@
+include boost-${PV}.inc
+include boost.inc
+
+SRC_URI += "\
+    file://arm-intrinsics.patch \
+"
diff --git a/meta/recipes-support/boost/files/0001-mips1-fix-added-gcc.jam-was-passing-the-options-m32-.patch b/meta/recipes-support/boost/files/0001-mips1-fix-added-gcc.jam-was-passing-the-options-m32-.patch
new file mode 100644
index 0000000..329b4c3
--- /dev/null
+++ b/meta/recipes-support/boost/files/0001-mips1-fix-added-gcc.jam-was-passing-the-options-m32-.patch
@@ -0,0 +1,33 @@
+From 817aed0d755bf8c0ba4ef6a77d41538e50b571fd Mon Sep 17 00:00:00 2001
+From: claymore <carlosmf.pt@gmail.com>
+Date: Fri, 24 Apr 2015 02:28:47 +0100
+Subject: [PATCH 1/2] mips1 fix added gcc.jam was passing the options -m32 and
+ -m64 to mips cross-compilers, when those do not use
+ such options This modification solves it by adding mips
+ as an exception
+
+Signed-off-by: Carlos M. Ferreira carlosmf.pt@gmail.com
+
+Upstream-Status: Backport
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
+---
+ tools/build/src/tools/gcc.jam |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tools/build/src/tools/gcc.jam b/tools/build/src/tools/gcc.jam
+index db04534..eff95ae 100644
+--- a/tools/build/src/tools/gcc.jam
++++ b/tools/build/src/tools/gcc.jam
+@@ -451,7 +451,7 @@ rule setup-address-model ( targets * : sources * : properties * )
+         else
+         {
+             local arch = [ feature.get-values architecture : $(properties) ] ;
+-            if $(arch) != arm
++            if $(arch) != arm && $(arch) != mips1
+             {
+                 if $(model) = 32
+                 {
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-support/boost/files/0002-Don-t-pass-m32-m64-where-it-s-not-supported.patch b/meta/recipes-support/boost/files/0002-Don-t-pass-m32-m64-where-it-s-not-supported.patch
new file mode 100644
index 0000000..ecf7e55
--- /dev/null
+++ b/meta/recipes-support/boost/files/0002-Don-t-pass-m32-m64-where-it-s-not-supported.patch
@@ -0,0 +1,40 @@
+From f825634a56b119dfa9d712119a66279cc7635978 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?J=C3=B6rg=20Krause?= <joerg.krause@embedded.rocks>
+Date: Sat, 2 May 2015 14:24:02 +0200
+Subject: [PATCH 2/2] Don't pass -m32/-m64 where it's not supported.
+
+Only PowerPC, SPARC, and x86 do support the -m32 and -m64 compiler options [1].
+
+Rather then excluding all architectures not supporting these options as it is
+done in commit c0634341d9ee2c02d3a55c91dafb988afc066c49 [2], include all
+architectures that do support them.
+
+This will fix building Boost for the SuperH architecture with Buildroot [3].
+
+[1] https://gcc.gnu.org/onlinedocs/gcc/Option-Summary.html
+[2] https://github.com/boostorg/build/commit/c0634341d9ee2c02d3a55c91dafb988afc066c49
+[3] http://autobuild.buildroot.net/results/ccd/ccd5c83963032ba49b1627b1dff39e34a9486943/build-end.log
+
+Upstream-Status: Backport
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
+---
+ tools/build/src/tools/gcc.jam |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tools/build/src/tools/gcc.jam b/tools/build/src/tools/gcc.jam
+index eff95ae..2f6af93 100644
+--- a/tools/build/src/tools/gcc.jam
++++ b/tools/build/src/tools/gcc.jam
+@@ -451,7 +451,7 @@ rule setup-address-model ( targets * : sources * : properties * )
+         else
+         {
+             local arch = [ feature.get-values architecture : $(properties) ] ;
+-            if $(arch) != arm && $(arch) != mips1
++            if $(arch) = power || $(arch) = sparc || $(arch) = x86
+             {
+                 if $(model) = 32
+                 {
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-support/boost/files/bjam-native-build-bjam.debug.patch b/meta/recipes-support/boost/files/bjam-native-build-bjam.debug.patch
new file mode 100644
index 0000000..9f8b7ea
--- /dev/null
+++ b/meta/recipes-support/boost/files/bjam-native-build-bjam.debug.patch
@@ -0,0 +1,50 @@
+From 619ada314ab26c0c9cbfe5702cd9c0caa8f6415a Mon Sep 17 00:00:00 2001
+From: Wenzong Fan <wenzong.fan@windriver.com>
+Date: Mon, 3 Aug 2015 17:12:33 +0800
+Subject: [PATCH] bjam-native: build bjam.debug
+
+bjam is stripped by default, this causes QA warning while stripping it
+from do_populate_sysroot():
+
+  WARNING: File '.../tmp/sysroots/x86_64-linux/usr/bin/bjam' \
+    from bjam-native was already stripped, \
+    this will prevent future debugging!
+
+The JAM scripts allow to build unstripped version with '--debug'. Just
+build and install the bjam.debug to stop bjam from being stripped in
+compile step.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ bootstrap.sh                    | 1 +
+ tools/build/src/engine/build.sh | 2 +-
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/bootstrap.sh b/bootstrap.sh
+index 98cf88b..54690aa 100755
+--- a/bootstrap.sh
++++ b/bootstrap.sh
+@@ -228,6 +228,7 @@ if test "x$BJAM" = x; then
+   echo "tools/build/src/engine/$arch/b2"
+   cp "$BJAM" .
+   cp "$my_dir/tools/build/src/engine/$arch/bjam" .
++  cp "$my_dir/tools/build/src/engine/${arch}.debug/bjam" bjam.debug
+ 
+ fi
+ 
+diff --git a/tools/build/src/engine/build.sh b/tools/build/src/engine/build.sh
+index 6dbc706..c69fdc7 100755
+--- a/tools/build/src/engine/build.sh
++++ b/tools/build/src/engine/build.sh
+@@ -312,5 +312,5 @@ if test -x "./bootstrap/jam0" ; then
+     if test "${BJAM_UPDATE}" != "update" ; then
+         echo_run ./bootstrap/jam0 -f build.jam --toolset=$BOOST_JAM_TOOLSET "--toolset-root=$BOOST_JAM_TOOLSET_ROOT" "$@" clean
+     fi
+-    echo_run ./bootstrap/jam0 -f build.jam --toolset=$BOOST_JAM_TOOLSET "--toolset-root=$BOOST_JAM_TOOLSET_ROOT" "$@"
++    echo_run ./bootstrap/jam0 -f build.jam --toolset=$BOOST_JAM_TOOLSET "--toolset-root=$BOOST_JAM_TOOLSET_ROOT" "$@" --debug
+ fi
+-- 
+1.9.1
+