Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Windows build with CUDA: prepend compiler lib path
Prepend compiler default lib path (usually something like `-LC:/tools/msys64/clang64/bin/../lib`) to avoid erors like: Linking bin/uv.exe... ld.lld: error: duplicate symbol: atexit >>> defined at C:/M/B/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:336 >>> C:/msys64/clang64/lib/crt2.o >>> defined at msvcrt.lib(utility.obj) c++: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [Makefile:241: bin/uv.exe] Error 1 (reproducible with `./configure --disable-all --enable-cuda`; the problem is superseded if libavcodec is present, which already does it) The problem was caused by the fact that MSVC library path is added to add libmsvcprt.a and libOLDNAMES.a needed by MS C++ STL library that is needed for CUDA (see the commit b6a45bd from 2024-03-27) to support C++ code in CUDA sources (currently lavc cuda convs). As we compile with MinGW toolkit, the MinGW lib wrappers need to be used. The error w/o MS STL library is: Linking bin/uv.exe... ld.lld: error: could not open 'libmsvcprt.a': No such file or directory ld.lld: error: could not open 'libOLDNAMES.a': No such file or directory c++: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [Makefile:241: bin/uv.exe] Error 1
- Loading branch information