Open johnthagen opened 7 years ago
This is happening inside LLVM and plausibly should be filed with that project.
crt-static
is not passed to LLVM (and shouldn't be). It seems as if rustc consumes not just crt-static
but also other target features that have it as a prefix? This filtering looks suspicious:
Also rustc:
+
and -
. I tried to find places in LLVM where this could break things, but found a couple at best. Memory sanitizer perhaps? https://github.com/rust-lang/llvm-project/blob/rustc/9.0-2019-12-19/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp#L3738. The main thing (subtarget creation) is done correctly.
There's at least one such place in rustc ("+atomics"
check).+
or -
. I have no idea why the assert in MCSubtargetInfo.cpp/ApplyFeatureFlag
doesn't fire on this.
Compiling a simple
Hello, World
program:Should
RUSTFLAGS=-Ctarget-feature=+crt-staticzzzz
be silently accepted?If I pass
RUSTFLAGS=-Ctarget-feature=+batman
, a warning is printed, as expected.Why is trailing misspelling silently allowed?