mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 12:18:19 +00:00
aarch64 linux error fix
This fixes the error relocation R_AARCH64_MOVW_UABS_G0_NC cannot be used against local symbol
This commit is contained in:
parent
93cb8f7c7a
commit
781fba8f73
1 changed files with 2 additions and 11 deletions
|
@ -149,23 +149,14 @@ pub fn target_machine(
|
|||
|
||||
init_arch(target);
|
||||
|
||||
let code_model = match target.architecture {
|
||||
// LLVM 12 will not compile our programs without a large code model.
|
||||
// The reason is not totally clear to me, but my guess is a few special-cases in
|
||||
// llvm/lib/Target/AArch64/AArch64ISelLowering.cpp (instructions)
|
||||
// llvm/lib/Target/AArch64/AArch64Subtarget.cpp (GoT tables)
|
||||
// Revisit when upgrading to LLVM 13.
|
||||
Architecture::Aarch64(..) => CodeModel::Large,
|
||||
_ => CodeModel::Default,
|
||||
};
|
||||
|
||||
Target::from_name(arch).unwrap().create_target_machine(
|
||||
&TargetTriple::create(target_triple_str(target)),
|
||||
"generic",
|
||||
"", // TODO: this probably should be TargetMachine::get_host_cpu_features() to enable all features.
|
||||
"",
|
||||
opt,
|
||||
reloc,
|
||||
code_model,
|
||||
CodeModel::Default,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue