Commit 27918f3
committed
Auto merge of #40245 - cuviper:maybe-not-pie, r=alexcrichton
Let `-Crelocation-model` better control `-pie` linking
Prior to this, if relocation model in the target options was "pic", as
most targets have it, then the user's `-Crelocation-model` had no effect
on whether `-pie` would be used. Only `-Clink-arg=-static` would have a
further override here.
Now we use `context::get_reloc_model`, which gives precedence to the
user's option, and if it's `RelocMode::PIC` we enable `-pie`. This is
the same test as `context::is_pie_binary`, except that folds across all
`sess.crate_types`, not just the current one.
Fixes #35061.1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| |||
859 | 861 | | |
860 | 862 | | |
861 | 863 | | |
862 | | - | |
863 | 864 | | |
864 | 865 | | |
865 | 866 | | |
866 | | - | |
867 | | - | |
868 | | - | |
| 867 | + | |
| 868 | + | |
869 | 869 | | |
870 | 870 | | |
871 | 871 | | |
| |||
0 commit comments