mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-07 13:18:20 +00:00
When we're building PIC we don't need the large code model. Try small.
Only mangle darwin to linux when PIC is disabled (the reason we do it is to avoid LLVM forcably enabling PIC for us).
This commit is contained in:
@@ -95,8 +95,12 @@ impl LLVM {
|
||||
}
|
||||
|
||||
fn code_model(&self) -> CodeModel {
|
||||
if self.is_pic {
|
||||
CodeModel::Small
|
||||
} else {
|
||||
CodeModel::Large
|
||||
}
|
||||
}
|
||||
|
||||
fn target_triple(&self, target: &Target) -> TargetTriple {
|
||||
// Hack: we're using is_pic to determine whether this is a native
|
||||
@@ -106,8 +110,10 @@ impl LLVM {
|
||||
} else {
|
||||
target_lexicon::BinaryFormat::Elf
|
||||
};
|
||||
let operating_system =
|
||||
if target.triple().operating_system == wasmer_compiler::OperatingSystem::Darwin {
|
||||
let operating_system = if target.triple().operating_system
|
||||
== wasmer_compiler::OperatingSystem::Darwin
|
||||
&& !self.is_pic
|
||||
{
|
||||
// LLVM detects static relocation + darwin + 64-bit and
|
||||
// force-enables PIC because MachO doesn't support that
|
||||
// combination. They don't check whether they're targeting
|
||||
|
||||
Reference in New Issue
Block a user