Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 833207 - net-fs/samba-4.15.5: i686-w64-mingw32/ld: cannot find -lpthread
Summary: net-fs/samba-4.15.5: i686-w64-mingw32/ld: cannot find -lpthread
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's SAMBA Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-12 20:47 UTC by Adel KARA SLIMANE
Modified: 2022-03-09 15:51 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
samba build log (samba-build.log,159.51 KB, text/x-log)
2022-02-12 20:47 UTC, Adel KARA SLIMANE
Details
emerge pqv samba (emerge-pqv-samba,408 bytes, text/plain)
2022-02-12 20:57 UTC, Adel KARA SLIMANE
Details
emerge info samba (emerge-info-samba,7.39 KB, text/plain)
2022-02-12 20:57 UTC, Adel KARA SLIMANE
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adel KARA SLIMANE 2022-02-12 20:47:46 UTC
Created attachment 764951 [details]
samba build log

Hello,

I have an issue compiling samba for a while now (not that I need it, it's being pulled by something in Gnome I cannot disable), and the error message I get is the following:

```
[206/207] Compiling packaging/systemd/winbind.service.in
[207/207] Compiling packaging/systemd/samba.service.in
/usr/libexec/gcc/i686-w64-mingw32/ld: cannot find -lpthread
collect2: error: ld returned 1 exit status
```

This may indicate that I have an issue with my mingw-gcc build (that I need to have built with posix thread model). Howewever, I can successfully build wine-staging with `mingw` useflag.

I emerge mingw-gcc with the following script, if that's any useful:

```
#!/bin/bash
 
echo "######################################"
echo "Generating x86_64-w64-mingw32"
echo "######################################"
 
crossdev --target cross-x86_64-w64-mingw32
crossdev --lenv 'USE="libraries"' \
--genv 'EXTRA_ECONF="--enable-threads=posix"' \
--init-target --target cross-x86_64-w64-mingw32
env USE="libraries" emerge --oneshot cross-x86_64-w64-mingw32/mingw64-runtime
env USE="libraries" emerge --oneshot cross-x86_64-w64-mingw32/gcc
 
# i686
 
echo "######################################"
echo "Generating i686-w64-mingw32"
echo "######################################"
 
crossdev --target cross-i686-w64-mingw32
crossdev --lenv 'USE="libraries"' \
--genv 'EXTRA_ECONF="--enable-threads=posix --disable-sjlj-exceptions --with-dwarf2"' \
--init-target --target cross-i686-w64-mingw32
env USE="libraries" emerge --oneshot cross-i686-w64-mingw32/mingw64-runtime
env USE="libraries" emerge --oneshot cross-i686-w64-mingw32/gcc
```

Any idea what may be wrong ?

Thank you for your help.
Comment 1 Adel KARA SLIMANE 2022-02-12 20:57:46 UTC
Created attachment 764952 [details]
emerge pqv samba
Comment 2 Adel KARA SLIMANE 2022-02-12 20:57:59 UTC
Created attachment 764953 [details]
emerge info samba
Comment 3 Adel KARA SLIMANE 2022-02-13 18:50:47 UTC
Bug https://bugs.gentoo.org/833284 is probably the reason behind. 

This bug can either be closed or maybe a more fine tuned dependency on mingw64-runtime should be set ? I suppose it's not really possible.
Comment 4 Adel KARA SLIMANE 2022-03-09 15:49:34 UTC
After fixing https://bugs.gentoo.org/833284  the problem doesn't occur any longer