public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2022-05-13  6:53 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2022-05-13  6:53 UTC (permalink / raw
  To: gentoo-commits

commit:     2a3c0f5024be20d4604d7a686039cbee6cd36a30
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Fri May 13 06:46:43 2022 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Fri May 13 06:52:54 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2a3c0f50

dev-util/mingw64-toolchain: disable gcov

Doesn't make sense for this package and if going to cause issues...

Closes: https://bugs.gentoo.org/843989
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0.ebuild | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0.ebuild
index 1ae7b097c037..4df5573bc1e4 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0.ebuild
@@ -111,6 +111,7 @@ src_compile() {
 		--host=${CHOST}
 		--disable-bootstrap
 		--disable-cet
+		--disable-gcov #843989
 		--disable-gomp
 		--disable-libquadmath
 		--disable-libsanitizer


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2022-05-17  6:53 Jakov Smolić
  0 siblings, 0 replies; 54+ messages in thread
From: Jakov Smolić @ 2022-05-17  6:53 UTC (permalink / raw
  To: gentoo-commits

commit:     182f1081e437b8333b2c321590a924937f98493f
Author:     Jakov Smolić <jsmolic <AT> gentoo <DOT> org>
AuthorDate: Tue May 17 06:53:26 2022 +0000
Commit:     Jakov Smolić <jsmolic <AT> gentoo <DOT> org>
CommitDate: Tue May 17 06:53:26 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=182f1081

dev-util/mingw64-toolchain: Stabilize 10.0.0 x86, #845111

Signed-off-by: Jakov Smolić <jsmolic <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0.ebuild
index 13b92a3c573c..9ce0884ba526 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0.ebuild
@@ -30,7 +30,7 @@ LICENSE="
 	LGPL-3+ || ( GPL-3+ libgcc libstdc++ gcc-runtime-library-exception-3.1 )
 	ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain"
 SLOT="0"
-KEYWORDS="-* ~amd64 ~x86"
+KEYWORDS="-* ~amd64 x86"
 IUSE="+abi_x86_32 custom-cflags debug"
 
 RDEPEND="


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2022-05-17  6:53 Jakov Smolić
  0 siblings, 0 replies; 54+ messages in thread
From: Jakov Smolić @ 2022-05-17  6:53 UTC (permalink / raw
  To: gentoo-commits

commit:     ea2922465e50c1b4cd9a9e73f7f5a5f7a38a7dcb
Author:     Jakov Smolić <jsmolic <AT> gentoo <DOT> org>
AuthorDate: Tue May 17 06:53:53 2022 +0000
Commit:     Jakov Smolić <jsmolic <AT> gentoo <DOT> org>
CommitDate: Tue May 17 06:53:53 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ea292246

dev-util/mingw64-toolchain: Stabilize 10.0.0 amd64, #845111

Signed-off-by: Jakov Smolić <jsmolic <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0.ebuild
index 9ce0884ba526..e0569a0e7981 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0.ebuild
@@ -30,7 +30,7 @@ LICENSE="
 	LGPL-3+ || ( GPL-3+ libgcc libstdc++ gcc-runtime-library-exception-3.1 )
 	ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain"
 SLOT="0"
-KEYWORDS="-* ~amd64 x86"
+KEYWORDS="-* amd64 x86"
 IUSE="+abi_x86_32 custom-cflags debug"
 
 RDEPEND="


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2022-05-28 19:26 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2022-05-28 19:26 UTC (permalink / raw
  To: gentoo-commits

commit:     864b148cbfd35252de45e48beb2704b4675044ae
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Fri May 27 15:19:18 2022 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Sat May 28 19:26:07 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=864b148c

dev-util/mingw64-toolchain: fix array check

Unimportant given variables are prefixed and unlikely
users set any of these (check is to ignore envionment),
but was wrong anyway.

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0.ebuild | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0.ebuild
index e0569a0e7981..5347cee7ffdc 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0.ebuild
@@ -203,8 +203,8 @@ src_compile() {
 		# mostly unused here, so use configure directly
 		eval '
 			local conf=( "${WORKDIR}/${1}"/configure "${conf[@]}" )
-			[[ ${conf_'${id}'@a} ]] && conf+=( "${conf_'${id}'[@]}" )
-			[[ ${2} && ${conf_'${id}_${2}'@a} ]] && conf+=( "${conf_'${id}_${2}'[@]}" )
+			[[ ${conf_'${id}'@a} =~ a ]] && conf+=( "${conf_'${id}'[@]}" )
+			[[ ${2} && ${conf_'${id}_${2}'@a} =~ a ]] && conf+=( "${conf_'${id}_${2}'[@]}" )
 			conf+=( ${EXTRA_ECONF} ${MWT_'${id^^}'_CONF} )
 			[[ ${2} ]] && conf+=( ${MWT_'${1^^}_${2^^}'_CONF} )'
 


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2022-06-28  5:56 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2022-06-28  5:56 UTC (permalink / raw
  To: gentoo-commits

commit:     681186074b74f271d43d680b920effa48c30eb0e
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 28 05:08:14 2022 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Tue Jun 28 05:55:31 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=68118607

dev-util/mingw64-toolchain: symlink gcc lto plugin for AR

Don't really want to revbump this slow build over a symlink, but
it could be a long time before this is bumped normally and come
bite back when people try to use LTO.

Closes: https://bugs.gentoo.org/854516
Closes: https://bugs.gentoo.org/854540
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 ...64-toolchain-10.0.0.ebuild => mingw64-toolchain-10.0.0-r1.ebuild} | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild
similarity index 97%
rename from dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0.ebuild
rename to dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild
index 5347cee7ffdc..c0d573454f7f 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild
@@ -104,6 +104,11 @@ src_compile() {
 			ln -sf {../${CTARGET}/bin/,"${sysroot}"/bin/${CTARGET}-}${bin##*/} || die
 		done
 		ln -sf ld.bfd "${sysroot}"/${CTARGET}/bin/ld || die
+
+		# symlink gcc's lto plugin for AR (bug #854516)
+		mkdir "${sysroot}"/${CTARGET}/lib/bfd-plugins || die
+		ln -s ../../../libexec/gcc/${CTARGET}/${GCC_PV}/liblto_plugin.so \
+			"${sysroot}"/${CTARGET}/lib/bfd-plugins || die
 	}
 
 	# gcc (minimal -- if need more, disable only in stage1 / enable in stage3)


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2022-07-16 17:03 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2022-07-16 17:03 UTC (permalink / raw
  To: gentoo-commits

commit:     b7de108f84ccb8007db496f1a29f7b8a19c708bd
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 16 15:39:30 2022 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Sat Jul 16 16:56:35 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b7de108f

dev-util/mingw64-toolchain: filter -fuse-ld for mingw

flag-o-matic is looking at respecting -fuse-ld for test-flags-CCLD,
which is good but don't want this when doing the user-unexpected
switch to mingw binutils we just built (filtering feels more solid
either way).

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild
index c902601aa43c..1af4218042da 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild
@@ -196,6 +196,7 @@ src_compile() {
 				# cross-compiling, cleanup and let ./configure handle it
 				unset AR AS CC CPP CXX LD NM OBJCOPY OBJDUMP RANLIB RC STRIP
 				CHOST=${CTARGET}
+				filter-flags '-fuse-ld=*'
 				strip-unsupported-flags
 				mwt-build "${@:2}"
 			)


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2022-08-20 13:45 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2022-08-20 13:45 UTC (permalink / raw
  To: gentoo-commits

commit:     923fd018c819487e7686d949593f17c5b0d1b879
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 20 09:10:47 2022 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Sat Aug 20 13:31:32 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=923fd018

dev-util/mingw64-toolchain: add 10.0.0_p1 (2.39, 12.2.0) unkeyworded

For testing new binutils/gcc impact on wine and friends, may
potentially wait until next mingw release to keyword depending
on schedule or issues.

wine-staging-7.15 at least builds with this but haven't tested
runtime, other versions, nor looked up potential known issues yet

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/Manifest                |   2 +
 .../mingw64-toolchain-10.0.0_p1.ebuild             | 301 +++++++++++++++++++++
 2 files changed, 303 insertions(+)

diff --git a/dev-util/mingw64-toolchain/Manifest b/dev-util/mingw64-toolchain/Manifest
index 059c493a8601..9bedc4e54451 100644
--- a/dev-util/mingw64-toolchain/Manifest
+++ b/dev-util/mingw64-toolchain/Manifest
@@ -1,3 +1,5 @@
 DIST binutils-2.37.tar.xz 22916924 BLAKE2B f5a374fdf0300f7734d1e462333296b16c9d5ed6eba167e1742a4da7082f4388c929e286bf76c3933b3e434937380340732a31790723654b491ea0c8ab5b9ba5 SHA512 5c11aeef6935860a6819ed3a3c93371f052e52b4bdc5033da36037c1544d013b7f12cb8d561ec954fe7469a68f1b66f1a3cd53d5a3af7293635a90d69edd15e7
+DIST binutils-2.39.tar.xz 25167756 BLAKE2B ac6a5296c6586d53eaadcbffc5c399a6d79edf72450b9bb8b3525ce525129cef3d2eb90c85ef3bb3270b5a03b0e1ffb8f0b705f028158726f9777ebb8685066f SHA512 68e038f339a8c21faa19a57bbc447a51c817f47c2e06d740847c6e9cc3396c025d35d5369fa8c3f8b70414757c89f0e577939ddc0d70f283182504920f53b0a3
 DIST gcc-11.3.0.tar.xz 81141364 BLAKE2B 7e562d25446ca4ab9fe8cdb714866f66aba3744d78bf84f31bfb097c1a981e4c7f990cb1e6bcfec5ae6671836a4984e2b70eb8fed81dcef5e244f88da8623469 SHA512 f0be5ad705c73b84477128a69c047f57dd47002f375eb60e1e842e08cf2009a509e92152bca345823926d550b7395ae6d4de7db51d1ee371c2dc37313881fca7
+DIST gcc-12.2.0.tar.xz 84645292 BLAKE2B 715574af9ad678f9dc8cfd19c866bf910c7edfd479e7e9681337feaa9b54e5d304ddb85483816b8d89754d502405823ae2eff0d1e444538763f40be8e428d8da SHA512 e9e857bd81bf7a370307d6848c81b2f5403db8c7b5207f54bce3f3faac3bde63445684092c2bc1a2427cddb6f7746496d9fbbef05fbbd77f2810b2998f1f9173
 DIST mingw-w64-v10.0.0.tar.bz2 9620291 BLAKE2B 451372403289c492ca939d65bb4d9f6e9fa6bdd6b32d79d6438d858e106e8cc291712ada1f3f7b951a4c6908e7d0385d485ca76920af39bcf86effa48408e330 SHA512 3c0827af7c40809a867758f6cd9ef3ff0c988b43082345bf725e03949af95968d634ace99a7ffae323189549221dcb5d861de9e801f1fbc7904e446641b60516

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild
new file mode 100644
index 000000000000..dd57ff69dc53
--- /dev/null
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild
@@ -0,0 +1,301 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MULTILIB_COMPAT=( abi_x86_{32,64} )
+inherit edo flag-o-matic multilib-build toolchain-funcs
+
+# Pick versions known to work for Wine and use vanilla for simplicity,
+# ideally update only on mingw64-runtime bumps or if there's known issues
+# (please report) to avoid rebuilding the entire toolchain too often.
+# Do _p1++ rather than revbump if changing without bumping mingw64 itself.
+BINUTILS_PV=2.39
+GCC_PV=12.2.0
+MINGW_PV=$(ver_cut 1-3)
+
+DESCRIPTION="All-in-one mingw64 toolchain intended for building Wine without crossdev"
+HOMEPAGE="
+	https://www.mingw-w64.org/
+	https://gcc.gnu.org/
+	https://sourceware.org/binutils/"
+SRC_URI="
+	mirror://sourceforge/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${MINGW_PV}.tar.bz2
+	mirror://gnu/gcc/gcc-${GCC_PV}/gcc-${GCC_PV}.tar.xz
+	mirror://gnu/binutils/binutils-${BINUTILS_PV}.tar.xz"
+S="${WORKDIR}"
+
+# l1:binutils+gcc, l2:gcc(libraries), l3:mingw64-runtime
+LICENSE="
+	GPL-3+
+	LGPL-3+ || ( GPL-3+ libgcc libstdc++ gcc-runtime-library-exception-3.1 )
+	ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain"
+SLOT="0"
+#KEYWORDS="-* ~amd64 ~x86"
+IUSE="+abi_x86_32 custom-cflags debug"
+
+RDEPEND="
+	dev-libs/gmp:=
+	dev-libs/mpc:=
+	dev-libs/mpfr:=
+	sys-libs/zlib:=
+	virtual/libiconv"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+	"${FILESDIR}"/mingw64-runtime-10.0.0-tmp-files-clash.patch
+	"${FILESDIR}"/gcc-11.3.0-plugin-objdump.patch
+)
+
+pkg_pretend() {
+	[[ ${MERGE_TYPE} == binary ]] && return
+
+	tc-is-cross-compiler &&
+		die "cross-compilation of the toolchain itself is unsupported"
+}
+
+src_prepare() {
+	# rename directories to simplify both patching and the ebuild
+	mv binutils{-${BINUTILS_PV},} || die
+	mv gcc{-${GCC_PV},} || die
+	mv mingw-w64-v${MINGW_PV} mingw64 || die
+
+	default
+}
+
+src_compile() {
+	# not great but do everything in src_compile given bootstrapping
+	# process needs to be done in steps of configure+compile+install
+	# (done modular to have most package-specific things in one place)
+
+	CTARGET=$(usex x86 i686 x86_64)-w64-mingw32
+
+	MWT_D=${T}/root # use ${T} to respect VariableScope for ${D}
+	local mwtdir=/usr/lib/${PN}
+	local prefix=${EPREFIX}${mwtdir}
+	local sysroot=${MWT_D}${prefix}
+	local -x PATH=${sysroot}/bin:${PATH}
+
+	use custom-cflags || strip-flags # fancy flags are not realistic here
+
+	local multilib=false
+	use abi_x86_32 && use abi_x86_64 && multilib=true
+
+	# global configure flags
+	local conf=(
+		--build=${CBUILD:-${CHOST}}
+		--target=${CTARGET}
+		--{doc,info,man}dir=/.skip # let individual packages handle docs
+	)
+
+	# binutils
+	local conf_binutils=(
+		--prefix="${prefix}"
+		--host=${CHOST}
+		--disable-cet
+		--disable-nls
+		--disable-shared
+		--enable-default-execstack=no
+		--with-system-zlib
+		--without-debuginfod
+		--without-msgpack
+	)
+	mwt-binutils() {
+		# symlink gcc's lto plugin for AR (bug #854516)
+		mkdir "${sysroot}"/${CTARGET}/lib/bfd-plugins || die
+		ln -s ../../../libexec/gcc/${CTARGET}/${GCC_PV}/liblto_plugin.so \
+			"${sysroot}"/${CTARGET}/lib/bfd-plugins || die
+	}
+
+	# gcc (minimal -- if need more, disable only in stage1 / enable in stage3)
+	local conf_gcc=(
+		--prefix="${prefix}"
+		--host=${CHOST}
+		--disable-bootstrap
+		--disable-cet
+		--disable-gcov #843989
+		--disable-gomp
+		--disable-libquadmath
+		--disable-libsanitizer
+		--disable-libssp
+		--disable-libvtv
+		--disable-shared
+		--disable-werror
+		--with-system-zlib
+		--without-isl
+		--without-zstd
+	)
+	${multilib} || conf_gcc+=( --disable-multilib )
+
+	local conf_gcc_stage1=(
+		--enable-languages=c
+		--disable-libatomic
+		--with-sysroot="${sysroot}"
+	)
+	local -n conf_gcc_stage2=conf_gcc_stage1
+
+	local conf_gcc_stage3=(
+		--enable-languages=c,c++
+		--enable-threads=posix # needs stage3, and is required for dxvk/vkd3d
+		--with-sysroot="${prefix}"
+		--with-build-sysroot="${sysroot}"
+	)
+
+	# mingw64-runtime (split in several parts, 3 needed for gcc stages)
+	local conf_mingw64=(
+		--prefix="${prefix}"/${CTARGET}
+		--host=${CTARGET}
+		--with-sysroot=no
+		--without-{crt,headers}
+
+		# mingw .dll aren't used by wine and packages wouldn't find them
+		# at runtime, use crossdev if need dll and proper search paths
+		--disable-shared
+	)
+
+	local conf_mingw64_headers=(
+		--enable-idl
+		--with-headers
+	)
+	mwt-mingw64_headers() { ln -s ${CTARGET} "${sysroot}"/mingw || die; } #419601
+
+	local conf_mingw64_runtime=( --with-crt )
+	${multilib} ||
+		conf_mingw64_runtime+=( $(usex x86 --disable-lib64 --disable-lib32 ) )
+
+	local conf_mingw64_libraries=( --with-libraries )
+	local conf_mingw64_libraries32=(
+		--libdir="${prefix}"/${CTARGET}/lib32
+		--with-libraries
+		CC="${CTARGET}-gcc -m32"
+		RCFLAGS="--target=pe-i386 ${RCFLAGS}"
+	)
+
+	# mingw64-runtime's idl compiler (useful not to depend on wine for widl)
+	local conf_widl=( --prefix="${prefix}" )
+
+	# mwt-build [-x] <path/package-name> [stage-name]
+	# -> ./configure && make && make install && mwt-package() && mwt-package_stage()
+	# passes conf, conf_package, and conf_package_stage arrays to configure, and
+	# users can add options through environment with e.g.
+	#	MWT_BINUTILS_CONF="--some-option"
+	#	MWT_GCC_STAGE1_CONF="--some-gcc-stage1-only-option"
+	#	MWT_WIDL_CONF="--some-other-option"
+	#	EXTRA_ECONF="--global-option" (generic naming for if not reading this)
+	mwt-build() {
+		if [[ ${1} == -x ]]; then
+			(
+				# cross-compiling, cleanup and let ./configure handle it
+				unset AR AS CC CPP CXX LD NM OBJCOPY OBJDUMP RANLIB RC STRIP
+				CHOST=${CTARGET}
+				filter-flags '-fuse-ld=*'
+				strip-unsupported-flags
+				mwt-build "${@:2}"
+			)
+			return
+		fi
+
+		local id=${1##*/}
+		local build_dir=${WORKDIR}/${1}${2+_${2}}-build
+
+		# econf is not allowed in src_compile and its defaults are
+		# mostly unused here, so use configure directly
+		eval '
+			local conf=( "${WORKDIR}/${1}"/configure "${conf[@]}" )
+			[[ ${conf_'${id}'@a} =~ a ]] && conf+=( "${conf_'${id}'[@]}" )
+			[[ ${2} && ${conf_'${id}_${2}'@a} =~ a ]] && conf+=( "${conf_'${id}_${2}'[@]}" )
+			conf+=( ${EXTRA_ECONF} ${MWT_'${id^^}'_CONF} )
+			[[ ${2} ]] && conf+=( ${MWT_'${1^^}_${2^^}'_CONF} )'
+
+		einfo "Building ${id}${2+ ${2}} in ${build_dir} ..."
+
+		mkdir "${build_dir}" || die
+		pushd "${build_dir}" >/dev/null || die
+
+		edo "${conf[@]}"
+		emake
+		emake DESTDIR="${MWT_D}" install
+
+		declare -f mwt-${id} >/dev/null && edo mwt-${id}
+		declare -f mwt-${id}_${2} >/dev/null && edo mwt-${id}_${2}
+
+		popd >/dev/null || die
+	}
+
+	# build with same ordering that crossdev would do + stage3 for pthreads
+	mwt-build binutils
+	mwt-build mingw64 headers
+	mwt-build gcc stage1
+	mwt-build -x mingw64 runtime
+	mwt-build gcc stage2
+	${multilib} && mwt-build -x mingw64 libraries32
+	mwt-build -x mingw64 libraries
+	mwt-build gcc stage3
+	mwt-build mingw64/mingw-w64-tools/widl
+	# note: /could/ system-bootstrap if already installed, but gcc and
+	# libraries will use the system's older mingw64 headers/static-libs
+	# and make this potentially fragile without more workarounds/stages
+
+	if ${multilib}; then
+		# Like system's gcc, `x86_64-w64-mingw32-gcc -m32` can build for x86,
+		# but packages expect crossdev's i686-w64-mingw32-gcc which is the same
+		# just without 64bit support and would rather not build the toolchain
+		# twice. Dirty but wrap to allow simple interoperability with crossdev.
+		mwt-i686_wrapper() {
+			printf "#!/usr/bin/env sh\nexec \"${prefix}/bin/${bin}\" ${*} "'"${@}"\n' \
+				> ${bin32} || die
+			chmod +x ${bin32} || die
+		}
+		pushd "${sysroot}"/bin >/dev/null || die
+		local bin bin32
+		for bin in ${CTARGET}-*; do
+			bin32=${bin/x86_64-w64/i686-w64}
+			case ${bin#${CTARGET}-} in
+				gcc|gcc-${GCC_PV}|g++|widl) mwt-i686_wrapper -m32;;
+				ld|ld.bfd) mwt-i686_wrapper -m i386pe;;
+				windres) mwt-i686_wrapper --target=pe-i386;;
+				*) ln -s ${bin} ${bin32} || die;;
+			esac
+		done
+		popd >/dev/null || die
+	fi
+
+	# portage doesn't know the right strip executable to use for CTARGET
+	# and it can lead to .a mangling, notably with 32bit (breaks toolchain)
+	dostrip -x ${mwtdir}/{${CTARGET}/lib{,32},lib/gcc/${CTARGET}}
+
+	# ... and instead do it here given this saves ~60MB
+	if use !debug; then
+		einfo "Stripping ${CTARGET} static libraries ..."
+		find "${sysroot}"/{,lib/gcc/}${CTARGET} -type f -name '*.a' \
+			-exec ${CTARGET}-strip --strip-unneeded {} + || die
+	fi
+}
+
+src_install() {
+	# use mv over copying given it's ~370MB
+	mv "${MWT_D}${EPREFIX}"/* "${ED}" || die
+
+	# gcc handles static libs internally without needing .la
+	find "${ED}" -type f -name '*.la' -delete || die
+}
+
+pkg_postinst() {
+	if [[ ! ${REPLACING_VERSIONS} ]]; then
+		elog "Note that this package is primarily intended for Wine and related"
+		elog "packages to depend on without needing a manual crossdev setup."
+		elog
+		elog "Settings are oriented only for what these need and simplicity."
+		elog "Please use sys-devel/crossdev for full toolchain/customization:"
+		elog "    https://wiki.gentoo.org/wiki/Mingw"
+		elog "    https://wiki.gentoo.org/wiki/Crossdev"
+	fi
+
+	local cross_gcc=cross-$(usex x86 i686 x86_64)-w64-mingw32/gcc
+	if has_version ${cross_gcc}; then
+		# encourage cleanup given users may not realize if switch by default
+		ewarn "${cross_gcc} is installed, note that ${PN}"
+		ewarn "is redundant with the *-w64-mingw32/{binutils,gcc,mingw64-runtime}"
+		ewarn "packages and optionally only one needs to be kept."
+	fi
+}


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2022-08-20 13:45 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2022-08-20 13:45 UTC (permalink / raw
  To: gentoo-commits

commit:     c4262506ff492b96cddccb15e1fe1842d8d5a626
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 20 08:47:29 2022 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Sat Aug 20 13:31:32 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c4262506

dev-util/mingw64-toolchain: minor adjustments

* add MINGW_PV, comment says to use _p1++ but was unhandled
* cleanup symlinks for duplicates, upon closer look these are
  hardlinks which is good enough
* pass --disable-werror for gcc, binutils doesn't but gcc was
  using it in a few places

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 .../mingw64-toolchain-10.0.0-r1.ebuild                  | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild
index 1af4218042da..2ae2ce9b80cb 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild
@@ -12,6 +12,7 @@ inherit edo flag-o-matic multilib-build toolchain-funcs
 # Do _p1++ rather than revbump if changing without bumping mingw64 itself.
 BINUTILS_PV=2.37 # 2.38 needs bug #838106
 GCC_PV=11.3.0
+MINGW_PV=$(ver_cut 1-3)
 
 DESCRIPTION="All-in-one mingw64 toolchain intended for building Wine without crossdev"
 HOMEPAGE="
@@ -19,7 +20,7 @@ HOMEPAGE="
 	https://gcc.gnu.org/
 	https://sourceware.org/binutils/"
 SRC_URI="
-	mirror://sourceforge/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${PV}.tar.bz2
+	mirror://sourceforge/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${MINGW_PV}.tar.bz2
 	mirror://gnu/gcc/gcc-${GCC_PV}/gcc-${GCC_PV}.tar.xz
 	mirror://gnu/binutils/binutils-${BINUTILS_PV}.tar.xz"
 S="${WORKDIR}"
@@ -58,7 +59,7 @@ src_prepare() {
 	# rename directories to simplify both patching and the ebuild
 	mv binutils{-${BINUTILS_PV},} || die
 	mv gcc{-${GCC_PV},} || die
-	mv mingw-w64-v${PV} mingw64 || die
+	mv mingw-w64-v${MINGW_PV} mingw64 || die
 
 	default
 }
@@ -99,13 +100,6 @@ src_compile() {
 		--without-debuginfod
 	)
 	mwt-binutils() {
-		# replace duplicates with symlinks
-		local bin
-		for bin in "${sysroot}"/${CTARGET}/bin/*; do
-			ln -sf {../${CTARGET}/bin/,"${sysroot}"/bin/${CTARGET}-}${bin##*/} || die
-		done
-		ln -sf ld.bfd "${sysroot}"/${CTARGET}/bin/ld || die
-
 		# symlink gcc's lto plugin for AR (bug #854516)
 		mkdir "${sysroot}"/${CTARGET}/lib/bfd-plugins || die
 		ln -s ../../../libexec/gcc/${CTARGET}/${GCC_PV}/liblto_plugin.so \
@@ -125,6 +119,7 @@ src_compile() {
 		--disable-libssp
 		--disable-libvtv
 		--disable-shared
+		--disable-werror
 		--with-system-zlib
 		--without-isl
 		--without-zstd
@@ -144,10 +139,6 @@ src_compile() {
 		--with-sysroot="${prefix}"
 		--with-build-sysroot="${sysroot}"
 	)
-	mwt-gcc_stage3() {
-		# replace duplicate with symlink
-		ln -sf ${CTARGET}-gcc "${sysroot}"/bin/${CTARGET}-gcc-${GCC_PV} || die
-	}
 
 	# mingw64-runtime (split in several parts, 3 needed for gcc stages)
 	local conf_mingw64=(


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2022-08-20 13:58 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2022-08-20 13:58 UTC (permalink / raw
  To: gentoo-commits

commit:     369fbf39852300efcfa8dff3209308359678fd04
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 20 13:55:11 2022 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Sat Aug 20 13:57:52 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=369fbf39

dev-util/mingw64-toolchain: nitpick execstack option

Unsure which is intended (see =no go around for some reason?
ended up using it without thinking about it), but either do
the same and going with what's more common to disable options.

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild
index dd57ff69dc53..2f07f8f08e07 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild
@@ -93,9 +93,9 @@ src_compile() {
 		--prefix="${prefix}"
 		--host=${CHOST}
 		--disable-cet
+		--disable-default-execstack
 		--disable-nls
 		--disable-shared
-		--enable-default-execstack=no
 		--with-system-zlib
 		--without-debuginfod
 		--without-msgpack


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2022-08-29  6:55 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2022-08-29  6:55 UTC (permalink / raw
  To: gentoo-commits

commit:     5ffe0bed23563853d69d5b782167d1740efd1391
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 29 06:02:32 2022 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Mon Aug 29 06:52:42 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5ffe0bed

dev-util/mingw64-toolchain: use namerefs rather than eval

Also simplified extra econf handling a bit.

Still looks ugly, but well.

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 .../mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild   | 14 ++++++++------
 .../mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild   | 14 ++++++++------
 2 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild
index 2ae2ce9b80cb..0bfc818d9698 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild
@@ -199,12 +199,14 @@ src_compile() {
 
 		# econf is not allowed in src_compile and its defaults are
 		# mostly unused here, so use configure directly
-		eval '
-			local conf=( "${WORKDIR}/${1}"/configure "${conf[@]}" )
-			[[ ${conf_'${id}'@a} =~ a ]] && conf+=( "${conf_'${id}'[@]}" )
-			[[ ${2} && ${conf_'${id}_${2}'@a} =~ a ]] && conf+=( "${conf_'${id}_${2}'[@]}" )
-			conf+=( ${EXTRA_ECONF} ${MWT_'${id^^}'_CONF} )
-			[[ ${2} ]] && conf+=( ${MWT_'${1^^}_${2^^}'_CONF} )'
+		local conf=( "${WORKDIR}/${1}"/configure "${conf[@]}" )
+
+		local -n conf_id=conf_${id} conf_id2=conf_${id}_${2}
+		[[ ${conf_id@a} == *a* ]] && conf+=( "${conf_id[@]}" )
+		[[ ${2} && ${conf_id2@a} == *a* ]] && conf+=( "${conf_id2[@]}" )
+
+		local -n extra_id=MWT_${id^^}_CONF extra_id2=MWT_${id^^}_${2^^}_CONF
+		conf+=( ${EXTRA_ECONF} ${extra_id} ${2+${extra_id2}} )
 
 		einfo "Building ${id}${2+ ${2}} in ${build_dir} ..."
 

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild
index 2f07f8f08e07..b7092f3a3fac 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild
@@ -200,12 +200,14 @@ src_compile() {
 
 		# econf is not allowed in src_compile and its defaults are
 		# mostly unused here, so use configure directly
-		eval '
-			local conf=( "${WORKDIR}/${1}"/configure "${conf[@]}" )
-			[[ ${conf_'${id}'@a} =~ a ]] && conf+=( "${conf_'${id}'[@]}" )
-			[[ ${2} && ${conf_'${id}_${2}'@a} =~ a ]] && conf+=( "${conf_'${id}_${2}'[@]}" )
-			conf+=( ${EXTRA_ECONF} ${MWT_'${id^^}'_CONF} )
-			[[ ${2} ]] && conf+=( ${MWT_'${1^^}_${2^^}'_CONF} )'
+		local conf=( "${WORKDIR}/${1}"/configure "${conf[@]}" )
+
+		local -n conf_id=conf_${id} conf_id2=conf_${id}_${2}
+		[[ ${conf_id@a} == *a* ]] && conf+=( "${conf_id[@]}" )
+		[[ ${2} && ${conf_id2@a} == *a* ]] && conf+=( "${conf_id2[@]}" )
+
+		local -n extra_id=MWT_${id^^}_CONF extra_id2=MWT_${id^^}_${2^^}_CONF
+		conf+=( ${EXTRA_ECONF} ${extra_id} ${2+${extra_id2}} )
 
 		einfo "Building ${id}${2+ ${2}} in ${build_dir} ..."
 


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2022-08-29  6:55 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2022-08-29  6:55 UTC (permalink / raw
  To: gentoo-commits

commit:     fe373aafccbc86dff2176a0f3eb18b5e6ce5564a
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 29 06:12:21 2022 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Mon Aug 29 06:52:42 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fe373aaf

dev-util/mingw64-toolchain: restore keywords for 10.0.0_p1

Do not believe(?) new mingw is coming anytime soon and want to get
rid of old binutils and get some testing done on gcc12+binutils2.39.

So far no known issues, been using Wine built with this for a week.

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild
index b7092f3a3fac..3b878de762bf 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild
@@ -31,7 +31,7 @@ LICENSE="
 	LGPL-3+ || ( GPL-3+ libgcc libstdc++ gcc-runtime-library-exception-3.1 )
 	ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain"
 SLOT="0"
-#KEYWORDS="-* ~amd64 ~x86"
+KEYWORDS="-* ~amd64 ~x86"
 IUSE="+abi_x86_32 custom-cflags debug"
 
 RDEPEND="


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2022-09-14 19:39 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2022-09-14 19:39 UTC (permalink / raw
  To: gentoo-commits

commit:     26b669479490ec1d679bdbd38b836d6782f1e6c0
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 14 19:34:40 2022 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Wed Sep 14 19:38:37 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=26b66947

dev-util/mingw64-toolchain: filter ssp for cross mingw

Closes: https://bugs.gentoo.org/870136
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild | 1 +
 dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild | 1 +
 2 files changed, 2 insertions(+)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild
index 0bfc818d9698..59a0022ee10b 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild
@@ -187,6 +187,7 @@ src_compile() {
 				# cross-compiling, cleanup and let ./configure handle it
 				unset AR AS CC CPP CXX LD NM OBJCOPY OBJDUMP RANLIB RC STRIP
 				CHOST=${CTARGET}
+				filter-flags '-fstack-protector*' #870136
 				filter-flags '-fuse-ld=*'
 				strip-unsupported-flags
 				mwt-build "${@:2}"

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild
index 3b878de762bf..4ad2c7cf514f 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild
@@ -188,6 +188,7 @@ src_compile() {
 				# cross-compiling, cleanup and let ./configure handle it
 				unset AR AS CC CPP CXX LD NM OBJCOPY OBJDUMP RANLIB RC STRIP
 				CHOST=${CTARGET}
+				filter-flags '-fstack-protector*' #870136
 				filter-flags '-fuse-ld=*'
 				strip-unsupported-flags
 				mwt-build "${@:2}"


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2022-09-14 21:12 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2022-09-14 21:12 UTC (permalink / raw
  To: gentoo-commits

commit:     d06a9cf2f29ca13694007493173a9ebe304005de
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 14 21:08:46 2022 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Wed Sep 14 21:12:16 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d06a9cf2

Revert "dev-util/mingw64-toolchain: filter ssp for cross mingw"

This reverts commit 26b669479490ec1d679bdbd38b836d6782f1e6c0.

Will try to get libssp to work, better reverted+failing for now given
this can create a unusable build if used ssp. Could filter further to
include gcc but will also need to filter on about every mingw packages.

For those just wanting this to work meanwhile, just don't enable ssp
on neither this nor wine.

Bug: https://bugs.gentoo.org/870136
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild | 1 -
 dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild | 1 -
 2 files changed, 2 deletions(-)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild
index 59a0022ee10b..0bfc818d9698 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild
@@ -187,7 +187,6 @@ src_compile() {
 				# cross-compiling, cleanup and let ./configure handle it
 				unset AR AS CC CPP CXX LD NM OBJCOPY OBJDUMP RANLIB RC STRIP
 				CHOST=${CTARGET}
-				filter-flags '-fstack-protector*' #870136
 				filter-flags '-fuse-ld=*'
 				strip-unsupported-flags
 				mwt-build "${@:2}"

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild
index 4ad2c7cf514f..3b878de762bf 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild
@@ -188,7 +188,6 @@ src_compile() {
 				# cross-compiling, cleanup and let ./configure handle it
 				unset AR AS CC CPP CXX LD NM OBJCOPY OBJDUMP RANLIB RC STRIP
 				CHOST=${CTARGET}
-				filter-flags '-fstack-protector*' #870136
 				filter-flags '-fuse-ld=*'
 				strip-unsupported-flags
 				mwt-build "${@:2}"


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2022-09-14 23:11 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2022-09-14 23:11 UTC (permalink / raw
  To: gentoo-commits

commit:     6087ef400265ab5a85bff365e0ba370a55da8e47
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 14 22:22:19 2022 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Wed Sep 14 23:10:16 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6087ef40

Revert "Revert "dev-util/mingw64-toolchain: filter ssp for cross mingw""

This reverts commit d06a9cf2f29ca13694007493173a9ebe304005de.

This turned out to be fine, was misled that it may have leaked
to gcc's own libraries rather than just mingw's crt.

Still require filtering ssp on every mingw packages though,
strip-unsupported-flags can't pickup that this will fail with
a basic `int main(void) { return 0; }` compiler test.

Closes: https://bugs.gentoo.org/870136
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild | 1 +
 dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild | 1 +
 2 files changed, 2 insertions(+)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild
index 0bfc818d9698..59a0022ee10b 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild
@@ -187,6 +187,7 @@ src_compile() {
 				# cross-compiling, cleanup and let ./configure handle it
 				unset AR AS CC CPP CXX LD NM OBJCOPY OBJDUMP RANLIB RC STRIP
 				CHOST=${CTARGET}
+				filter-flags '-fstack-protector*' #870136
 				filter-flags '-fuse-ld=*'
 				strip-unsupported-flags
 				mwt-build "${@:2}"

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild
index 3b878de762bf..4ad2c7cf514f 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild
@@ -188,6 +188,7 @@ src_compile() {
 				# cross-compiling, cleanup and let ./configure handle it
 				unset AR AS CC CPP CXX LD NM OBJCOPY OBJDUMP RANLIB RC STRIP
 				CHOST=${CTARGET}
+				filter-flags '-fstack-protector*' #870136
 				filter-flags '-fuse-ld=*'
 				strip-unsupported-flags
 				mwt-build "${@:2}"


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2022-09-16  7:47 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2022-09-16  7:47 UTC (permalink / raw
  To: gentoo-commits

commit:     82bfe66fdcce6b7b709bbe95c2125f3d93ff2a62
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 16 06:55:49 2022 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Fri Sep 16 07:46:48 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=82bfe66f

dev-util/mingw64-toolchain: stabilize 10.0.0_p1 for amd64, x86

gcc-12/binutils-2.39 been tested more than 11/2.37 lately due to
working on new ebuilds and want to get rid of 2.37, should be no
reasons to hold this back

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild
index 4ad2c7cf514f..19bd919bebec 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild
@@ -31,7 +31,7 @@ LICENSE="
 	LGPL-3+ || ( GPL-3+ libgcc libstdc++ gcc-runtime-library-exception-3.1 )
 	ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain"
 SLOT="0"
-KEYWORDS="-* ~amd64 ~x86"
+KEYWORDS="-* amd64 x86"
 IUSE="+abi_x86_32 custom-cflags debug"
 
 RDEPEND="


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2022-09-16  7:54 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2022-09-16  7:54 UTC (permalink / raw
  To: gentoo-commits

commit:     1ebddce44856176c380d0f5599cea82b00e8a542
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 16 07:52:46 2022 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Fri Sep 16 07:54:05 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1ebddce4

dev-util/mingw64-toolchain: adjust postinst elog

Sounded a bit like doing this was recommended rather
than only for a as-needed basis.

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild | 2 +-
 dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild
index 59a0022ee10b..e88628a96cfb 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild
@@ -288,7 +288,7 @@ pkg_postinst() {
 		elog "packages to depend on without needing a manual crossdev setup."
 		elog
 		elog "Settings are oriented only for what these need and simplicity."
-		elog "Please use sys-devel/crossdev for full toolchain/customization:"
+		elog "Use sys-devel/crossdev if need full toolchain/customization:"
 		elog "    https://wiki.gentoo.org/wiki/Mingw"
 		elog "    https://wiki.gentoo.org/wiki/Crossdev"
 	fi

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild
index 19bd919bebec..d5ea4cc5118d 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild
@@ -289,7 +289,7 @@ pkg_postinst() {
 		elog "packages to depend on without needing a manual crossdev setup."
 		elog
 		elog "Settings are oriented only for what these need and simplicity."
-		elog "Please use sys-devel/crossdev for full toolchain/customization:"
+		elog "Use sys-devel/crossdev if need full toolchain/customization:"
 		elog "    https://wiki.gentoo.org/wiki/Mingw"
 		elog "    https://wiki.gentoo.org/wiki/Crossdev"
 	fi


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2022-09-16 16:17 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2022-09-16 16:17 UTC (permalink / raw
  To: gentoo-commits

commit:     e855eb72fd45d7a1cb013e658fdeb49636ffe7af
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 16 15:48:13 2022 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Fri Sep 16 16:17:19 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e855eb72

dev-util/mingw64-toolchain: fix lto again

Was wondering why AR was looking for the lto plugin in a non-existing
bfd-plugins directory before, turned out it was because gcc resolved
its location differently when set as a symlink.

In commit c4262506ff492b96cddccb15e1fe1842d8d5a626, reverted to using
upstream's intended hardlink but didn't notice this change in behavior
and it broke lto again.

Bug: https://bugs.gentoo.org/854516
Fixes: c4262506ff492b96cddccb15e1fe1842d8d5a626
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 ...toolchain-10.0.0-r1.ebuild => mingw64-toolchain-10.0.0-r2.ebuild} | 5 ++---
 ...lchain-10.0.0_p1.ebuild => mingw64-toolchain-10.0.0_p1-r1.ebuild} | 5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r2.ebuild
similarity index 98%
rename from dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild
rename to dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r2.ebuild
index e88628a96cfb..a7fc75296ccc 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r1.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0-r2.ebuild
@@ -101,9 +101,8 @@ src_compile() {
 	)
 	mwt-binutils() {
 		# symlink gcc's lto plugin for AR (bug #854516)
-		mkdir "${sysroot}"/${CTARGET}/lib/bfd-plugins || die
-		ln -s ../../../libexec/gcc/${CTARGET}/${GCC_PV}/liblto_plugin.so \
-			"${sysroot}"/${CTARGET}/lib/bfd-plugins || die
+		ln -s ../../libexec/gcc/${CTARGET}/${GCC_PV}/liblto_plugin.so \
+			"${sysroot}"/lib/bfd-plugins || die
 	}
 
 	# gcc (minimal -- if need more, disable only in stage1 / enable in stage3)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r1.ebuild
similarity index 98%
rename from dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild
rename to dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r1.ebuild
index d5ea4cc5118d..bc9e79c199db 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r1.ebuild
@@ -102,9 +102,8 @@ src_compile() {
 	)
 	mwt-binutils() {
 		# symlink gcc's lto plugin for AR (bug #854516)
-		mkdir "${sysroot}"/${CTARGET}/lib/bfd-plugins || die
-		ln -s ../../../libexec/gcc/${CTARGET}/${GCC_PV}/liblto_plugin.so \
-			"${sysroot}"/${CTARGET}/lib/bfd-plugins || die
+		ln -s ../../libexec/gcc/${CTARGET}/${GCC_PV}/liblto_plugin.so \
+			"${sysroot}"/lib/bfd-plugins || die
 	}
 
 	# gcc (minimal -- if need more, disable only in stage1 / enable in stage3)


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2022-10-23  7:20 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2022-10-23  7:20 UTC (permalink / raw
  To: gentoo-commits

commit:     d9512a3db7da6f8ee2afa1854b370a37cea0abaf
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 23 07:15:50 2022 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Sun Oct 23 07:20:05 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d9512a3d

dev-util/mingw64-toolchain: filter -fstack-clash-protection

Bug: https://bugs.gentoo.org/758914
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r1.ebuild | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r1.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r1.ebuild
index 650225a5218e..ca6dcfd5cefd 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r1.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r1.ebuild
@@ -188,6 +188,7 @@ src_compile() {
 				# cross-compiling, cleanup and let ./configure handle it
 				unset AR AS CC CPP CXX LD NM OBJCOPY OBJDUMP RANLIB RC STRIP
 				CHOST=${CTARGET}
+				filter-flags '-fstack-clash-protection' #758914
 				filter-flags '-fstack-protector*' #870136
 				filter-flags '-fuse-ld=*'
 				strip-unsupported-flags


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2022-10-31  0:54 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2022-10-31  0:54 UTC (permalink / raw
  To: gentoo-commits

commit:     64c008020223a6a6a7ccacdbc02b98378f81540e
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 31 00:46:34 2022 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Mon Oct 31 00:47:51 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=64c00802

dev-util/mingw64-toolchain: filter -mfunction-return=thunk for mingw

Unfortunately mingw doesn't play well with many security/mitigation
flags. May need to consider a mingw.eclass if keep adding more of
these to every ebuilds using it.

Closes: https://bugs.gentoo.org/878849
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r1.ebuild | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r1.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r1.ebuild
index ca6dcfd5cefd..4b6d2cf8e8e0 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r1.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r1.ebuild
@@ -191,6 +191,7 @@ src_compile() {
 				filter-flags '-fstack-clash-protection' #758914
 				filter-flags '-fstack-protector*' #870136
 				filter-flags '-fuse-ld=*'
+				filter-flags '-mfunction-return=thunk*' #878849
 				strip-unsupported-flags
 				mwt-build "${@:2}"
 			)


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2022-11-12 11:33 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2022-11-12 11:33 UTC (permalink / raw
  To: gentoo-commits

commit:     7701fe3a1016af768c99b722169c6aabf28be5c8
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 12 03:26:25 2022 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Sat Nov 12 11:15:57 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7701fe3a

dev-util/mingw64-toolchain: use 32bit wrapper for gas+cpp too

Overlooked given gcc normally calls AS the right way itself,
but >=wine-7.21 started to use it directly.

cpp wrapper isn't needed for wine, but do it anyway to ensure
proper macro tests everywhere.

Sorry for the large rebuild over this.

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 ...chain-10.0.0_p1-r1.ebuild => mingw64-toolchain-10.0.0_p1-r2.ebuild} | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r1.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r2.ebuild
similarity index 99%
rename from dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r1.ebuild
rename to dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r2.ebuild
index 1394d8b7f905..d3215a0ed723 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r1.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r2.ebuild
@@ -260,7 +260,8 @@ src_compile() {
 		for bin in ${CTARGET}-*; do
 			bin32=${bin/x86_64-w64/i686-w64}
 			case ${bin#${CTARGET}-} in
-				gcc|gcc-${GCC_PV}|g++|widl) mwt-i686_wrapper -m32;;
+				as) mwt-i686_wrapper --32;;
+				cpp|gcc|gcc-${GCC_PV}|g++|widl) mwt-i686_wrapper -m32;;
 				ld|ld.bfd) mwt-i686_wrapper -m i386pe;;
 				windres) mwt-i686_wrapper --target=pe-i386;;
 				*) ln -s ${bin} ${bin32} || die;;


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2023-01-15  7:00 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2023-01-15  7:00 UTC (permalink / raw
  To: gentoo-commits

commit:     b33d409a2d2e4e612914be8482b69a5b23675511
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 15 05:31:22 2023 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Sun Jan 15 06:59:53 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b33d409a

dev-util/mingw64-toolchain: add 10.0.0_p2 unkeyworded

For testing binutils-2.40, but really only unkeyworded because hoping
to bump something else at same time (runtime or gcc) before exposing
to most users due to the long build time.

Also:
* switch to --with-gcc-major-version-only, unimportent here but
  doesn't hurt to be consistent with system's
* explicitly filter-lto regardless of custom-cflags as it's
  guaranteed to not work (would need a USE=lto, and perhaps
  still skip for mingw static libs as this is fragile)

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/Manifest                |   1 +
 .../mingw64-toolchain-10.0.0_p2.ebuild             | 315 +++++++++++++++++++++
 2 files changed, 316 insertions(+)

diff --git a/dev-util/mingw64-toolchain/Manifest b/dev-util/mingw64-toolchain/Manifest
index ec14b3eba767..e2d41c1f9190 100644
--- a/dev-util/mingw64-toolchain/Manifest
+++ b/dev-util/mingw64-toolchain/Manifest
@@ -1,3 +1,4 @@
 DIST binutils-2.39.tar.xz 25167756 BLAKE2B ac6a5296c6586d53eaadcbffc5c399a6d79edf72450b9bb8b3525ce525129cef3d2eb90c85ef3bb3270b5a03b0e1ffb8f0b705f028158726f9777ebb8685066f SHA512 68e038f339a8c21faa19a57bbc447a51c817f47c2e06d740847c6e9cc3396c025d35d5369fa8c3f8b70414757c89f0e577939ddc0d70f283182504920f53b0a3
+DIST binutils-2.40.tar.xz 25241484 BLAKE2B 8d799f7c595f878b9af5b17a490021dd8b8300ac2fe0ed8574c012929d22d2d0493e003a3e631a9436e8e712da801779b777c566167fe42b0bde119ffa5ad1c2 SHA512 a37e042523bc46494d99d5637c3f3d8f9956d9477b748b3b1f6d7dfbb8d968ed52c932e88a4e946c6f77b8f48f1e1b360ca54c3d298f17193f3b4963472f6925
 DIST gcc-12.2.0.tar.xz 84645292 BLAKE2B 715574af9ad678f9dc8cfd19c866bf910c7edfd479e7e9681337feaa9b54e5d304ddb85483816b8d89754d502405823ae2eff0d1e444538763f40be8e428d8da SHA512 e9e857bd81bf7a370307d6848c81b2f5403db8c7b5207f54bce3f3faac3bde63445684092c2bc1a2427cddb6f7746496d9fbbef05fbbd77f2810b2998f1f9173
 DIST mingw-w64-v10.0.0.tar.bz2 9620291 BLAKE2B 451372403289c492ca939d65bb4d9f6e9fa6bdd6b32d79d6438d858e106e8cc291712ada1f3f7b951a4c6908e7d0385d485ca76920af39bcf86effa48408e330 SHA512 3c0827af7c40809a867758f6cd9ef3ff0c988b43082345bf725e03949af95968d634ace99a7ffae323189549221dcb5d861de9e801f1fbc7904e446641b60516

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p2.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p2.ebuild
new file mode 100644
index 000000000000..4fcbb96b0cb6
--- /dev/null
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p2.ebuild
@@ -0,0 +1,315 @@
+# Copyright 2022-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MULTILIB_COMPAT=( abi_x86_{32,64} )
+inherit edo flag-o-matic multilib-build toolchain-funcs
+
+# Pick versions known to work for Wine and use vanilla for simplicity,
+# ideally update only on mingw64-runtime bumps or if toolchain is getting
+# too outdated to avoid rebuilding the entire toolchain too often.
+# Do _p1++ rather than revbump if changing without bumping mingw64 itself.
+BINUTILS_PV=2.40
+GCC_PV=12.2.0
+MINGW_PV=$(ver_cut 1-3)
+
+DESCRIPTION="All-in-one mingw64 toolchain intended for building Wine without crossdev"
+HOMEPAGE="
+	https://www.mingw-w64.org/
+	https://gcc.gnu.org/
+	https://sourceware.org/binutils/"
+SRC_URI="
+	mirror://sourceforge/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${MINGW_PV}.tar.bz2
+	mirror://gnu/gcc/gcc-${GCC_PV}/gcc-${GCC_PV}.tar.xz
+	mirror://gnu/binutils/binutils-${BINUTILS_PV}.tar.xz
+	https://sourceware.org/pub/binutils/releases/binutils-${BINUTILS_PV}.tar.xz"
+S="${WORKDIR}"
+
+# l1:binutils+gcc, l2:gcc(libraries), l3:mingw64-runtime
+LICENSE="
+	GPL-3+
+	LGPL-3+ || ( GPL-3+ libgcc libstdc++ gcc-runtime-library-exception-3.1 )
+	ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain"
+SLOT="0"
+# unkeyworded for testing new binutils, keywording may wait until can bump
+# either gcc or mingw64-runtime at same time given the long build time
+#KEYWORDS="-* ~amd64 ~x86"
+IUSE="+abi_x86_32 custom-cflags debug"
+
+RDEPEND="
+	dev-libs/gmp:=
+	dev-libs/mpc:=
+	dev-libs/mpfr:=
+	sys-libs/zlib:=
+	virtual/libiconv"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+	"${FILESDIR}"/mingw64-runtime-10.0.0-msvcr-extra-race.patch
+	"${FILESDIR}"/mingw64-runtime-10.0.0-tmp-files-clash.patch
+	"${FILESDIR}"/gcc-11.3.0-plugin-objdump.patch
+	"${FILESDIR}"/gcc-12.2.0-drop-cflags-sed.patch
+)
+
+pkg_pretend() {
+	[[ ${MERGE_TYPE} == binary ]] && return
+
+	tc-is-cross-compiler &&
+		die "cross-compilation of the toolchain itself is unsupported"
+}
+
+src_prepare() {
+	# rename directories to simplify both patching and the ebuild
+	mv binutils{-${BINUTILS_PV},} || die
+	mv gcc{-${GCC_PV},} || die
+	mv mingw-w64-v${MINGW_PV} mingw64 || die
+
+	default
+}
+
+src_compile() {
+	# not great but do everything in src_compile given bootstrapping
+	# process needs to be done in steps of configure+compile+install
+	# (done modular to have most package-specific things in one place)
+
+	CTARGET=$(usex x86 i686 x86_64)-w64-mingw32
+
+	MWT_D=${T}/root # moved to ${D} in src_install
+	local mwtdir=/usr/lib/${PN}
+	local prefix=${EPREFIX}${mwtdir}
+	local sysroot=${MWT_D}${prefix}
+	local -x PATH=${sysroot}/bin:${PATH}
+
+	filter-lto # requires setting up, and may be messy with mingw static libs
+	use custom-cflags || strip-flags # fancy flags are not realistic here
+
+	local multilib=false
+	use abi_x86_32 && use abi_x86_64 && multilib=true
+
+	# global configure flags
+	local conf=(
+		--build=${CBUILD:-${CHOST}}
+		--target=${CTARGET}
+		--{doc,info,man}dir=/.skip # let individual packages handle docs
+	)
+
+	# binutils
+	local conf_binutils=(
+		--prefix="${prefix}"
+		--host=${CHOST}
+		--disable-cet
+		--disable-default-execstack
+		--disable-nls
+		--disable-shared
+		--with-system-zlib
+		--without-debuginfod
+		--without-msgpack
+		--without-zstd
+	)
+	mwt-binutils() {
+		# symlink gcc's lto plugin for AR (bug #854516)
+		ln -s ../../libexec/gcc/${CTARGET}/${GCC_PV%%.*}/liblto_plugin.so \
+			"${sysroot}"/lib/bfd-plugins || die
+	}
+
+	# gcc (minimal -- if need more, disable only in stage1 / enable in stage3)
+	local conf_gcc=(
+		--prefix="${prefix}"
+		--host=${CHOST}
+		--disable-bootstrap
+		--disable-cet
+		--disable-gcov #843989
+		--disable-gomp
+		--disable-libquadmath
+		--disable-libsanitizer
+		--disable-libssp
+		--disable-libvtv
+		--disable-shared
+		--disable-werror
+		--with-gcc-major-version-only
+		--with-system-zlib
+		--without-isl
+		--without-zstd
+	)
+	${multilib} || conf_gcc+=( --disable-multilib )
+
+	local conf_gcc_stage1=(
+		--enable-languages=c
+		--disable-libatomic
+		--with-sysroot="${sysroot}"
+	)
+	local -n conf_gcc_stage2=conf_gcc_stage1
+
+	local conf_gcc_stage3=(
+		--enable-languages=c,c++
+		--enable-threads=posix # needs stage3, and is required for dxvk/vkd3d
+		--with-sysroot="${prefix}"
+		--with-build-sysroot="${sysroot}"
+	)
+
+	# mingw64-runtime (split in several parts, 3 needed for gcc stages)
+	local conf_mingw64=(
+		--prefix="${prefix}"/${CTARGET}
+		--host=${CTARGET}
+		--with-sysroot=no
+		--without-{crt,headers}
+
+		# mingw .dll aren't used by wine and packages wouldn't find them
+		# at runtime, use crossdev if need dll and proper search paths
+		--disable-shared
+	)
+
+	local conf_mingw64_headers=(
+		--enable-idl
+		--with-headers
+	)
+	mwt-mingw64_headers() { ln -s ${CTARGET} "${sysroot}"/mingw || die; } #419601
+
+	local conf_mingw64_runtime=( --with-crt )
+	${multilib} ||
+		conf_mingw64_runtime+=( $(usex x86 --disable-lib64 --disable-lib32 ) )
+
+	local conf_mingw64_libraries=( --with-libraries )
+	local conf_mingw64_libraries32=(
+		--libdir="${prefix}"/${CTARGET}/lib32
+		--with-libraries
+		CC="${CTARGET}-gcc -m32"
+		RCFLAGS="--target=pe-i386 ${RCFLAGS}"
+	)
+
+	# mingw64-runtime's idl compiler (useful not to depend on wine for widl)
+	local conf_widl=( --prefix="${prefix}" )
+
+	# mwt-build [-x] <path/package-name> [stage-name]
+	# -> ./configure && make && make install && mwt-package() && mwt-package_stage()
+	# passes conf, conf_package, and conf_package_stage arrays to configure, and
+	# users can add options through environment with e.g.
+	#	MWT_BINUTILS_CONF="--some-option"
+	#	MWT_GCC_STAGE1_CONF="--some-gcc-stage1-only-option"
+	#	MWT_WIDL_CONF="--some-other-option"
+	#	EXTRA_ECONF="--global-option" (generic naming for if not reading this)
+	mwt-build() {
+		if [[ ${1} == -x ]]; then
+			(
+				# cross-compiling, cleanup and let ./configure handle it
+				unset AR AS CC CPP CXX LD NM OBJCOPY OBJDUMP RANLIB RC STRIP
+				CHOST=${CTARGET}
+				filter-flags '-fstack-clash-protection' #758914
+				filter-flags '-fstack-protector*' #870136
+				filter-flags '-fuse-ld=*'
+				filter-flags '-mfunction-return=thunk*' #878849
+				strip-unsupported-flags
+				mwt-build "${@:2}"
+			)
+			return
+		fi
+
+		local id=${1##*/}
+		local build_dir=${WORKDIR}/${1}${2+_${2}}-build
+
+		# econf is not allowed in src_compile and its defaults are
+		# mostly unused here, so use configure directly
+		local conf=( "${WORKDIR}/${1}"/configure "${conf[@]}" )
+
+		local -n conf_id=conf_${id} conf_id2=conf_${id}_${2}
+		[[ ${conf_id@a} == *a* ]] && conf+=( "${conf_id[@]}" )
+		[[ ${2} && ${conf_id2@a} == *a* ]] && conf+=( "${conf_id2[@]}" )
+
+		local -n extra_id=MWT_${id^^}_CONF extra_id2=MWT_${id^^}_${2^^}_CONF
+		conf+=( ${EXTRA_ECONF} ${extra_id} ${2+${extra_id2}} )
+
+		einfo "Building ${id}${2+ ${2}} in ${build_dir} ..."
+
+		mkdir -p "${build_dir}" || die
+		pushd "${build_dir}" >/dev/null || die
+
+		edo "${conf[@]}"
+		emake
+		emake DESTDIR="${MWT_D}" install
+
+		declare -f mwt-${id} >/dev/null && edo mwt-${id}
+		declare -f mwt-${id}_${2} >/dev/null && edo mwt-${id}_${2}
+
+		popd >/dev/null || die
+	}
+
+	# workaround race condition with out-of-source crt build (bug #879537)
+	mkdir -p mingw64_runtime-build/mingw-w64-crt/lib{32,64} || die
+
+	# build with same ordering that crossdev would do + stage3 for pthreads
+	mwt-build binutils
+	mwt-build mingw64 headers
+	mwt-build gcc stage1
+	mwt-build -x mingw64 runtime
+	mwt-build gcc stage2
+	${multilib} && mwt-build -x mingw64 libraries32
+	mwt-build -x mingw64 libraries
+	mwt-build gcc stage3
+	mwt-build mingw64/mingw-w64-tools/widl
+	# note: /could/ system-bootstrap if already installed, but gcc and
+	# libraries will use the system's older mingw64 headers/static-libs
+	# and make this potentially fragile without more workarounds/stages
+
+	if ${multilib}; then
+		# Like system's gcc, `x86_64-w64-mingw32-gcc -m32` can build for x86,
+		# but packages expect crossdev's i686-w64-mingw32-gcc which is the same
+		# just without 64bit support and would rather not build the toolchain
+		# twice. Dirty but wrap to allow simple interoperability with crossdev.
+		mwt-i686_wrapper() {
+			printf "#!/usr/bin/env sh\nexec \"${prefix}/bin/${bin}\" ${*} "'"${@}"\n' \
+				> ${bin32} || die
+			chmod +x ${bin32} || die
+		}
+		pushd "${sysroot}"/bin >/dev/null || die
+		local bin bin32
+		for bin in ${CTARGET}-*; do
+			bin32=${bin/x86_64-w64/i686-w64}
+			case ${bin#${CTARGET}-} in
+				as) mwt-i686_wrapper --32;;
+				cpp|gcc|gcc-${GCC_PV%%.*}|g++|widl) mwt-i686_wrapper -m32;;
+				ld|ld.bfd) mwt-i686_wrapper -m i386pe;;
+				windres) mwt-i686_wrapper --target=pe-i386;;
+				*) ln -s ${bin} ${bin32} || die;;
+			esac
+		done
+		popd >/dev/null || die
+	fi
+
+	# portage doesn't know the right strip executable to use for CTARGET
+	# and it can lead to .a mangling, notably with 32bit (breaks toolchain)
+	dostrip -x ${mwtdir}/{${CTARGET}/lib{,32},lib/gcc/${CTARGET}}
+
+	# ... and instead do it here given this saves ~60MB
+	if use !debug; then
+		einfo "Stripping ${CTARGET} static libraries ..."
+		find "${sysroot}"/{,lib/gcc/}${CTARGET} -type f -name '*.a' \
+			-exec ${CTARGET}-strip --strip-unneeded {} + || die
+	fi
+}
+
+src_install() {
+	mv "${MWT_D}${EPREFIX}"/* "${ED}" || die
+
+	find "${ED}" -type f -name '*.la' -delete || die
+}
+
+pkg_postinst() {
+	if [[ ! ${REPLACING_VERSIONS} ]]; then
+		elog "Note that this package is primarily intended for Wine and related"
+		elog "packages to depend on without needing a manual crossdev setup."
+		elog
+		elog "Settings are oriented only for what these need and simplicity."
+		elog "Use sys-devel/crossdev if need full toolchain/customization:"
+		elog "    https://wiki.gentoo.org/wiki/Mingw"
+		elog "    https://wiki.gentoo.org/wiki/Crossdev"
+	fi
+
+	local cross_gcc=cross-$(usex x86 i686 x86_64)-w64-mingw32/gcc
+	if has_version ${cross_gcc}; then
+		# encourage cleanup given users may not realize if switch by default
+		ewarn "${cross_gcc} is installed, note that ${PN}"
+		ewarn "is redundant with the *-w64-mingw32/{binutils,gcc,mingw64-runtime}"
+		ewarn "packages and optionally only one needs to be kept."
+	fi
+}


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2023-02-01 21:04 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2023-02-01 21:04 UTC (permalink / raw
  To: gentoo-commits

commit:     f4ef7718112f02679e4a66c22cf3482916f9ea99
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Wed Feb  1 20:53:21 2023 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Wed Feb  1 21:02:51 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f4ef7718

dev-util/mingw64-toolchain: cleanup alternate binutils-2.40 src_uri

Was used because .xz was missing from mirror://, but it's there now.

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p2.ebuild | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p2.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p2.ebuild
index 4fcbb96b0cb6..2f27e2bb7149 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p2.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p2.ebuild
@@ -22,8 +22,7 @@ HOMEPAGE="
 SRC_URI="
 	mirror://sourceforge/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${MINGW_PV}.tar.bz2
 	mirror://gnu/gcc/gcc-${GCC_PV}/gcc-${GCC_PV}.tar.xz
-	mirror://gnu/binutils/binutils-${BINUTILS_PV}.tar.xz
-	https://sourceware.org/pub/binutils/releases/binutils-${BINUTILS_PV}.tar.xz"
+	mirror://gnu/binutils/binutils-${BINUTILS_PV}.tar.xz"
 S="${WORKDIR}"
 
 # l1:binutils+gcc, l2:gcc(libraries), l3:mingw64-runtime


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2023-04-26  8:37 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2023-04-26  8:37 UTC (permalink / raw
  To: gentoo-commits

commit:     d40efb39554df7bcabaf53648aa0ee808f680660
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 26 08:03:20 2023 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Wed Apr 26 08:36:50 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d40efb39

dev-util/mingw64-toolchain: add 10.0.0_p4 w/ gcc-13.1.0 (keyworded)

Been using _p3 with a bit earlier 13 pre-release + binutils-2.40
with Wine for a bit and no known issues at the moment.

Closes: https://bugs.gentoo.org/898778
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/Manifest                |   1 +
 .../mingw64-toolchain-10.0.0_p4.ebuild             | 321 +++++++++++++++++++++
 2 files changed, 322 insertions(+)

diff --git a/dev-util/mingw64-toolchain/Manifest b/dev-util/mingw64-toolchain/Manifest
index b3f53ced509a..a521d157a1ce 100644
--- a/dev-util/mingw64-toolchain/Manifest
+++ b/dev-util/mingw64-toolchain/Manifest
@@ -2,4 +2,5 @@ DIST binutils-2.39.tar.xz 25167756 BLAKE2B ac6a5296c6586d53eaadcbffc5c399a6d79ed
 DIST binutils-2.40.tar.xz 25241484 BLAKE2B 8d799f7c595f878b9af5b17a490021dd8b8300ac2fe0ed8574c012929d22d2d0493e003a3e631a9436e8e712da801779b777c566167fe42b0bde119ffa5ad1c2 SHA512 a37e042523bc46494d99d5637c3f3d8f9956d9477b748b3b1f6d7dfbb8d968ed52c932e88a4e946c6f77b8f48f1e1b360ca54c3d298f17193f3b4963472f6925
 DIST gcc-12.2.0.tar.xz 84645292 BLAKE2B 715574af9ad678f9dc8cfd19c866bf910c7edfd479e7e9681337feaa9b54e5d304ddb85483816b8d89754d502405823ae2eff0d1e444538763f40be8e428d8da SHA512 e9e857bd81bf7a370307d6848c81b2f5403db8c7b5207f54bce3f3faac3bde63445684092c2bc1a2427cddb6f7746496d9fbbef05fbbd77f2810b2998f1f9173
 DIST gcc-13-20230416.tar.xz 83936936 BLAKE2B c052fff2838a0bdd87f90345a5f7f5c607a6fe360b02ce8cb076f6dd3a62f6aae0c7d3914eee447e9c92c971331ddcbf0c94f2aa120aef89a742162b5e7dbfdd SHA512 222bb6db05b23aeb428262c69319a4964097065a88a5ae6c19b104c31af82c465f139c08f01bb077b0e776685769b77a54b772ebc4e2057e7c3e8954283997cf
+DIST gcc-13.1.0.tar.xz 87451196 BLAKE2B b956a773cffe8b43bd6c9a99fe614f53f665438925a6b320975d301f547923e45d4d6fa577a143467fb03e0a9c1bab2b6719a1011d672367f3e644433a2d7606 SHA512 6cf06dfc48f57f5e67f7efe3248019329a14d690c728d9f2f7ef5fa0d58f1816f309586ba7ea2eac20d0b60a2d1b701f68392e9067dd46f827ba0efd7192db33
 DIST mingw-w64-v10.0.0.tar.bz2 9620291 BLAKE2B 451372403289c492ca939d65bb4d9f6e9fa6bdd6b32d79d6438d858e106e8cc291712ada1f3f7b951a4c6908e7d0385d485ca76920af39bcf86effa48408e330 SHA512 3c0827af7c40809a867758f6cd9ef3ff0c988b43082345bf725e03949af95968d634ace99a7ffae323189549221dcb5d861de9e801f1fbc7904e446641b60516

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p4.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p4.ebuild
new file mode 100644
index 000000000000..daed2fea783e
--- /dev/null
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p4.ebuild
@@ -0,0 +1,321 @@
+# Copyright 2022-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MULTILIB_COMPAT=( abi_x86_{32,64} )
+inherit edo flag-o-matic multilib-build toolchain-funcs
+
+# Pick versions known to work for wine+dxvk, and avoid too frequent updates
+# due to slow rebuilds. Do _p1++ rather than revbump on changes (not using
+# Gentoo patchsets for simplicity, their changes are mostly unneeded here).
+BINUTILS_PV=2.40
+GCC_PV=13.1.0
+MINGW_PV=$(ver_cut 1-3)
+
+DESCRIPTION="All-in-one mingw64 toolchain intended for building Wine without crossdev"
+HOMEPAGE="
+	https://www.mingw-w64.org/
+	https://gcc.gnu.org/
+	https://sourceware.org/binutils/"
+SRC_URI="
+	mirror://sourceforge/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${MINGW_PV}.tar.bz2
+	mirror://gnu/binutils/binutils-${BINUTILS_PV}.tar.xz"
+if [[ ${GCC_PV} == *-* ]]; then
+	SRC_URI+=" mirror://gcc/snapshots/${GCC_PV}/gcc-${GCC_PV}.tar.xz"
+else
+	SRC_URI+="
+		mirror://gcc/gcc-${GCC_PV}/gcc-${GCC_PV}.tar.xz
+		mirror://gnu/gcc/gcc-${GCC_PV}/gcc-${GCC_PV}.tar.xz"
+fi
+S="${WORKDIR}"
+
+# l1:binutils+gcc, l2:gcc(libraries), l3:mingw64-runtime
+LICENSE="
+	GPL-3+
+	LGPL-3+ || ( GPL-3+ libgcc libstdc++ gcc-runtime-library-exception-3.1 )
+	ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="+abi_x86_32 custom-cflags debug"
+
+RDEPEND="
+	dev-libs/gmp:=
+	dev-libs/mpc:=
+	dev-libs/mpfr:=
+	sys-libs/zlib:=
+	virtual/libiconv"
+DEPEND="${RDEPEND}"
+
+QA_CONFIG_IMPL_DECL_SKIP=(
+	strerror_r # libstdc++ test using -Wimplicit+error
+)
+
+PATCHES=(
+	"${FILESDIR}"/mingw64-runtime-10.0.0-msvcr-extra-race.patch
+	"${FILESDIR}"/mingw64-runtime-10.0.0-tmp-files-clash.patch
+	"${FILESDIR}"/binutils-2.40-import-lib.patch
+	"${FILESDIR}"/gcc-12.2.0-drop-cflags-sed.patch
+)
+
+pkg_pretend() {
+	[[ ${MERGE_TYPE} == binary ]] && return
+
+	tc-is-cross-compiler &&
+		die "cross-compilation of the toolchain itself is unsupported"
+}
+
+src_prepare() {
+	# rename directories to simplify both patching and the ebuild
+	mv binutils{-${BINUTILS_PV},} || die
+	mv gcc{-${GCC_PV},} || die
+	mv mingw-w64-v${MINGW_PV} mingw64 || die
+
+	default
+}
+
+src_compile() {
+	# not great but do everything in src_compile given bootstrapping
+	# process needs to be done in steps of configure+compile+install
+	# (done modular to have most package-specific things in one place)
+
+	CTARGET=$(usex x86 i686 x86_64)-w64-mingw32
+
+	MWT_D=${T}/root # moved to ${D} in src_install
+	local mwtdir=/usr/lib/${PN}
+	local prefix=${EPREFIX}${mwtdir}
+	local sysroot=${MWT_D}${prefix}
+	local -x PATH=${sysroot}/bin:${PATH}
+
+	filter-lto # requires setting up, and may be messy with mingw static libs
+	use custom-cflags || strip-flags # fancy flags are not realistic here
+
+	local multilib=false
+	use abi_x86_32 && use abi_x86_64 && multilib=true
+
+	# global configure flags
+	local conf=(
+		--build=${CBUILD:-${CHOST}}
+		--target=${CTARGET}
+		--{doc,info,man}dir=/.skip # let individual packages handle docs
+	)
+
+	# binutils
+	local conf_binutils=(
+		--prefix="${prefix}"
+		--host=${CHOST}
+		--disable-cet
+		--disable-default-execstack
+		--disable-nls
+		--disable-shared
+		--with-system-zlib
+		--without-debuginfod
+		--without-msgpack
+		--without-zstd
+	)
+	mwt-binutils() {
+		# symlink gcc's lto plugin for AR (bug #854516)
+		ln -s ../../libexec/gcc/${CTARGET}/${GCC_PV%%[.-]*}/liblto_plugin.so \
+			"${sysroot}"/lib/bfd-plugins || die
+	}
+
+	# gcc (minimal -- if need more, disable only in stage1 / enable in stage3)
+	local conf_gcc=(
+		--prefix="${prefix}"
+		--host=${CHOST}
+		--disable-bootstrap
+		--disable-cet
+		--disable-gcov #843989
+		--disable-gomp
+		--disable-libquadmath
+		--disable-libsanitizer
+		--disable-libssp
+		--disable-libvtv
+		--disable-shared
+		--disable-werror
+		--with-gcc-major-version-only
+		--with-system-zlib
+		--without-isl
+		--without-zstd
+	)
+	${multilib} || conf_gcc+=( --disable-multilib )
+
+	local conf_gcc_stage1=(
+		--enable-languages=c
+		--disable-libatomic
+		--with-sysroot="${sysroot}"
+	)
+	local -n conf_gcc_stage2=conf_gcc_stage1
+
+	local conf_gcc_stage3=(
+		--enable-languages=c,c++
+		--enable-threads=posix # needs stage3, and is required for dxvk/vkd3d
+		--with-sysroot="${prefix}"
+		--with-build-sysroot="${sysroot}"
+	)
+
+	# mingw64-runtime (split in several parts, 3 needed for gcc stages)
+	local conf_mingw64=(
+		--prefix="${prefix}"/${CTARGET}
+		--host=${CTARGET}
+		--with-sysroot=no
+		--without-{crt,headers}
+
+		# mingw .dll aren't used by wine and packages wouldn't find them
+		# at runtime, use crossdev if need dll and proper search paths
+		--disable-shared
+	)
+
+	local conf_mingw64_headers=(
+		--enable-idl
+		--with-headers
+	)
+	mwt-mingw64_headers() { ln -s ${CTARGET} "${sysroot}"/mingw || die; } #419601
+
+	local conf_mingw64_runtime=( --with-crt )
+	${multilib} ||
+		conf_mingw64_runtime+=( $(usex x86 --disable-lib64 --disable-lib32 ) )
+
+	local conf_mingw64_libraries=( --with-libraries )
+	local conf_mingw64_libraries32=(
+		--libdir="${prefix}"/${CTARGET}/lib32
+		--with-libraries
+		CC="${CTARGET}-gcc -m32"
+		RCFLAGS="--target=pe-i386 ${RCFLAGS}"
+	)
+
+	# mingw64-runtime's idl compiler (useful not to depend on wine for widl)
+	local conf_widl=( --prefix="${prefix}" )
+
+	# mwt-build [-x] <path/package-name> [stage-name]
+	# -> ./configure && make && make install && mwt-package() && mwt-package_stage()
+	# passes conf, conf_package, and conf_package_stage arrays to configure, and
+	# users can add options through environment with e.g.
+	#	MWT_BINUTILS_CONF="--some-option"
+	#	MWT_GCC_STAGE1_CONF="--some-gcc-stage1-only-option"
+	#	MWT_WIDL_CONF="--some-other-option"
+	#	EXTRA_ECONF="--global-option" (generic naming for if not reading this)
+	mwt-build() {
+		if [[ ${1} == -x ]]; then
+			(
+				# cross-compiling, cleanup and let ./configure handle it
+				unset AR AS CC CPP CXX LD NM OBJCOPY OBJDUMP RANLIB RC STRIP
+				CHOST=${CTARGET}
+				filter-flags '-fstack-clash-protection' #758914
+				filter-flags '-fstack-protector*' #870136
+				filter-flags '-fuse-ld=*'
+				filter-flags '-mfunction-return=thunk*' #878849
+				strip-unsupported-flags
+				mwt-build "${@:2}"
+			)
+			return
+		fi
+
+		local id=${1##*/}
+		local build_dir=${WORKDIR}/${1}${2+_${2}}-build
+
+		# econf is not allowed in src_compile and its defaults are
+		# mostly unused here, so use configure directly
+		local conf=( "${WORKDIR}/${1}"/configure "${conf[@]}" )
+
+		local -n conf_id=conf_${id} conf_id2=conf_${id}_${2}
+		[[ ${conf_id@a} == *a* ]] && conf+=( "${conf_id[@]}" )
+		[[ ${2} && ${conf_id2@a} == *a* ]] && conf+=( "${conf_id2[@]}" )
+
+		local -n extra_id=MWT_${id^^}_CONF extra_id2=MWT_${id^^}_${2^^}_CONF
+		conf+=( ${EXTRA_ECONF} ${extra_id} ${2+${extra_id2}} )
+
+		einfo "Building ${id}${2+ ${2}} in ${build_dir} ..."
+
+		mkdir -p "${build_dir}" || die
+		pushd "${build_dir}" >/dev/null || die
+
+		edo "${conf[@]}"
+		emake
+		emake DESTDIR="${MWT_D}" install
+
+		declare -f mwt-${id} >/dev/null && edo mwt-${id}
+		declare -f mwt-${id}_${2} >/dev/null && edo mwt-${id}_${2}
+
+		popd >/dev/null || die
+	}
+
+	# workaround race condition with out-of-source crt build (bug #879537)
+	mkdir -p mingw64_runtime-build/mingw-w64-crt/lib{32,64} || die
+
+	# build with same ordering that crossdev would do + stage3 for pthreads
+	mwt-build binutils
+	mwt-build mingw64 headers
+	mwt-build gcc stage1
+	mwt-build -x mingw64 runtime
+	mwt-build gcc stage2
+	${multilib} && mwt-build -x mingw64 libraries32
+	mwt-build -x mingw64 libraries
+	mwt-build gcc stage3
+	mwt-build mingw64/mingw-w64-tools/widl
+	# note: /could/ system-bootstrap if already installed, but gcc and
+	# libraries will use the system's older mingw64 headers/static-libs
+	# and make this potentially fragile without more workarounds/stages
+
+	if ${multilib}; then
+		# Like system's gcc, `x86_64-w64-mingw32-gcc -m32` can build for x86,
+		# but packages expect crossdev's i686-w64-mingw32-gcc which is the same
+		# just without 64bit support and would rather not build the toolchain
+		# twice. Dirty but wrap to allow simple interoperability with crossdev.
+		mwt-i686_wrapper() {
+			printf "#!/usr/bin/env sh\nexec \"${prefix}/bin/${bin}\" ${*} "'"${@}"\n' \
+				> ${bin32} || die
+			chmod +x ${bin32} || die
+		}
+		pushd "${sysroot}"/bin >/dev/null || die
+		local bin bin32
+		for bin in ${CTARGET}-*; do
+			bin32=${bin/x86_64-w64/i686-w64}
+			case ${bin#${CTARGET}-} in
+				as) mwt-i686_wrapper --32;;
+				cpp|gcc|gcc-${GCC_PV%%[.-]*}|g++|widl) mwt-i686_wrapper -m32;;
+				ld|ld.bfd) mwt-i686_wrapper -m i386pe;;
+				windres) mwt-i686_wrapper --target=pe-i386;;
+				*) ln -s ${bin} ${bin32} || die;;
+			esac
+		done
+		popd >/dev/null || die
+	fi
+
+	# portage doesn't know the right strip executable to use for CTARGET
+	# and it can lead to .a mangling, notably with 32bit (breaks toolchain)
+	dostrip -x ${mwtdir}/{${CTARGET}/lib{,32},lib/gcc/${CTARGET}}
+
+	# ... and instead do it here given this saves ~60MB
+	if use !debug; then
+		einfo "Stripping ${CTARGET} static libraries ..."
+		find "${sysroot}"/{,lib/gcc/}${CTARGET} -type f -name '*.a' \
+			-exec ${CTARGET}-strip --strip-unneeded {} + || die
+	fi
+}
+
+src_install() {
+	mv "${MWT_D}${EPREFIX}"/* "${ED}" || die
+
+	find "${ED}" -type f -name '*.la' -delete || die
+}
+
+pkg_postinst() {
+	if [[ ! ${REPLACING_VERSIONS} ]]; then
+		elog "Note that this package is primarily intended for Wine and related"
+		elog "packages to depend on without needing a manual crossdev setup."
+		elog
+		elog "Settings are oriented only for what these need and simplicity."
+		elog "Use sys-devel/crossdev if need full toolchain/customization:"
+		elog "    https://wiki.gentoo.org/wiki/Mingw"
+		elog "    https://wiki.gentoo.org/wiki/Crossdev"
+	fi
+
+	local cross_gcc=cross-$(usex x86 i686 x86_64)-w64-mingw32/gcc
+	if has_version ${cross_gcc}; then
+		# encourage cleanup given users may not realize if switch by default
+		ewarn "${cross_gcc} is installed, note that ${PN}"
+		ewarn "is redundant with the *-w64-mingw32/{binutils,gcc,mingw64-runtime}"
+		ewarn "packages and optionally only one needs to be kept."
+	fi
+}


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2023-04-26  8:37 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2023-04-26  8:37 UTC (permalink / raw
  To: gentoo-commits

commit:     ef53d4bba5b476e461c8f33b99cc1d4a897de7b1
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 26 08:06:26 2023 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Wed Apr 26 08:36:51 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ef53d4bb

dev-util/mingw64-toolchain: drop 10.0.0_p2, 10.0.0_p3

Never keyworded testing versions.

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/Manifest                |   1 -
 .../mingw64-toolchain-10.0.0_p2.ebuild             | 314 --------------------
 .../mingw64-toolchain-10.0.0_p3.ebuild             | 323 ---------------------
 3 files changed, 638 deletions(-)

diff --git a/dev-util/mingw64-toolchain/Manifest b/dev-util/mingw64-toolchain/Manifest
index a521d157a1ce..68054eeca0ea 100644
--- a/dev-util/mingw64-toolchain/Manifest
+++ b/dev-util/mingw64-toolchain/Manifest
@@ -1,6 +1,5 @@
 DIST binutils-2.39.tar.xz 25167756 BLAKE2B ac6a5296c6586d53eaadcbffc5c399a6d79edf72450b9bb8b3525ce525129cef3d2eb90c85ef3bb3270b5a03b0e1ffb8f0b705f028158726f9777ebb8685066f SHA512 68e038f339a8c21faa19a57bbc447a51c817f47c2e06d740847c6e9cc3396c025d35d5369fa8c3f8b70414757c89f0e577939ddc0d70f283182504920f53b0a3
 DIST binutils-2.40.tar.xz 25241484 BLAKE2B 8d799f7c595f878b9af5b17a490021dd8b8300ac2fe0ed8574c012929d22d2d0493e003a3e631a9436e8e712da801779b777c566167fe42b0bde119ffa5ad1c2 SHA512 a37e042523bc46494d99d5637c3f3d8f9956d9477b748b3b1f6d7dfbb8d968ed52c932e88a4e946c6f77b8f48f1e1b360ca54c3d298f17193f3b4963472f6925
 DIST gcc-12.2.0.tar.xz 84645292 BLAKE2B 715574af9ad678f9dc8cfd19c866bf910c7edfd479e7e9681337feaa9b54e5d304ddb85483816b8d89754d502405823ae2eff0d1e444538763f40be8e428d8da SHA512 e9e857bd81bf7a370307d6848c81b2f5403db8c7b5207f54bce3f3faac3bde63445684092c2bc1a2427cddb6f7746496d9fbbef05fbbd77f2810b2998f1f9173
-DIST gcc-13-20230416.tar.xz 83936936 BLAKE2B c052fff2838a0bdd87f90345a5f7f5c607a6fe360b02ce8cb076f6dd3a62f6aae0c7d3914eee447e9c92c971331ddcbf0c94f2aa120aef89a742162b5e7dbfdd SHA512 222bb6db05b23aeb428262c69319a4964097065a88a5ae6c19b104c31af82c465f139c08f01bb077b0e776685769b77a54b772ebc4e2057e7c3e8954283997cf
 DIST gcc-13.1.0.tar.xz 87451196 BLAKE2B b956a773cffe8b43bd6c9a99fe614f53f665438925a6b320975d301f547923e45d4d6fa577a143467fb03e0a9c1bab2b6719a1011d672367f3e644433a2d7606 SHA512 6cf06dfc48f57f5e67f7efe3248019329a14d690c728d9f2f7ef5fa0d58f1816f309586ba7ea2eac20d0b60a2d1b701f68392e9067dd46f827ba0efd7192db33
 DIST mingw-w64-v10.0.0.tar.bz2 9620291 BLAKE2B 451372403289c492ca939d65bb4d9f6e9fa6bdd6b32d79d6438d858e106e8cc291712ada1f3f7b951a4c6908e7d0385d485ca76920af39bcf86effa48408e330 SHA512 3c0827af7c40809a867758f6cd9ef3ff0c988b43082345bf725e03949af95968d634ace99a7ffae323189549221dcb5d861de9e801f1fbc7904e446641b60516

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p2.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p2.ebuild
deleted file mode 100644
index 2f27e2bb7149..000000000000
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p2.ebuild
+++ /dev/null
@@ -1,314 +0,0 @@
-# Copyright 2022-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-MULTILIB_COMPAT=( abi_x86_{32,64} )
-inherit edo flag-o-matic multilib-build toolchain-funcs
-
-# Pick versions known to work for Wine and use vanilla for simplicity,
-# ideally update only on mingw64-runtime bumps or if toolchain is getting
-# too outdated to avoid rebuilding the entire toolchain too often.
-# Do _p1++ rather than revbump if changing without bumping mingw64 itself.
-BINUTILS_PV=2.40
-GCC_PV=12.2.0
-MINGW_PV=$(ver_cut 1-3)
-
-DESCRIPTION="All-in-one mingw64 toolchain intended for building Wine without crossdev"
-HOMEPAGE="
-	https://www.mingw-w64.org/
-	https://gcc.gnu.org/
-	https://sourceware.org/binutils/"
-SRC_URI="
-	mirror://sourceforge/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${MINGW_PV}.tar.bz2
-	mirror://gnu/gcc/gcc-${GCC_PV}/gcc-${GCC_PV}.tar.xz
-	mirror://gnu/binutils/binutils-${BINUTILS_PV}.tar.xz"
-S="${WORKDIR}"
-
-# l1:binutils+gcc, l2:gcc(libraries), l3:mingw64-runtime
-LICENSE="
-	GPL-3+
-	LGPL-3+ || ( GPL-3+ libgcc libstdc++ gcc-runtime-library-exception-3.1 )
-	ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain"
-SLOT="0"
-# unkeyworded for testing new binutils, keywording may wait until can bump
-# either gcc or mingw64-runtime at same time given the long build time
-#KEYWORDS="-* ~amd64 ~x86"
-IUSE="+abi_x86_32 custom-cflags debug"
-
-RDEPEND="
-	dev-libs/gmp:=
-	dev-libs/mpc:=
-	dev-libs/mpfr:=
-	sys-libs/zlib:=
-	virtual/libiconv"
-DEPEND="${RDEPEND}"
-
-PATCHES=(
-	"${FILESDIR}"/mingw64-runtime-10.0.0-msvcr-extra-race.patch
-	"${FILESDIR}"/mingw64-runtime-10.0.0-tmp-files-clash.patch
-	"${FILESDIR}"/gcc-11.3.0-plugin-objdump.patch
-	"${FILESDIR}"/gcc-12.2.0-drop-cflags-sed.patch
-)
-
-pkg_pretend() {
-	[[ ${MERGE_TYPE} == binary ]] && return
-
-	tc-is-cross-compiler &&
-		die "cross-compilation of the toolchain itself is unsupported"
-}
-
-src_prepare() {
-	# rename directories to simplify both patching and the ebuild
-	mv binutils{-${BINUTILS_PV},} || die
-	mv gcc{-${GCC_PV},} || die
-	mv mingw-w64-v${MINGW_PV} mingw64 || die
-
-	default
-}
-
-src_compile() {
-	# not great but do everything in src_compile given bootstrapping
-	# process needs to be done in steps of configure+compile+install
-	# (done modular to have most package-specific things in one place)
-
-	CTARGET=$(usex x86 i686 x86_64)-w64-mingw32
-
-	MWT_D=${T}/root # moved to ${D} in src_install
-	local mwtdir=/usr/lib/${PN}
-	local prefix=${EPREFIX}${mwtdir}
-	local sysroot=${MWT_D}${prefix}
-	local -x PATH=${sysroot}/bin:${PATH}
-
-	filter-lto # requires setting up, and may be messy with mingw static libs
-	use custom-cflags || strip-flags # fancy flags are not realistic here
-
-	local multilib=false
-	use abi_x86_32 && use abi_x86_64 && multilib=true
-
-	# global configure flags
-	local conf=(
-		--build=${CBUILD:-${CHOST}}
-		--target=${CTARGET}
-		--{doc,info,man}dir=/.skip # let individual packages handle docs
-	)
-
-	# binutils
-	local conf_binutils=(
-		--prefix="${prefix}"
-		--host=${CHOST}
-		--disable-cet
-		--disable-default-execstack
-		--disable-nls
-		--disable-shared
-		--with-system-zlib
-		--without-debuginfod
-		--without-msgpack
-		--without-zstd
-	)
-	mwt-binutils() {
-		# symlink gcc's lto plugin for AR (bug #854516)
-		ln -s ../../libexec/gcc/${CTARGET}/${GCC_PV%%.*}/liblto_plugin.so \
-			"${sysroot}"/lib/bfd-plugins || die
-	}
-
-	# gcc (minimal -- if need more, disable only in stage1 / enable in stage3)
-	local conf_gcc=(
-		--prefix="${prefix}"
-		--host=${CHOST}
-		--disable-bootstrap
-		--disable-cet
-		--disable-gcov #843989
-		--disable-gomp
-		--disable-libquadmath
-		--disable-libsanitizer
-		--disable-libssp
-		--disable-libvtv
-		--disable-shared
-		--disable-werror
-		--with-gcc-major-version-only
-		--with-system-zlib
-		--without-isl
-		--without-zstd
-	)
-	${multilib} || conf_gcc+=( --disable-multilib )
-
-	local conf_gcc_stage1=(
-		--enable-languages=c
-		--disable-libatomic
-		--with-sysroot="${sysroot}"
-	)
-	local -n conf_gcc_stage2=conf_gcc_stage1
-
-	local conf_gcc_stage3=(
-		--enable-languages=c,c++
-		--enable-threads=posix # needs stage3, and is required for dxvk/vkd3d
-		--with-sysroot="${prefix}"
-		--with-build-sysroot="${sysroot}"
-	)
-
-	# mingw64-runtime (split in several parts, 3 needed for gcc stages)
-	local conf_mingw64=(
-		--prefix="${prefix}"/${CTARGET}
-		--host=${CTARGET}
-		--with-sysroot=no
-		--without-{crt,headers}
-
-		# mingw .dll aren't used by wine and packages wouldn't find them
-		# at runtime, use crossdev if need dll and proper search paths
-		--disable-shared
-	)
-
-	local conf_mingw64_headers=(
-		--enable-idl
-		--with-headers
-	)
-	mwt-mingw64_headers() { ln -s ${CTARGET} "${sysroot}"/mingw || die; } #419601
-
-	local conf_mingw64_runtime=( --with-crt )
-	${multilib} ||
-		conf_mingw64_runtime+=( $(usex x86 --disable-lib64 --disable-lib32 ) )
-
-	local conf_mingw64_libraries=( --with-libraries )
-	local conf_mingw64_libraries32=(
-		--libdir="${prefix}"/${CTARGET}/lib32
-		--with-libraries
-		CC="${CTARGET}-gcc -m32"
-		RCFLAGS="--target=pe-i386 ${RCFLAGS}"
-	)
-
-	# mingw64-runtime's idl compiler (useful not to depend on wine for widl)
-	local conf_widl=( --prefix="${prefix}" )
-
-	# mwt-build [-x] <path/package-name> [stage-name]
-	# -> ./configure && make && make install && mwt-package() && mwt-package_stage()
-	# passes conf, conf_package, and conf_package_stage arrays to configure, and
-	# users can add options through environment with e.g.
-	#	MWT_BINUTILS_CONF="--some-option"
-	#	MWT_GCC_STAGE1_CONF="--some-gcc-stage1-only-option"
-	#	MWT_WIDL_CONF="--some-other-option"
-	#	EXTRA_ECONF="--global-option" (generic naming for if not reading this)
-	mwt-build() {
-		if [[ ${1} == -x ]]; then
-			(
-				# cross-compiling, cleanup and let ./configure handle it
-				unset AR AS CC CPP CXX LD NM OBJCOPY OBJDUMP RANLIB RC STRIP
-				CHOST=${CTARGET}
-				filter-flags '-fstack-clash-protection' #758914
-				filter-flags '-fstack-protector*' #870136
-				filter-flags '-fuse-ld=*'
-				filter-flags '-mfunction-return=thunk*' #878849
-				strip-unsupported-flags
-				mwt-build "${@:2}"
-			)
-			return
-		fi
-
-		local id=${1##*/}
-		local build_dir=${WORKDIR}/${1}${2+_${2}}-build
-
-		# econf is not allowed in src_compile and its defaults are
-		# mostly unused here, so use configure directly
-		local conf=( "${WORKDIR}/${1}"/configure "${conf[@]}" )
-
-		local -n conf_id=conf_${id} conf_id2=conf_${id}_${2}
-		[[ ${conf_id@a} == *a* ]] && conf+=( "${conf_id[@]}" )
-		[[ ${2} && ${conf_id2@a} == *a* ]] && conf+=( "${conf_id2[@]}" )
-
-		local -n extra_id=MWT_${id^^}_CONF extra_id2=MWT_${id^^}_${2^^}_CONF
-		conf+=( ${EXTRA_ECONF} ${extra_id} ${2+${extra_id2}} )
-
-		einfo "Building ${id}${2+ ${2}} in ${build_dir} ..."
-
-		mkdir -p "${build_dir}" || die
-		pushd "${build_dir}" >/dev/null || die
-
-		edo "${conf[@]}"
-		emake
-		emake DESTDIR="${MWT_D}" install
-
-		declare -f mwt-${id} >/dev/null && edo mwt-${id}
-		declare -f mwt-${id}_${2} >/dev/null && edo mwt-${id}_${2}
-
-		popd >/dev/null || die
-	}
-
-	# workaround race condition with out-of-source crt build (bug #879537)
-	mkdir -p mingw64_runtime-build/mingw-w64-crt/lib{32,64} || die
-
-	# build with same ordering that crossdev would do + stage3 for pthreads
-	mwt-build binutils
-	mwt-build mingw64 headers
-	mwt-build gcc stage1
-	mwt-build -x mingw64 runtime
-	mwt-build gcc stage2
-	${multilib} && mwt-build -x mingw64 libraries32
-	mwt-build -x mingw64 libraries
-	mwt-build gcc stage3
-	mwt-build mingw64/mingw-w64-tools/widl
-	# note: /could/ system-bootstrap if already installed, but gcc and
-	# libraries will use the system's older mingw64 headers/static-libs
-	# and make this potentially fragile without more workarounds/stages
-
-	if ${multilib}; then
-		# Like system's gcc, `x86_64-w64-mingw32-gcc -m32` can build for x86,
-		# but packages expect crossdev's i686-w64-mingw32-gcc which is the same
-		# just without 64bit support and would rather not build the toolchain
-		# twice. Dirty but wrap to allow simple interoperability with crossdev.
-		mwt-i686_wrapper() {
-			printf "#!/usr/bin/env sh\nexec \"${prefix}/bin/${bin}\" ${*} "'"${@}"\n' \
-				> ${bin32} || die
-			chmod +x ${bin32} || die
-		}
-		pushd "${sysroot}"/bin >/dev/null || die
-		local bin bin32
-		for bin in ${CTARGET}-*; do
-			bin32=${bin/x86_64-w64/i686-w64}
-			case ${bin#${CTARGET}-} in
-				as) mwt-i686_wrapper --32;;
-				cpp|gcc|gcc-${GCC_PV%%.*}|g++|widl) mwt-i686_wrapper -m32;;
-				ld|ld.bfd) mwt-i686_wrapper -m i386pe;;
-				windres) mwt-i686_wrapper --target=pe-i386;;
-				*) ln -s ${bin} ${bin32} || die;;
-			esac
-		done
-		popd >/dev/null || die
-	fi
-
-	# portage doesn't know the right strip executable to use for CTARGET
-	# and it can lead to .a mangling, notably with 32bit (breaks toolchain)
-	dostrip -x ${mwtdir}/{${CTARGET}/lib{,32},lib/gcc/${CTARGET}}
-
-	# ... and instead do it here given this saves ~60MB
-	if use !debug; then
-		einfo "Stripping ${CTARGET} static libraries ..."
-		find "${sysroot}"/{,lib/gcc/}${CTARGET} -type f -name '*.a' \
-			-exec ${CTARGET}-strip --strip-unneeded {} + || die
-	fi
-}
-
-src_install() {
-	mv "${MWT_D}${EPREFIX}"/* "${ED}" || die
-
-	find "${ED}" -type f -name '*.la' -delete || die
-}
-
-pkg_postinst() {
-	if [[ ! ${REPLACING_VERSIONS} ]]; then
-		elog "Note that this package is primarily intended for Wine and related"
-		elog "packages to depend on without needing a manual crossdev setup."
-		elog
-		elog "Settings are oriented only for what these need and simplicity."
-		elog "Use sys-devel/crossdev if need full toolchain/customization:"
-		elog "    https://wiki.gentoo.org/wiki/Mingw"
-		elog "    https://wiki.gentoo.org/wiki/Crossdev"
-	fi
-
-	local cross_gcc=cross-$(usex x86 i686 x86_64)-w64-mingw32/gcc
-	if has_version ${cross_gcc}; then
-		# encourage cleanup given users may not realize if switch by default
-		ewarn "${cross_gcc} is installed, note that ${PN}"
-		ewarn "is redundant with the *-w64-mingw32/{binutils,gcc,mingw64-runtime}"
-		ewarn "packages and optionally only one needs to be kept."
-	fi
-}

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p3.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p3.ebuild
deleted file mode 100644
index 53a29447919b..000000000000
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p3.ebuild
+++ /dev/null
@@ -1,323 +0,0 @@
-# Copyright 2022-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-MULTILIB_COMPAT=( abi_x86_{32,64} )
-inherit edo flag-o-matic multilib-build toolchain-funcs
-
-# Pick versions known to work for wine+dxvk, and avoid too frequent updates
-# to due to slow rebuilds. Do _p1++ rather than revbump on changes (not using
-# Gentoo patchsets for simplicity, their changes are mostly unneeded here).
-BINUTILS_PV=2.40
-GCC_PV=13-20230416
-MINGW_PV=$(ver_cut 1-3)
-
-DESCRIPTION="All-in-one mingw64 toolchain intended for building Wine without crossdev"
-HOMEPAGE="
-	https://www.mingw-w64.org/
-	https://gcc.gnu.org/
-	https://sourceware.org/binutils/"
-SRC_URI="
-	mirror://sourceforge/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${MINGW_PV}.tar.bz2
-	mirror://gnu/binutils/binutils-${BINUTILS_PV}.tar.xz"
-if [[ ${GCC_PV} == *-* ]]; then
-	SRC_URI+=" mirror://gcc/snapshots/${GCC_PV}/gcc-${GCC_PV}.tar.xz"
-else
-	SRC_URI+="
-		mirror://gcc/gcc-${GCC_PV}/gcc-${GCC_PV}.tar.xz
-		mirror://gnu/gcc/gcc-${GCC_PV}/gcc-${GCC_PV}.tar.xz"
-fi
-S="${WORKDIR}"
-
-# l1:binutils+gcc, l2:gcc(libraries), l3:mingw64-runtime
-LICENSE="
-	GPL-3+
-	LGPL-3+ || ( GPL-3+ libgcc libstdc++ gcc-runtime-library-exception-3.1 )
-	ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain"
-SLOT="0"
-# unkeyworded for testing new binutils+gcc, will likely keyword _p4 with
-# non-snapshot gcc-13.0.1 if no known issues
-#KEYWORDS="-* ~amd64 ~x86"
-IUSE="+abi_x86_32 custom-cflags debug"
-
-RDEPEND="
-	dev-libs/gmp:=
-	dev-libs/mpc:=
-	dev-libs/mpfr:=
-	sys-libs/zlib:=
-	virtual/libiconv"
-DEPEND="${RDEPEND}"
-
-QA_CONFIG_IMPL_DECL_SKIP=(
-	strerror_r # libstdc++ test using -Wimplicit+error
-)
-
-PATCHES=(
-	"${FILESDIR}"/mingw64-runtime-10.0.0-msvcr-extra-race.patch
-	"${FILESDIR}"/mingw64-runtime-10.0.0-tmp-files-clash.patch
-	"${FILESDIR}"/binutils-2.40-import-lib.patch
-	"${FILESDIR}"/gcc-12.2.0-drop-cflags-sed.patch
-)
-
-pkg_pretend() {
-	[[ ${MERGE_TYPE} == binary ]] && return
-
-	tc-is-cross-compiler &&
-		die "cross-compilation of the toolchain itself is unsupported"
-}
-
-src_prepare() {
-	# rename directories to simplify both patching and the ebuild
-	mv binutils{-${BINUTILS_PV},} || die
-	mv gcc{-${GCC_PV},} || die
-	mv mingw-w64-v${MINGW_PV} mingw64 || die
-
-	default
-}
-
-src_compile() {
-	# not great but do everything in src_compile given bootstrapping
-	# process needs to be done in steps of configure+compile+install
-	# (done modular to have most package-specific things in one place)
-
-	CTARGET=$(usex x86 i686 x86_64)-w64-mingw32
-
-	MWT_D=${T}/root # moved to ${D} in src_install
-	local mwtdir=/usr/lib/${PN}
-	local prefix=${EPREFIX}${mwtdir}
-	local sysroot=${MWT_D}${prefix}
-	local -x PATH=${sysroot}/bin:${PATH}
-
-	filter-lto # requires setting up, and may be messy with mingw static libs
-	use custom-cflags || strip-flags # fancy flags are not realistic here
-
-	local multilib=false
-	use abi_x86_32 && use abi_x86_64 && multilib=true
-
-	# global configure flags
-	local conf=(
-		--build=${CBUILD:-${CHOST}}
-		--target=${CTARGET}
-		--{doc,info,man}dir=/.skip # let individual packages handle docs
-	)
-
-	# binutils
-	local conf_binutils=(
-		--prefix="${prefix}"
-		--host=${CHOST}
-		--disable-cet
-		--disable-default-execstack
-		--disable-nls
-		--disable-shared
-		--with-system-zlib
-		--without-debuginfod
-		--without-msgpack
-		--without-zstd
-	)
-	mwt-binutils() {
-		# symlink gcc's lto plugin for AR (bug #854516)
-		ln -s ../../libexec/gcc/${CTARGET}/${GCC_PV%%[.-]*}/liblto_plugin.so \
-			"${sysroot}"/lib/bfd-plugins || die
-	}
-
-	# gcc (minimal -- if need more, disable only in stage1 / enable in stage3)
-	local conf_gcc=(
-		--prefix="${prefix}"
-		--host=${CHOST}
-		--disable-bootstrap
-		--disable-cet
-		--disable-gcov #843989
-		--disable-gomp
-		--disable-libquadmath
-		--disable-libsanitizer
-		--disable-libssp
-		--disable-libvtv
-		--disable-shared
-		--disable-werror
-		--with-gcc-major-version-only
-		--with-system-zlib
-		--without-isl
-		--without-zstd
-	)
-	${multilib} || conf_gcc+=( --disable-multilib )
-
-	local conf_gcc_stage1=(
-		--enable-languages=c
-		--disable-libatomic
-		--with-sysroot="${sysroot}"
-	)
-	local -n conf_gcc_stage2=conf_gcc_stage1
-
-	local conf_gcc_stage3=(
-		--enable-languages=c,c++
-		--enable-threads=posix # needs stage3, and is required for dxvk/vkd3d
-		--with-sysroot="${prefix}"
-		--with-build-sysroot="${sysroot}"
-	)
-
-	# mingw64-runtime (split in several parts, 3 needed for gcc stages)
-	local conf_mingw64=(
-		--prefix="${prefix}"/${CTARGET}
-		--host=${CTARGET}
-		--with-sysroot=no
-		--without-{crt,headers}
-
-		# mingw .dll aren't used by wine and packages wouldn't find them
-		# at runtime, use crossdev if need dll and proper search paths
-		--disable-shared
-	)
-
-	local conf_mingw64_headers=(
-		--enable-idl
-		--with-headers
-	)
-	mwt-mingw64_headers() { ln -s ${CTARGET} "${sysroot}"/mingw || die; } #419601
-
-	local conf_mingw64_runtime=( --with-crt )
-	${multilib} ||
-		conf_mingw64_runtime+=( $(usex x86 --disable-lib64 --disable-lib32 ) )
-
-	local conf_mingw64_libraries=( --with-libraries )
-	local conf_mingw64_libraries32=(
-		--libdir="${prefix}"/${CTARGET}/lib32
-		--with-libraries
-		CC="${CTARGET}-gcc -m32"
-		RCFLAGS="--target=pe-i386 ${RCFLAGS}"
-	)
-
-	# mingw64-runtime's idl compiler (useful not to depend on wine for widl)
-	local conf_widl=( --prefix="${prefix}" )
-
-	# mwt-build [-x] <path/package-name> [stage-name]
-	# -> ./configure && make && make install && mwt-package() && mwt-package_stage()
-	# passes conf, conf_package, and conf_package_stage arrays to configure, and
-	# users can add options through environment with e.g.
-	#	MWT_BINUTILS_CONF="--some-option"
-	#	MWT_GCC_STAGE1_CONF="--some-gcc-stage1-only-option"
-	#	MWT_WIDL_CONF="--some-other-option"
-	#	EXTRA_ECONF="--global-option" (generic naming for if not reading this)
-	mwt-build() {
-		if [[ ${1} == -x ]]; then
-			(
-				# cross-compiling, cleanup and let ./configure handle it
-				unset AR AS CC CPP CXX LD NM OBJCOPY OBJDUMP RANLIB RC STRIP
-				CHOST=${CTARGET}
-				filter-flags '-fstack-clash-protection' #758914
-				filter-flags '-fstack-protector*' #870136
-				filter-flags '-fuse-ld=*'
-				filter-flags '-mfunction-return=thunk*' #878849
-				strip-unsupported-flags
-				mwt-build "${@:2}"
-			)
-			return
-		fi
-
-		local id=${1##*/}
-		local build_dir=${WORKDIR}/${1}${2+_${2}}-build
-
-		# econf is not allowed in src_compile and its defaults are
-		# mostly unused here, so use configure directly
-		local conf=( "${WORKDIR}/${1}"/configure "${conf[@]}" )
-
-		local -n conf_id=conf_${id} conf_id2=conf_${id}_${2}
-		[[ ${conf_id@a} == *a* ]] && conf+=( "${conf_id[@]}" )
-		[[ ${2} && ${conf_id2@a} == *a* ]] && conf+=( "${conf_id2[@]}" )
-
-		local -n extra_id=MWT_${id^^}_CONF extra_id2=MWT_${id^^}_${2^^}_CONF
-		conf+=( ${EXTRA_ECONF} ${extra_id} ${2+${extra_id2}} )
-
-		einfo "Building ${id}${2+ ${2}} in ${build_dir} ..."
-
-		mkdir -p "${build_dir}" || die
-		pushd "${build_dir}" >/dev/null || die
-
-		edo "${conf[@]}"
-		emake
-		emake DESTDIR="${MWT_D}" install
-
-		declare -f mwt-${id} >/dev/null && edo mwt-${id}
-		declare -f mwt-${id}_${2} >/dev/null && edo mwt-${id}_${2}
-
-		popd >/dev/null || die
-	}
-
-	# workaround race condition with out-of-source crt build (bug #879537)
-	mkdir -p mingw64_runtime-build/mingw-w64-crt/lib{32,64} || die
-
-	# build with same ordering that crossdev would do + stage3 for pthreads
-	mwt-build binutils
-	mwt-build mingw64 headers
-	mwt-build gcc stage1
-	mwt-build -x mingw64 runtime
-	mwt-build gcc stage2
-	${multilib} && mwt-build -x mingw64 libraries32
-	mwt-build -x mingw64 libraries
-	mwt-build gcc stage3
-	mwt-build mingw64/mingw-w64-tools/widl
-	# note: /could/ system-bootstrap if already installed, but gcc and
-	# libraries will use the system's older mingw64 headers/static-libs
-	# and make this potentially fragile without more workarounds/stages
-
-	if ${multilib}; then
-		# Like system's gcc, `x86_64-w64-mingw32-gcc -m32` can build for x86,
-		# but packages expect crossdev's i686-w64-mingw32-gcc which is the same
-		# just without 64bit support and would rather not build the toolchain
-		# twice. Dirty but wrap to allow simple interoperability with crossdev.
-		mwt-i686_wrapper() {
-			printf "#!/usr/bin/env sh\nexec \"${prefix}/bin/${bin}\" ${*} "'"${@}"\n' \
-				> ${bin32} || die
-			chmod +x ${bin32} || die
-		}
-		pushd "${sysroot}"/bin >/dev/null || die
-		local bin bin32
-		for bin in ${CTARGET}-*; do
-			bin32=${bin/x86_64-w64/i686-w64}
-			case ${bin#${CTARGET}-} in
-				as) mwt-i686_wrapper --32;;
-				cpp|gcc|gcc-${GCC_PV%%[.-]*}|g++|widl) mwt-i686_wrapper -m32;;
-				ld|ld.bfd) mwt-i686_wrapper -m i386pe;;
-				windres) mwt-i686_wrapper --target=pe-i386;;
-				*) ln -s ${bin} ${bin32} || die;;
-			esac
-		done
-		popd >/dev/null || die
-	fi
-
-	# portage doesn't know the right strip executable to use for CTARGET
-	# and it can lead to .a mangling, notably with 32bit (breaks toolchain)
-	dostrip -x ${mwtdir}/{${CTARGET}/lib{,32},lib/gcc/${CTARGET}}
-
-	# ... and instead do it here given this saves ~60MB
-	if use !debug; then
-		einfo "Stripping ${CTARGET} static libraries ..."
-		find "${sysroot}"/{,lib/gcc/}${CTARGET} -type f -name '*.a' \
-			-exec ${CTARGET}-strip --strip-unneeded {} + || die
-	fi
-}
-
-src_install() {
-	mv "${MWT_D}${EPREFIX}"/* "${ED}" || die
-
-	find "${ED}" -type f -name '*.la' -delete || die
-}
-
-pkg_postinst() {
-	if [[ ! ${REPLACING_VERSIONS} ]]; then
-		elog "Note that this package is primarily intended for Wine and related"
-		elog "packages to depend on without needing a manual crossdev setup."
-		elog
-		elog "Settings are oriented only for what these need and simplicity."
-		elog "Use sys-devel/crossdev if need full toolchain/customization:"
-		elog "    https://wiki.gentoo.org/wiki/Mingw"
-		elog "    https://wiki.gentoo.org/wiki/Crossdev"
-	fi
-
-	local cross_gcc=cross-$(usex x86 i686 x86_64)-w64-mingw32/gcc
-	if has_version ${cross_gcc}; then
-		# encourage cleanup given users may not realize if switch by default
-		ewarn "${cross_gcc} is installed, note that ${PN}"
-		ewarn "is redundant with the *-w64-mingw32/{binutils,gcc,mingw64-runtime}"
-		ewarn "packages and optionally only one needs to be kept."
-	fi
-}


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2023-04-29  9:43 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2023-04-29  9:43 UTC (permalink / raw
  To: gentoo-commits

commit:     97613a229fa10fd2589e122e64bae6156133987f
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 29 08:03:41 2023 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Sat Apr 29 09:42:39 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=97613a22

dev-util/mingw64-toolchain: add 11.0.0

Also remove two obsolete flags filters:
* -fstack-clash-protection (bug #758914): ICE was fixed, if still
  run into this then updating gcc to a newer _p* snapshot should
  sort it (alternatively, use released >=gcc-13.1.0)
* -fstack-protector* (bug #870136): mingw64-runtime-11.0.0 adds
  its own (partial) ssp support, allowing -D_FORTIFY_SOURCE=3 and
  -fstack-protector-strong without libssp. Using these to build
  Wine currently still leads to failure, but we can allow it here.

Bug: https://bugs.gentoo.org/758914
Bug: https://bugs.gentoo.org/870136
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/Manifest                |   1 +
 .../mingw64-toolchain-11.0.0.ebuild                | 317 +++++++++++++++++++++
 2 files changed, 318 insertions(+)

diff --git a/dev-util/mingw64-toolchain/Manifest b/dev-util/mingw64-toolchain/Manifest
index 68054eeca0ea..c34f2d99ef72 100644
--- a/dev-util/mingw64-toolchain/Manifest
+++ b/dev-util/mingw64-toolchain/Manifest
@@ -3,3 +3,4 @@ DIST binutils-2.40.tar.xz 25241484 BLAKE2B 8d799f7c595f878b9af5b17a490021dd8b830
 DIST gcc-12.2.0.tar.xz 84645292 BLAKE2B 715574af9ad678f9dc8cfd19c866bf910c7edfd479e7e9681337feaa9b54e5d304ddb85483816b8d89754d502405823ae2eff0d1e444538763f40be8e428d8da SHA512 e9e857bd81bf7a370307d6848c81b2f5403db8c7b5207f54bce3f3faac3bde63445684092c2bc1a2427cddb6f7746496d9fbbef05fbbd77f2810b2998f1f9173
 DIST gcc-13.1.0.tar.xz 87451196 BLAKE2B b956a773cffe8b43bd6c9a99fe614f53f665438925a6b320975d301f547923e45d4d6fa577a143467fb03e0a9c1bab2b6719a1011d672367f3e644433a2d7606 SHA512 6cf06dfc48f57f5e67f7efe3248019329a14d690c728d9f2f7ef5fa0d58f1816f309586ba7ea2eac20d0b60a2d1b701f68392e9067dd46f827ba0efd7192db33
 DIST mingw-w64-v10.0.0.tar.bz2 9620291 BLAKE2B 451372403289c492ca939d65bb4d9f6e9fa6bdd6b32d79d6438d858e106e8cc291712ada1f3f7b951a4c6908e7d0385d485ca76920af39bcf86effa48408e330 SHA512 3c0827af7c40809a867758f6cd9ef3ff0c988b43082345bf725e03949af95968d634ace99a7ffae323189549221dcb5d861de9e801f1fbc7904e446641b60516
+DIST mingw-w64-v11.0.0.tar.bz2 10058657 BLAKE2B 3f7637bcc7c3f25b2141d35105ea086eab74e228d7275725ffb4f07e283fd75169dbe0900a9c29494fba9ddb2ea03bdd6ae26f06048311e9c93ae3e317c4c060 SHA512 bc1c9fd9d8593ead9375fcbe40950f06cf7616b94dc676db2793ac9b496fe3a6cc94b5793effda3b752942be0d7d01a1c37a8f221aaf178df0d4eeb0aa6d1f8d

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0.ebuild
new file mode 100644
index 000000000000..360f880e3610
--- /dev/null
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0.ebuild
@@ -0,0 +1,317 @@
+# Copyright 2022-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MULTILIB_COMPAT=( abi_x86_{32,64} )
+inherit edo flag-o-matic multilib-build toolchain-funcs
+
+# Pick versions known to work for wine+dxvk, and avoid too frequent updates
+# due to slow rebuilds. Do _p1++ rather than revbump on changes (not using
+# Gentoo patchsets for simplicity, their changes are mostly unneeded here).
+BINUTILS_PV=2.40
+GCC_PV=13.1.0
+MINGW_PV=$(ver_cut 1-3)
+
+DESCRIPTION="All-in-one mingw64 toolchain intended for building Wine without crossdev"
+HOMEPAGE="
+	https://www.mingw-w64.org/
+	https://gcc.gnu.org/
+	https://sourceware.org/binutils/"
+SRC_URI="
+	mirror://sourceforge/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${MINGW_PV}.tar.bz2
+	mirror://gnu/binutils/binutils-${BINUTILS_PV}.tar.xz"
+if [[ ${GCC_PV} == *-* ]]; then
+	SRC_URI+=" mirror://gcc/snapshots/${GCC_PV}/gcc-${GCC_PV}.tar.xz"
+else
+	SRC_URI+="
+		mirror://gcc/gcc-${GCC_PV}/gcc-${GCC_PV}.tar.xz
+		mirror://gnu/gcc/gcc-${GCC_PV}/gcc-${GCC_PV}.tar.xz"
+fi
+S="${WORKDIR}"
+
+# l1:binutils+gcc, l2:gcc(libraries), l3:mingw64-runtime
+LICENSE="
+	GPL-3+
+	LGPL-3+ || ( GPL-3+ libgcc libstdc++ gcc-runtime-library-exception-3.1 )
+	ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="+abi_x86_32 custom-cflags debug"
+
+RDEPEND="
+	dev-libs/gmp:=
+	dev-libs/mpc:=
+	dev-libs/mpfr:=
+	sys-libs/zlib:=
+	virtual/libiconv"
+DEPEND="${RDEPEND}"
+
+QA_CONFIG_IMPL_DECL_SKIP=(
+	strerror_r # libstdc++ test using -Wimplicit+error
+)
+
+PATCHES=(
+	"${FILESDIR}"/binutils-2.40-import-lib.patch
+	"${FILESDIR}"/gcc-12.2.0-drop-cflags-sed.patch
+)
+
+pkg_pretend() {
+	[[ ${MERGE_TYPE} == binary ]] && return
+
+	tc-is-cross-compiler &&
+		die "cross-compilation of the toolchain itself is unsupported"
+}
+
+src_prepare() {
+	# rename directories to simplify both patching and the ebuild
+	mv binutils{-${BINUTILS_PV},} || die
+	mv gcc{-${GCC_PV},} || die
+	mv mingw-w64-v${MINGW_PV} mingw64 || die
+
+	default
+}
+
+src_compile() {
+	# not great but do everything in src_compile given bootstrapping
+	# process needs to be done in steps of configure+compile+install
+	# (done modular to have most package-specific things in one place)
+
+	CTARGET=$(usex x86 i686 x86_64)-w64-mingw32
+
+	MWT_D=${T}/root # moved to ${D} in src_install
+	local mwtdir=/usr/lib/${PN}
+	local prefix=${EPREFIX}${mwtdir}
+	local sysroot=${MWT_D}${prefix}
+	local -x PATH=${sysroot}/bin:${PATH}
+
+	filter-lto # requires setting up, and may be messy with mingw static libs
+	use custom-cflags || strip-flags # fancy flags are not realistic here
+
+	local multilib=false
+	use abi_x86_32 && use abi_x86_64 && multilib=true
+
+	# global configure flags
+	local conf=(
+		--build=${CBUILD:-${CHOST}}
+		--target=${CTARGET}
+		--{doc,info,man}dir=/.skip # let individual packages handle docs
+	)
+
+	# binutils
+	local conf_binutils=(
+		--prefix="${prefix}"
+		--host=${CHOST}
+		--disable-cet
+		--disable-default-execstack
+		--disable-nls
+		--disable-shared
+		--with-system-zlib
+		--without-debuginfod
+		--without-msgpack
+		--without-zstd
+	)
+	mwt-binutils() {
+		# symlink gcc's lto plugin for AR (bug #854516)
+		ln -s ../../libexec/gcc/${CTARGET}/${GCC_PV%%[.-]*}/liblto_plugin.so \
+			"${sysroot}"/lib/bfd-plugins || die
+	}
+
+	# gcc (minimal -- if need more, disable only in stage1 / enable in stage3)
+	local conf_gcc=(
+		--prefix="${prefix}"
+		--host=${CHOST}
+		--disable-bootstrap
+		--disable-cet
+		--disable-gcov #843989
+		--disable-gomp
+		--disable-libquadmath
+		--disable-libsanitizer
+		--disable-libssp
+		--disable-libvtv
+		--disable-shared
+		--disable-werror
+		--with-gcc-major-version-only
+		--with-system-zlib
+		--without-isl
+		--without-zstd
+	)
+	${multilib} || conf_gcc+=( --disable-multilib )
+
+	local conf_gcc_stage1=(
+		--enable-languages=c
+		--disable-libatomic
+		--with-sysroot="${sysroot}"
+	)
+	local -n conf_gcc_stage2=conf_gcc_stage1
+
+	local conf_gcc_stage3=(
+		--enable-languages=c,c++
+		--enable-threads=posix # needs stage3, and is required for dxvk/vkd3d
+		--with-sysroot="${prefix}"
+		--with-build-sysroot="${sysroot}"
+	)
+
+	# mingw64-runtime (split in several parts, 3 needed for gcc stages)
+	local conf_mingw64=(
+		--prefix="${prefix}"/${CTARGET}
+		--host=${CTARGET}
+		--with-sysroot=no
+		--without-{crt,headers}
+
+		# mingw .dll aren't used by wine and packages wouldn't find them
+		# at runtime, use crossdev if need dll and proper search paths
+		--disable-shared
+	)
+
+	local conf_mingw64_headers=(
+		--enable-idl
+		--with-headers
+	)
+	mwt-mingw64_headers() { ln -s ${CTARGET} "${sysroot}"/mingw || die; } #419601
+
+	local conf_mingw64_runtime=( --with-crt )
+	${multilib} ||
+		conf_mingw64_runtime+=( $(usex x86 --disable-lib64 --disable-lib32 ) )
+
+	local conf_mingw64_libraries=( --with-libraries )
+	local conf_mingw64_libraries32=(
+		--libdir="${prefix}"/${CTARGET}/lib32
+		--with-libraries
+		CC="${CTARGET}-gcc -m32"
+		RCFLAGS="--target=pe-i386 ${RCFLAGS}"
+	)
+
+	# mingw64-runtime's idl compiler (useful not to depend on wine for widl)
+	local conf_widl=( --prefix="${prefix}" )
+
+	# mwt-build [-x] <path/package-name> [stage-name]
+	# -> ./configure && make && make install && mwt-package() && mwt-package_stage()
+	# passes conf, conf_package, and conf_package_stage arrays to configure, and
+	# users can add options through environment with e.g.
+	#	MWT_BINUTILS_CONF="--some-option"
+	#	MWT_GCC_STAGE1_CONF="--some-gcc-stage1-only-option"
+	#	MWT_WIDL_CONF="--some-other-option"
+	#	EXTRA_ECONF="--global-option" (generic naming for if not reading this)
+	mwt-build() {
+		if [[ ${1} == -x ]]; then
+			(
+				# cross-compiling, cleanup and let ./configure handle it
+				unset AR AS CC CPP CXX LD NM OBJCOPY OBJDUMP RANLIB RC STRIP
+				CHOST=${CTARGET}
+				filter-flags '-fuse-ld=*'
+				filter-flags '-mfunction-return=thunk*' #878849
+				strip-unsupported-flags
+				mwt-build "${@:2}"
+			)
+			return
+		fi
+
+		local id=${1##*/}
+		local build_dir=${WORKDIR}/${1}${2+_${2}}-build
+
+		# econf is not allowed in src_compile and its defaults are
+		# mostly unused here, so use configure directly
+		local conf=( "${WORKDIR}/${1}"/configure "${conf[@]}" )
+
+		local -n conf_id=conf_${id} conf_id2=conf_${id}_${2}
+		[[ ${conf_id@a} == *a* ]] && conf+=( "${conf_id[@]}" )
+		[[ ${2} && ${conf_id2@a} == *a* ]] && conf+=( "${conf_id2[@]}" )
+
+		local -n extra_id=MWT_${id^^}_CONF extra_id2=MWT_${id^^}_${2^^}_CONF
+		conf+=( ${EXTRA_ECONF} ${extra_id} ${2+${extra_id2}} )
+
+		einfo "Building ${id}${2+ ${2}} in ${build_dir} ..."
+
+		mkdir -p "${build_dir}" || die
+		pushd "${build_dir}" >/dev/null || die
+
+		edo "${conf[@]}"
+		emake
+		emake DESTDIR="${MWT_D}" install
+
+		declare -f mwt-${id} >/dev/null && edo mwt-${id}
+		declare -f mwt-${id}_${2} >/dev/null && edo mwt-${id}_${2}
+
+		popd >/dev/null || die
+	}
+
+	# workaround race condition with out-of-source crt build (bug #879537)
+	mkdir -p mingw64_runtime-build/mingw-w64-crt/lib{32,64} || die
+
+	# build with same ordering that crossdev would do + stage3 for pthreads
+	mwt-build binutils
+	mwt-build mingw64 headers
+	mwt-build gcc stage1
+	mwt-build -x mingw64 runtime
+	mwt-build gcc stage2
+	${multilib} && mwt-build -x mingw64 libraries32
+	mwt-build -x mingw64 libraries
+	mwt-build gcc stage3
+	mwt-build mingw64/mingw-w64-tools/widl
+	# note: /could/ system-bootstrap if already installed, but gcc and
+	# libraries will use the system's older mingw64 headers/static-libs
+	# and make this potentially fragile without more workarounds/stages
+
+	if ${multilib}; then
+		# Like system's gcc, `x86_64-w64-mingw32-gcc -m32` can build for x86,
+		# but packages expect crossdev's i686-w64-mingw32-gcc which is the same
+		# just without 64bit support and would rather not build the toolchain
+		# twice. Dirty but wrap to allow simple interoperability with crossdev.
+		mwt-i686_wrapper() {
+			printf "#!/usr/bin/env sh\nexec \"${prefix}/bin/${bin}\" ${*} "'"${@}"\n' \
+				> ${bin32} || die
+			chmod +x ${bin32} || die
+		}
+		pushd "${sysroot}"/bin >/dev/null || die
+		local bin bin32
+		for bin in ${CTARGET}-*; do
+			bin32=${bin/x86_64-w64/i686-w64}
+			case ${bin#${CTARGET}-} in
+				as) mwt-i686_wrapper --32;;
+				cpp|gcc|gcc-${GCC_PV%%[.-]*}|g++|widl) mwt-i686_wrapper -m32;;
+				ld|ld.bfd) mwt-i686_wrapper -m i386pe;;
+				windres) mwt-i686_wrapper --target=pe-i386;;
+				*) ln -s ${bin} ${bin32} || die;;
+			esac
+		done
+		popd >/dev/null || die
+	fi
+
+	# portage doesn't know the right strip executable to use for CTARGET
+	# and it can lead to .a mangling, notably with 32bit (breaks toolchain)
+	dostrip -x ${mwtdir}/{${CTARGET}/lib{,32},lib/gcc/${CTARGET}}
+
+	# ... and instead do it here given this saves ~60MB
+	if use !debug; then
+		einfo "Stripping ${CTARGET} static libraries ..."
+		find "${sysroot}"/{,lib/gcc/}${CTARGET} -type f -name '*.a' \
+			-exec ${CTARGET}-strip --strip-unneeded {} + || die
+	fi
+}
+
+src_install() {
+	mv "${MWT_D}${EPREFIX}"/* "${ED}" || die
+
+	find "${ED}" -type f -name '*.la' -delete || die
+}
+
+pkg_postinst() {
+	if [[ ! ${REPLACING_VERSIONS} ]]; then
+		elog "Note that this package is primarily intended for Wine and related"
+		elog "packages to depend on without needing a manual crossdev setup."
+		elog
+		elog "Settings are oriented only for what these need and simplicity."
+		elog "Use sys-devel/crossdev if need full toolchain/customization:"
+		elog "    https://wiki.gentoo.org/wiki/Mingw"
+		elog "    https://wiki.gentoo.org/wiki/Crossdev"
+	fi
+
+	local cross_gcc=cross-$(usex x86 i686 x86_64)-w64-mingw32/gcc
+	if has_version ${cross_gcc}; then
+		# encourage cleanup given users may not realize if switch by default
+		ewarn "${cross_gcc} is installed, note that ${PN}"
+		ewarn "is redundant with the *-w64-mingw32/{binutils,gcc,mingw64-runtime}"
+		ewarn "packages and optionally only one needs to be kept."
+	fi
+}


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2023-05-11 17:01 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2023-05-11 17:01 UTC (permalink / raw
  To: gentoo-commits

commit:     7d7cbaccd18980dd47f652ce80a745d289b0c352
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Thu May 11 16:54:46 2023 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Thu May 11 17:00:10 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7d7cbacc

dev-util/mingw64-toolchain: drop 10.0.0_p4

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 .../mingw64-toolchain-10.0.0_p4.ebuild             | 321 ---------------------
 1 file changed, 321 deletions(-)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p4.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p4.ebuild
deleted file mode 100644
index daed2fea783e..000000000000
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p4.ebuild
+++ /dev/null
@@ -1,321 +0,0 @@
-# Copyright 2022-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-MULTILIB_COMPAT=( abi_x86_{32,64} )
-inherit edo flag-o-matic multilib-build toolchain-funcs
-
-# Pick versions known to work for wine+dxvk, and avoid too frequent updates
-# due to slow rebuilds. Do _p1++ rather than revbump on changes (not using
-# Gentoo patchsets for simplicity, their changes are mostly unneeded here).
-BINUTILS_PV=2.40
-GCC_PV=13.1.0
-MINGW_PV=$(ver_cut 1-3)
-
-DESCRIPTION="All-in-one mingw64 toolchain intended for building Wine without crossdev"
-HOMEPAGE="
-	https://www.mingw-w64.org/
-	https://gcc.gnu.org/
-	https://sourceware.org/binutils/"
-SRC_URI="
-	mirror://sourceforge/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${MINGW_PV}.tar.bz2
-	mirror://gnu/binutils/binutils-${BINUTILS_PV}.tar.xz"
-if [[ ${GCC_PV} == *-* ]]; then
-	SRC_URI+=" mirror://gcc/snapshots/${GCC_PV}/gcc-${GCC_PV}.tar.xz"
-else
-	SRC_URI+="
-		mirror://gcc/gcc-${GCC_PV}/gcc-${GCC_PV}.tar.xz
-		mirror://gnu/gcc/gcc-${GCC_PV}/gcc-${GCC_PV}.tar.xz"
-fi
-S="${WORKDIR}"
-
-# l1:binutils+gcc, l2:gcc(libraries), l3:mingw64-runtime
-LICENSE="
-	GPL-3+
-	LGPL-3+ || ( GPL-3+ libgcc libstdc++ gcc-runtime-library-exception-3.1 )
-	ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain"
-SLOT="0"
-KEYWORDS="-* ~amd64 ~x86"
-IUSE="+abi_x86_32 custom-cflags debug"
-
-RDEPEND="
-	dev-libs/gmp:=
-	dev-libs/mpc:=
-	dev-libs/mpfr:=
-	sys-libs/zlib:=
-	virtual/libiconv"
-DEPEND="${RDEPEND}"
-
-QA_CONFIG_IMPL_DECL_SKIP=(
-	strerror_r # libstdc++ test using -Wimplicit+error
-)
-
-PATCHES=(
-	"${FILESDIR}"/mingw64-runtime-10.0.0-msvcr-extra-race.patch
-	"${FILESDIR}"/mingw64-runtime-10.0.0-tmp-files-clash.patch
-	"${FILESDIR}"/binutils-2.40-import-lib.patch
-	"${FILESDIR}"/gcc-12.2.0-drop-cflags-sed.patch
-)
-
-pkg_pretend() {
-	[[ ${MERGE_TYPE} == binary ]] && return
-
-	tc-is-cross-compiler &&
-		die "cross-compilation of the toolchain itself is unsupported"
-}
-
-src_prepare() {
-	# rename directories to simplify both patching and the ebuild
-	mv binutils{-${BINUTILS_PV},} || die
-	mv gcc{-${GCC_PV},} || die
-	mv mingw-w64-v${MINGW_PV} mingw64 || die
-
-	default
-}
-
-src_compile() {
-	# not great but do everything in src_compile given bootstrapping
-	# process needs to be done in steps of configure+compile+install
-	# (done modular to have most package-specific things in one place)
-
-	CTARGET=$(usex x86 i686 x86_64)-w64-mingw32
-
-	MWT_D=${T}/root # moved to ${D} in src_install
-	local mwtdir=/usr/lib/${PN}
-	local prefix=${EPREFIX}${mwtdir}
-	local sysroot=${MWT_D}${prefix}
-	local -x PATH=${sysroot}/bin:${PATH}
-
-	filter-lto # requires setting up, and may be messy with mingw static libs
-	use custom-cflags || strip-flags # fancy flags are not realistic here
-
-	local multilib=false
-	use abi_x86_32 && use abi_x86_64 && multilib=true
-
-	# global configure flags
-	local conf=(
-		--build=${CBUILD:-${CHOST}}
-		--target=${CTARGET}
-		--{doc,info,man}dir=/.skip # let individual packages handle docs
-	)
-
-	# binutils
-	local conf_binutils=(
-		--prefix="${prefix}"
-		--host=${CHOST}
-		--disable-cet
-		--disable-default-execstack
-		--disable-nls
-		--disable-shared
-		--with-system-zlib
-		--without-debuginfod
-		--without-msgpack
-		--without-zstd
-	)
-	mwt-binutils() {
-		# symlink gcc's lto plugin for AR (bug #854516)
-		ln -s ../../libexec/gcc/${CTARGET}/${GCC_PV%%[.-]*}/liblto_plugin.so \
-			"${sysroot}"/lib/bfd-plugins || die
-	}
-
-	# gcc (minimal -- if need more, disable only in stage1 / enable in stage3)
-	local conf_gcc=(
-		--prefix="${prefix}"
-		--host=${CHOST}
-		--disable-bootstrap
-		--disable-cet
-		--disable-gcov #843989
-		--disable-gomp
-		--disable-libquadmath
-		--disable-libsanitizer
-		--disable-libssp
-		--disable-libvtv
-		--disable-shared
-		--disable-werror
-		--with-gcc-major-version-only
-		--with-system-zlib
-		--without-isl
-		--without-zstd
-	)
-	${multilib} || conf_gcc+=( --disable-multilib )
-
-	local conf_gcc_stage1=(
-		--enable-languages=c
-		--disable-libatomic
-		--with-sysroot="${sysroot}"
-	)
-	local -n conf_gcc_stage2=conf_gcc_stage1
-
-	local conf_gcc_stage3=(
-		--enable-languages=c,c++
-		--enable-threads=posix # needs stage3, and is required for dxvk/vkd3d
-		--with-sysroot="${prefix}"
-		--with-build-sysroot="${sysroot}"
-	)
-
-	# mingw64-runtime (split in several parts, 3 needed for gcc stages)
-	local conf_mingw64=(
-		--prefix="${prefix}"/${CTARGET}
-		--host=${CTARGET}
-		--with-sysroot=no
-		--without-{crt,headers}
-
-		# mingw .dll aren't used by wine and packages wouldn't find them
-		# at runtime, use crossdev if need dll and proper search paths
-		--disable-shared
-	)
-
-	local conf_mingw64_headers=(
-		--enable-idl
-		--with-headers
-	)
-	mwt-mingw64_headers() { ln -s ${CTARGET} "${sysroot}"/mingw || die; } #419601
-
-	local conf_mingw64_runtime=( --with-crt )
-	${multilib} ||
-		conf_mingw64_runtime+=( $(usex x86 --disable-lib64 --disable-lib32 ) )
-
-	local conf_mingw64_libraries=( --with-libraries )
-	local conf_mingw64_libraries32=(
-		--libdir="${prefix}"/${CTARGET}/lib32
-		--with-libraries
-		CC="${CTARGET}-gcc -m32"
-		RCFLAGS="--target=pe-i386 ${RCFLAGS}"
-	)
-
-	# mingw64-runtime's idl compiler (useful not to depend on wine for widl)
-	local conf_widl=( --prefix="${prefix}" )
-
-	# mwt-build [-x] <path/package-name> [stage-name]
-	# -> ./configure && make && make install && mwt-package() && mwt-package_stage()
-	# passes conf, conf_package, and conf_package_stage arrays to configure, and
-	# users can add options through environment with e.g.
-	#	MWT_BINUTILS_CONF="--some-option"
-	#	MWT_GCC_STAGE1_CONF="--some-gcc-stage1-only-option"
-	#	MWT_WIDL_CONF="--some-other-option"
-	#	EXTRA_ECONF="--global-option" (generic naming for if not reading this)
-	mwt-build() {
-		if [[ ${1} == -x ]]; then
-			(
-				# cross-compiling, cleanup and let ./configure handle it
-				unset AR AS CC CPP CXX LD NM OBJCOPY OBJDUMP RANLIB RC STRIP
-				CHOST=${CTARGET}
-				filter-flags '-fstack-clash-protection' #758914
-				filter-flags '-fstack-protector*' #870136
-				filter-flags '-fuse-ld=*'
-				filter-flags '-mfunction-return=thunk*' #878849
-				strip-unsupported-flags
-				mwt-build "${@:2}"
-			)
-			return
-		fi
-
-		local id=${1##*/}
-		local build_dir=${WORKDIR}/${1}${2+_${2}}-build
-
-		# econf is not allowed in src_compile and its defaults are
-		# mostly unused here, so use configure directly
-		local conf=( "${WORKDIR}/${1}"/configure "${conf[@]}" )
-
-		local -n conf_id=conf_${id} conf_id2=conf_${id}_${2}
-		[[ ${conf_id@a} == *a* ]] && conf+=( "${conf_id[@]}" )
-		[[ ${2} && ${conf_id2@a} == *a* ]] && conf+=( "${conf_id2[@]}" )
-
-		local -n extra_id=MWT_${id^^}_CONF extra_id2=MWT_${id^^}_${2^^}_CONF
-		conf+=( ${EXTRA_ECONF} ${extra_id} ${2+${extra_id2}} )
-
-		einfo "Building ${id}${2+ ${2}} in ${build_dir} ..."
-
-		mkdir -p "${build_dir}" || die
-		pushd "${build_dir}" >/dev/null || die
-
-		edo "${conf[@]}"
-		emake
-		emake DESTDIR="${MWT_D}" install
-
-		declare -f mwt-${id} >/dev/null && edo mwt-${id}
-		declare -f mwt-${id}_${2} >/dev/null && edo mwt-${id}_${2}
-
-		popd >/dev/null || die
-	}
-
-	# workaround race condition with out-of-source crt build (bug #879537)
-	mkdir -p mingw64_runtime-build/mingw-w64-crt/lib{32,64} || die
-
-	# build with same ordering that crossdev would do + stage3 for pthreads
-	mwt-build binutils
-	mwt-build mingw64 headers
-	mwt-build gcc stage1
-	mwt-build -x mingw64 runtime
-	mwt-build gcc stage2
-	${multilib} && mwt-build -x mingw64 libraries32
-	mwt-build -x mingw64 libraries
-	mwt-build gcc stage3
-	mwt-build mingw64/mingw-w64-tools/widl
-	# note: /could/ system-bootstrap if already installed, but gcc and
-	# libraries will use the system's older mingw64 headers/static-libs
-	# and make this potentially fragile without more workarounds/stages
-
-	if ${multilib}; then
-		# Like system's gcc, `x86_64-w64-mingw32-gcc -m32` can build for x86,
-		# but packages expect crossdev's i686-w64-mingw32-gcc which is the same
-		# just without 64bit support and would rather not build the toolchain
-		# twice. Dirty but wrap to allow simple interoperability with crossdev.
-		mwt-i686_wrapper() {
-			printf "#!/usr/bin/env sh\nexec \"${prefix}/bin/${bin}\" ${*} "'"${@}"\n' \
-				> ${bin32} || die
-			chmod +x ${bin32} || die
-		}
-		pushd "${sysroot}"/bin >/dev/null || die
-		local bin bin32
-		for bin in ${CTARGET}-*; do
-			bin32=${bin/x86_64-w64/i686-w64}
-			case ${bin#${CTARGET}-} in
-				as) mwt-i686_wrapper --32;;
-				cpp|gcc|gcc-${GCC_PV%%[.-]*}|g++|widl) mwt-i686_wrapper -m32;;
-				ld|ld.bfd) mwt-i686_wrapper -m i386pe;;
-				windres) mwt-i686_wrapper --target=pe-i386;;
-				*) ln -s ${bin} ${bin32} || die;;
-			esac
-		done
-		popd >/dev/null || die
-	fi
-
-	# portage doesn't know the right strip executable to use for CTARGET
-	# and it can lead to .a mangling, notably with 32bit (breaks toolchain)
-	dostrip -x ${mwtdir}/{${CTARGET}/lib{,32},lib/gcc/${CTARGET}}
-
-	# ... and instead do it here given this saves ~60MB
-	if use !debug; then
-		einfo "Stripping ${CTARGET} static libraries ..."
-		find "${sysroot}"/{,lib/gcc/}${CTARGET} -type f -name '*.a' \
-			-exec ${CTARGET}-strip --strip-unneeded {} + || die
-	fi
-}
-
-src_install() {
-	mv "${MWT_D}${EPREFIX}"/* "${ED}" || die
-
-	find "${ED}" -type f -name '*.la' -delete || die
-}
-
-pkg_postinst() {
-	if [[ ! ${REPLACING_VERSIONS} ]]; then
-		elog "Note that this package is primarily intended for Wine and related"
-		elog "packages to depend on without needing a manual crossdev setup."
-		elog
-		elog "Settings are oriented only for what these need and simplicity."
-		elog "Use sys-devel/crossdev if need full toolchain/customization:"
-		elog "    https://wiki.gentoo.org/wiki/Mingw"
-		elog "    https://wiki.gentoo.org/wiki/Crossdev"
-	fi
-
-	local cross_gcc=cross-$(usex x86 i686 x86_64)-w64-mingw32/gcc
-	if has_version ${cross_gcc}; then
-		# encourage cleanup given users may not realize if switch by default
-		ewarn "${cross_gcc} is installed, note that ${PN}"
-		ewarn "is redundant with the *-w64-mingw32/{binutils,gcc,mingw64-runtime}"
-		ewarn "packages and optionally only one needs to be kept."
-	fi
-}


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2023-05-19  1:41 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2023-05-19  1:41 UTC (permalink / raw
  To: gentoo-commits

commit:     e38deba76eb1f0c07b03ba8d99dd92f985425b5c
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Fri May 19 01:35:42 2023 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Fri May 19 01:41:14 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e38deba7

dev-util/mingw64-toolchain: use -j1 for make install

Matches the change from bug #906155.

This may potentially not be affected with what it builds, but all
these packages have a tendendency to be fragile in that regard and
there's not much to gain from threads on install.

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r2.ebuild | 5 +++--
 dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0.ebuild       | 3 ++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r2.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r2.ebuild
index d3215a0ed723..82af5181e021 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r2.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2022 Gentoo Authors
+# Copyright 2022-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -220,7 +220,8 @@ src_compile() {
 
 		edo "${conf[@]}"
 		emake
-		emake DESTDIR="${MWT_D}" install
+		# -j1 to match bug #906155, other packages may be fragile too
+		emake -j1 DESTDIR="${MWT_D}" install
 
 		declare -f mwt-${id} >/dev/null && edo mwt-${id}
 		declare -f mwt-${id}_${2} >/dev/null && edo mwt-${id}_${2}

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0.ebuild
index 360f880e3610..c1d38e605af9 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0.ebuild
@@ -228,7 +228,8 @@ src_compile() {
 
 		edo "${conf[@]}"
 		emake
-		emake DESTDIR="${MWT_D}" install
+		# -j1 to match bug #906155, other packages may be fragile too
+		emake -j1 DESTDIR="${MWT_D}" install
 
 		declare -f mwt-${id} >/dev/null && edo mwt-${id}
 		declare -f mwt-${id}_${2} >/dev/null && edo mwt-${id}_${2}


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2023-05-29 15:06 Sam James
  0 siblings, 0 replies; 54+ messages in thread
From: Sam James @ 2023-05-29 15:06 UTC (permalink / raw
  To: gentoo-commits

commit:     3d74c9a992890a318ecbb03d7dadb6471165fe1a
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon May 29 15:05:55 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon May 29 15:05:55 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3d74c9a9

dev-util/mingw64-toolchain: Stabilize 11.0.0 amd64, #907368

Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0.ebuild
index c1d38e605af9..db1625cb1195 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0.ebuild
@@ -36,7 +36,7 @@ LICENSE="
 	LGPL-3+ || ( GPL-3+ libgcc libstdc++ gcc-runtime-library-exception-3.1 )
 	ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain"
 SLOT="0"
-KEYWORDS="-* ~amd64 ~x86"
+KEYWORDS="-* amd64 ~x86"
 IUSE="+abi_x86_32 custom-cflags debug"
 
 RDEPEND="


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2023-05-29 17:49 Arthur Zamarin
  0 siblings, 0 replies; 54+ messages in thread
From: Arthur Zamarin @ 2023-05-29 17:49 UTC (permalink / raw
  To: gentoo-commits

commit:     de256c97bb76d48e4f504987fc8d7f36b1bf1789
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Mon May 29 17:49:00 2023 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Mon May 29 17:49:00 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=de256c97

dev-util/mingw64-toolchain: Stabilize 11.0.0 x86, #907368

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0.ebuild
index db1625cb1195..d4fe6b516d10 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0.ebuild
@@ -36,7 +36,7 @@ LICENSE="
 	LGPL-3+ || ( GPL-3+ libgcc libstdc++ gcc-runtime-library-exception-3.1 )
 	ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain"
 SLOT="0"
-KEYWORDS="-* amd64 ~x86"
+KEYWORDS="-* amd64 x86"
 IUSE="+abi_x86_32 custom-cflags debug"
 
 RDEPEND="


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2023-06-26 10:12 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2023-06-26 10:12 UTC (permalink / raw
  To: gentoo-commits

commit:     0757e1e630fba6b5f064002bdc18e173d47fdc5f
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 26 09:58:42 2023 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Mon Jun 26 10:10:10 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0757e1e6

dev-util/mingw64-toolchain: pass -mno-avx for mingw cross

AVX issues with mingw-gcc aren't exactly new, e.g.
https://bugs.winehq.org/show_bug.cgi?id=45289
Been known to cause issues with dxvk too, albeit unsure
if that's still relevant as issues are scattered/lost.

Newly, >=wine-8.10 is likely to crash doing anything
at all 32bit if used -march=native (w/ avx) and 32bit
(e.g. `WINEARCH=win32 winecfg`).

Adding this to every packages using mingw as a precaution,
not believed there is much to gain from keeping AVX given
the fragility here. May revisit eventually with a newer GCC.

Not known to have caused issues with this package in particular
(unlike wine/dxvk), so skipping a slow rebuild revbump.

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r2.ebuild | 7 +++++++
 dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0.ebuild       | 7 +++++++
 2 files changed, 14 insertions(+)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r2.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r2.ebuild
index 82af5181e021..cb802c55f8b1 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r2.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r2.ebuild
@@ -193,6 +193,13 @@ src_compile() {
 				filter-flags '-fstack-protector*' #870136
 				filter-flags '-fuse-ld=*'
 				filter-flags '-mfunction-return=thunk*' #878849
+
+				# -mavx with mingw-gcc has a history of obscure issues and
+				# disabling is seen as safer, e.g. `WINEARCH=win32 winecfg`
+				# crashes with -march=skylake >=wine-8.10, similar issues with
+				# znver4: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110273
+				append-flags -mno-avx
+
 				strip-unsupported-flags
 				mwt-build "${@:2}"
 			)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0.ebuild
index d4fe6b516d10..803cd398d9be 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0.ebuild
@@ -201,6 +201,13 @@ src_compile() {
 				CHOST=${CTARGET}
 				filter-flags '-fuse-ld=*'
 				filter-flags '-mfunction-return=thunk*' #878849
+
+				# -mavx with mingw-gcc has a history of obscure issues and
+				# disabling is seen as safer, e.g. `WINEARCH=win32 winecfg`
+				# crashes with -march=skylake >=wine-8.10, similar issues with
+				# znver4: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110273
+				append-flags -mno-avx
+
 				strip-unsupported-flags
 				mwt-build "${@:2}"
 			)


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2023-07-03 20:55 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2023-07-03 20:55 UTC (permalink / raw
  To: gentoo-commits

commit:     a8c399928eba0bbd84255e3819f6dd8485b3c584
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Mon Jul  3 20:31:36 2023 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Mon Jul  3 20:54:52 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a8c39992

dev-util/mingw64-toolchain: pass V=1 for binutils

Overlooked that parts of binutils weren't verbose, so do like the
binutils ebuild does. Harmless for gcc/runtime, so can just put it
in the generic function.

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r2.ebuild | 4 ++--
 dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0.ebuild       | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r2.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r2.ebuild
index cb802c55f8b1..0cd505bd6851 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r2.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r2.ebuild
@@ -226,9 +226,9 @@ src_compile() {
 		pushd "${build_dir}" >/dev/null || die
 
 		edo "${conf[@]}"
-		emake
+		emake V=1
 		# -j1 to match bug #906155, other packages may be fragile too
-		emake -j1 DESTDIR="${MWT_D}" install
+		emake -j1 V=1 DESTDIR="${MWT_D}" install
 
 		declare -f mwt-${id} >/dev/null && edo mwt-${id}
 		declare -f mwt-${id}_${2} >/dev/null && edo mwt-${id}_${2}

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0.ebuild
index 803cd398d9be..fe1e24330e9d 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0.ebuild
@@ -234,9 +234,9 @@ src_compile() {
 		pushd "${build_dir}" >/dev/null || die
 
 		edo "${conf[@]}"
-		emake
+		emake V=1
 		# -j1 to match bug #906155, other packages may be fragile too
-		emake -j1 DESTDIR="${MWT_D}" install
+		emake -j1 V=1 DESTDIR="${MWT_D}" install
 
 		declare -f mwt-${id} >/dev/null && edo mwt-${id}
 		declare -f mwt-${id}_${2} >/dev/null && edo mwt-${id}_${2}


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2023-07-28  5:16 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2023-07-28  5:16 UTC (permalink / raw
  To: gentoo-commits

commit:     8e22f70e210eab6a1b13d6c126ddb470a4bf83c9
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 28 01:48:59 2023 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Fri Jul 28 05:15:45 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e22f70e

dev-util/mingw64-toolchain: add 11.0.0_p1 w/ gcc-13.2 (unkeyworded)

No known issues at the moment (albeit barely tested), primarily
unkeyworded to skip a slow rebuild until the bump can be more
useful (e.g. also bump binutils or runtime, and do a _p2).

May keyword earlier if it is known to fix notable issues with Wine.

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/Manifest                |   1 +
 .../mingw64-toolchain-11.0.0_p1.ebuild             | 327 +++++++++++++++++++++
 2 files changed, 328 insertions(+)

diff --git a/dev-util/mingw64-toolchain/Manifest b/dev-util/mingw64-toolchain/Manifest
index c34f2d99ef72..8c70917a1f31 100644
--- a/dev-util/mingw64-toolchain/Manifest
+++ b/dev-util/mingw64-toolchain/Manifest
@@ -2,5 +2,6 @@ DIST binutils-2.39.tar.xz 25167756 BLAKE2B ac6a5296c6586d53eaadcbffc5c399a6d79ed
 DIST binutils-2.40.tar.xz 25241484 BLAKE2B 8d799f7c595f878b9af5b17a490021dd8b8300ac2fe0ed8574c012929d22d2d0493e003a3e631a9436e8e712da801779b777c566167fe42b0bde119ffa5ad1c2 SHA512 a37e042523bc46494d99d5637c3f3d8f9956d9477b748b3b1f6d7dfbb8d968ed52c932e88a4e946c6f77b8f48f1e1b360ca54c3d298f17193f3b4963472f6925
 DIST gcc-12.2.0.tar.xz 84645292 BLAKE2B 715574af9ad678f9dc8cfd19c866bf910c7edfd479e7e9681337feaa9b54e5d304ddb85483816b8d89754d502405823ae2eff0d1e444538763f40be8e428d8da SHA512 e9e857bd81bf7a370307d6848c81b2f5403db8c7b5207f54bce3f3faac3bde63445684092c2bc1a2427cddb6f7746496d9fbbef05fbbd77f2810b2998f1f9173
 DIST gcc-13.1.0.tar.xz 87451196 BLAKE2B b956a773cffe8b43bd6c9a99fe614f53f665438925a6b320975d301f547923e45d4d6fa577a143467fb03e0a9c1bab2b6719a1011d672367f3e644433a2d7606 SHA512 6cf06dfc48f57f5e67f7efe3248019329a14d690c728d9f2f7ef5fa0d58f1816f309586ba7ea2eac20d0b60a2d1b701f68392e9067dd46f827ba0efd7192db33
+DIST gcc-13.2.0.tar.xz 87858592 BLAKE2B 0034b29d3d6cc05821f0c4253ce077805943aff7b370729dd203bda57d89c107edd657eeddc2fb1e69ea15c7b0323b961f46516c7f4af89a3ccf7fea84701be2 SHA512 d99e4826a70db04504467e349e9fbaedaa5870766cda7c5cab50cdebedc4be755ebca5b789e1232a34a20be1a0b60097de9280efe47bdb71c73251e30b0862a2
 DIST mingw-w64-v10.0.0.tar.bz2 9620291 BLAKE2B 451372403289c492ca939d65bb4d9f6e9fa6bdd6b32d79d6438d858e106e8cc291712ada1f3f7b951a4c6908e7d0385d485ca76920af39bcf86effa48408e330 SHA512 3c0827af7c40809a867758f6cd9ef3ff0c988b43082345bf725e03949af95968d634ace99a7ffae323189549221dcb5d861de9e801f1fbc7904e446641b60516
 DIST mingw-w64-v11.0.0.tar.bz2 10058657 BLAKE2B 3f7637bcc7c3f25b2141d35105ea086eab74e228d7275725ffb4f07e283fd75169dbe0900a9c29494fba9ddb2ea03bdd6ae26f06048311e9c93ae3e317c4c060 SHA512 bc1c9fd9d8593ead9375fcbe40950f06cf7616b94dc676db2793ac9b496fe3a6cc94b5793effda3b752942be0d7d01a1c37a8f221aaf178df0d4eeb0aa6d1f8d

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p1.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p1.ebuild
new file mode 100644
index 000000000000..1ba6d9f3c46f
--- /dev/null
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p1.ebuild
@@ -0,0 +1,327 @@
+# Copyright 2022-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MULTILIB_COMPAT=( abi_x86_{32,64} )
+inherit edo flag-o-matic multilib-build toolchain-funcs
+
+# Pick versions known to work for wine+dxvk, and avoid too frequent updates
+# due to slow rebuilds. Do _p1++ rather than revbump on changes (not using
+# Gentoo patchsets for simplicity, their changes are mostly unneeded here).
+BINUTILS_PV=2.40
+GCC_PV=13.2.0
+MINGW_PV=$(ver_cut 1-3)
+
+DESCRIPTION="All-in-one mingw64 toolchain intended for building Wine without crossdev"
+HOMEPAGE="
+	https://www.mingw-w64.org/
+	https://gcc.gnu.org/
+	https://sourceware.org/binutils/"
+SRC_URI="
+	mirror://sourceforge/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${MINGW_PV}.tar.bz2
+	mirror://gnu/binutils/binutils-${BINUTILS_PV}.tar.xz"
+if [[ ${GCC_PV} == *-* ]]; then
+	SRC_URI+=" mirror://gcc/snapshots/${GCC_PV}/gcc-${GCC_PV}.tar.xz"
+else
+	SRC_URI+="
+		mirror://gcc/gcc-${GCC_PV}/gcc-${GCC_PV}.tar.xz
+		mirror://gnu/gcc/gcc-${GCC_PV}/gcc-${GCC_PV}.tar.xz"
+fi
+S="${WORKDIR}"
+
+# l1:binutils+gcc, l2:gcc(libraries), l3:mingw64-runtime
+LICENSE="
+	GPL-3+
+	LGPL-3+ || ( GPL-3+ libgcc libstdc++ gcc-runtime-library-exception-3.1 )
+	ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain"
+SLOT="0"
+# okay to use/test, primarily unkeyworded to avoid a slow rebuild until it
+# can be more useful, e.g. also bump binutils or runtime on top of gcc in _p2
+#KEYWORDS="-* ~amd64 ~x86"
+IUSE="+abi_x86_32 custom-cflags debug"
+
+RDEPEND="
+	dev-libs/gmp:=
+	dev-libs/mpc:=
+	dev-libs/mpfr:=
+	sys-libs/zlib:=
+	virtual/libiconv"
+DEPEND="${RDEPEND}"
+
+QA_CONFIG_IMPL_DECL_SKIP=(
+	strerror_r # libstdc++ test using -Wimplicit+error
+)
+
+PATCHES=(
+	"${FILESDIR}"/binutils-2.40-import-lib.patch
+	"${FILESDIR}"/gcc-12.2.0-drop-cflags-sed.patch
+)
+
+pkg_pretend() {
+	[[ ${MERGE_TYPE} == binary ]] && return
+
+	tc-is-cross-compiler &&
+		die "cross-compilation of the toolchain itself is unsupported"
+}
+
+src_prepare() {
+	# rename directories to simplify both patching and the ebuild
+	mv binutils{-${BINUTILS_PV},} || die
+	mv gcc{-${GCC_PV},} || die
+	mv mingw-w64-v${MINGW_PV} mingw64 || die
+
+	default
+}
+
+src_compile() {
+	# not great but do everything in src_compile given bootstrapping
+	# process needs to be done in steps of configure+compile+install
+	# (done modular to have most package-specific things in one place)
+
+	CTARGET=$(usex x86 i686 x86_64)-w64-mingw32
+
+	MWT_D=${T}/root # moved to ${D} in src_install
+	local mwtdir=/usr/lib/${PN}
+	local prefix=${EPREFIX}${mwtdir}
+	local sysroot=${MWT_D}${prefix}
+	local -x PATH=${sysroot}/bin:${PATH}
+
+	filter-lto # requires setting up, and may be messy with mingw static libs
+	use custom-cflags || strip-flags # fancy flags are not realistic here
+
+	local multilib=false
+	use abi_x86_32 && use abi_x86_64 && multilib=true
+
+	# global configure flags
+	local conf=(
+		--build=${CBUILD:-${CHOST}}
+		--target=${CTARGET}
+		--{doc,info,man}dir=/.skip # let individual packages handle docs
+	)
+
+	# binutils
+	local conf_binutils=(
+		--prefix="${prefix}"
+		--host=${CHOST}
+		--disable-cet
+		--disable-default-execstack
+		--disable-nls
+		--disable-shared
+		--with-system-zlib
+		--without-debuginfod
+		--without-msgpack
+		--without-zstd
+	)
+	mwt-binutils() {
+		# symlink gcc's lto plugin for AR (bug #854516)
+		ln -s ../../libexec/gcc/${CTARGET}/${GCC_PV%%[.-]*}/liblto_plugin.so \
+			"${sysroot}"/lib/bfd-plugins || die
+	}
+
+	# gcc (minimal -- if need more, disable only in stage1 / enable in stage3)
+	local conf_gcc=(
+		--prefix="${prefix}"
+		--host=${CHOST}
+		--disable-bootstrap
+		--disable-cet
+		--disable-gcov #843989
+		--disable-gomp
+		--disable-libquadmath
+		--disable-libsanitizer
+		--disable-libssp
+		--disable-libvtv
+		--disable-shared
+		--disable-werror
+		--with-gcc-major-version-only
+		--with-system-zlib
+		--without-isl
+		--without-zstd
+	)
+	${multilib} || conf_gcc+=( --disable-multilib )
+
+	local conf_gcc_stage1=(
+		--enable-languages=c
+		--disable-libatomic
+		--with-sysroot="${sysroot}"
+	)
+	local -n conf_gcc_stage2=conf_gcc_stage1
+
+	local conf_gcc_stage3=(
+		--enable-languages=c,c++
+		--enable-threads=posix # needs stage3, and is required for dxvk/vkd3d
+		--with-sysroot="${prefix}"
+		--with-build-sysroot="${sysroot}"
+	)
+
+	# mingw64-runtime (split in several parts, 3 needed for gcc stages)
+	local conf_mingw64=(
+		--prefix="${prefix}"/${CTARGET}
+		--host=${CTARGET}
+		--with-sysroot=no
+		--without-{crt,headers}
+
+		# mingw .dll aren't used by wine and packages wouldn't find them
+		# at runtime, use crossdev if need dll and proper search paths
+		--disable-shared
+	)
+
+	local conf_mingw64_headers=(
+		--enable-idl
+		--with-headers
+	)
+	mwt-mingw64_headers() { ln -s ${CTARGET} "${sysroot}"/mingw || die; } #419601
+
+	local conf_mingw64_runtime=( --with-crt )
+	${multilib} ||
+		conf_mingw64_runtime+=( $(usex x86 --disable-lib64 --disable-lib32 ) )
+
+	local conf_mingw64_libraries=( --with-libraries )
+	local conf_mingw64_libraries32=(
+		--libdir="${prefix}"/${CTARGET}/lib32
+		--with-libraries
+		CC="${CTARGET}-gcc -m32"
+		RCFLAGS="--target=pe-i386 ${RCFLAGS}"
+	)
+
+	# mingw64-runtime's idl compiler (useful not to depend on wine for widl)
+	local conf_widl=( --prefix="${prefix}" )
+
+	# mwt-build [-x] <path/package-name> [stage-name]
+	# -> ./configure && make && make install && mwt-package() && mwt-package_stage()
+	# passes conf, conf_package, and conf_package_stage arrays to configure, and
+	# users can add options through environment with e.g.
+	#	MWT_BINUTILS_CONF="--some-option"
+	#	MWT_GCC_STAGE1_CONF="--some-gcc-stage1-only-option"
+	#	MWT_WIDL_CONF="--some-other-option"
+	#	EXTRA_ECONF="--global-option" (generic naming for if not reading this)
+	mwt-build() {
+		if [[ ${1} == -x ]]; then
+			(
+				# cross-compiling, cleanup and let ./configure handle it
+				unset AR AS CC CPP CXX LD NM OBJCOPY OBJDUMP RANLIB RC STRIP
+				CHOST=${CTARGET}
+				filter-flags '-fuse-ld=*'
+				filter-flags '-mfunction-return=thunk*' #878849
+
+				# -mavx with mingw-gcc has a history of obscure issues and
+				# disabling is seen as safer, e.g. `WINEARCH=win32 winecfg`
+				# crashes with -march=skylake >=wine-8.10, similar issues with
+				# znver4: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110273
+				append-flags -mno-avx
+
+				strip-unsupported-flags
+				mwt-build "${@:2}"
+			)
+			return
+		fi
+
+		local id=${1##*/}
+		local build_dir=${WORKDIR}/${1}${2+_${2}}-build
+
+		# econf is not allowed in src_compile and its defaults are
+		# mostly unused here, so use configure directly
+		local conf=( "${WORKDIR}/${1}"/configure "${conf[@]}" )
+
+		local -n conf_id=conf_${id} conf_id2=conf_${id}_${2}
+		[[ ${conf_id@a} == *a* ]] && conf+=( "${conf_id[@]}" )
+		[[ ${2} && ${conf_id2@a} == *a* ]] && conf+=( "${conf_id2[@]}" )
+
+		local -n extra_id=MWT_${id^^}_CONF extra_id2=MWT_${id^^}_${2^^}_CONF
+		conf+=( ${EXTRA_ECONF} ${extra_id} ${2+${extra_id2}} )
+
+		einfo "Building ${id}${2+ ${2}} in ${build_dir} ..."
+
+		mkdir -p "${build_dir}" || die
+		pushd "${build_dir}" >/dev/null || die
+
+		edo "${conf[@]}"
+		emake V=1
+		# -j1 to match bug #906155, other packages may be fragile too
+		emake -j1 V=1 DESTDIR="${MWT_D}" install
+
+		declare -f mwt-${id} >/dev/null && edo mwt-${id}
+		declare -f mwt-${id}_${2} >/dev/null && edo mwt-${id}_${2}
+
+		popd >/dev/null || die
+	}
+
+	# workaround race condition with out-of-source crt build (bug #879537)
+	mkdir -p mingw64_runtime-build/mingw-w64-crt/lib{32,64} || die
+
+	# build with same ordering that crossdev would do + stage3 for pthreads
+	mwt-build binutils
+	mwt-build mingw64 headers
+	mwt-build gcc stage1
+	mwt-build -x mingw64 runtime
+	mwt-build gcc stage2
+	${multilib} && mwt-build -x mingw64 libraries32
+	mwt-build -x mingw64 libraries
+	mwt-build gcc stage3
+	mwt-build mingw64/mingw-w64-tools/widl
+	# note: /could/ system-bootstrap if already installed, but gcc and
+	# libraries will use the system's older mingw64 headers/static-libs
+	# and make this potentially fragile without more workarounds/stages
+
+	if ${multilib}; then
+		# Like system's gcc, `x86_64-w64-mingw32-gcc -m32` can build for x86,
+		# but packages expect crossdev's i686-w64-mingw32-gcc which is the same
+		# just without 64bit support and would rather not build the toolchain
+		# twice. Dirty but wrap to allow simple interoperability with crossdev.
+		mwt-i686_wrapper() {
+			printf "#!/usr/bin/env sh\nexec \"${prefix}/bin/${bin}\" ${*} "'"${@}"\n' \
+				> ${bin32} || die
+			chmod +x ${bin32} || die
+		}
+		pushd "${sysroot}"/bin >/dev/null || die
+		local bin bin32
+		for bin in ${CTARGET}-*; do
+			bin32=${bin/x86_64-w64/i686-w64}
+			case ${bin#${CTARGET}-} in
+				as) mwt-i686_wrapper --32;;
+				cpp|gcc|gcc-${GCC_PV%%[.-]*}|g++|widl) mwt-i686_wrapper -m32;;
+				ld|ld.bfd) mwt-i686_wrapper -m i386pe;;
+				windres) mwt-i686_wrapper --target=pe-i386;;
+				*) ln -s ${bin} ${bin32} || die;;
+			esac
+		done
+		popd >/dev/null || die
+	fi
+
+	# portage doesn't know the right strip executable to use for CTARGET
+	# and it can lead to .a mangling, notably with 32bit (breaks toolchain)
+	dostrip -x ${mwtdir}/{${CTARGET}/lib{,32},lib/gcc/${CTARGET}}
+
+	# ... and instead do it here given this saves ~60MB
+	if use !debug; then
+		einfo "Stripping ${CTARGET} static libraries ..."
+		find "${sysroot}"/{,lib/gcc/}${CTARGET} -type f -name '*.a' \
+			-exec ${CTARGET}-strip --strip-unneeded {} + || die
+	fi
+}
+
+src_install() {
+	mv "${MWT_D}${EPREFIX}"/* "${ED}" || die
+
+	find "${ED}" -type f -name '*.la' -delete || die
+}
+
+pkg_postinst() {
+	if [[ ! ${REPLACING_VERSIONS} ]]; then
+		elog "Note that this package is primarily intended for Wine and related"
+		elog "packages to depend on without needing a manual crossdev setup."
+		elog
+		elog "Settings are oriented only for what these need and simplicity."
+		elog "Use sys-devel/crossdev if need full toolchain/customization:"
+		elog "    https://wiki.gentoo.org/wiki/Mingw"
+		elog "    https://wiki.gentoo.org/wiki/Crossdev"
+	fi
+
+	local cross_gcc=cross-$(usex x86 i686 x86_64)-w64-mingw32/gcc
+	if has_version ${cross_gcc}; then
+		# encourage cleanup given users may not realize if switch by default
+		ewarn "${cross_gcc} is installed, note that ${PN}"
+		ewarn "is redundant with the *-w64-mingw32/{binutils,gcc,mingw64-runtime}"
+		ewarn "packages and optionally only one needs to be kept."
+	fi
+}


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2023-07-30 16:52 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2023-07-30 16:52 UTC (permalink / raw
  To: gentoo-commits

commit:     5132bdcee81b7bd3567ad0cbbb8e126466d63389
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 30 16:22:04 2023 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Sun Jul 30 16:52:17 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5132bdce

dev-util/mingw64-toolchain: add 11.0.0_p2 w/ bin-2.41 (unkeyworded)

Unlike _p1 will likely keyword (and later stable) this one, but
have not really tested yet nor looked into if binutils did any
notable changes with mingw, so keep unkeyworded for a bit.

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/Manifest                |   1 +
 .../mingw64-toolchain-11.0.0_p2.ebuild             | 330 +++++++++++++++++++++
 2 files changed, 331 insertions(+)

diff --git a/dev-util/mingw64-toolchain/Manifest b/dev-util/mingw64-toolchain/Manifest
index 8c70917a1f31..87da411f739f 100644
--- a/dev-util/mingw64-toolchain/Manifest
+++ b/dev-util/mingw64-toolchain/Manifest
@@ -1,5 +1,6 @@
 DIST binutils-2.39.tar.xz 25167756 BLAKE2B ac6a5296c6586d53eaadcbffc5c399a6d79edf72450b9bb8b3525ce525129cef3d2eb90c85ef3bb3270b5a03b0e1ffb8f0b705f028158726f9777ebb8685066f SHA512 68e038f339a8c21faa19a57bbc447a51c817f47c2e06d740847c6e9cc3396c025d35d5369fa8c3f8b70414757c89f0e577939ddc0d70f283182504920f53b0a3
 DIST binutils-2.40.tar.xz 25241484 BLAKE2B 8d799f7c595f878b9af5b17a490021dd8b8300ac2fe0ed8574c012929d22d2d0493e003a3e631a9436e8e712da801779b777c566167fe42b0bde119ffa5ad1c2 SHA512 a37e042523bc46494d99d5637c3f3d8f9956d9477b748b3b1f6d7dfbb8d968ed52c932e88a4e946c6f77b8f48f1e1b360ca54c3d298f17193f3b4963472f6925
+DIST binutils-2.41.tar.xz 26765692 BLAKE2B 3bccec2b52f7e82a727121bf2a2e51a6249ba63dcd74c665fd834e858645c912ffd8245d848435288b938852830b482905606f55c40df4061215fd75c52ffc75 SHA512 5df45d0bd6ddabdce4f35878c041e46a92deef01e7dea5facc97fd65cc06b59abc6fba0eb454b68e571c7e14038dc823fe7f2263843e6e627b7444eaf0fe9374
 DIST gcc-12.2.0.tar.xz 84645292 BLAKE2B 715574af9ad678f9dc8cfd19c866bf910c7edfd479e7e9681337feaa9b54e5d304ddb85483816b8d89754d502405823ae2eff0d1e444538763f40be8e428d8da SHA512 e9e857bd81bf7a370307d6848c81b2f5403db8c7b5207f54bce3f3faac3bde63445684092c2bc1a2427cddb6f7746496d9fbbef05fbbd77f2810b2998f1f9173
 DIST gcc-13.1.0.tar.xz 87451196 BLAKE2B b956a773cffe8b43bd6c9a99fe614f53f665438925a6b320975d301f547923e45d4d6fa577a143467fb03e0a9c1bab2b6719a1011d672367f3e644433a2d7606 SHA512 6cf06dfc48f57f5e67f7efe3248019329a14d690c728d9f2f7ef5fa0d58f1816f309586ba7ea2eac20d0b60a2d1b701f68392e9067dd46f827ba0efd7192db33
 DIST gcc-13.2.0.tar.xz 87858592 BLAKE2B 0034b29d3d6cc05821f0c4253ce077805943aff7b370729dd203bda57d89c107edd657eeddc2fb1e69ea15c7b0323b961f46516c7f4af89a3ccf7fea84701be2 SHA512 d99e4826a70db04504467e349e9fbaedaa5870766cda7c5cab50cdebedc4be755ebca5b789e1232a34a20be1a0b60097de9280efe47bdb71c73251e30b0862a2

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild
new file mode 100644
index 000000000000..924db6d0bca9
--- /dev/null
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild
@@ -0,0 +1,330 @@
+# Copyright 2022-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MULTILIB_COMPAT=( abi_x86_{32,64} )
+inherit edo flag-o-matic multilib-build toolchain-funcs
+
+# Pick versions known to work for wine+dxvk, and avoid too frequent updates
+# due to slow rebuilds. Do _p1++ rather than revbump on changes (not using
+# Gentoo patchsets for simplicity, their changes are mostly unneeded here).
+BINUTILS_PV=2.41
+GCC_PV=13.2.0
+MINGW_PV=$(ver_cut 1-3)
+
+DESCRIPTION="All-in-one mingw64 toolchain intended for building Wine without crossdev"
+HOMEPAGE="
+	https://www.mingw-w64.org/
+	https://gcc.gnu.org/
+	https://sourceware.org/binutils/
+"
+SRC_URI="
+	mirror://sourceforge/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${MINGW_PV}.tar.bz2
+	mirror://gnu/binutils/binutils-${BINUTILS_PV}.tar.xz
+"
+if [[ ${GCC_PV} == *-* ]]; then
+	SRC_URI+=" mirror://gcc/snapshots/${GCC_PV}/gcc-${GCC_PV}.tar.xz"
+else
+	SRC_URI+="
+		mirror://gcc/gcc-${GCC_PV}/gcc-${GCC_PV}.tar.xz
+		mirror://gnu/gcc/gcc-${GCC_PV}/gcc-${GCC_PV}.tar.xz
+	"
+fi
+S="${WORKDIR}"
+
+# l1:binutils+gcc, l2:gcc(libraries), l3:mingw64-runtime
+LICENSE="
+	GPL-3+
+	LGPL-3+ || ( GPL-3+ libgcc libstdc++ gcc-runtime-library-exception-3.1 )
+	ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain
+"
+SLOT="0"
+# unkeyworded for testing binutils-2.41+gcc-13.2.0
+#KEYWORDS="-* ~amd64 ~x86"
+IUSE="+abi_x86_32 custom-cflags debug"
+
+RDEPEND="
+	dev-libs/gmp:=
+	dev-libs/mpc:=
+	dev-libs/mpfr:=
+	sys-libs/zlib:=
+	virtual/libiconv
+"
+DEPEND="${RDEPEND}"
+
+QA_CONFIG_IMPL_DECL_SKIP=(
+	strerror_r # libstdc++ test using -Wimplicit+error
+)
+
+PATCHES=(
+	"${FILESDIR}"/gcc-12.2.0-drop-cflags-sed.patch
+)
+
+pkg_pretend() {
+	[[ ${MERGE_TYPE} == binary ]] && return
+
+	tc-is-cross-compiler &&
+		die "cross-compilation of the toolchain itself is unsupported"
+}
+
+src_prepare() {
+	# rename directories to simplify both patching and the ebuild
+	mv binutils{-${BINUTILS_PV},} || die
+	mv gcc{-${GCC_PV},} || die
+	mv mingw-w64-v${MINGW_PV} mingw64 || die
+
+	default
+}
+
+src_compile() {
+	# not great but do everything in src_compile given bootstrapping
+	# process needs to be done in steps of configure+compile+install
+	# (done modular to have most package-specific things in one place)
+
+	CTARGET=$(usex x86 i686 x86_64)-w64-mingw32
+
+	MWT_D=${T}/root # moved to ${D} in src_install
+	local mwtdir=/usr/lib/${PN}
+	local prefix=${EPREFIX}${mwtdir}
+	local sysroot=${MWT_D}${prefix}
+	local -x PATH=${sysroot}/bin:${PATH}
+
+	filter-lto # requires setting up, and may be messy with mingw static libs
+	use custom-cflags || strip-flags # fancy flags are not realistic here
+
+	local multilib=false
+	use abi_x86_32 && use abi_x86_64 && multilib=true
+
+	# global configure flags
+	local conf=(
+		--build=${CBUILD:-${CHOST}}
+		--target=${CTARGET}
+		--{doc,info,man}dir=/.skip # let individual packages handle docs
+	)
+
+	# binutils
+	local conf_binutils=(
+		--prefix="${prefix}"
+		--host=${CHOST}
+		--disable-cet
+		--disable-default-execstack
+		--disable-nls
+		--disable-shared
+		--with-system-zlib
+		--without-debuginfod
+		--without-msgpack
+		--without-zstd
+	)
+	mwt-binutils() {
+		# symlink gcc's lto plugin for AR (bug #854516)
+		ln -s ../../libexec/gcc/${CTARGET}/${GCC_PV%%[.-]*}/liblto_plugin.so \
+			"${sysroot}"/lib/bfd-plugins || die
+	}
+
+	# gcc (minimal -- if need more, disable only in stage1 / enable in stage3)
+	local conf_gcc=(
+		--prefix="${prefix}"
+		--host=${CHOST}
+		--disable-bootstrap
+		--disable-cet
+		--disable-gcov #843989
+		--disable-gomp
+		--disable-libquadmath
+		--disable-libsanitizer
+		--disable-libssp
+		--disable-libvtv
+		--disable-shared
+		--disable-werror
+		--with-gcc-major-version-only
+		--with-system-zlib
+		--without-isl
+		--without-zstd
+	)
+	${multilib} || conf_gcc+=( --disable-multilib )
+
+	local conf_gcc_stage1=(
+		--enable-languages=c
+		--disable-libatomic
+		--with-sysroot="${sysroot}"
+	)
+	local -n conf_gcc_stage2=conf_gcc_stage1
+
+	local conf_gcc_stage3=(
+		--enable-languages=c,c++
+		--enable-threads=posix # needs stage3, and is required for dxvk/vkd3d
+		--with-sysroot="${prefix}"
+		--with-build-sysroot="${sysroot}"
+	)
+
+	# mingw64-runtime (split in several parts, 3 needed for gcc stages)
+	local conf_mingw64=(
+		--prefix="${prefix}"/${CTARGET}
+		--host=${CTARGET}
+		--with-sysroot=no
+		--without-{crt,headers}
+
+		# mingw .dll aren't used by wine and packages wouldn't find them
+		# at runtime, use crossdev if need dll and proper search paths
+		--disable-shared
+	)
+
+	local conf_mingw64_headers=(
+		--enable-idl
+		--with-headers
+	)
+	mwt-mingw64_headers() { ln -s ${CTARGET} "${sysroot}"/mingw || die; } #419601
+
+	local conf_mingw64_runtime=( --with-crt )
+	${multilib} ||
+		conf_mingw64_runtime+=( $(usex x86 --disable-lib64 --disable-lib32 ) )
+
+	local conf_mingw64_libraries=( --with-libraries )
+	local conf_mingw64_libraries32=(
+		--libdir="${prefix}"/${CTARGET}/lib32
+		--with-libraries
+		CC="${CTARGET}-gcc -m32"
+		RCFLAGS="--target=pe-i386 ${RCFLAGS}"
+	)
+
+	# mingw64-runtime's idl compiler (useful not to depend on wine for widl)
+	local conf_widl=( --prefix="${prefix}" )
+
+	# mwt-build [-x] <path/package-name> [stage-name]
+	# -> ./configure && make && make install && mwt-package() && mwt-package_stage()
+	# passes conf, conf_package, and conf_package_stage arrays to configure, and
+	# users can add options through environment with e.g.
+	#	MWT_BINUTILS_CONF="--some-option"
+	#	MWT_GCC_STAGE1_CONF="--some-gcc-stage1-only-option"
+	#	MWT_WIDL_CONF="--some-other-option"
+	#	EXTRA_ECONF="--global-option" (generic naming for if not reading this)
+	mwt-build() {
+		if [[ ${1} == -x ]]; then
+			(
+				# cross-compiling, cleanup and let ./configure handle it
+				unset AR AS CC CPP CXX LD NM OBJCOPY OBJDUMP RANLIB RC STRIP
+				CHOST=${CTARGET}
+				filter-flags '-fuse-ld=*'
+				filter-flags '-mfunction-return=thunk*' #878849
+
+				# -mavx with mingw-gcc has a history of obscure issues and
+				# disabling is seen as safer, e.g. `WINEARCH=win32 winecfg`
+				# crashes with -march=skylake >=wine-8.10, similar issues with
+				# znver4: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110273
+				append-flags -mno-avx
+
+				strip-unsupported-flags
+				mwt-build "${@:2}"
+			)
+			return
+		fi
+
+		local id=${1##*/}
+		local build_dir=${WORKDIR}/${1}${2+_${2}}-build
+
+		# econf is not allowed in src_compile and its defaults are
+		# mostly unused here, so use configure directly
+		local conf=( "${WORKDIR}/${1}"/configure "${conf[@]}" )
+
+		local -n conf_id=conf_${id} conf_id2=conf_${id}_${2}
+		[[ ${conf_id@a} == *a* ]] && conf+=( "${conf_id[@]}" )
+		[[ ${2} && ${conf_id2@a} == *a* ]] && conf+=( "${conf_id2[@]}" )
+
+		local -n extra_id=MWT_${id^^}_CONF extra_id2=MWT_${id^^}_${2^^}_CONF
+		conf+=( ${EXTRA_ECONF} ${extra_id} ${2+${extra_id2}} )
+
+		einfo "Building ${id}${2+ ${2}} in ${build_dir} ..."
+
+		mkdir -p "${build_dir}" || die
+		pushd "${build_dir}" >/dev/null || die
+
+		edo "${conf[@]}"
+		emake V=1
+		# -j1 to match bug #906155, other packages may be fragile too
+		emake -j1 V=1 DESTDIR="${MWT_D}" install
+
+		declare -f mwt-${id} >/dev/null && edo mwt-${id}
+		declare -f mwt-${id}_${2} >/dev/null && edo mwt-${id}_${2}
+
+		popd >/dev/null || die
+	}
+
+	# workaround race condition with out-of-source crt build (bug #879537)
+	mkdir -p mingw64_runtime-build/mingw-w64-crt/lib{32,64} || die
+
+	# build with same ordering that crossdev would do + stage3 for pthreads
+	mwt-build binutils
+	mwt-build mingw64 headers
+	mwt-build gcc stage1
+	mwt-build -x mingw64 runtime
+	mwt-build gcc stage2
+	${multilib} && mwt-build -x mingw64 libraries32
+	mwt-build -x mingw64 libraries
+	mwt-build gcc stage3
+	mwt-build mingw64/mingw-w64-tools/widl
+	# note: /could/ system-bootstrap if already installed, but gcc and
+	# libraries will use the system's older mingw64 headers/static-libs
+	# and make this potentially fragile without more workarounds/stages
+
+	if ${multilib}; then
+		# Like system's gcc, `x86_64-w64-mingw32-gcc -m32` can build for x86,
+		# but packages expect crossdev's i686-w64-mingw32-gcc which is the same
+		# just without 64bit support and would rather not build the toolchain
+		# twice. Dirty but wrap to allow simple interoperability with crossdev.
+		mwt-i686_wrapper() {
+			printf "#!/usr/bin/env sh\nexec \"${prefix}/bin/${bin}\" ${*} "'"${@}"\n' \
+				> ${bin32} || die
+			chmod +x ${bin32} || die
+		}
+		pushd "${sysroot}"/bin >/dev/null || die
+		local bin bin32
+		for bin in ${CTARGET}-*; do
+			bin32=${bin/x86_64-w64/i686-w64}
+			case ${bin#${CTARGET}-} in
+				as) mwt-i686_wrapper --32;;
+				cpp|gcc|gcc-${GCC_PV%%[.-]*}|g++|widl) mwt-i686_wrapper -m32;;
+				ld|ld.bfd) mwt-i686_wrapper -m i386pe;;
+				windres) mwt-i686_wrapper --target=pe-i386;;
+				*) ln -s ${bin} ${bin32} || die;;
+			esac
+		done
+		popd >/dev/null || die
+	fi
+
+	# portage doesn't know the right strip executable to use for CTARGET
+	# and it can lead to .a mangling, notably with 32bit (breaks toolchain)
+	dostrip -x ${mwtdir}/{${CTARGET}/lib{,32},lib/gcc/${CTARGET}}
+
+	# ... and instead do it here given this saves ~60MB
+	if use !debug; then
+		einfo "Stripping ${CTARGET} static libraries ..."
+		find "${sysroot}"/{,lib/gcc/}${CTARGET} -type f -name '*.a' \
+			-exec ${CTARGET}-strip --strip-unneeded {} + || die
+	fi
+}
+
+src_install() {
+	mv "${MWT_D}${EPREFIX}"/* "${ED}" || die
+
+	find "${ED}" -type f -name '*.la' -delete || die
+}
+
+pkg_postinst() {
+	if [[ ! ${REPLACING_VERSIONS} ]]; then
+		elog "Note that this package is primarily intended for Wine and related"
+		elog "packages to depend on without needing a manual crossdev setup."
+		elog
+		elog "Settings are oriented only for what these need and simplicity."
+		elog "Use sys-devel/crossdev if need full toolchain/customization:"
+		elog "    https://wiki.gentoo.org/wiki/Mingw"
+		elog "    https://wiki.gentoo.org/wiki/Crossdev"
+	fi
+
+	local cross_gcc=cross-$(usex x86 i686 x86_64)-w64-mingw32/gcc
+	if has_version ${cross_gcc}; then
+		# encourage cleanup given users may not realize if switch by default
+		ewarn "${cross_gcc} is installed, note that ${PN}"
+		ewarn "is redundant with the *-w64-mingw32/{binutils,gcc,mingw64-runtime}"
+		ewarn "packages and optionally only one needs to be kept."
+	fi
+}


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2023-08-04  3:25 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2023-08-04  3:25 UTC (permalink / raw
  To: gentoo-commits

commit:     41aebf89d033f5f5c18d29f8fcf4b80539718c48
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Fri Aug  4 02:47:33 2023 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Fri Aug  4 03:24:54 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=41aebf89

dev-util/mingw64-toolchain: drop 11.0.0_p1

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 .../mingw64-toolchain-11.0.0_p1.ebuild             | 327 ---------------------
 1 file changed, 327 deletions(-)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p1.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p1.ebuild
deleted file mode 100644
index 1ba6d9f3c46f..000000000000
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p1.ebuild
+++ /dev/null
@@ -1,327 +0,0 @@
-# Copyright 2022-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-MULTILIB_COMPAT=( abi_x86_{32,64} )
-inherit edo flag-o-matic multilib-build toolchain-funcs
-
-# Pick versions known to work for wine+dxvk, and avoid too frequent updates
-# due to slow rebuilds. Do _p1++ rather than revbump on changes (not using
-# Gentoo patchsets for simplicity, their changes are mostly unneeded here).
-BINUTILS_PV=2.40
-GCC_PV=13.2.0
-MINGW_PV=$(ver_cut 1-3)
-
-DESCRIPTION="All-in-one mingw64 toolchain intended for building Wine without crossdev"
-HOMEPAGE="
-	https://www.mingw-w64.org/
-	https://gcc.gnu.org/
-	https://sourceware.org/binutils/"
-SRC_URI="
-	mirror://sourceforge/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${MINGW_PV}.tar.bz2
-	mirror://gnu/binutils/binutils-${BINUTILS_PV}.tar.xz"
-if [[ ${GCC_PV} == *-* ]]; then
-	SRC_URI+=" mirror://gcc/snapshots/${GCC_PV}/gcc-${GCC_PV}.tar.xz"
-else
-	SRC_URI+="
-		mirror://gcc/gcc-${GCC_PV}/gcc-${GCC_PV}.tar.xz
-		mirror://gnu/gcc/gcc-${GCC_PV}/gcc-${GCC_PV}.tar.xz"
-fi
-S="${WORKDIR}"
-
-# l1:binutils+gcc, l2:gcc(libraries), l3:mingw64-runtime
-LICENSE="
-	GPL-3+
-	LGPL-3+ || ( GPL-3+ libgcc libstdc++ gcc-runtime-library-exception-3.1 )
-	ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain"
-SLOT="0"
-# okay to use/test, primarily unkeyworded to avoid a slow rebuild until it
-# can be more useful, e.g. also bump binutils or runtime on top of gcc in _p2
-#KEYWORDS="-* ~amd64 ~x86"
-IUSE="+abi_x86_32 custom-cflags debug"
-
-RDEPEND="
-	dev-libs/gmp:=
-	dev-libs/mpc:=
-	dev-libs/mpfr:=
-	sys-libs/zlib:=
-	virtual/libiconv"
-DEPEND="${RDEPEND}"
-
-QA_CONFIG_IMPL_DECL_SKIP=(
-	strerror_r # libstdc++ test using -Wimplicit+error
-)
-
-PATCHES=(
-	"${FILESDIR}"/binutils-2.40-import-lib.patch
-	"${FILESDIR}"/gcc-12.2.0-drop-cflags-sed.patch
-)
-
-pkg_pretend() {
-	[[ ${MERGE_TYPE} == binary ]] && return
-
-	tc-is-cross-compiler &&
-		die "cross-compilation of the toolchain itself is unsupported"
-}
-
-src_prepare() {
-	# rename directories to simplify both patching and the ebuild
-	mv binutils{-${BINUTILS_PV},} || die
-	mv gcc{-${GCC_PV},} || die
-	mv mingw-w64-v${MINGW_PV} mingw64 || die
-
-	default
-}
-
-src_compile() {
-	# not great but do everything in src_compile given bootstrapping
-	# process needs to be done in steps of configure+compile+install
-	# (done modular to have most package-specific things in one place)
-
-	CTARGET=$(usex x86 i686 x86_64)-w64-mingw32
-
-	MWT_D=${T}/root # moved to ${D} in src_install
-	local mwtdir=/usr/lib/${PN}
-	local prefix=${EPREFIX}${mwtdir}
-	local sysroot=${MWT_D}${prefix}
-	local -x PATH=${sysroot}/bin:${PATH}
-
-	filter-lto # requires setting up, and may be messy with mingw static libs
-	use custom-cflags || strip-flags # fancy flags are not realistic here
-
-	local multilib=false
-	use abi_x86_32 && use abi_x86_64 && multilib=true
-
-	# global configure flags
-	local conf=(
-		--build=${CBUILD:-${CHOST}}
-		--target=${CTARGET}
-		--{doc,info,man}dir=/.skip # let individual packages handle docs
-	)
-
-	# binutils
-	local conf_binutils=(
-		--prefix="${prefix}"
-		--host=${CHOST}
-		--disable-cet
-		--disable-default-execstack
-		--disable-nls
-		--disable-shared
-		--with-system-zlib
-		--without-debuginfod
-		--without-msgpack
-		--without-zstd
-	)
-	mwt-binutils() {
-		# symlink gcc's lto plugin for AR (bug #854516)
-		ln -s ../../libexec/gcc/${CTARGET}/${GCC_PV%%[.-]*}/liblto_plugin.so \
-			"${sysroot}"/lib/bfd-plugins || die
-	}
-
-	# gcc (minimal -- if need more, disable only in stage1 / enable in stage3)
-	local conf_gcc=(
-		--prefix="${prefix}"
-		--host=${CHOST}
-		--disable-bootstrap
-		--disable-cet
-		--disable-gcov #843989
-		--disable-gomp
-		--disable-libquadmath
-		--disable-libsanitizer
-		--disable-libssp
-		--disable-libvtv
-		--disable-shared
-		--disable-werror
-		--with-gcc-major-version-only
-		--with-system-zlib
-		--without-isl
-		--without-zstd
-	)
-	${multilib} || conf_gcc+=( --disable-multilib )
-
-	local conf_gcc_stage1=(
-		--enable-languages=c
-		--disable-libatomic
-		--with-sysroot="${sysroot}"
-	)
-	local -n conf_gcc_stage2=conf_gcc_stage1
-
-	local conf_gcc_stage3=(
-		--enable-languages=c,c++
-		--enable-threads=posix # needs stage3, and is required for dxvk/vkd3d
-		--with-sysroot="${prefix}"
-		--with-build-sysroot="${sysroot}"
-	)
-
-	# mingw64-runtime (split in several parts, 3 needed for gcc stages)
-	local conf_mingw64=(
-		--prefix="${prefix}"/${CTARGET}
-		--host=${CTARGET}
-		--with-sysroot=no
-		--without-{crt,headers}
-
-		# mingw .dll aren't used by wine and packages wouldn't find them
-		# at runtime, use crossdev if need dll and proper search paths
-		--disable-shared
-	)
-
-	local conf_mingw64_headers=(
-		--enable-idl
-		--with-headers
-	)
-	mwt-mingw64_headers() { ln -s ${CTARGET} "${sysroot}"/mingw || die; } #419601
-
-	local conf_mingw64_runtime=( --with-crt )
-	${multilib} ||
-		conf_mingw64_runtime+=( $(usex x86 --disable-lib64 --disable-lib32 ) )
-
-	local conf_mingw64_libraries=( --with-libraries )
-	local conf_mingw64_libraries32=(
-		--libdir="${prefix}"/${CTARGET}/lib32
-		--with-libraries
-		CC="${CTARGET}-gcc -m32"
-		RCFLAGS="--target=pe-i386 ${RCFLAGS}"
-	)
-
-	# mingw64-runtime's idl compiler (useful not to depend on wine for widl)
-	local conf_widl=( --prefix="${prefix}" )
-
-	# mwt-build [-x] <path/package-name> [stage-name]
-	# -> ./configure && make && make install && mwt-package() && mwt-package_stage()
-	# passes conf, conf_package, and conf_package_stage arrays to configure, and
-	# users can add options through environment with e.g.
-	#	MWT_BINUTILS_CONF="--some-option"
-	#	MWT_GCC_STAGE1_CONF="--some-gcc-stage1-only-option"
-	#	MWT_WIDL_CONF="--some-other-option"
-	#	EXTRA_ECONF="--global-option" (generic naming for if not reading this)
-	mwt-build() {
-		if [[ ${1} == -x ]]; then
-			(
-				# cross-compiling, cleanup and let ./configure handle it
-				unset AR AS CC CPP CXX LD NM OBJCOPY OBJDUMP RANLIB RC STRIP
-				CHOST=${CTARGET}
-				filter-flags '-fuse-ld=*'
-				filter-flags '-mfunction-return=thunk*' #878849
-
-				# -mavx with mingw-gcc has a history of obscure issues and
-				# disabling is seen as safer, e.g. `WINEARCH=win32 winecfg`
-				# crashes with -march=skylake >=wine-8.10, similar issues with
-				# znver4: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110273
-				append-flags -mno-avx
-
-				strip-unsupported-flags
-				mwt-build "${@:2}"
-			)
-			return
-		fi
-
-		local id=${1##*/}
-		local build_dir=${WORKDIR}/${1}${2+_${2}}-build
-
-		# econf is not allowed in src_compile and its defaults are
-		# mostly unused here, so use configure directly
-		local conf=( "${WORKDIR}/${1}"/configure "${conf[@]}" )
-
-		local -n conf_id=conf_${id} conf_id2=conf_${id}_${2}
-		[[ ${conf_id@a} == *a* ]] && conf+=( "${conf_id[@]}" )
-		[[ ${2} && ${conf_id2@a} == *a* ]] && conf+=( "${conf_id2[@]}" )
-
-		local -n extra_id=MWT_${id^^}_CONF extra_id2=MWT_${id^^}_${2^^}_CONF
-		conf+=( ${EXTRA_ECONF} ${extra_id} ${2+${extra_id2}} )
-
-		einfo "Building ${id}${2+ ${2}} in ${build_dir} ..."
-
-		mkdir -p "${build_dir}" || die
-		pushd "${build_dir}" >/dev/null || die
-
-		edo "${conf[@]}"
-		emake V=1
-		# -j1 to match bug #906155, other packages may be fragile too
-		emake -j1 V=1 DESTDIR="${MWT_D}" install
-
-		declare -f mwt-${id} >/dev/null && edo mwt-${id}
-		declare -f mwt-${id}_${2} >/dev/null && edo mwt-${id}_${2}
-
-		popd >/dev/null || die
-	}
-
-	# workaround race condition with out-of-source crt build (bug #879537)
-	mkdir -p mingw64_runtime-build/mingw-w64-crt/lib{32,64} || die
-
-	# build with same ordering that crossdev would do + stage3 for pthreads
-	mwt-build binutils
-	mwt-build mingw64 headers
-	mwt-build gcc stage1
-	mwt-build -x mingw64 runtime
-	mwt-build gcc stage2
-	${multilib} && mwt-build -x mingw64 libraries32
-	mwt-build -x mingw64 libraries
-	mwt-build gcc stage3
-	mwt-build mingw64/mingw-w64-tools/widl
-	# note: /could/ system-bootstrap if already installed, but gcc and
-	# libraries will use the system's older mingw64 headers/static-libs
-	# and make this potentially fragile without more workarounds/stages
-
-	if ${multilib}; then
-		# Like system's gcc, `x86_64-w64-mingw32-gcc -m32` can build for x86,
-		# but packages expect crossdev's i686-w64-mingw32-gcc which is the same
-		# just without 64bit support and would rather not build the toolchain
-		# twice. Dirty but wrap to allow simple interoperability with crossdev.
-		mwt-i686_wrapper() {
-			printf "#!/usr/bin/env sh\nexec \"${prefix}/bin/${bin}\" ${*} "'"${@}"\n' \
-				> ${bin32} || die
-			chmod +x ${bin32} || die
-		}
-		pushd "${sysroot}"/bin >/dev/null || die
-		local bin bin32
-		for bin in ${CTARGET}-*; do
-			bin32=${bin/x86_64-w64/i686-w64}
-			case ${bin#${CTARGET}-} in
-				as) mwt-i686_wrapper --32;;
-				cpp|gcc|gcc-${GCC_PV%%[.-]*}|g++|widl) mwt-i686_wrapper -m32;;
-				ld|ld.bfd) mwt-i686_wrapper -m i386pe;;
-				windres) mwt-i686_wrapper --target=pe-i386;;
-				*) ln -s ${bin} ${bin32} || die;;
-			esac
-		done
-		popd >/dev/null || die
-	fi
-
-	# portage doesn't know the right strip executable to use for CTARGET
-	# and it can lead to .a mangling, notably with 32bit (breaks toolchain)
-	dostrip -x ${mwtdir}/{${CTARGET}/lib{,32},lib/gcc/${CTARGET}}
-
-	# ... and instead do it here given this saves ~60MB
-	if use !debug; then
-		einfo "Stripping ${CTARGET} static libraries ..."
-		find "${sysroot}"/{,lib/gcc/}${CTARGET} -type f -name '*.a' \
-			-exec ${CTARGET}-strip --strip-unneeded {} + || die
-	fi
-}
-
-src_install() {
-	mv "${MWT_D}${EPREFIX}"/* "${ED}" || die
-
-	find "${ED}" -type f -name '*.la' -delete || die
-}
-
-pkg_postinst() {
-	if [[ ! ${REPLACING_VERSIONS} ]]; then
-		elog "Note that this package is primarily intended for Wine and related"
-		elog "packages to depend on without needing a manual crossdev setup."
-		elog
-		elog "Settings are oriented only for what these need and simplicity."
-		elog "Use sys-devel/crossdev if need full toolchain/customization:"
-		elog "    https://wiki.gentoo.org/wiki/Mingw"
-		elog "    https://wiki.gentoo.org/wiki/Crossdev"
-	fi
-
-	local cross_gcc=cross-$(usex x86 i686 x86_64)-w64-mingw32/gcc
-	if has_version ${cross_gcc}; then
-		# encourage cleanup given users may not realize if switch by default
-		ewarn "${cross_gcc} is installed, note that ${PN}"
-		ewarn "is redundant with the *-w64-mingw32/{binutils,gcc,mingw64-runtime}"
-		ewarn "packages and optionally only one needs to be kept."
-	fi
-}


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2023-08-04  3:25 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2023-08-04  3:25 UTC (permalink / raw
  To: gentoo-commits

commit:     22f0d3db074088e8350adcdd44ea82c5ab1cdf7d
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Fri Aug  4 02:47:54 2023 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Fri Aug  4 03:24:54 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=22f0d3db

dev-util/mingw64-toolchain: restore keywords for 11.0.0_p2

binutils:2.41 is keyworded in ~arch too now, and have not
seen any issues with wine yet, so let's try it.

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild
index 924db6d0bca9..06f4a57509a0 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild
@@ -40,8 +40,7 @@ LICENSE="
 	ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain
 "
 SLOT="0"
-# unkeyworded for testing binutils-2.41+gcc-13.2.0
-#KEYWORDS="-* ~amd64 ~x86"
+KEYWORDS="-* ~amd64 ~x86"
 IUSE="+abi_x86_32 custom-cflags debug"
 
 RDEPEND="


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2023-08-27  1:28 Sam James
  0 siblings, 0 replies; 54+ messages in thread
From: Sam James @ 2023-08-27  1:28 UTC (permalink / raw
  To: gentoo-commits

commit:     271755f9af096f20ec4bc0a899fbc3dcf119bab9
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 27 01:28:40 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Aug 27 01:28:40 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=271755f9

dev-util/mingw64-toolchain: Stabilize 11.0.0_p2 x86, #913091

Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild
index 06f4a57509a0..c489e2e8fdaf 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild
@@ -40,7 +40,7 @@ LICENSE="
 	ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain
 "
 SLOT="0"
-KEYWORDS="-* ~amd64 ~x86"
+KEYWORDS="-* ~amd64 x86"
 IUSE="+abi_x86_32 custom-cflags debug"
 
 RDEPEND="


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2023-08-27 17:18 Sam James
  0 siblings, 0 replies; 54+ messages in thread
From: Sam James @ 2023-08-27 17:18 UTC (permalink / raw
  To: gentoo-commits

commit:     dc6683e12b5eba507e4e84aecf1f8fd3fe76c96b
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 27 17:18:29 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Aug 27 17:18:29 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dc6683e1

dev-util/mingw64-toolchain: Stabilize 11.0.0_p2 amd64, #913091

Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild
index c489e2e8fdaf..5a09bb4367bc 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild
@@ -40,7 +40,7 @@ LICENSE="
 	ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain
 "
 SLOT="0"
-KEYWORDS="-* ~amd64 x86"
+KEYWORDS="-* amd64 x86"
 IUSE="+abi_x86_32 custom-cflags debug"
 
 RDEPEND="


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2023-12-22 17:38 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2023-12-22 17:38 UTC (permalink / raw
  To: gentoo-commits

commit:     db21b95652247c4181a0b92e47421f885d942c66
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 22 17:08:44 2023 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Fri Dec 22 17:37:24 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=db21b956

dev-util/mingw64-toolchain: unset DLLTOOL for cross

Rarely set but, if it is, can result in using llvm-dlltool
when it should be using mingw's, and ultimately fails.

Closes: https://bugs.gentoo.org/920483
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild
index 1a08ba3e0844..7196f0b85f19 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild
@@ -202,7 +202,7 @@ src_compile() {
 		if [[ ${1} == -x ]]; then
 			(
 				# cross-compiling, cleanup and let ./configure handle it
-				unset AR AS CC CPP CXX LD NM OBJCOPY OBJDUMP RANLIB RC STRIP
+				unset AR AS CC CPP CXX DLLTOOL LD NM OBJCOPY OBJDUMP RANLIB RC STRIP
 				CHOST=${CTARGET}
 				filter-flags '-fuse-ld=*'
 				filter-flags '-mfunction-return=thunk*' #878849


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2024-01-16 17:52 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2024-01-16 17:52 UTC (permalink / raw
  To: gentoo-commits

commit:     90dae1b4ae07d6bb6fc650743269f5b55a8995c3
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 16 16:51:07 2024 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Tue Jan 16 17:52:05 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=90dae1b4

dev-util/mingw64-toolchain: prevent makeinfo usage

This does not install .info pages (that is left to binutils+gcc
real packages), so little reason to depend on texinfo(makeinfo)
and generate them for nothing.

Could possibly come back as an issue if use gcc snapshots (that
lack pre-gen info pages), and unsure if this same workaround will
work for gcc (currently only binutils is trying to use it).

MAKEINFO=: on ./configure is not necessary (and is insufficient
to stop usage given it is not respected in Makefiles), but it
prevents a command not found QA notice.

That aside, generally hard for texinfo to be missing unless
depclean build deps, so BDEPEND would not have been too wasteful.

Closes: https://bugs.gentoo.org/922230
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild
index 7196f0b85f19..808cdc0731ae 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2022-2023 Gentoo Authors
+# Copyright 2022-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -100,7 +100,8 @@ src_compile() {
 	local conf=(
 		--build=${CBUILD:-${CHOST}}
 		--target=${CTARGET}
-		--{doc,info,man}dir=/.skip # let individual packages handle docs
+		--{doc,info,man}dir=/.skip # let the real binutils+gcc handle docs
+		MAKEINFO=: #922230
 	)
 
 	# binutils
@@ -239,9 +240,9 @@ src_compile() {
 		pushd "${build_dir}" >/dev/null || die
 
 		edo "${conf[@]}"
-		emake V=1
+		emake MAKEINFO=: V=1
 		# -j1 to match bug #906155, other packages may be fragile too
-		emake -j1 V=1 DESTDIR="${MWT_D}" install
+		emake -j1 MAKEINFO=: V=1 DESTDIR="${MWT_D}" install
 
 		declare -f mwt-${id} >/dev/null && edo mwt-${id}
 		declare -f mwt-${id}_${2} >/dev/null && edo mwt-${id}_${2}


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2024-02-22 14:27 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2024-02-22 14:27 UTC (permalink / raw
  To: gentoo-commits

commit:     d4584144a3ccb5ac08c3eb67fe67918cec15f020
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 22 14:19:18 2024 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Thu Feb 22 14:26:04 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d4584144

dev-util/mingw64-toolchain: prevent sys/sdt.h (systemtap) detection

Unsure which conditions are needed to reproduce exactly,
(having dev-debug/systemtap is not enough) but failed for a
user with USE=systemtap enabled globally (perhaps related
to glibc[systemtap] or gcc[systemtap]).

--disable-systemtap does not do anything to help here, the
header is checked individually by libstdc++ and then fails
given it's missing for the mingw target.

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild
index 808cdc0731ae..9aab786878f3 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild
@@ -143,6 +143,9 @@ src_compile() {
 		--without-zstd
 	)
 	${multilib} || conf_gcc+=( --disable-multilib )
+	# libstdc++ may misdetect sys/sdt.h on systemtap-enabled system and fail
+	# (not passed in conf_gcc above given it is lost in sub-configure calls)
+	local -x glibcxx_cv_sys_sdt_h=no
 
 	local conf_gcc_stage1=(
 		--enable-languages=c


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2024-03-24 18:39 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2024-03-24 18:39 UTC (permalink / raw
  To: gentoo-commits

commit:     f4f5384a31752bfbaf021725ac539d1522656423
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 24 17:13:04 2024 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Sun Mar 24 18:37:34 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f4f5384a

dev-util/mingw64-toolchain: filter -Wl,-z,* ... for CFLAGS

strip-unsupported-flags handles this fine in LDFLAGS, but -Wl,*
are no-ops during compile-only tests (thus not stripped) and then
if a package compiles and links anything at same time it fails.

This used not to be a big problem but now that 23.0 profiles
do -Wl,-z,pack-relative-relocs (mingw ld has no -z) this is
hitting bashrc-mv users that tend to do CFLAGS="${LDFLAGS}"
by default. Tempting to ignore it because of how wrong it is,
but well.

An alternate route could be to eventually have strip-flags
and/or strip-unsupported-flags remove -Wl,* from non-LDFLAGS
given this could affect more than mingw (e.g. switching to
bfd when there is a lld-only option).

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild
index 9aab786878f3..910dddbdfbb5 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild
@@ -211,6 +211,11 @@ src_compile() {
 				filter-flags '-fuse-ld=*'
 				filter-flags '-mfunction-return=thunk*' #878849
 
+				# some bashrc-mv users tend to do CFLAGS="${LDFLAGS}" and then
+				# strip-unsupported-flags miss these during compile-only tests
+				# (primarily done for 23.0 profiles' -z, not full coverage)
+				filter-flags '-Wl,-z,*'
+
 				# -mavx with mingw-gcc has a history of obscure issues and
 				# disabling is seen as safer, e.g. `WINEARCH=win32 winecfg`
 				# crashes with -march=skylake >=wine-8.10, similar issues with


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2024-05-07 14:28 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2024-05-07 14:28 UTC (permalink / raw
  To: gentoo-commits

commit:     ab40dd1735ded9340253a9e693dd75eac860fe3c
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Tue May  7 11:12:48 2024 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Tue May  7 14:23:04 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ab40dd17

dev-util/mingw64-toolchain: add IUSE=bin-symlinks

Kept off-by-default given crossdev is still preferred for
full featured mingw toolchain usage, just for anyone that
wants it (also works out better with ccache).

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/metadata.xml            |  7 ++++++
 .../mingw64-toolchain-11.0.1.ebuild                | 28 +++++++++++++++++++++-
 2 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/dev-util/mingw64-toolchain/metadata.xml b/dev-util/mingw64-toolchain/metadata.xml
index 7a95ab69a652..ec66707e7ad0 100644
--- a/dev-util/mingw64-toolchain/metadata.xml
+++ b/dev-util/mingw64-toolchain/metadata.xml
@@ -5,6 +5,13 @@
 		<email>ionen@gentoo.org</email>
 		<name>Ionen Wolkens</name>
 	</maintainer>
+	<use>
+		<flag name="bin-symlinks">
+			Symlink executables to usr/bin to be in default
+			PATH (conflicts with crossdev mingw, and crossdev
+			is preferable for a fully featured toolchain)
+		</flag>
+	</use>
 	<upstream>
 		<remote-id type="cpe">cpe:/a:gnu:gcc</remote-id>
 		<remote-id type="cpe">cpe:/a:gnu:binutils</remote-id>

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild
index d8d4a4846a8a..94e4af656ed4 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild
@@ -42,7 +42,7 @@ LICENSE="
 SLOT="0"
 # unkeyworded for testing
 #KEYWORDS="-* ~amd64 ~x86"
-IUSE="+abi_x86_32 custom-cflags debug"
+IUSE="+abi_x86_32 bin-symlinks custom-cflags debug"
 
 RDEPEND="
 	dev-libs/gmp:=
@@ -50,6 +50,16 @@ RDEPEND="
 	dev-libs/mpfr:=
 	sys-libs/zlib:=
 	virtual/libiconv
+	bin-symlinks? (
+		abi_x86_64? (
+			!cross-x86_64-w64-mingw32/binutils
+			!cross-x86_64-w64-mingw32/gcc
+		)
+		abi_x86_32? (
+			!cross-i686-w64-mingw32/binutils
+			!cross-i686-w64-mingw32/gcc
+		)
+	)
 "
 DEPEND="${RDEPEND}"
 
@@ -300,6 +310,14 @@ src_compile() {
 		popd >/dev/null || die
 	fi
 
+	if use bin-symlinks; then
+		mkdir -p -- "${MWT_D}${EPREFIX}"/usr/bin/ || die
+		local bin
+		for bin in "${sysroot}"/bin/*; do
+			ln -rs -- "${bin}" "${MWT_D}${EPREFIX}"/usr/bin/ || die
+		done
+	fi
+
 	# portage doesn't know the right strip executable to use for CTARGET
 	# and it can lead to .a mangling, notably with 32bit (breaks toolchain)
 	dostrip -x ${mwtdir}/{${CTARGET}/lib{,32},lib/gcc/${CTARGET}}
@@ -319,6 +337,9 @@ src_install() {
 }
 
 pkg_postinst() {
+	use bin-symlinks && has_version dev-util/shadowman && [[ ! ${ROOT} ]] &&
+		eselect compiler-shadow update all
+
 	if [[ ! ${REPLACING_VERSIONS} ]]; then
 		elog "Note that this package is primarily intended for Wine and related"
 		elog "packages to depend on without needing a manual crossdev setup."
@@ -337,3 +358,8 @@ pkg_postinst() {
 		ewarn "packages and optionally only one needs to be kept."
 	fi
 }
+
+pkg_postrm() {
+	use bin-symlinks && has_version dev-util/shadowman && [[ ! ${ROOT} ]] &&
+		eselect compiler-shadow clean all
+}


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2024-05-07 14:28 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2024-05-07 14:28 UTC (permalink / raw
  To: gentoo-commits

commit:     c283b1c54c695314e209af76ecad211cc320ceb7
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Tue May  7 10:56:50 2024 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Tue May  7 14:23:04 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c283b1c5

dev-util/mingw64-toolchain: add 11.0.1, unkeyworded for now

mingw64-runtime-11.0.1 makes no difference for the wine use case,
but includes gcc-14.1.0 and binutils-2.42 that need testing first.

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/Manifest                |   3 +
 .../mingw64-toolchain-11.0.1.ebuild                | 339 +++++++++++++++++++++
 2 files changed, 342 insertions(+)

diff --git a/dev-util/mingw64-toolchain/Manifest b/dev-util/mingw64-toolchain/Manifest
index 20f636111961..82888e7aa969 100644
--- a/dev-util/mingw64-toolchain/Manifest
+++ b/dev-util/mingw64-toolchain/Manifest
@@ -1,3 +1,6 @@
 DIST binutils-2.41.tar.xz 26765692 BLAKE2B 3bccec2b52f7e82a727121bf2a2e51a6249ba63dcd74c665fd834e858645c912ffd8245d848435288b938852830b482905606f55c40df4061215fd75c52ffc75 SHA512 5df45d0bd6ddabdce4f35878c041e46a92deef01e7dea5facc97fd65cc06b59abc6fba0eb454b68e571c7e14038dc823fe7f2263843e6e627b7444eaf0fe9374
+DIST binutils-2.42.tar.xz 27567160 BLAKE2B e67a5c028fba70e70088fd11b38ec8c9c4ed5a019badefda25abeb6275997b16f0891e7ff3424c4b82bbfae92e8992669826920dd53df61cd48469d8f7cd5bd1 SHA512 155f3ba14cd220102f4f29a4f1e5cfee3c48aa03b74603460d05afb73c70d6657a9d87eee6eb88bf13203fe6f31177a5c9addc04384e956e7da8069c8ecd20a6
 DIST gcc-13.2.0.tar.xz 87858592 BLAKE2B 0034b29d3d6cc05821f0c4253ce077805943aff7b370729dd203bda57d89c107edd657eeddc2fb1e69ea15c7b0323b961f46516c7f4af89a3ccf7fea84701be2 SHA512 d99e4826a70db04504467e349e9fbaedaa5870766cda7c5cab50cdebedc4be755ebca5b789e1232a34a20be1a0b60097de9280efe47bdb71c73251e30b0862a2
+DIST gcc-14.1.0.tar.xz 92265736 BLAKE2B 7efd6574b8bca081de6e31480ec0565c6d7fb773383e8e1fdcc17e35bba2bf44b3f4f995cdbcccd001689926e96a6563ef3d099902fe3b37ab09dcf553ab0596 SHA512 e9e224f2b26646fcf038d28dfa08b94c623bc57941f99894a321d01c600f7c68aff6b8837fd25e73e540de1f8de5606e98694a62cdcdfb525ce768b3ef6879ea
 DIST mingw-w64-v11.0.0.tar.bz2 10058657 BLAKE2B 3f7637bcc7c3f25b2141d35105ea086eab74e228d7275725ffb4f07e283fd75169dbe0900a9c29494fba9ddb2ea03bdd6ae26f06048311e9c93ae3e317c4c060 SHA512 bc1c9fd9d8593ead9375fcbe40950f06cf7616b94dc676db2793ac9b496fe3a6cc94b5793effda3b752942be0d7d01a1c37a8f221aaf178df0d4eeb0aa6d1f8d
+DIST mingw-w64-v11.0.1.tar.bz2 10057401 BLAKE2B 3222eed35522bf95a571b11dc52ea23153068b32497676dbb2837306ba52a78e6d1c9c44a4d64d314e64583b54f6fe86dcff3e467e101acf71cebb7d2a963963 SHA512 568702100bbbb11f7f9c9596dd70df3fb2577492459cf55da38691af1504b91127cb5f3eff268850dcbaa461fdc72e4e2379f7a576fd4a0e537ee1fe42531c01

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild
new file mode 100644
index 000000000000..d8d4a4846a8a
--- /dev/null
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild
@@ -0,0 +1,339 @@
+# Copyright 2022-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MULTILIB_COMPAT=( abi_x86_{32,64} )
+inherit edo flag-o-matic multilib-build toolchain-funcs
+
+# Pick versions known to work for wine+dxvk, and avoid too frequent updates
+# due to slow rebuilds. Do _p1++ rather than revbump on changes (not using
+# Gentoo patchsets for simplicity, their changes are mostly unneeded here).
+BINUTILS_PV=2.42
+GCC_PV=14.1.0
+MINGW_PV=$(ver_cut 1-3)
+
+DESCRIPTION="All-in-one mingw64 toolchain intended for building Wine without crossdev"
+HOMEPAGE="
+	https://www.mingw-w64.org/
+	https://gcc.gnu.org/
+	https://sourceware.org/binutils/
+"
+SRC_URI="
+	https://downloads.sourceforge.net/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${MINGW_PV}.tar.bz2
+	mirror://gnu/binutils/binutils-${BINUTILS_PV}.tar.xz
+"
+if [[ ${GCC_PV} == *-* ]]; then
+	SRC_URI+=" mirror://gcc/snapshots/${GCC_PV}/gcc-${GCC_PV}.tar.xz"
+else
+	SRC_URI+="
+		mirror://gcc/gcc-${GCC_PV}/gcc-${GCC_PV}.tar.xz
+		mirror://gnu/gcc/gcc-${GCC_PV}/gcc-${GCC_PV}.tar.xz
+	"
+fi
+S="${WORKDIR}"
+
+# l1:binutils+gcc, l2:gcc(libraries), l3:mingw64-runtime
+LICENSE="
+	GPL-3+
+	LGPL-3+ || ( GPL-3+ libgcc libstdc++ gcc-runtime-library-exception-3.1 )
+	ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain
+"
+SLOT="0"
+# unkeyworded for testing
+#KEYWORDS="-* ~amd64 ~x86"
+IUSE="+abi_x86_32 custom-cflags debug"
+
+RDEPEND="
+	dev-libs/gmp:=
+	dev-libs/mpc:=
+	dev-libs/mpfr:=
+	sys-libs/zlib:=
+	virtual/libiconv
+"
+DEPEND="${RDEPEND}"
+
+QA_CONFIG_IMPL_DECL_SKIP=(
+	strerror_r # libstdc++ test using -Wimplicit+error
+)
+
+PATCHES=(
+	"${FILESDIR}"/gcc-12.2.0-drop-cflags-sed.patch
+)
+
+pkg_pretend() {
+	[[ ${MERGE_TYPE} == binary ]] && return
+
+	tc-is-cross-compiler &&
+		die "cross-compilation of the toolchain itself is unsupported"
+}
+
+src_prepare() {
+	# rename directories to simplify both patching and the ebuild
+	mv binutils{-${BINUTILS_PV},} || die
+	mv gcc{-${GCC_PV},} || die
+	mv mingw-w64-v${MINGW_PV} mingw64 || die
+
+	default
+}
+
+src_compile() {
+	# not great but do everything in src_compile given bootstrapping
+	# process needs to be done in steps of configure+compile+install
+	# (done modular to have most package-specific things in one place)
+
+	CTARGET=$(usex x86 i686 x86_64)-w64-mingw32
+
+	MWT_D=${T}/root # moved to ${D} in src_install
+	local mwtdir=/usr/lib/${PN}
+	local prefix=${EPREFIX}${mwtdir}
+	local sysroot=${MWT_D}${prefix}
+	local -x PATH=${sysroot}/bin:${PATH}
+
+	filter-lto # requires setting up, and may be messy with mingw static libs
+	use custom-cflags || strip-flags # fancy flags are not realistic here
+
+	local multilib=false
+	use abi_x86_32 && use abi_x86_64 && multilib=true
+
+	# global configure flags
+	local conf=(
+		--build=${CBUILD:-${CHOST}}
+		--target=${CTARGET}
+		--{doc,info,man}dir=/.skip # let the real binutils+gcc handle docs
+		MAKEINFO=: #922230
+	)
+
+	# binutils
+	local conf_binutils=(
+		--prefix="${prefix}"
+		--host=${CHOST}
+		--disable-cet
+		--disable-default-execstack
+		--disable-nls
+		--disable-shared
+		--with-system-zlib
+		--without-debuginfod
+		--without-msgpack
+		--without-zstd
+	)
+	mwt-binutils() {
+		# symlink gcc's lto plugin for AR (bug #854516)
+		ln -s ../../libexec/gcc/${CTARGET}/${GCC_PV%%[.-]*}/liblto_plugin.so \
+			"${sysroot}"/lib/bfd-plugins || die
+	}
+
+	# gcc (minimal -- if need more, disable only in stage1 / enable in stage3)
+	local conf_gcc=(
+		--prefix="${prefix}"
+		--host=${CHOST}
+		--disable-bootstrap
+		--disable-cet
+		--disable-gcov #843989
+		--disable-gomp
+		--disable-libquadmath
+		--disable-libsanitizer
+		--disable-libssp
+		--disable-libvtv
+		--disable-shared
+		--disable-werror
+		--with-gcc-major-version-only
+		--with-system-zlib
+		--without-isl
+		--without-zstd
+	)
+	${multilib} || conf_gcc+=( --disable-multilib )
+	# libstdc++ may misdetect sys/sdt.h on systemtap-enabled system and fail
+	# (not passed in conf_gcc above given it is lost in sub-configure calls)
+	local -x glibcxx_cv_sys_sdt_h=no
+
+	local conf_gcc_stage1=(
+		--enable-languages=c
+		--disable-libatomic
+		--with-sysroot="${sysroot}"
+	)
+	local -n conf_gcc_stage2=conf_gcc_stage1
+
+	local conf_gcc_stage3=(
+		--enable-languages=c,c++
+		--enable-threads=posix # needs stage3, and is required for dxvk/vkd3d
+		--with-sysroot="${prefix}"
+		--with-build-sysroot="${sysroot}"
+	)
+
+	# mingw64-runtime (split in several parts, 3 needed for gcc stages)
+	local conf_mingw64=(
+		--prefix="${prefix}"/${CTARGET}
+		--host=${CTARGET}
+		--with-sysroot=no
+		--without-{crt,headers}
+
+		# mingw .dll aren't used by wine and packages wouldn't find them
+		# at runtime, use crossdev if need dll and proper search paths
+		--disable-shared
+	)
+
+	local conf_mingw64_headers=(
+		--enable-idl
+		--with-headers
+	)
+	mwt-mingw64_headers() { ln -s ${CTARGET} "${sysroot}"/mingw || die; } #419601
+
+	local conf_mingw64_runtime=( --with-crt )
+	${multilib} ||
+		conf_mingw64_runtime+=( $(usex x86 --disable-lib64 --disable-lib32 ) )
+
+	local conf_mingw64_libraries=( --with-libraries )
+	local conf_mingw64_libraries32=(
+		--libdir="${prefix}"/${CTARGET}/lib32
+		--with-libraries
+		CC="${CTARGET}-gcc -m32"
+		RCFLAGS="--target=pe-i386 ${RCFLAGS}"
+	)
+
+	# mingw64-runtime's idl compiler (useful not to depend on wine for widl)
+	local conf_widl=( --prefix="${prefix}" )
+
+	# mwt-build [-x] <path/package-name> [stage-name]
+	# -> ./configure && make && make install && mwt-package() && mwt-package_stage()
+	# passes conf, conf_package, and conf_package_stage arrays to configure, and
+	# users can add options through environment with e.g.
+	#	MWT_BINUTILS_CONF="--some-option"
+	#	MWT_GCC_STAGE1_CONF="--some-gcc-stage1-only-option"
+	#	MWT_WIDL_CONF="--some-other-option"
+	#	EXTRA_ECONF="--global-option" (generic naming for if not reading this)
+	mwt-build() {
+		if [[ ${1} == -x ]]; then
+			(
+				# cross-compiling, cleanup and let ./configure handle it
+				unset AR AS CC CPP CXX DLLTOOL LD NM OBJCOPY OBJDUMP RANLIB RC STRIP
+				CHOST=${CTARGET}
+				filter-flags '-fuse-ld=*'
+				filter-flags '-mfunction-return=thunk*' #878849
+
+				# some bashrc-mv users tend to do CFLAGS="${LDFLAGS}" and then
+				# strip-unsupported-flags miss these during compile-only tests
+				# (primarily done for 23.0 profiles' -z, not full coverage)
+				filter-flags '-Wl,-z,*'
+
+				# -mavx with mingw-gcc has a history of obscure issues and
+				# disabling is seen as safer, e.g. `WINEARCH=win32 winecfg`
+				# crashes with -march=skylake >=wine-8.10, similar issues with
+				# znver4: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110273
+				append-flags -mno-avx
+
+				strip-unsupported-flags
+				mwt-build "${@:2}"
+			)
+			return
+		fi
+
+		local id=${1##*/}
+		local build_dir=${WORKDIR}/${1}${2+_${2}}-build
+
+		# econf is not allowed in src_compile and its defaults are
+		# mostly unused here, so use configure directly
+		local conf=( "${WORKDIR}/${1}"/configure "${conf[@]}" )
+
+		local -n conf_id=conf_${id} conf_id2=conf_${id}_${2}
+		[[ ${conf_id@a} == *a* ]] && conf+=( "${conf_id[@]}" )
+		[[ ${2} && ${conf_id2@a} == *a* ]] && conf+=( "${conf_id2[@]}" )
+
+		local -n extra_id=MWT_${id^^}_CONF extra_id2=MWT_${id^^}_${2^^}_CONF
+		conf+=( ${EXTRA_ECONF} ${extra_id} ${2+${extra_id2}} )
+
+		einfo "Building ${id}${2+ ${2}} in ${build_dir} ..."
+
+		mkdir -p "${build_dir}" || die
+		pushd "${build_dir}" >/dev/null || die
+
+		edo "${conf[@]}"
+		emake MAKEINFO=: V=1
+		# -j1 to match bug #906155, other packages may be fragile too
+		emake -j1 MAKEINFO=: V=1 DESTDIR="${MWT_D}" install
+
+		declare -f mwt-${id} >/dev/null && edo mwt-${id}
+		declare -f mwt-${id}_${2} >/dev/null && edo mwt-${id}_${2}
+
+		popd >/dev/null || die
+	}
+
+	# workaround race condition with out-of-source crt build (bug #879537)
+	mkdir -p mingw64_runtime-build/mingw-w64-crt/lib{32,64} || die
+
+	# build with same ordering that crossdev would do + stage3 for pthreads
+	mwt-build binutils
+	mwt-build mingw64 headers
+	mwt-build gcc stage1
+	mwt-build -x mingw64 runtime
+	mwt-build gcc stage2
+	${multilib} && mwt-build -x mingw64 libraries32
+	mwt-build -x mingw64 libraries
+	mwt-build gcc stage3
+	mwt-build mingw64/mingw-w64-tools/widl
+	# note: /could/ system-bootstrap if already installed, but gcc and
+	# libraries will use the system's older mingw64 headers/static-libs
+	# and make this potentially fragile without more workarounds/stages
+
+	if ${multilib}; then
+		# Like system's gcc, `x86_64-w64-mingw32-gcc -m32` can build for x86,
+		# but packages expect crossdev's i686-w64-mingw32-gcc which is the same
+		# just without 64bit support and would rather not build the toolchain
+		# twice. Dirty but wrap to allow simple interoperability with crossdev.
+		mwt-i686_wrapper() {
+			printf "#!/usr/bin/env sh\nexec \"${prefix}/bin/${bin}\" ${*} "'"${@}"\n' \
+				> ${bin32} || die
+			chmod +x ${bin32} || die
+		}
+		pushd "${sysroot}"/bin >/dev/null || die
+		local bin bin32
+		for bin in ${CTARGET}-*; do
+			bin32=${bin/x86_64-w64/i686-w64}
+			case ${bin#${CTARGET}-} in
+				as) mwt-i686_wrapper --32;;
+				cpp|gcc|gcc-${GCC_PV%%[.-]*}|g++|widl) mwt-i686_wrapper -m32;;
+				ld|ld.bfd) mwt-i686_wrapper -m i386pe;;
+				windres) mwt-i686_wrapper --target=pe-i386;;
+				*) ln -s ${bin} ${bin32} || die;;
+			esac
+		done
+		popd >/dev/null || die
+	fi
+
+	# portage doesn't know the right strip executable to use for CTARGET
+	# and it can lead to .a mangling, notably with 32bit (breaks toolchain)
+	dostrip -x ${mwtdir}/{${CTARGET}/lib{,32},lib/gcc/${CTARGET}}
+
+	# ... and instead do it here given this saves ~60MB
+	if use !debug; then
+		einfo "Stripping ${CTARGET} static libraries ..."
+		find "${sysroot}"/{,lib/gcc/}${CTARGET} -type f -name '*.a' \
+			-exec ${CTARGET}-strip --strip-unneeded {} + || die
+	fi
+}
+
+src_install() {
+	mv -- "${MWT_D}${EPREFIX}"/* "${ED}" || die
+
+	find "${ED}" -type f -name '*.la' -delete || die
+}
+
+pkg_postinst() {
+	if [[ ! ${REPLACING_VERSIONS} ]]; then
+		elog "Note that this package is primarily intended for Wine and related"
+		elog "packages to depend on without needing a manual crossdev setup."
+		elog
+		elog "Settings are oriented only for what these need and simplicity."
+		elog "Use sys-devel/crossdev if need full toolchain/customization:"
+		elog "    https://wiki.gentoo.org/wiki/Mingw"
+		elog "    https://wiki.gentoo.org/wiki/Crossdev"
+	fi
+
+	local cross_gcc=cross-$(usex x86 i686 x86_64)-w64-mingw32/gcc
+	if has_version ${cross_gcc}; then
+		# encourage cleanup given users may not realize if switch by default
+		ewarn "${cross_gcc} is installed, note that ${PN}"
+		ewarn "is redundant with the *-w64-mingw32/{binutils,gcc,mingw64-runtime}"
+		ewarn "packages and optionally only one needs to be kept."
+	fi
+}


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2024-05-07 17:49 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2024-05-07 17:49 UTC (permalink / raw
  To: gentoo-commits

commit:     896a29cffd9ccd6f060d74a5193b6825338dd7c3
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Tue May  7 17:47:27 2024 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Tue May  7 17:48:51 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=896a29cf

dev-util/mingw64-toolchain: IUSE=debug -> +strip

Forgot but meant to do this on a bump to avoid rebuilds,
but given this isn't keyworded yet there is little harm
in doing it now.

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild
index 94e4af656ed4..4003b26827a8 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild
@@ -42,7 +42,7 @@ LICENSE="
 SLOT="0"
 # unkeyworded for testing
 #KEYWORDS="-* ~amd64 ~x86"
-IUSE="+abi_x86_32 bin-symlinks custom-cflags debug"
+IUSE="+abi_x86_32 bin-symlinks custom-cflags +strip"
 
 RDEPEND="
 	dev-libs/gmp:=
@@ -323,7 +323,7 @@ src_compile() {
 	dostrip -x ${mwtdir}/{${CTARGET}/lib{,32},lib/gcc/${CTARGET}}
 
 	# ... and instead do it here given this saves ~60MB
-	if use !debug; then
+	if use strip; then
 		einfo "Stripping ${CTARGET} static libraries ..."
 		find "${sysroot}"/{,lib/gcc/}${CTARGET} -type f -name '*.a' \
 			-exec ${CTARGET}-strip --strip-unneeded {} + || die


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2024-05-10  3:03 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2024-05-10  3:03 UTC (permalink / raw
  To: gentoo-commits

commit:     4778d9cbaca208869cb80f606db24d857c75aa3f
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Fri May 10 02:36:23 2024 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Fri May 10 03:00:43 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4778d9cb

dev-util/mingw64-toolchain: filter -fstack-protector* again

Used to be done because it was straight up broken (couldn't
build), but now it's successfully causing problems and it's
not obvious for upstreams to fix these issues with mingw.

There may be real issues in dxvk & others, but support for
this is new in mingw (also only partial), and believe using
this can be considered too experimental/early "here". Still
allowing it with USE=custom-cflags for those that really want
it and don't mind if it breaks some components they don't use.

Skipping revbump given it's an unusual configuration given
users normally don't pass this in *FLAGS but rather rely
on the toolchain's defaults. mingw64-toolchain-11.0.1 will
also be keyworded in not that long for rebuilds.

Only needed for mingw runtime, so the toolchain itself is still
using it through the system-wide defaults.

May revisit eventually.

Not doing this for crossdev+mingw64-runtime main package again,
these are for more expert use in the first place.

Bug: https://bugs.gentoo.org/870136
Closes: https://bugs.gentoo.org/931512
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild | 6 ++++++
 dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild    | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild
index 68c62e65ac14..1e512377b27b 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild
@@ -211,6 +211,12 @@ src_compile() {
 				filter-flags '-fuse-ld=*'
 				filter-flags '-mfunction-return=thunk*' #878849
 
+				# support for stack-protector is still new and experimental
+				# for mingw and issues can also be harder to debug + fix for
+				# upstreams using it, if feeling concerned about security
+				# would advise to either not use wine or at least contain it
+				use custom-cflags || filter-flags '-fstack-protector*' #931512
+
 				# some bashrc-mv users tend to do CFLAGS="${LDFLAGS}" and then
 				# strip-unsupported-flags miss these during compile-only tests
 				# (primarily done for 23.0 profiles' -z, not full coverage)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild
index 4003b26827a8..09f8b50f64a4 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild
@@ -221,6 +221,12 @@ src_compile() {
 				filter-flags '-fuse-ld=*'
 				filter-flags '-mfunction-return=thunk*' #878849
 
+				# support for stack-protector is still new and experimental
+				# for mingw and issues can also be harder to debug + fix for
+				# upstreams using it, if feeling concerned about security
+				# would advise to either not use wine or at least contain it
+				use custom-cflags || filter-flags '-fstack-protector*' #931512
+
 				# some bashrc-mv users tend to do CFLAGS="${LDFLAGS}" and then
 				# strip-unsupported-flags miss these during compile-only tests
 				# (primarily done for 23.0 profiles' -z, not full coverage)


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2024-05-10 10:12 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2024-05-10 10:12 UTC (permalink / raw
  To: gentoo-commits

commit:     9e3eb5a1b306c9baa70a1c39c59253878647adf1
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Fri May 10 10:10:52 2024 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Fri May 10 10:12:36 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9e3eb5a1

dev-util/mingw64-toolchain: restore keywords for 11.0.1

Had hoped to get some feedback before wider testing but
seems fine from using it a bit myself.

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild
index 09f8b50f64a4..8f3671e17f67 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild
@@ -40,8 +40,7 @@ LICENSE="
 	ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain
 "
 SLOT="0"
-# unkeyworded for testing
-#KEYWORDS="-* ~amd64 ~x86"
+KEYWORDS="-* ~amd64 ~x86"
 IUSE="+abi_x86_32 bin-symlinks custom-cflags +strip"
 
 RDEPEND="


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2024-05-21  3:01 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2024-05-21  3:01 UTC (permalink / raw
  To: gentoo-commits

commit:     b6ca4f9dc1b3e4f9e947e547f9cab2730502de52
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Tue May 21 02:24:12 2024 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Tue May 21 02:58:16 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b6ca4f9d

dev-util/mingw64-toolchain: add workaround for gcc14 ICE w/ mingw

Bug: https://bugs.gentoo.org/932319
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild
index 8f3671e17f67..adae7ba4e0d5 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild
@@ -237,6 +237,9 @@ src_compile() {
 				# znver4: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110273
 				append-flags -mno-avx
 
+				# gcc14 -fno-omit-frame-pointer ICE workaround (bug #932319)
+				append-flags -fomit-frame-pointer
+
 				strip-unsupported-flags
 				mwt-build "${@:2}"
 			)


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2024-05-22  3:32 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2024-05-22  3:32 UTC (permalink / raw
  To: gentoo-commits

commit:     3cd1ffe8b0e1fd84a98501ccca0a8ccefd40c307
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Wed May 22 02:11:07 2024 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Wed May 22 03:30:57 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3cd1ffe8

Revert "dev-util/mingw64-toolchain: add workaround for gcc14 ICE w/ mingw"

This reverts commit b6ca4f9dc1b3e4f9e947e547f9cab2730502de52.

A fix was found, so will patch gcc instead.

Bug: https://bugs.gentoo.org/932319
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild
index adae7ba4e0d5..8f3671e17f67 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild
@@ -237,9 +237,6 @@ src_compile() {
 				# znver4: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110273
 				append-flags -mno-avx
 
-				# gcc14 -fno-omit-frame-pointer ICE workaround (bug #932319)
-				append-flags -fomit-frame-pointer
-
 				strip-unsupported-flags
 				mwt-build "${@:2}"
 			)


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2024-05-30  6:39 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2024-05-30  6:39 UTC (permalink / raw
  To: gentoo-commits

commit:     581279bf4d84218551086939ededc970910311d2
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Thu May 30 05:38:03 2024 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Thu May 30 06:38:48 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=581279bf

dev-util/mingw64-toolchain: add 12.0.0 (unkeyworded)

Same gcc+binutils, only bumps runtime.

Should be safe, but have not tested it much yet and will wait a bit
to keyword and want to spare users from long rebuilds if anything
needs fixing.

Force msvcrt-os for now (upstream switch to ucrt by default), have
not tried ucrt with wine at all and there may be things to consider
to switch safely (but less of a hassle than with crossdev given we
always bootstrap here).

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/Manifest                |   1 +
 .../mingw64-toolchain-12.0.0.ebuild                | 380 +++++++++++++++++++++
 2 files changed, 381 insertions(+)

diff --git a/dev-util/mingw64-toolchain/Manifest b/dev-util/mingw64-toolchain/Manifest
index 82888e7aa969..3ae5bf401675 100644
--- a/dev-util/mingw64-toolchain/Manifest
+++ b/dev-util/mingw64-toolchain/Manifest
@@ -4,3 +4,4 @@ DIST gcc-13.2.0.tar.xz 87858592 BLAKE2B 0034b29d3d6cc05821f0c4253ce077805943aff7
 DIST gcc-14.1.0.tar.xz 92265736 BLAKE2B 7efd6574b8bca081de6e31480ec0565c6d7fb773383e8e1fdcc17e35bba2bf44b3f4f995cdbcccd001689926e96a6563ef3d099902fe3b37ab09dcf553ab0596 SHA512 e9e224f2b26646fcf038d28dfa08b94c623bc57941f99894a321d01c600f7c68aff6b8837fd25e73e540de1f8de5606e98694a62cdcdfb525ce768b3ef6879ea
 DIST mingw-w64-v11.0.0.tar.bz2 10058657 BLAKE2B 3f7637bcc7c3f25b2141d35105ea086eab74e228d7275725ffb4f07e283fd75169dbe0900a9c29494fba9ddb2ea03bdd6ae26f06048311e9c93ae3e317c4c060 SHA512 bc1c9fd9d8593ead9375fcbe40950f06cf7616b94dc676db2793ac9b496fe3a6cc94b5793effda3b752942be0d7d01a1c37a8f221aaf178df0d4eeb0aa6d1f8d
 DIST mingw-w64-v11.0.1.tar.bz2 10057401 BLAKE2B 3222eed35522bf95a571b11dc52ea23153068b32497676dbb2837306ba52a78e6d1c9c44a4d64d314e64583b54f6fe86dcff3e467e101acf71cebb7d2a963963 SHA512 568702100bbbb11f7f9c9596dd70df3fb2577492459cf55da38691af1504b91127cb5f3eff268850dcbaa461fdc72e4e2379f7a576fd4a0e537ee1fe42531c01
+DIST mingw-w64-v12.0.0.tar.bz2 10474283 BLAKE2B 6500045f7d77f7de01dea0f4e03f3e4ddf6154586c5e3ee9718ee2c7ef1cc83ce3cbd644b6f1dc293ae6e0bfb55a6b68d439622bd1cfdefefc4cc547317f1943 SHA512 949b2bfab8763ab10ec4e9fdfdaf5361517a4ab787fb98ab419b38d02694061c2e821ebbf6e2e4b39d92bdf17419d116daa8e63afd9e01d11592f39df4da69d7

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-12.0.0.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-12.0.0.ebuild
new file mode 100644
index 000000000000..9d0caa3aafaa
--- /dev/null
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-12.0.0.ebuild
@@ -0,0 +1,380 @@
+# Copyright 2022-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MULTILIB_COMPAT=( abi_x86_{32,64} )
+inherit edo flag-o-matic multilib-build toolchain-funcs
+
+# Pick versions known to work for wine+dxvk, and avoid too frequent updates
+# due to slow rebuilds. Do _p1++ rather than revbump on changes (not using
+# Gentoo patchsets for simplicity, their changes are mostly unneeded here).
+BINUTILS_PV=2.42
+GCC_PV=14.1.0
+MINGW_PV=$(ver_cut 1-3)
+
+DESCRIPTION="All-in-one mingw64 toolchain intended for building Wine without crossdev"
+HOMEPAGE="
+	https://www.mingw-w64.org/
+	https://gcc.gnu.org/
+	https://sourceware.org/binutils/
+"
+SRC_URI="
+	https://downloads.sourceforge.net/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${MINGW_PV}.tar.bz2
+	mirror://gnu/binutils/binutils-${BINUTILS_PV}.tar.xz
+"
+if [[ ${GCC_PV} == *-* ]]; then
+	SRC_URI+=" mirror://gcc/snapshots/${GCC_PV}/gcc-${GCC_PV}.tar.xz"
+else
+	SRC_URI+="
+		mirror://gcc/gcc-${GCC_PV}/gcc-${GCC_PV}.tar.xz
+		mirror://gnu/gcc/gcc-${GCC_PV}/gcc-${GCC_PV}.tar.xz
+	"
+fi
+S="${WORKDIR}"
+
+# l1:binutils+gcc, l2:gcc(libraries), l3:mingw64-runtime
+LICENSE="
+	GPL-3+
+	LGPL-3+ || ( GPL-3+ libgcc libstdc++ gcc-runtime-library-exception-3.1 )
+	ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain
+"
+SLOT="0"
+# unkeyworded for testing
+#KEYWORDS="-* ~amd64 ~x86"
+IUSE="+abi_x86_32 bin-symlinks custom-cflags +strip"
+
+RDEPEND="
+	dev-libs/gmp:=
+	dev-libs/mpc:=
+	dev-libs/mpfr:=
+	sys-libs/zlib:=
+	virtual/libiconv
+	bin-symlinks? (
+		abi_x86_64? (
+			!cross-x86_64-w64-mingw32/binutils
+			!cross-x86_64-w64-mingw32/gcc
+		)
+		abi_x86_32? (
+			!cross-i686-w64-mingw32/binutils
+			!cross-i686-w64-mingw32/gcc
+		)
+	)
+"
+DEPEND="${RDEPEND}"
+
+QA_CONFIG_IMPL_DECL_SKIP=(
+	strerror_r # libstdc++ test using -Wimplicit+error
+)
+
+PATCHES=(
+	"${FILESDIR}"/gcc-12.2.0-drop-cflags-sed.patch
+	"${FILESDIR}"/gcc-14.1.0-no-omit-fp-ice.patch
+)
+
+pkg_pretend() {
+	[[ ${MERGE_TYPE} == binary ]] && return
+
+	tc-is-cross-compiler &&
+		die "cross-compilation of the toolchain itself is unsupported"
+}
+
+src_prepare() {
+	# rename directories to simplify both patching and the ebuild
+	mv binutils{-${BINUTILS_PV},} || die
+	mv gcc{-${GCC_PV},} || die
+	mv mingw-w64-v${MINGW_PV} mingw64 || die
+
+	default
+}
+
+src_compile() {
+	# not great but do everything in src_compile given bootstrapping
+	# process needs to be done in steps of configure+compile+install
+	# (done modular to have most package-specific things in one place)
+
+	CTARGET=$(usex x86 i686 x86_64)-w64-mingw32
+
+	MWT_D=${T}/root # moved to ${D} in src_install
+	local mwtdir=/usr/lib/${PN}
+	local prefix=${EPREFIX}${mwtdir}
+	local sysroot=${MWT_D}${prefix}
+	local -x PATH=${sysroot}/bin:${PATH}
+
+	filter-lto # requires setting up, and may be messy with mingw static libs
+	use custom-cflags || strip-flags # fancy flags are not realistic here
+
+	local multilib=false
+	use abi_x86_32 && use abi_x86_64 && multilib=true
+
+	# global configure flags
+	local conf=(
+		--build=${CBUILD:-${CHOST}}
+		--target=${CTARGET}
+		--{doc,info,man}dir=/.skip # let the real binutils+gcc handle docs
+		MAKEINFO=: #922230
+	)
+
+	# binutils
+	local conf_binutils=(
+		--prefix="${prefix}"
+		--host=${CHOST}
+		--disable-cet
+		--disable-default-execstack
+		--disable-nls
+		--disable-shared
+		--with-system-zlib
+		--without-debuginfod
+		--without-msgpack
+		--without-zstd
+	)
+	mwt-binutils() {
+		# symlink gcc's lto plugin for AR (bug #854516)
+		ln -s ../../libexec/gcc/${CTARGET}/${GCC_PV%%[.-]*}/liblto_plugin.so \
+			"${sysroot}"/lib/bfd-plugins || die
+	}
+
+	# gcc (minimal -- if need more, disable only in stage1 / enable in stage3)
+	local conf_gcc=(
+		--prefix="${prefix}"
+		--host=${CHOST}
+		--disable-bootstrap
+		--disable-cet
+		--disable-gcov #843989
+		--disable-gomp
+		--disable-libquadmath
+		--disable-libsanitizer
+		--disable-libssp
+		--disable-libvtv
+		--disable-shared
+		--disable-werror
+		--with-gcc-major-version-only
+		--with-system-zlib
+		--without-isl
+		--without-zstd
+	)
+	${multilib} || conf_gcc+=( --disable-multilib )
+	# libstdc++ may misdetect sys/sdt.h on systemtap-enabled system and fail
+	# (not passed in conf_gcc above given it is lost in sub-configure calls)
+	local -x glibcxx_cv_sys_sdt_h=no
+
+	local conf_gcc_stage1=(
+		--enable-languages=c
+		--disable-libatomic
+		--with-sysroot="${sysroot}"
+	)
+	local -n conf_gcc_stage2=conf_gcc_stage1
+
+	local conf_gcc_stage3=(
+		--enable-languages=c,c++
+		--enable-threads=posix # needs stage3, and is required for dxvk/vkd3d
+		--with-sysroot="${prefix}"
+		--with-build-sysroot="${sysroot}"
+	)
+
+	# mingw64-runtime (split in several parts, 3 needed for gcc stages)
+	local conf_mingw64=(
+		--prefix="${prefix}"/${CTARGET}
+		--host=${CTARGET}
+		--with-sysroot=no
+		--without-{crt,headers}
+
+		# mingw .dll aren't used by wine and packages wouldn't find them
+		# at runtime, use crossdev if need dll and proper search paths
+		--disable-shared
+	)
+
+	local conf_mingw64_headers=(
+		--enable-idl
+		--with-headers
+
+		# ucrt has not been tested and migration needs looking into, force
+		# msvcrt-os for now (if really want this either use crossdev or
+		# override using MWT_MINGW64_{HEADERS,RUNTIME}_CONF=... env vars)
+		--with-default-msvcrt=msvcrt-os
+	)
+	mwt-mingw64_headers() { ln -s ${CTARGET} "${sysroot}"/mingw || die; } #419601
+
+	local conf_mingw64_runtime=(
+		--with-crt
+		--with-default-msvcrt=msvcrt-os # match with headers
+	)
+	${multilib} ||
+		conf_mingw64_runtime+=( $(usex x86 --disable-lib64 --disable-lib32 ) )
+
+	local conf_mingw64_libraries=( --with-libraries )
+	local conf_mingw64_libraries32=(
+		--libdir="${prefix}"/${CTARGET}/lib32
+		--with-libraries
+		CC="${CTARGET}-gcc -m32"
+		RCFLAGS="--target=pe-i386 ${RCFLAGS}"
+	)
+
+	# mingw64-runtime's idl compiler (useful not to depend on wine for widl)
+	local conf_widl=( --prefix="${prefix}" )
+
+	# mwt-build [-x] <path/package-name> [stage-name]
+	# -> ./configure && make && make install && mwt-package() && mwt-package_stage()
+	# passes conf, conf_package, and conf_package_stage arrays to configure, and
+	# users can add options through environment with e.g.
+	#	MWT_BINUTILS_CONF="--some-option"
+	#	MWT_GCC_STAGE1_CONF="--some-gcc-stage1-only-option"
+	#	MWT_WIDL_CONF="--some-other-option"
+	#	EXTRA_ECONF="--global-option" (generic naming for if not reading this)
+	mwt-build() {
+		if [[ ${1} == -x ]]; then
+			(
+				# cross-compiling, cleanup and let ./configure handle it
+				unset AR AS CC CPP CXX DLLTOOL LD NM OBJCOPY OBJDUMP RANLIB RC STRIP
+				CHOST=${CTARGET}
+				filter-flags '-fuse-ld=*'
+				filter-flags '-mfunction-return=thunk*' #878849
+
+				# support for stack-protector is still new and experimental
+				# for mingw and issues can also be harder to debug + fix for
+				# upstreams using it, if feeling concerned about security
+				# would advise to either not use wine or at least contain it
+				use custom-cflags || filter-flags '-fstack-protector*' #931512
+
+				# some bashrc-mv users tend to do CFLAGS="${LDFLAGS}" and then
+				# strip-unsupported-flags miss these during compile-only tests
+				# (primarily done for 23.0 profiles' -z, not full coverage)
+				filter-flags '-Wl,-z,*'
+
+				# -mavx with mingw-gcc has a history of obscure issues and
+				# disabling is seen as safer, e.g. `WINEARCH=win32 winecfg`
+				# crashes with -march=skylake >=wine-8.10, similar issues with
+				# znver4: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110273
+				append-flags -mno-avx
+
+				strip-unsupported-flags
+				mwt-build "${@:2}"
+			)
+			return
+		fi
+
+		local id=${1##*/}
+		local build_dir=${WORKDIR}/${1}${2+_${2}}-build
+
+		# econf is not allowed in src_compile and its defaults are
+		# mostly unused here, so use configure directly
+		local conf=( "${WORKDIR}/${1}"/configure "${conf[@]}" )
+
+		local -n conf_id=conf_${id} conf_id2=conf_${id}_${2}
+		[[ ${conf_id@a} == *a* ]] && conf+=( "${conf_id[@]}" )
+		[[ ${2} && ${conf_id2@a} == *a* ]] && conf+=( "${conf_id2[@]}" )
+
+		local -n extra_id=MWT_${id^^}_CONF extra_id2=MWT_${id^^}_${2^^}_CONF
+		conf+=( ${EXTRA_ECONF} ${extra_id} ${2+${extra_id2}} )
+
+		einfo "Building ${id}${2+ ${2}} in ${build_dir} ..."
+
+		mkdir -p "${build_dir}" || die
+		pushd "${build_dir}" >/dev/null || die
+
+		edo "${conf[@]}"
+		emake MAKEINFO=: V=1
+		# -j1 to match bug #906155, other packages may be fragile too
+		emake -j1 MAKEINFO=: V=1 DESTDIR="${MWT_D}" install
+
+		declare -f mwt-${id} >/dev/null && edo mwt-${id}
+		declare -f mwt-${id}_${2} >/dev/null && edo mwt-${id}_${2}
+
+		popd >/dev/null || die
+	}
+
+	# workaround race condition with out-of-source crt build (bug #879537)
+	mkdir -p mingw64_runtime-build/mingw-w64-crt/lib{32,64} || die
+
+	# build with same ordering that crossdev would do + stage3 for pthreads
+	mwt-build binutils
+	mwt-build mingw64 headers
+	mwt-build gcc stage1
+	mwt-build -x mingw64 runtime
+	mwt-build gcc stage2
+	${multilib} && mwt-build -x mingw64 libraries32
+	mwt-build -x mingw64 libraries
+	mwt-build gcc stage3
+	mwt-build mingw64/mingw-w64-tools/widl
+	# note: /could/ system-bootstrap if already installed, but gcc and
+	# libraries will use the system's older mingw64 headers/static-libs
+	# and make this potentially fragile without more workarounds/stages
+
+	if ${multilib}; then
+		# Like system's gcc, `x86_64-w64-mingw32-gcc -m32` can build for x86,
+		# but packages expect crossdev's i686-w64-mingw32-gcc which is the same
+		# just without 64bit support and would rather not build the toolchain
+		# twice. Dirty but wrap to allow simple interoperability with crossdev.
+		mwt-i686_wrapper() {
+			printf "#!/usr/bin/env sh\nexec \"${prefix}/bin/${bin}\" ${*} "'"${@}"\n' \
+				> ${bin32} || die
+			chmod +x ${bin32} || die
+		}
+		pushd "${sysroot}"/bin >/dev/null || die
+		local bin bin32
+		for bin in ${CTARGET}-*; do
+			bin32=${bin/x86_64-w64/i686-w64}
+			case ${bin#${CTARGET}-} in
+				as) mwt-i686_wrapper --32;;
+				cpp|gcc|gcc-${GCC_PV%%[.-]*}|g++|widl) mwt-i686_wrapper -m32;;
+				ld|ld.bfd) mwt-i686_wrapper -m i386pe;;
+				windres) mwt-i686_wrapper --target=pe-i386;;
+				*) ln -s ${bin} ${bin32} || die;;
+			esac
+		done
+		popd >/dev/null || die
+	fi
+
+	if use bin-symlinks; then
+		mkdir -p -- "${MWT_D}${EPREFIX}"/usr/bin/ || die
+		local bin
+		for bin in "${sysroot}"/bin/*; do
+			ln -rs -- "${bin}" "${MWT_D}${EPREFIX}"/usr/bin/ || die
+		done
+	fi
+
+	# portage doesn't know the right strip executable to use for CTARGET
+	# and it can lead to .a mangling, notably with 32bit (breaks toolchain)
+	dostrip -x ${mwtdir}/{${CTARGET}/lib{,32},lib/gcc/${CTARGET}}
+
+	# ... and instead do it here given this saves ~60MB
+	if use strip; then
+		einfo "Stripping ${CTARGET} static libraries ..."
+		find "${sysroot}"/{,lib/gcc/}${CTARGET} -type f -name '*.a' \
+			-exec ${CTARGET}-strip --strip-unneeded {} + || die
+	fi
+}
+
+src_install() {
+	mv -- "${MWT_D}${EPREFIX}"/* "${ED}" || die
+
+	find "${ED}" -type f -name '*.la' -delete || die
+}
+
+pkg_postinst() {
+	use bin-symlinks && has_version dev-util/shadowman && [[ ! ${ROOT} ]] &&
+		eselect compiler-shadow update all
+
+	if [[ ! ${REPLACING_VERSIONS} ]]; then
+		elog "Note that this package is primarily intended for Wine and related"
+		elog "packages to depend on without needing a manual crossdev setup."
+		elog
+		elog "Settings are oriented only for what these need and simplicity."
+		elog "Use sys-devel/crossdev if need full toolchain/customization:"
+		elog "    https://wiki.gentoo.org/wiki/Mingw"
+		elog "    https://wiki.gentoo.org/wiki/Crossdev"
+	fi
+
+	local cross_gcc=cross-$(usex x86 i686 x86_64)-w64-mingw32/gcc
+	if has_version ${cross_gcc}; then
+		# encourage cleanup given users may not realize if switch by default
+		ewarn "${cross_gcc} is installed, note that ${PN}"
+		ewarn "is redundant with the *-w64-mingw32/{binutils,gcc,mingw64-runtime}"
+		ewarn "packages and optionally only one needs to be kept."
+	fi
+}
+
+pkg_postrm() {
+	use bin-symlinks && has_version dev-util/shadowman && [[ ! ${ROOT} ]] &&
+		eselect compiler-shadow clean all
+}


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2024-06-02  3:54 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2024-06-02  3:54 UTC (permalink / raw
  To: gentoo-commits

commit:     b7ddf87f5dcfb7f78af2d93443ec622c0b61946b
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Sun Jun  2 03:52:54 2024 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Sun Jun  2 03:54:37 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b7ddf87f

dev-util/mingw64-toolchain: restore 12.0.0 keywords

SEem pretty uneventful, old hacky wine-proton-7 still builds
with it as-is too (well, with the patch for mingw-11 anyway).

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-12.0.0.ebuild | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-12.0.0.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-12.0.0.ebuild
index 9d0caa3aafaa..299f57892c6e 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-12.0.0.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-12.0.0.ebuild
@@ -40,8 +40,7 @@ LICENSE="
 	ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain
 "
 SLOT="0"
-# unkeyworded for testing
-#KEYWORDS="-* ~amd64 ~x86"
+KEYWORDS="-* ~amd64 ~x86"
 IUSE="+abi_x86_32 bin-symlinks custom-cflags +strip"
 
 RDEPEND="


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2024-06-06 13:20 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2024-06-06 13:20 UTC (permalink / raw
  To: gentoo-commits

commit:     fe0135a66f1234afbfcfbc7ccc70b4d4817da8bb
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Thu Jun  6 12:45:22 2024 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Thu Jun  6 13:18:58 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fe0135a6

dev-util/mingw64-toolchain: drop 11.0.1-r1

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/Manifest                |   1 -
 .../mingw64-toolchain-11.0.1-r1.ebuild             | 371 ---------------------
 2 files changed, 372 deletions(-)

diff --git a/dev-util/mingw64-toolchain/Manifest b/dev-util/mingw64-toolchain/Manifest
index 3ae5bf401675..d33cfbe97b77 100644
--- a/dev-util/mingw64-toolchain/Manifest
+++ b/dev-util/mingw64-toolchain/Manifest
@@ -3,5 +3,4 @@ DIST binutils-2.42.tar.xz 27567160 BLAKE2B e67a5c028fba70e70088fd11b38ec8c9c4ed5
 DIST gcc-13.2.0.tar.xz 87858592 BLAKE2B 0034b29d3d6cc05821f0c4253ce077805943aff7b370729dd203bda57d89c107edd657eeddc2fb1e69ea15c7b0323b961f46516c7f4af89a3ccf7fea84701be2 SHA512 d99e4826a70db04504467e349e9fbaedaa5870766cda7c5cab50cdebedc4be755ebca5b789e1232a34a20be1a0b60097de9280efe47bdb71c73251e30b0862a2
 DIST gcc-14.1.0.tar.xz 92265736 BLAKE2B 7efd6574b8bca081de6e31480ec0565c6d7fb773383e8e1fdcc17e35bba2bf44b3f4f995cdbcccd001689926e96a6563ef3d099902fe3b37ab09dcf553ab0596 SHA512 e9e224f2b26646fcf038d28dfa08b94c623bc57941f99894a321d01c600f7c68aff6b8837fd25e73e540de1f8de5606e98694a62cdcdfb525ce768b3ef6879ea
 DIST mingw-w64-v11.0.0.tar.bz2 10058657 BLAKE2B 3f7637bcc7c3f25b2141d35105ea086eab74e228d7275725ffb4f07e283fd75169dbe0900a9c29494fba9ddb2ea03bdd6ae26f06048311e9c93ae3e317c4c060 SHA512 bc1c9fd9d8593ead9375fcbe40950f06cf7616b94dc676db2793ac9b496fe3a6cc94b5793effda3b752942be0d7d01a1c37a8f221aaf178df0d4eeb0aa6d1f8d
-DIST mingw-w64-v11.0.1.tar.bz2 10057401 BLAKE2B 3222eed35522bf95a571b11dc52ea23153068b32497676dbb2837306ba52a78e6d1c9c44a4d64d314e64583b54f6fe86dcff3e467e101acf71cebb7d2a963963 SHA512 568702100bbbb11f7f9c9596dd70df3fb2577492459cf55da38691af1504b91127cb5f3eff268850dcbaa461fdc72e4e2379f7a576fd4a0e537ee1fe42531c01
 DIST mingw-w64-v12.0.0.tar.bz2 10474283 BLAKE2B 6500045f7d77f7de01dea0f4e03f3e4ddf6154586c5e3ee9718ee2c7ef1cc83ce3cbd644b6f1dc293ae6e0bfb55a6b68d439622bd1cfdefefc4cc547317f1943 SHA512 949b2bfab8763ab10ec4e9fdfdaf5361517a4ab787fb98ab419b38d02694061c2e821ebbf6e2e4b39d92bdf17419d116daa8e63afd9e01d11592f39df4da69d7

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1-r1.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1-r1.ebuild
deleted file mode 100644
index 547dc68de3e9..000000000000
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1-r1.ebuild
+++ /dev/null
@@ -1,371 +0,0 @@
-# Copyright 2022-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-MULTILIB_COMPAT=( abi_x86_{32,64} )
-inherit edo flag-o-matic multilib-build toolchain-funcs
-
-# Pick versions known to work for wine+dxvk, and avoid too frequent updates
-# due to slow rebuilds. Do _p1++ rather than revbump on changes (not using
-# Gentoo patchsets for simplicity, their changes are mostly unneeded here).
-BINUTILS_PV=2.42
-GCC_PV=14.1.0
-MINGW_PV=$(ver_cut 1-3)
-
-DESCRIPTION="All-in-one mingw64 toolchain intended for building Wine without crossdev"
-HOMEPAGE="
-	https://www.mingw-w64.org/
-	https://gcc.gnu.org/
-	https://sourceware.org/binutils/
-"
-SRC_URI="
-	https://downloads.sourceforge.net/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${MINGW_PV}.tar.bz2
-	mirror://gnu/binutils/binutils-${BINUTILS_PV}.tar.xz
-"
-if [[ ${GCC_PV} == *-* ]]; then
-	SRC_URI+=" mirror://gcc/snapshots/${GCC_PV}/gcc-${GCC_PV}.tar.xz"
-else
-	SRC_URI+="
-		mirror://gcc/gcc-${GCC_PV}/gcc-${GCC_PV}.tar.xz
-		mirror://gnu/gcc/gcc-${GCC_PV}/gcc-${GCC_PV}.tar.xz
-	"
-fi
-S="${WORKDIR}"
-
-# l1:binutils+gcc, l2:gcc(libraries), l3:mingw64-runtime
-LICENSE="
-	GPL-3+
-	LGPL-3+ || ( GPL-3+ libgcc libstdc++ gcc-runtime-library-exception-3.1 )
-	ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain
-"
-SLOT="0"
-KEYWORDS="-* ~amd64 ~x86"
-IUSE="+abi_x86_32 bin-symlinks custom-cflags +strip"
-
-RDEPEND="
-	dev-libs/gmp:=
-	dev-libs/mpc:=
-	dev-libs/mpfr:=
-	sys-libs/zlib:=
-	virtual/libiconv
-	bin-symlinks? (
-		abi_x86_64? (
-			!cross-x86_64-w64-mingw32/binutils
-			!cross-x86_64-w64-mingw32/gcc
-		)
-		abi_x86_32? (
-			!cross-i686-w64-mingw32/binutils
-			!cross-i686-w64-mingw32/gcc
-		)
-	)
-"
-DEPEND="${RDEPEND}"
-
-QA_CONFIG_IMPL_DECL_SKIP=(
-	strerror_r # libstdc++ test using -Wimplicit+error
-)
-
-PATCHES=(
-	"${FILESDIR}"/gcc-12.2.0-drop-cflags-sed.patch
-	"${FILESDIR}"/gcc-14.1.0-no-omit-fp-ice.patch
-)
-
-pkg_pretend() {
-	[[ ${MERGE_TYPE} == binary ]] && return
-
-	tc-is-cross-compiler &&
-		die "cross-compilation of the toolchain itself is unsupported"
-}
-
-src_prepare() {
-	# rename directories to simplify both patching and the ebuild
-	mv binutils{-${BINUTILS_PV},} || die
-	mv gcc{-${GCC_PV},} || die
-	mv mingw-w64-v${MINGW_PV} mingw64 || die
-
-	default
-}
-
-src_compile() {
-	# not great but do everything in src_compile given bootstrapping
-	# process needs to be done in steps of configure+compile+install
-	# (done modular to have most package-specific things in one place)
-
-	CTARGET=$(usex x86 i686 x86_64)-w64-mingw32
-
-	MWT_D=${T}/root # moved to ${D} in src_install
-	local mwtdir=/usr/lib/${PN}
-	local prefix=${EPREFIX}${mwtdir}
-	local sysroot=${MWT_D}${prefix}
-	local -x PATH=${sysroot}/bin:${PATH}
-
-	filter-lto # requires setting up, and may be messy with mingw static libs
-	use custom-cflags || strip-flags # fancy flags are not realistic here
-
-	local multilib=false
-	use abi_x86_32 && use abi_x86_64 && multilib=true
-
-	# global configure flags
-	local conf=(
-		--build=${CBUILD:-${CHOST}}
-		--target=${CTARGET}
-		--{doc,info,man}dir=/.skip # let the real binutils+gcc handle docs
-		MAKEINFO=: #922230
-	)
-
-	# binutils
-	local conf_binutils=(
-		--prefix="${prefix}"
-		--host=${CHOST}
-		--disable-cet
-		--disable-default-execstack
-		--disable-nls
-		--disable-shared
-		--with-system-zlib
-		--without-debuginfod
-		--without-msgpack
-		--without-zstd
-	)
-	mwt-binutils() {
-		# symlink gcc's lto plugin for AR (bug #854516)
-		ln -s ../../libexec/gcc/${CTARGET}/${GCC_PV%%[.-]*}/liblto_plugin.so \
-			"${sysroot}"/lib/bfd-plugins || die
-	}
-
-	# gcc (minimal -- if need more, disable only in stage1 / enable in stage3)
-	local conf_gcc=(
-		--prefix="${prefix}"
-		--host=${CHOST}
-		--disable-bootstrap
-		--disable-cet
-		--disable-gcov #843989
-		--disable-gomp
-		--disable-libquadmath
-		--disable-libsanitizer
-		--disable-libssp
-		--disable-libvtv
-		--disable-shared
-		--disable-werror
-		--with-gcc-major-version-only
-		--with-system-zlib
-		--without-isl
-		--without-zstd
-	)
-	${multilib} || conf_gcc+=( --disable-multilib )
-	# libstdc++ may misdetect sys/sdt.h on systemtap-enabled system and fail
-	# (not passed in conf_gcc above given it is lost in sub-configure calls)
-	local -x glibcxx_cv_sys_sdt_h=no
-
-	local conf_gcc_stage1=(
-		--enable-languages=c
-		--disable-libatomic
-		--with-sysroot="${sysroot}"
-	)
-	local -n conf_gcc_stage2=conf_gcc_stage1
-
-	local conf_gcc_stage3=(
-		--enable-languages=c,c++
-		--enable-threads=posix # needs stage3, and is required for dxvk/vkd3d
-		--with-sysroot="${prefix}"
-		--with-build-sysroot="${sysroot}"
-	)
-
-	# mingw64-runtime (split in several parts, 3 needed for gcc stages)
-	local conf_mingw64=(
-		--prefix="${prefix}"/${CTARGET}
-		--host=${CTARGET}
-		--with-sysroot=no
-		--without-{crt,headers}
-
-		# mingw .dll aren't used by wine and packages wouldn't find them
-		# at runtime, use crossdev if need dll and proper search paths
-		--disable-shared
-	)
-
-	local conf_mingw64_headers=(
-		--enable-idl
-		--with-headers
-	)
-	mwt-mingw64_headers() { ln -s ${CTARGET} "${sysroot}"/mingw || die; } #419601
-
-	local conf_mingw64_runtime=( --with-crt )
-	${multilib} ||
-		conf_mingw64_runtime+=( $(usex x86 --disable-lib64 --disable-lib32 ) )
-
-	local conf_mingw64_libraries=( --with-libraries )
-	local conf_mingw64_libraries32=(
-		--libdir="${prefix}"/${CTARGET}/lib32
-		--with-libraries
-		CC="${CTARGET}-gcc -m32"
-		RCFLAGS="--target=pe-i386 ${RCFLAGS}"
-	)
-
-	# mingw64-runtime's idl compiler (useful not to depend on wine for widl)
-	local conf_widl=( --prefix="${prefix}" )
-
-	# mwt-build [-x] <path/package-name> [stage-name]
-	# -> ./configure && make && make install && mwt-package() && mwt-package_stage()
-	# passes conf, conf_package, and conf_package_stage arrays to configure, and
-	# users can add options through environment with e.g.
-	#	MWT_BINUTILS_CONF="--some-option"
-	#	MWT_GCC_STAGE1_CONF="--some-gcc-stage1-only-option"
-	#	MWT_WIDL_CONF="--some-other-option"
-	#	EXTRA_ECONF="--global-option" (generic naming for if not reading this)
-	mwt-build() {
-		if [[ ${1} == -x ]]; then
-			(
-				# cross-compiling, cleanup and let ./configure handle it
-				unset AR AS CC CPP CXX DLLTOOL LD NM OBJCOPY OBJDUMP RANLIB RC STRIP
-				CHOST=${CTARGET}
-				filter-flags '-fuse-ld=*'
-				filter-flags '-mfunction-return=thunk*' #878849
-
-				# support for stack-protector is still new and experimental
-				# for mingw and issues can also be harder to debug + fix for
-				# upstreams using it, if feeling concerned about security
-				# would advise to either not use wine or at least contain it
-				use custom-cflags || filter-flags '-fstack-protector*' #931512
-
-				# some bashrc-mv users tend to do CFLAGS="${LDFLAGS}" and then
-				# strip-unsupported-flags miss these during compile-only tests
-				# (primarily done for 23.0 profiles' -z, not full coverage)
-				filter-flags '-Wl,-z,*'
-
-				# -mavx with mingw-gcc has a history of obscure issues and
-				# disabling is seen as safer, e.g. `WINEARCH=win32 winecfg`
-				# crashes with -march=skylake >=wine-8.10, similar issues with
-				# znver4: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110273
-				append-flags -mno-avx
-
-				strip-unsupported-flags
-				mwt-build "${@:2}"
-			)
-			return
-		fi
-
-		local id=${1##*/}
-		local build_dir=${WORKDIR}/${1}${2+_${2}}-build
-
-		# econf is not allowed in src_compile and its defaults are
-		# mostly unused here, so use configure directly
-		local conf=( "${WORKDIR}/${1}"/configure "${conf[@]}" )
-
-		local -n conf_id=conf_${id} conf_id2=conf_${id}_${2}
-		[[ ${conf_id@a} == *a* ]] && conf+=( "${conf_id[@]}" )
-		[[ ${2} && ${conf_id2@a} == *a* ]] && conf+=( "${conf_id2[@]}" )
-
-		local -n extra_id=MWT_${id^^}_CONF extra_id2=MWT_${id^^}_${2^^}_CONF
-		conf+=( ${EXTRA_ECONF} ${extra_id} ${2+${extra_id2}} )
-
-		einfo "Building ${id}${2+ ${2}} in ${build_dir} ..."
-
-		mkdir -p "${build_dir}" || die
-		pushd "${build_dir}" >/dev/null || die
-
-		edo "${conf[@]}"
-		emake MAKEINFO=: V=1
-		# -j1 to match bug #906155, other packages may be fragile too
-		emake -j1 MAKEINFO=: V=1 DESTDIR="${MWT_D}" install
-
-		declare -f mwt-${id} >/dev/null && edo mwt-${id}
-		declare -f mwt-${id}_${2} >/dev/null && edo mwt-${id}_${2}
-
-		popd >/dev/null || die
-	}
-
-	# workaround race condition with out-of-source crt build (bug #879537)
-	mkdir -p mingw64_runtime-build/mingw-w64-crt/lib{32,64} || die
-
-	# build with same ordering that crossdev would do + stage3 for pthreads
-	mwt-build binutils
-	mwt-build mingw64 headers
-	mwt-build gcc stage1
-	mwt-build -x mingw64 runtime
-	mwt-build gcc stage2
-	${multilib} && mwt-build -x mingw64 libraries32
-	mwt-build -x mingw64 libraries
-	mwt-build gcc stage3
-	mwt-build mingw64/mingw-w64-tools/widl
-	# note: /could/ system-bootstrap if already installed, but gcc and
-	# libraries will use the system's older mingw64 headers/static-libs
-	# and make this potentially fragile without more workarounds/stages
-
-	if ${multilib}; then
-		# Like system's gcc, `x86_64-w64-mingw32-gcc -m32` can build for x86,
-		# but packages expect crossdev's i686-w64-mingw32-gcc which is the same
-		# just without 64bit support and would rather not build the toolchain
-		# twice. Dirty but wrap to allow simple interoperability with crossdev.
-		mwt-i686_wrapper() {
-			printf "#!/usr/bin/env sh\nexec \"${prefix}/bin/${bin}\" ${*} "'"${@}"\n' \
-				> ${bin32} || die
-			chmod +x ${bin32} || die
-		}
-		pushd "${sysroot}"/bin >/dev/null || die
-		local bin bin32
-		for bin in ${CTARGET}-*; do
-			bin32=${bin/x86_64-w64/i686-w64}
-			case ${bin#${CTARGET}-} in
-				as) mwt-i686_wrapper --32;;
-				cpp|gcc|gcc-${GCC_PV%%[.-]*}|g++|widl) mwt-i686_wrapper -m32;;
-				ld|ld.bfd) mwt-i686_wrapper -m i386pe;;
-				windres) mwt-i686_wrapper --target=pe-i386;;
-				*) ln -s ${bin} ${bin32} || die;;
-			esac
-		done
-		popd >/dev/null || die
-	fi
-
-	if use bin-symlinks; then
-		mkdir -p -- "${MWT_D}${EPREFIX}"/usr/bin/ || die
-		local bin
-		for bin in "${sysroot}"/bin/*; do
-			ln -rs -- "${bin}" "${MWT_D}${EPREFIX}"/usr/bin/ || die
-		done
-	fi
-
-	# portage doesn't know the right strip executable to use for CTARGET
-	# and it can lead to .a mangling, notably with 32bit (breaks toolchain)
-	dostrip -x ${mwtdir}/{${CTARGET}/lib{,32},lib/gcc/${CTARGET}}
-
-	# ... and instead do it here given this saves ~60MB
-	if use strip; then
-		einfo "Stripping ${CTARGET} static libraries ..."
-		find "${sysroot}"/{,lib/gcc/}${CTARGET} -type f -name '*.a' \
-			-exec ${CTARGET}-strip --strip-unneeded {} + || die
-	fi
-}
-
-src_install() {
-	mv -- "${MWT_D}${EPREFIX}"/* "${ED}" || die
-
-	find "${ED}" -type f -name '*.la' -delete || die
-}
-
-pkg_postinst() {
-	use bin-symlinks && has_version dev-util/shadowman && [[ ! ${ROOT} ]] &&
-		eselect compiler-shadow update all
-
-	if [[ ! ${REPLACING_VERSIONS} ]]; then
-		elog "Note that this package is primarily intended for Wine and related"
-		elog "packages to depend on without needing a manual crossdev setup."
-		elog
-		elog "Settings are oriented only for what these need and simplicity."
-		elog "Use sys-devel/crossdev if need full toolchain/customization:"
-		elog "    https://wiki.gentoo.org/wiki/Mingw"
-		elog "    https://wiki.gentoo.org/wiki/Crossdev"
-	fi
-
-	local cross_gcc=cross-$(usex x86 i686 x86_64)-w64-mingw32/gcc
-	if has_version ${cross_gcc}; then
-		# encourage cleanup given users may not realize if switch by default
-		ewarn "${cross_gcc} is installed, note that ${PN}"
-		ewarn "is redundant with the *-w64-mingw32/{binutils,gcc,mingw64-runtime}"
-		ewarn "packages and optionally only one needs to be kept."
-	fi
-}
-
-pkg_postrm() {
-	use bin-symlinks && has_version dev-util/shadowman && [[ ! ${ROOT} ]] &&
-		eselect compiler-shadow clean all
-}


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2024-07-02 21:09 Jakov Smolić
  0 siblings, 0 replies; 54+ messages in thread
From: Jakov Smolić @ 2024-07-02 21:09 UTC (permalink / raw
  To: gentoo-commits

commit:     aad2e1fb05cfca3da2e52b68b50cedc31642edd4
Author:     Jakov Smolić <jsmolic <AT> gentoo <DOT> org>
AuthorDate: Tue Jul  2 21:09:12 2024 +0000
Commit:     Jakov Smolić <jsmolic <AT> gentoo <DOT> org>
CommitDate: Tue Jul  2 21:09:12 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aad2e1fb

dev-util/mingw64-toolchain: Stabilize 12.0.0 amd64, #935355

Signed-off-by: Jakov Smolić <jsmolic <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-12.0.0.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-12.0.0.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-12.0.0.ebuild
index 299f57892c6e..01bd0b713830 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-12.0.0.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-12.0.0.ebuild
@@ -40,7 +40,7 @@ LICENSE="
 	ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain
 "
 SLOT="0"
-KEYWORDS="-* ~amd64 ~x86"
+KEYWORDS="-* amd64 ~x86"
 IUSE="+abi_x86_32 bin-symlinks custom-cflags +strip"
 
 RDEPEND="


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2024-07-02 21:09 Jakov Smolić
  0 siblings, 0 replies; 54+ messages in thread
From: Jakov Smolić @ 2024-07-02 21:09 UTC (permalink / raw
  To: gentoo-commits

commit:     502bd9ddb4f6d81c3202ccfcdba0331ac630d232
Author:     Jakov Smolić <jsmolic <AT> gentoo <DOT> org>
AuthorDate: Tue Jul  2 21:09:18 2024 +0000
Commit:     Jakov Smolić <jsmolic <AT> gentoo <DOT> org>
CommitDate: Tue Jul  2 21:09:18 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=502bd9dd

dev-util/mingw64-toolchain: Stabilize 12.0.0 x86, #935355

Signed-off-by: Jakov Smolić <jsmolic <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-12.0.0.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-12.0.0.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-12.0.0.ebuild
index 01bd0b713830..ee5e4abfb62e 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-12.0.0.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-12.0.0.ebuild
@@ -40,7 +40,7 @@ LICENSE="
 	ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain
 "
 SLOT="0"
-KEYWORDS="-* amd64 ~x86"
+KEYWORDS="-* amd64 x86"
 IUSE="+abi_x86_32 bin-symlinks custom-cflags +strip"
 
 RDEPEND="


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/
@ 2024-09-03 12:31 Ionen Wolkens
  0 siblings, 0 replies; 54+ messages in thread
From: Ionen Wolkens @ 2024-09-03 12:31 UTC (permalink / raw
  To: gentoo-commits

commit:     28f62579b520ad4b852022ad8a2cd8ad5d49d9fd
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Tue Sep  3 11:04:46 2024 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Tue Sep  3 11:51:17 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=28f62579

dev-util/mingw64-toolchain: drop 11.0.0_p2

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/Manifest                |   3 -
 .../mingw64-toolchain-11.0.0_p2.ebuild             | 345 ---------------------
 2 files changed, 348 deletions(-)

diff --git a/dev-util/mingw64-toolchain/Manifest b/dev-util/mingw64-toolchain/Manifest
index d33cfbe97b77..82ac375ad0f5 100644
--- a/dev-util/mingw64-toolchain/Manifest
+++ b/dev-util/mingw64-toolchain/Manifest
@@ -1,6 +1,3 @@
-DIST binutils-2.41.tar.xz 26765692 BLAKE2B 3bccec2b52f7e82a727121bf2a2e51a6249ba63dcd74c665fd834e858645c912ffd8245d848435288b938852830b482905606f55c40df4061215fd75c52ffc75 SHA512 5df45d0bd6ddabdce4f35878c041e46a92deef01e7dea5facc97fd65cc06b59abc6fba0eb454b68e571c7e14038dc823fe7f2263843e6e627b7444eaf0fe9374
 DIST binutils-2.42.tar.xz 27567160 BLAKE2B e67a5c028fba70e70088fd11b38ec8c9c4ed5a019badefda25abeb6275997b16f0891e7ff3424c4b82bbfae92e8992669826920dd53df61cd48469d8f7cd5bd1 SHA512 155f3ba14cd220102f4f29a4f1e5cfee3c48aa03b74603460d05afb73c70d6657a9d87eee6eb88bf13203fe6f31177a5c9addc04384e956e7da8069c8ecd20a6
-DIST gcc-13.2.0.tar.xz 87858592 BLAKE2B 0034b29d3d6cc05821f0c4253ce077805943aff7b370729dd203bda57d89c107edd657eeddc2fb1e69ea15c7b0323b961f46516c7f4af89a3ccf7fea84701be2 SHA512 d99e4826a70db04504467e349e9fbaedaa5870766cda7c5cab50cdebedc4be755ebca5b789e1232a34a20be1a0b60097de9280efe47bdb71c73251e30b0862a2
 DIST gcc-14.1.0.tar.xz 92265736 BLAKE2B 7efd6574b8bca081de6e31480ec0565c6d7fb773383e8e1fdcc17e35bba2bf44b3f4f995cdbcccd001689926e96a6563ef3d099902fe3b37ab09dcf553ab0596 SHA512 e9e224f2b26646fcf038d28dfa08b94c623bc57941f99894a321d01c600f7c68aff6b8837fd25e73e540de1f8de5606e98694a62cdcdfb525ce768b3ef6879ea
-DIST mingw-w64-v11.0.0.tar.bz2 10058657 BLAKE2B 3f7637bcc7c3f25b2141d35105ea086eab74e228d7275725ffb4f07e283fd75169dbe0900a9c29494fba9ddb2ea03bdd6ae26f06048311e9c93ae3e317c4c060 SHA512 bc1c9fd9d8593ead9375fcbe40950f06cf7616b94dc676db2793ac9b496fe3a6cc94b5793effda3b752942be0d7d01a1c37a8f221aaf178df0d4eeb0aa6d1f8d
 DIST mingw-w64-v12.0.0.tar.bz2 10474283 BLAKE2B 6500045f7d77f7de01dea0f4e03f3e4ddf6154586c5e3ee9718ee2c7ef1cc83ce3cbd644b6f1dc293ae6e0bfb55a6b68d439622bd1cfdefefc4cc547317f1943 SHA512 949b2bfab8763ab10ec4e9fdfdaf5361517a4ab787fb98ab419b38d02694061c2e821ebbf6e2e4b39d92bdf17419d116daa8e63afd9e01d11592f39df4da69d7

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild
deleted file mode 100644
index 1e512377b27b..000000000000
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0_p2.ebuild
+++ /dev/null
@@ -1,345 +0,0 @@
-# Copyright 2022-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-MULTILIB_COMPAT=( abi_x86_{32,64} )
-inherit edo flag-o-matic multilib-build toolchain-funcs
-
-# Pick versions known to work for wine+dxvk, and avoid too frequent updates
-# due to slow rebuilds. Do _p1++ rather than revbump on changes (not using
-# Gentoo patchsets for simplicity, their changes are mostly unneeded here).
-BINUTILS_PV=2.41
-GCC_PV=13.2.0
-MINGW_PV=$(ver_cut 1-3)
-
-DESCRIPTION="All-in-one mingw64 toolchain intended for building Wine without crossdev"
-HOMEPAGE="
-	https://www.mingw-w64.org/
-	https://gcc.gnu.org/
-	https://sourceware.org/binutils/
-"
-SRC_URI="
-	https://downloads.sourceforge.net/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${MINGW_PV}.tar.bz2
-	mirror://gnu/binutils/binutils-${BINUTILS_PV}.tar.xz
-"
-if [[ ${GCC_PV} == *-* ]]; then
-	SRC_URI+=" mirror://gcc/snapshots/${GCC_PV}/gcc-${GCC_PV}.tar.xz"
-else
-	SRC_URI+="
-		mirror://gcc/gcc-${GCC_PV}/gcc-${GCC_PV}.tar.xz
-		mirror://gnu/gcc/gcc-${GCC_PV}/gcc-${GCC_PV}.tar.xz
-	"
-fi
-S="${WORKDIR}"
-
-# l1:binutils+gcc, l2:gcc(libraries), l3:mingw64-runtime
-LICENSE="
-	GPL-3+
-	LGPL-3+ || ( GPL-3+ libgcc libstdc++ gcc-runtime-library-exception-3.1 )
-	ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain
-"
-SLOT="0"
-KEYWORDS="-* amd64 x86"
-IUSE="+abi_x86_32 custom-cflags debug"
-
-RDEPEND="
-	dev-libs/gmp:=
-	dev-libs/mpc:=
-	dev-libs/mpfr:=
-	sys-libs/zlib:=
-	virtual/libiconv
-"
-DEPEND="${RDEPEND}"
-
-QA_CONFIG_IMPL_DECL_SKIP=(
-	strerror_r # libstdc++ test using -Wimplicit+error
-)
-
-PATCHES=(
-	"${FILESDIR}"/gcc-12.2.0-drop-cflags-sed.patch
-	"${FILESDIR}"/gcc-13.2.0-libcxx-17.patch
-)
-
-pkg_pretend() {
-	[[ ${MERGE_TYPE} == binary ]] && return
-
-	tc-is-cross-compiler &&
-		die "cross-compilation of the toolchain itself is unsupported"
-}
-
-src_prepare() {
-	# rename directories to simplify both patching and the ebuild
-	mv binutils{-${BINUTILS_PV},} || die
-	mv gcc{-${GCC_PV},} || die
-	mv mingw-w64-v${MINGW_PV} mingw64 || die
-
-	default
-}
-
-src_compile() {
-	# not great but do everything in src_compile given bootstrapping
-	# process needs to be done in steps of configure+compile+install
-	# (done modular to have most package-specific things in one place)
-
-	CTARGET=$(usex x86 i686 x86_64)-w64-mingw32
-
-	MWT_D=${T}/root # moved to ${D} in src_install
-	local mwtdir=/usr/lib/${PN}
-	local prefix=${EPREFIX}${mwtdir}
-	local sysroot=${MWT_D}${prefix}
-	local -x PATH=${sysroot}/bin:${PATH}
-
-	filter-lto # requires setting up, and may be messy with mingw static libs
-	use custom-cflags || strip-flags # fancy flags are not realistic here
-
-	local multilib=false
-	use abi_x86_32 && use abi_x86_64 && multilib=true
-
-	# global configure flags
-	local conf=(
-		--build=${CBUILD:-${CHOST}}
-		--target=${CTARGET}
-		--{doc,info,man}dir=/.skip # let the real binutils+gcc handle docs
-		MAKEINFO=: #922230
-	)
-
-	# binutils
-	local conf_binutils=(
-		--prefix="${prefix}"
-		--host=${CHOST}
-		--disable-cet
-		--disable-default-execstack
-		--disable-nls
-		--disable-shared
-		--with-system-zlib
-		--without-debuginfod
-		--without-msgpack
-		--without-zstd
-	)
-	mwt-binutils() {
-		# symlink gcc's lto plugin for AR (bug #854516)
-		ln -s ../../libexec/gcc/${CTARGET}/${GCC_PV%%[.-]*}/liblto_plugin.so \
-			"${sysroot}"/lib/bfd-plugins || die
-	}
-
-	# gcc (minimal -- if need more, disable only in stage1 / enable in stage3)
-	local conf_gcc=(
-		--prefix="${prefix}"
-		--host=${CHOST}
-		--disable-bootstrap
-		--disable-cet
-		--disable-gcov #843989
-		--disable-gomp
-		--disable-libquadmath
-		--disable-libsanitizer
-		--disable-libssp
-		--disable-libvtv
-		--disable-shared
-		--disable-werror
-		--with-gcc-major-version-only
-		--with-system-zlib
-		--without-isl
-		--without-zstd
-	)
-	${multilib} || conf_gcc+=( --disable-multilib )
-	# libstdc++ may misdetect sys/sdt.h on systemtap-enabled system and fail
-	# (not passed in conf_gcc above given it is lost in sub-configure calls)
-	local -x glibcxx_cv_sys_sdt_h=no
-
-	local conf_gcc_stage1=(
-		--enable-languages=c
-		--disable-libatomic
-		--with-sysroot="${sysroot}"
-	)
-	local -n conf_gcc_stage2=conf_gcc_stage1
-
-	local conf_gcc_stage3=(
-		--enable-languages=c,c++
-		--enable-threads=posix # needs stage3, and is required for dxvk/vkd3d
-		--with-sysroot="${prefix}"
-		--with-build-sysroot="${sysroot}"
-	)
-
-	# mingw64-runtime (split in several parts, 3 needed for gcc stages)
-	local conf_mingw64=(
-		--prefix="${prefix}"/${CTARGET}
-		--host=${CTARGET}
-		--with-sysroot=no
-		--without-{crt,headers}
-
-		# mingw .dll aren't used by wine and packages wouldn't find them
-		# at runtime, use crossdev if need dll and proper search paths
-		--disable-shared
-	)
-
-	local conf_mingw64_headers=(
-		--enable-idl
-		--with-headers
-	)
-	mwt-mingw64_headers() { ln -s ${CTARGET} "${sysroot}"/mingw || die; } #419601
-
-	local conf_mingw64_runtime=( --with-crt )
-	${multilib} ||
-		conf_mingw64_runtime+=( $(usex x86 --disable-lib64 --disable-lib32 ) )
-
-	local conf_mingw64_libraries=( --with-libraries )
-	local conf_mingw64_libraries32=(
-		--libdir="${prefix}"/${CTARGET}/lib32
-		--with-libraries
-		CC="${CTARGET}-gcc -m32"
-		RCFLAGS="--target=pe-i386 ${RCFLAGS}"
-	)
-
-	# mingw64-runtime's idl compiler (useful not to depend on wine for widl)
-	local conf_widl=( --prefix="${prefix}" )
-
-	# mwt-build [-x] <path/package-name> [stage-name]
-	# -> ./configure && make && make install && mwt-package() && mwt-package_stage()
-	# passes conf, conf_package, and conf_package_stage arrays to configure, and
-	# users can add options through environment with e.g.
-	#	MWT_BINUTILS_CONF="--some-option"
-	#	MWT_GCC_STAGE1_CONF="--some-gcc-stage1-only-option"
-	#	MWT_WIDL_CONF="--some-other-option"
-	#	EXTRA_ECONF="--global-option" (generic naming for if not reading this)
-	mwt-build() {
-		if [[ ${1} == -x ]]; then
-			(
-				# cross-compiling, cleanup and let ./configure handle it
-				unset AR AS CC CPP CXX DLLTOOL LD NM OBJCOPY OBJDUMP RANLIB RC STRIP
-				CHOST=${CTARGET}
-				filter-flags '-fuse-ld=*'
-				filter-flags '-mfunction-return=thunk*' #878849
-
-				# support for stack-protector is still new and experimental
-				# for mingw and issues can also be harder to debug + fix for
-				# upstreams using it, if feeling concerned about security
-				# would advise to either not use wine or at least contain it
-				use custom-cflags || filter-flags '-fstack-protector*' #931512
-
-				# some bashrc-mv users tend to do CFLAGS="${LDFLAGS}" and then
-				# strip-unsupported-flags miss these during compile-only tests
-				# (primarily done for 23.0 profiles' -z, not full coverage)
-				filter-flags '-Wl,-z,*'
-
-				# -mavx with mingw-gcc has a history of obscure issues and
-				# disabling is seen as safer, e.g. `WINEARCH=win32 winecfg`
-				# crashes with -march=skylake >=wine-8.10, similar issues with
-				# znver4: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110273
-				append-flags -mno-avx
-
-				strip-unsupported-flags
-				mwt-build "${@:2}"
-			)
-			return
-		fi
-
-		local id=${1##*/}
-		local build_dir=${WORKDIR}/${1}${2+_${2}}-build
-
-		# econf is not allowed in src_compile and its defaults are
-		# mostly unused here, so use configure directly
-		local conf=( "${WORKDIR}/${1}"/configure "${conf[@]}" )
-
-		local -n conf_id=conf_${id} conf_id2=conf_${id}_${2}
-		[[ ${conf_id@a} == *a* ]] && conf+=( "${conf_id[@]}" )
-		[[ ${2} && ${conf_id2@a} == *a* ]] && conf+=( "${conf_id2[@]}" )
-
-		local -n extra_id=MWT_${id^^}_CONF extra_id2=MWT_${id^^}_${2^^}_CONF
-		conf+=( ${EXTRA_ECONF} ${extra_id} ${2+${extra_id2}} )
-
-		einfo "Building ${id}${2+ ${2}} in ${build_dir} ..."
-
-		mkdir -p "${build_dir}" || die
-		pushd "${build_dir}" >/dev/null || die
-
-		edo "${conf[@]}"
-		emake MAKEINFO=: V=1
-		# -j1 to match bug #906155, other packages may be fragile too
-		emake -j1 MAKEINFO=: V=1 DESTDIR="${MWT_D}" install
-
-		declare -f mwt-${id} >/dev/null && edo mwt-${id}
-		declare -f mwt-${id}_${2} >/dev/null && edo mwt-${id}_${2}
-
-		popd >/dev/null || die
-	}
-
-	# workaround race condition with out-of-source crt build (bug #879537)
-	mkdir -p mingw64_runtime-build/mingw-w64-crt/lib{32,64} || die
-
-	# build with same ordering that crossdev would do + stage3 for pthreads
-	mwt-build binutils
-	mwt-build mingw64 headers
-	mwt-build gcc stage1
-	mwt-build -x mingw64 runtime
-	mwt-build gcc stage2
-	${multilib} && mwt-build -x mingw64 libraries32
-	mwt-build -x mingw64 libraries
-	mwt-build gcc stage3
-	mwt-build mingw64/mingw-w64-tools/widl
-	# note: /could/ system-bootstrap if already installed, but gcc and
-	# libraries will use the system's older mingw64 headers/static-libs
-	# and make this potentially fragile without more workarounds/stages
-
-	if ${multilib}; then
-		# Like system's gcc, `x86_64-w64-mingw32-gcc -m32` can build for x86,
-		# but packages expect crossdev's i686-w64-mingw32-gcc which is the same
-		# just without 64bit support and would rather not build the toolchain
-		# twice. Dirty but wrap to allow simple interoperability with crossdev.
-		mwt-i686_wrapper() {
-			printf "#!/usr/bin/env sh\nexec \"${prefix}/bin/${bin}\" ${*} "'"${@}"\n' \
-				> ${bin32} || die
-			chmod +x ${bin32} || die
-		}
-		pushd "${sysroot}"/bin >/dev/null || die
-		local bin bin32
-		for bin in ${CTARGET}-*; do
-			bin32=${bin/x86_64-w64/i686-w64}
-			case ${bin#${CTARGET}-} in
-				as) mwt-i686_wrapper --32;;
-				cpp|gcc|gcc-${GCC_PV%%[.-]*}|g++|widl) mwt-i686_wrapper -m32;;
-				ld|ld.bfd) mwt-i686_wrapper -m i386pe;;
-				windres) mwt-i686_wrapper --target=pe-i386;;
-				*) ln -s ${bin} ${bin32} || die;;
-			esac
-		done
-		popd >/dev/null || die
-	fi
-
-	# portage doesn't know the right strip executable to use for CTARGET
-	# and it can lead to .a mangling, notably with 32bit (breaks toolchain)
-	dostrip -x ${mwtdir}/{${CTARGET}/lib{,32},lib/gcc/${CTARGET}}
-
-	# ... and instead do it here given this saves ~60MB
-	if use !debug; then
-		einfo "Stripping ${CTARGET} static libraries ..."
-		find "${sysroot}"/{,lib/gcc/}${CTARGET} -type f -name '*.a' \
-			-exec ${CTARGET}-strip --strip-unneeded {} + || die
-	fi
-}
-
-src_install() {
-	mv "${MWT_D}${EPREFIX}"/* "${ED}" || die
-
-	find "${ED}" -type f -name '*.la' -delete || die
-}
-
-pkg_postinst() {
-	if [[ ! ${REPLACING_VERSIONS} ]]; then
-		elog "Note that this package is primarily intended for Wine and related"
-		elog "packages to depend on without needing a manual crossdev setup."
-		elog
-		elog "Settings are oriented only for what these need and simplicity."
-		elog "Use sys-devel/crossdev if need full toolchain/customization:"
-		elog "    https://wiki.gentoo.org/wiki/Mingw"
-		elog "    https://wiki.gentoo.org/wiki/Crossdev"
-	fi
-
-	local cross_gcc=cross-$(usex x86 i686 x86_64)-w64-mingw32/gcc
-	if has_version ${cross_gcc}; then
-		# encourage cleanup given users may not realize if switch by default
-		ewarn "${cross_gcc} is installed, note that ${PN}"
-		ewarn "is redundant with the *-w64-mingw32/{binutils,gcc,mingw64-runtime}"
-		ewarn "packages and optionally only one needs to be kept."
-	fi
-}


^ permalink raw reply related	[flat|nested] 54+ messages in thread

end of thread, other threads:[~2024-09-03 12:31 UTC | newest]

Thread overview: 54+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-22 14:27 [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-toolchain/ Ionen Wolkens
  -- strict thread matches above, loose matches on Subject: below --
2024-09-03 12:31 Ionen Wolkens
2024-07-02 21:09 Jakov Smolić
2024-07-02 21:09 Jakov Smolić
2024-06-06 13:20 Ionen Wolkens
2024-06-02  3:54 Ionen Wolkens
2024-05-30  6:39 Ionen Wolkens
2024-05-22  3:32 Ionen Wolkens
2024-05-21  3:01 Ionen Wolkens
2024-05-10 10:12 Ionen Wolkens
2024-05-10  3:03 Ionen Wolkens
2024-05-07 17:49 Ionen Wolkens
2024-05-07 14:28 Ionen Wolkens
2024-05-07 14:28 Ionen Wolkens
2024-03-24 18:39 Ionen Wolkens
2024-01-16 17:52 Ionen Wolkens
2023-12-22 17:38 Ionen Wolkens
2023-08-27 17:18 Sam James
2023-08-27  1:28 Sam James
2023-08-04  3:25 Ionen Wolkens
2023-08-04  3:25 Ionen Wolkens
2023-07-30 16:52 Ionen Wolkens
2023-07-28  5:16 Ionen Wolkens
2023-07-03 20:55 Ionen Wolkens
2023-06-26 10:12 Ionen Wolkens
2023-05-29 17:49 Arthur Zamarin
2023-05-29 15:06 Sam James
2023-05-19  1:41 Ionen Wolkens
2023-05-11 17:01 Ionen Wolkens
2023-04-29  9:43 Ionen Wolkens
2023-04-26  8:37 Ionen Wolkens
2023-04-26  8:37 Ionen Wolkens
2023-02-01 21:04 Ionen Wolkens
2023-01-15  7:00 Ionen Wolkens
2022-11-12 11:33 Ionen Wolkens
2022-10-31  0:54 Ionen Wolkens
2022-10-23  7:20 Ionen Wolkens
2022-09-16 16:17 Ionen Wolkens
2022-09-16  7:54 Ionen Wolkens
2022-09-16  7:47 Ionen Wolkens
2022-09-14 23:11 Ionen Wolkens
2022-09-14 21:12 Ionen Wolkens
2022-09-14 19:39 Ionen Wolkens
2022-08-29  6:55 Ionen Wolkens
2022-08-29  6:55 Ionen Wolkens
2022-08-20 13:58 Ionen Wolkens
2022-08-20 13:45 Ionen Wolkens
2022-08-20 13:45 Ionen Wolkens
2022-07-16 17:03 Ionen Wolkens
2022-06-28  5:56 Ionen Wolkens
2022-05-28 19:26 Ionen Wolkens
2022-05-17  6:53 Jakov Smolić
2022-05-17  6:53 Jakov Smolić
2022-05-13  6:53 Ionen Wolkens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox