Closed mcourteaux closed 3 weeks ago
I'm currently sitting on this patch:
diff --git a/cmake/config.cmake b/cmake/config.cmake
index 1367f9a5..4517b5a7 100644
--- a/cmake/config.cmake
+++ b/cmake/config.cmake
@@ -40,9 +40,11 @@ if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug" AND NOT EMSCRIPTEN)
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT EMSCRIPTEN)
- find_program(MOLD_LINKER mold)
- if(MOLD_LINKER)
- set(CMAKE_LINKER_TYPE "MOLD")
+ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ find_program(MOLD_LINKER mold)
+ if(MOLD_LINKER)
+ set(CMAKE_LINKER_TYPE "MOLD")
+ endif()
endif()
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_options(-fno-eliminate-unused-debug-types)
@@ -51,4 +53,4 @@ endif()
file(GENERATE OUTPUT .gitignore CONTENT "*")
-set(CMAKE_COLOR_DIAGNOSTICS ON)
\ No newline at end of file
+set(CMAKE_COLOR_DIAGNOSTICS ON)
diff --git a/cmake/vendor.cmake b/cmake/vendor.cmake
index a2a9dedf..8d9a7464 100644
--- a/cmake/vendor.cmake
+++ b/cmake/vendor.cmake
@@ -47,6 +47,7 @@ else()
"CAPSTONE_RISCV_SUPPORT OFF"
"CAPSTONE_SH_SUPPORT OFF"
"CAPSTONE_XTENSA_SUPPORT OFF"
+ "CAPSTONE_BUILD_MACOS_THIN ON"
EXCLUDE_FROM_ALL TRUE
)
add_library(TracyCapstone INTERFACE)
but I'm not sure what to do if you already have capstone installed instead of doing it through CPM. I hope it doesn't import the fat-compiling settings into Tracy in that case.
Fixed by caa61de5406951 and ee06542f1f543.
I spent quite a while trying to compile the server. Observations:
capstone automatically enables "fat" compiling (enabling both
x86_64
andarm64
), which breaks entirely on my system. Running cmake with-DCAPSTONE_BUILD_MACOS_THIN=ON
resolves that. Now it'll only compile the native architecture. I guess this is what we want, so I think it makes sense to set this property from Tracy's CMakeList already.Mold is not supported on macOS and is instead aliased by sold. However, the latest
sold
commit still causes linker errors. I found the auther declaring thatsold
is no longer active: https://github.com/bluewhalesystems/sold/issues/57#issuecomment-2392722829. Pretty much all symbols are marked as not found. So I propose to only use mold on Linux. Here is small excerpt ofsold
output:sold linker output
The default compiler (AppleClang 14.0.0.14000029) on my system (macOS 12.7.6, up-to-date) does not support
-fexperimental-library
. I have to use clang from HomeBrew to get it working.