summaryrefslogtreecommitdiff
path: root/dev-util/mingw64-runtime
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-05-04 22:28:33 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-05-04 22:28:33 +0100
commita978c074e4272bb901fbe4a10de0a7b2af574f17 (patch)
tree8c764c1cc0576389ce22abd317bceba71ea5732d /dev-util/mingw64-runtime
parent40aaaa64e86ba6710bbeb31c4615a6ce80e75e11 (diff)
gentoo resync : 04.05.2021
Diffstat (limited to 'dev-util/mingw64-runtime')
-rw-r--r--dev-util/mingw64-runtime/Manifest2
-rw-r--r--dev-util/mingw64-runtime/files/mingw64-runtime-8.0.0-__rdtsc.patch25
-rw-r--r--dev-util/mingw64-runtime/mingw64-runtime-8.0.0-r1.ebuild119
3 files changed, 146 insertions, 0 deletions
diff --git a/dev-util/mingw64-runtime/Manifest b/dev-util/mingw64-runtime/Manifest
index 55093c2e47db..528231224a06 100644
--- a/dev-util/mingw64-runtime/Manifest
+++ b/dev-util/mingw64-runtime/Manifest
@@ -1,6 +1,8 @@
AUX mingw64-runtime-7.0.0-fortify-only-ssp.patch 637 BLAKE2B 3a8eff14b3150446da51354324a3b29e327982fd586339e5f8df4309de2bbdb2722773e0d145d87363183ff70fd02fcdcbc46c560bef9a5111dc33ee8105bede SHA512 991d4294d81a05bfa86d2bed102b3f5bf58435ef02b0a38abe905cc4a0416896b01ffc3a2fe64e78d44e78c9c65051428426b7d19561bd337a229bf7281c7040
+AUX mingw64-runtime-8.0.0-__rdtsc.patch 773 BLAKE2B 8ec970049ee9d1003caed099a6eb0301f066cd3f0986895f08b2912b14248d3c41c87558a1df40b7f452e73d382da73215942827f4e5e551df65d779eda23eef SHA512 df986f2b24ea1e4db7babad2a837a55a59e1abd20f41ef03f438907477829561238a69fa8e8891ede1a45eef6dca36deb82c6be61293ce0f39e7f94f82483cad
DIST mingw-w64-v7.0.0.tar.bz2 9071231 BLAKE2B da00794ec456ede5913a565248c79255407c058469cb7338cf81b8d03c1e39f4189016b01734b786c0ad8f18166a24fdb95ca72edc954f31151e5d3aa2b2a899 SHA512 30e5b2824a24eeb99ab519e3fc134cc9a7f04ee8b853bc8d66a13d1ab74144bf78b93e162bfe6de2a5e61f63c0e620a933b260b02d019cd68cc4b78bd36c67fd
DIST mingw-w64-v8.0.0.tar.bz2 9370799 BLAKE2B ec65191722f6f2ddbb93488ea4c4c21e22fb5ef777ef293d65d13de1057d96c9105a4a4936999d4babbd8fdfc52ed14675f1c5fbc630524df28805e0f66b1a2b SHA512 cefcc86ac3e6337c88ed224ab4692abbd5eb543ce78fb6c5462198a85f36c9274a0a1df0a0bebd182137fd527c15831f9237c782711a85f32e77d9104b28359e
EBUILD mingw64-runtime-7.0.0-r1.ebuild 2982 BLAKE2B 8f053374e0a9efb5d5bf80f2da61ba9e3c5b4fdc46c70b68bea330dff90e35aa1063b2a46634344c32af369f3f595220a5546b06f07cca8f9684a75be1330e49 SHA512 207053be905bba9e9a956d1c0fa3d4ba10280e3c92ad958f0aa3b9408ab6473333dabb6472d5217ccdfb5f4fc8343bc80f4728105b708ec75071772226ae1099
+EBUILD mingw64-runtime-8.0.0-r1.ebuild 3030 BLAKE2B 9a90af1f77827b0fb93194b28d115cd32a0ea45f78366bb07c19b8536ed93b7059fc8eaf85537988779b2a30e7cc0738306c713be944e22b27a0250cbe298bc7 SHA512 0892656f775b1d550ca486a2a02703caf4d56c46c7dd96f7e66f10b260062a97759d2e2cb5e690b1a809e8c6b09c5d3a4e4a0f98c2dac479ce6c67feb490e210
EBUILD mingw64-runtime-8.0.0.ebuild 2989 BLAKE2B eff772061575f14ffcc9b85a1c6d4658eb2854b19a9b103eecb8e579bbf44e31084c1e915dff3415cecfcf0ae3e41444c31b7f4d5a5559c9c0addd2a94129999 SHA512 baff94670008ee2e907924fa7c0cc6c86f7902ceb60fe39e53a4d6d3b3a093bfce0270b89bc2a11ef0c11e724d1e3fd90de04b1ab0ae3b40cb934971d834f4e3
MISC metadata.xml 563 BLAKE2B 84e56e99482d2f7bb1e1095d84915b42190ba74fe7242ffdce548c4249a40be17018a29911d32b9b09df8fc5e04d912dcfe6f473e5eb2478f55d317808b24f4b SHA512 27dca35a3b2d5444b712802c3099c595d9b9fda21f29b6b709222e5bb0aad78f353d0170500eb3b632b254935d35cf43fc43d4ecb61722b711799ca4d28211bd
diff --git a/dev-util/mingw64-runtime/files/mingw64-runtime-8.0.0-__rdtsc.patch b/dev-util/mingw64-runtime/files/mingw64-runtime-8.0.0-__rdtsc.patch
new file mode 100644
index 000000000000..df06f041c8c2
--- /dev/null
+++ b/dev-util/mingw64-runtime/files/mingw64-runtime-8.0.0-__rdtsc.patch
@@ -0,0 +1,25 @@
+https://bugs.gentoo.org/786549
+
+gcc-11 defines __rdtsc as a macro:
+ // include/ia32intrin.h:110
+ #define __rdtsc() __builtin_ia32_rdtsc ()
+and causes build failure:
+ intrincs/rdtsc.c:15:30: error: macro "__rdtsc" passed 1 arguments, but takes just 0
+ 15 | unsigned __int64 __rdtsc(void)
+ | ^
+
+Let's avoid __rdtsc definition on systems with #define __rdtsc present.
+
+There is still a chance that it might be a '#define __rdtsc __rdtsc'.
+We'll revisit it then.
+--- a/mingw-w64-crt/intrincs/rdtsc.c
++++ b/mingw-w64-crt/intrincs/rdtsc.c
+@@ -11,7 +11,7 @@
+ #define __has_builtin(x) 0
+ #endif
+
+-#if !__has_builtin(__rdtsc)
++#if !__has_builtin(__rdtsc) && !defined(__rdtsc)
+ unsigned __int64 __rdtsc(void)
+ {
+ #ifdef _WIN64
diff --git a/dev-util/mingw64-runtime/mingw64-runtime-8.0.0-r1.ebuild b/dev-util/mingw64-runtime/mingw64-runtime-8.0.0-r1.ebuild
new file mode 100644
index 000000000000..3dfff3894bf5
--- /dev/null
+++ b/dev-util/mingw64-runtime/mingw64-runtime-8.0.0-r1.ebuild
@@ -0,0 +1,119 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+inherit autotools flag-o-matic toolchain-funcs
+
+DESCRIPTION="Free Win64 runtime and import library definitions"
+HOMEPAGE="http://mingw-w64.sourceforge.net/"
+SRC_URI="mirror://sourceforge/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${PV}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+# USE=libraries needs working stage2 compiler: bug #665512
+IUSE="headers-only idl libraries tools"
+RESTRICT="strip"
+
+S="${WORKDIR}/mingw-w64-v${PV}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-7.0.0-fortify-only-ssp.patch
+ "${FILESDIR}"/${PN}-8.0.0-__rdtsc.patch
+)
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+just_headers() {
+ use headers-only
+}
+alt_prefix() {
+ is_crosscompile && echo /usr/${CTARGET}
+}
+crt_with() {
+ just_headers && echo --without-$1 || echo --with-$1
+}
+crt_use_enable() {
+ just_headers && echo --without-$2 || use_enable "$@"
+}
+crt_use_with() {
+ just_headers && echo --without-$2 || use_with "$@"
+}
+
+pkg_setup() {
+ if [[ ${CBUILD} == ${CHOST} ]] && [[ ${CHOST} == ${CTARGET} ]] ; then
+ die "Invalid configuration"
+ fi
+}
+
+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"
+ pushd "${WORKDIR}/headers" > /dev/null
+ CHOST=${CTARGET} "${S}/configure" \
+ --prefix="${T}/tmproot" \
+ --with-headers \
+ --without-crt \
+ || die
+ popd > /dev/null
+ append-cppflags "-I${T}/tmproot/include"
+ fi
+
+ # By default configure tries to set --sysroot=${prefix}. We disable
+ # this behaviour with --with-sysroot=no to use gcc's sysroot default.
+ # That way we can cross-build mingw64-runtime with cross-emerge.
+ local prefix="${EPREFIX}"$(alt_prefix)/usr
+ CHOST=${CTARGET} econf \
+ --with-sysroot=no \
+ --prefix="${prefix}" \
+ --libdir="${prefix}"/lib \
+ --with-headers \
+ --enable-sdk \
+ $(crt_with crt) \
+ $(crt_use_enable idl idl) \
+ $(crt_use_with libraries libraries) \
+ $(crt_use_with tools tools) \
+ $(
+ $(tc-getCPP ${CTARGET}) ${CPPFLAGS} -dM - < /dev/null | grep -q __MINGW64__ \
+ && echo --disable-lib32 --enable-lib64 \
+ || echo --enable-lib32 --disable-lib64
+ )
+}
+
+src_compile() {
+ if ! just_headers; then
+ emake -C "${WORKDIR}/headers" install
+ fi
+ default
+}
+
+src_install() {
+ default
+
+ if is_crosscompile ; then
+ # gcc is configured to look at specific hard-coded paths for mingw #419601
+ dosym usr /usr/${CTARGET}/mingw
+ dosym usr /usr/${CTARGET}/${CTARGET}
+ dosym usr/include /usr/${CTARGET}/sys-include
+ fi
+
+ rm -rf "${ED}/usr/share"
+}