Skip to contentSkip to conversation

perf: libelf is required to compile perf

PATCH New Andi Shyti 4 participants 6 messages Nov 5, 2013

lore
Share & tools
lore

Andi Shyti

author
#0 lore raw

PATCH 1/1 perf: libelf is required to compile perf

Point this out in the related Config.in in the perf directory.

Mute the following error by selecting BR2_PACKAGE_LIBELF:

The perf tool in your kernel cannot be built without libelf.
Either upgrade your kernel to >= 3.7, or enable the elfutils package.
make: *** [/home/andi/repo/buildroot-snowball/output/build/perf-stable-linux-ux500-3.4/.stamp_built] Error 1

---
 package/perf/Config.in | 1 +
 1 file changed, 1 insertion(+)
package/perf/Config.in +1 -0
index 88dce93..4b651b3 100644
@@ -2,6 +2,7 @@ config BR2_PACKAGE_PERF
 	bool "perf"
 	depends on BR2_LINUX_KERNEL
 	depends on BR2_LARGEFILE
+	depends on BR2_PACKAGE_LIBELF
 	help
 	  perf (sometimes "Perf Events" or perf tools, originally
 	  "Performance Counters for Linux") - is a performance
Signature · 1 line
1.8.4.2
#1 lore raw

PATCH 1/1 perf: libelf is required to compile perf

Hi Andi,

Quoted 18 lines · Andi Shyti

Point this out in the related Config.in in the perf directory.

Mute the following error by selecting BR2_PACKAGE_LIBELF:

The perf tool in your kernel cannot be built without libelf.
Either upgrade your kernel to >= 3.7, or enable the elfutils package.
make: *** [/home/andi/repo/buildroot-snowball/output/build/perf-stable-linux-ux500-3.4/.stamp_built] Error 1

---
 package/perf/Config.in | 1 +
 1 file changed, 1 insertion(+)
package/perf/Config.in +0 -0
index 88dce93..4b651b3 100644

package/perf/Config.in config BR2_PACKAGE_PERF · line 8

Quoted 7 lines
package/perf/Config.in +1 -0
@@ -2,6 +2,7 @@ config BR2_PACKAGE_PERF
        bool "perf"
        depends on BR2_LINUX_KERNEL
        depends on BR2_LARGEFILE
+       depends on BR2_PACKAGE_LIBELF
        help
          perf (sometimes "Perf Events" or perf tools, originally
          "Performance Counters for Linux") - is a performance

This doesn't look right. As the error indicates, if your kernel is recent enough you don't need libelf.
Have you tried enabling libelf manually?

Best regards,
Thomas

Quoted 7 lines

--
1.8.4.2

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

author
#2 lore raw

PATCH 1/1 perf: libelf is required to compile perf

Hi Thomas,

Quoted 10 lines
Quoted 7 lines

Point this out in the related Config.in in the perf directory.

Mute the following error by selecting BR2_PACKAGE_LIBELF:

The perf tool in your kernel cannot be built without libelf.
Either upgrade your kernel to >= 3.7, or enable the elfutils package.
make: *** [/home/andi/repo/buildroot-snowball/output/build/perf-stable-linux-ux500-3.4/.stamp_built] Error 1

This doesn't look right. As the error indicates, if your kernel is recent enough you don't need libelf.

I was compiling for snowball which has an old Kernel as default, that's why I got the error.

Quoted 1 line

Have you tried enabling libelf manually?

By enabling it manually it works. If the patch doesn't look right, feel free to ignore it.

Thanks,
Andi

#3 lore raw

PATCH 1/1 perf: libelf is required to compile perf

In reply to Andi Shyti

Andi,

Andi Shyti <[email protected]> wrote on 11/05/2013 08:06:27 AM:

Quoted 19 lines

Point this out in the related Config.in in the perf directory.

Mute the following error by selecting BR2_PACKAGE_LIBELF:

The perf tool in your kernel cannot be built without libelf. Either upgrade your kernel to >= 3.7, or enable the elfutils package.
make: *** [/home/andi/repo/buildroot-snowball/output/build/perf- stable-linux-ux500-3.4/.stamp_built] Error 1

---
 package/perf/Config.in | 1 +
 1 file changed, 1 insertion(+)
package/perf/Config.in +0 -0
index 88dce93..4b651b3 100644

package/perf/Config.in config BR2_PACKAGE_PERF · line 5

Quoted 4 lines
package/perf/Config.in +1 -0
@@ -2,6 +2,7 @@ config BR2_PACKAGE_PERF
    bool "perf"
    depends on BR2_LINUX_KERNEL
    depends on BR2_LARGEFILE
+   depends on BR2_PACKAGE_LIBELF

Wouldn't you want this to be a select since LIBELF is required by this package? Also in the perf.mk you want to ensure that the libelf package is built before by adding a dependancy to the makefile.

ifeq ($(BR2_PACKAGE_LIBELF),y)
PERF_DEPENDENCIES += libelf
endif

Please see section 6.1.2 of the Buildroot manual:
http://buildroot.uclibc.org/downloads/manual/manual.html#writing-rules-mk

Quoted 10 lines
package/perf/Config.in +0 -0
    help
      perf (sometimes "Perf Events" or perf tools, originally
      "Performance Counters for Linux") - is a performance
Signature · 6 lines
1.8.4.2

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
#4 lore raw

PATCH 1/1 perf: libelf is required to compile perf

Hi rjbarnet at rockwellcollins.com,

Quoted 30 lines · rjbarnet at rockwellcollins.com

Andi Shyti <[email protected]> wrote on 11/05/2013 08:06:27 AM:

Quoted 19 lines

Point this out in the related Config.in in the perf directory.

Mute the following error by selecting BR2_PACKAGE_LIBELF:

The perf tool in your kernel cannot be built without libelf. Either upgrade your kernel to >= 3.7, or enable the elfutils package.
make: *** [/home/andi/repo/buildroot-snowball/output/build/perf- stable-linux-ux500-3.4/.stamp_built] Error 1

---
 package/perf/Config.in | 1 +
 1 file changed, 1 insertion(+)
package/perf/Config.in +0 -0
index 88dce93..4b651b3 100644

package/perf/Config.in config BR2_PACKAGE_PERF · line 5

Quoted 4 lines
package/perf/Config.in +1 -0
@@ -2,6 +2,7 @@ config BR2_PACKAGE_PERF
    bool "perf"
    depends on BR2_LINUX_KERNEL
    depends on BR2_LARGEFILE
+   depends on BR2_PACKAGE_LIBELF

Wouldn't you want this to be a select since LIBELF is required by this package? Also in the perf.mk you want to ensure that the libelf package is built before by adding a dependancy to the makefile.

Quoted 3 lines

ifeq ($(BR2_PACKAGE_LIBELF),y)
PERF_DEPENDENCIES += libelf
endif

When you select BR2_PACKAGE_LIBELF in Config.in there should be no need for the 'ifeq' condition. Just add 'libelf' to PERF_DEPENDENCIES unconditionally.

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#5 lore raw

PATCH 1/1 perf: libelf is required to compile perf

Baruch Siach,

Baruch Siach <[email protected]> wrote on 11/05/2013 10:18:46 AM:

Quoted 1 line

On Tue, Nov 05, 2013 at 08:58:10AM -0600, rjbarnet at rockwellcollins.com

Quoted 13 lines · wrote:
Quoted 12 lines

Andi Shyti <[email protected]> wrote on 11/05/2013 08:06:27 AM:

package/perf/Config.in config BR2_PACKAGE_PERF · line 5

Quoted 9 lines
package/perf/Config.in +1 -0
index 88dce93..4b651b3 100644
@@ -2,6 +2,7 @@ config BR2_PACKAGE_PERF
    bool "perf"
    depends on BR2_LINUX_KERNEL
    depends on BR2_LARGEFILE
+   depends on BR2_PACKAGE_LIBELF

Wouldn't you want this to be a select since LIBELF is required by this

Quoted 1 line
Quoted 1 line

package? Also in the perf.mk you want to ensure that the libelf

package is

Quoted 7 lines
Quoted 5 lines

built before by adding a dependancy to the makefile.

ifeq ($(BR2_PACKAGE_LIBELF),y)
PERF_DEPENDENCIES += libelf
endif

When you select BR2_PACKAGE_LIBELF in Config.in there should be no need

for

Quoted 1 line

the 'ifeq' condition. Just add 'libelf' to PERF_DEPENDENCIES

unconditionally.

You are correct. Its just habit that I do things like that.

Thanks,
-Ryan