From patchwork Tue Mar 12 18:10:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas De Schampheleire X-Patchwork-Id: 227093 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 8B35F2C029D for ; Wed, 13 Mar 2013 05:11:42 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 8E495316EA; Tue, 12 Mar 2013 18:11:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dNTHgxW5WaPh; Tue, 12 Mar 2013 18:11:40 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id D689220222; Tue, 12 Mar 2013 18:11:39 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 29BC78F7A5 for ; Tue, 12 Mar 2013 18:11:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 383708D152 for ; Tue, 12 Mar 2013 18:11:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CmEYfEF2dUDg for ; Tue, 12 Mar 2013 18:11:31 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-we0-f169.google.com (mail-we0-f169.google.com [74.125.82.169]) by whitealder.osuosl.org (Postfix) with ESMTPS id 5F11B8D147 for ; Tue, 12 Mar 2013 18:11:31 +0000 (UTC) Received: by mail-we0-f169.google.com with SMTP id t11so146472wey.28 for ; Tue, 12 Mar 2013 11:11:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:content-type:mime-version :content-transfer-encoding:subject:x-mercurial-node:message-id :in-reply-to:references:user-agent:date:from:to; bh=RxXHCeNfbxtvmTuCLNbmw2YyPhKp7/WmGHkjzqt936Y=; b=hcEM9ickT9F9W3i8pDaB15x+Rortj9fU/pO8TYgus3yDVBrpM/ggD39HZl6/jDZ2tM 1dlTMlI3q7pIRupewBoFLEwwqxQrqhsI+SprpS00KnbB10fjLRken802CO8BaWYQDhlU YcyNMI1cRgyU148EVmYNOvv/yLTILDEDZmBhxZuV0tW+Sw5opefKtnwdjcfzGo8z/w+Y fHlAjBhr/lY56HJ6+Zibvr3iV+J1lXxc/bFXww/8HlwsRrbBzUMrAogDDq0Wl3GGQPMs fvYX4eBqCnTgGqXAjp6k5N2RsVd7XXJZWZh//HB6rg7low93sX3koMbOWrMjW1zya/Ox ojkg== X-Received: by 10.180.76.171 with SMTP id l11mr21789078wiw.24.1363111889992; Tue, 12 Mar 2013 11:11:29 -0700 (PDT) Received: from [127.0.1.1] (d54C62EEB.access.telenet.be. [84.198.46.235]) by mx.google.com with ESMTPS id ex1sm17564951wib.7.2013.03.12.11.11.28 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Mar 2013 11:11:29 -0700 (PDT) MIME-Version: 1.0 X-Mercurial-Node: e866a53b0e64b92f119bddc75bcf039785241b64 Message-Id: In-Reply-To: References: User-Agent: Mercurial-patchbomb/2.2.2 Date: Tue, 12 Mar 2013 19:10:56 +0100 From: Thomas De Schampheleire To: buildroot@busybox.net Subject: [Buildroot] [PATCH 3 of 3] oprofile 0.9.8: fix compilation on powerpc X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net The oprofile build was broken on powerpc since version 0.9.8. This was detected in several autobuilds, like http://autobuild.buildroot.net/results/6f6c02d18495907d50fcdfc6003ac20d493c55fe/ The problem can be fixed by adding libpfm4 into the build and making a few changes in the configure script. Because the configure script is changed, we additionally need to prevent autoreconfiguring (which fails). At the same time, I fixed the removed --with-kernel-support configure option. Signed-off-by: Thomas De Schampheleire --- package/oprofile/Config.in | 1 + package/oprofile/oprofile-0.9.8-003-powerpc.patch | 27 +++++++++++++++++++++++++++ package/oprofile/oprofile.mk | 16 ++++++++++++++-- 3 files changed, 42 insertions(+), 2 deletions(-) Note: this is compile-tested on x86 and powerpc, but I was not able to test it on target. diff --git a/package/oprofile/Config.in b/package/oprofile/Config.in --- a/package/oprofile/Config.in +++ b/package/oprofile/Config.in @@ -2,6 +2,7 @@ config BR2_PACKAGE_OPROFILE bool "oprofile" select BR2_PACKAGE_POPT select BR2_PACKAGE_BINUTILS + select BR2_PACKAGE_LIBPFM4 if BR2_powerpc depends on BR2_INSTALL_LIBSTDCPP depends on !BR2_aarch64 # binutils help diff --git a/package/oprofile/oprofile-0.9.8-003-powerpc.patch b/package/oprofile/oprofile-0.9.8-003-powerpc.patch new file mode 100644 --- /dev/null +++ b/package/oprofile/oprofile-0.9.8-003-powerpc.patch @@ -0,0 +1,27 @@ + +Signed-off-by: Thomas De Schampheleire + +diff --git a/configure.ac b/configure.ac +--- a/configure.ac ++++ b/configure.ac +@@ -104,7 +104,7 @@ AC_DEFINE_UNQUOTED(HAVE_PERF_EVENTS, $HA + if test "$HAVE_PERF_EVENTS" = "1"; then + PFM_LIB= + arch="`uname -m`" +- if test "$arch" = "ppc64"; then ++ if test "$arch" = "ppc64" || test "$arch" = "ppc"; then + AC_CHECK_HEADER(perfmon/pfmlib.h,,[AC_MSG_ERROR([pfmlib.h not found; usually provided in papi devel package])]) + AC_CHECK_LIB(pfm,pfm_get_event_name, HAVE_LIBPFM3='1'; HAVE_LIBPFM='1', [ + AC_CHECK_LIB(pfm,pfm_get_os_event_encoding, HAVE_LIBPFM3='0'; HAVE_LIBPFM='1', +diff --git a/configure b/configure +--- a/configure ++++ b/configure +@@ -16985,7 +16985,7 @@ cat >>confdefs.h <<_ACEOF + if test "$HAVE_PERF_EVENTS" = "1"; then + PFM_LIB= + arch="`uname -m`" +- if test "$arch" = "ppc64"; then ++ if test "$arch" = "ppc64" || test "$arch" = "ppc"; then + if test "${ac_cv_header_perfmon_pfmlib_h+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for perfmon/pfmlib.h" >&5 + $as_echo_n "checking for perfmon/pfmlib.h... " >&6; } diff --git a/package/oprofile/oprofile.mk b/package/oprofile/oprofile.mk --- a/package/oprofile/oprofile.mk +++ b/package/oprofile/oprofile.mk @@ -8,7 +8,7 @@ OPROFILE_VERSION = 0.9.8 OPROFILE_SITE = http://downloads.sourceforge.net/project/oprofile/oprofile/oprofile-$(OPROFILE_VERSION) OPROFILE_LICENSE = GPLv2+ OPROFILE_LICENSE_FILES = COPYING -OPROFILE_CONF_OPT = --localstatedir=/var --with-kernel-support +OPROFILE_CONF_OPT = --localstatedir=/var --with-kernel=$(SYSROOT_DIR) OPROFILE_BINARIES = utils/ophelp pp/opannotate pp/oparchive pp/opgprof OPROFILE_BINARIES += pp/opreport opjitconv/opjitconv daemon/oprofiled OPROFILE_BINARIES += utils/op-check-perfevents pe_profiling/operf libabi/opimport @@ -29,7 +29,19 @@ ifeq ($(OPROFILE_ARCH),) OPROFILE_ARCH = $(BR2_ARCH) endif -OPROFILE_DEPENDENCIES = popt binutils +OPROFILE_DEPENDENCIES = popt binutils libpfm4 + +define OPROFILE_PREVENT_AUTOMAKE + # Prevent automake from running. + (cd $(@D); touch -c config* aclocal.m4 Makefile*); +endef + +define OPROFILE_FIX_CROSS_UNAME + $(SED) 's/`uname -m`/$(OPROFILE_ARCH)/' $(@D)/configure +endef + +OPROFILE_POST_PATCH_HOOKS += OPROFILE_PREVENT_AUTOMAKE +OPROFILE_POST_PATCH_HOOKS += OPROFILE_FIX_CROSS_UNAME define OPROFILE_INSTALL_TARGET_CMDS $(INSTALL) -d -m 755 $(TARGET_DIR)/usr/bin