Python: fix build with Fujitsu compiler (#28744)

This commit is contained in:
Toyohisa Kameyama 2022-02-14 23:06:34 +09:00 committed by GitHub
parent dc57f987a7
commit 5353032eef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 1 deletions

View File

@ -0,0 +1,11 @@
--- spack-src/Lib/distutils/unixccompiler.py.org 2022-01-31 14:42:34.000000000 +0900
+++ spack-src/Lib/distutils/unixccompiler.py 2022-01-31 14:43:19.000000000 +0900
@@ -212,7 +212,7 @@
def _is_gcc(self, compiler_name):
# clang uses same syntax for rpath as gcc
- return any(name in compiler_name for name in ("gcc", "g++", "clang"))
+ return any(name in compiler_name for name in ("gcc", "g++", "clang", "fcc", "FCC"))
def runtime_library_dir_option(self, dir):
# XXX Hackish, at the very least. See Python bug #445902:

View File

@ -224,7 +224,8 @@ class Python(AutotoolsPackage):
# Ensure that distutils chooses correct compiler option for RPATH on fj:
patch('fj-rpath-2.3.patch', when='@2.3:3.0.1 %fj')
patch('fj-rpath-3.1.patch', when='@3.1:3 %fj')
patch('fj-rpath-3.1.patch', when='@3.1:3.9.7,3.10.0 %fj')
patch('fj-rpath-3.9.patch', when='@3.9.8:3.9,3.10.1: %fj')
# Fixes an alignment problem with more aggressive optimization in gcc8
# https://github.com/python/cpython/commit/0b91f8a668201fc58fa732b8acc496caedfdbae0
@ -418,6 +419,11 @@ def setup_build_environment(self, env):
env.unset('PYTHONPATH')
env.unset('PYTHONHOME')
# avoid build error on fugaku
if spec.satisfies('@3.10.0 arch=linux-rhel8-a64fx'):
if spec.satisfies('%gcc') or spec.satisfies('%fj'):
env.unset('LC_ALL')
def flag_handler(self, name, flags):
# python 3.8 requires -fwrapv when compiled with intel
if self.spec.satisfies('@3.8: %intel'):