Skip to content

can't compile Rust standard library with cc v1.0.80+ #859

@kadiwa4

Description

@kadiwa4

Edit: now tracked in #913

In the Rust repo, if you update cc to the latest version and try to compile the standard library

RUSTC_BOOTSTRAP=1 ./build/host/stage0/bin/cargo update -p cc
./x check std

You will get this error:

Error
error: unexpected `cfg` condition name
  --> library/core/src/num/mod.rs:29:11
   |
29 | #[cfg(not(no_fp_fmt_parse))]
   |           ^^^^^^^^^^^^^^^
   |
   = note: `-D unexpected-cfgs` implied by `-D warnings`

error: unexpected `cfg` condition name
  --> library/core/src/num/mod.rs:31:11
   |
31 | #[cfg(not(no_fp_fmt_parse))]
   |           ^^^^^^^^^^^^^^^

error: unexpected `cfg` condition name
  --> library/core/src/num/mod.rs:33:11
   |
33 | #[cfg(not(no_fp_fmt_parse))]
   |           ^^^^^^^^^^^^^^^

error: unexpected `cfg` condition name
  --> library/core/src/num/mod.rs:35:11
   |
35 | #[cfg(not(no_fp_fmt_parse))]
   |           ^^^^^^^^^^^^^^^

error: unexpected `cfg` condition name
  --> library/core/src/num/mod.rs:57:11
   |
57 | #[cfg(not(no_fp_fmt_parse))]
   |           ^^^^^^^^^^^^^^^

error: unexpected `cfg` condition value
   --> library/core/src/mem/mod.rs:735:19
    |
735 |     #[cfg(not(any(target_arch = "spirv")))]
    |                   ^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `target_arch` are: `aarch64`, `arm`, `avr`, `bpf`, `hexagon`, `loongarch64`, `m68k`, `mips`, `mips64`, `msp430`, `nvptx64`, `powerpc`, `powerpc64`, `riscv32`, `riscv64`, `s390x`, `sparc`, `sparc64`, `wasm32`, `wasm64`, `x86`, `x86_64`

error: unexpected `cfg` condition value
   --> library/core/src/ffi/mod.rs:244:5
    |
244 |     target_arch = "asmjs",
    |     ^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `target_arch` are: `aarch64`, `arm`, `avr`, `bpf`, `hexagon`, `loongarch64`, `m68k`, `mips`, `mips64`, `msp430`, `nvptx64`, `powerpc`, `powerpc64`, `riscv32`, `riscv64`, `s390x`, `sparc`, `sparc64`, `wasm32`, `wasm64`, `x86`, `x86_64`

error: unexpected `cfg` condition value
   --> library/core/src/ffi/mod.rs:273:5
    |
273 |     target_arch = "asmjs",
    |     ^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `target_arch` are: `aarch64`, `arm`, `avr`, `bpf`, `hexagon`, `loongarch64`, `m68k`, `mips`, `mips64`, `msp430`, `nvptx64`, `powerpc`, `powerpc64`, `riscv32`, `riscv64`, `s390x`, `sparc`, `sparc64`, `wasm32`, `wasm64`, `x86`, `x86_64`

error: unexpected `cfg` condition value
   --> library/core/src/ffi/mod.rs:434:5
    |
434 |     target_arch = "asmjs",
    |     ^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `target_arch` are: `aarch64`, `arm`, `avr`, `bpf`, `hexagon`, `loongarch64`, `m68k`, `mips`, `mips64`, `msp430`, `nvptx64`, `powerpc`, `powerpc64`, `riscv32`, `riscv64`, `s390x`, `sparc`, `sparc64`, `wasm32`, `wasm64`, `x86`, `x86_64`

error: unexpected `cfg` condition value
   --> library/core/src/ffi/mod.rs:464:9
    |
464 |     not(target_arch = "asmjs"),
    |         ^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `target_arch` are: `aarch64`, `arm`, `avr`, `bpf`, `hexagon`, `loongarch64`, `m68k`, `mips`, `mips64`, `msp430`, `nvptx64`, `powerpc`, `powerpc64`, `riscv32`, `riscv64`, `s390x`, `sparc`, `sparc64`, `wasm32`, `wasm64`, `x86`, `x86_64`

error: unexpected `cfg` condition value
   --> library/core/src/ffi/mod.rs:398:9
    |
398 |         target_arch = "asmjs",
    |         ^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `target_arch` are: `aarch64`, `arm`, `avr`, `bpf`, `hexagon`, `loongarch64`, `m68k`, `mips`, `mips64`, `msp430`, `nvptx64`, `powerpc`, `powerpc64`, `riscv32`, `riscv64`, `s390x`, `sparc`, `sparc64`, `wasm32`, `wasm64`, `x86`, `x86_64`

error: unexpected `cfg` condition value
   --> library/core/src/ffi/mod.rs:416:13
    |
416 |         not(target_arch = "asmjs"),
    |             ^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `target_arch` are: `aarch64`, `arm`, `avr`, `bpf`, `hexagon`, `loongarch64`, `m68k`, `mips`, `mips64`, `msp430`, `nvptx64`, `powerpc`, `powerpc64`, `riscv32`, `riscv64`, `s390x`, `sparc`, `sparc64`, `wasm32`, `wasm64`, `x86`, `x86_64`

error: unexpected `cfg` condition value
   --> library/core/src/ffi/mod.rs:114:21
    |
114 |                     target_arch = "csky"
    |                     ^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `target_arch` are: `aarch64`, `arm`, `avr`, `bpf`, `hexagon`, `loongarch64`, `m68k`, `mips`, `mips64`, `msp430`, `nvptx64`, `powerpc`, `powerpc64`, `riscv32`, `riscv64`, `s390x`, `sparc`, `sparc64`, `wasm32`, `wasm64`, `x86`, `x86_64`

error: unexpected `cfg` condition name
  --> library/core/src/fmt/mod.rs:16:11
   |
16 | #[cfg(not(no_fp_fmt_parse))]
   |           ^^^^^^^^^^^^^^^

error: unexpected `cfg` condition name
  --> library/core/src/fmt/mod.rs:18:7
   |
18 | #[cfg(no_fp_fmt_parse)]
   |       ^^^^^^^^^^^^^^^

error: unexpected `cfg` condition name
   --> library/core/src/../../stdarch/crates/core_arch/src/x86/mod.rs:782:11
    |
782 | #[cfg(not(stdarch_intel_sde))]
    |           ^^^^^^^^^^^^^^^^^

error: unexpected `cfg` condition name
   --> library/core/src/../../stdarch/crates/core_arch/src/x86/mod.rs:784:11
    |
784 | #[cfg(not(stdarch_intel_sde))]
    |           ^^^^^^^^^^^^^^^^^

error: unexpected `cfg` condition name
   --> library/core/src/../../stdarch/crates/core_arch/src/x86/mod.rs:787:11
    |
787 | #[cfg(not(stdarch_intel_sde))]
    |           ^^^^^^^^^^^^^^^^^

error: unexpected `cfg` condition name
   --> library/core/src/../../stdarch/crates/core_arch/src/x86/mod.rs:789:11
    |
789 | #[cfg(not(stdarch_intel_sde))]
    |           ^^^^^^^^^^^^^^^^^

error: could not compile `core` (lib) due to 19 previous errors

Preventing rust-lang/rust#112865 from passing CI. The problem was introduced in #780. Maybe it's because it introduced a new dependency (os_pipe edit: libc, because os_pipe was removed again).

Feel free to move the issue if it belongs to rust-lang/rust.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions