Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions cpython-unix/build-cpython.sh
Original file line number Diff line number Diff line change
Expand Up @@ -504,17 +504,26 @@ if [ -n "${CPYTHON_OPTIMIZED}" ]; then
-reorder-blocks=ext-tsp \
-reorder-functions=cdsort \
-split-functions \
-split-strategy=cdsplit \
-icf=safe \
-inline-all \
-split-eh \
-reorder-functions-use-hot-size \
-peepholes=none \
-jump-tables=aggressive \
-inline-ap \
-dyno-stats"
if [[ "${TARGET_TRIPLE}" == aarch64* ]]; then
# CDSplit requires the prohibitively slow compact code model on
# AArch64, and indirect-call promotion crashes on calls.
BOLT_APPLY_FLAGS="${BOLT_APPLY_FLAGS} \
-split-strategy=profile2 \
-indirect-call-promotion=jump-tables"
elif [[ "${TARGET_TRIPLE}" == x86_64* ]]; then
BOLT_APPLY_FLAGS="${BOLT_APPLY_FLAGS} \
-split-strategy=cdsplit \
-indirect-call-promotion=all \
-dyno-stats \
-frame-opt=hot"
fi
fi

# Allow users to enable the experimental JIT on 3.13+
Expand Down
3 changes: 3 additions & 0 deletions cpython-unix/extension-modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ _csv:
- _csv.c

_ctypes:
build-mode: shared
sources:
- _ctypes/_ctypes.c
- _ctypes/callbacks.c
Expand All @@ -128,6 +129,8 @@ _ctypes:
- HAVE_FFI_PREP_CLOSURE_LOC=1
- HAVE_FFI_CLOSURE_ALLOC=1
defines-conditional:
- define: Py_BUILD_CORE_MODULE
maximum-python-version: "3.10"
- define: MACOSX
targets:
- .*-apple-.*
Expand Down
6 changes: 1 addition & 5 deletions cpython-unix/targets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,7 @@ aarch64-unknown-linux-gnu:
- zlib
- zstd
openssl_target: linux-aarch64
# Blocked on:
# BOLT-ERROR: Cannot relax adr in non-simple function
# trampoline_code_table/1. Use --strict option to override
# See https://github.com/llvm/llvm-project/issues/146541
# bolt_capable: true
bolt_capable: true

armv7-unknown-linux-gnueabi:
linux_uapi_include_arch: arm-linux-gnueabi
Expand Down
4 changes: 2 additions & 2 deletions pythonbuild/cpython.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ def derive_setup_local(
# agrees fully with the distribution's knowledge of extensions. So we can
# treat our metadata as canonical.

RE_DEFINE = re.compile(rb"-D[^=]+=[^\s]+")
RE_DEFINE = re.compile(rb"-D[^=\s]+=[^\s]+")

# Translate our YAML metadata into Setup lines.

Expand Down Expand Up @@ -697,7 +697,7 @@ def derive_setup_local(

for target in sorted(extra_cflags):
make_lines.append(
b"%s: PY_STDMODULE_CFLAGS += %s" % (target, b" ".join(extra_cflags[target]))
b"%s: PY_CPPFLAGS += %s" % (target, b" ".join(extra_cflags[target]))
)

return {
Expand Down
1 change: 1 addition & 0 deletions src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,7 @@ const GLOBAL_EXTENSIONS_WINDOWS_NO_STATIC: &[&str] = &["_testinternalcapi", "_tk
/// Extension modules that should be built as shared libraries.
const SHARED_LIBRARY_EXTENSIONS: &[&str] = &[
"_crypt",
"_ctypes",
"_ctypes_test",
"_dbm",
"_testbuffer",
Expand Down
Loading