Skip to content

Commit

Permalink
fix Xlinker rpath linker flags deduplication
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthapz committed Nov 1, 2024
1 parent c6bb229 commit a64735d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion xmake/core/tool/compiler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ function compiler:build(sourcefiles, targetfile, opt)
opt = opt or {}

-- get compile flags
local compflags = opt.compflags
local compflags = opt.compflags and self:_preprocess_flags(opt.compflags)
if not compflags then
-- patch sourcefile to get flags of the given source file
if type(sourcefiles) == "string" then
Expand Down
2 changes: 1 addition & 1 deletion xmake/core/tool/linker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ end
-- link the target file
function linker:link(objectfiles, targetfile, opt)
opt = opt or {}
local linkflags = opt.linkflags or self:linkflags(opt)
local linkflags = opt.linkflags and self:_preprocess_flags(opt.linkflags) or self:linkflags(opt)
opt = table.copy(opt)
opt.target = self:target()
profiler:enter(self:name(), "link", targetfile)
Expand Down
2 changes: 1 addition & 1 deletion xmake/modules/core/tools/gcc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ function nf_rpathdir(self, dir, opt)
end
return flags
elseif self:has_flags("-Xlinker -rpath -Xlinker " .. dir, "ldflags") then
return {"-Xlinker", "-rpath", "-Xlinker", (dir:gsub("%$ORIGIN", "@loader_path"))}
return {"-Xlinker -rpath", "-Xlinker " .. (dir:gsub("%$ORIGIN", "@loader_path"))}
end
end

Expand Down

0 comments on commit a64735d

Please sign in to comment.