1

How to cross compile alljoyn standard core and service framework?

asked 2015-10-01 15:01:50 -0700

pratikmevada gravatar image

updated 2015-10-29 14:41:48 -0700

ry.jones gravatar image
Linux Foundation Staff

Hi All,

I have one wifi camera with armv5 processor and want to cross compile and alljoyn standard core, service framework and want to make notification producer application.

But I am stuck while cross compiling alljoyn. I am compiling alljoyn with codesourcery arm cross compiler with gcc version 4.3.3

Initially I have used same command, used to compile standard core and service framework. Just added CROSS_COMPILE and CPU flag for arm and cross-compiler. Here is the command used, compilation process fails with some error related to "-std=c++11"

scons BINDINGS=cpp WS=off BT=off ICE=off OS=linux CPU=arm CROSS_COMPILE="/home/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-" SERVICES="about,notification,controlpanel,config,onboarding,sample_apps"

cc1plus: error: unrecognized command line option "-std=c++11"

scons: *** [build/linux/arm/debug/obj/services/config/cpp/samples/ConfigClientSample/ConfigClientMain.o] Error 1

After this failure I found following link, https://wiki.allseenalliance.org/deve...

It says that we can compile alljoyn for openwrt on cross compiling. So I ahve prepared and executed following command:

scons BINDINGS=cpp WS=off BT=off ICE=off OS=openwrt CPU=openwrt TARGET_PATH=/home/CodeSourcery/Sourcery_G++_Lite/bin/ TARGET_CC=arm-none-linux-gnueabi-gcc TARGET_CFLAGS="-std=c++0x" TARGET_CPPFLAGS="-std=c++0x" TARGET_CXX=arm-none-linux-gnueabi-g++ TARGET_LINK=arm-none-linux-gnueabi-gcc TARGET_LINKFLAGS="" TARGET_AR="" TARGET_RANLIB="" STAGING_DIR=/usr/lib/x86_64-linux-gnu SERVICES="about,notification,controlpanel,config,onboarding,sample_apps"

But getting error before compilation starts,

scons: Reading SConscript files ...

Checking c++ compiler support for -std=c++11 flag... no

Checking c++ compiler support for -std=c++0x flag... no

*** Compiler too old to build AllJoyn.  Aborting.

So here is my questions,

1. Is it possible to cross compile alljoyn standard client and services without using openwrt?

2. Does cross compiling using openwrt affect any functionality of alljoyn?

3. What should I do to overcome c++11/c++0x error, should I find new gcc version for cross compiling my code.

Please let me know if some one has cross compiled alljoyn standard core and service framework for any platform, please provide me steps/command for that.

Thanks in advance.

Pratik

edit retag flag offensive close merge delete

Comments

you might try on the core mailing list. https://lists.allseenalliance.org/mailman/listinfo/allseen-core

ry.jones ( 2015-10-02 00:15:20 -0700 )edit

3 answers

Sort by ยป oldest newest most voted
1

answered 2015-10-02 13:23:25 -0700

bspencer gravatar image

If you just want to use Notification producer then you should remove the other services so that you don't compile them. What you are providing as errors looks to all be coming from config, so if you reduce your services to just this: SERVICES="about,notification" then compile again and see if you get further and past the issue.

edit flag offensive delete publish link more

Comments

Thanks for your reply Bapsncer. Compiled after removing extra services; but still I am getting same error.

pratikmevada ( 2015-10-02 13:33:34 -0700 )edit

Can you please update with the new error? If you don't need 15.04 you can check out 14.12b and use that version. It didn't have the c++11 flag and check in the SConscript file.

bspencer ( 2015-10-05 10:21:03 -0700 )edit
1

answered 2015-10-05 18:32:51 -0700

garyhu gravatar image

I applied RB14.12 and aarch64-linux-gnu for arm64 support. Env and build commands are:

export CPU=arm64 export OS=linux export VARIANT=release

export CROSS=aarch64-linux-gnu export AR=${CROSS}-ar export AS=${CROSS}-as export CC=${CROSS}-gcc export CPP=${CROSS}-cpp export CXX=${CROSS}-g++ export LD=${CROSS}-ld export RANLIB=${CROSS}-ranlib export STRIP=${CROSS}-strip export READELF=${CROSS}-readelf

scons V=1 OS=$OS CPU=$CPU BINDINGS=cpp VARIANT=$VARIANT WS=off POLICYDB=on CROSS_COMPILE=aarch64-linux-gnu-

edit flag offensive delete publish link more
1

answered 2015-10-29 11:40:47 -0700

stevek gravatar image

1 Is it possible to cross compile alljoyn standard client and services without using openwrt?

Specifying CPU=openwrt and OS=openwrt only adds options to enable cross-compiling for Linux. It is simply an historical artifact resulting from OpenWrt being the first cross-compiled target Linux system to be supported by AllJoyn.

2 Does cross compiling using openwrt affect any functionality of alljoyn?

No. See answer to question 1.

3 What should I do to overcome c++11/c++0x error, should I find new gcc version for cross compiling my code.

Yes. That's what the error "Compiler too old to build AllJoyn. Aborting." is telling you. You need at the very least GCC 4.6 or newer. I highly recommend using 4.8, 4.9, or even better, 5.x since support for 4.6 may be removed in future releases of AllJoyn.

edit flag offensive delete publish link more
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2015-10-01 15:01:50 -0700

Seen: 1,815 times

Last updated: Oct 29 '15