Python: fix build with AOCC compiler (#28708)

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
This commit is contained in:
AMD Toolchain Support 2022-04-11 14:20:29 +05:30 committed by GitHub
parent 714573cdbc
commit ae76834f3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -270,9 +270,7 @@ class Python(Package):
)
conflicts('+tix', when='~tkinter',
msg='python+tix requires python+tix+tkinter')
conflicts('%nvhpc')
conflicts('@:2.7', when='platform=darwin target=aarch64:',
msg='Python 2.7 is too old for Apple Silicon')
@ -455,6 +453,13 @@ def flag_handler(self, name, flags):
if name == 'cflags':
flags.append('-fwrapv')
# Fix for following issues for python with aocc%3.2.0:
# https://github.com/spack/spack/issues/29115
# https://github.com/spack/spack/pull/28708
if self.spec.satisfies('%aocc@3.2.0', strict=True):
if name == 'cflags':
flags.extend(['-mllvm', '-disable-indvar-simplify=true'])
# allow flags to be passed through compiler wrapper
return (flags, None, None)