summaryrefslogtreecommitdiffstats
path: root/classes/clang.bbclass
Commit message (Collapse)AuthorAgeFilesLines
...
* clang: Do not force libgcc libunwind in rv32 and rv64Khem Raj2021-06-101-2/+0
| | | | | | | llvm unwind can work on rv32 and rv64 with latest clang so open up that option Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang.bbclass: Limit using clang to target recipes onlyKhem Raj2021-06-081-9/+9
| | | | | | | since toolchain-clang maybe available for native as well now, it means we have to ensure we do not use it for native recipes _yet_ Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang.bbclass: Adjust for clang default changesKhem Raj2021-06-081-7/+11
| | | | | | | | | | | | | | | Now that clang can pass right options automatically when RUNTIME = "llvm", adjust the variables e.g. COMPILER_RT/UNWINDLIB/LIBCPLUSPLUS are no more required to be defaulted Disable enforcing gcc runtime for packages using gcc as its no longer needed here but is taken care by RUNTIME variable as an aside it also helps in building native and nativesdk llvm runtimes Compute right dependencies based on selected RUNTIME along with COMPILER_RT/UNWINDLIB/LIBCPLUSPLUS variables Signed-off-by: Khem Raj <raj.khem@gmail.com>
* replace --rtlib with -rtlibKhem Raj2021-05-191-3/+3
| | | | | | This is advertised option from clang Signed-off-by: Khem Raj <raj.khem@gmail.com>
* Replace --stdlibc=libc++ with -stdlibc=libc++Khem Raj2021-05-191-2/+2
| | | | | | | | | This ensures that it matches with CMake's understanding of this option and when its removed then it silently removes -stdlibc=libc++ but leaves the spurious '-' in the commandline which confuses the compiler as it them expects input from stdin Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang.bbclass: Define CMAKE_CLANG_TIDY directly using ${HOST_PREFIX}clang-tidyKhem Raj2021-04-231-4/+1
| | | | | | | There is no need for exporting CLANG_TIDY, since its not a standard variable Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang: Replace mtune with mcpu to match oe-coreKhem Raj2021-01-261-5/+5
| | | | | | Fixes Issue #415 Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang.bbclass: Set CCACHE_COMPILERCHECK as default valueMike Crowe2021-01-251-1/+1
| | | | | | | | | | | | | oe-core's ccache.bbclass contains: export CCACHE_COMPILERCHECK ?= "%compiler% -dumpspecs" which sets a default value and allows others to easily override the value of CCACHE_COMPILERCHECK if they wish to. Let's update clang.bbclass to also set only the default value of CCACHE_COMPILERCHECK too. Signed-off-by: Mike Crowe <mac@mcrowe.com>
* clang.bbclass: Remove -mcpu option for the octeontx2 coreKevin Hao2021-01-041-0/+3
| | | | | | | | | | The tune file for octeontx2 has been added into oe-core by commit ad4f82742c6f ("tune-octeontx2.inc: Add tune for Marvell OCTEON TX2 core"). But the clang doesn't support this core yet. So remove the -mcpu from the TUNE_CCARGS to fix the build failure for the octeontx2 core. Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
* clang: Use lld for LTO linkKhem Raj2020-11-131-1/+2
| | | | | | | | | Core uses a dumb utility called dwarfsrcfiles to grok source file names and it assumes that .o and .a files are good old ELF files, that is not true when using LTO in which case it becomes IR code, this tool starts to puke, therefore disable using this tool Signed-off-by: Khem Raj <raj.khem@gmail.com>
* lto: Override LTO variable from oe-core for thin-ltoKhem Raj2020-11-131-0/+2
| | | | | | If thin-lto is used in DISTRO_FEATURES then enable thin-lto Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang.bbclass: Use -mno-relax with clang for riscvKhem Raj2020-11-131-0/+4
| | | | | | lld yet does not work relaxation so accomodate for that so LTO can work Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang: Use python3 explicitly in scriptsKhem Raj2020-10-151-0/+9
| | | | Signed-off-by: Khem Raj <raj.khem@gmail.com>
* classes/clang.bbclass: Remove -mmusl flag from toolchain.cmake.Leon Woestenberg2020-09-301-0/+1
| | | | | | | | | | The -mmusl flag is GCC specific, Clang supports MUSL differently. Prevents clang-11: error: unknown argument: '-mmusl' Verified it does not affect the GCC toolchain.cmake build. Signed-off-by: Leon Woestenberg <leon@sidebranch.com>
* clang: usrmerge workaroundOleksandr Ocheretnyi2020-07-021-0/+2
| | | | | | | | | | | | | | | |  * issue:     the openembedded-core build procedure relies on changed default dynamic loader path when the usrmerge distro feature turned on. As we can find the GCC which is used as default toolchain uses SYSTEMLIBS_DIR macro variable set to /usr/(lib|lib64) at build time and hardcodes the binaries with that default loader path.  * solution:     change the default dynamic loader location with --dyld-prefix clang option to conform the loader location (as GCC does) to openembedded-core build procedure. Signed-off-by: Oleksandr Ocheretnyi <oocheret@cisco.com>
* clang.bbclass: Define -target in HOST_CC_ARCHKhem Raj2020-05-161-0/+1
| | | | | | | This helps extra tools like clang-tidy to find arch-specific macros, headers in a cross compile environment. Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang.bbclass: Define CLANG_TIDY and extend it to cmake as wellKhem Raj2020-05-161-1/+8
| | | | Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang.bbclass: override CCACHE_COMPILERCHECKKai Kang2020-05-151-0/+1
| | | | | | | | | | | | It fails to build compiler-rt when ccache is enabled: | ccache: error: Failure running compiler check command: %compiler% -dumpspecs Because clang doesn't recognize option '-dumpspecs' from default value of CCACHE_COMPILERCHECK, override CCACHE_COMPILERCHECK for toolchain clang in clang.bbclass. Signed-off-by: Kai Kang <kai.kang@windriver.com>
* clang.bbclass: Handle big.LITTLE mtune options on arm/aarch64Khem Raj2020-04-231-0/+7
| | | | | | | | | | | Clang does not yet support big.LITTLE performance tunes, so use the LITTLE for tunes see [1] Fixes Issue #313 [1] https://reviews.llvm.org/D32076 Signed-off-by: Khem Raj <raj.khem@gmail.com>
* recipes: Do not Add -Wno-error=unused-command-line-argument globallyKhem Raj2020-03-161-1/+1
| | | | | | | This option can turn Valid options into warnings and cause unintended behaviour Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang: Use 64bit long double on musl/ppc64leKhem Raj2020-01-231-0/+1
| | | | Signed-off-by: Khem Raj <raj.khem@gmail.com>
* armeb: Disable compiler-rtKhem Raj2019-11-201-0/+3
| | | | | | compile-rt is not fully ported for ARM big-endian therefore disable it Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang.bbclass: Define RUNTIME variable to select compiler runtimeKhem Raj2019-11-181-6/+8
| | | | | | | RUNTIME can be 'llvm' or 'gnu' defaults to 'gnu' Use this variable for selecting stdc++ and c runtime Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang: Merge libunwind back into libcxxKhem Raj2019-10-091-15/+2
| | | | | | | | Do not export libunwind to other recipes besides libcxx itself, we use non-gnu libunwind on linux in general and its not a drop in replacement as of yet Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang: Remove editing THUMB_TUNE_CCARGSKhem Raj2019-10-021-1/+0
| | | | | | THUMB_TUNE_CCARGS is gone from oe-core Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang-runtime: Use INHIBIT_DEFAULT_DEPS = "1"Khem Raj2019-10-011-4/+10
| | | | | | | This ensures that clang-runtime elements e.g. llvm-libunwind can be used with gcc as well Signed-off-by: Khem Raj <raj.khem@gmail.com>
* llvm-libunwind: Fix linunwind providersKhem Raj2019-09-281-0/+8
| | | | | | | | | | | | libunwind can be either nongnu libunwind ( from OE-Core ) or from llvm and when using clang and using --unwindlib=libunwind we know we have to use llvm libunwind implementation, so remove libunwind from DEPENDS and add llvm-libunwind to depends Drop providing libunwind from llvm-libunwind since its not needed anymore Signed-off-by: Khem Raj <raj.khem@gmail.com>
* runtime: Automatically add llvm-libunwind based on COMPILER_RT asking for ↵Khem Raj2019-09-281-6/+2
| | | | | | --unwindlib=libunwind Signed-off-by: Khem Raj <raj.khem@gmail.com>
* llvm-libunwind: New reecipe for llvm unwinder split from libcxxKhem Raj2019-09-191-1/+1
| | | | | | | Its easier to provide it as replacement for nongnu libunwind bundled into libcxx was getting harder when it came to replacement Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang.bbclass: Do not set LIBCPLUSPLUS and COMPILER_RT when compiler != clangKhem Raj2019-09-181-5/+12
| | | | | | | | | | | | | * Add compiler-rt and libcxx only when these libs are used via cmdline * libffi still need to disable internal asm on arm <= v6 * Add compiler-rt to linker only when compiler-rt is used in compiler cmdline * Set BASE_DEFAULT_DEPS instead of munging BASEEDEPENDS directly Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang.bbclass: compiler-rt does not compile for ppc32Khem Raj2019-09-021-0/+1
| | | | | | Use libgcc Signed-off-by: Khem Raj <raj.khem@gmail.com>
* clang.bbclass: Use -mlong-double-64 on ppc64/muslKhem Raj2019-09-021-0/+1
| | | | Signed-off-by: Khem Raj <raj.khem@gmail.com>
* libcxx: Disable llvm libunwind when using gcc as system compilerKhem Raj2019-08-201-1/+2
| | | | Signed-off-by: Khem Raj <raj.khem@gmail.com>
* libcxx: Provide libunwind and fix risv supportKhem Raj2019-08-121-2/+10
| | | | | | Use llvm libunwind as default for clang toolchain Signed-off-by: Khem Raj <raj.khem@gmail.com>
* libcxx,compiler-rt: Add --unwindlib=libunwind to COMPILER_RTKhem Raj2019-08-121-1/+1
| | | | | | | This is new way of enabling llvm unwinder as default unwinder now build shared libunwind which is needed for new option Signed-off-by: Khem Raj <raj.khem@gmail.com>
* 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: Enable LTO and lld based on distro knobsKhem Raj2019-02-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* 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>
* 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>