rav1e icon indicating copy to clipboard operation
rav1e copied to clipboard

msys2: cannot compile due to issue with crossbeam dependency

Open 1480c1 opened this issue 2 years ago • 6 comments

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 https://github.com/crossbeam-rs/crossbeam/commit/08e41e184832f9d0bd49d97e21be1d60c437a894, 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 avatar Jun 23 '22 02:06 1480c1

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?

tdaede avatar Jun 23 '22 03:06 tdaede

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

1480c1 avatar Jun 23 '22 04:06 1480c1

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 avatar Jun 26 '22 19:06 lu-zero

https://github.com/rust-lang/rust/issues/98302 seems the root issue

lu-zero avatar Jul 14 '22 08:07 lu-zero

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?

1480c1 avatar Aug 14 '22 02:08 1480c1

yes, I hope that's enough.

lu-zero avatar Aug 14 '22 06:08 lu-zero