[OE-core] [PATCH 5/6] Fix sysprof for powerpc64

McClintock Matthew-B29882 B29882 at freescale.com
Wed Oct 5 06:44:59 UTC 2011


On Tue, Oct 4, 2011 at 7:05 PM, Khem Raj <raj.khem at gmail.com> wrote:
>> diff --git a/meta/recipes-kernel/sysprof/sysprof_git.bb
>> b/meta/recipes-kernel/sysprof/sysprof_git.bb
>> index 10bde04..271b5d8 100644
>> --- a/meta/recipes-kernel/sysprof/sysprof_git.bb
>> +++ b/meta/recipes-kernel/sysprof/sysprof_git.bb
>> @@ -16,6 +16,8 @@ SRC_URI_append_arm  = " file://rmb-arm.patch"
>>  SRC_URI_append_mips = " file://rmb-mips.patch"
>>  SRC_URI_append_powerpc = " file://ppc-macro-fix.patch"
>>
>> +export CFLAGS_append_powerpc64 = " -D__ppc64__"
>> +
>
> this is a gcc built-in define I wonder why you need to add it explicitly

The file in question is compiled like:

powerpc64-fsl-linux-gcc     -m64 -mcpu=e5500
--sysroot=/local/home/mattsm/git/poky/build_p5020ds-64b_release/tmp/sysroots/p5020ds-64b
-DHAVE_CONFIG_H -I.
-I/local/home/mattsm/git/poky/build_p5020ds-64b_release/tmp/sysroots/p5020ds-64b/usr/include/glib-2.0
-I/local/home/mattsm/git/poky/build_p5020ds-64b_release/tmp/sysroots/p5020ds-64b/usr/lib64/glib-2.0/include
    -O2 -pipe -g -feliminate-unused-debug-types -Wall -MT
sysprof_cli-collector.o -MD -MP -MF .deps/sysprof_cli-collector.Tpo -c
-o sysprof_cli-collector.o `test -f 'collector.c' || echo
'./'`collector.c

Without the -D__ppc64__ it gives the following:

collector.c: In function ‘sysprof_perf_counter_open’:
collector.c:193:21: error: ‘__NR_perf_counter_open’ undeclared (first
use in this function)
collector.c:193:21: note: each undeclared identifier is reported only
once for each function it appears in
collector.c: In function ‘process_event’:
collector.c:654:11: warning: variable ‘name’ set but not used
[-Wunused-but-set-variable]
collector.c: In function ‘sysprof_perf_counter_open’:
collector.c:194:1: warning: control reaches end of non-void function
[-Wreturn-type]

Looking at collector.c it's very simple:

#ifndef __NR_perf_counter_open
#if defined(__i386__)
#define __NR_perf_counter_open 336
#elif defined(__x86_64__)
#define __NR_perf_counter_open 298
[...snip...]
#elif defined(__hppa__)
#define __NR_perf_counter_open 318
#elif defined(__ppc__) || defined(__ppc64__)
#define __NR_perf_counter_open 319
#elif defined(__s390__)
[...snip...]
#endif
#endif

Am I missing something obvious?

-M




More information about the Openembedded-core mailing list