<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>15924</bug_id>
          
          <creation_ts>2025-07-03 17:40:00 +0000</creation_ts>
          <short_desc>multiple compiler runtimes dev packages from build host may result in clang-native not filing libstdc++</short_desc>
          <delta_ts>2025-07-10 14:32:41 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>devtools / tool chain</component>
          <version>5.3</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Undecided</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>0.0.0</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Khem Raj">raj.khem</reporter>
          <assigned_to name="Unassigned">unassigned</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>richard.purdie</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Yes (doc changes required)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>102409</commentid>
    <comment_count>0</comment_count>
    <who name="Khem Raj">raj.khem</who>
    <bug_when>2025-07-03 17:40:00 +0000</bug_when>
    <thetext>Clang driver finds compiler runtime and tools like linker on install host and uses the latest gcc runtime if multiple gcc installations exist e.g. on ubuntu 24.04 host if gcc-13 ( default ) and gcc-14 are installed, it will configure the clang invocation to use gcc-14, now if gcc-14 is not installing c++ runtime then it will not find -lstdc++ because driver instructed it to use gcc-14 libs/headers/runtime. Technically this is right thing to do, mixing runtimes e.g. using libgcc from gcc13 and libstdc++ from gcc14 is worse condition, since it can result in weird runtime behaviors which will be harder to debug.

This can be seen when build compiler-rt-native on a ubuntu 24.04 worker host on autobuilder. The configuration of that machine installs gcc-13 c/c++ ( default runtime and development files ) fully, but installs gcc-14 partially ( without c++ runtime development files ). In this system we can see that clang-native when probing for configure tests bails out because it can not link a simple C++ program. The reason being it not being able to find libstdc++ due to above reasons.

This problem is not seen on vanilla ubuntu 24.04 systems with OE pre-requisites.

We can try to do some fixes in toolchains to pretend smart and make compiler do additional probing to look into other locations e.g. default c++ runtime or uninative runtime but that had a potential downside of mixing runtimes and create another can of worms.

A slightly better approach could be to instruct the user to isntall the pre-requisites properly, if they have systems installed with non default toolchains then they should install C/C++ runtime and development headers fully.

Perfect option would be to not rely on build host provides toolchain at all and provide fully functional native C/C++ toolchain via bultools tarball or some such and make it a pre-requisite to build OE, this will get rid of all these kind of inconsistencies and even better if native compiler binaries are statically linked, it will become truly host independent.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102444</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2025-07-10 14:32:41 +0000</bug_when>
    <thetext>Issue was caused by emacs pulling in emacs-gtk which leads to libgcc-14-dev on Ubuntu 24.04 despite gcc being version 13.

We&apos;ve added a sanity test for this problem and removed emacs from those workers:

https://git.yoctoproject.org/poky/commit/?id=0a9668e192e04ddccb29d6ba271213c708d01066</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>