Skip to content

Allow overriding linker flags#406

Merged
superg merged 1 commit into
superg:mainfrom
ypsvlq:dynamic
Jul 5, 2026
Merged

Allow overriding linker flags#406
superg merged 1 commit into
superg:mainfrom
ypsvlq:dynamic

Conversation

@ypsvlq

@ypsvlq ypsvlq commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Allows dynamic linking, which is required for packaging in some Linux distributions.

Summary by CodeRabbit

  • New Features

    • Linux builds are now configurable to override the default static-linking behavior, allowing dynamically linked binaries when desired.
  • Bug Fixes

    • Improved build flexibility by letting linker flags be set via the CMake cache, instead of being fixed to -static, helping compatibility across different environments.

@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

CMakeLists.txt now uses a cache string variable for the Linux linker flags applied to redumper, with -static remaining the default value.

Changes

Build Configuration

Layer / File(s) Summary
Make redumper linker flags configurable
CMakeLists.txt
REDUMPER_LINKER_FLAGS is added as a CMake cache string with default -static, and redumper now uses that variable in target_link_options on Linux.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: making linker flags overridable instead of hardcoded.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
CMakeLists.txt (1)

233-233: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider adding a short help-text clarification.

The option's description "Link binary dynamically" doesn't mention it's Linux-specific or that it only affects the -static linker flag being skipped. A slightly more descriptive help string (e.g., mentioning it disables static linking on Linux) would aid users configuring the build via cmake-gui/ccmake.

✏️ Optional wording tweak
-    option(REDUMPER_DYNAMIC "Link binary dynamically" OFF)
+    option(REDUMPER_DYNAMIC "Link redumper dynamically instead of statically (useful for distro packaging)" OFF)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CMakeLists.txt` at line 233, The REDUMPER_DYNAMIC option help text is too
generic and should clarify its scope. Update the option declaration for
REDUMPER_DYNAMIC to mention that it is Linux-specific and that it disables
skipping the -static linker flag, so users configuring via cmake-gui or ccmake
understand the effect. Keep the change limited to the option description string
in CMakeLists.txt.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@CMakeLists.txt`:
- Line 233: The REDUMPER_DYNAMIC option help text is too generic and should
clarify its scope. Update the option declaration for REDUMPER_DYNAMIC to mention
that it is Linux-specific and that it disables skipping the -static linker flag,
so users configuring via cmake-gui or ccmake understand the effect. Keep the
change limited to the option description string in CMakeLists.txt.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f7fef59c-7f6d-4527-91be-f72d61a04479

📥 Commits

Reviewing files that changed from the base of the PR and between cbf7c9b and c48e45b.

📒 Files selected for processing (1)
  • CMakeLists.txt

Comment thread CMakeLists.txt Outdated
@ypsvlq ypsvlq changed the title Add option for dynamic Linux build Allow overriding linker flags Jul 5, 2026
@superg superg merged commit dcfc696 into superg:main Jul 5, 2026
11 checks passed
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.

2 participants