forked from M-Labs/artiq
1
0
Fork 0

compiler: link with lld on ARM (#733)

This commit is contained in:
Sebastien Bourdeauducq 2020-04-28 15:00:24 +08:00
parent 3a7819704a
commit 4228e0205c
1 changed files with 6 additions and 1 deletions

View File

@ -68,6 +68,8 @@ class Target:
:var triple: (string) :var triple: (string)
LLVM target triple, e.g. ``"or1k"`` LLVM target triple, e.g. ``"or1k"``
:var linker: (string)
Linker to run.
:var data_layout: (string) :var data_layout: (string)
LLVM target data layout, e.g. ``"E-m:e-p:32:32-i64:32-f64:32-v64:32-v128:32-a:0:32-n32"`` LLVM target data layout, e.g. ``"E-m:e-p:32:32-i64:32-f64:32-v64:32-v128:32-a:0:32-n32"``
:var features: (list of string) :var features: (list of string)
@ -84,6 +86,7 @@ class Target:
triple = "unknown" triple = "unknown"
data_layout = "" data_layout = ""
features = [] features = []
linker = "lld"
print_function = "printf" print_function = "printf"
little_endian = False little_endian = False
now_pinning = True now_pinning = True
@ -176,7 +179,7 @@ class Target:
def link(self, objects): def link(self, objects):
"""Link the relocatable objects into a shared library for this target.""" """Link the relocatable objects into a shared library for this target."""
with RunTool([self.triple + "-ld", "-shared", "--eh-frame-hdr"] + with RunTool([self.linker, "-shared", "--eh-frame-hdr"] +
["{{obj{}}}".format(index) for index in range(len(objects))] + ["{{obj{}}}".format(index) for index in range(len(objects))] +
["-o", "{output}"], ["-o", "{output}"],
output=None, output=None,
@ -254,6 +257,7 @@ class OR1KTarget(Target):
data_layout = "E-m:e-p:32:32-i8:8:8-i16:16:16-i64:32:32-" \ data_layout = "E-m:e-p:32:32-i8:8:8-i16:16:16-i64:32:32-" \
"f64:32:32-v64:32:32-v128:32:32-a0:0:32-n32" "f64:32:32-v64:32:32-v128:32:32-a0:0:32-n32"
features = ["mul", "div", "ffl1", "cmov", "addc"] features = ["mul", "div", "ffl1", "cmov", "addc"]
linker = "or1k-linux-ld"
print_function = "core_log" print_function = "core_log"
little_endian = False little_endian = False
now_pinning = True now_pinning = True
@ -262,6 +266,7 @@ class CortexA9Target(Target):
triple = "armv7-unknown-linux-gnueabihf" triple = "armv7-unknown-linux-gnueabihf"
data_layout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" data_layout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
features = ["dsp", "fp16", "neon", "vfp3"] features = ["dsp", "fp16", "neon", "vfp3"]
linker = "lld"
print_function = "core_log" print_function = "core_log"
little_endian = True little_endian = True
now_pinning = False now_pinning = False