-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Persistent unused attribute warnings when recompiling libcore after linker flags are changed #55
Comments
Thanks for the report! It looks like this is a bug in rustc's incremental support. We should be turning incremental off anyways (#44), I'll take a look into that. |
Oh, and the incremental thing looks like a known issue: |
build-std: Don't treat std like a "local" package. This changes it so that build-std will not treat the std crates like a "local" package. This has the following changes: - std does not build with incremental. This generally shouldn't be needed, and incremental has various bugs with std crates. - Cargo's dep-info fingerprint tracking will not track the std crate sources, these are tracked via other means. - Cargo's `.d` dep-info file does not include std crate sources. - Lints are capped to "allow" for std crates, and warnings are not shown by default. Closes rust-lang/wg-cargo-std-aware#44 Closes rust-lang/wg-cargo-std-aware#55
Closed by rust-lang/cargo#8177. |
Excellent, ty for your work! One question:
Not that I have immediate use for this, but is it possible to override this setting to see std warnings if I desire? |
|
All references to
-Clink-arg
are in a.cargo/config
file. I can't duplicate this behavior usingcargo rustc
on the command-line.I have an msp430 project I'm testing with
-Zbuild-std=core
. The.cargo/config
file normally looks like this:Therefore, my command line invocation always looks like
cargo build -Zbuild-std=core
, relying on cargo to infer the target.When I build a debug binary with or without
-Clink-arg=-lc
after acargo clean
, the build works fine. However, if I do a subsequent build where I either add-Clink-arg=-lc
if it was missing, or remove-Clink-arg=-lc
if it was present, I get a large number of warnings I don't understand, referring to unused attributes:These warnings remain, no matter whether I include
-Clink-arg=-lgcc
or not, on subsequent builds until I do the nextcargo clean
. The warnings even occur when I switch between linking tomemcpy
and friends usinglibc
to linking againstrlibc
instead (again, until the nextcargo clean
). This behavior does not happen during release builds.Beside being noise in my console, these warnings may very well be harmless. But I would expect the warnings to not persist after every other recompilation of
libcore
no matter what linker flags I pass tocargo
. This makes me thinklibcore
builds using-Zbuild-std=core
are not duplicable w/ the same exact flags betweencargo
invocations, depending on what linker argscargo
has seen before.I cannot duplicate this behavior in
xargo
. Possibly relevant:xargo
always compileslibcore
etc in release mode.The text was updated successfully, but these errors were encountered: