On Wednesday, February 6, 2013, Maynard Johnson <maynardj@us.ibm.com> wrote:
> On 02/05/2013 11:46 AM, Matthew McClintock wrote:
>> You can't determine the target for running on by running uname
>> on the build machine. Use a better method instead.
> This patch breaks native ppc64 builds, since $host_cpu is "powerpc64" in that case.

Hmm, I thought I read that $host_cpu would be wrong "powerpc" still. I will test this out and resubmit if appropriate in a few days once I'm back from vacation.

> What exactly is the intent of the patch?  Do you wish to include or exclude the ppc arch configuring with libpfm?

I'm trying to fix cross compiling. Running 'uname' on the build machine to determine arch won't work properly.

> I would guess the latter since I see no evidence that libpfm supports ppc, but that doesn't seem to be how the patch was written.

What do you mean libpfm does not support ppc? It builds fine and links with oprofile just fine. In fact oprofile seems to be unable to build at all without libpfm, which is why this issue came up for me.

Please correct me if I'm wrong, I'm not a oprofile/libpfm expert by any means here ;)


> -Maynard
>> Signed-off-by: Matthew McClintock <msm@freescale.com>
>> ---
>>  configure.ac |    4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>> diff --git a/configure.ac b/configure.ac
>> index a9b1ee4..4b73cdd 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -155,10 +155,10 @@ fi
>>  AC_DEFINE_UNQUOTED(HAVE_PERF_EVENTS, $HAVE_PERF_EVENTS, [Kernel support for perf_events exists])
>>  if test "$HAVE_PERF_EVENTS" = "1"; then
>>       PFM_LIB=
>> -     arch="`uname -m`"
>> -     if test "$arch" = "ppc64" || test "$arch" = "ppc"; then
>> +     if test "$host_cpu" = "powerpc"; 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_os_event_encoding, HAVE_LIBPFM3='0'; HAVE_LIBPFM='1', [
>>                       AC_CHECK_LIB(pfm, pfm_get_event_name, HAVE_LIBPFM3='1'; HAVE_LIBPFM='1',