Boost logo

Boost Users :

Subject: [Boost-users] Boost not compiling with arm-cross-compiler
From: ustulation (ustulation_at_[hidden])
Date: 2014-11-16 01:00:19


{Ubuntu 14.04 64 bits, arm-g++ compiler 4.9 one that comes with google's ndk
r10c)
(The compiler has --sysroot pointing to platform android-14, and
-march=armv7-a)

on using arm cross-compiler for compiling boost I get the following error in
"*socket_ops.ipp*":

*<1> for all function (templates) of this type:*
template <typename SockLenType>
inline int call_getsockname(SockLenType msghdr::*,
    socket_type s, socket_addr_type* addr, std::size_t* addrlen)
{
  SockLenType tmp_addrlen = (SockLenType)*addrlen;
  int result = ::getsockname(s, addr, &tmp_addrlen);
  *addrlen = (std::size_t)tmp_addrlen;
  return result;
}

/some-path/thirdparty/boost/boost_1_55_0_Android/boost/asio/detail/impl/socket_ops.ipp:1639:
error: invalid conversion from 'int*' to 'socklen_t* {aka unsigned int*}'
[-fpermissive]
   int result = ::getsockname(s, addr, &tmp_addrlen);
                                                   ^

On changing the line to:
int result = ::getsockname(s, addr, (socklen_t*)tmp_addrlen);

it compiles fine ofcourse but i don't know if this is what is to be done.

*<2> And in "mapped_region.hpp":
/some-path/thirdparty/boost/boost_1_55_0_Android/boost/interprocess/mapped_region.hpp:49:
error: sys/shm.h: No such file or directory
 # include <sys/shm.h> //System V shared memory...
                                                            ^
*
and points to:
# if defined(BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS)
# include <sys/shm.h> //System V shared memory...
# endif

in that file.

Here are the flags in my user-config.jam file:
using gcc : android
:
@AndroidNDKSrcDir@/bin/arm-linux-androideabi-g++
:
<archiver>@AndroidNDKSrcDir@/bin/arm-linux-androideabi-ar
<compileflags>-fexceptions
<compileflags>-frtti
<compileflags>-fPIC
<compileflags>-std=c++11
<compileflags>-ffunction-sections
<compileflags>-funwind-tables
<compileflags>-D__ARM_ARCH_5__
<compileflags>-D__ARM_ARCH_5T__
<compileflags>-D__ARM_ARCH_5E__
<compileflags>-D__ARM_ARCH_5TE__
<compileflags>-Wno-psabi
<compileflags>-march=armv5te
<compileflags>-mtune=xscale
<compileflags>-msoft-float
<compileflags>-mthumb
<compileflags>-Os
<compileflags>-fomit-frame-pointer
<compileflags>-fno-strict-aliasing
<compileflags>-finline-limit=64
<compileflags>-I_at_AndroidNDKSrcDir@/include/c++/4.9
<compileflags>-Wa,--noexecstack
<compileflags>-DANDROID
<compileflags>-D__ANDROID__
<compileflags>-DNDEBUG
<compileflags>-O2
<compileflags>-g
<compileflags>-I_at_AndroidNDKSrcDir@/sysroot/usr/include
<architecture>arm
<compileflags>-fvisibility=hidden
<compileflags>-fvisibility-inlines-hidden
<compileflags>-fdata-sections
<cxxflags>-D__arm__
<cxxflags>-D_REENTRANT
<cxxflags>-D_GLIBCXX__PTHREADS
;

*What is the way forward for those two errors - <1> and <2> above ?*

--
View this message in context: http://boost.2283326.n4.nabble.com/Boost-not-compiling-with-arm-cross-compiler-tp4669099.html
Sent from the Boost - Users mailing list archive at Nabble.com.

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net