Skip to contentSkip to conversation

perf: Fix compilation without libelf for post-3.10 kernels

PATCH New Peter Meerwald 3 participants 3 messages Apr 5, 2014 – May 5, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf: Fix compilation without libelf for post-3.10 kernels

kernel commit cf4cca10 (perf tools: Move libelf check config into config/Makefile) removes the NO_LIBELF check from the top-level Makefile

for newer kernels, if config/Makefile exists, we can assume that NO_LIBELF is also there

---
 package/perf/perf.mk | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
package/perf/perf.mk +5 -3
index d7898d0..7610f3d 100644
@@ -36,9 +36,11 @@ define PERF_BUILD_CMDS
 	fi
 	$(Q)if test "$(BR2_PACKAGE_ELFUTILS)" = "" ; then \
 		if ! grep -q NO_LIBELF $(LINUX_DIR)/tools/perf/Makefile ; then \
-			echo "The perf tool in your kernel cannot be built without libelf." ; \
-			echo "Either upgrade your kernel to >= 3.7, or enable the elfutils package." ; \
-			exit 1 ; \
+			if ! test -r $(LINUX_DIR)/tools/perf/config/Makefile ; then \
+				echo "The perf tool in your kernel cannot be built without libelf." ; \
+				echo "Either upgrade your kernel to >= 3.7, or enable the elfutils package." ; \
+				exit 1 ; \
+			fi \
 		fi \
 	fi
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools/perf \
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 perf: Fix compilation without libelf for post-3.10 kernels

Quoted 20 lines · Peter Meerwald

kernel commit cf4cca10 (perf tools: Move libelf check config into config/Makefile) removes the NO_LIBELF check from the top-level Makefile

for newer kernels, if config/Makefile exists, we can assume that NO_LIBELF is also there

---
 package/perf/perf.mk | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
package/perf/perf.mk +0 -1
index d7898d0..7610f3d 100644
@@ -36,9 +36,11 @@ define PERF_BUILD_CMDS
        fi
        $(Q)if test "$(BR2_PACKAGE_ELFUTILS)" = "" ; then \
                if ! grep -q NO_LIBELF $(LINUX_DIR)/tools/perf/Makefile ; then \
-                       echo "The perf tool in your kernel cannot be built without libelf." ; \

package/perf/perf.mk define PERF_BUILD_CMDS · line 46

Quoted 10 lines
package/perf/perf.mk +5 -2
-                       echo "Either upgrade your kernel to >= 3.7, or enable the elfutils package." ; \
-                       exit 1 ; \
+                       if ! test -r $(LINUX_DIR)/tools/perf/config/Makefile ; then \
+                               echo "The perf tool in your kernel cannot be built without libelf." ; \
+                               echo "Either upgrade your kernel to >= 3.7, or enable the elfutils package." ; \
+                               exit 1 ; \
+                       fi \
                fi \
        fi
        $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools/perf \
#2 lore raw

PATCH 1/1 perf: Fix compilation without libelf for post-3.10 kernels

Quoted 28 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas De Schampheleire <[email protected]> writes:

Quoted 25 lines · Peter Meerwald

kernel commit cf4cca10 (perf tools: Move libelf check config into config/Makefile) removes the NO_LIBELF check from the top-level Makefile

for newer kernels, if config/Makefile exists, we can assume that NO_LIBELF is also there

---
package/perf/perf.mk | 8 +++++---

1 file changed, 5 insertions(+), 3 deletions(-)
package/perf/perf.mk +0 -0
index d7898d0..7610f3d 100644
@@ -36,9 +36,11 @@ define PERF_BUILD_CMDS

fi
$(Q)if test "$(BR2_PACKAGE_ELFUTILS)" = "" ; then \
if ! grep -q NO_LIBELF $(LINUX_DIR)/tools/perf/Makefile ; then \

package/perf/perf.mk +3 -3
-                       echo "The perf tool in your kernel cannot be built without libelf." ; \
-                       echo "Either upgrade your kernel to >= 3.7, or enable the elfutils package." ; \
-                       exit 1 ; \
+                       if ! test -r $(LINUX_DIR)/tools/perf/config/Makefile ; then \
+                               echo "The perf tool in your kernel cannot be built without libelf." ; \
+                               echo "Either upgrade your kernel to >= 3.7, or enable the elfutils package." ; \
Quoted 8 lines
Quoted 5 lines
package/perf/perf.mk +2 -0
+                               exit 1 ; \
+                       fi \

fi \
fi
$(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools/perf \

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard