mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-03 21:23:48 +00:00
[PR #2042] [MERGED] fix(build): resolve Rust-to-C linking issues on Linux #2849
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/CCExtractor/ccextractor/pull/2042
Author: @cfsmp3
Created: 1/19/2026
Status: ✅ Merged
Merged: 1/19/2026
Merged by: @cfsmp3
Base:
master← Head:fix/cmake-rust-linking📝 Commits (2)
2352ea2fix(build): resolve Rust-to-C linking issues on Linuxdf90009ci: add CMakeLists.txt to workflow path filters📊 Changes
6 files changed (+27 additions, -2 deletions)
View changed files
📝
.github/workflows/build_docker.yml(+4 -0)📝
.github/workflows/build_linux.yml(+4 -0)📝
.github/workflows/build_mac.yml(+4 -0)📝
.github/workflows/build_windows.yml(+4 -0)📝
src/CMakeLists.txt(+9 -0)📝
src/lib_ccx/CMakeLists.txt(+2 -2)📄 Description
Summary
Problem
On Linux, the build fails with undefined reference errors:
These C functions are defined in
libccx.abut called fromccx_rust(Rust library). With static libraries, the linker processes them in order and only pulls symbols that are currently unresolved. Sinceccxis processed beforeccx_rust, these symbols weren't being included.Solution
CMAKE_C_FLAGS preservation: Change
set(CMAKE_C_FLAGS "...")toset(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ...")so build systems can pass additional flags.Force undefined symbols: Add
target_link_optionswith-Wl,--undefined=<symbol>to force the linker to mark these symbols as needed before processinglibccx.a.Test plan
ccextractor --versionruns without errors🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.