Skip to content

Commit 456c232

Browse files
committed
Skip fPIC
1 parent cb1f583 commit 456c232

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

cpython-unix/build-cpython.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,18 @@ fi
650650
autoconf
651651

652652
# Ensure `CFLAGS` are propagated to JIT compilation for 3.13+
653-
CFLAGS=$CFLAGS CPPFLAGS=$CFLAGS CFLAGS_JIT=$CFLAGS LDFLAGS=$LDFLAGS \
653+
# (note this variable has no effect on 3.12 and earlier)
654+
if [[ -n "${PYTHON_MEETS_MAXIMUM_VERSION_313}" ]]; then
655+
CFLAGS_JIT="${CFLAGS}"
656+
else
657+
# In 3.14+, the JIT compiler on x86-64 Linux uses a model that conflicts with `-fPIC`, so strip
658+
# it from the flags. See:
659+
# - https://github.com/python/cpython/issues/135690
660+
# - https://github.com/python/cpython/pull/130097
661+
CFLAGS_JIT="${CFLAGS//-fPIC/}"
662+
fi
663+
664+
CFLAGS=$CFLAGS CPPFLAGS=$CFLAGS CFLAGS_JIT=$CFLAGS_JIT LDFLAGS=$LDFLAGS \
654665
./configure ${CONFIGURE_FLAGS}
655666

656667
# Supplement produced Makefile with our modifications.

0 commit comments

Comments
 (0)