Ticket #12418: 0001-smart_ptr-mips-assembly-doesn-t-compile-in-mips16e-m.patch

File 0001-smart_ptr-mips-assembly-doesn-t-compile-in-mips16e-m.patch, 3.6 KB (added by git@…, 6 years ago)

use sync intrinsics when in mips16e mode

  • include/boost/smart_ptr/detail/sp_counted_base.hpp

    From ef199c690fac396aa2937ee20b19addd4be7bb93 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] smart_ptr: mips assembly doesn't compile in mips16e mode
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    
    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...
    
    include/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>
    ---
     include/boost/smart_ptr/detail/sp_counted_base.hpp | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/include/boost/smart_ptr/detail/sp_counted_base.hpp b/include/boost/smart_ptr/detail/sp_counted_base.hpp
    index 851ef19..83ede23 100644
    a b  
    6868#elif defined( __GNUC__ ) && ( defined( __powerpc__ ) || defined( __ppc__ ) || defined( __ppc ) ) && !defined(__PATHSCALE__) && !defined( _AIX )
    6969# include <boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp>
    7070
    71 #elif defined( __GNUC__ ) && ( defined( __mips__ ) || defined( _mips ) ) && !defined(__PATHSCALE__)
     71#elif defined( __GNUC__ ) && ( defined( __mips__ ) || defined( _mips ) ) && !defined(__PATHSCALE__) && !defined( __mips16 )
    7272# include <boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp>
    7373
    7474#elif defined( BOOST_SP_HAS_SYNC )