Skip to content

Commit ea24d9d

Browse files
jannausvenpeter42
authored andcommitted
m1n1: toolchain: llvm: Link with --pie
ld.lld started with 21.1 using 0x200000 as image base conflicting with the fixed address of 0x1238 for the .text section used in m1n1's asm.py. Linking as position independent executable avoids this. Signed-off-by: Janne Grunau <[email protected]>
1 parent 54d2c7f commit ea24d9d

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

proxyclient/m1n1/toolchain.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def _set_tools_clang(self, clangdir: str, llddir: str = None):
145145

146146
# pylint: disable=invalid-name
147147
self.CC = clangdir + "clang --target=" + self.ARCH + " " + self.CFLAGS
148-
self.LD = llddir + "ld.lld -maarch64elf"
148+
self.LD = llddir + "ld.lld -maarch64elf --pie"
149149
self.OBJCOPY = clangdir + "llvm-objcopy"
150150
self.OBJDUMP = clangdir + "llvm-objdump"
151151
self.NM = clangdir + "llvm-nm"

tests/python/test_proxyclient/test_m1n1/test_toolchain.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class TestToolchain:
5555
"use_clang": True,
5656
"has_brew": True,
5757
"CC": "/opt/homebrew/opt/llvm/bin/clang --target=aarch64-linux-gnu- -pipe -Wall -march=armv8.4-a",
58-
"LD": "/opt/homebrew/opt/lld/bin/ld.lld -maarch64elf",
58+
"LD": "/opt/homebrew/opt/lld/bin/ld.lld -maarch64elf --pie",
5959
"OBJCOPY": "/opt/homebrew/opt/llvm/bin/llvm-objcopy",
6060
"OBJDUMP": "/opt/homebrew/opt/llvm/bin/llvm-objdump",
6161
"NM": "/opt/homebrew/opt/llvm/bin/llvm-nm",
@@ -100,7 +100,7 @@ class TestToolchain:
100100
"use_clang": True,
101101
"has_brew": True,
102102
"CC": "/usr/local/opt/llvm/bin/clang --target=aarch64-linux-gnu- -pipe -Wall -march=armv8.4-a",
103-
"LD": "/usr/local/opt/lld/bin/ld.lld -maarch64elf",
103+
"LD": "/usr/local/opt/lld/bin/ld.lld -maarch64elf --pie",
104104
"OBJCOPY": "/usr/local/opt/llvm/bin/llvm-objcopy",
105105
"OBJDUMP": "/usr/local/opt/llvm/bin/llvm-objdump",
106106
"NM": "/usr/local/opt/llvm/bin/llvm-nm",
@@ -115,7 +115,7 @@ class TestToolchain:
115115
"use_clang": True,
116116
"has_brew": False,
117117
"CC": "/usr/local/bin/clang --target=aarch64-none-elf- -pipe -Wall -march=armv8.4-a",
118-
"LD": "/usr/local/bin/ld.lld -maarch64elf",
118+
"LD": "/usr/local/bin/ld.lld -maarch64elf --pie",
119119
"OBJCOPY": "/usr/local/bin/llvm-objcopy",
120120
"OBJDUMP": "/usr/local/bin/llvm-objdump",
121121
"NM": "/usr/local/bin/llvm-nm",
@@ -130,7 +130,7 @@ class TestToolchain:
130130
"use_clang": True,
131131
"has_brew": False,
132132
"CC": "/usr/local/bin/clang --target=aarch64-none-elf- -pipe -Wall -march=armv8.4-a",
133-
"LD": "/usr/local/bin/ld.lld -maarch64elf",
133+
"LD": "/usr/local/bin/ld.lld -maarch64elf --pie",
134134
"OBJCOPY": "/usr/local/bin/llvm-objcopy",
135135
"OBJDUMP": "/usr/local/bin/llvm-objdump",
136136
"NM": "/usr/local/bin/llvm-nm",

0 commit comments

Comments
 (0)