diff options
| author | Marcel Hlopko <hlopko@google.com> | 2021-09-10 15:11:56 +0200 |
|---|---|---|
| committer | Marcel Hlopko <hlopko@google.com> | 2021-10-01 08:06:42 +0200 |
| commit | 198d90786b9fb429928d70c423bad5d65374a532 (patch) | |
| tree | dfe7e0753b3e6071471f9a29075fb134b2679f72 /compiler/rustc_codegen_llvm/src/back/write.rs | |
| parent | 497ee321af3b8496eaccd7af7b437f18bab81abf (diff) | |
| download | rust-198d90786b9fb429928d70c423bad5d65374a532.tar.gz rust-198d90786b9fb429928d70c423bad5d65374a532.zip | |
Add `pie` as another `relocation-model` value
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/back/write.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/back/write.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_llvm/src/back/write.rs b/compiler/rustc_codegen_llvm/src/back/write.rs index 791604a1827..e8484c24df9 100644 --- a/compiler/rustc_codegen_llvm/src/back/write.rs +++ b/compiler/rustc_codegen_llvm/src/back/write.rs @@ -129,7 +129,8 @@ fn to_pass_builder_opt_level(cfg: config::OptLevel) -> llvm::PassBuilderOptLevel fn to_llvm_relocation_model(relocation_model: RelocModel) -> llvm::RelocModel { match relocation_model { RelocModel::Static => llvm::RelocModel::Static, - RelocModel::Pic => llvm::RelocModel::PIC, + // LLVM doesn't have a PIE relocation model, it represents PIE as PIC with an extra attribute. + RelocModel::Pic | RelocModel::Pie => llvm::RelocModel::PIC, RelocModel::DynamicNoPic => llvm::RelocModel::DynamicNoPic, RelocModel::Ropi => llvm::RelocModel::ROPI, RelocModel::Rwpi => llvm::RelocModel::RWPI, |
