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)
LLVM target triple, e.g. ``"or1k"``
:var linker: (string)
Linker to run.
: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"``
:var features: (list of string)
@ -84,6 +86,7 @@ class Target:
triple = "unknown"
data_layout = ""
features = []
linker = "lld"
print_function = "printf"
little_endian = False
now_pinning = True
@ -176,7 +179,7 @@ class Target:
def link(self, objects):
"""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))] +
["-o", "{output}"],
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-" \
"f64:32:32-v64:32:32-v128:32:32-a0:0:32-n32"
features = ["mul", "div", "ffl1", "cmov", "addc"]
linker = "or1k-linux-ld"
print_function = "core_log"
little_endian = False
now_pinning = True
@ -262,6 +266,7 @@ class CortexA9Target(Target):
triple = "armv7-unknown-linux-gnueabihf"
data_layout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
features = ["dsp", "fp16", "neon", "vfp3"]
linker = "lld"
print_function = "core_log"
little_endian = True
now_pinning = False