From 6630a0904869f548eabdabefd37acb4b30f79368 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 12 Aug 2012 04:50:17 +0000 Subject: Add fix for building with gcc-4.6 #419627 by Maciej Szmigiero. (Portage version: 2.2.0_alpha120/cvs/Linux x86_64) --- dev-util/mingw-runtime/ChangeLog | 6 ++++- .../files/mingw-runtime-3.18-gcc-4.6.patch | 27 ++++++++++++++++++++++ dev-util/mingw-runtime/mingw-runtime-3.18.ebuild | 5 ++-- 3 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 dev-util/mingw-runtime/files/mingw-runtime-3.18-gcc-4.6.patch (limited to 'dev-util/mingw-runtime') diff --git a/dev-util/mingw-runtime/ChangeLog b/dev-util/mingw-runtime/ChangeLog index 7dd7113d6bf4..a329ebb1057d 100644 --- a/dev-util/mingw-runtime/ChangeLog +++ b/dev-util/mingw-runtime/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for dev-util/mingw-runtime # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-util/mingw-runtime/ChangeLog,v 1.24 2012/08/12 04:49:07 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-util/mingw-runtime/ChangeLog,v 1.25 2012/08/12 04:50:17 vapier Exp $ + + 12 Aug 2012; Mike Frysinger + +files/mingw-runtime-3.18-gcc-4.6.patch, mingw-runtime-3.18.ebuild: + Add fix for building with gcc-4.6 #419627 by Maciej Szmigiero. 12 Aug 2012; Mike Frysinger mingw-runtime-3.20.ebuild, +files/mingw-runtime-3.20-LDBL_MIN_EXP.patch: diff --git a/dev-util/mingw-runtime/files/mingw-runtime-3.18-gcc-4.6.patch b/dev-util/mingw-runtime/files/mingw-runtime-3.18-gcc-4.6.patch new file mode 100644 index 000000000000..8b2418178857 --- /dev/null +++ b/dev-util/mingw-runtime/files/mingw-runtime-3.18-gcc-4.6.patch @@ -0,0 +1,27 @@ +http://sourceforge.net/tracker/?func=detail&aid=3446009&group_id=2435&atid=302435 +https://bugs.gentoo.org/419627 + +--- a/tlssup.c ++++ b/tlssup.c +@@ -84,6 +84,7 @@ BOOL WINAPI + __dyn_tls_init (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved) + { + _PVFV *pfunc; ++ int nfuncs, ifunc; + + /* We don't let us trick here. */ + if (_CRT_MT != 2) +@@ -96,8 +97,12 @@ __dyn_tls_init (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved) + return TRUE; + } + +- for (pfunc = &__xd_a + 1; pfunc != &__xd_z; ++pfunc) ++ /* Use the nfuncs variable to iterate the TLS functions instead of pfunc to ++ avoid nasty compiler optimizations when comparing two global pointers. */ ++ nfuncs = &__xd_z - (&__xd_a + 1); ++ for (ifunc=0; ifunc < nfuncs; ++ifunc) + { ++ pfunc = (&__xd_a + 1) + ifunc; + if (*pfunc != NULL) + (*pfunc)(); + } diff --git a/dev-util/mingw-runtime/mingw-runtime-3.18.ebuild b/dev-util/mingw-runtime/mingw-runtime-3.18.ebuild index ca291a921c0f..f9423aa21144 100644 --- a/dev-util/mingw-runtime/mingw-runtime-3.18.ebuild +++ b/dev-util/mingw-runtime/mingw-runtime-3.18.ebuild @@ -1,6 +1,6 @@ -# Copyright 1999-2010 Gentoo Foundation +# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-util/mingw-runtime/mingw-runtime-3.18.ebuild,v 1.2 2010/09/22 22:22:49 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-util/mingw-runtime/mingw-runtime-3.18.ebuild,v 1.3 2012/08/12 04:50:17 vapier Exp $ export CBUILD=${CBUILD:-${CHOST}} export CTARGET=${CTARGET:-${CHOST}} @@ -41,6 +41,7 @@ pkg_setup() { src_unpack() { unpack ${A} cd "${S}" + epatch "${FILESDIR}"/${P}-gcc-4.6.patch #419627 sed -i \ -e "/W32API_INCLUDE/s:=.*:='-I /usr/${CTARGET}/usr/include':" \ $(find -name configure) || die -- cgit v1.2.3-65-gdbad