public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: "André Draszik" <git@andred.net>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 3/3] boost: fix MIPS16e compilation
Date: Mon, 29 Aug 2016 12:03:41 +0100	[thread overview]
Message-ID: <20160829110341.13100-4-git@andred.net> (raw)
In-Reply-To: <20160829110341.13100-1-git@andred.net>

use g++ 4.1+ __sync intrinsics instead of incompatible
hand-written assembly

Signed-off-by: André Draszik <git@andred.net>
---
 ...ips-assembly-doesn-t-compile-in-mips16e-m.patch | 57 ++++++++++++++++++++++
 meta/recipes-support/boost/boost_1.61.0.bb         |  1 +
 2 files changed, 58 insertions(+)
 create mode 100644 meta/recipes-support/boost/boost/0003-smart_ptr-mips-assembly-doesn-t-compile-in-mips16e-m.patch

diff --git a/meta/recipes-support/boost/boost/0003-smart_ptr-mips-assembly-doesn-t-compile-in-mips16e-m.patch b/meta/recipes-support/boost/boost/0003-smart_ptr-mips-assembly-doesn-t-compile-in-mips16e-m.patch
new file mode 100644
index 0000000..9fe6389
--- /dev/null
+++ b/meta/recipes-support/boost/boost/0003-smart_ptr-mips-assembly-doesn-t-compile-in-mips16e-m.patch
@@ -0,0 +1,57 @@
+From 4f19d72ca94418431e068cfd4ffb96ed9b289f6c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <adraszik@tycoint.com>
+Date: Wed, 24 Aug 2016 17:34:59 +0100
+Subject: [PATCH 3/3] smart_ptr: mips assembly doesn't compile in mips16e mode
+
+gcc.compile.c++ <builddir>/boost/bin.v2/libs/date_time/build/gcc-4.3.1/release/threading-multi/gregorian/greg_month.o
+
+    "mipsel-poky-linux-musl-g++" "-mel" "-mabi=32" "-msoft-float" "-march=mips32r2" "-mips16" "-minterlink-compressed" "-mtune=24kec" "-mdsp" "-Wl,-O1" "-Wl,--as-needed" "-fstack-protector-strong" "-Wl,-z,relro,-z,now" "--sysroot=<sysroot>"  -ftemplate-depth-128 -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=<srcdir>=/usr/src/debug/boost/1.61.0-r0 -fdebug-prefix-map=<sysroot_host>= -fdebug-prefix-map=<sysroot>= -fstack-protector-strong -pie -fpie -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -fvisibility-inlines-hidden -O3 -finline-functions -Wno-inline -Wall -pthread -fPIC  -DBOOST_ALL_DYN_LINK=1 -DBOOST_ALL_NO_LIB=1 -DDATE_TIME_INLINE -DNDEBUG  -I"." -c -o "<builddir>/boost/bin.v2/libs/date_time/build/gcc-4.3.1/release/threading-multi/gregorian/greg_month.o" "libs/date_time/src/gregorian/greg_month.cpp"
+
+{standard input}: Assembler messages:
+{standard input}:17603: Warning: the `dsp' extension requires MIPS32 revision 2 or greater
+{standard input}:17604: Error: unrecognized opcode `ll $3,4($16)'
+{standard input}:17606: Error: unrecognized opcode `sc $2,4($16)'
+{standard input}:17734: Error: unrecognized opcode `ll $3,8($16)'
+{standard input}:17736: Error: unrecognized opcode `sc $2,8($16)'
+{standard input}:18084: Error: unrecognized opcode `ll $3,4($4)'
+{standard input}:18086: Error: unrecognized opcode `sc $2,4($4)'
+{standard input}:18318: Error: unrecognized opcode `ll $3,8($4)'
+{standard input}:18320: Error: unrecognized opcode `sc $2,8($4)'
+{standard input}:19921: Error: unrecognized opcode `ll $3,4($2)'
+{standard input}:19923: Error: unrecognized opcode `sc $3,4($2)'
+{standard input}:20199: Error: unrecognized opcode `ll $4,4($16)'
+{standard input}:20201: Error: unrecognized opcode `sc $2,4($16)'
+{standard input}:23392: Error: unrecognized opcode `ll $4,8($16)'
+{standard input}:23394: Error: unrecognized opcode `sc $2,8($16)'
+...failed updating 1 target...
+
+boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp
+contains hand-written MIPS assembly, which is not compatible
+with the MIPS16e instruction set.
+
+By not using this file in MIPS16e mode, we fallback to using
+g++ 4.1+ __sync intrinsics (__sync_fetch_and_add() and
+__sync_val_compare_and_swap()) which are working fine.
+
+Signed-off-by: André Draszik <adraszik@tycoint.com>
+---
+Upstream-Status: Sumbitted https://svn.boost.org/trac/boost/ticket/12418
+ boost/smart_ptr/detail/sp_counted_base.hpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/boost/smart_ptr/detail/sp_counted_base.hpp b/boost/smart_ptr/detail/sp_counted_base.hpp
+index 0addf07..0995ca8 100644
+--- a/boost/smart_ptr/detail/sp_counted_base.hpp
++++ b/boost/smart_ptr/detail/sp_counted_base.hpp
+@@ -65,7 +65,7 @@
+ #elif defined( __GNUC__ ) && ( defined( __powerpc__ ) || defined( __ppc__ ) || defined( __ppc ) ) && !defined(__PATHSCALE__) && !defined( _AIX )
+ # include <boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp>
+ 
+-#elif defined( __GNUC__ ) && ( defined( __mips__ ) || defined( _mips ) ) && !defined(__PATHSCALE__)
++#elif defined( __GNUC__ ) && ( defined( __mips__ ) || defined( _mips ) ) && !defined(__PATHSCALE__) && !defined( __mips16 )
+ # include <boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp>
+ 
+ #elif defined( BOOST_SP_HAS_SYNC )
+-- 
+2.9.3
+
diff --git a/meta/recipes-support/boost/boost_1.61.0.bb b/meta/recipes-support/boost/boost_1.61.0.bb
index 09137db..71fd4c4 100644
--- a/meta/recipes-support/boost/boost_1.61.0.bb
+++ b/meta/recipes-support/boost/boost_1.61.0.bb
@@ -7,4 +7,5 @@ SRC_URI += "\
     file://boost-CVE-2012-2677.patch \
     file://0001-boost-asio-detail-socket_types.hpp-fix-poll.h-includ.patch \
     file://0002-gcc-config-BOOST_NO_FENV_H.patch \
+    file://0003-smart_ptr-mips-assembly-doesn-t-compile-in-mips16e-m.patch \
 "
-- 
2.9.3



  parent reply	other threads:[~2016-08-29 11:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-29 11:03 [PATCH 0/3] boost mips16e and soft-float fixes André Draszik
2016-08-29 11:03 ` [PATCH 1/3] boost: fix a musl compilation warning André Draszik
2016-08-29 11:03 ` [PATCH 2/3] boost: fix compilation using soft float toolchains André Draszik
2016-08-29 11:16   ` André Draszik
2016-08-29 11:03 ` André Draszik [this message]
2016-08-29 11:55 ` [PATCH v2 0/3] boost mips16e and soft-float fixes André Draszik
2016-08-29 11:55   ` [PATCH v2 1/3] boost: fix a musl compilation warning André Draszik
2016-08-29 11:55   ` [PATCH v2 2/3] boost: fix compilation using soft float toolchains André Draszik
2016-08-29 11:55   ` [PATCH v2 3/3] boost: fix MIPS16e compilation André Draszik
2016-08-30 16:00   ` [PATCH v2 0/3] boost mips16e and soft-float fixes Richard Purdie
2016-08-30 16:05     ` André Draszik
2016-09-03  0:12 ` [PATCH v3 " André Draszik
2016-09-03  0:12   ` [PATCH v3 1/3] boost: fix a musl compilation warning André Draszik
2016-09-03  0:12   ` [PATCH v3 2/3] boost: fix mips soft float compilation André Draszik
2016-09-03  0:12   ` [PATCH v3 3/3] boost: fix MIPS16e compilation André Draszik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160829110341.13100-4-git@andred.net \
    --to=git@andred.net \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox