Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 1 | From 95a5c97122b7c5bdeba61f2e890bae9a961dd4bf Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Wed, 8 Dec 2021 10:01:22 -0800 |
| 4 | Subject: [PATCH] Disable LTO on clang/riscv |
| 5 | |
| 6 | With clang in OE LTO does not work as it does not seem to carry right |
| 7 | target info and mixes ABIs |
| 8 | |
| 9 | | Hard-float 'd' ABI can't be used for a target that doesn't support the D instruction set extension (ignoring target-abi) |
| 10 | | /mnt/b/yoe/master/build/tmp/work/riscv32-yoe-linux/tbb/1_2021.4.0-r0/recipe-sysroot-native/usr/bin/riscv32-yoe-linux/riscv32-yoe-linux-ld: /tmp/lto-llvm-3fb1bf.o: can't link soft-float modules with double-float modules |
| 11 | | /mnt/b/yoe/master/build/tmp/work/riscv32-yoe-linux/tbb/1_2021.4.0-r0/recipe-sysroot-native/usr/bin/riscv32-yoe-linux/riscv32-yoe-linux-ld: failed to merge target specific data of file /tmp/lto-llvm-3fb1bf.o |
| 12 | |
| 13 | Upstream-Status: Inappropriate [ OE-Specific ] |
| 14 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 15 | --- |
| 16 | cmake/compilers/Clang.cmake | 2 +- |
| 17 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 18 | |
| 19 | --- a/cmake/compilers/Clang.cmake |
| 20 | +++ b/cmake/compilers/Clang.cmake |
| 21 | @@ -60,7 +60,7 @@ endif() |
| 22 | |
| 23 | # Enabling LTO on Android causes the NDK bug. |
| 24 | # NDK throws the warning: "argument unused during compilation: '-Wa,--noexecstack'" |
| 25 | -if (NOT ANDROID_PLATFORM AND BUILD_SHARED_LIBS) |
| 26 | +if (NOT ANDROID_PLATFORM AND BUILD_SHARED_LIBS AND NOT CMAKE_SYSTEM_PROCESSOR MATCHES "(riscv32|riscv64|arm)") |
| 27 | set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>) |
| 28 | set(TBB_IPO_LINK_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>) |
| 29 | endif() |