kraj/meta-clang

When installing nativesdk-clang-tools, for a sdk, it installs clang compiler

Lorac opened this issue · 10 comments

Lorac commented

Describe the bug
Given that I only want the clang tooling but not the compiler. If I decide to install nativesdk-clang-tools it will install clang compiler which isn't what I wanted to install.

To Reproduce
Add nativesdk-clang-tools to TOOLCHAIN_HOST_TASK

Expected behavior
Only install nativesdk-clang-tools binaries and the needed .so, but not the compiler and its headers, intrinsic, etc.

Desktop (please complete the following information):

  • OS: Linux, Debian 11
kraj commented

its interesting who is pulling nativesdk-clang. Can you look into output of bitbake -g nativesdk-clang-tools or post the output here as well.

Lorac commented

nativesdk-clang-tools is a package and can't be used to do that on kirkstone. I think you mean bitbake -g nativesdk-clang ?

Lorac commented

I know that mesa depends on clang. But it doesn't RDEPENDS, maybe the way mesa depends on clang is incorrect?

Lorac commented

Build history output

host/depends.dot
598:"nativesdk-clang-tools" -> "nativesdk-clang"
599:"nativesdk-clang-tools" -> "nativesdk-clang-libllvm" [label=">= 14.0.3"]
600:"nativesdk-clang-tools" -> "nativesdk-clang-libllvm" [label="libLLVM-14.so()(64bit)"] [style=dashed]
601:"nativesdk-clang-tools" -> "nativesdk-clang-libllvm" [label="libLLVM-14.so(LLVM_14)(64bit)"] [style=dashed]
602:"nativesdk-clang-tools" -> "nativesdk-libc6" [label=">= 2.35"]
603:"nativesdk-clang-tools" -> "nativesdk-libc6" [label="ld-linux-x86-64.so.2()(64bit)"] [style=dashed]
604:"nativesdk-clang-tools" -> "nativesdk-libc6" [label="ld-linux-x86-64.so.2(GLIBC_2.3)(64bit)"] [style=dashed]
605:"nativesdk-clang-tools" -> "nativesdk-libc6" [label="libc.so.6()(64bit)"] [style=dashed]
606:"nativesdk-clang-tools" -> "nativesdk-libc6" [label="libc.so.6(GLIBC_2.14)(64bit)"] [style=dashed]
607:"nativesdk-clang-tools" -> "nativesdk-libc6" [label="libc.so.6(GLIBC_2.2.5)(64bit)"] [style=dashed]
608:"nativesdk-clang-tools" -> "nativesdk-libc6" [label="libc.so.6(GLIBC_2.32)(64bit)"] [style=dashed]
609:"nativesdk-clang-tools" -> "nativesdk-libc6" [label="libc.so.6(GLIBC_2.34)(64bit)"] [style=dashed]
610:"nativesdk-clang-tools" -> "nativesdk-libc6" [label="libm.so.6()(64bit)"] [style=dashed]
611:"nativesdk-clang-tools" -> "nativesdk-libc6" [label="libm.so.6(GLIBC_2.29)(64bit)"] [style=dashed]
612:"nativesdk-clang-tools" -> "nativesdk-libclang13" [label=">= 14.0.3"]
613:"nativesdk-clang-tools" -> "nativesdk-libclang13" [label="libclang.so.13()(64bit)"] [style=dashed]
614:"nativesdk-clang-tools" -> "nativesdk-libclang13" [label="libclang.so.13(LLVM_13)(64bit)"] [style=dashed]
615:"nativesdk-clang-tools" -> "nativesdk-libclang-cpp14" [label=">= 14.0.3"]
616:"nativesdk-clang-tools" -> "nativesdk-libclang-cpp14" [label="libclang-cpp.so.14()(64bit)"] [style=dashed]
617:"nativesdk-clang-tools" -> "nativesdk-libgcc1" [label=">= 11.3.0"]
618:"nativesdk-clang-tools" -> "nativesdk-libgcc1" [label="libgcc_s.so.1()(64bit)"] [style=dashed]
619:"nativesdk-clang-tools" -> "nativesdk-libstdc++6" [label=">= 11.3.0"]
620:"nativesdk-clang-tools" -> "nativesdk-libstdc++6" [label="libstdc++.so.6()(64bit)"] [style=dashed]
621:"nativesdk-clang-tools" -> "nativesdk-libstdc++6" [label="libstdc++.so.6(CXXABI_1.3.13)(64bit)"] [style=dashed]
622:"nativesdk-clang-tools" -> "nativesdk-libstdc++6" [label="libstdc++.so.6(CXXABI_1.3.3)(64bit)"] [style=dashed]
623:"nativesdk-clang-tools" -> "nativesdk-libstdc++6" [label="libstdc++.so.6(CXXABI_1.3)(64bit)"] [style=dashed]
624:"nativesdk-clang-tools" -> "nativesdk-libstdc++6" [label="libstdc++.so.6(GLIBCXX_3.4.11)(64bit)"] [style=dashed]
625:"nativesdk-clang-tools" -> "nativesdk-libstdc++6" [label="libstdc++.so.6(GLIBCXX_3.4.14)(64bit)"] [style=dashed]
626:"nativesdk-clang-tools" -> "nativesdk-libstdc++6" [label="libstdc++.so.6(GLIBCXX_3.4.15)(64bit)"] [style=dashed]
627:"nativesdk-clang-tools" -> "nativesdk-libstdc++6" [label="libstdc++.so.6(GLIBCXX_3.4.18)(64bit)"] [style=dashed]
628:"nativesdk-clang-tools" -> "nativesdk-libstdc++6" [label="libstdc++.so.6(GLIBCXX_3.4.20)(64bit)"] [style=dashed]
629:"nativesdk-clang-tools" -> "nativesdk-libstdc++6" [label="libstdc++.so.6(GLIBCXX_3.4.21)(64bit)"] [style=dashed]
630:"nativesdk-clang-tools" -> "nativesdk-libstdc++6" [label="libstdc++.so.6(GLIBCXX_3.4.22)(64bit)"] [style=dashed]
631:"nativesdk-clang-tools" -> "nativesdk-libstdc++6" [label="libstdc++.so.6(GLIBCXX_3.4.26)(64bit)"] [style=dashed]
632:"nativesdk-clang-tools" -> "nativesdk-libstdc++6" [label="libstdc++.so.6(GLIBCXX_3.4.29)(64bit)"] [style=dashed]
633:"nativesdk-clang-tools" -> "nativesdk-libstdc++6" [label="libstdc++.so.6(GLIBCXX_3.4)(64bit)"] [style=dashed]
634:"nativesdk-clang-tools" -> "nativesdk-libstdc++6" [label="libstdc++.so.6(GLIBCXX_3.4.9)(64bit)"] [style=dashed]
635:"nativesdk-clang-tools" -> "nativesdk-libxml2-2" [label=">= 2.9.14"]
636:"nativesdk-clang-tools" -> "nativesdk-libxml2-2" [label="libxml2.so.2()(64bit)"] [style=dashed]
637:"nativesdk-clang-tools" -> "nativesdk-libxml2-2" [label="libxml2.so.2(LIBXML2_2.4.30)(64bit)"] [style=dashed]
638:"nativesdk-clang-tools" -> "nativesdk-libxml2-2" [label="libxml2.so.2(LIBXML2_2.5.2)(64bit)"] [style=dashed]
639:"nativesdk-clang-tools" -> "nativesdk-libxml2-2" [label="libxml2.so.2(LIBXML2_2.6.0)(64bit)"] [style=dashed]
packages/x86_64-nativesdk-ekosdk-linux/nativesdk-clang/nativesdk-clang-tools/latest
4:RDEPENDS = nativesdk-clang nativesdk-clang-libclang-cpp (>= 14.0.3) nativesdk-clang-libllvm (>= 14.0.3) nativesdk-glibc (>= 2.35) nativesdk-libclang (>= 14.0.3) nativesdk-libgcc (>= 11.3.0) nativesdk-libstdc++ (>= 11.3.0) nativesdk-libxml2 (>= 2.9.14)
kraj commented

Well may be add -g to sdk target build

Lorac commented

task-depends.dot of the -g sdk target build: https://file.io/qFVjQv9bSvNX

kraj commented

who is pulling nativesdk-clang-glue I think thats what is pulling it in.

Lorac commented

clang-crosssdk-x86_64.do_prepare_recipe_sysroot depends on nativesdk-clang-glue

Lorac commented

@kraj do you have any updates on this?

kraj commented

I finally found some time to look into it and I see

% readelf -d clang-apply-replacements

Dynamic section at offset 0x1dd08 contains 32 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libclang-cpp.so.16]
 0x0000000000000001 (NEEDED)             Shared library: [libLLVM-16.so]

Which means the tools depend on llvm and clang library. Which will be pulled in as dependency and it will automatically pull in nativesdk-clang-libclang-cpp and nativesdk-clang-libllvm

so this dependency "nativesdk-clang-tools" -> "nativesdk-clang" is interesting and is the root of your issue.
so I think we need to see why packager/opkg thinks this should be added to rdepends. Since I dont see it being
asked to be in rdeps by recipe.