diff options
-rw-r--r-- | README.md | 23 | ||||
-rw-r--r-- | conf/nonclangable.conf | 22 |
2 files changed, 9 insertions, 36 deletions
@@ -83,27 +83,21 @@ compiler, switching to use LLVM runtime is done via a config metadata knob | |||
83 | TC_CXX_RUNTIME = "llvm" | 83 | TC_CXX_RUNTIME = "llvm" |
84 | ``` | 84 | ``` |
85 | 85 | ||
86 | TC_CXX_RUNTIME variable influences individual runtime elements and can be set explicitly as well | 86 | TC_CXX_RUNTIME variable influences individual runtime elements for C runtime |
87 | e.g. `LIBCPLUSPLUS` `COMPILER_RT` and `UNWINDLIB`. | 87 | C++ runtime and unwinding support. |
88 | 88 | ||
89 | Please note that this will still use crt files from GNU compiler always, while llvm now | 89 | Please note that this will still use crt files from GNU compiler, while LLVM |
90 | do provide crt files, they have not been yet integrated into the toolchain. | 90 | does provide crt files, they have not been yet integrated into the toolchain. |
91 | 91 | ||
92 | # Default C++ Standard Library Switch | 92 | # Default C++ Standard Library Switch |
93 | 93 | ||
94 | Using TC_CXX_RUNTIME variable will select which C++ runtime is used, however it can be overridden | 94 | Using TC_CXX_RUNTIME variable will select which C++ runtime is used. |
95 | if needed to by modifying `LIBCPLUSPLUS` variable, usually defaults used by `TC_CXX_RUNTIME` are | ||
96 | best fit. e.g. below we select LLVM C++ as default C++ runtime. | ||
97 | |||
98 | ```shell | ||
99 | LIBCPLUSPLUS = "-stdlib=libc++" | ||
100 | ``` | ||
101 | 95 | ||
102 | in `local.conf`. | 96 | in `local.conf`. |
103 | You can select libstdc++ per package too by writing bbappends for them containing | 97 | You can select a C++ runtime per package by writing bbappends for them containing |
104 | 98 | ||
105 | ```shell | 99 | ```shell |
106 | LIBCPLUSPLUS:toolchain-clang:pn-<recipe> = "-stdlib=libc++" | 100 | TC_CXX_RUNTIME:toolchain-clang:pn-<recipe> = "llvm" |
107 | ``` | 101 | ``` |
108 | Defaults are chosen to be GNU for maximum compatibility with existing GNU systems. It's always | 102 | Defaults are chosen to be GNU for maximum compatibility with existing GNU systems. It's always |
109 | good to use single runtime on a system, mixing runtimes can cause complications during | 103 | good to use single runtime on a system, mixing runtimes can cause complications during |
@@ -187,7 +181,8 @@ and OE will start using gcc to cross compile that recipe. | |||
187 | If a component does not build with libc++, you can add it to `conf/nonclangable.inc` e.g. | 181 | If a component does not build with libc++, you can add it to `conf/nonclangable.inc` e.g. |
188 | 182 | ||
189 | ```shell | 183 | ```shell |
190 | CXX:remove:pn-<recipe>:toolchain-clang = " -stdlib=libc++ " | 184 | CXXFLAGS:append:pn-<recipe>:toolchain-clang = " -stdlib=libstdc++ " |
185 | LDFLAGS:append:pn-<recipe>:toolchain-clang = " -stdlib=libstdc++ " | ||
191 | ``` | 186 | ``` |
192 | 187 | ||
193 | # compiler-rt failing in do_configure with custom TARGET_VENDOR | 188 | # compiler-rt failing in do_configure with custom TARGET_VENDOR |
diff --git a/conf/nonclangable.conf b/conf/nonclangable.conf index 4465ec6..d0ca639 100644 --- a/conf/nonclangable.conf +++ b/conf/nonclangable.conf | |||
@@ -21,8 +21,6 @@ TOOLCHAIN:pn-grub:riscv64 = "gcc" | |||
21 | TOOLCHAIN:pn-grub:aarch64 = "gcc" | 21 | TOOLCHAIN:pn-grub:aarch64 = "gcc" |
22 | # crash embeds version of gdb which is not buildable with clang | 22 | # crash embeds version of gdb which is not buildable with clang |
23 | TOOLCHAIN:pn-crash = "gcc" | 23 | TOOLCHAIN:pn-crash = "gcc" |
24 | # See https://github.com/llvm/llvm-project/issues/71925 | ||
25 | LIBCPLUSPLUS:pn-elfutils:toolchain-clang = "-stdlib=libstdc++" | ||
26 | #| erl_bits.c:(.text+0xc2a): undefined reference to `__extendhfsf2' | 24 | #| erl_bits.c:(.text+0xc2a): undefined reference to `__extendhfsf2' |
27 | #| erl_bits.c:(.text+0x1bfa): undefined reference to `__truncsfhf2' | 25 | #| erl_bits.c:(.text+0x1bfa): undefined reference to `__truncsfhf2' |
28 | #| clang-15: error: linker command failed with exit code 1 (use -v to see invocation) | 26 | #| clang-15: error: linker command failed with exit code 1 (use -v to see invocation) |
@@ -429,26 +427,6 @@ COMPILER_RT:pn-ostree:libc-glibc:toolchain-clang:x86-64 = "-rtlib=libgcc --unwin | |||
429 | #clang-8: error: linker command failed with exit code 1 (use -v to see invocation) | 427 | #clang-8: error: linker command failed with exit code 1 (use -v to see invocation) |
430 | COMPILER_RT:pn-libhugetlbfs:libc-glibc:toolchain-clang:arm = "--unwindlib=libgcc" | 428 | COMPILER_RT:pn-libhugetlbfs:libc-glibc:toolchain-clang:arm = "--unwindlib=libgcc" |
431 | 429 | ||
432 | # Does not compile with libc++ from clang 17+ anymore see | ||
433 | # https://github.com/llvm/llvm-project/issues/63743 | ||
434 | LIBCPLUSPLUS:pn-apt:toolchain-clang = "-stdlib=libstdc++" | ||
435 | |||
436 | # All following need to use libstdc++ with clang-19 | ||
437 | # see https://libcxx.llvm.org/ReleaseNotes/19.html#deprecations-and-removals | ||
438 | LIBCPLUSPLUS:pn-pbzip2:toolchain-clang = "-stdlib=libstdc++" | ||
439 | LIBCPLUSPLUS:pn-nlohmann-json:toolchain-clang = "-stdlib=libstdc++" | ||
440 | LIBCPLUSPLUS:pn-paho-mqtt-cpp:toolchain-clang = "-stdlib=libstdc++" | ||
441 | LIBCPLUSPLUS:pn-poco:toolchain-clang = "-stdlib=libstdc++" | ||
442 | LIBCPLUSPLUS:pn-netdata:toolchain-clang = "-stdlib=libstdc++" | ||
443 | LIBCPLUSPLUS:pn-cpp-netlib:toolchain-clang = "-stdlib=libstdc++" | ||
444 | LIBCPLUSPLUS:pn-cpprest:toolchain-clang = "-stdlib=libstdc++" | ||
445 | # See https://lists.openembedded.org/g/openembedded-devel/topic/meta_oe_patch_2_3/108964413 | ||
446 | LIBCPLUSPLUS:pn-tomlplusplus:toolchain-clang = "-stdlib=libstdc++" | ||
447 | LIBCPLUSPLUS:pn-doxygen:toolchain-clang = "-stdlib=libstdc++" | ||
448 | # https://www.mail-archive.com/freebsd-pkg-fallout@freebsd.org/msg2394451.html | ||
449 | LIBCPLUSPLUS:pn-snort3:toolchain-clang = "-stdlib=libstdc++" | ||
450 | LIBCPLUSPLUS:pn-libdaq:toolchain-clang = "-stdlib=libstdc++" | ||
451 | |||
452 | # Uses gcc for native tools, e.g. nsinstall and passes clang options which fails so | 430 | # Uses gcc for native tools, e.g. nsinstall and passes clang options which fails so |
453 | # let same compiler ( gcc or clang) be native/cross compiler | 431 | # let same compiler ( gcc or clang) be native/cross compiler |
454 | # | gcc: error: unrecognized command line option ‘-Qunused-arguments’ | 432 | # | gcc: error: unrecognized command line option ‘-Qunused-arguments’ |