Normally mingw-64 does not use dynamic linker.
One exception is at ./configure time where $LDFLAGS
is used by default.
When LDFFLAGS=-Wl,--hash-style=gnu is passed (default
on linux) to mingw64-runtime a few things are not
auto-detected. One of them is __CTORS_LIST__ / __DTORS_LIST__
support by binutils' target ld.
If constructors are not provided then binaries start
crashing at shutdown.
The workaround is to filter out -Wl,--hash-style=* options.
Longer-term fix will be to install mingw64-runtime into
target: bug #642604. That wa LDFLAGS from CBUILD will not
leak into libc packages.
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Package-Manager: Portage-2.3.50, Repoman-2.3.11
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
LICENSE="BSD"
SLOT="0"
-KEYWORDS=""
+KEYWORDS="~amd64 ~x86"
IUSE="headers-only idl libraries tools"
RESTRICT="strip"
src_configure() {
CHOST=${CTARGET} strip-unsupported-flags
+ # Normally mingw-64 does not use dynamic linker.
+ # But at configure time it uses $LDFLAGS.
+ # When default -Wl,--hash-style=gnu is passed
+ # __CTORS_LIST__ / __DTORS_LIST__ is mis-detected
+ # for target ld and binaries crash at shutdown.
+ filter-ldflags '-Wl,--hash-style=*'
if ! just_headers; then
mkdir "${WORKDIR}/headers"