Skip to content

flexible target specification breaks plugins lookup #18699

Closed
@farcaller

Description

@farcaller

I've got two crates failing to build after flexible target specification (6b130e3) was merged.

rustc \
  --opt-level 2 \
  -Z no-landing-pads \
  --cfg mcu_k20 --cfg arch_cortex_m4 \
  -g \
  -C no-stack-check \
  -L /Users/farcaller/src/zinc/build \
  --out-dir /Users/farcaller/src/zinc/build \
  /Users/farcaller/src/zinc/src/macro/ioreg.rs

builds libmacro_ioreg.dylib (and a matching libmacro_ioreg.dylib.dSYM).

The crate that depends on it fails to build though:

rustc \
  --opt-level 2 \
  -Z no-landing-pads \
  --cfg mcu_k20 --cfg arch_cortex_m4 \
  --target thumbv7em-none-eabi -Ctarget-cpu=cortex-m4 \
  -C relocation_model=static \
  -g \
  -C no-stack-check \
  -L /Users/farcaller/src/zinc/build \
  --out-dir /Users/farcaller/src/zinc/build  /Users/farcaller/src/zinc/src/zinc/lib.rs
/Users/farcaller/src/zinc/src/zinc/lib.rs:52:18: 52:43 error: can't find crate for `macro_ioreg`
/Users/farcaller/src/zinc/src/zinc/lib.rs:52 #[phase(plugin)] extern crate macro_ioreg;
                                                              ^~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error

if I remove --target thumbv7em-none-eabi, the macro_ioreg crate is resolved correctly.

target spec:

{
    "data-layout": "e-m:e-p:32:32-i1:8:32-i8:8:32-i16:16:32-i64:64-v128:64:128-a:0:32-n32-S64",
    "llvm-target": "thumbv7em-none-eabi",
    "target-endian": "little",
    "target-word-size": "32",
    "arch": "arm",
    "os": "none",
    "morestack": false
}

Metadata

Metadata

Assignees

Labels

A-pluginsArea: compiler plugins, doc.rust-lang.org/nightly/unstable-book/language-features/plugin.htmlE-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions