Merged
Conversation
The idasql static library linked idasdk::idalib as PUBLIC, forcing all consumers — including the IDA plugin — to transitively link libidalib.dylib. The plugin runs inside IDA GUI and should only link libida.dylib (via idasdk::plugin). libidalib is strictly for standalone programs. Two changes working together: 1. CMake: Replace idasdk::idalib with compilation-only targets (ida_compiler_settings, ida_platform_settings) plus SDK include path. No SDK library linkage on the static lib — each consumer already gets the right SDK target from its own cmake macro. 2. TU split: Extract Session implementation into session.cpp. Session is the only code with idalib symbol references (init_library, open_database, close_database). When the plugin links the static archive, no plugin code references Session symbols, so session.o is never pulled in and idalib symbols never need resolution.
Decouples idasql from ida-sdk's submodule pin of ida-cmake. This gives us immediate control over build fixes (e.g. link order) without waiting for upstream ida-sdk to update its submodule.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
libidalibfrom the IDA plugin binary. The static library (liblibidasql.a) no longer linksidasdk::idalib— it only uses compilation-only targets (ida_compiler_settings,ida_platform_settings) plus SDK include paths. Each consumer brings its own SDK target.Sessionimplementation intosession.cpp. Session is the only code with idalib symbol references (init_library,open_database,close_database). When the plugin links the static archive,session.ois never pulled in — the idalib symbols never need resolution.ida_add_idalib()/ida_add_plugin().Before
All three platform plugin binaries (
.dll,.so,.dylib) unnecessarily linkedlibidalib.After
libida.dylibonly — nolibidaliblibida.dylibandlibidalib.dylib(as expected)Verified locally on macOS:
Test plan
idasql -s <db> -q "SELECT * FROM welcome"succeeds