Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 653246 - dev-util/mingw-runtime incorrectly installs pthreads to /usr/i686-w64-mingw32/usr/lib64 instead of /usr/i686-w64-mingw32/usr/lib/
Summary: dev-util/mingw-runtime incorrectly installs pthreads to /usr/i686-w64-mingw32...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2018-04-15 16:31 UTC by Luke A. Guest
Modified: 2019-09-16 21:18 UTC (History)
5 users (show)

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


Attachments
emerge --info (emerge-info.log,6.84 KB, text/x-log)
2018-05-11 16:20 UTC, Christian Widmer
Details
emerge-i686-w64-mingw32 --info (emerge-info-i686.log,2.57 KB, text/x-log)
2018-05-11 16:21 UTC, Christian Widmer
Details
emerge-x86_64-w64-mingw32 --info (emerge-info-x86_64.log,2.58 KB, text/x-log)
2018-05-11 16:27 UTC, Christian Widmer
Details
mingw64-runtime-5.0.4-r1.ebuild (mingw64-runtime-5.0.4-r1.ebuild,2.58 KB, text/plain)
2018-08-21 09:08 UTC, Christian Widmer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luke A. Guest 2018-04-15 16:31:21 UTC
Installing mingw-runtime with:

USE="libraries idl tools" crossdev --ex-only --ex-pkg cross-i686-w64-mingw32/mingw64-runtime -t i686-w64-mingw32

installs the wrong library location:

ls /usr/i686-w64-mingw32/usr/lib64/
libmangle.a  libpseh.a  libpthread.a  libpthread.dll.a  libwinpthread.a  libwinpthread.dll.a  libwinpthread.la

These should be inside /usr/i686-w64-mingw32/usr/lib/

The same happens for x86_64-w64-mingw32 as well.
Comment 1 Sergei Trofimovich (RETIRED) gentoo-dev 2018-04-17 19:06:29 UTC
Please post your 'emerge --info' and 'i686-w64-mingw32 --info'.

while lib64 is wrong for i686 target i'm not so sure about x86_64.
Comment 2 Luke A. Guest 2018-04-18 17:18:47 UTC
(In reply to Sergei Trofimovich from comment #1)
> Please post your 'emerge --info' and 'i686-w64-mingw32 --info'.
> 
> while lib64 is wrong for i686 target i'm not so sure about x86_64.

Why are all the other libs under lib then? https://bpaste.net/show/632ccd0318b8
Comment 3 Christian Widmer 2018-05-10 18:06:51 UTC
This also leads to a linker error[1] when compiling x86-64-win64-mingw64-gcc with pthreads. Symlinking everything from /usr/i686-w64-mingw32/usr/lib64/ to /usr/i686-w64-mingw32/usr/lib/ worked around the issue and let me compile gcc just fine.

[1] /usr/libexec/gcc/x86_64-w64-mingw32/ld: cannot find -lpthread
Comment 4 Christian Widmer 2018-05-10 18:38:53 UTC
It might also be worth mentioning that this behavior is new to mingw64-runtime-5.0.3-r2 while 5.0.3-r1 installs the libraries listed in the original post into /usr/x86_64-w64-mingw32/usr/lib and all the other libraries into /usr/x86_64-w64-mingw32/lib.
Comment 5 Sergei Trofimovich (RETIRED) gentoo-dev 2018-05-10 21:11:09 UTC
I still don't see output of 'emerge --info' and 'i686-w64-mingw32 --info'. Did I miss it? Topic seems to be incorrect as *-w64-* targets use mingw64-runtime, not mingw-runtime.
Comment 6 Christian Widmer 2018-05-11 16:20:42 UTC
Created attachment 530816 [details]
emerge --info

Although I am not the original poster, I hereby provide the requested information. Additionally, I am not experiencing any problems with the i686 installation. All libraries are installed into /usr/i686-w64-mingw32/usr/lib/ as they should. It is only the x86_64 toolchain that exhibits the reported linker error because of the pthread libraries being in lib64.
Comment 7 Christian Widmer 2018-05-11 16:21:20 UTC
Created attachment 530818 [details]
emerge-i686-w64-mingw32 --info
Comment 8 Christian Widmer 2018-05-11 16:27:25 UTC
Created attachment 530820 [details]
emerge-x86_64-w64-mingw32 --info

Although I do not see where this would alter the log, this one is taken while using the working mingw64-runtime-5.0.3-r1 instead of the failing 5.0.3-r2.
Comment 9 Christian Segundo 2018-08-03 03:27:26 UTC
I'm also hitting this issue when compiling cross-x86_64-w64-mingw32/gcc-7.3.0-r3 with EXTRA_ECONF="--enable-threads=posix" and cross-x86_64-w64-mingw32/mingw64-runtime-5.0.4.
Comment 10 Christian Widmer 2018-08-21 09:08:23 UTC
Created attachment 544244 [details]
mingw64-runtime-5.0.4-r1.ebuild

This ebuild sets libdir to lib instead of lib64 as a workaround for x86_64-w64-mingw32. This leads to all the libraries being installed in lib thus allowing the linker to pick them up and, in consequence, lets gcc compile fine with pthreads support without the need for manual symlinking.
Although I think making the linker search the lib64 dir in addition to lib would be a better solution, that might need a modification of the toolchain.eclass and would be better done by someone familiar with it.
Comment 11 Larry the Git Cow gentoo-dev 2019-09-16 21:18:58 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1fae5b17fa009c7bfb405dd186566c48c42c5390

commit 1fae5b17fa009c7bfb405dd186566c48c42c5390
Author:     James Le Cuirot <chewi@gentoo.org>
AuthorDate: 2019-09-16 20:49:42 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2019-09-16 21:18:52 +0000

    dev-util/mingw64-runtime: Don't install USE=libraries libs to lib64
    
    Closes: https://bugs.gentoo.org/653246
    Package-Manager: Portage-2.3.76, Repoman-2.3.17
    Signed-off-by: James Le Cuirot <chewi@gentoo.org>
    Closes: https://github.com/gentoo/gentoo/pull/12944
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 ...ingw64-runtime-6.0.0-r2.ebuild => mingw64-runtime-6.0.0-r3.ebuild} | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)