Clang Cross Compiling with Yocto SDK -


is possible use toolchain , sysroot yocto sdk cross compile clang/llvm arm?

the environment-setup script within yocto sdk has following compiler options:

export cc="arm-poky-linux-gnueabi-gcc  -march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a7 --sysroot=$sdktargetsysroot" 

i cross compile simple userspace application

testapp.c:

#include <stdio.h> int main()    {    printf("hello world\n");    return(0);    } 

following guide http://clang.llvm.org/docs/crosscompilation.html, trying cross compile app

$ gccflags="-mcpu=cortex-a7 -mfpu=neon -mfloat-abi=hard" $ gccinclude="/opt/poky/2.0.1/sysroots/cortexa7hf-vfp-neon-poky-linux-gnueabi/usr/include/c++/5.2.0/arm-poky-linux-gnueabi/  $ /usr/bin/clang -target arm-poky-linux-gnueabi $gccflags -i$gccinclude -ccc-gcc-name arm-poky-linux-gnueabi-gcc testapp.c -o testapp -v 

however, fails with

ubuntu clang version 3.4.2-3ubuntu2~xedgers (tags/release_34/dot2-final) (based on llvm 3.4.2) target: arm-poky-linux-gnueabi thread model: posix selected gcc installation:   "/usr/lib/llvm-3.4/bin/clang" -cc1 -triple armv7-poky-linux-gnueabi -s -disable-free -disable-llvm-verifier -main-file-name testapp.c -mrelocation-model static -mdisable-fp-elim -fmath-errno -mconstructor-aliases -target-cpu cortex-a7 -target-feature +neon -target-abi aapcs-linux -mfloat-abi hard -target-linker-version 2.24 -v -resource-dir /usr/lib/llvm-3.4/bin/../lib/clang/3.4.2 -i /opt/poky/2.0.1/sysroots/cortexa7hf-vfp-neon-poky-linux-gnueabi/usr/include/c++/5.2.0/arm-poky-linux-gnueabi/ -internal-isystem /usr/include/clang/3.4.2/include/ -internal-isystem /usr/local/include -internal-isystem /usr/lib/llvm-3.4/bin/../lib/clang/3.4.2/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -fno-dwarf-directory-asm -fdebug-compilation-dir /home/adtec/workspace/yocto/testapp -ferror-limit 19 -fmessage-length 207 -mstackrealign -fno-signed-char -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o /tmp/testapp-8517af.s -x c testapp.c clang -cc1 version 3.4.2 based upon llvm 3.4.2 default target x86_64-pc-linux-gnu ignoring nonexistent directory "/include" ignoring duplicate directory "/usr/include/clang/3.4.2/include" #include "..." search starts here: #include <...> search starts here:  /opt/poky/2.0.1/sysroots/cortexa7hf-vfp-neon-poky-linux-gnueabi/usr/include/c++/5.2.0/arm-poky-linux-gnueabi  /usr/include/clang/3.4.2/include  /usr/local/include  /usr/include end of search list. 'cortex-a7' not recognized processor target (ignoring processor) 'cortex-a7' not recognized processor target (ignoring processor) 'cortex-a7' not recognized processor target (ignoring processor) 'cortex-a7' not recognized processor target (ignoring processor) 'cortex-a7' not recognized processor target (ignoring processor) 'cortex-a7' not recognized processor target (ignoring processor)  "/usr/bin/as" -mfloat-abi=hard -mcpu=cortex-a7 -mfpu=neon -o /tmp/testapp-f4f688.o /tmp/testapp-8517af.s /usr/bin/as: unrecognized option '-mfloat-abi=hard' clang: error: assembler command failed exit code 1 (use -v see invocation) 

what appropriate clang flags necessary cross compile simple application arm?

if have access full build rather sdk, try using clang layer, https://github.com/kraj/meta-clang. whilst should possible build sdk containing clang don't think has done yet.


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -