From 68ad4caf30b0c213c1f00d23a1b3ea375d265644 Mon Sep 17 00:00:00 2001 From: Hironori-Yamaji <52182908+Hironori-Yamaji@users.noreply.github.com> Date: Tue, 16 Jul 2019 00:50:26 +0900 Subject: [PATCH] binutils: added '-Wno-narrowing' to CXXFLAGS when using fj compiler via flag_handler (#11922) FJ compiler fails for older versions w/o '-Wno-narrowing' flag. --- var/spack/repos/builtin/packages/binutils/package.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/var/spack/repos/builtin/packages/binutils/package.py b/var/spack/repos/builtin/packages/binutils/package.py index ca90f629e9..8533358020 100644 --- a/var/spack/repos/builtin/packages/binutils/package.py +++ b/var/spack/repos/builtin/packages/binutils/package.py @@ -91,3 +91,11 @@ def install_headers(self): for current_file in glob.glob(join_path(self.build_directory, 'bfd', '*.h')): install(current_file, extradir) + + def flag_handler(self, name, flags): + # To ignore the errors of narrowing conversions for + # the Fujitsu compiler + if name == 'cxxflags' and self.compiler.name == 'fj'\ + and self.version <= ver('2.31.1'): + flags.append('-Wno-narrowing') + return (flags, None, None)