From f77b607b56b5d63e100e338d4d9519c07b81a9f5 Mon Sep 17 00:00:00 2001 From: occheung Date: Tue, 17 Aug 2021 11:44:05 +0800 Subject: [PATCH] compiler: generate symbols --- MANIFEST.in | 1 + artiq/compiler/kernel.ld | 9 +++++++++ artiq/compiler/targets.py | 5 +++-- 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 artiq/compiler/kernel.ld diff --git a/MANIFEST.in b/MANIFEST.in index 52fac08ba..27aa85a93 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,3 +4,4 @@ include artiq/gui/logo*.svg include versioneer.py include artiq/_version.py include artiq/coredevice/coredevice_generic.schema.json +include artiq/compiler/kernel.ld diff --git a/artiq/compiler/kernel.ld b/artiq/compiler/kernel.ld new file mode 100644 index 000000000..4147026a2 --- /dev/null +++ b/artiq/compiler/kernel.ld @@ -0,0 +1,9 @@ +SECTIONS { + .bss ALIGN(4) : + { + __bss_start = .; + *(.sbss .sbss.* .bss .bss.*); + . = ALIGN(4); + _end = .; + } +} \ No newline at end of file diff --git a/artiq/compiler/targets.py b/artiq/compiler/targets.py index b6e33e8ca..0c6ee3ee4 100644 --- a/artiq/compiler/targets.py +++ b/artiq/compiler/targets.py @@ -182,6 +182,7 @@ class Target: def link(self, objects): """Link the relocatable objects into a shared library for this target.""" with RunTool([self.tool_ld, "-shared", "--eh-frame-hdr"] + + ["-T" + os.path.join(os.path.dirname(__file__), "kernel.ld")] + ["{{obj{}}}".format(index) for index in range(len(objects))] + ["-x"] + ["-o", "{output}"], @@ -258,9 +259,9 @@ class NativeTarget(Target): class RISCVTarget(Target): triple = "riscv32-unknown-linux" data_layout = "e-m:e-p:32:32-i64:64-n32-S128" - features = [] + features = ["m", "a"] print_function = "core_log" - little_endian = False + little_endian = True now_pinning = True tool_ld = "ld.lld"