From 1f737edb67e702095feb97118a911afb569f5705 Mon Sep 17 00:00:00 2001 From: Pablo Galindo Salgado Date: Tue, 25 Oct 2022 23:34:22 +0100 Subject: [PATCH] gh-96143: Move the perf trampoline files to the Python directory (#98675) --- Makefile.pre.in | 4 ++-- PCbuild/_freeze_module.vcxproj | 2 +- PCbuild/_freeze_module.vcxproj.filters | 2 +- PCbuild/pythoncore.vcxproj | 2 +- PCbuild/pythoncore.vcxproj.filters | 6 +++--- {Objects => Python}/asm_trampoline.S | 0 {Objects => Python}/perf_trampoline.c | 0 Tools/c-analyzer/cpython/globals-to-fix.tsv | 10 +++++----- Tools/c-analyzer/cpython/ignored.tsv | 6 +++--- configure | 2 +- configure.ac | 2 +- 11 files changed, 18 insertions(+), 18 deletions(-) rename {Objects => Python}/asm_trampoline.S (100%) rename {Objects => Python}/perf_trampoline.c (100%) diff --git a/Makefile.pre.in b/Makefile.pre.in index 5b4bf15eb8a..6ab1422c789 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -426,6 +426,7 @@ PYTHON_OBJS= \ Python/formatter_unicode.o \ Python/fileutils.o \ Python/suggestions.o \ + Python/perf_trampoline.o \ Python/$(DYNLOADFILE) \ $(LIBOBJS) \ $(MACHDEP_OBJS) \ @@ -479,7 +480,6 @@ OBJECT_OBJS= \ Objects/unicodectype.o \ Objects/unionobject.o \ Objects/weakrefobject.o \ - Objects/perf_trampoline.o \ @PERF_TRAMPOLINE_OBJ@ DEEPFREEZE_OBJS = Python/deepfreeze/deepfreeze.o @@ -2370,7 +2370,7 @@ config.status: $(srcdir)/configure .PRECIOUS: config.status $(BUILDPYTHON) Makefile Makefile.pre -Objects/asm_trampoline.o: $(srcdir)/Objects/asm_trampoline.S +Python/asm_trampoline.o: $(srcdir)/Python/asm_trampoline.S $(CC) -c $(PY_CORE_CFLAGS) -o $@ $< # Some make's put the object file in the current directory diff --git a/PCbuild/_freeze_module.vcxproj b/PCbuild/_freeze_module.vcxproj index 49e5cc89a26..8454bd67b1d 100644 --- a/PCbuild/_freeze_module.vcxproj +++ b/PCbuild/_freeze_module.vcxproj @@ -129,7 +129,6 @@ - @@ -211,6 +210,7 @@ + diff --git a/PCbuild/_freeze_module.vcxproj.filters b/PCbuild/_freeze_module.vcxproj.filters index 96ab2f2a4aa..6e8498dceb1 100644 --- a/PCbuild/_freeze_module.vcxproj.filters +++ b/PCbuild/_freeze_module.vcxproj.filters @@ -85,7 +85,7 @@ Source Files - + Source Files diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index ff17304032c..111ad67f7da 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -429,7 +429,6 @@ - @@ -513,6 +512,7 @@ + diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters index 7d7fe7267c8..ab7d01974b0 100644 --- a/PCbuild/pythoncore.vcxproj.filters +++ b/PCbuild/pythoncore.vcxproj.filters @@ -923,9 +923,6 @@ Objects - - Objects - Objects @@ -1127,6 +1124,9 @@ Python + + Python + Python diff --git a/Objects/asm_trampoline.S b/Python/asm_trampoline.S similarity index 100% rename from Objects/asm_trampoline.S rename to Python/asm_trampoline.S diff --git a/Objects/perf_trampoline.c b/Python/perf_trampoline.c similarity index 100% rename from Objects/perf_trampoline.c rename to Python/perf_trampoline.c diff --git a/Tools/c-analyzer/cpython/globals-to-fix.tsv b/Tools/c-analyzer/cpython/globals-to-fix.tsv index 196d62d361b..e327f0a50c6 100644 --- a/Tools/c-analyzer/cpython/globals-to-fix.tsv +++ b/Tools/c-analyzer/cpython/globals-to-fix.tsv @@ -380,7 +380,7 @@ Objects/floatobject.c - float_format - Objects/longobject.c long_from_non_binary_base log_base_BASE - Objects/longobject.c long_from_non_binary_base convwidth_base - Objects/longobject.c long_from_non_binary_base convmultmax_base - -Objects/perf_trampoline.c - perf_map_file - +Python/perf_trampoline.c - perf_map_file - Objects/unicodeobject.c - ucnhash_capi - Parser/action_helpers.c _PyPegen_dummy_name cache - Python/dtoa.c - p5s - @@ -456,10 +456,10 @@ Objects/dictobject.c - next_dict_keys_version - Objects/funcobject.c - next_func_version - Objects/moduleobject.c - max_module_number - Objects/object.c - _Py_RefTotal - -Objects/perf_trampoline.c - perf_status - -Objects/perf_trampoline.c - extra_code_index - -Objects/perf_trampoline.c - code_arena - -Objects/perf_trampoline.c - trampoline_api - +Python/perf_trampoline.c - perf_status - +Python/perf_trampoline.c - extra_code_index - +Python/perf_trampoline.c - code_arena - +Python/perf_trampoline.c - trampoline_api - Objects/typeobject.c - next_version_tag - Objects/typeobject.c resolve_slotdups ptrs - Parser/pegen.c - memo_statistics - diff --git a/Tools/c-analyzer/cpython/ignored.tsv b/Tools/c-analyzer/cpython/ignored.tsv index 28c2325c263..dbfb0e01e7f 100644 --- a/Tools/c-analyzer/cpython/ignored.tsv +++ b/Tools/c-analyzer/cpython/ignored.tsv @@ -77,8 +77,8 @@ Objects/object.c - _Py_GenericAliasIterType - Objects/object.c - _PyMemoryIter_Type - Objects/object.c - _PyLineIterator - Objects/object.c - _PyPositionsIterator - -Objects/perf_trampoline.c - _Py_trampoline_func_start - -Objects/perf_trampoline.c - _Py_trampoline_func_end - +Python/perf_trampoline.c - _Py_trampoline_func_start - +Python/perf_trampoline.c - _Py_trampoline_func_end - Python/importdl.h - _PyImport_DynLoadFiletab - Modules/expat/xmlrole.c - prolog0 - @@ -465,7 +465,7 @@ Objects/obmalloc.c - _PyMem_Debug - Objects/obmalloc.c - _PyMem_Raw - Objects/obmalloc.c - _PyObject - Objects/obmalloc.c - usedpools - -Objects/perf_trampoline.c - _Py_perfmap_callbacks - +Python/perf_trampoline.c - _Py_perfmap_callbacks - Objects/typeobject.c - name_op - Objects/unicodeobject.c - stripfuncnames - Objects/unicodeobject.c - utf7_category - diff --git a/configure b/configure index 15d97963742..953c558d604 100755 --- a/configure +++ b/configure @@ -11629,7 +11629,7 @@ if test "x$perf_trampoline" = xyes; then : $as_echo "#define PY_HAVE_PERF_TRAMPOLINE 1" >>confdefs.h - PERF_TRAMPOLINE_OBJ=Objects/asm_trampoline.o + PERF_TRAMPOLINE_OBJ=Python/asm_trampoline.o if test "x$Py_DEBUG" = xtrue; then : diff --git a/configure.ac b/configure.ac index c7945aaf850..210ce3292cf 100644 --- a/configure.ac +++ b/configure.ac @@ -3474,7 +3474,7 @@ AC_MSG_RESULT([$perf_trampoline]) AS_VAR_IF([perf_trampoline], [yes], [ AC_DEFINE([PY_HAVE_PERF_TRAMPOLINE], [1], [Define to 1 if you have the perf trampoline.]) - PERF_TRAMPOLINE_OBJ=Objects/asm_trampoline.o + PERF_TRAMPOLINE_OBJ=Python/asm_trampoline.o dnl perf needs frame pointers for unwinding, include compiler option in debug builds AS_VAR_IF([Py_DEBUG], [true], [