py-tensorflow: fix linking with ubuntu's gcc (#45437)
gcc on ubuntu has fix-cortex-a53-843419 set by default - this causes linking issues (symbol relocation errors) for tf, even when compiling for different cpus.
This commit is contained in:
parent
a342da5642
commit
fd087107ea
@ -452,6 +452,22 @@ class PyTensorflow(Package, CudaPackage, ROCmPackage, PythonExtension):
|
|||||||
)
|
)
|
||||||
phases = ["configure", "build", "install"]
|
phases = ["configure", "build", "install"]
|
||||||
|
|
||||||
|
def flag_handler(self, name, flags):
|
||||||
|
spec = self.spec
|
||||||
|
# ubuntu gcc has this workaround turned on by default in aarch64
|
||||||
|
# and it causes issues with symbol relocation during link
|
||||||
|
# note, archspec doesn't currently ever report cortex_a53!
|
||||||
|
if (
|
||||||
|
name == "ldflags"
|
||||||
|
and spec.target.family == "aarch64"
|
||||||
|
and "ubuntu" in spec.os
|
||||||
|
and spec.compiler.name == "gcc"
|
||||||
|
and "cortex_a53" not in spec.target.name
|
||||||
|
):
|
||||||
|
flags.append("-mno-fix-cortex-a53-843419")
|
||||||
|
|
||||||
|
return (flags, None, None)
|
||||||
|
|
||||||
# https://www.tensorflow.org/install/source
|
# https://www.tensorflow.org/install/source
|
||||||
def setup_build_environment(self, env):
|
def setup_build_environment(self, env):
|
||||||
spec = self.spec
|
spec = self.spec
|
||||||
|
Loading…
Reference in New Issue
Block a user