diff options
author | Khem Raj <raj.khem@gmail.com> | 2021-06-10 19:34:50 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2023-09-08 09:08:54 -0700 |
commit | bf7108acca50003425702e7514bc9ea9f3e512e4 (patch) | |
tree | c5be01569996a7aa84f93b1739fca3a0fa4c0961 | |
parent | f6fc1f6dd5a91fd15d3c4e89e1d3918923b09b2a (diff) | |
download | meta-clang-bf7108acca50003425702e7514bc9ea9f3e512e4.tar.gz |
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 <raj.khem@gmail.com>
(cherry picked from commit bc2b5e4b874968745fdcfbcea43e2eb8eafa592e)
-rw-r--r-- | classes/clang.bbclass | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/classes/clang.bbclass b/classes/clang.bbclass index 8c2e3b7..849049a 100644 --- a/classes/clang.bbclass +++ b/classes/clang.bbclass | |||
@@ -15,10 +15,12 @@ PACKAGE_DEBUG_SPLIT_STYLE_toolchain-clang = "debug-without-src" | |||
15 | COMPILER_RT ??= "" | 15 | COMPILER_RT ??= "" |
16 | COMPILER_RT_powerpc = "-rtlib=libgcc ${UNWINDLIB}" | 16 | COMPILER_RT_powerpc = "-rtlib=libgcc ${UNWINDLIB}" |
17 | COMPILER_RT_armeb = "-rtlib=libgcc ${UNWINDLIB}" | 17 | COMPILER_RT_armeb = "-rtlib=libgcc ${UNWINDLIB}" |
18 | COMPILER_RT_libc-klibc = "-rtlib=libgcc ${UNWINDLIB}" | ||
18 | 19 | ||
19 | UNWINDLIB ??= "" | 20 | UNWINDLIB ??= "" |
20 | UNWINDLIB_powerpc = "--unwindlib=libgcc" | 21 | UNWINDLIB_powerpc = "--unwindlib=libgcc" |
21 | UNWINDLIB_armeb = "--unwindlib=libgcc" | 22 | UNWINDLIB_armeb = "--unwindlib=libgcc" |
23 | UNWINDLIB_libc-klibc = "--unwindlib=libgcc" | ||
22 | 24 | ||
23 | LIBCPLUSPLUS ??= "" | 25 | LIBCPLUSPLUS ??= "" |
24 | 26 | ||