From: Conrad Meyer Date: Thu, 8 Aug 2019 21:16:36 +0000 (-0700) Subject: Fix the build on GCC 4.x after 812e8f2a1 X-Git-Tag: v1.4.4~2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1713%2Fhead;p=thirdparty%2Fzstd.git Fix the build on GCC 4.x after 812e8f2a1 The ancient GCC 4.x doesn't understand the "optimize" attribute until 4.4. Fix the build on platforms with GCC 4.x < 4.4 by limiting the DONT_VECTORIZE definition to GCC 5 and greater. Noticed and patch proposed by Warner Losh . --- diff --git a/lib/common/compiler.h b/lib/common/compiler.h index 87bf51ae8..d18179582 100644 --- a/lib/common/compiler.h +++ b/lib/common/compiler.h @@ -128,7 +128,7 @@ } /* vectorization */ -#if !defined(__clang__) && defined(__GNUC__) +#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ >= 5 # define DONT_VECTORIZE __attribute__((optimize("no-tree-vectorize"))) #else # define DONT_VECTORIZE