Remove the dead code in setup.py (#160515)

The following line has no effect.

34ec5ed275/setup.py (L1205)

This code was originally introduced in this PR: dd7cec680c,
and clang11 and later now support `-fstack-clash-protection`. Can we remove this line?

@malfet
Pull Request resolved: https://github.com/pytorch/pytorch/pull/160515
Approved by: https://github.com/isuruf, https://github.com/albanD
This commit is contained in:
FFFrog
2025-08-13 17:53:53 +08:00
committed by PyTorch MergeBot
parent 639778b3ee
commit 39aa3d1471

View File

@ -1194,16 +1194,6 @@ class build_ext(setuptools.command.build_ext.build_ext):
else:
report("-- Not using ITT")
# Do not use clang to compile extensions if `-fstack-clash-protection` is defined
# in system CFLAGS
c_flags = os.getenv("CFLAGS", "")
if (
IS_LINUX
and "-fstack-clash-protection" in c_flags
and "clang" in os.getenv("CC", "")
):
os.environ["CC"] = str(os.environ["CC"])
super().run()
if IS_DARWIN: