mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-03 19:28:22 +00:00
Explain why we switch away from large code model when PIC is enabled.
Note that I don't explain why Small vs Medium. I'm not sure myself.
This commit is contained in:
@@ -95,6 +95,11 @@ impl LLVM {
|
||||
}
|
||||
|
||||
fn code_model(&self) -> CodeModel {
|
||||
// We normally use the large code model, but when targeting shared
|
||||
// objects, we are required to use PIC. If we use PIC anyways, we lose
|
||||
// any benefit from large code model and there's some cost on all
|
||||
// platforms, plus some platforms (MachO) don't support PIC + large
|
||||
// at all.
|
||||
if self.is_pic {
|
||||
CodeModel::Small
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user