1

Cannot build Alljoyn for Linux openwrt

asked 2015-09-03 22:40:56 -0800

iriver gravatar image

updated 2015-09-04 10:31:49 -0800

stevek gravatar image

Hi,

I'm working on a Ubuntu 12.04 and followed this page to get all the source files. And I started to build, looking at this page. Then I run the command below:

scons CPU=openwrt BINDINGS="cpp,java,c,unity,js" WS=off BR=off ICE=off SERVICES="about,notification,controlpanel,config,onboarding"

However I got the error:

/usr/bin/ld: build/linux/openwrt/debug/dist/cpp/lib/**liballjoyn.a**(Debug.o): relocation R_X86_64_32S against `.rodata._ZZL6Output10DbgMsgTypePKcS1_PvE11priorityMap' **can not be used when making a shared object**; recompile with -fPIC

A full error log is below:

scons: Reading SConscript files ...
Checking c++ compiler support for -std=c++11 flag... (cached) no
Checking c++ compiler support for -std=c++0x flag... (cached) yes
scons: warning: Ignoring missing SConscript 'build_core/conf/linux/openwrt/SConscript'
File "/usr2/shaungja/Documents/alljoyn_build/core/alljoyn/build_core/conf/linux/SConscript", line 88, in <module>
Using OpenSSL crypto
Building bindings: cpp, c, java, js
Building services: notification, controlpanel, config, onboarding
scons: warning: Ignoring missing SConscript 'build/linux/openwrt/debug/obj/services/config/java/samples/java/ConfigClientSample/SConscript'
File "/usr2/shaungja/Documents/alljoyn_build/services/base/config/java/samples/java/SConscript", line 20, in <module>
scons: done reading SConscript files.
scons: Building targets ...
Install file: "build/linux/openwrt/debug/dist/cpp/inc/alljoyn/DBusStdDefines.h" as "alljoyn_c/inc/alljoyn_c/DBusStdDefines.h"
Install file: "build/linux/openwrt/debug/dist/cpp/inc/alljoyn/Status.h" as "alljoyn_c/inc/alljoyn_c/Status.h"
Install file: "build/linux/openwrt/debug/dist/cpp/inc/qcc/posix/platform_types.h" as "alljoyn_c/inc/qcc/posix/platform_types.h"
        [AR]      build/linux/openwrt/debug/obj/alljoyn_core/liballjoyn.a
        [RANLIB]  build/linux/openwrt/debug/obj/alljoyn_core/liballjoyn.a
Install file: "build/linux/openwrt/debug/obj/alljoyn_core/liballjoyn.a" as "build/linux/openwrt/debug/dist/cpp/lib/liballjoyn.a"
        [LINK-SH] build/linux/openwrt/debug/obj/alljoyn_java/jni/liballjoyn_java.so
/usr/bin/ld: build/linux/openwrt/debug/dist/cpp/lib/liballjoyn.a(Debug.o): relocation R_X86_64_32S against `.rodata._ZZL6Output10DbgMsgTypePKcS1_PvE11priorityMap' can not be used when making a shared object; recompile with -fPIC
build/linux/openwrt/debug/dist/cpp/lib/liballjoyn.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
scons: *** [build/linux/openwrt/debug/obj/alljoyn_java/jni/liballjoyn_java.so] Error 1
scons: building terminated because of errors.

Seems that there's some issue relating to liballjoyn.a. I saw some post indicating this may cause by multiple instance of "liballjoyn.a" in one's system, but I'm not sure if that's the reason.

Does anyone have a solution to this? Would appreciate any ideas.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-09-04 10:29:07 -0800

stevek gravatar image

updated 2015-09-04 10:39:11 -0800

There are a few problems here. First you are trying to build AllJoyn for OpenWrt the hard way. The easy way is to just add the AllJoyn OpenWrt feed to your feeds.conf file and build a package using the normal OpenWrt buildroot system.

For details, consult the following pages:

If you really need to build AllJoyn for OpenWrt outside of the OpenWrt buildroot you'll need to run scons with far more options. See the following answers for details:

You will need to include '-fPIC' to TARGET_CFLAGS. You may also need to specify other options for TARGET_CFLAGS required for your OpenWrt target platform.

Lastly, you can only build with BINDINGS="cpp" or BINDINGS="cpp,c" for OpenWrt. Java, Unity, and JavaScript are not support for OpenWrt. (The C binding is largely useless for OpenWrt as there is nothing that uses it at the moment.)

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

Question Tools

Follow
1 follower

Stats

Asked: 2015-09-03 22:40:56 -0800

Seen: 562 times

Last updated: Sep 04 '15