bpo-36618: Don't add -fmax-type-align=8 flag for clang (GH-13320) · python/cpython@d97adfb (original) (raw)

2 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -6905,26 +6905,6 @@ then
6905 6905 esac
6906 6906 fi
6907 6907
6908 -if test -n "${cc_is_clang}"
6909 -then
6910 -# bpo-36618: Add -fmax-type-align=8 to CFLAGS when clang compiler is
6911 -# detected. The pymalloc memory allocator aligns memory on 8 bytes. On
6912 -# x86-64, clang expects alignment on 16 bytes by default and so uses MOVAPS
6913 -# instruction which can lead to segmentation fault. Instruct clang that
6914 -# Python is limited to alignemnt on 8 bytes to use MOVUPS instruction
6915 -# instead: slower but don't trigger a SIGSEGV if the memory is not aligned
6916 -# on 16 bytes.
6917 -#
6918 -# Sadly, the flag must be added to CFLAGS and not just CFLAGS_NODIST,
6919 -# since third party C extensions can have the same issue.
6920 -#
6921 -# Check if -fmax-type-align flag is supported (it's not supported by old
6922 -# clang versions):
6923 -if "$CC" -v --help 2>/dev/null |grep -- -fmax-type-align > /dev/null; then
6924 - CFLAGS="$CFLAGS -fmax-type-align=8"
6925 -fi
6926 -fi
6927 -
6928 6908
6929 6909
6930 6910
Original file line number Diff line number Diff line change
@@ -1543,26 +1543,6 @@ then
1543 1543 esac
1544 1544 fi
1545 1545
1546 -if test -n "${cc_is_clang}"
1547 -then
1548 -# bpo-36618: Add -fmax-type-align=8 to CFLAGS when clang compiler is
1549 -# detected. The pymalloc memory allocator aligns memory on 8 bytes. On
1550 -# x86-64, clang expects alignment on 16 bytes by default and so uses MOVAPS
1551 -# instruction which can lead to segmentation fault. Instruct clang that
1552 -# Python is limited to alignemnt on 8 bytes to use MOVUPS instruction
1553 -# instead: slower but don't trigger a SIGSEGV if the memory is not aligned
1554 -# on 16 bytes.
1555 -#
1556 -# Sadly, the flag must be added to CFLAGS and not just CFLAGS_NODIST,
1557 -# since third party C extensions can have the same issue.
1558 -#
1559 -# Check if -fmax-type-align flag is supported (it's not supported by old
1560 -# clang versions):
1561 - if "$CC" -v --help 2>/dev/null |grep -- -fmax-type-align > /dev/null; then
1562 - CFLAGS="$CFLAGS -fmax-type-align=8"
1563 - fi
1564 -fi
1565 -
1566 1546 AC_SUBST(BASECFLAGS)
1567 1547 AC_SUBST(CFLAGS_NODIST)
1568 1548 AC_SUBST(LDFLAGS_NODIST)