Xargo and compiling modified std


I'm using xargo to cross compile for a new target and I've realized that I need to make source level modifications to libstd.

My initial thought was to clone the rust repo and point XARGO_RUST_SRC at my local copy. First I tried just running xargo against the unmodified rust source. However when I run xargo I'm running into compile errors with features which either have been removed (when compiling off stable or beta branch):

   Compiling compiler_builtins v0.1.18
   Compiling core v0.0.0 (/vagrant/repos/rust/src/libcore)
   Compiling cc v1.0.35
   Compiling libc v0.2.62
error[E0557]: feature has been removed
  --> /vagrant/repos/rust/src/libcore/lib.rs:93:12
93 | #![feature(on_unimplemented)]
   |            ^^^^^^^^^^^^^^^^ feature has been removed

Or are experimental (when compiling off master):

   Compiling compiler_builtins v0.1.18
   Compiling core v0.0.0 (/vagrant/repos/rust/src/libcore)
   Compiling cc v1.0.47
   Compiling libc v0.2.64
   Compiling autocfg v0.1.6
   Compiling std v0.0.0 (/vagrant/repos/rust/src/libstd)
error[E0658]: The `!` type is experimental
    --> /vagrant/repos/rust/src/libcore/num/mod.rs:4725:11
4725 | impl From<!> for TryFromIntError {
     |           ^
     = note: for more information, see https://github.com/rust-lang/rust/issues/35121
     = help: add `#![feature(never_type)]` to the crate attributes to enable

I'm not sure if this is the correct way to point xargo at modified lidstd source. I also tried pointing to the source in Xargo.toml by setting:

path = "/path/to/rust/src/libstd"

However this resulted in identical compiler errors as the XARGO_RUST_SRC method. I suspect I'm either not using the correct version of rustc for compiling the straight libstd source or I need a different version of that source, but I'm not sure which it is.

I'm using rustc 1.41.0-nightly (5c5b8afd8 2019-11-16) as my default toolchain.
My xargo version is 0.3.17.
My cargo version is cargo 1.40.0-nightly (5da4b4d47 2019-10-28).
My base xargo compile command is xargo build --target thumbv7m-unknown-linux-uclibc.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.