Fedora Account System
Red Hat Associate
Red Hat Customer
Description of problem: mingw-gcc toolchain does not install the static library of winpthreads automatically. Compiling a simple test code statically which does not call any pthread API will fail. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: # dnf install mingw64-gcc # cat test.c int main(void) { return 0; } # x86_64-w64-mingw32-gcc -static test.c -o test.exe Actual results: # x86_64-w64-mingw32-gcc -static test.c -o test.exe /usr/lib/gcc/x86_64-w64-mingw32/11.2.1/../../../../x86_64-w64-mingw32/bin/ld: cannot find -lpthread collect2: error: ld returned 1 exit status Expected results: Compile the simple test case without any error Additional info: When installing mingw64-gcc, mingw64-winpthreads was listed as one of the dependencies, however this only includes the dynamic linked library (-shared). One has to # dnf install mingw64-winpthreads-static to make the compilation pass without any error. I don't understand the reason of dividing mingw64-winpthreads into 2 packages (mingw64-winpthreads, mingw64-winpthreads-static). We should either merge these 2 packages into one, or express the mingw64-winpthreads-static dependency to mingw64-gcc.
FEDORA-2022-be4adec40b has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-be4adec40b
FEDORA-2022-be4adec40b has been pushed to the Fedora 37 stable repository. If problem still persists, please make note of it in this bug report.