[OE-core] [PATCH] linux-yocto-3.0: Fix compile failure in perf

Khem Raj raj.khem at gmail.com
Thu Jan 5 20:55:17 UTC 2012


On Thu, Jan 5, 2012 at 12:13 PM, Bruce Ashfield
<bruce.ashfield at gmail.com> wrote:
> On Thu, Jan 5, 2012 at 3:06 PM, Khem Raj <raj.khem at gmail.com> wrote:
>> Signed-off-by: Khem Raj <raj.khem at gmail.com>
>> ---
>>  ...Undef-before-redefining-__attribute_const.patch |   33 ++++++++++++++++++++
>>  meta/recipes-kernel/linux/linux-yocto_3.0.bb       |    4 ++-
>>  2 files changed, 36 insertions(+), 1 deletions(-)
>>  create mode 100644 meta/recipes-kernel/linux/linux-yocto/0001-compiler.h-Undef-before-redefining-__attribute_const.patch
>
> Khem,
>
> I just built multiple linux-yocto kernels, for all the qemu targets
> and haven't seen this
> error at all. Do you have any special configuration that would be
> triggering this ?

yes I am building with eglibc 2.15 ( recipes I have not posted yet)
and this defines is reported to be defined in usr/include/sys/cdefs.h
which is a header from libc.

>
> The change itself looks sane, and in fact makes sense, since the rest
> of the file
> has the same protection for the new defines. Nothing has changed that
> should have triggered
> this to become an issue. I'm just trying to figure out why it has
> popped up now.
>
> I also checked and the 3.2 kernel still has the same issue, so pushing
> it upstream makes
> sense as well.
>
> And I see you asked on IRC, so I'll answer here. Submit a patch to the
> kernel like
> any upstream kernel change. Simply send the patch right from your
> linux working tree,

You mean send to oe-core ml here right ?

> and I'll pickup the change, merge it into the tree, push it out and
> send a pull request
> with updated SRCREVs that collect all the queued changes.
>

Will you be able to bean this patch out from the one I sent or should
I resend it ?
the patch itself should be git am'able

> Cheers,
>
> Bruce
>
>>
>> diff --git a/meta/recipes-kernel/linux/linux-yocto/0001-compiler.h-Undef-before-redefining-__attribute_const.patch b/meta/recipes-kernel/linux/linux-yocto/0001-compiler.h-Undef-before-redefining-__attribute_const.patch
>> new file mode 100644
>> index 0000000..b85cc97
>> --- /dev/null
>> +++ b/meta/recipes-kernel/linux/linux-yocto/0001-compiler.h-Undef-before-redefining-__attribute_const.patch
>> @@ -0,0 +1,33 @@
>> +From 6f92ab6de9d8daeb575949bbbcbc7bcdcebc60af Mon Sep 17 00:00:00 2001
>> +From: Khem Raj <raj.khem at gmail.com>
>> +Date: Thu, 5 Jan 2012 11:42:35 -0800
>> +Subject: [PATCH] compiler.h: Undef before redefining __attribute_const__
>> +
>> +This is required to avoid warnings like
>> +util/include/linux/compiler.h:8:0: error: "__attribute_const__" redefined [-Werror]
>> +
>> +Signed-off-by: Khem Raj <raj.khem at gmail.com>
>> +---
>> + tools/perf/util/include/linux/compiler.h |    4 +++-
>> + 1 files changed, 3 insertions(+), 1 deletions(-)
>> +
>> +diff --git a/tools/perf/util/include/linux/compiler.h b/tools/perf/util/include/linux/compiler.h
>> +index 791f9dd..f17ecef 100644
>> +--- a/tools/perf/util/include/linux/compiler.h
>> ++++ b/tools/perf/util/include/linux/compiler.h
>> +@@ -4,9 +4,11 @@
>> + #ifndef __always_inline
>> + #define __always_inline       inline
>> + #endif
>> ++#undef __user
>> + #define __user
>> ++#undef __attribute_const__
>> + #define __attribute_const__
>> +-
>> ++#undef __used
>> + #define __used                __attribute__((__unused__))
>> +
>> + #endif
>> +--
>> +1.7.5.4
>> +
>> diff --git a/meta/recipes-kernel/linux/linux-yocto_3.0.bb b/meta/recipes-kernel/linux/linux-yocto_3.0.bb
>> index b650c84..2e87f7f 100644
>> --- a/meta/recipes-kernel/linux/linux-yocto_3.0.bb
>> +++ b/meta/recipes-kernel/linux/linux-yocto_3.0.bb
>> @@ -23,7 +23,9 @@ SRCREV_meta ?= "c979f1365b1eb74e882b2cbbc8407ec536ab6eb8"
>>  PR = "r2"
>>  PV = "${LINUX_VERSION}+git${SRCPV}"
>>
>> -SRC_URI = "git://git.yoctoproject.org/linux-yocto-3.0;protocol=git;nocheckout=1;branch=${KBRANCH},meta;name=machine,meta"
>> +SRC_URI = "git://git.yoctoproject.org/linux-yocto-3.0;protocol=git;nocheckout=1;branch=${KBRANCH},meta;name=machine,meta \
>> +           file://0001-compiler.h-Undef-before-redefining-__attribute_const.patch \
>> +           "
>>
>>  COMPATIBLE_MACHINE = "(qemuarm|qemux86|qemuppc|qemumips|qemux86-64)"
>>
>> --
>> 1.7.5.4
>>
>>
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core at lists.openembedded.org
>> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
>
>
> --
> "Thou shalt not follow the NULL pointer, for chaos and madness await
> thee at its end"
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core




More information about the Openembedded-core mailing list