Skip to content

Commit 29ee4b4

Browse files
authored
Merge pull request #6425 from Arthapz/fix-ld-autotools
(autotools) fix ld override when ld binary is not in the same directo…
2 parents 173069f + c295751 commit 29ee4b4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

xmake/modules/package/tools/autoconf.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,14 @@ function buildenvs(package, opt)
449449
name = name:gsub("gcc-%d+", "ld")
450450
name = name:gsub("g%+%+$", "ld")
451451
name = name:gsub("g%+%+%-%d+", "ld")
452-
envs.LD = dir and path.join(dir, name) or name
452+
if dir and os.isfile(path.join(dir, name)) then
453+
envs.LD = path.join(dir, name)
454+
else
455+
local ld = find_tool("ld")
456+
if ld and path.filename(ld.program) == name then
457+
envs.LD = ld.program
458+
end
459+
end
453460
end
454461
-- we need use clang++ as cxx, autoconf will use it as linker
455462
-- https://github.com/xmake-io/xmake/issues/2170

0 commit comments

Comments
 (0)