summaryrefslogtreecommitdiffstats
path: root/classes
Commit message (Collapse)AuthorAgeFilesLines
* clang:bbclass: Do not use compiler-rt/libcxx for recipes which use gccKhem Raj2019-03-031-0/+3
| | | | Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang.bbclass: Redefine ar/nm/ranlibKhem Raj2019-02-251-0/+3
| | | | | | | | OE-core now points to gcc-* variants of these variables which will not be installed when a package is built with clang moreover llvm version would be needed for thin-lto to work anyway Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang.bbclass: Define COMPILER_RT and LIBCPLUSPLUSKhem Raj2019-02-231-0/+6
| | | | | | | LIBCPLUSPLUS and COMPILER_RT are variables to indicate if clang c/c++ runtime should be used as well or not Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang.bbclass: Remove compilerlibs from BASEDEPENDSKhem Raj2019-02-231-1/+1
| | | | | | We do not need it when using clang Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang.bbclass: Set nativesk ldso location correctly during linkKhem Raj2019-02-111-3/+8
| | | | | | | | | | Add aarch64 host support Enable lld via LDFLGS instead of TOOLCHAIN_FLAGS which also get passed to compiler Add relative rpaths so the liraries from SDK sysroot are preferred over sdk host when SDK is used Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang: Fix nativesdk builds to use clang-nativeKhem Raj2019-02-111-0/+4
| | | | | | | | | | - User lld for linking nativesdk-clang - Enable LTO to build nativesdk-clang - Use -static-libgcc when using gold/lld for nativesdk clang build - Use llvm wrappers for ar ranlib and nm to help LTO - Package and create cross versions of lld Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang: Enable LTO and lld based on distro knobsKhem Raj2019-02-092-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | Add to local.conf or distro config the following to enable lto flavors and lld linker DISTRO_FEATURES += "thin-lto" DISTRO_FEATURES += "full-lto" DISTRO_FEATURES += "lld" Add lto.bbclass To enable LTO is currently per recipe, or globally to enable globally add following to global config meta-data e.g. local.conf INHRIT += "lto" other-wise enable LTO per recipe using inherit lto to recipe via bbappend or in main recipe Signed-off-by: Khem Raj <raj.khem@gmail.com>
* libcxx: Make libunwind as static libraryKhem Raj2019-02-071-1/+0
| | | | Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang: Enable a cross version of clang-tidyKhem Raj2019-01-311-0/+1
| | | | | | define CLANG_TIDY_EXE which is used by some build systems e.g. cmake Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang.bbclass: Do not add lld-native to forced clang depsKhem Raj2018-12-271-1/+1
| | | | | | lld is being folded into clang recipe itself Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang: Switch to using own internal assemblerKhem Raj2018-12-271-1/+1
| | | | | | | | There still are some recipes which do not build with internal assembler, due to GNU'isms or other bugs in inline assembly, but its small enough number to fix or pin to external assembler Signed-off-by: Khem Raj <raj.khem@gmail.com>
* build native lld along with cross clangKhem Raj2018-09-091-1/+1
| | | | Signed-off-by: Khem Raj <raj.khem@gmail.com>
* scan-build.bbclass: Rename tasksKhem Raj2018-05-171-13/+13
| | | | | | | buildscan -> scanbuild viewscan -> scanview Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang: Drop -D__extern_always_inline=inlineKhem Raj2018-05-171-1/+1
| | | | | | | | | It was a workaround which was supposed to go away one day and that day has arrived We should fix the packages if they need such a workaround Signed-off-by: Khem Raj <raj.khem@gmail.com>
* scan-build: Change pwd to B for buildscan taskKhem Raj2018-05-151-2/+3
| | | | | | | Drop -C <src> from make invocation this helps in making it more generic Signed-off-by: Khem Raj <raj.khem@gmail.com>
* scan-build.bbclass: Do not depend on clang-nativeKhem Raj2018-05-151-20/+20
| | | | | | | | | | - Dependency on clang-native causes circular dependency - Use spaces instead of tabs in shell functions - Convert do_configure_prepend into a prefunc, makes it work with non-shell do_configure - Use TARGET_CC_ARCH instead of HOST_CC_ARCH Signed-off-by: Khem Raj <raj.khem@gmail.com>
* scan-build: Add mechanism to run static analysis using clangKhem Raj2018-05-151-1/+55
| | | | | | Implements issues #44 Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang,llvm,lld: Update to latest on release_50Khem Raj2017-10-051-0/+3
| | | | | | Drop upstreamed patches Signed-off-by: Khem Raj <raj.khem@gmail.com>
* libcxx: Disable libunwind on all mipsKhem Raj2017-09-181-0/+1
| | | | | | llvm libunwind is still not ported to mips Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang.bbclass: Prepend instead of appending to overridesKhem Raj2017-09-101-1/+1
| | | | | | | Right now it becomes highest priority override which we dont want Signed-off-by: Khem Raj <raj.khem@gmail.com>
* classes: Do not replace armv7ve with armv7a anymoreKhem Raj2017-08-291-3/+0
| | | | | | clang-5.0 supports the option now Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang: fix nativesdk buildMing Liu2017-08-231-0/+47
| | | | | | | | | | | | | | | | | | | | | I could not manage to build nativesdk-clang, I encountered errors as follows: (trimmed for purpose) | ../gcc/x86_64-pokysdk-linux/6.3.0/ld:: | cannot find crt1.o: No such file or directory | cannot find crtbegin.o: No such file or directory | cannot find -lgcc | cannot find -lgcc_s After some investigation, I found it's caused by the llvm native tools could not compile with crosssdk toolchains. (special linking flags are needed) So we introduce a cmake-native class with a task to generate a native toolchain file, it will be used to build llvm native tools by passed with CROSS_TOOLCHAIN_FLAGS_NATIVE. Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang: Switch c++ default to gnu++14 standardKhem Raj2017-08-121-1/+1
| | | | | | | | | | | | | | | Using cmdline options -std doesnt always work e.g. boost where it uses c++ driver (clang++) to invoke compilation but then passes '-x c' to choose the language for compilation Which ends in errors like below error: invalid argument '-std=c++14' not allowed with 'C' Therefore change the defaults in driver itself to use gnu++14 which is default with g++ from gcc7+ too. Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang++: Default to c++14 stdKhem Raj2017-08-121-1/+1
| | | | | | | | | | latest gcc7 also defaults to c++14, some packages have started to use c++11 and newer features without specifying -std option and rightly so now that gcc defaults are c++14, applications can safely assume c++14 as default Signed-off-by: Khem Raj <raj.khem@gmail.com>
* llvm-libunwind: DeleteKhem Raj2017-07-311-3/+2
| | | | | | build llvm libunwind along with libcxx Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang: Default to PIE when GCCPIE is setKhem Raj2017-07-291-2/+0
| | | | | | | | This matches with OE-Core expectations and we do not need to inject PIE flags manually via SECURITY_CFLAGS which does not always work Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang.bbclass: Add -pie -fPIE to SECURITY_PIE_CFLAGS explicitlyKhem Raj2017-07-211-0/+3
| | | | | | | | gcc in core now is configured with these options but clang does not have a configuration level knob so we still need to pass it old way Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang.bbclass: Add -Qunused-arguments to clang argumentsKhem Raj2017-06-091-1/+1
| | | | | | | | GCC ignores unused arguements by default, but Clang needs this extra parameter to stop printing warnings about LDFLAGS passed during compiling stage and CFLAGS passed during linking stage. Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang.bbclass: Disable llvm-libunwind for mipsKhem Raj2017-03-231-0/+1
| | | | | | Its not ported to mips yet Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang.bbclass: Add CCACHE prefix and use HOST_PREFIX instead of TARGET_PREFIXKhem Raj2017-03-211-4/+4
| | | | Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang: Add clang runtime to dependencies when toolchain is clangKhem Raj2017-03-161-2/+2
| | | | | | A step towards unplugging gcc runtime Signed-off-by: Khem Raj <raj.khem@gmail.com>
* Ony use llvm-libunwind if clang is selectedRoss Burton2016-05-251-0/+3
|
* clang-libs: Fix build on x86_64 and use gcc for all cross recipesKhem Raj2016-05-081-0/+1
| | | | Signed-off-by: Khem Raj <raj.khem@gmail.com>
* Switch default compiler option to remain gccKhem Raj2016-05-051-1/+1
| | | | | | | | | | | Users find it too intrusive that clang becomes the default compiler, they would like to invoke it on demand for certain packages only. Use TOOLCHAIN ?= "clang" in local.conf if you want clang to become default Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang: Remove -mno-spe option from cmdline on ppcKhem Raj2016-03-031-0/+1
| | | | | | | This gcc option is not supported in clang hence remove it Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang: Move -Wno-error=unused-command-line-argument setting to TUNE_CCARGSKhem Raj2016-03-011-3/+1
| | | | | | | Adding it to TOOLCHAIN_OPTIONS renders libtool useless and its not able to build .so Signed-off-by: Khem Raj <raj.khem@gmail.com>
* Pass -Wno-error=unused-command-line-argument to clangKhem Raj2016-02-291-0/+2
| | | | | | | | | | | We can get past the errors due to -Werror when unused cmdline options appear on compiler cmdline e.g. error: argument unused during compilation: '-pie' Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang.bbclass: remove gcc from deps when appropriateChristopher Larson2016-02-151-15/+4
| | | | Signed-off-by: Christopher Larson <chris_larson@mentor.com>
* clang.bbclass: Replace -march=armv7ve with -march=armv7aKhem Raj2016-01-091-0/+3
| | | | | | | OE-Core now uses -march=armv7ve for cortext-a7 and clang/llvm doesnt have arch tunable for armv7ve, we revert to prior art of using armv7-a Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang.bbclass: use gcc form nativesdk, crosssdk, cross-canadian recipesKhem Raj2015-10-011-0/+3
| | | | | | | | These are not part of target image and many of these tools are still not ported to be buildable with clang, so lets use gcc for building them at this moment Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang.bbclass: Remove -mhard-float for ppcKhem Raj2015-10-011-0/+2
| | | | | | | The option is not defined for llvm/clang but the defaults are hard-float anyway so not needed Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang: Convert gcc specific endian options to clang accepted onesKhem Raj2015-09-251-0/+4
| | | | Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang/classes: Invert the logic to select toolchain and default to clangKhem Raj2015-08-211-6/+37
| | | | | | | | | | | | | | | | | | | | | So far we have been selecting which packages are compiled using clang this patch changes the logic to use clang by default unless selecting TOOLCHAIN = "gcc" explicitly in the recipe We have not yet enabled clang for native recipes, its only enabled for target recipes needing cross compilation as of now. Get rid of configuration file and move the code to clang.bbclass, simplifies the logic If needed to select gcc to be default system compiler set TOOLCHAIN = "gcc" in local.conf Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang.bbclass: Remove junk filesKhem Raj2015-04-221-0/+0
| | | | Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang-cross: Rename PN to include TARGET_ARCHKhem Raj2015-04-061-0/+0
| | | | | | brings it inline with gcc toolchain Signed-off-by: Khem Raj <raj.khem@gmail.com>
* classes: Add a mechanism, to select components to be able to select default ↵Khem Raj2015-03-121-0/+10
compiler We add clang as an alternative compiler, it sitll uses underlying binutils and compiler runtime, it will only do the compilation and defer link, to GNU ld/gold, to compile a component usign clang add TOOLCHAIN_pn-<recipe-name> = "clang" DEPENDS_append_pn-<recipe-name> = " clang-cross " And OE will start using clang to compile <recipe-name> Signed-off-by: Khem Raj <raj.khem@gmail.com>