rust-osdev / cargo-xbuild

Automatically cross-compiles the sysroot crates core, compiler_builtins, and alloc.
Apache License 2.0
258 stars 25 forks source link

Incorrect linking using sysroot from xbuild #30

Closed MathiasKoch closed 4 years ago

MathiasKoch commented 5 years ago

Hi.

I am trying to use cargo xbuild to build for target "thumbv7em-none-eabihf".

When i am using cargo build, everything correctly links, resulting in

size target/thumbv7em-none-eabihf/debug/factbird-rs       
   text    data     bss     dec     hex filename
   6562       0       8    6570    19aa target/thumbv7em-none-eabihf/debug/factbird-rs

But, building the exact same with cargo xbuild results in

size target/thumbv7em-none-eabihf/debug/factbird-rs                                                                                                         
   text    data     bss     dec     hex filename
      0       0       0       0       0 target/thumbv7em-none-eabihf/debug/factbird-rs

I have also tried using RUSTFLAGS="--sysroot=/home/mathias/git/blackbird/other/factbird-rs/target/sysroot" cargo build

Which also results in the same wrongly linked file.

My problem is, that i need the sysroot alloc and compiler_builtins for my project.

I have attached an cargo xbuild --verbose after a cargo clean here, but there is no errors.. :

+ "rustc" "--print" "sysroot"
+ "rustc" "--print" "target-list"
+ "/home/mathias/.rustup/toolchains/nightly-2019-02-19-x86_64-unknown-linux-gnu/bin/cargo" "rustc" "-p" "alloc" "--release" "--manifest-path" "/tmp/xargo.5R25mEvRl1u9/Cargo.toml" "--target" "thumbv7em-none-eabihf" "-v" "--" "-Z" "force-unstable-if-unmarked"
    Updating crates.io index
   Compiling core v0.0.0 (/home/mathias/.rustup/toolchains/nightly-2019-02-19-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore)
   Compiling compiler_builtins v0.1.10
     Running `rustc --crate-name core /home/mathias/.rustup/toolchains/nightly-2019-02-19-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/lib.rs --color always --crate-type lib --emit=dep-info,link -C opt-level=3 -C debuginfo=2 -C metadata=689e0a6b9a65f770 -C extra-filename=-689e0a6b9a65f770 --out-dir /tmp/xargo.5R25mEvRl1u9/target/thumbv7em-none-eabihf/release/deps --target thumbv7em-none-eabihf -L dependency=/tmp/xargo.5R25mEvRl1u9/target/thumbv7em-none-eabihf/release/deps -L dependency=/tmp/xargo.5R25mEvRl1u9/target/release/deps -C linker=arm-none-eabi-gcc -C link-arg=-Wl,-Tlink.x -C link-arg=-nostartfiles`
     Running `rustc --crate-name build_script_build /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/compiler_builtins-0.1.10/build.rs --color always --crate-type bin --emit=dep-info,link -C opt-level=3 -C debuginfo=2 --cfg 'feature="compiler-builtins"' --cfg 'feature="core"' --cfg 'feature="default"' --cfg 'feature="mem"' -C metadata=774b5f2c2454c202 -C extra-filename=-774b5f2c2454c202 --out-dir /tmp/xargo.5R25mEvRl1u9/target/release/build/compiler_builtins-774b5f2c2454c202 -L dependency=/tmp/xargo.5R25mEvRl1u9/target/release/deps --cap-lints allow`
     Running `/tmp/xargo.5R25mEvRl1u9/target/release/build/compiler_builtins-774b5f2c2454c202/build-script-build`
   Compiling rustc-std-workspace-core v1.0.0 (/home/mathias/.rustup/toolchains/nightly-2019-02-19-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/tools/rustc-std-workspace-core)
     Running `rustc --edition=2018 --crate-name rustc_std_workspace_core /home/mathias/.rustup/toolchains/nightly-2019-02-19-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/tools/rustc-std-workspace-core/lib.rs --color always --crate-type lib --emit=dep-info,link -C opt-level=3 -C debuginfo=2 -C metadata=61dda5bb21022ff9 -C extra-filename=-61dda5bb21022ff9 --out-dir /tmp/xargo.5R25mEvRl1u9/target/thumbv7em-none-eabihf/release/deps --target thumbv7em-none-eabihf -L dependency=/tmp/xargo.5R25mEvRl1u9/target/thumbv7em-none-eabihf/release/deps -L dependency=/tmp/xargo.5R25mEvRl1u9/target/release/deps --extern core=/tmp/xargo.5R25mEvRl1u9/target/thumbv7em-none-eabihf/release/deps/libcore-689e0a6b9a65f770.rlib -C linker=arm-none-eabi-gcc -C link-arg=-Wl,-Tlink.x -C link-arg=-nostartfiles`
     Running `rustc --crate-name compiler_builtins /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/compiler_builtins-0.1.10/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C opt-level=3 -C debuginfo=2 --cfg 'feature="compiler-builtins"' --cfg 'feature="core"' --cfg 'feature="default"' --cfg 'feature="mem"' -C metadata=700c8fe620c273a5 -C extra-filename=-700c8fe620c273a5 --out-dir /tmp/xargo.5R25mEvRl1u9/target/thumbv7em-none-eabihf/release/deps --target thumbv7em-none-eabihf -L dependency=/tmp/xargo.5R25mEvRl1u9/target/thumbv7em-none-eabihf/release/deps -L dependency=/tmp/xargo.5R25mEvRl1u9/target/release/deps --extern core=/tmp/xargo.5R25mEvRl1u9/target/thumbv7em-none-eabihf/release/deps/librustc_std_workspace_core-61dda5bb21022ff9.rlib --cap-lints allow -C linker=arm-none-eabi-gcc -C link-arg=-Wl,-Tlink.x -C link-arg=-nostartfiles --cfg thumb`
   Compiling alloc v0.0.0 (/tmp/xargo.5R25mEvRl1u9)
     Running `rustc --edition=2018 --crate-name alloc /home/mathias/.rustup/toolchains/nightly-2019-02-19-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/liballoc/lib.rs --color always --crate-type lib --emit=dep-info,link -C opt-level=3 -C debuginfo=2 -Z force-unstable-if-unmarked -C metadata=175bf83a25490432 -C extra-filename=-175bf83a25490432 --out-dir /tmp/xargo.5R25mEvRl1u9/target/thumbv7em-none-eabihf/release/deps --target thumbv7em-none-eabihf -L dependency=/tmp/xargo.5R25mEvRl1u9/target/thumbv7em-none-eabihf/release/deps -L dependency=/tmp/xargo.5R25mEvRl1u9/target/release/deps --extern compiler_builtins=/tmp/xargo.5R25mEvRl1u9/target/thumbv7em-none-eabihf/release/deps/libcompiler_builtins-700c8fe620c273a5.rlib --extern core=/tmp/xargo.5R25mEvRl1u9/target/thumbv7em-none-eabihf/release/deps/libcore-689e0a6b9a65f770.rlib -C linker=arm-none-eabi-gcc -C link-arg=-Wl,-Tlink.x -C link-arg=-nostartfiles`
    Finished release [optimized + debuginfo] target(s) in 20.33s
+ RUSTFLAGS="--sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot"
+ "/home/mathias/.rustup/toolchains/nightly-2019-02-19-x86_64-unknown-linux-gnu/bin/cargo" "build" "--verbose"
   Compiling semver-parser v0.7.0
   Compiling proc-macro2 v0.4.27
   Compiling unicode-xid v0.1.0
   Compiling typenum v1.10.0
   Compiling rand_core v0.4.0
   Compiling syn v0.15.30
   Compiling cortex-m v0.5.8
   Compiling vcell v0.1.0
     Running `rustc --crate-name semver_parser /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/semver-parser-0.7.0/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=a5013c4a48997760 -C extra-filename=-a5013c4a48997760 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow`
     Running `rustc --crate-name build_script_build /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-0.4.27/build.rs --color always --crate-type bin --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="proc-macro"' -C metadata=664c2cb41db3018b -C extra-filename=-664c2cb41db3018b --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/build/proc-macro2-664c2cb41db3018b -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow`
     Running `rustc --crate-name unicode_xid /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/unicode-xid-0.1.0/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 --cfg 'feature="default"' -C metadata=9d54fe9bc00fa368 -C extra-filename=-9d54fe9bc00fa368 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow`
     Running `rustc --crate-name build_script_main /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/typenum-1.10.0/build/main.rs --color always --crate-type bin --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=5806034ac73363ff -C extra-filename=-5806034ac73363ff --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/build/typenum-5806034ac73363ff -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow`
     Running `rustc --crate-name rand_core /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_core-0.4.0/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=6a6744a4fd9cb569 -C extra-filename=-6a6744a4fd9cb569 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow`
     Running `rustc --crate-name build_script_build /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-0.15.30/build.rs --color always --crate-type bin --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 --cfg 'feature="clone-impls"' --cfg 'feature="default"' --cfg 'feature="derive"' --cfg 'feature="extra-traits"' --cfg 'feature="full"' --cfg 'feature="parsing"' --cfg 'feature="printing"' --cfg 'feature="proc-macro"' --cfg 'feature="proc-macro2"' --cfg 'feature="quote"' -C metadata=644f9d62d598c31c -C extra-filename=-644f9d62d598c31c --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/build/syn-644f9d62d598c31c -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow`
     Running `rustc --crate-name build_script_build /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-0.5.8/build.rs --color always --crate-type bin --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=a058de06953ee555 -C extra-filename=-a058de06953ee555 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/build/cortex-m-a058de06953ee555 -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow`
     Running `rustc --crate-name vcell /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/vcell-0.1.0/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=ec393dc222a689bb -C extra-filename=-ec393dc222a689bb --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot`
   Compiling cortex-m-rt v0.6.8
     Running `rustc --crate-name build_script_build /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-rt-0.6.8/build.rs --color always --crate-type bin --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 --cfg 'feature="device"' -C metadata=c21932aaeb68e831 -C extra-filename=-c21932aaeb68e831 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/build/cortex-m-rt-c21932aaeb68e831 -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow`
   Compiling stable_deref_trait v1.1.1
     Running `rustc --crate-name stable_deref_trait /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/stable_deref_trait-1.1.1/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=a169e2b80cd9406a -C extra-filename=-a169e2b80cd9406a --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot`
   Compiling cortex-m v0.6.0
     Running `rustc --crate-name build_script_build /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-0.6.0/build.rs --color always --crate-type bin --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=25022b70a34fb207 -C extra-filename=-25022b70a34fb207 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/build/cortex-m-25022b70a34fb207 -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow`
   Compiling r0 v0.2.2
     Running `rustc --crate-name r0 /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/r0-0.2.2/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=7235a16c01140ce4 -C extra-filename=-7235a16c01140ce4 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot`
   Compiling cortex-m-semihosting v0.3.2
     Running `rustc --crate-name build_script_build /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-semihosting-0.3.2/build.rs --color always --crate-type bin --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=72090633d9b51425 -C extra-filename=-72090633d9b51425 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/build/cortex-m-semihosting-72090633d9b51425 -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow`
   Compiling stm32l4 v0.6.0
     Running `rustc --crate-name build_script_build /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/stm32l4-0.6.0/build.rs --color always --crate-type bin --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 --cfg 'feature="cortex-m-rt"' --cfg 'feature="default"' --cfg 'feature="rt"' --cfg 'feature="stm32l4x5"' -C metadata=63906e06fd79cd2b -C extra-filename=-63906e06fd79cd2b --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/build/stm32l4-63906e06fd79cd2b -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow`
   Compiling volatile-register v0.1.2
     Running `rustc --crate-name volatile_register /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/volatile-register-0.1.2/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=bafa39a5a29a6244 -C extra-filename=-bafa39a5a29a6244 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot`
   Compiling aligned v0.2.0
   Compiling linked_list_allocator v0.6.4
     Running `rustc --crate-name aligned /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/aligned-0.2.0/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=41bf270fc6e54be6 -C extra-filename=-41bf270fc6e54be6 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot`
     Running `rustc --crate-name linked_list_allocator /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/linked_list_allocator-0.6.4/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=14db457c0cb6e97e -C extra-filename=-14db457c0cb6e97e --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot`
   Compiling volatile-register v0.2.0
     Running `rustc --crate-name volatile_register /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/volatile-register-0.2.0/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=af4ad95bd95e18f4 -C extra-filename=-af4ad95bd95e18f4 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern vcell=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libvcell-ec393dc222a689bb.rlib --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot`
   Compiling rand_core v0.3.1
     Running `rustc --crate-name rand_core /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_core-0.3.1/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=20f3b3841c5e3d62 -C extra-filename=-20f3b3841c5e3d62 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern rand_core=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps/librand_core-6a6744a4fd9cb569.rlib --cap-lints allow`
     Running `/home/mathias/git/blackbird/other/factbird-rs/target/debug/build/cortex-m-a058de06953ee555/build-script-build`
     Running `/home/mathias/git/blackbird/other/factbird-rs/target/debug/build/cortex-m-rt-c21932aaeb68e831/build-script-build`
     Running `/home/mathias/git/blackbird/other/factbird-rs/target/debug/build/syn-644f9d62d598c31c/build-script-build`
     Running `/home/mathias/git/blackbird/other/factbird-rs/target/debug/build/proc-macro2-664c2cb41db3018b/build-script-build`
   Compiling cortex-m v0.1.8
     Running `rustc --crate-name cortex_m /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-0.1.8/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=d596cb2a215a5d27 -C extra-filename=-d596cb2a215a5d27 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern volatile_register=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libvolatile_register-bafa39a5a29a6244.rlib --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot`
     Running `/home/mathias/git/blackbird/other/factbird-rs/target/debug/build/cortex-m-25022b70a34fb207/build-script-build`
   Compiling rand v0.5.6
     Running `rustc --crate-name rand /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.5.6/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=0ead1e2840848d75 -C extra-filename=-0ead1e2840848d75 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern rand_core=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps/librand_core-20f3b3841c5e3d62.rlib --cap-lints allow`
     Running `/home/mathias/git/blackbird/other/factbird-rs/target/debug/build/cortex-m-semihosting-72090633d9b51425/build-script-build`
     Running `/home/mathias/git/blackbird/other/factbird-rs/target/debug/build/typenum-5806034ac73363ff/build-script-main`
     Running `rustc --crate-name proc_macro2 /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-0.4.27/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="proc-macro"' -C metadata=569c775ba7e48c3e -C extra-filename=-569c775ba7e48c3e --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern unicode_xid=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps/libunicode_xid-9d54fe9bc00fa368.rlib --cap-lints allow --cfg u128 --cfg use_proc_macro --cfg wrap_proc_macro --cfg nightly`
     Running `/home/mathias/git/blackbird/other/factbird-rs/target/debug/build/stm32l4-63906e06fd79cd2b/build-script-build`
     Running `rustc --crate-name typenum /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/typenum-1.10.0/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=ae5097b29b3df08a -C extra-filename=-ae5097b29b3df08a --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot`
   Compiling semver v0.9.0
     Running `rustc --crate-name semver /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/semver-0.9.0/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 --cfg 'feature="default"' -C metadata=97631abd75a04f66 -C extra-filename=-97631abd75a04f66 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern semver_parser=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps/libsemver_parser-a5013c4a48997760.rlib --cap-lints allow`
   Compiling alloc-cortex-m v0.3.5
     Running `rustc --crate-name alloc_cortex_m /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/alloc-cortex-m-0.3.5/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=743fff4f20ccd058 -C extra-filename=-743fff4f20ccd058 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern cortex_m=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libcortex_m-d596cb2a215a5d27.rlib --extern linked_list_allocator=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/liblinked_list_allocator-14db457c0cb6e97e.rlib --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot`
   Compiling rustc_version v0.2.3
     Running `rustc --crate-name rustc_version /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc_version-0.2.3/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=57e8ff2e2c437f30 -C extra-filename=-57e8ff2e2c437f30 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern semver=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps/libsemver-97631abd75a04f66.rlib --cap-lints allow`
   Compiling generic-array v0.12.0
     Running `rustc --crate-name generic_array /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/generic-array-0.12.0/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=bd098c6f883efdb3 -C extra-filename=-bd098c6f883efdb3 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern typenum=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libtypenum-ae5097b29b3df08a.rlib --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot`
   Compiling bare-metal v0.2.4
     Running `rustc --crate-name build_script_build /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/bare-metal-0.2.4/build.rs --color always --crate-type bin --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=30b2f25266ef58bb -C extra-filename=-30b2f25266ef58bb --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/build/bare-metal-30b2f25266ef58bb -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern rustc_version=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps/librustc_version-57e8ff2e2c437f30.rlib --cap-lints allow`
   Compiling as-slice v0.1.0
     Running `rustc --crate-name as_slice /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/as-slice-0.1.0/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=2176a59937717e9f -C extra-filename=-2176a59937717e9f --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern generic_array=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libgeneric_array-bd098c6f883efdb3.rlib --extern stable_deref_trait=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libstable_deref_trait-a169e2b80cd9406a.rlib --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot`
   Compiling quote v0.6.12
     Running `rustc --crate-name quote /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/quote-0.6.12/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="proc-macro"' --cfg 'feature="proc-macro2"' -C metadata=6b4a844fc4c32a32 -C extra-filename=-6b4a844fc4c32a32 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern proc_macro2=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps/libproc_macro2-569c775ba7e48c3e.rlib --cap-lints allow`
     Running `/home/mathias/git/blackbird/other/factbird-rs/target/debug/build/bare-metal-30b2f25266ef58bb/build-script-build`
     Running `rustc --crate-name bare_metal /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/bare-metal-0.2.4/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=c8d2a0cf662a2d5c -C extra-filename=-c8d2a0cf662a2d5c --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot`
     Running `rustc --crate-name cortex_m /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-0.5.8/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=1e5848c4ac0bfe37 -C extra-filename=-1e5848c4ac0bfe37 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern aligned=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libaligned-41bf270fc6e54be6.rlib --extern bare_metal=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libbare_metal-c8d2a0cf662a2d5c.rlib --extern volatile_register=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libvolatile_register-af4ad95bd95e18f4.rlib --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot -L /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/build/cortex-m-dddb4941397b99f6/out --cfg cortex_m --cfg armv7m --cfg has_fpu -l static=cortex-m`
     Running `rustc --crate-name syn /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-0.15.30/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 --cfg 'feature="clone-impls"' --cfg 'feature="default"' --cfg 'feature="derive"' --cfg 'feature="extra-traits"' --cfg 'feature="full"' --cfg 'feature="parsing"' --cfg 'feature="printing"' --cfg 'feature="proc-macro"' --cfg 'feature="proc-macro2"' --cfg 'feature="quote"' -C metadata=4455476e02eee424 -C extra-filename=-4455476e02eee424 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern proc_macro2=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps/libproc_macro2-569c775ba7e48c3e.rlib --extern quote=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps/libquote-6b4a844fc4c32a32.rlib --extern unicode_xid=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps/libunicode_xid-9d54fe9bc00fa368.rlib --cap-lints allow --cfg syn_can_use_thread_id --cfg syn_can_call_macro_by_path`
     Running `rustc --crate-name cortex_m_semihosting /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-semihosting-0.3.2/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=d6e290ce4d11922f -C extra-filename=-d6e290ce4d11922f --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern cortex_m=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libcortex_m-1e5848c4ac0bfe37.rlib --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot -L /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/build/cortex-m-semihosting-0ae8219cf00c055d/out --cfg thumb -l static=cortex-m-semihosting -L /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/build/cortex-m-dddb4941397b99f6/out`
   Compiling aligned v0.3.1
     Running `rustc --edition=2018 --crate-name aligned /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/aligned-0.3.1/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=4d8a2d956c8cf5ee -C extra-filename=-4d8a2d956c8cf5ee --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern as_slice=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libas_slice-2176a59937717e9f.rlib --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot`
     Running `rustc --crate-name cortex_m /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-0.6.0/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=8bb7745d28efa6d6 -C extra-filename=-8bb7745d28efa6d6 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern aligned=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libaligned-4d8a2d956c8cf5ee.rlib --extern bare_metal=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libbare_metal-c8d2a0cf662a2d5c.rlib --extern volatile_register=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libvolatile_register-af4ad95bd95e18f4.rlib --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot -L /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/build/cortex-m-159a20753a1a73df/out --cfg cortex_m --cfg armv7m --cfg has_fpu -l static=cortex-m`
   Compiling cortex-m-rt-macros v0.1.5
     Running `rustc --crate-name cortex_m_rt_macros /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-rt-macros-0.1.5/src/lib.rs --color always --crate-type proc-macro --emit=dep-info,link -C prefer-dynamic -C codegen-units=1 -C debuginfo=2 -C metadata=d23eb9131f6bb606 -C extra-filename=-d23eb9131f6bb606 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern proc_macro2=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps/libproc_macro2-569c775ba7e48c3e.rlib --extern quote=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps/libquote-6b4a844fc4c32a32.rlib --extern rand=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps/librand-0ead1e2840848d75.rlib --extern syn=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps/libsyn-4455476e02eee424.rlib --cap-lints allow`
     Running `rustc --crate-name cortex_m_rt /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-rt-0.6.8/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 --cfg 'feature="device"' -C metadata=6aad3ef91dfb67ce -C extra-filename=-6aad3ef91dfb67ce --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern cortex_m_rt_macros=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps/libcortex_m_rt_macros-d23eb9131f6bb606.so --extern r0=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libr0-7235a16c01140ce4.rlib --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot -L /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/build/cortex-m-rt-039d964bde87625c/out --cfg has_fpu --cfg cortex_m --cfg armv7m -l static=cortex-m-rt`
     Running `rustc --crate-name stm32l4 /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/stm32l4-0.6.0/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 --cfg 'feature="cortex-m-rt"' --cfg 'feature="default"' --cfg 'feature="rt"' --cfg 'feature="stm32l4x5"' -C metadata=64f7cbb9965ef9a2 -C extra-filename=-64f7cbb9965ef9a2 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern bare_metal=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libbare_metal-c8d2a0cf662a2d5c.rlib --extern cortex_m=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libcortex_m-1e5848c4ac0bfe37.rlib --extern cortex_m_rt=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libcortex_m_rt-6aad3ef91dfb67ce.rlib --extern vcell=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libvcell-ec393dc222a689bb.rlib --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot -L /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/build/stm32l4-7ec013fd750bca39/out -L /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/build/cortex-m-dddb4941397b99f6/out -L /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/build/cortex-m-rt-039d964bde87625c/out`
   Compiling factbird-rs v0.1.0 (/home/mathias/git/blackbird/other/factbird-rs)
     Running `rustc --crate-name factbird_rs src/main.rs --color always --crate-type bin --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=f0c403b14b0cc245 -C extra-filename=-f0c403b14b0cc245 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -C incremental=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/incremental -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern alloc_cortex_m=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/liballoc_cortex_m-743fff4f20ccd058.rlib --extern cortex_m=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libcortex_m-8bb7745d28efa6d6.rlib --extern cortex_m_rt=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libcortex_m_rt-6aad3ef91dfb67ce.rlib --extern cortex_m_semihosting=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libcortex_m_semihosting-d6e290ce4d11922f.rlib --extern stm32l4=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libstm32l4-64f7cbb9965ef9a2.rlib --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot -L /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/build/cortex-m-159a20753a1a73df/out -L /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/build/cortex-m-rt-039d964bde87625c/out -L /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/build/cortex-m-semihosting-0ae8219cf00c055d/out -L /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/build/cortex-m-dddb4941397b99f6/out -L /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/build/stm32l4-7ec013fd750bca39/out`
    Finished dev [unoptimized + debuginfo] target(s) in 38.95s

My .cargo/config is:

[target.thumbv7m-none-eabi]
# uncomment this to make `cargo run` execute programs on QEMU
# runner = "qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel"

[target.'cfg(all(target_arch = "arm", target_os = "none"))']
# uncomment ONE of these three option to make `cargo run` start a GDB session
# which option to pick depends on your system
runner = "arm-none-eabi-gdb -q -x openocd.gdb"
# runner = "gdb-multiarch -q -x openocd.gdb"
# runner = "gdb -q -x openocd.gdb"

rustflags = [
  # LLD (shipped with the Rust toolchain) is used as the default linker
  "-C", "link-arg=-Tlink.x",

  # if you run into problems with LLD switch to the GNU linker by commenting out
  # this line
  "-C", "linker=arm-none-eabi-ld",

  # if you need to link to pre-compiled C libraries provided by a C toolchain
  # use GCC as the linker by commenting out both lines above and then
  # uncommenting the three lines below
  # "-C", "linker=arm-none-eabi-gcc",
  # "-C", "link-arg=-Wl,-Tlink.x",
  # "-C", "link-arg=-nostartfiles",
]

[build]
# Pick ONE of these compilation targets
# target = "thumbv6m-none-eabi"    # Cortex-M0 and Cortex-M0+
# target = "thumbv7m-none-eabi"    # Cortex-M3
# target = "thumbv7em-none-eabi"   # Cortex-M4 and Cortex-M7 (no FPU)
target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU)
➜  factbird-rs git:(master) rustc -V       
rustc 1.34.0-nightly (146aa60f3 2019-02-18)
➜  factbird-rs git:(master) cargo --version
cargo 1.34.0-nightly (865cb7010 2019-02-10)
➜  factbird-rs git:(master) cargo xbuild -v       
cargo-xbuild 0.5.7

A copy of my repo can be found here: https://github.com/smilykoch/factbird_rs

I am not really sure how to continue on this, so any help is welcomed!

phil-opp commented 5 years ago

I have also tried using RUSTFLAGS="--sysroot=/home/mathias/git/blackbird/other/factbird-rs/target/sysroot" cargo build

My guess is that setting the RUSTFLAGS environment variables overwrites the default values set in .cargo/config, so that no linker script is used. If it occurs with bare cargo, there is nothing that cargo-xbuild can do to fix this.

My problem is, that i need the sysroot alloc and compiler_builtins for my project.

If you're using the built-in thumbv7em-none-eabihf, all sysroot libraries should be provided by rustup/cargo. For using alloc, just add extern crate alloc; to your main.rs and use the normal cargo build for building.

The cargo-xbuild crate is only needed when compiling for a custom target, since there are no precompiled versions of the sysroot crates then.