From bc2b5e4b874968745fdcfbcea43e2eb8eafa592e Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 10 Jun 2021 19:34:50 -0700 Subject: Use libgcc instead of compiler-rt on klibc apps klibc does not provide libssp functions e.g. __stack_chk_guard and __stack_chk_guard which it expects from libc and compiler-rt code tend to use these functions, so when using compiler-rt it ends up with undefined symbols e.g. /usr/lib/clang/13.0.0/lib/linux/libclang_rt.builtins-armhf.a(divmoddi4.c.o): in function `__divmoddi4': divmoddi4.c:(.text+0x70): undefined reference to `__stack_chk_fail' arm-yoe-linux-gnueabi-ld.bfd: divmoddi4.c:(.text+0x74): undefined reference to `__stack_chk_guard' Signed-off-by: Khem Raj --- classes/clang.bbclass | 2 ++ 1 file changed, 2 insertions(+) (limited to 'classes/clang.bbclass') diff --git a/classes/clang.bbclass b/classes/clang.bbclass index ce5d321..0f9e46c 100644 --- a/classes/clang.bbclass +++ b/classes/clang.bbclass @@ -15,10 +15,12 @@ PACKAGE_DEBUG_SPLIT_STYLE_toolchain-clang = "debug-without-src" COMPILER_RT ??= "" COMPILER_RT_powerpc = "-rtlib=libgcc ${UNWINDLIB}" COMPILER_RT_armeb = "-rtlib=libgcc ${UNWINDLIB}" +COMPILER_RT_libc-klibc = "-rtlib=libgcc ${UNWINDLIB}" UNWINDLIB ??= "" UNWINDLIB_powerpc = "--unwindlib=libgcc" UNWINDLIB_armeb = "--unwindlib=libgcc" +UNWINDLIB_libc-klibc = "--unwindlib=libgcc" LIBCPLUSPLUS ??= "" -- cgit v1.2.3-54-g00ecf