From 77c237d21943363ebe17b9fefe5ef1e62fa374a1 Mon Sep 17 00:00:00 2001 From: makise-homura Date: Thu, 30 Sep 2021 21:34:57 +0300 Subject: zstd: Fix incorrect pragma error on LCC compiler LCC (Elbrus C Compiler) doesn't understand some of GCC pragmas, despite of declaring itself GCC-aware. The pragma of subject is the one that forbids vectorizing. Actually, LCC don't vectorize anything unless explicitly said to, so this pragma may be safely omitted and thus not cause an error. This patch does this. --- Utilities/cmzstd/lib/common/compiler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utilities/cmzstd/lib/common/compiler.h b/Utilities/cmzstd/lib/common/compiler.h index 95e9483..1b864ea 100644 --- a/Utilities/cmzstd/lib/common/compiler.h +++ b/Utilities/cmzstd/lib/common/compiler.h @@ -139,7 +139,7 @@ /* vectorization * older GCC (pre gcc-4.3 picked as the cutoff) uses a different syntax */ -#if !defined(__INTEL_COMPILER) && !defined(__clang__) && defined(__GNUC__) +#if !defined(__INTEL_COMPILER) && !defined(__clang__) && !defined(__LCC__) && defined(__GNUC__) # if (__GNUC__ == 4 && __GNUC_MINOR__ > 3) || (__GNUC__ >= 5) # define DONT_VECTORIZE __attribute__((optimize("no-tree-vectorize"))) # else -- cgit v0.12 From d6746fd05c92a8edb94de746846227e6101fc05e Mon Sep 17 00:00:00 2001 From: makise-homura Date: Thu, 30 Sep 2021 21:30:06 +0300 Subject: cmMakefile: Fix compilation on EDG-based compilers such as LCC Compilers based on EDG frontend sometimes throw an internal error while using `this->` at some circumstances. While it is up to be fixed in future versions of front end, this bug still occurs in some modern compilers, such as LCC for Elbrus CPUs, and probably others (maybe ICC). It caused CMake to be unbuildable by these compilers. This patch fixes it. --- Source/cmMakefile.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index a490dac..83984f7 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3982,11 +3982,10 @@ cmValue cmMakefile::GetProperty(const std::string& prop) const if (prop == "TESTS") { std::vector keys; // get list of keys - std::transform(this->Tests.begin(), this->Tests.end(), - std::back_inserter(keys), - [](decltype(this->Tests)::value_type const& pair) { - return pair.first; - }); + const auto* t = this; + std::transform( + t->Tests.begin(), t->Tests.end(), std::back_inserter(keys), + [](decltype(t->Tests)::value_type const& pair) { return pair.first; }); output = cmJoin(keys, ";"); return cmValue(output); } -- cgit v0.12