summaryrefslogtreecommitdiff
path: root/xmake/rules/platform/linux/driver
diff options
context:
space:
mode:
authorruki <[email protected]>2021-12-11 10:12:33 +0800
committerruki <[email protected]>2021-12-11 10:12:33 +0800
commitb2e2bf3bfb508bdff576a6eea3b8928d4d9ae50b (patch)
tree5692600dd51938f4d8ad564466f98f9913400eae /xmake/rules/platform/linux/driver
parenta64f493f3b6812bef7f78fa973f11cc963d1b8a3 (diff)
find ld
Diffstat (limited to 'xmake/rules/platform/linux/driver')
-rw-r--r--xmake/rules/platform/linux/driver/driver_modules.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/xmake/rules/platform/linux/driver/driver_modules.lua b/xmake/rules/platform/linux/driver/driver_modules.lua
index 7addb3764..47d5dcf54 100644
--- a/xmake/rules/platform/linux/driver/driver_modules.lua
+++ b/xmake/rules/platform/linux/driver/driver_modules.lua
@@ -21,6 +21,7 @@
-- imports
import("core.base.option")
import("core.project.depend")
+import("lib.detect.find_tool")
import("utils.progress")
import("private.tools.ccache")
@@ -162,6 +163,9 @@ function link(target, opt)
assert(modpost and os.isfile(modpost), "scripts/mod/modpost not found!")
assert(ldscriptfile and os.isfile(ldscriptfile), "scripts/module.lds not found!")
+ -- get ld
+ local ld = assert(find_tool("ld"), "ld not found!")
+
-- link target.o
local argv = {"-m"}
if target:is_arch("x86_64") then
@@ -173,7 +177,7 @@ function link(target, opt)
table.insert(argv, targetfile_o)
table.join2(argv, objectfiles)
os.mkdir(path.directory(targetfile_o))
- os.vrunv("ld", argv)
+ os.vrunv(ld.program, argv)
-- generate target.mod
local targetfile_mod = targetfile_o:gsub("%.o$", ".mod")
@@ -219,7 +223,7 @@ function link(target, opt)
table.insert(argv, targetfile_o)
table.insert(argv, targetfile_mod_o)
os.mkdir(path.directory(targetfile))
- os.vrunv("ld", argv)
+ os.vrunv(ld.program, argv)
end, {dependfile = dependfile, lastmtime = os.mtime(target:targetfile()), files = objectfiles})
end