From 0113b3d40ecb7cb3d34144a05eb83c389bf773e4 Mon Sep 17 00:00:00 2001 From: Jerome Marchand Date: Fri, 31 Mar 2023 12:31:58 +0200 Subject: [PATCH] Fix infinite loop in make Build is stuck in an infinite loop with make 4.4. Fix it. Resolves: rhbz#2171769 Signed-off-by: Jerome Marchand --- libtracecmd.spec | 6 +- ...cmd-Allow-building-with-GNU-Make-4.4.patch | 101 ++++++++++++++++++ 2 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 trace-cmd-Allow-building-with-GNU-Make-4.4.patch diff --git a/libtracecmd.spec b/libtracecmd.spec index 45825e4..e3edd59 100644 --- a/libtracecmd.spec +++ b/libtracecmd.spec @@ -1,11 +1,12 @@ Name: libtracecmd Version: 1.2.0 -Release: 2%{?dist} +Release: 3%{?dist} License: LGPLv2 Summary: A library for reading tracing instances stored in a trace file URL: https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/ Source0: https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/snapshot/trace-cmd-libtracecmd-%{version}.tar.gz +Patch0: trace-cmd-Allow-building-with-GNU-Make-4.4.patch ExcludeArch: %{ix86} %{arm} @@ -69,6 +70,9 @@ chrpath --delete %{buildroot}/%{_libdir}/libtracecmd.so* %{_includedir}/trace-cmd %changelog +* Fri Mar 31 2023 Jerome Marchand - 1.2.0-3 +- Fix build: RHBZ#2171769 + * Thu Jan 19 2023 Fedora Release Engineering - 1.2.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild diff --git a/trace-cmd-Allow-building-with-GNU-Make-4.4.patch b/trace-cmd-Allow-building-with-GNU-Make-4.4.patch new file mode 100644 index 0000000..5dcf5fe --- /dev/null +++ b/trace-cmd-Allow-building-with-GNU-Make-4.4.patch @@ -0,0 +1,101 @@ +From 5b87ceb33a33857a51aa52db092ad28e0510d00a Mon Sep 17 00:00:00 2001 +From: Michal Sojka +Date: Mon, 26 Dec 2022 17:49:51 +0100 +Subject: [PATCH] trace-cmd: Allow building with GNU Make 4.4 + +Make 4.4 introduces several backward incompatibilities and the result +is that building trace-cmd with it never finishes. It seems that make +ends up in some kind of infinite recursion. The symptoms are: + + $ make -d + GNU Make 4.4 + Built for x86_64-pc-linux-gnu + Copyright (C) 1988-2022 Free Software Foundation, Inc. + License GPLv3+: GNU GPL version 3 or later + This is free software: you are free to change and redistribute it. + There is NO WARRANTY, to the extent permitted by law. + Reading makefiles... + Reading makefile 'Makefile'... + Makefile:79: not recursively expanding pkgconfig_dir to export to shell function + Makefile:79: not recursively expanding pkgconfig_dir to export to shell function + Makefile:224: not recursively expanding LIBTRACECMD_SHARED_VERSION to export to shell function + Makefile:79: not recursively expanding pkgconfig_dir to export to shell function + Makefile:224: not recursively expanding LIBTRACECMD_SHARED_VERSION to export to shell function + Makefile:225: not recursively expanding LIBTRACECMD_SHARED_SO to export to shell function + Makefile:79: not recursively expanding pkgconfig_dir to export to shell function + Makefile:79: not recursively expanding pkgconfig_dir to export to shell function + +Build succeeds if recursively expanded variables (defined with '='), +which use $(shell ...) as its value, are replaced with simply expanded +variables (defined with ':='). + +Link: https://lore.kernel.org/linux-trace-devel/20221226164951.2632069-1-michal.sojka@cvut.cz + +Signed-off-by: Michal Sojka +Tested-by: Daniel Wagner +Signed-off-by: Steven Rostedt (Google) +--- + Makefile | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +diff --git a/Makefile b/Makefile +index b61b8951..e892a2ec 100644 +--- a/Makefile ++++ b/Makefile +@@ -221,8 +221,8 @@ LIBS ?= -ldl + LIBTRACECMD_DIR = $(obj)/lib/trace-cmd + LIBTRACECMD_STATIC = $(LIBTRACECMD_DIR)/libtracecmd.a + LIBTRACECMD_SHARED = $(LIBTRACECMD_DIR)/libtracecmd.so.$(LIBTRACECMD_VERSION) +-LIBTRACECMD_SHARED_VERSION = $(shell echo $(LIBTRACECMD_SHARED) | sed -e 's/\(\.so\.[0-9]*\).*/\1/') +-LIBTRACECMD_SHARED_SO = $(shell echo $(LIBTRACECMD_SHARED) | sed -e 's/\(\.so\).*/\1/') ++LIBTRACECMD_SHARED_VERSION := $(shell echo $(LIBTRACECMD_SHARED) | sed -e 's/\(\.so\.[0-9]*\).*/\1/') ++LIBTRACECMD_SHARED_SO := $(shell echo $(LIBTRACECMD_SHARED) | sed -e 's/\(\.so\).*/\1/') + + export LIBTRACECMD_STATIC LIBTRACECMD_SHARED + export LIBTRACECMD_SHARED_VERSION LIBTRACECMD_SHARED_SO +@@ -230,12 +230,12 @@ export LIBTRACECMD_SHARED_VERSION LIBTRACECMD_SHARED_SO + LIBTRACEEVENT=libtraceevent + LIBTRACEFS=libtracefs + +-TEST_LIBTRACEEVENT = $(shell sh -c "$(PKG_CONFIG) --atleast-version $(LIBTRACEEVENT_MIN_VERSION) $(LIBTRACEEVENT) > /dev/null 2>&1 && echo y") +-TEST_LIBTRACEFS = $(shell sh -c "$(PKG_CONFIG) --atleast-version $(LIBTRACEFS_MIN_VERSION) $(LIBTRACEFS) > /dev/null 2>&1 && echo y") ++TEST_LIBTRACEEVENT := $(shell sh -c "$(PKG_CONFIG) --atleast-version $(LIBTRACEEVENT_MIN_VERSION) $(LIBTRACEEVENT) > /dev/null 2>&1 && echo y") ++TEST_LIBTRACEFS := $(shell sh -c "$(PKG_CONFIG) --atleast-version $(LIBTRACEFS_MIN_VERSION) $(LIBTRACEFS) > /dev/null 2>&1 && echo y") + + ifeq ("$(TEST_LIBTRACEEVENT)", "y") +-LIBTRACEEVENT_CFLAGS = $(shell sh -c "$(PKG_CONFIG) --cflags $(LIBTRACEEVENT)") +-LIBTRACEEVENT_LDLAGS = $(shell sh -c "$(PKG_CONFIG) --libs $(LIBTRACEEVENT)") ++LIBTRACEEVENT_CFLAGS := $(shell sh -c "$(PKG_CONFIG) --cflags $(LIBTRACEEVENT)") ++LIBTRACEEVENT_LDLAGS := $(shell sh -c "$(PKG_CONFIG) --libs $(LIBTRACEEVENT)") + else + .PHONY: warning + warning: +@@ -253,8 +253,8 @@ endif + export LIBTRACEEVENT_CFLAGS LIBTRACEEVENT_LDLAGS + + ifeq ("$(TEST_LIBTRACEFS)", "y") +-LIBTRACEFS_CFLAGS = $(shell sh -c "$(PKG_CONFIG) --cflags $(LIBTRACEFS)") +-LIBTRACEFS_LDLAGS = $(shell sh -c "$(PKG_CONFIG) --libs $(LIBTRACEFS)") ++LIBTRACEFS_CFLAGS := $(shell sh -c "$(PKG_CONFIG) --cflags $(LIBTRACEFS)") ++LIBTRACEFS_LDLAGS := $(shell sh -c "$(PKG_CONFIG) --libs $(LIBTRACEFS)") + else + .PHONY: warning + warning: +@@ -324,11 +324,11 @@ endif + export ZLIB_LDLAGS + + ifndef NO_LIBZSTD +-TEST_LIBZSTD = $(shell sh -c "$(PKG_CONFIG) --atleast-version 1.4.0 libzstd > /dev/null 2>&1 && echo y") ++TEST_LIBZSTD := $(shell sh -c "$(PKG_CONFIG) --atleast-version 1.4.0 libzstd > /dev/null 2>&1 && echo y") + + ifeq ("$(TEST_LIBZSTD)", "y") +-LIBZSTD_CFLAGS = $(shell sh -c "$(PKG_CONFIG) --cflags libzstd") +-LIBZSTD_LDLAGS = $(shell sh -c "$(PKG_CONFIG) --libs libzstd") ++LIBZSTD_CFLAGS := $(shell sh -c "$(PKG_CONFIG) --cflags libzstd") ++LIBZSTD_LDLAGS := $(shell sh -c "$(PKG_CONFIG) --libs libzstd") + CFLAGS += -DHAVE_ZSTD + ZSTD_INSTALLED=1 + $(info Have ZSTD compression support) +-- +2.39.2 +