Clang cross compiler with OpenEmbedded
Hi all
We have put together clang as system cross compiler support into OpenEmbedded, here is a writeup on how to use it in your setups.
http://himvis.com/using-clang-with-openembeddedyocto-project/
At present, it is able to compile a lot of packages already and core-image-minimal when build mixed with clang and gcc boots fine on qemux86 and rpi2, I have not tested ppc and mips images yet but build wise a lot of packages can be build for ppc/mips too.
Interested ? then please come on board and help porting the packages to work with clang
if you find issues or have questions please feel free to send them my way
Thanks
-Khem
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi Roman
Quoted 9 lines · Roman Khimov
В письме от 25 августа 2015 01:03:07 пользователь Khem Raj написал:
Quoted 4 lines
We have put together clang as system cross compiler support into OpenEmbedded, here is a writeup on how to use it in your setups.
http://himvis.com/using-clang-with-openembeddedyocto-project/
Do you have any plans to support scan-build analysis?
Yes but its in back burners so patches are welcome! I do use scan-build with some native application projects but thats very simple setup to have.
I think it should be easy enough to add a class to insert the static analysis
given we can configure clang as cross compiler,
Right now my priorities are to use subset of arches e.g. x86/arm
1. Fix compile issues for OE-Core, reach to a point where all packages can build we have around 40 failing in world builds
2. Start using compiler-rt and libc++ to provide compiler c/c++ runtime
3. Repeat 1 to 2 with musl
4. Repeat 1 to 3 for remaining architectures
5. Start using other tools e.g. lldb, native linker and integrated as system wide
So this can take a while.
Quoted 12 lines
We have had one in Altell but with a gross hack (and even that based on OE classic) --- we'd built native clang and then used a special task between configure and compile stages that copied its script (run.do_scanbuild) into another one, mangled it heavily to override $CC and $CXX, and after that ran that script under scan-build (with --use-cc and --use-c++ pointing to the proper GCC toolchain), then reconfigured again for normal build.
That worked with some exceptions and allowed us to make static analysis of our whole build, but it was kludgy and not that efficient. I guess that with a proper cross-compiling Clang toolchain things could be done way more easily right at the compile stage.