Index: build/premake/premake5.lua =================================================================== --- build/premake/premake5.lua +++ build/premake/premake5.lua @@ -1006,6 +1006,12 @@ end if os.istarget("linux") or os.getversion().description == "GNU/kFreeBSD" then + local _, errorCode = os.outputof(cc .. " ./tests/execinfo.c") + if errorCode ~= 0 then + links { + "execinfo" + } + end links { -- Dynamic libraries (needed for linking for gold) "dl", @@ -1390,6 +1396,12 @@ end if os.istarget("linux") or os.getversion().description == "GNU/kFreeBSD" then + local _, errorCode = os.outputof(cc .. " ./tests/execinfo.c") + if errorCode ~= 0 then + links { + "execinfo" + } + end links { -- Dynamic libraries (needed for linking for gold) "dl", Index: build/premake/tests/execinfo.c =================================================================== --- /dev/null +++ build/premake/tests/execinfo.c @@ -0,0 +1,6 @@ +#include + +int main() { + backtrace(0, 0); + return 0; +}