Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: link modifiers combination +bundle,+whole-archive is unstable when generating rlibs #519

Closed
CarlSchwan opened this issue Apr 27, 2023 · 11 comments · Fixed by #520
Closed
Assignees
Labels
🪲 bug Something isn't working

Comments

@CarlSchwan
Copy link

CarlSchwan commented Apr 27, 2023

Compiling qml-features v0.1.0 (/home/cschwan/kde/cxx-qt/examples/qml_features/rust)
error: link modifiers combination `+bundle,+whole-archive` is unstable when generating rlibs

tested with rust from the fedora repo and from rustup.

@ahayzen-kdab ahayzen-kdab added the 🪲 bug Something isn't working label Apr 27, 2023
@ahayzen-kdab
Copy link
Collaborator

So looking at https://doc.rust-lang.org/rustc/command-line-arguments.html#-l-link-the-generated-crate-to-a-native-library +bundle is set by default, so that is likely where that is set.

Then we are normally building to staticlib with the Rust parts, i wonder which part specifically is being built to an rlib and if that's a problem.

This from initial investigation seems to have broken via a newer rustc ?

@ahayzen-kdab
Copy link
Collaborator

Manually setting cc_builder_whole_archive.link_lib_modifier("-bundle"); to still allow +whole-archive solves the issue.

But we need to check that

  • Is it right that a rlib is being built there?
  • Is setting -bundle OK or does that cause other problems?

@Be-ing ^^ any opinions ?

ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Apr 27, 2023
Otherwise the build fails with

link modifiers combination `+bundle,+whole-archive` is unstable when generating rlibs

Closes KDAB#519
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Apr 27, 2023
Otherwise the build fails with the following error with rustc 1.69

link modifiers combination `+bundle,+whole-archive` is unstable when generating rlibs

Closes KDAB#519
@Be-ing
Copy link
Contributor

Be-ing commented Apr 27, 2023

rust-lang/rust#108081 🤔

ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Apr 27, 2023
Otherwise the build fails with the following error with rustc 1.69

link modifiers combination `+bundle,+whole-archive` is unstable when generating rlibs

Closes KDAB#519
ahayzen-kdab added a commit that referenced this issue Apr 27, 2023
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
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Apr 27, 2023
Otherwise the build fails with the following error with rustc 1.69

link modifiers combination `+bundle,+whole-archive` is unstable when generating rlibs

Closes KDAB#519
@Be-ing
Copy link
Contributor

Be-ing commented Apr 27, 2023

This is caused by a regression in rustc 1.69: rust-lang/rust#110912

Reopening this until the upstream issue is fixed

@Be-ing Be-ing reopened this Apr 27, 2023
@Be-ing Be-ing changed the title Can not build anymore error: link modifiers combination +bundle,+whole-archive is unstable when generating rlibs Apr 27, 2023
@Be-ing Be-ing self-assigned this Apr 27, 2023
ahayzen-kdab added a commit that referenced this issue Apr 27, 2023
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
@Be-ing
Copy link
Contributor

Be-ing commented Apr 27, 2023

Upstream fix: rust-lang/rust#110917

@Be-ing
Copy link
Contributor

Be-ing commented May 1, 2023

Fix was merged upstream and will be in Rust 1.71 and maybe 1.70.

@Be-ing Be-ing closed this as completed May 1, 2023
@ahayzen-kdab
Copy link
Collaborator

@Be-ing do we want to leave this open as a reminder to remove the workaround ? And also do we want to remove the workaround at some point ? How long should we wait for people to move on from 1.69 to 1.70+ ? Or is it even possible to have a cfg flag for a specific rustc version ?

@Be-ing
Copy link
Contributor

Be-ing commented May 1, 2023

The workaround is harmless AFAIK, so we might as well leave it forever.

@ahayzen-kdab
Copy link
Collaborator

Cool, just wanted to check :-)

@Be-ing
Copy link
Contributor

Be-ing commented May 1, 2023

We could remove the workaround if we raise the MSRV to >= 1.70 in the future (or 1.71 if the fix doesn't make it into 1.70).

@Be-ing
Copy link
Contributor

Be-ing commented May 8, 2023

rust-lang/rust#110917 was approved for backporting to 1.70.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪲 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants