xargo icon indicating copy to clipboard operation
xargo copied to clipboard

xargo 0.3.9->0.3.10 regression: custom target - wrong cflags

Open Dushistov opened this issue 6 years ago • 0 comments

With 0.3.10 when I compile "hello world" I got error, with 0.3.9 all works fine. The problem in cflags in compiler_builtins compilation, I set them to -march=armv5te -mtune=arm926ej-s -mfpu=vfp -mfloat-abi=hard, but for some reason 0.3.10 add mfloat-abi=soft flag, while version 0.3.9 do not do that.

0.3.10

$ TARGET_CC=arm-angstrom-linux-gnueabi-gcc TARGET_CFLAGS="-march=armv5te -mtune=arm926ej-s -mfpu=vfp -mfloat-abi=hard" TARGET_CXX=arm-angstrom-linux-gnueabi-g++ xargo build --target=armv5te-unknown-linux-gnueabihf --release
...SKIPPED...
Compiling compiler_builtins v0.0.0 (file:///home/evgeniy/.rustup/toolchains/nightly-2017-11-08-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/rustc/compiler_builtins_shim)
error: failed to run custom build command for `compiler_builtins v0.0.0 (file:///home/evgeniy/.rustup/toolchains/nightly-2017-11-08-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/rustc/compiler_builtins_shim)`
...SKIPPED...
running: "arm-angstrom-linux-gnueabi-gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-march=armv5te" "-mtune=arm926ej-s" "-mfpu=vfp" "-mfloat-abi=hard" "-march=armv5te" "-marm" "-mfloat-abi=soft" "-fno-builtin" "-fvisibility=hidden" "-fomit-frame-pointer" "-ffreestanding" "-DVISIBILITY_HIDDEN" "-o" "/tmp/xargo.ksJZ59AHoayI/target/armv5te-unknown-linux-gnueabihf/release/build/compiler_builtins-a8505422c10cdbf3/out/../../libcompiler_builtins/compiler-rt/lib/builtins/absvdi2.o" "-c" "../../libcompiler_builtins/compiler-rt/lib/builtins/absvdi2.c"
cargo:warning=arm-angstrom-linux-gnueabi-gcc: error: -mfloat-abi=soft and -mfloat-abi=hard may not be used together

0.3.9

 Compiling compiler_builtins v0.0.0 (file:///home/evgeniy/.rustup/toolchains/nightly-2017-11-08-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/rustc/compiler_builtins_shim)
warning: ../../libcompiler_builtins/compiler-rt/lib/builtins/divdc3.c:21:1: warning: conflicting types for built-in function '__divdc3' [enabled by default]
warning: ../../libcompiler_builtins/compiler-rt/lib/builtins/divsc3.c:21:1: warning: conflicting types for built-in function '__divsc3' [enabled by default]
warning: ../../libcompiler_builtins/compiler-rt/lib/builtins/muldc3.c:21:1: warning: conflicting types for built-in function '__muldc3' [enabled by default]
warning: ../../libcompiler_builtins/compiler-rt/lib/builtins/mulsc3.c:21:1: warning: conflicting types for built-in function '__mulsc3' [enabled by default]
Compiling std_unicode v0.0.0 (file:///home/evgeniy/.rustup/toolchains/nightly-2017-11-08-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd_unicode)

I use nightly-2017-11-08 (because of recent regression in rust compiler related to armv5 code generation).

armv5te-unknown-linux-gnueabihf.json

{
  "abi-blacklist": [
    "stdcall",
    "fastcall",
    "vectorcall",
    "thiscall",
    "win64",
    "sysv64"
  ],
  "arch": "arm",
  "data-layout": "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64",
  "dynamic-linking": true,
  "env": "gnu",
  "exe-allocation-crate": "alloc",
  "executables": true,
  "features": "+vfp2,+strict-align",
  "has-elf-tls": true,
  "has-rpath": true,
  "linker-flavor": "gcc",
  "linker-is-gnu": true,
  "llvm-target": "armv5te-unknown-linux-gnueabihf",
  "max-atomic-width": 32,
  "os": "linux",
  "position-independent-executables": true,
  "pre-link-args": {
    "gcc": [
      "-Wl,--as-needed",
      "-Wl,-z,noexecstack"
    ]
  },
  "relro-level": "full",
  "target-c-int-width": "32",
  "target-endian": "little",
  "target-family": "unix",
  "target-pointer-width": "32",
  "vendor": "unknown"
}

Xargo.toml

[target.armv5te-unknown-linux-gnueabihf.dependencies.std]
features = ["alloc_system"]

Cargo.toml

[package]
name = "rust_mv78200"
version = "0.1.0"
authors = ["Evgeniy A. Dushistov <dushistov at mail.ru>"]

[dependencies]

[profile.release]
panic = "abort"

[profile.debug]
panic = "abort"

versions:

evgeniy@retina ~/.cargo/bin $ ./xargo.new --version
xargo 0.3.10
cargo 0.24.0-nightly (b83550edc 2017-11-04)
evgeniy@retina ~/.cargo/bin $ ./xargo --version
xargo 0.3.9
cargo 0.24.0-nightly (b83550edc 2017-11-04)

Dushistov avatar Jan 10 '18 13:01 Dushistov