我正在尝试在Ubuntu 16.04上为RaspberryPI2交叉编译AllJoyn。我按照Linux Cross-Compiling一节中提到的https://wiki.allseenalliance.org/develop/building_and_running步骤进行了操作。
当我尝试使用命令编译AllJoyn时
scons OS=openwrt CPU=openwrt BINDINGS=cpp,c,java WS=off BT=off ICE=off SERVICE="about,notification,controlpannel,config,onboarding,sample_apps"
我收到以下错误
scons: Reading SConscript files ...
Checking c++ compiler support for -std=c++11 flag... Printing env dump...
{ 'CPATH': '/home/jha/rpi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/sysroot/usr/include',
'HOME': '/home/jha',
'LIBRARY_PATH': '/home/jha/rpi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/sysroot/usr/lib:/home/jha/rpi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/sysroot/usr/libexec',
'PATH': '/home/jha/rpi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin',
'STAGING_DIR': '/home/jha/rpi/linux/usr'}
no
Checking c++ compiler support for -std=c++0x flag... Printing env dump...
{ 'CPATH': '/home/jha/rpi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/sysroot/usr/include',
'HOME': '/home/jha',
'LIBRARY_PATH': '/home/jha/rpi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/sysroot/usr/lib:/home/jha/rpi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/sysroot/usr/libexec',
'PATH': '/home/jha/rpi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin',
'STAGING_DIR': '/home/jha/rpi/linux/usr'}
no
*** Compiler too old to build AllJoyn. Aborting.
我修改了build_core / conf / openwrt下的SConscript文件,以便在检查编译器之前打印env变量。
为了验证我的编译器不是过时的编译器,我尝试了
int main(void) { return 0; }
/home/jha/rpi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -std=c++11 -o ../test ../test.cc
以下是我在运行scons命令之前设置的环境变量的值
HOST_HOME="/home/jha/rpi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf"
TARGET_PREFIX="arm-linux-gnueabihf-"
export TARGET_PATH="${HOST_HOME}/bin"
export TARGET_CC="${TARGET_PREFIX}gcc"
export TARGET_CPPFLAGS=""
export TARGET_CFLAGS="-I${HOST_HOME}/arm-linux-gnueabihf/sysroot/usr/include"
export CXXFLAGS="-std=c++11"
export TARGET_CXX="${TARGET_PREFIX}g++"
export TARGET_LINK=$TARGET_CC
export TARGET_LINKFLAGS="-L${HOST_HOME}/arm-linux-gnueabihf/sysroot/usr/lib -L${HOST_HOME}/arm-linux-gnueabihf/sysroot/usr/libexec"
export TARGET_LDFLAGS=$TARGET_LINKFLAGS
export TARGET_AR="${TARGET_PREFIX}ar"
export TARGET_RANLIB="${TARGET_PREFIX}ranlib"
export STAGING_DIR="/home/jha/rpi/linux/usr"
export CROSS_PREFIX=$TARGET_PREFIX
export CROSS_PATH=$TARGET_PATH
export CROSS_CFLAGS="$TARGET_CFLAGS -march=armv7 "
export CROSS_LINKFLAGS=$TARGET_LINKFLAGS
export CROSS_COMPILE=$TARGET_PREFIX
我无法在Ubuntu 16.04计算机上交叉编译AllJoyn for RaspberryPI2。任何正确方向的指针都将非常受欢迎。提前谢谢。
答案 0 :(得分:0)
我可以想出为ARM编译AllJoyn,以下是步骤http://itisprakash.blogspot.com/2016/05/cross-compile-alljoyn-for-raspberrypi.html