From ebf5b87ea44d276d45f37da761a9f11e5ab3be5d Mon Sep 17 00:00:00 2001 From: Andrew Hayzen Date: Thu, 27 Apr 2023 15:38:23 +0100 Subject: [PATCH] cxx-qt-build: unset bundle for link modifiers Otherwise the build fails with the following error with rustc 1.69 link modifiers combination `+bundle,+whole-archive` is unstable when generating rlibs Closes #519 --- CHANGELOG.md | 4 ++++ crates/cxx-qt-build/src/lib.rs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30d504f84..9487419cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased](https://github.com/KDAB/cxx-qt/compare/v0.5.1...HEAD) +### Fixed + +- Builds failing due to `link modifiers combination +bundle,+whole-archive is unstable when generating rlibs` + ## [0.5.1](https://github.com/KDAB/cxx-qt/compare/v0.5.0...v0.5.1) - 2023-03-30 ### Fixed diff --git a/crates/cxx-qt-build/src/lib.rs b/crates/cxx-qt-build/src/lib.rs index a93760068..04f35fe6a 100644 --- a/crates/cxx-qt-build/src/lib.rs +++ b/crates/cxx-qt-build/src/lib.rs @@ -411,6 +411,10 @@ impl CxxQtBuilder { // to avoid bloating the binary. let mut cc_builder_whole_archive = cc::Build::new(); cc_builder_whole_archive.link_lib_modifier("+whole-archive"); + // We need to set -bundle otherwise the compiler fails with + // link modifiers combination `+bundle,+whole-archive` is unstable when generating rlibs + // https://github.com/rust-lang/rust/issues/108081 + cc_builder_whole_archive.link_lib_modifier("-bundle"); for builder in [&mut self.cc_builder, &mut cc_builder_whole_archive] { builder.cpp(true); // MSVC