<?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>14975</bug_id>
          
          <creation_ts>2022-11-26 01:36:06 +0000</creation_ts>
          <short_desc>Installing cargo on target fails</short_desc>
          <delta_ts>2026-02-12 14:55:27 +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>4.2</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>IN PROGRESS REVIEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>6.1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Randy MacLeod">randy.macleod</reporter>
          <assigned_to name="Randy MacLeod">randy.macleod</assigned_to>
          <cc>cp0613</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>Naveen.Gowda</cc>
    
    <cc>sundeep.kokkonda</cc>
    
    <cc>sundeep.kokkonda</cc>
    
    <cc>Yash.Shinde</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>94451</commentid>
    <comment_count>0</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2022-11-26 01:36:06 +0000</bug_when>
    <thetext>In your conf/local.conf, add:

IMAGE_INSTALL:append = &quot; rust-hello-world rust cargo&quot;

for qemux86-64 and build
$ bitbake core-image-full-cmdline

and see:
|      Running `rustc --crate-name opener --edition=2018 /.../tmp/work/core2-64-poky-linux/cargo/1.65.0-r0/rustc-1.65.0-src/vendor/opener/src/lib.rs --error-
format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C metadata=457c3ee6920405e4 -C extra-filename=-457c3ee6920
405e4 --out-dir /.../tmp/work/core2-64-poky-linux/cargo/1.65.0-r0/build/target/x86_64-poky-linux-gnu/release/deps --target x86_64-poky-linux-gnu -C linker=/a
la-lpggp31/rmacleod/src/distro/yocto/b/summit-rust-22.11/tmp/work/core2-64-poky-linux/cargo/1.65.0-r0/wrapper/target-rust-ccld -L dependency=/.../tmp/work/co
re2-64-poky-linux/cargo/1.65.0-r0/build/target/x86_64-poky-linux-gnu/release/deps -L dependency=/.../tmp/work/core2-64-poky-linux/cargo/1.65.0-r0/build/targe
t/release/deps --extern bstr=/.../tmp/work/core2-64-poky-linux/cargo/1.65.0-r0/build/target/x86_64-poky-linux-gnu/release/deps/libbstr-8c5c1c7b9cee429d.rmeta
 --cap-lints allow -L /.../tmp/work/core2-64-poky-linux/cargo/1.65.0-r0/recipe-sysroot/usr/lib/rustlib/x86_64-poky-linux-gnu/lib --remap-path-prefix=/ala-lpg
gp31/rmacleod/src/distro/yocto/b/summit-rust-22.11/tmp/work/core2-64-poky-linux/cargo/1.65.0-r0=/usr/src/debug/cargo/1.65.0-r0`
|      Running `rustc --crate-name rand_xoshiro --edition=2018 /.../tmp/work/core2-64-poky-linux/cargo/1.65.0-r0/rustc-1.65.0-src/vendor/rand_xoshiro/src/lib
.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C metadata=49cea93c48df9ce5 -C extra-filename=
-49cea93c48df9ce5 --out-dir /.../tmp/work/core2-64-poky-linux/cargo/1.65.0-r0/build/target/x86_64-poky-linux-gnu/release/deps --target x86_64-poky-linux-gnu
-C linker=/.../tmp/work/core2-64-poky-linux/cargo/1.65.0-r0/wrapper/target-rust-ccld -L dependency=/.../tmp/work/core2-64-poky-linux/cargo/1.65.0-r0/build/target/x86_64-poky-linux-gnu/release/deps -L dependency=/.../tmp/work/core2-64-poky-linux/cargo/1.65.0-r0/build/target/release/deps --extern rand_core=/.../tmp/work/core2-64-poky-linux/cargo/1.65.0-r0/build/target/x86_64-poky-linux-gnu/release/deps/librand_core-8cebb0f5994ebeb7.rmeta --cap-lints allow -L /.../tmp/work/core2-64-poky-linux/cargo/1.65.0-r0/recipe-sysroot/usr/lib/rustlib/x86_64-poky-linux-gnu/lib --remap-path-prefix=/.../tmp/work/core2-64-poky-linux/cargo/1.65.0-r0=/usr/src/debug/cargo/1.65.0-r0`                                                              
| error[E0463]: can&apos;t find crate for `proc_macro`                                                                                                                                                                  
|    --&gt; /usr/src/debug/cargo/1.65.0-r0/rustc-1.65.0-src/vendor/proc-macro2-1.0.37/src/lib.rs:119:1                                                                                                                
|     |                                                                                                                                                                                                            
| 119 | extern crate proc_macro;                                                                                                                                                                                   
|     | ^^^^^^^^^^^^^^^^^^^^^^^^ can&apos;t find crate                                                                                                                                                                  
|                                                                                                                                                                                                                  
| For more information about this error, try `rustc --explain E0463`.                                                                                                                                              
| error: could not compile `proc-macro2` due to previous error                                                                                                                                                     
|                                                                                                                                                                                                                  
| Caused by:                                                                                                                                                                                                       
|   process didn&apos;t exit successfully: `rustc --crate-name proc_macro2 --edition=2018 /.../tmp/work/core2-64-poky-linux/cargo/1.65.0-r0/rustc-1.65.0-src/vendo
r/proc-macro2-1.0.37/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --cfg &apos;feature=&quot;default&quot;&apos; --cfg &apos;feature=&quot;proc-macro&quot;&apos; -C metadata=51be2a8927e76ee0 -C extra-filename=-51be2a8927e76ee0 --out-dir /.../tmp/work/core2-64-poky-linux/cargo/1.65.0-r0/build/target/x86_64-poky-linux-gnu/release/deps --target x86_64-poky-linux-gnu -C linker=/.../tmp/work/core2-64-poky-linux/cargo/1.65.0-r0/wrapper/target-rust-ccld -L dependency=/.../tmp/work/core2-64-poky-linux/cargo/1.65.0-r0/build/target/x86_64-poky-linux-gnu/release/deps -L dependency=/.../tmp/work/core2-64-poky-linux/cargo/1.65.0-r0/build/target/release/deps --extern unicode_xid=/.../tmp/work/core2-64-poky-linux/cargo/1.65.0-r0/build/target/x86_64-poky-linux-gnu/release/deps/libunicode_xid-4bc56ec0bbcfdb1e.rmeta --cap-lints allow -L /.../tmp/work/core2-64-poky-linux/cargo/1.65.0-r0/recipe-sysroot/usr/lib/rustlib/x86_WARNING: /ala-lpggp31/rmacleod/src/distro/yocto/poky.git/bitbake/lib/bb/ui/knotty.py:852: ResourceWarning: unclosed file &lt;_io.TextIOWrapper name=&apos;/.../tmp/work/core2-64-poky-linux/cargo/1.65.0-r0/temp/log.do_compile.14259&apos; mode=&apos;r&apos; encoding=&apos;UTF-8&apos;&gt;                                                            
  main.shutdown = 2   

Note that rust alone on target builds fine:
IMAGE_INSTALL:append = &quot; rust-hello-world rust&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94452</commentid>
    <comment_count>1</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2022-11-26 02:29:22 +0000</bug_when>
    <thetext>When this is fixed, drop:
EXCLUDE_FROM_WORLD = &quot;1&quot;

from cargo.inc.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94468</commentid>
    <comment_count>2</comment_count>
    <who name="Chen Pei">cp0613</who>
    <bug_when>2022-12-01 03:04:43 +0000</bug_when>
    <thetext>This looks like proc-macro2 failed to compiled when compiling cargo.
If IMAGE_INSTALL does not contain cargo, it will not compile, so no error is reported.
The workaround method is to modify &apos;S = &quot;${RUSTSRC}/library/test&quot;&apos; in libstd-rs_%.bb.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94727</commentid>
    <comment_count>3</comment_count>
    <who name="Sundeep KOKKONDA">sundeep.kokkonda</who>
    <bug_when>2023-01-16 06:41:31 +0000</bug_when>
    <thetext>Issue fixed with commit https://git.openembedded.org/openembedded-core/commit/?id=550c273f38d8e6d2d431908023e213c6b018d7ed

&apos;bitbake core-image-full-cmdline&apos; built without any issues.

EXCLUDE_FROM_WORLD is only in .bb &amp; .bbclass files (there is no .inc file having this flag). There is no cargo/rust recipe file having this flag. From where this should be removed?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94769</commentid>
    <comment_count>4</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-01-19 15:59:55 +0000</bug_when>
    <thetext>Randy to test that we can build cargo /rust for the target without changes to local.conf.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94979</commentid>
    <comment_count>5</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-02-21 14:50:53 +0000</bug_when>
    <thetext>Sundeep,

I still see a problem if running rust on target:
root@qemux86-64:~# rustc -o hw /tmp/hw.rs
error: linker `x86_64-poky-linux-gcc` not found
  |
  = note: No such file or directory (os error 2)

error: aborting due to previous error

We can&apos;t just ask people to add whatever part of the gcc toolchain that&apos;s needed, we need the right dependency in the rust recipe for class-target.

Is there another defect to track that?



The cargo EXCLUDE_FROM_WORLD was dropped in:

commit d2925c9c110e272ed00ab1cd8e83bb0114a254b9
Author: Alex Kiernan &lt;alex.kiernan@gmail.com&gt;
Date:   Wed Dec 28 15:23:32 2022 +0000

    cargo: Drop exclude from world
    
    On-target cargo now builds/runs.
    
    (From OE-Core rev: eb8b8c5247a32f2bd6b680de6f1a999dc2fcbc5f)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95116</commentid>
    <comment_count>6</comment_count>
    <who name="Sundeep Kokkonda">sundeep.kokkonda</who>
    <bug_when>2023-03-11 05:22:43 +0000</bug_when>
    <thetext>rust dependent modules are added to run rust on target.
Now, the rust linker issue solved and rust is running on target, verified on arm64 &amp; x86_64 qemu. Below is the patch.

https://git.openembedded.org/openembedded-core/commit/?h=master-next&amp;id=bb781f452299cfa6ec7fffd215b0af3149178f32</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95121</commentid>
    <comment_count>7</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-03-13 14:55:14 +0000</bug_when>
    <thetext>A fix has been merged to master so I&apos;ve lowered the importance of the defect but I&apos;d like to keep this issue open for reasons described below.

Fix/work-around:
https://git.openembedded.org/openembedded-core/commit/?id=bb781f452299cfa6ec7fffd215b0af3149178f32

Sundeep,

I suspect that part of what is provided by gcc, g++ is required but not all.
Have you looked at what is used in rustup to support cross-compilation?   
   https://rust-lang.github.io/rustup/cross-compilation.html

We may have to change the gcc, g++ recipes to make sub-packages so that less of the toolchain is install. What you have works, no doubt, but it&apos;s more than the minimum required I suspect.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95425</commentid>
    <comment_count>8</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-04-21 18:45:44 +0000</bug_when>
    <thetext>Moved en masse from 4.2 to 4.3 by Randy.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95511</commentid>
    <comment_count>9</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-05-10 22:01:27 +0000</bug_when>
    <thetext>Sundeep, any comments about what part of gcc, g++ is really needed?

If I run rust-up in an ubuntu container:
$ docker run -it ubuntu
root@d78c1c2d1ee0:/# cat /etc/os-release | grep PRETTY_NAME
PRETTY_NAME=&quot;Ubuntu 22.04.2 LTS&quot;
root@d78c1c2d1ee0:/# apt update
...

root@d78c1c2d1ee0:/# apt install cargo
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  binutils binutils-common binutils-x86-64-linux-gnu ca-certificates cpp cpp-11 fontconfig-config fonts-dejavu-core gcc gcc-11 gcc-11-base libasan6 libatomic1 libbinutils libbrotli1 libbsd0 libc-dev-bin
  libc-devtools libc6-dev libcc1-0 libcrypt-dev libctf-nobfd0 libctf0 libcurl3-gnutls libdeflate0 libedit2 libexpat1 libfontconfig1 libfreetype6 libgcc-11-dev libgd3 libgomp1 libicu70 libisl23 libitm1 libjbig0
  libjpeg-turbo8 libjpeg8 libldap-2.5-0 libldap-common libllvm14 liblsan0 libmd0 libmpc3 libmpfr6 libnghttp2-14 libnsl-dev libpng16-16 libpsl5 libquadmath0 librtmp1 libsasl2-2 libsasl2-modules
  libsasl2-modules-db libssh-4 libssh2-1 libstd-rust-1.65 libstd-rust-dev libtiff5 libtirpc-dev libtsan0 libubsan1 libwebp7 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxml2 libxpm4 linux-libc-dev
  manpages manpages-dev openssl publicsuffix rpcsvc-proto rustc ucf
Suggested packages:
  binutils-doc cargo-doc python3 cpp-doc gcc-11-locales gcc-multilib make autoconf automake libtool flex bison gdb gcc-doc gcc-11-multilib gcc-11-doc glibc-doc libgd-tools libsasl2-modules-gssapi-mit
  | libsasl2-modules-gssapi-heimdal libsasl2-modules-ldap libsasl2-modules-otp libsasl2-modules-sql man-browser llvm-14 lld-14 clang-14
The following NEW packages will be installed:
  binutils binutils-common binutils-x86-64-linux-gnu ca-certificates cargo cpp cpp-11 fontconfig-config fonts-dejavu-core gcc gcc-11 gcc-11-base libasan6 libatomic1 libbinutils libbrotli1 libbsd0 libc-dev-bin
  libc-devtools libc6-dev libcc1-0 libcrypt-dev libctf-nobfd0 libctf0 libcurl3-gnutls libdeflate0 libedit2 libexpat1 libfontconfig1 libfreetype6 libgcc-11-dev libgd3 libgomp1 libicu70 libisl23 libitm1 libjbig0
  libjpeg-turbo8 libjpeg8 libldap-2.5-0 libldap-common libllvm14 liblsan0 libmd0 libmpc3 libmpfr6 libnghttp2-14 libnsl-dev libpng16-16 libpsl5 libquadmath0 librtmp1 libsasl2-2 libsasl2-modules
  libsasl2-modules-db libssh-4 libssh2-1 libstd-rust-1.65 libstd-rust-dev libtiff5 libtirpc-dev libtsan0 libubsan1 libwebp7 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxml2 libxpm4 linux-libc-dev
  manpages manpages-dev openssl publicsuffix rpcsvc-proto rustc ucf
0 upgraded, 79 newly installed, 0 to remove and 4 not upgraded.
Need to get 166 MB of archives.
After this operation, 629 MB of additional disk space will be used.


root@d78c1c2d1ee0:/# cat /tmp/jj | tr &apos; &apos; &apos;\n&apos; | egrep &apos;gcc|g\+\+&apos;
gcc
gcc-11
gcc-11-base
libgcc-11-dev
gcc-11-locales
gcc-multilib
gcc-doc
gcc-11-multilib
gcc-11-doc
gcc
gcc-11
gcc-11-base
libgcc-11-dev

or to be less restrictive:
root@d78c1c2d1ee0:/# cat /tmp/jj | tr &apos; &apos; &apos;\n&apos; | egrep &quot;^g&quot;
gcc
gcc-11
gcc-11-base
gcc-11-locales
gcc-multilib
gdb
gcc-doc
gcc-11-multilib
gcc-11-doc
glibc-doc
gcc
gcc-11
gcc-11-base
get

so do we really need g++?

similar ubuntu pkg info for rustc:

root@d78c1c2d1ee0:/# apt install rustc
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  binutils binutils-common binutils-x86-64-linux-gnu cpp cpp-11 fontconfig-config fonts-dejavu-core gcc gcc-11 gcc-11-base libasan6 libatomic1 libbinutils libbrotli1 libbsd0 libc-dev-bin libc-devtools
  libc6-dev libcc1-0 libcrypt-dev libctf-nobfd0 libctf0 libdeflate0 libedit2 libfontconfig1 libfreetype6 libgcc-11-dev libgd3 libgomp1 libicu70 libisl23 libitm1 libjbig0 libjpeg-turbo8 libjpeg8 libllvm14
  liblsan0 libmd0 libmpc3 libmpfr6 libnsl-dev libpng16-16 libquadmath0 libstd-rust-1.65 libstd-rust-dev libtiff5 libtirpc-dev libtsan0 libubsan1 libwebp7 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxml2
  libxpm4 linux-libc-dev manpages manpages-dev rpcsvc-proto ucf
Suggested packages:
  binutils-doc cpp-doc gcc-11-locales gcc-multilib make autoconf automake libtool flex bison gdb gcc-doc gcc-11-multilib gcc-11-doc glibc-doc libgd-tools man-browser cargo llvm-14 lld-14 clang-14
The following NEW packages will be installed:
  binutils binutils-common binutils-x86-64-linux-gnu cpp cpp-11 fontconfig-config fonts-dejavu-core gcc gcc-11 gcc-11-base libasan6 libatomic1 libbinutils libbrotli1 libbsd0 libc-dev-bin libc-devtools
  libc6-dev libcc1-0 libcrypt-dev libctf-nobfd0 libctf0 libdeflate0 libedit2 libfontconfig1 libfreetype6 libgcc-11-dev libgd3 libgomp1 libicu70 libisl23 libitm1 libjbig0 libjpeg-turbo8 libjpeg8 libllvm14
  liblsan0 libmd0 libmpc3 libmpfr6 libnsl-dev libpng16-16 libquadmath0 libstd-rust-1.65 libstd-rust-dev libtiff5 libtirpc-dev libtsan0 libubsan1 libwebp7 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxml2
  libxpm4 linux-libc-dev manpages manpages-dev rpcsvc-proto rustc ucf
0 upgraded, 63 newly installed, 0 to remove and 4 not upgraded.
Need to get 160 MB of archives.
After this operation, 609 MB of additional disk space will be used.
Do you want to continue? [Y/n]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95746</commentid>
    <comment_count>10</comment_count>
    <who name="Sundeep Kokkonda">sundeep.kokkonda</who>
    <bug_when>2023-06-19 07:24:53 +0000</bug_when>
    <thetext>Hello Randy,

Currently, binutils installing the below tools on target machine.
x86_64-poky-linux-addr2line        x86_64-poky-linux-dwp              x86_64-poky-linux-gp-display-html  x86_64-poky-linux-gprofng          x86_64-poky-linux-nm               x86_64-poky-linux-readelf
x86_64-poky-linux-ar               x86_64-poky-linux-elfedit          x86_64-poky-linux-gp-display-src   x86_64-poky-linux-ld               x86_64-poky-linux-objcopy          x86_64-poky-linux-size
x86_64-poky-linux-as               x86_64-poky-linux-gp-archive       x86_64-poky-linux-gp-display-text  x86_64-poky-linux-ld.bfd           x86_64-poky-linux-objdump          x86_64-poky-linux-strings
x86_64-poky-linux-c++filt          x86_64-poky-linux-gp-collect-app   x86_64-poky-linux-gprof            x86_64-poky-linux-ld.gold          x86_64-poky-linux-ranlib           x86_64-poky-linux-strip

The tried installing the required tools such as as, ld.. etc but that&apos;s not working as binutils is collection of all those tools and currently binutils recipe in Yocto is not enabled to generate these individual module packages.
The g++ was analyzed earlier and it is required to run Cargo on target. The detailed analysis is here - https://lists.openembedded.org/g/openembedded-core/message/178207</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95764</commentid>
    <comment_count>11</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-06-21 00:55:10 +0000</bug_when>
    <thetext>Sundeep, Thanks for checking on this.

I still don&apos;t understand *why* we would need g++ even for cargo.

Running an ubuntu-22.04 docker container, I see the following dependencies, none of which is g++ but cargo does seem to need gcc. It would be good to understand why. 22.04 ships rustc-1.65, fyi.

$ docker run -it ubuntu 
root@dd3c5196093b:/# apt update
...
root@dd3c5196093b:/# apt depends rustc
rustc
  Depends: libc6 (&gt;= 2.34)
  Depends: libgcc-s1 (&gt;= 4.2)
  Depends: libstd-rust-dev (= 1.65.0+dfsg0ubuntu1-0ubuntu0.22.04.1)
  Depends: gcc
  Depends: &lt;libc-dev&gt;
    libc6-dev
  Depends: binutils (&gt;= 2.26)
  Breaks: libstd-rust-dev (&lt;&lt; 1.26.2+dfsg1+llvm-0ubuntu1~~)
  Suggests: cargo (&gt;= 0.65.0~~)
  Suggests: cargo (&lt;&lt; 0.66.0~~)
  Suggests: llvm-14
  Suggests: lld-14
  Suggests: clang-14
  Replaces: libstd-rust-dev (&lt;&lt; 1.26.2+dfsg1+llvm-0ubuntu1~~)
root@dd3c5196093b:/# apt depends cargo
cargo
  Depends: libc6 (&gt;= 2.34)
  Depends: libcurl3-gnutls (&gt;= 7.28.0)
  Depends: libgcc-s1 (&gt;= 4.2)
  Depends: libssh2-1 (&gt;= 1.7.0)
  Depends: libssl3 (&gt;= 3.0.0~~alpha1)
  Depends: zlib1g (&gt;= 1:1.1.4)
  Depends: rustc (&gt;= 1.24)
  Depends: binutils
 |Depends: gcc
 |Depends: clang
  Depends: &lt;c-compiler&gt;
    bcc
    clang-11
    clang-12
    clang-13
    clang-14
    clang-15
    gcc
    gcc-10
    gcc-11
    gcc-12
    gcc-9
    pcc
    tcc
  Suggests: cargo-doc
  Suggests: python3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95928</commentid>
    <comment_count>12</comment_count>
    <who name="Sundeep Kokkonda">sundeep.kokkonda</who>
    <bug_when>2023-07-17 16:07:08 +0000</bug_when>
    <thetext>Hello  Randy,

Here g++ is not a direct dependency of cargo/rust.
I tried a simple C program to compile and link w/o adding g++ and the linker failed with same errors mentioned earlier (x86_64-poky-linux/bin/ld: cannot find Scrt1.o: No such file or directory ... etc)
The missing files are &apos;C runtime startup code object files&apos;. There is an explanation about these files here - https://stackoverflow.com/questions/16436035/whats-the-usage-of-mcrt1-o-and-scrt1-o
With g++ package these files are installing on the image. In Yocto, the gcc RPROVIDES g++, so this dependency is added.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96247</commentid>
    <comment_count>13</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-08-11 19:35:47 +0000</bug_when>
    <thetext>I need to spend time on this to understand if we should be changing the gcc/g++
recipe to avoid RDEPENDing on g++ or if my understanding of cargo&apos;s requirement is simply not correct.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99737</commentid>
    <comment_count>14</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2024-09-26 18:13:36 +0000</bug_when>
    <thetext>I&apos;m still not convinced that we don&apos;t have an opportunity to trim down or sanitize our rust/cargo dependencies since according the the Fedora 40 sRPMs,
rust and cargo do not depend on g++:

https://www.rpmfind.net/linux/RPM/fedora/40/x86_64/r/rust-1.77.0-1.fc40.x86_64.html

https://www.rpmfind.net/linux/RPM/fedora/40/x86_64/c/cargo-1.77.0-1.fc40.x86_64.html

Anyway, bumping to the next release since I don&apos;t have more time for this now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104253</commentid>
    <comment_count>15</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2026-02-12 14:55:27 +0000</bug_when>
    <thetext>We should confirm that if we split up the gcc/g++ recipe to separate the linker parts from the compiler parts in 6.1.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>