Skip to content

Commit 3d1d57d

Browse files
committed
tools build: Remove needless libpython-version feature check that breaks test-all fast path
Since 66dfdff ("perf tools: Add Python 3 support") we don't use the tools/build/feature/test-libpython-version.c version in any Makefile feature check: $ find tools/ -type f | xargs grep feature-libpython-version $ The only place where this was used was removed in 66dfdff: - ifneq ($(feature-libpython-version), 1) - $(warning Python 3 is not yet supported; please set) - $(warning PYTHON and/or PYTHON_CONFIG appropriately.) - $(warning If you also have Python 2 installed, then) - $(warning try something like:) - $(warning $(and ,)) - $(warning $(and ,) make PYTHON=python2) - $(warning $(and ,)) - $(warning Otherwise, disable Python support entirely:) - $(warning $(and ,)) - $(warning $(and ,) make NO_LIBPYTHON=1) - $(warning $(and ,)) - $(error $(and ,)) - else - LDFLAGS += $(PYTHON_EMBED_LDFLAGS) - EXTLIBS += $(PYTHON_EMBED_LIBADD) - LANG_BINDINGS += $(obj-perf)python/perf.so - $(call detected,CONFIG_LIBPYTHON) - endif And nowadays we either build with PYTHON=python3 or just install the python3 devel packages and perf will build against it. But the leftover feature-libpython-version check made the fast path feature detection to break in all cases except when python2 devel files were installed: $ rpm -qa | grep python.*devel python3-devel-3.9.7-1.fc34.x86_64 $ rm -rf /tmp/build/perf ; mkdir -p /tmp/build/perf ; $ make -C tools/perf O=/tmp/build/perf install-bin make: Entering directory '/var/home/acme/git/perf/tools/perf' BUILD: Doing 'make -j32' parallel build HOSTCC /tmp/build/perf/fixdep.o <SNIP> $ cat /tmp/build/perf/feature/test-all.make.output In file included from test-all.c:18: test-libpython-version.c:5:10: error: #error 5 | #error | ^~~~~ $ ldd ~/bin/perf | grep python libpython3.9.so.1.0 => /lib64/libpython3.9.so.1.0 (0x00007fda6dbcf000) $ As python3 is the norm these days, fix this by just removing the unused feature-libpython-version feature check, making the test-all fast path to work with the common case. With this: $ rm -rf /tmp/build/perf ; mkdir -p /tmp/build/perf ; $ make -C tools/perf O=/tmp/build/perf install-bin |& head make: Entering directory '/var/home/acme/git/perf/tools/perf' BUILD: Doing 'make -j32' parallel build HOSTCC /tmp/build/perf/fixdep.o HOSTLD /tmp/build/perf/fixdep-in.o LINK /tmp/build/perf/fixdep Auto-detecting system features: ... dwarf: [ on ] ... dwarf_getlocations: [ on ] ... glibc: [ on ] $ ldd ~/bin/perf | grep python libpython3.9.so.1.0 => /lib64/libpython3.9.so.1.0 (0x00007f58800b0000) $ cat /tmp/build/perf/feature/test-all.make.output $ Reviewed-by: James Clark <[email protected]> Fixes: 66dfdff ("perf tools: Add Python 3 support") Cc: Adrian Hunter <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Jaroslav Škarvada <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Link: https://lore.kernel.org/lkml/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 4ffbe87 commit 3d1d57d

File tree

5 files changed

+0
-23
lines changed

5 files changed

+0
-23
lines changed

tools/build/Makefile.feature

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ FEATURE_TESTS_BASIC := \
4848
numa_num_possible_cpus \
4949
libperl \
5050
libpython \
51-
libpython-version \
5251
libslang \
5352
libslang-include-subdir \
5453
libtraceevent \

tools/build/feature/Makefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ FILES= \
3232
test-numa_num_possible_cpus.bin \
3333
test-libperl.bin \
3434
test-libpython.bin \
35-
test-libpython-version.bin \
3635
test-libslang.bin \
3736
test-libslang-include-subdir.bin \
3837
test-libtraceevent.bin \
@@ -227,9 +226,6 @@ $(OUTPUT)test-libperl.bin:
227226
$(OUTPUT)test-libpython.bin:
228227
$(BUILD) $(FLAGS_PYTHON_EMBED)
229228

230-
$(OUTPUT)test-libpython-version.bin:
231-
$(BUILD)
232-
233229
$(OUTPUT)test-libbfd.bin:
234230
$(BUILD) -DPACKAGE='"perf"' -lbfd -ldl
235231

tools/build/feature/test-all.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414
# include "test-libpython.c"
1515
#undef main
1616

17-
#define main main_test_libpython_version
18-
# include "test-libpython-version.c"
19-
#undef main
20-
2117
#define main main_test_libperl
2218
# include "test-libperl.c"
2319
#undef main
@@ -177,7 +173,6 @@
177173
int main(int argc, char *argv[])
178174
{
179175
main_test_libpython();
180-
main_test_libpython_version();
181176
main_test_libperl();
182177
main_test_hello();
183178
main_test_libelf();

tools/build/feature/test-libpython-version.c

Lines changed: 0 additions & 11 deletions
This file was deleted.

tools/perf/Makefile.config

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,6 @@ endif
271271

272272
FEATURE_CHECK_CFLAGS-libpython := $(PYTHON_EMBED_CCOPTS)
273273
FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
274-
FEATURE_CHECK_CFLAGS-libpython-version := $(PYTHON_EMBED_CCOPTS)
275-
FEATURE_CHECK_LDFLAGS-libpython-version := $(PYTHON_EMBED_LDOPTS)
276274

277275
FEATURE_CHECK_LDFLAGS-libaio = -lrt
278276

0 commit comments

Comments
 (0)