Skip to content

Commit 7badf1e

Browse files
committed
tc_build: kernel: Use ld.lld as host linker when possible
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
1 parent 8fcfd58 commit 7badf1e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tc_build/kernel.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ def build(self):
4444
if self.can_use_clang_as_hostcc():
4545
if 'CC' in self.make_variables:
4646
self.make_variables['HOSTCC'] = self.make_variables['CC']
47+
if self.can_use_lld_as_hostld():
48+
self.make_variables['HOSTLDFLAGS'] = '-fuse-ld=lld'
4749
else:
4850
self.make_variables['HOSTCC'] = 'gcc'
4951
self.make_variables['HOSTCXX'] = 'g++'
@@ -138,6 +140,9 @@ def get_toolchain_version(self):
138140
def can_use_clang_as_hostcc(self):
139141
return self._run_clang('-c')
140142

143+
def can_use_lld_as_hostld(self):
144+
return self._run_clang('-fuse-lld')
145+
141146
def needs_binutils(self):
142147
return not self.can_use_ias()
143148

0 commit comments

Comments
 (0)