Compiliing rust 1.67 on yocto

Hello, I am attempting to build rust 1.67 on yocto. I am using a rust mixin layer on kirkstone. (GitHub - tepperson2/meta-rust-mixin at rust1.67).

I am experiencing a build failure in building rust-native, where the cc linker is unable to be found.

| Building [> ] 4/90: proc-macro2(build.rs), pk...
| Running /home/thomas/yocto/build_xwayland/tmp/work/x86_64-linux/rust-native/1.67.0-r0/rust-snapshot/bin/rustc --crate-name build_script_build --edition=2018 /home/thomas/yocto/build_xwayland/tmp/work/x86_64-linux/rust-native/1.67.0-r0/rustc-1.67.0-src/vendor/serde_json-1.0.81/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=0 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=d9e98963d16cff0e -C extra-filename=-d9e98963d16cff0e --out-dir /home/thomas/yocto/build_xwayland/tmp/work/x86_64-linux/rust-native/1.67.0-r0/rustc-1.67.0-src/build/bootstrap/debug/build/serde_json-d9e98963d16cff0e -L dependency=/home/thomas/yocto/build_xwayland/tmp/work/x86_64-linux/rust-native/1.67.0-r0/rustc-1.67.0-src/build/bootstrap/debug/deps --cap-lints allow --remap-path-prefix=/home/thomas/yocto/build_xwayland/tmp/work/x86_64-linux/rust-native/1.67.0-r0=/usr/src/debug/rust-native/1.67.0-r0 -Wrust_2018_idioms -Wunused_lifetimes -Wsemicolon_in_expressions_from_macros -Dwarnings
| error: linker cc not found

Any ideas on what might be causing this or how to work around it?

You will need to install a C compiler toolchain and if you are cross-compiling (or autodetectiob fails for some other reason) you will need to point to the linker in config.toml.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.