我有一个使用opt工具的ModulePass,但是我无法弄清楚如何在命令行中使用它.我目前使用my pass的工作流程是:
我希望将我的pass与clang命令行集成,以便可以作为现有软件(例如c ++标准库)构建的一部分调用它,而不必为我编译的每个东西重新构建整个构建系统.我已经看到了关于如何做到这一点的提示,但我无法将各个部分组合到一个正常工作的设置中.
使用Clang自动运行LLVM Pass会自动描述我想要的内容,但LLVM 3.4中似乎不推荐使用该方法(PassManagerBuilder已移至旧版命名空间).
LLVM - 使用clang自动运行自己的通行证似乎解决了基本问题,但我希望我能做到这一点,而不必修改clang(这似乎是那里的建议).
使用LLVM 3.4从clang获得新传递的最佳方法是什么?
问题:如何解决(或修复)我的两个依赖关系链接到同一个库但该库无法链接两次的情况?这似乎通常可以通过共享库来解决,但我不确定如何使用Rust来解决它.
细节:
我正在使用Nickel框架和Rust -postgres为数据库创建一个Web应用程序.构建时出现以下错误:
> cargo build
native library `openssl` is being linked to by more than one package, and can only be linked to by one package
openssl-sys v0.3.3 (https://github.com/sfackler/rust-openssl.git#ee66da60)
openssl-sys v0.3.3
Run Code Online (Sandbox Code Playgroud)
通过Cargo.lock查看,openssl由http(这是镍的依赖)和rust-postgres引用.
我的Cargo.toml看起来像这样:
[package]
name = "goodoldweb"
version = "0.0.1"
authors = ["..."]
[dependencies.nickel]
git="https://github.com/nickel-org/nickel.rs.git"
[dependencies.postgres]
git="https://github.com/sfackler/rust-postgres.git"
Run Code Online (Sandbox Code Playgroud)
这是完整的Cargo.lock:
[root]
name = "goodoldweb"
version = "0.0.1"
dependencies = [
"nickel 0.1.0 (git+https://github.com/nickel-org/nickel.rs.git)",
"postgres 0.6.1 (git+https://github.com/sfackler/rust-postgres.git)",
]
[[package]]
name = "byteorder"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index" …Run Code Online (Sandbox Code Playgroud)