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

msys2: cannot compile due to issue with crossbeam dependency #2960

Open
1480c1 opened this issue Jun 23, 2022 · 6 comments
Open

msys2: cannot compile due to issue with crossbeam dependency #2960

1480c1 opened this issue Jun 23, 2022 · 6 comments
Labels

Comments

@1480c1
Copy link
Contributor

1480c1 commented Jun 23, 2022

Describe the bug

Compile error due to crossbeam-epoch

error: linking with `i686-w64-mingw32-gcc` failed: exit code: 1
  |
  = note: "i686-w64-mingw32-gcc" ...
  = note: D:/media-autobuild_suite/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/12.1.0/../../../../i686-w64-mingw32/bin/ld.exe: D:\media-autobuild_suite\build\rav1e-git\target\i686-pc-windows-gnu\release\deps\rav1e-2bb7c42675a4c7b5.kb0hgx92w3aeqvs.rcgu.o: in function `ZN15crossbeam_epoch7default11with_handle17h689cff926aee7e0fE':
          D:/media-autobuild_suite/msys64/opt/cargo\registry\src\github.com-1285ae84e5963aae\crossbeam-epoch-0.9.9\src/internal.rs:(.text+0x30b): undefined reference to `_imp___ZN15crossbeam_epoch7default9COLLECTOR17hd32c8f6291a208e5E'
          collect2.exe: error: ld returned 1 exit status
          
  = help: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)

warning: `rav1e` (bin "rav1e") generated 1 warning
error: could not compile `rav1e` due to previous error; 1 warning emitted

Possibly related to crossbeam-rs/crossbeam@08e41e1, unsure how I can pin a dependency of a dependency since this seems to be pulled by stuff like rayon and such, so I do not know how I can test it. Reporting here just in case

To Reproduce
Steps to reproduce the behavior

get Windows with msys2, might happen with linux, haven't tested, git clone rav1e, and CC=clang cargo build --release --target=i686-pc-windows-gnu

Expected behavior
A clear and concise description of what you expected to happen.

Successful compile

Required Information
Toolchain (if is a build problem):

cddeg@ccom-laptop /trunk
$ cargo --version
cargo 1.61.0 (a028ae42f 2022-04-29)
cddeg@ccom-laptop /trunk
$ rustc --version
rustc 1.61.0 (fe5b13d68 2022-05-18)
cddeg@ccom-laptop /trunk
$ nasm --version
NASM version 2.15.05 compiled on Oct 14 2020

Version:

$ rav1e --version

Operating system:

$ uname -a
MINGW64_NT-10.0-22000 ccom-laptop 3.3.5-341.x86_64 2022-05-30 21:10 UTC x86_64 Msys

Console Output
Please paste the console output below if it is relevant,

Snippet here
@1480c1 1480c1 added the bug label Jun 23, 2022
@tdaede
Copy link
Collaborator

tdaede commented Jun 23, 2022

Hmm, this seems like an internal linking error, like a file got corrupted or a symbol got too long.

Do you know if this happens for the 64 bit target as well?

@1480c1
Copy link
Contributor Author

1480c1 commented Jun 23, 2022

The same thing happens to 64-bit target as well

  = note: D:/media-autobuild_suite/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:\media-autobuild_suite\build\rav1e-git\target\x86_64-pc-windows-gnu\release\deps\rav1e-e2d763b0698b5292.28bil6h58aw9lgwy.rcgu.o: in function `crossbeam_epoch::default::with_handle':
          D:/media-autobuild_suite/msys64/opt/cargo\registry\src\github.com-1ecc6299db9ec823\crossbeam-epoch-0.9.9\src/internal.rs:(.text+0x3bc): undefined reference to `__imp__ZN15crossbeam_epoch7default9COLLECTOR17ha85cf7255fe8d9bbE'
          D:/media-autobuild_suite/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:\media-autobuild_suite\build\rav1e-git\target\x86_64-pc-windows-gnu\release\deps\rav1e-e2d763b0698b5292.28bil6h58aw9lgwy.rcgu.o: in function `once_cell::sync::OnceCell<T>::get_or_try_init':
          D:/media-autobuild_suite/msys64/opt/cargo\registry\src\github.com-1ecc6299db9ec823\once_cell-1.12.0\src/lib.rs:1063: undefined reference to `__imp__ZN15crossbeam_epoch7default9COLLECTOR17ha85cf7255fe8d9bbE'
          collect2.exe: error: ld returned 1 exit status

  = help: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)

warning: `rav1e` (bin "rav1e") generated 1 warning
error: could not compile `rav1e` due to previous error; 1 warning emitted

@lu-zero
Copy link
Collaborator

lu-zero commented Jun 26, 2022

You can pin any dependency by setting a override in your local config, since I assume the problem is present on other crates as well (e.g. grcov)

@lu-zero
Copy link
Collaborator

lu-zero commented Jul 14, 2022

rust-lang/rust#98302 seems the root issue

lu-zero added a commit to rust-av/rav1e that referenced this issue Jul 14, 2022
lu-zero added a commit to rust-av/rav1e that referenced this issue Jul 14, 2022
lu-zero added a commit that referenced this issue Jul 15, 2022
@1480c1
Copy link
Contributor Author

1480c1 commented Aug 14, 2022

Possible issues with console now

  = note: D:/mabs/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/12.1.0/../../../../i686-w64-mingw32/bin/ld.exe: D:\mabs\build\rav1e-git\target\i686-pc-windows-gnu\release\deps\rav1e-1e14ff98ab9eccdc.385ujshg43acefoq.rcgu.o: in function `ZN76_$LT$console..utils..StyledObject$LT$D$GT$$u20$as$u20$core..fmt..Display$GT$3fmt28_$u7b$$u7b$closure$u7d$$u7d$17h45a9c9ebdd004644E':
          D:/mabs/msys64/opt/cargo\registry\src\github.com-1285ae84e5963aae\console-0.15.1\src/utils.rs:(.text+0x2b): undefined reference to `_imp___ZN7console5utils13STDOUT_COLORS17h39f3f40ff1768141E'
          D:/mabs/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/12.1.0/../../../../i686-w64-mingw32/bin/ld.exe: D:\mabs\build\rav1e-git\target\i686-pc-windows-gnu\release\deps\rav1e-1e14ff98ab9eccdc.385ujshg43acefoq.rcgu.o: in function `ZN9once_cell4sync17OnceCell$LT$T$GT$15get_or_try_init17h1063d958e445f9c3E':
          D:/mabs/msys64/opt/cargo\registry\src\github.com-1285ae84e5963aae\once_cell-1.13.0\src/lib.rs:(.text+0x3e): undefined reference to `_imp___ZN7console5utils13STDOUT_COLORS17h39f3f40ff1768141E'
          D:/mabs/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/12.1.0/../../../../i686-w64-mingw32/bin/ld.exe: D:/mabs/msys64/opt/cargo\registry\src\github.com-1285ae84e5963aae\once_cell-1.13.0\src/lib.rs:(.text+0x45): undefined reference to `_imp___ZN7console5utils13STDERR_COLORS17h064808dba4074d8cE'
          D:/mabs/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/12.1.0/../../../../i686-w64-mingw32/bin/ld.exe: D:\mabs\build\rav1e-git\target\i686-pc-windows-gnu\release\deps\rav1e-1e14ff98ab9eccdc.385ujshg43acefoq.rcgu.o: in function `ZN76_$LT$console..utils..StyledObject$LT$D$GT$$u20$as$u20$core..fmt..Display$GT$3fmt28_$u7b$$u7b$closure$u7d$$u7d$17h45a9c9ebdd004644E':
          D:/mabs/msys64/opt/cargo\registry\src\github.com-1285ae84e5963aae\console-0.15.1\src/utils.rs:(.text+0x58): undefined reference to `_imp___ZN7console5utils13STDOUT_COLORS17h39f3f40ff1768141E'
          D:/mabs/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/12.1.0/../../../../i686-w64-mingw32/bin/ld.exe: D:/mabs/msys64/opt/cargo\registry\src\github.com-1285ae84e5963aae\console-0.15.1\src/utils.rs:(.text+0x5f): undefined reference to `_imp___ZN7console5utils13STDERR_COLORS17h064808dba4074d8cE'
          D:/mabs/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/12.1.0/../../../../i686-w64-mingw32/bin/ld.exe: D:/mabs/msys64/opt/cargo\registry\src\github.com-1285ae84e5963aae\console-0.15.1\src/utils.rs:(.text+0x75): undefined reference to `_imp___ZN7console5utils13STDERR_COLORS17h064808dba4074d8cE'
          collect2.exe: error: ld returned 1 exit status

@lu-zero to use the release-nolto profile, do I just add --profile release-no-lto to my cargo build?

@lu-zero
Copy link
Collaborator

lu-zero commented Aug 14, 2022

yes, I hope that's enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants