From 24dd5d12a534c7811e46593ab0aa540601f50046 Mon Sep 17 00:00:00 2001 From: a-saitoh-fj <63334055+a-saitoh-fj@users.noreply.github.com> Date: Thu, 11 Feb 2021 00:58:10 +0900 Subject: [PATCH] py-llvmlite: Changing build options when using the FUJITSU compiler (#21585) --- .../repos/builtin/packages/py-llvmlite/package.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/var/spack/repos/builtin/packages/py-llvmlite/package.py b/var/spack/repos/builtin/packages/py-llvmlite/package.py index 73ec82e924..6d8e8657aa 100644 --- a/var/spack/repos/builtin/packages/py-llvmlite/package.py +++ b/var/spack/repos/builtin/packages/py-llvmlite/package.py @@ -37,6 +37,10 @@ class PyLlvmlite(PythonPackage): depends_on('binutils', type='build') def setup_build_environment(self, env): - # Need to set PIC flag since this is linking statically with LLVM - env.set('CXX_FLTO_FLAGS', '-flto {0}'.format( - self.compiler.cxx_pic_flag)) + if self.spec.satisfies('%fj'): + env.set('CXX_FLTO_FLAGS', '{0}'.format(self.compiler.cxx_pic_flag)) + env.set('LD_FLTO_FLAGS', '-Wl,--exclude-libs=ALL') + else: + # Need to set PIC flag since this is linking statically with LLVM + env.set('CXX_FLTO_FLAGS', '-flto {0}'.format( + self.compiler.cxx_pic_flag))