Rearranged --start-group --end-group to enclose only the user libs.

This commit is contained in:
Manu Evans 2016-07-08 14:27:54 +10:00
parent ab1b4edcb7
commit a2b5fa727d
2 changed files with 8 additions and 16 deletions

View File

@ -239,8 +239,8 @@
-- A list of libraries to link, decorated for the linker.
--
function clang.getlinks(cfg, systemonly)
return gcc.getlinks(cfg, systemonly)
function clang.getlinks(cfg, systemonly, nogroups)
return gcc.getlinks(cfg, systemonly, nogroups)
end

View File

@ -276,7 +276,7 @@
-- Return the list of libraries to link, decorated with flags as needed.
--
function gcc.getlinksonly(cfg, systemonly)
function gcc.getlinks(cfg, systemonly, nogroups)
local result = {}
if not systemonly then
@ -296,6 +296,11 @@
end
end
if not nogroups and #result > 1 and (cfg.linkgroups == p.ON) then
table.insert(result, 1, "-Wl,--start-group")
table.insert(result, "-Wl,--end-group")
end
-- The "-l" flag is fine for system libraries
local links = config.getlinks(cfg, "system", "fullpath")
@ -313,19 +318,6 @@
end
function gcc.getlinks(cfg, systemonly)
local result = gcc.getlinksonly(cfg, systemonly)
if (#result > 1) and (cfg.linkgroups == p.ON) then
local res = {}
table.insert(res, '-Wl,--start-group')
table.insertflat(res, result)
table.insert(res, '-Wl,--end-group')
return res
end
return result
end
--
-- Returns makefile-specific configuration rules.
--