From 1471eea6e5b4395beed24bfdf241908b4f8857f7 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Mon, 21 Apr 2025 00:01:42 +0200 Subject: [PATCH] Fix compile error and the backtrace (sorta, still sucks) for Linux --- src/CMakeLists.txt | 4 ++++ src/common/console/c_console.cpp | 3 ++- src/common/scripting/jit/jit_runtime.cpp | 19 ++++++++++++++++++- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 806e92289..405838fae 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1461,6 +1461,10 @@ if( APPLE ) # Dymanic libraries like libvulkan.dylib or libMoltenVK.dylib will be loaded by dlopen() # if placed in the directory with the main executable set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rpath @executable_path" ) +elseif(UNIX) + # backtrace wants -rdynamic to print friendly names. + # We should consider switching to libbacktrace as it reads DWARF debug info instead of staying with the API from 1865... + set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rdynamic" ) endif() if( WIN32 ) diff --git a/src/common/console/c_console.cpp b/src/common/console/c_console.cpp index 41c86abd7..f9f79768a 100644 --- a/src/common/console/c_console.cpp +++ b/src/common/console/c_console.cpp @@ -66,6 +66,7 @@ #include "c_commandbuffer.h" #include "vm.h" #include "common/widgets/errorwindow.h" +#include #define LEFTMARGIN 8 #define RIGHTMARGIN 8 @@ -425,7 +426,7 @@ void GetLog(std::function