app-emulation/wine: Check and warn about GCC-5.3 compile bug. #574044
authorNP-Hardass <NP-Hardass@gentoo.org>
Sat, 12 Mar 2016 21:09:22 +0000 (16:09 -0500)
committerNP-Hardass <NP-Hardass@gentoo.org>
Sat, 12 Mar 2016 21:10:00 +0000 (16:10 -0500)
Package-Manager: portage-2.2.26

app-emulation/wine/files/pr69140.c [new file with mode: 0644]
app-emulation/wine/wine-1.9.4.ebuild
app-emulation/wine/wine-1.9.5.ebuild
app-emulation/wine/wine-9999.ebuild

diff --git a/app-emulation/wine/files/pr69140.c b/app-emulation/wine/files/pr69140.c
new file mode 100644 (file)
index 0000000..2c345dd
--- /dev/null
@@ -0,0 +1,24 @@
+/* { dg-do compile { target lp64 } } */
+/* { dg-options "-O2 -mincoming-stack-boundary=3" } */
+
+typedef struct {
+  unsigned int buf[4];
+  unsigned char in[64];
+} MD4_CTX;
+
+static void
+MD4Transform (unsigned int buf[4], const unsigned int in[16])
+{
+  unsigned int a, b, c, d;
+  (b) += ((((c)) & ((d))) | ((~(c)) & ((a)))) + (in[7]);
+  (a) += ((((b)) & ((c))) | ((~(b)) & ((d)))) + (in[8]);
+  (d) += ((((a)) & ((b))) | ((~(a)) & ((c)))) + (in[9]);
+  buf[3] += d;
+}
+
+void __attribute__((ms_abi))
+MD4Update (MD4_CTX *ctx, const unsigned char *buf)
+{
+  MD4Transform( ctx->buf, (unsigned int *)ctx->in);
+  MD4Transform( ctx->buf, (unsigned int *)ctx->in);
+}
index 6388a5b6d1cbe06ea4778dcc39bd1873345679c2..e47fe62c743217a63c776275f650eef9f570d790 100644 (file)
@@ -174,6 +174,20 @@ wine_build_environment_check() {
                        return 1
                fi
        fi
+       # bug #574044
+       if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
+               einfo "Checking for gcc-5-3 stack realignment compiler bug ..."
+               $(tc-getCC) -O2 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 || die
+               # Run in subshell to prevent "Aborted" message
+               if ! ( "${T}"/69140 || false ) >/dev/null 2>&1; then
+                       eerror "Wine cannot be built with this version of gcc-5.3"
+                       eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
+                       eerror "or use gcc-config to select a different compiler version."
+                       eerror "See https://bugs.gentoo.org/574044"
+                       eerror
+                       return 1
+               fi
+       fi
 
        if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
                eerror "You need gcc-4.4+ to build 64-bit wine"
index 2c75d7b611909b8db69b379e8f5da9b60b66ed98..5abc38030ec9e8244944c8fbb6d0fa8139c9d2d7 100644 (file)
@@ -174,6 +174,20 @@ wine_build_environment_check() {
                        return 1
                fi
        fi
+       # bug #574044
+       if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
+               einfo "Checking for gcc-5-3 stack realignment compiler bug ..."
+               $(tc-getCC) -O2 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 || die
+               # Run in subshell to prevent "Aborted" message
+               if ! ( "${T}"/69140 || false ) >/dev/null 2>&1; then
+                       eerror "Wine cannot be built with this version of gcc-5.3"
+                       eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
+                       eerror "or use gcc-config to select a different compiler version."
+                       eerror "See https://bugs.gentoo.org/574044"
+                       eerror
+                       return 1
+               fi
+       fi
 
        if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
                eerror "You need gcc-4.4+ to build 64-bit wine"
index 2c75d7b611909b8db69b379e8f5da9b60b66ed98..5abc38030ec9e8244944c8fbb6d0fa8139c9d2d7 100644 (file)
@@ -174,6 +174,20 @@ wine_build_environment_check() {
                        return 1
                fi
        fi
+       # bug #574044
+       if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
+               einfo "Checking for gcc-5-3 stack realignment compiler bug ..."
+               $(tc-getCC) -O2 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 || die
+               # Run in subshell to prevent "Aborted" message
+               if ! ( "${T}"/69140 || false ) >/dev/null 2>&1; then
+                       eerror "Wine cannot be built with this version of gcc-5.3"
+                       eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
+                       eerror "or use gcc-config to select a different compiler version."
+                       eerror "See https://bugs.gentoo.org/574044"
+                       eerror
+                       return 1
+               fi
+       fi
 
        if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
                eerror "You need gcc-4.4+ to build 64-bit wine"