![](/img/trans.png)
[英]How to find which libc.so will `rustc --target=$TARGET` link against?
[英]How can I silence `rustc`'s note about which native artifacts to link against?
我有一个项目,其中Rust源文件被自动生成并编译到静态库中。 我希望将rustc
输出像往常一样流式传输到stdout和stderr,但我希望并非总是发出以下注释:
note: link against the following native artifacts when linking against this static library
note: the order and any duplication can be significant on some platforms, and so may need to be preserved
note: library: System
note: library: resolv
note: library: c
note: library: m
有什么办法可以在不使其他内容沉默太多的情况下将其静音? 当我想出如何自动链接内容时,该注释对我很有用,但对于从未真正看到链接过程的用户而言,它将无用。
在Rust 1.21和更早的版本中,无法关闭输出。
在Rust 1.22中,添加了--print=native-static-libs
选项。 如果不存在,则输出:
注意:默认情况下不会打印此列表。 如果需要此信息,请添加--print native-static-libs。
添加该选项将使警告静音。
要使此信息静音而不使其他任何内容静默,请在Rust 1.23发布后将其升级。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.