From 6bc371cd9358386db230f6d8caff57c897bbaf1f Mon Sep 17 00:00:00 2001 From: Elias Bachaalany Date: Wed, 4 Mar 2026 22:38:32 -0500 Subject: [PATCH] fix: swap ida/idalib link order to fix macOS SIGSEGV MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both stub dylibs export overlapping symbols (qvector_reserve, qalloc_or_throw, qfree, qsnprintf — 184 total), but at runtime only libida.dylib actually provides them. With idalib listed first, the macOS two-level namespace linker binds these symbols to libidalib, which doesn't export them at runtime. This causes all IDA memory functions to resolve to a dyld fallback address, resulting in SIGSEGV on any qstring construction. Fix: link libida before libidalib so overlapping symbols bind to the library that actually exports them. --- idasdkConfig.cmake | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/idasdkConfig.cmake b/idasdkConfig.cmake index fd8007b..7cc5576 100644 --- a/idasdkConfig.cmake +++ b/idasdkConfig.cmake @@ -143,12 +143,15 @@ if(NOT TARGET idasdk::idalib) ) # Link to platform and compiler settings, plus BOTH idalib and ida libraries - # Note: idalib.lib requires ida.lib for some symbols + # Note: ida must come BEFORE idalib because both stubs export overlapping + # symbols (qvector_reserve, qalloc_or_throw, qfree, etc.), but at runtime + # only libida actually provides them. Wrong order causes two-level namespace + # binding failures on macOS. target_link_libraries(idasdk::idalib INTERFACE ida_platform_settings ida_compiler_settings - "${IDALIB_PATH}" - "${IDA_LIB_PATH}") + "${IDA_LIB_PATH}" + "${IDALIB_PATH}") endif() # Debugger module support (optional, disabled by default)