-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
+whole-archive link modifier causes build failure on staticlib crate with Rust 1.69 #110912
Labels
A-linkage
Area: linking into static, shared libraries and binaries
C-bug
Category: This is a bug.
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
Comments
Be-ing
added
C-bug
Category: This is a bug.
regression-untriaged
Untriaged performance or correctness regression.
labels
Apr 27, 2023
rustbot
added
the
I-prioritize
Issue: Indicates that prioritization has been requested for this issue.
label
Apr 27, 2023
Noratrieb
added
the
A-linkage
Area: linking into static, shared libraries and binaries
label
Apr 28, 2023
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Apr 28, 2023
…b_fix, r=petrochenkov only error combining +whole-archive and +bundle for rlibs Fixes rust-lang#110912 Checking `flavor == RlibFlavor::Normal` was accidentally lost in 601fc8b rust-lang#105601 That caused combining +whole-archive and +bundle link modifiers on non-rlib crates to fail with a confusing error message saying that combination is unstable for rlibs. In particular, this caused the build to fail when +whole-archive was used on staticlib crates, even though +whole-archive effectively does nothing on non-bin crates because the final linker invocation is left to an external build system. cc `@petrochenkov`
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Apr 28, 2023
…b_fix, r=petrochenkov only error combining +whole-archive and +bundle for rlibs Fixes rust-lang#110912 Checking `flavor == RlibFlavor::Normal` was accidentally lost in 601fc8b rust-lang#105601 That caused combining +whole-archive and +bundle link modifiers on non-rlib crates to fail with a confusing error message saying that combination is unstable for rlibs. In particular, this caused the build to fail when +whole-archive was used on staticlib crates, even though +whole-archive effectively does nothing on non-bin crates because the final linker invocation is left to an external build system. cc ``@petrochenkov``
RalfJung
pushed a commit
to RalfJung/miri
that referenced
this issue
Apr 30, 2023
…petrochenkov only error combining +whole-archive and +bundle for rlibs Fixes rust-lang/rust#110912 Checking `flavor == RlibFlavor::Normal` was accidentally lost in 601fc8b36b1962285e371cf3c54eeb3b1b9b3a74 rust-lang/rust#105601 That caused combining +whole-archive and +bundle link modifiers on non-rlib crates to fail with a confusing error message saying that combination is unstable for rlibs. In particular, this caused the build to fail when +whole-archive was used on staticlib crates, even though +whole-archive effectively does nothing on non-bin crates because the final linker invocation is left to an external build system. cc ``@petrochenkov``
apiraino
removed
the
I-prioritize
Issue: Indicates that prioritization has been requested for this issue.
label
May 2, 2023
pnkfelix
added
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
and removed
regression-untriaged
Untriaged performance or correctness regression.
labels
May 4, 2023
rustbot
added
the
I-prioritize
Issue: Indicates that prioritization has been requested for this issue.
label
May 4, 2023
apiraino
removed
the
I-prioritize
Issue: Indicates that prioritization has been requested for this issue.
label
May 4, 2023
Mark-Simulacrum
pushed a commit
to Mark-Simulacrum/rust
that referenced
this issue
May 6, 2023
Fixes rust-lang#110912 Checking `flavor == RlibFlavor::Normal` was accidentally lost in 601fc8b rust-lang#105601 That caused combining +whole-archive and +bundle link modifiers on non-rlib crates to fail with a confusing error message saying that combination is unstable for rlibs. In particular, this caused the build to fail when +whole-archive was used on staticlib crates, even though +whole-archive effectively does nothing on non-bin crates because the final linker invocation is left to an external build system.
MabezDev
pushed a commit
to esp-rs/rust
that referenced
this issue
May 30, 2023
Fixes rust-lang#110912 Checking `flavor == RlibFlavor::Normal` was accidentally lost in 601fc8b rust-lang#105601 That caused combining +whole-archive and +bundle link modifiers on non-rlib crates to fail with a confusing error message saying that combination is unstable for rlibs. In particular, this caused the build to fail when +whole-archive was used on staticlib crates, even though +whole-archive effectively does nothing on non-bin crates because the final linker invocation is left to an external build system.
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-linkage
Area: linking into static, shared libraries and binaries
C-bug
Category: This is a bug.
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
Code
I tried this code in a library used in build.rs
In Cargo.toml:
I expected to see this happen: build succeeds, but
+whole-archive
effectively does nothing because the final link of the executable is done by an external build system (CMake in this case)Instead, this happened: build fails with
KDAB/cxx-qt#519
Version it worked on
It most recently worked on: 1.68
Version with regression
1.69.0
Backtrace
N/A
Workaround
Add
-bundle
link modifier:KDAB/cxx-qt#520
Neither +bundle nor -bundle seem to make much sense for a staticlib which is built by cc rather than rustc, so adding
-bundle
doesn't seem to have any downside for CXX-Qt's purposes.Context
The CXX-Qt build system supports building two ways:
+whole-archive
:target_link_libraries(${APP_NAME}_lib INTERFACE "$<LINK_LIBRARY:WHOLE_ARCHIVE,${CRATE}-static>")
The Rust bin crate case is still working. The Rust staticlib case fails with the confusing error about rlibs in Rust 1.69. From the Zulip discussion, this seems to be a regression from #105601. This error should be ignored when the crate being built isn't an rlib.
The text was updated successfully, but these errors were encountered: