-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Solve the pinned memchr problem #127890
Labels
A-linkage
Area: linking into static, shared libraries and binaries
C-bug
Category: This is a bug.
O-windows-gnu
Toolchain: GNU, Operating system: Windows
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
rustbot
added
the
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
label
Jul 18, 2024
Noratrieb
added
A-linkage
Area: linking into static, shared libraries and binaries
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
C-bug
Category: This is a bug.
and removed
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
labels
Jul 18, 2024
Closed
tgross35
added a commit
to tgross35/rust
that referenced
this issue
Aug 26, 2024
The latest versions of `memchr` experience LTO-related issues when compiling for windows-gnu [1], so needs to be pinned. The issue is present in the standard library. `memchr` has been pinned in `rustc_ast`, but since the workspace was recently split, this pin no longer has any effect on library crates. Resolve this by adding `memchr` as an _unused_ dependency in `std`, pinned to 2.5. Additionally, remove the pin in `rustc_ast` to allow non-library crates to upgrade to the latest version. Link: rust-lang#127890 [1]
tgross35
added a commit
to tgross35/rust
that referenced
this issue
Sep 1, 2024
The latest versions of `memchr` experience LTO-related issues when compiling for windows-gnu [1], so needs to be pinned. The issue is present in the standard library. `memchr` has been pinned in `rustc_ast`, but since the workspace was recently split, this pin no longer has any effect on library crates. Resolve this by adding `memchr` as an _unused_ dependency in `std`, pinned to 2.5. Additionally, remove the pin in `rustc_ast` to allow non-library crates to upgrade to the latest version. Link: rust-lang#127890 [1]
tgross35
added a commit
to tgross35/rust
that referenced
this issue
Sep 1, 2024
The latest versions of `memchr` experience LTO-related issues when compiling for windows-gnu [1], so needs to be pinned. The issue is present in the standard library. `memchr` has been pinned in `rustc_ast`, but since the workspace was recently split, this pin no longer has any effect on library crates. Resolve this by adding `memchr` as an _unused_ dependency in `std`, pinned to 2.5. Additionally, remove the pin in `rustc_ast` to allow non-library crates to upgrade to the latest version. Link: rust-lang#127890 [1]
tgross35
added a commit
to tgross35/rust
that referenced
this issue
Sep 3, 2024
The latest versions of `memchr` experience LTO-related issues when compiling for windows-gnu [1], so needs to be pinned. The issue is present in the standard library. `memchr` has been pinned in `rustc_ast`, but since the workspace was recently split, this pin no longer has any effect on library crates. Resolve this by adding `memchr` as an _unused_ dependency in `std`, pinned to 2.5. Additionally, remove the pin in `rustc_ast` to allow non-library crates to upgrade to the latest version. Link: rust-lang#127890 [1]
tgross35
added a commit
to tgross35/rust
that referenced
this issue
Sep 11, 2024
The latest versions of `memchr` experience LTO-related issues when compiling for windows-gnu [1], so needs to be pinned. The issue is present in the standard library. `memchr` has been pinned in `rustc_ast`, but since the workspace was recently split, this pin no longer has any effect on library crates. Resolve this by adding `memchr` as an _unused_ dependency in `std`, pinned to 2.5. Additionally, remove the pin in `rustc_ast` to allow non-library crates to upgrade to the latest version. Link: rust-lang#127890 [1]
tgross35
added a commit
to tgross35/rust
that referenced
this issue
Sep 24, 2024
The latest versions of `memchr` experience LTO-related issues when compiling for windows-gnu [1], so needs to be pinned. The issue is present in the standard library. `memchr` has been pinned in `rustc_ast`, but since the workspace was recently split, this pin no longer has any effect on library crates. Resolve this by adding `memchr` as an _unused_ dependency in `std`, pinned to 2.5. Additionally, remove the pin in `rustc_ast` to allow non-library crates to upgrade to the latest version. Link: rust-lang#127890 [1]
tgross35
added a commit
to tgross35/rust
that referenced
this issue
Sep 24, 2024
The latest versions of `memchr` experience LTO-related issues when compiling for windows-gnu [1], so needs to be pinned. The issue is present in the standard library. `memchr` has been pinned in `rustc_ast`, but since the workspace was recently split, this pin no longer has any effect on library crates. Resolve this by adding `memchr` as an _unused_ dependency in `std`, pinned to 2.5. Additionally, remove the pin in `rustc_ast` to allow non-library crates to upgrade to the latest version. Link: rust-lang#127890 [1]
tgross35
added a commit
to tgross35/rust
that referenced
this issue
Sep 24, 2024
The latest versions of `memchr` experience LTO-related issues when compiling for windows-gnu [1], so needs to be pinned. The issue is present in the standard library. `memchr` has been pinned in `rustc_ast`, but since the workspace was recently split, this pin no longer has any effect on library crates. Resolve this by adding `memchr` as an _unused_ dependency in `std`, pinned to 2.5. Additionally, remove the pin in `rustc_ast` to allow non-library crates to upgrade to the latest version. Link: rust-lang#127890 [1]
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Sep 24, 2024
Pin memchr to 2.5.0 in the library rather than rustc_ast The latest versions of `memchr` experience LTO-related issues when compiling for windows-gnu [1], so needs to be pinned. The issue is present in the standard library. `memchr` has been pinned in `rustc_ast`, but since the workspace was recently split, this pin no longer has any effect on library crates. Resolve this by adding `memchr` as an _unused_ dependency in `std`, pinned to 2.5. Additionally, remove the pin in `rustc_ast` to allow non-library crates to upgrade to the latest version. Link: rust-lang#127890 [1] try-job: x86_64-mingw try-job: x86_64-msvc
tgross35
added a commit
to tgross35/rust
that referenced
this issue
Sep 24, 2024
The latest versions of `memchr` experience LTO-related issues when compiling for windows-gnu [1], so needs to be pinned. The issue is present in the standard library. `memchr` has been pinned in `rustc_ast`, but since the workspace was recently split, this pin no longer has any effect on library crates. Resolve this by adding `memchr` as an _unused_ dependency in `std`, pinned to 2.5. Additionally, remove the pin in `rustc_ast` to allow non-library crates to upgrade to the latest version. Link: rust-lang#127890 [1]
tgross35
added a commit
to tgross35/rust
that referenced
this issue
Sep 24, 2024
…eb,Mark-Simulacrum Pin memchr to 2.5.0 in the library rather than rustc_ast The latest versions of `memchr` experience LTO-related issues when compiling for windows-gnu [1], so needs to be pinned. The issue is present in the standard library. `memchr` has been pinned in `rustc_ast`, but since the workspace was recently split, this pin no longer has any effect on library crates. Resolve this by adding `memchr` as an _unused_ dependency in `std`, pinned to 2.5. Additionally, remove the pin in `rustc_ast` to allow non-library crates to upgrade to the latest version. Link: rust-lang#127890 [1] try-job: x86_64-mingw try-job: x86_64-msvc
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Sep 25, 2024
Rollup merge of rust-lang#130788 - tgross35:memchr-pinning, r=Noratrieb,Mark-Simulacrum Pin memchr to 2.5.0 in the library rather than rustc_ast The latest versions of `memchr` experience LTO-related issues when compiling for windows-gnu [1], so needs to be pinned. The issue is present in the standard library. `memchr` has been pinned in `rustc_ast`, but since the workspace was recently split, this pin no longer has any effect on library crates. Resolve this by adding `memchr` as an _unused_ dependency in `std`, pinned to 2.5. Additionally, remove the pin in `rustc_ast` to allow non-library crates to upgrade to the latest version. Link: rust-lang#127890 [1] try-job: x86_64-mingw try-job: x86_64-msvc
github-actions bot
pushed a commit
to rust-lang/miri
that referenced
this issue
Sep 25, 2024
…imulacrum Pin memchr to 2.5.0 in the library rather than rustc_ast The latest versions of `memchr` experience LTO-related issues when compiling for windows-gnu [1], so needs to be pinned. The issue is present in the standard library. `memchr` has been pinned in `rustc_ast`, but since the workspace was recently split, this pin no longer has any effect on library crates. Resolve this by adding `memchr` as an _unused_ dependency in `std`, pinned to 2.5. Additionally, remove the pin in `rustc_ast` to allow non-library crates to upgrade to the latest version. Link: rust-lang/rust#127890 [1] try-job: x86_64-mingw try-job: x86_64-msvc
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.
O-windows-gnu
Toolchain: GNU, Operating system: Windows
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Ever since #120454, the
memchr
crate has been pinned at 2.5.0. This is causing problems when trying to update things which depend on a newer version (like regex). This issue is to track trying to get that problem resolved.The dependency is pinned because the x86_64-pc-windows-gnu target fails some tests with the 2.6.0 release. These tests fail when linking with "undefined reference" symbol errors in memchr (which ends up in the standard library via the
object
dependency for backtraces).The errors look like:
The underlying problem isn't with memchr. It's just that version 2.6 is just triggering a bug that has been around for a long while due to some refactoring of the code.
Reproduction
Edit
rustc_ast/Cargo.toml
and remove the=
on memchr.cargo update -p memchr
./x test tests/ui --build=x86_64-pc-windows-msvc --host=x86_64-pc-windows-gnu
bin
directory to your PATH.This currently fails these tests:
Theories
This is likely some interaction with Thin LTO and
inline
.A theory is that this is a bug in ld.bfd (just based on the evidence that it works with lld). However, it may also be possible that rustc is generating things in an incorrect way, and lld is just more tolerant of it.
Note that memchr is doing some fancy things with function pointers (https://github.com/BurntSushi/memchr/blob/2.7.4/src/arch/x86_64/memchr.rs#L58-L160) with
inline(always)
functions.Notes
cargo update
#120454 -- Pinned memchr to 2.5.0corrupt .drectve
warnings can (probably?) be ignored, they are only due to using an older version of binutils (GNU linker warns “corrupt .drectve” on staticlib binary generated with Rust 1.70 on Windows #112368).Possible solutions
Non-solutions
inline
attribute inmemchr
for windows-gnu, but nobody wants to do that. It's not memchr's fault, and we don't want to paper over the real problem.The text was updated successfully, but these errors were encountered: