]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-152769: Enable perf trampoline on musl (Alpine Linux) (#152774)
authorXiaowei Lu <weixlu420302@gmail.com>
Thu, 9 Jul 2026 19:17:40 +0000 (03:17 +0800)
committerGitHub <noreply@github.com>
Thu, 9 Jul 2026 19:17:40 +0000 (21:17 +0200)
Misc/NEWS.d/next/Build/2026-07-01-17-53-00.gh-issue-152769.Kp7mQ2.rst [new file with mode: 0644]
configure
configure.ac

diff --git a/Misc/NEWS.d/next/Build/2026-07-01-17-53-00.gh-issue-152769.Kp7mQ2.rst b/Misc/NEWS.d/next/Build/2026-07-01-17-53-00.gh-issue-152769.Kp7mQ2.rst
new file mode 100644 (file)
index 0000000..04a6ef4
--- /dev/null
@@ -0,0 +1,4 @@
+Enable the :ref:`perf profiler <perf_profiling>` trampoline on Alpine Linux with the
+musl C library on ``x86_64`` and ``aarch64``. The
+trampoline is architecture-specific and does not depend on the C library, so
+the same assembly trampoline used for glibc is reused for musl.
index 11ef14c46eeeaefbc34a0466f461335386c0da1d..17b7ef765cc7fdf09239622422ea51429b54a707 100755 (executable)
--- a/configure
+++ b/configure
@@ -14440,9 +14440,15 @@ case $PLATFORM_TRIPLET in #(
   x86_64-linux-gnu) :
     perf_trampoline=yes
                         PERF_TRAMPOLINE_OBJ=Python/asm_trampoline_x86_64.o ;; #(
+  x86_64-linux-musl) :
+    perf_trampoline=yes
+                        PERF_TRAMPOLINE_OBJ=Python/asm_trampoline_x86_64.o ;; #(
   aarch64-linux-gnu) :
     perf_trampoline=yes
                          PERF_TRAMPOLINE_OBJ=Python/asm_trampoline_aarch64.o ;; #(
+  aarch64-linux-musl) :
+    perf_trampoline=yes
+                         PERF_TRAMPOLINE_OBJ=Python/asm_trampoline_aarch64.o ;; #(
   darwin) :
     case $MACOSX_DEPLOYMENT_TARGET in #(
   10.[0-9]|10.1[0-1]) :
index 568286a9e468a3691c406adf24fb3a29076fd109..ab64ac8769b55150100b4c5d2e065fb45d137660 100644 (file)
@@ -3874,8 +3874,12 @@ PERF_TRAMPOLINE_OBJ=""
 AS_CASE([$PLATFORM_TRIPLET],
   [x86_64-linux-gnu], [perf_trampoline=yes
                         PERF_TRAMPOLINE_OBJ=Python/asm_trampoline_x86_64.o],
+  [x86_64-linux-musl], [perf_trampoline=yes
+                        PERF_TRAMPOLINE_OBJ=Python/asm_trampoline_x86_64.o],
   [aarch64-linux-gnu], [perf_trampoline=yes
                          PERF_TRAMPOLINE_OBJ=Python/asm_trampoline_aarch64.o],
+  [aarch64-linux-musl], [perf_trampoline=yes
+                         PERF_TRAMPOLINE_OBJ=Python/asm_trampoline_aarch64.o],
   [darwin], [AS_CASE([$MACOSX_DEPLOYMENT_TARGET],
                 [[10.[0-9]|10.1[0-1]]], [perf_trampoline=no],
                 [perf_trampoline=yes