Index: ps/trunk/binaries/data/mods/public/gui/credits/texts/programming.json =================================================================== --- ps/trunk/binaries/data/mods/public/gui/credits/texts/programming.json +++ ps/trunk/binaries/data/mods/public/gui/credits/texts/programming.json @@ -168,6 +168,7 @@ { "nick": "myconid" }, { "nick": "nani", "name": "S. N." }, { "nick": "nd3c3nt", "name": "Gavin Fowler" }, + { "nick": "nephele" }, { "nick": "Nescio" }, { "nick": "niektb", "name": "Niek ten Brinke" }, { "nick": "njm" }, Index: ps/trunk/build/premake/premake5.lua =================================================================== --- ps/trunk/build/premake/premake5.lua +++ ps/trunk/build/premake/premake5.lua @@ -90,6 +90,19 @@ end end +-- Test whether we need to link libexecinfo. +-- This is mostly the case on musl systems, as well as on BSD systems : only glibc provides the +-- backtrace symbols we require in the libc, for other libcs we use the libexecinfo library. +local link_execinfo = false +if os.istarget("bsd") then + link_execinfo = true +elseif os.istarget("linux") then + local _, link_errorCode = os.outputof(cc .. " ./tests/execinfo.c -o /dev/null") + if link_errorCode ~= 0 then + link_execinfo = true + end +end + -- Set up the Workspace workspace "pyrogenesis" targetdir(rootdir.."/binaries/system") @@ -1005,16 +1018,17 @@ links { "log" } end + if link_execinfo then + links { + "execinfo" + } + end + if os.istarget("linux") or os.getversion().description == "GNU/kFreeBSD" then links { -- Dynamic libraries (needed for linking for gold) "dl", } - elseif os.istarget("bsd") then - links { - -- Needed for backtrace* on BSDs - "execinfo", - } end -- Threading support @@ -1380,6 +1394,11 @@ elseif os.istarget("linux") or os.istarget("bsd") then + if link_execinfo then + links { + "execinfo" + } + end if not _OPTIONS["android"] and not (os.getversion().description == "OpenBSD") then links { "rt" } end @@ -1394,11 +1413,6 @@ -- Dynamic libraries (needed for linking for gold) "dl", } - elseif os.istarget("bsd") then - links { - -- Needed for backtrace* on BSDs - "execinfo", - } end -- Threading support Index: ps/trunk/build/premake/tests/execinfo.c =================================================================== --- ps/trunk/build/premake/tests/execinfo.c +++ ps/trunk/build/premake/tests/execinfo.c @@ -0,0 +1,6 @@ +#include + +int main() { + backtrace(0, 0); + return 0; +}