Skip to content

Fix GNU toolchain compatibility with direct object linking (Continuation of #11) - #54

Open
kkua wants to merge 2 commits into
BenjaminRi:masterfrom
kkua:feat-multi-bin
Open

Fix GNU toolchain compatibility with direct object linking (Continuation of #11)#54
kkua wants to merge 2 commits into
BenjaminRi:masterfrom
kkua:feat-multi-bin

Conversation

@kkua

@kkua kkua commented Sep 3, 2026

Copy link
Copy Markdown

🚀 Summary

This PR is a continuation of the work started by @arihant2math in #11. It adds support for multiple executables and fixes the GNU toolchain compatibility issues reported by the maintainer.

🛠️ Changes & Fixes

I have rebased the original changes onto the latest main branch and applied the following fixes:

  1. Fixed GNU Toolchain Compatibility (Solution from Rust 1.61 in Linux does no add resources to the EXE mxre/winres#40)

    Inspired by the solution proposed by @rodrigorc in , instead of relying on --whole-archive (which is not supported by x86_64-w64-mingw32-gcc), we now pass the object file path directly via cargo:rustc-link-args.
    println!("cargo:rustc-link-args={}", output.display());

This forces the linker to unconditionally include the object file in the EXE, without needing --whole-archive.

🤝 Credits

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