From 546f81e0f943022e27b4aeaea3edd7bc8549093d Mon Sep 17 00:00:00 2001 From: makise-homura Date: Wed, 21 Mar 2018 16:42:15 +0300 Subject: [PATCH] Fixed lchmod detection for lcc C/C++ compilers --- mesonbuild/compilers/c.py | 8 ++++++++ mesonbuild/compilers/cpp.py | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index be8bb5285..47acdd994 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -903,6 +903,14 @@ class ElbrusCCompiler(GnuCCompiler, ElbrusCompiler): 'none')} return opts + # Elbrus C compiler does not have lchmod, but there is only linker warning, not compiler error. + # So we should explicitly fail at this case. + def has_function(self, funcname, prefix, env, extra_args=None, dependencies=None): + if funcname == 'lchmod': + return False + else: + return super().has_function(funcname, prefix, env, extra_args, dependencies) + class IntelCCompiler(IntelCompiler, CCompiler): def __init__(self, exelist, version, icc_type, is_cross, exe_wrapper=None, **kwargs): diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py index 394c961ba..d2d25851f 100644 --- a/mesonbuild/compilers/cpp.py +++ b/mesonbuild/compilers/cpp.py @@ -148,6 +148,14 @@ class ElbrusCPPCompiler(GnuCPPCompiler, ElbrusCompiler): 'none') return opts + # Elbrus C++ compiler does not have lchmod, but there is only linker warning, not compiler error. + # So we should explicitly fail at this case. + def has_function(self, funcname, prefix, env, extra_args=None, dependencies=None): + if funcname == 'lchmod': + return False + else: + return super().has_function(funcname, prefix, env, extra_args, dependencies) + class IntelCPPCompiler(IntelCompiler, CPPCompiler): def __init__(self, exelist, version, icc_type, is_cross, exe_wrap, **kwargs):