From 4ac51b2127cc2f94f8e2526a364c63025397dd14 Mon Sep 17 00:00:00 2001 From: Sergey Kosukhin Date: Fri, 22 Mar 2024 02:43:30 +0200 Subject: [PATCH] libiconv: fix building with nvhpc (#43033) --- var/spack/repos/builtin/packages/libiconv/package.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/var/spack/repos/builtin/packages/libiconv/package.py b/var/spack/repos/builtin/packages/libiconv/package.py index efe9584a828..2be3db5a803 100644 --- a/var/spack/repos/builtin/packages/libiconv/package.py +++ b/var/spack/repos/builtin/packages/libiconv/package.py @@ -41,6 +41,17 @@ def configure_args(self): args += self.enable_or_disable("libs") args.append("--with-pic") + # Starting version 1.17, libiconv uses the version of gnulib that implements a + # configure-time check for C compiler flags that enables/disables certain warning + # (see https://git.savannah.gnu.org/gitweb/?p=gnulib.git;h=0c8a563f6). Unfortunately, the + # check does not work for compilers that inject extra symbols into the translation unit + # during the preprocessing step. For example, NVHPC injects the definition of the + # __va_list_tag structure, which appears verbatim on the compilation command line as + # additional compiler flags. The easiest way to circumvent the issue is to make the + # configure script believe that the compiler does not support a flag that allows warnings: + if self.spec.satisfies("@1.17:%nvhpc"): + args.append("gl_cv_cc_wallow=none") + # A hack to patch config.guess in the libcharset sub directory copy("./build-aux/config.guess", "libcharset/build-aux/config.guess") return args