pmaports/cross/gcc4-armhf/48_all_x86_pr53113_libitm-avx.patch
Daniele Debernardi 7b3702e2dd Add gcc4 and gcc4-armhf packages (!216)
Successfully tested both the gcc4 compiler on x86_64 with a simple
program (fbdebug) and the gcc4-armhf cross-compiler to build a very old
u-boot port for Galaxy Nexus (a MR will follow soon) which failed to
boot with either newer version (6 and 8).

[skip ci]: already went through
2019-02-12 21:03:12 +00:00

28 lines
1 KiB
Diff

libitm checks for AVX support in the assembler and adds -mavx to x86_avx.cc
which defines the needed typedefs. User CFLAGS can override -mavx however,
so also use the fallback typedef if __AVX__ isn't defined.
https://bugs.gentoo.org/417271
http://gcc.gnu.org/PR53113
--- a/libitm/config/x86/x86_avx.cc
+++ b/libitm/config/x86/x86_avx.cc
@@ -29,7 +29,7 @@
extern "C" {
-#ifndef HAVE_AS_AVX
+#if !defined (HAVE_AS_AVX) || !defined(__AVX__)
// If we don't have an AVX capable assembler, we didn't set -mavx on the
// command-line either, which means that libitm.h defined neither this type
// nor the functions in this file. Define the type and unconditionally
@@ -40,7 +40,7 @@ typedef float _ITM_TYPE_M256 __attribute__((vector_size(32), may_alias));
// Re-define the memcpy implementations so that we can frob the
// interface to deal with possibly missing AVX instruction set support.
-#ifdef HAVE_AS_AVX
+#if defined(HAVE_AS_AVX) && defined(__AVX__)
#define RETURN(X) return X
#define STORE(X,Y) X = Y
#define OUTPUT(T) _ITM_TYPE_##T