Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 2070571 - mingw-gcc toolchain does not install the static library of winpthreads automatically
Summary: mingw-gcc toolchain does not install the static library of winpthreads automa...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: mingw-gcc
Version: 35
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Kalev Lember
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-03-31 12:58 UTC by Bin Meng
Modified: 2022-04-28 06:57 UTC (History)
6 users (show)

Fixed In Version: mingw-gcc-12.0.1-8.fc37
Doc Type: ---
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-04-28 06:57:40 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Bin Meng 2022-03-31 12:58:32 UTC
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.

Comment 1 Fedora Update System 2022-04-27 23:04:32 UTC
FEDORA-2022-be4adec40b has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-be4adec40b

Comment 2 Fedora Update System 2022-04-28 06:57:40 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.