Skip to content

Support new and legacy IDA SDK library layouts regardless of version#59

Merged
srgblv merged 3 commits into
KasperskyLab:masterfrom
reo101:refactor/ida_plugin
Jul 7, 2026
Merged

Support new and legacy IDA SDK library layouts regardless of version#59
srgblv merged 3 commits into
KasperskyLab:masterfrom
reo101:refactor/ida_plugin

Conversation

@reo101

@reo101 reo101 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR updates ida_plugin.cmake to support newer IDA SDK library layouts while keeping compatibility with older SDKs.

Features

  • Add Linux aarch64 host detection mapped to IDA SDK arm64 dirs

Note

Only relevant on versions of IDA SDK which include HexRaysSA/ida-sdk#39

Changes

  • Detect IDA SDK library directory layouts with EXISTS instead of relying on SDK version guesses
  • Support these layouts:
    • x64_linux_64
    • x64_linux_gcc_64
    • x64_linux_gcc_64_pro
    • same pattern for Windows/macOS and 32-bit dirs
  • Remove global non-MSVC -flto; linking already passes LTO flags where needed
  • Centralize TARGET_LINK_LIBRARIES selection across platforms
  • Add explicit errors for unsupported platforms and missing SDK libs
  • Normalize formatting in ida_plugin.cmake

Testing

Tested with a CMake matrix covering:

  • Windows, macOS, Linux
  • x64 and arm64/aarch64 where applicable
  • plain, compiler-suffixed, and _pro SDK layouts
  • UNI64=ON and UNI64=OFF

Also verified the plugin builds with IDA SDK 9.3 on Linux.

reo101 and others added 3 commits July 7, 2026 16:52
- Remove global `-flto` from `src/CMakeLists.txt`
- Detect compiler-less IDA SDK library directories
- Add Linux `aarch64` mapping to IDA `arm64` library paths
- Keep compiler suffixes for older SDK library layouts

Co-authored-by: Dimitar Kolev <dimitarkolev@tutanota.com>
- Normalize directive spacing and indentation in `src/ida_plugin.cmake`
- Align target and link calls without changing CMake behavior

Co-authored-by: Dimitar Kolev <dimitarkolev@tutanota.com>
- Move platform branches to set architecture, platform, compiler,
  and link metadata
- Probe `plain`, `compiler`, and `compiler_pro` SDK layouts
  with `EXISTS`
- Validate selected SDK library paths before linking
- Reject unsupported `CMAKE_SYSTEM_NAME` values explicitly
- Share `TARGET_LINK_LIBRARIES` calls across supported platforms

Co-authored-by: Dimitar Kolev <dimitarkolev@tutanota.com>
@srgblv srgblv self-assigned this Jul 7, 2026

@srgblv srgblv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job. Thank you

@srgblv
srgblv merged commit 6202adf into KasperskyLab:master Jul 7, 2026
9 checks passed
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants