linux-yocto-3.0: Fix compile failure in perf
PATCH 1/1 linux-yocto-3.0: Fix compile failure in perf
--- ...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
meta/recipes-kernel/linux/linux-yocto/0001-compiler.h-Undef-before-redefining-__attribute_const.patch new file +33 -0
@@ -0,0 +1,33 @@ +From 6f92ab6de9d8daeb575949bbbcbc7bcdcebc60af Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +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 <[email protected]> +--- + 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 +
meta/recipes-kernel/linux/linux-yocto_3.0.bb +3 -1
@@ -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)"
Signature · 1 line
1.7.5.4
Quoted 6 lines · Khem Raj
Signed-off-by Khem Raj <[email protected]>---
...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 ?
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,
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.
Cheers,
Bruce
Quoted 63 lines
meta/recipes-kernel/linux/linux-yocto/0001-compiler.h-Undef-before-redefining-__attribute_const.patch new file +33
-0@@ -0,0 +1,33 @@ +From 6f92ab6de9d8daeb575949bbbcbc7bcdcebc60af Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +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 <[email protected]> +--- + 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 +meta/recipes-kernel/linux/linux-yocto_3.0.bb +0
-0@@ -23,7 +23,9 @@ SRCREV_meta ?= "c979f1365b1eb74e882b2cbbc8407ec536ab6eb8"PR = "r2"
PV = "${LINUX_VERSION}+git${SRCPV}"meta/recipes-kernel/linux/linux-yocto_3.0.bb +3
-1-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
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end"
Quoted 8 lines · Bruce Ashfield
Quoted 6 lines · Khem Raj
Signed-off-by Khem Raj <[email protected]>---
...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
Quoted 6 lines
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.
Quoted 8 lines
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.
Quoted 8 lines
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 ?
Quoted 4 lines
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
Quoted 78 lines
Cheers,
Bruce
Quoted 55 lines
meta/recipes-kernel/linux/linux-yocto/0001-compiler.h-Undef-before-redefining-__attribute_const.patch new file +33
-0@@ -0,0 +1,33 @@ +From 6f92ab6de9d8daeb575949bbbcbc7bcdcebc60af Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +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 <[email protected]> +--- + 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 +meta/recipes-kernel/linux/linux-yocto_3.0.bb +0
-0@@ -23,7 +23,9 @@ SRCREV_meta ?= "c979f1365b1eb74e882b2cbbc8407ec536ab6eb8"PR = "r2"
PV = "${LINUX_VERSION}+git${SRCPV}"meta/recipes-kernel/linux/linux-yocto_3.0.bb +3
-1-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)"
Quoted 8 lines
--
1.7.5.4_______________________________________________
Openembedded-core mailing list
[email protected]
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
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Quoted 12 lines · Khem Raj
Quoted 10 lines · Bruce Ashfield
Quoted 6 lines · Khem Raj
Signed-off-by Khem Raj <[email protected]>---
...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.patchKhem,
Quoted 8 lines
Quoted 4 lines
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.hwhich is a header from libc.
Aha. Perfect. This explains it completely.
Quoted 13 lines
Quoted 13 lines
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.
Quoted 6 lines
Quoted 4 lines
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 ?
Yep!
Quoted 9 lines
Quoted 5 lines
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
I'll grab it, no need to resend. I'm doing 3.0.16 merging right now, so I can collect
it with that set of changes.
Cheers,
Bruce
Quoted 84 lines
Quoted 75 lines
Cheers,
Bruce
Quoted 55 lines
meta/recipes-kernel/linux/linux-yocto/0001-compiler.h-Undef-before-redefining-__attribute_const.patch new file +33
-0@@ -0,0 +1,33 @@ +From 6f92ab6de9d8daeb575949bbbcbc7bcdcebc60af Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +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 <[email protected]> +--- + 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 +meta/recipes-kernel/linux/linux-yocto_3.0.bb +0
-0@@ -23,7 +23,9 @@ SRCREV_meta ?= "c979f1365b1eb74e882b2cbbc8407ec536ab6eb8"PR = "r2"
PV = "${LINUX_VERSION}+git${SRCPV}"meta/recipes-kernel/linux/linux-yocto_3.0.bb +3
-1-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)"
Quoted 8 lines
--
1.7.5.4_______________________________________________
Openembedded-core mailing list
[email protected]
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"Quoted 4 lines
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end"
Quoted 18 lines · Bruce Ashfield
Quoted 17 lines · Khem Raj
Quoted 14 lines · Bruce Ashfield
Quoted 6 lines · Khem Raj
Signed-off-by Khem Raj <[email protected]>---
...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.patchKhem,
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 ?
Quoted 18 lines
Quoted 3 lines
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.hwhich is a header from libc.Aha. Perfect. This explains it completely.
Quoted 12 lines
Quoted 12 lines
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.
btw. I made the change thinking that perf utils want it that way to I undefine the previous definitions before redefining. But if it was a placeholder where it was defined because something needed it and there was no definitions from standard include headers then I think right fix would be to check if its defined before redefining it. In both cases the warning will go away
However with current patch the behaviour remains same as it was but if we check for definition before redefining then that may change.
Quoted 123 lines
Quoted 7 lines
Quoted 5 lines
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 ?
Yep!
Quoted 9 lines
Quoted 5 lines
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'ableI'll grab it, no need to resend. I'm doing 3.0.16 merging right now, so I can collect
it with that set of changes.Cheers,
Bruce
Quoted 80 lines
Quoted 75 lines
Cheers,
Bruce
Quoted 55 lines
meta/recipes-kernel/linux/linux-yocto/0001-compiler.h-Undef-before-redefining-__attribute_const.patch new file +33
-0@@ -0,0 +1,33 @@ +From 6f92ab6de9d8daeb575949bbbcbc7bcdcebc60af Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +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 <[email protected]> +--- + 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 +meta/recipes-kernel/linux/linux-yocto_3.0.bb +0
-0@@ -23,7 +23,9 @@ SRCREV_meta ?= "c979f1365b1eb74e882b2cbbc8407ec536ab6eb8"PR = "r2"
PV = "${LINUX_VERSION}+git${SRCPV}"meta/recipes-kernel/linux/linux-yocto_3.0.bb +3
-1-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)"
Quoted 8 lines
--
1.7.5.4_______________________________________________
Openembedded-core mailing list
[email protected]
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"Quoted 4 lines
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-coreQuoted 4 lines
_______________________________________________
Openembedded-core mailing list
[email protected]
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
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Quoted 39 lines · Khem Raj
Quoted 18 lines · Bruce Ashfield
Quoted 17 lines · Khem Raj
Quoted 14 lines · Bruce Ashfield
Quoted 6 lines · Khem Raj
Signed-off-by Khem Raj <[email protected]>---
...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.patchKhem,
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 ?Quoted 18 lines
Quoted 3 lines
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.hwhich is a header from libc.Aha. Perfect. This explains it completely.
Quoted 12 lines
Quoted 12 lines
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.
Quoted 8 lines
btw. I made the change thinking that perf utils want it that way to I undefine the previous definitions before redefining. But if it was a placeholder where it was defined because something needed it and there was no definitions from standard include headers then I think right fix would be to check if its defined before redefining it. In both cases the warning will go away
However with current patch the behaviour remains same as it was but if we check for definition before redefining then that may change.
Agreed. Let's keep the behaviour just as it was (just without warnings for now), and
if it needs to change in the future, that's easy enough to do as well.
I'm grabbing this change now.
Cheers,
Bruce
Quoted 129 lines
Quoted 116 lines
Quoted 8 lines
Quoted 6 lines
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 ?
Yep!
Quoted 9 lines
Quoted 5 lines
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'ableI'll grab it, no need to resend. I'm doing 3.0.16 merging right now, so I can collect
it with that set of changes.Cheers,
Bruce
Quoted 80 lines
Quoted 75 lines
Cheers,
Bruce
Quoted 55 lines
meta/recipes-kernel/linux/linux-yocto/0001-compiler.h-Undef-before-redefining-__attribute_const.patch new file +33
-0@@ -0,0 +1,33 @@ +From 6f92ab6de9d8daeb575949bbbcbc7bcdcebc60af Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +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 <[email protected]> +--- + 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 +meta/recipes-kernel/linux/linux-yocto_3.0.bb +0
-0@@ -23,7 +23,9 @@ SRCREV_meta ?= "c979f1365b1eb74e882b2cbbc8407ec536ab6eb8"PR = "r2"
PV = "${LINUX_VERSION}+git${SRCPV}"meta/recipes-kernel/linux/linux-yocto_3.0.bb +3
-1-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)"
Quoted 8 lines
--
1.7.5.4_______________________________________________
Openembedded-core mailing list
[email protected]
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"Quoted 4 lines
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-coreQuoted 4 lines
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-coreQuoted 8 lines
--
"Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end"_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end"
Quoted 46 lines · Bruce Ashfield
Quoted 45 lines · Khem Raj
Quoted 18 lines · Bruce Ashfield
Quoted 17 lines · Khem Raj
Quoted 14 lines · Bruce Ashfield
Quoted 6 lines · Khem Raj
Signed-off-by Khem Raj<[email protected]>--- ...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.patchKhem,
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 ?Quoted 18 lines
Quoted 3 lines
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.hwhich is a header from libc.Aha. Perfect. This explains it completely.
Quoted 12 lines
Quoted 12 lines
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.btw. I made the change thinking that perf utils want it that way to I undefine the previous definitions before redefining. But if it was a placeholder where it was defined because something needed it and there was no definitions from standard include headers then I think right fix would be to check if its defined before redefining it. In both cases the warning will go away
Quoted 9 lines
Quoted 2 lines
However with current patch the behaviour remains same as it was but if we check for definition before redefining then that may change.
Agreed. Let's keep the behaviour just as it was (just without warnings for now), and
if it needs to change in the future, that's easy enough to do as well.I'm grabbing this change now.
Just to confirm, with Bruce and Khem:
If this change comes in from Bruce before we grab the 2.15 eglibc, we won't need the patch, correct?
I am going to hold off pulling this patch for now.
Sau!
Quoted 136 lines
Cheers,
Bruce
Quoted 129 lines
Quoted 116 lines
Quoted 8 lines
Quoted 6 lines
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 ?
Yep!
Quoted 9 lines
Quoted 5 lines
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'ableI'll grab it, no need to resend. I'm doing 3.0.16 merging right now, so I can collect
it with that set of changes.Cheers,
Bruce
Quoted 80 lines
Quoted 75 lines
Cheers,
Bruce
Quoted 59 lines
meta/recipes-kernel/linux/linux-yocto/0001-compiler.h-Undef-before-redefining-__attribute_const.patch new file +33
-0@@ -0,0 +1,33 @@ +From 6f92ab6de9d8daeb575949bbbcbc7bcdcebc60af Mon Sep 17 00:00:00 2001 +From: Khem Raj<[email protected]> +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<[email protected]> +--- + 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 +meta/recipes-kernel/linux/linux-yocto_3.0.bb +3
-2@@ -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
Quoted 4 lines
_______________________________________________
Openembedded-core mailing list
[email protected]
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"Quoted 4 lines
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-coreQuoted 4 lines
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-coreQuoted 8 lines
--
"Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end"_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Quoted 72 lines · Saul Wold
Quoted 71 lines · Bruce Ashfield
Quoted 60 lines · Khem Raj
Quoted 26 lines · Bruce Ashfield
Quoted 24 lines · Khem Raj
Quoted 19 lines · Bruce Ashfield
Quoted 9 lines · Khem Raj
Signed-off-by Khem Raj<[email protected]>---
...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.patchKhem,
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 ?Quoted 19 lines
Quoted 3 lines
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.hwhich is a header from libc.Aha. Perfect. This explains it completely.
Quoted 12 lines
Quoted 12 lines
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.btw. I made the change thinking that perf utils want it that way to I undefine
the previous definitions before redefining. But if it was a placeholder where
it was defined because something needed it and there was no definitions from
standard include headers then I think right fix would be to check if its defined
before redefining it. In both cases the warning will go awayQuoted 3 lines
However with current patch the behaviour remains same as it was but if we check
for definition before redefining then that may change.Agreed. Let's keep the behaviour just as it was (just without warnings for now), and
if it needs to change in the future, that's easy enough to do as well.
Quoted 6 lines
Quoted 2 lines
I'm grabbing this change now.
Just to confirm, with Bruce and Khem:
If this change comes in from Bruce before we grab the 2.15 eglibc, we won't need the patch, correct?
I'll take the patch now in preparation for any updates to 2.15, and put it in both the 3.0 and -dev (3.2) kernel trees. We won't technically need it, but there's
no harm when it is in place, so it's fine to have in the tree ahead of time.
Cheers,
Bruce
Quoted 164 lines
I am going to hold off pulling this patch for now.
Sau!
Quoted 157 lines
Cheers,
Bruce
Quoted 149 lines
Quoted 135 lines
Quoted 9 lines
Quoted 6 lines
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 ?
Yep!
Quoted 9 lines
Quoted 5 lines
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'ableI'll grab it, no need to resend. I'm doing 3.0.16 merging right now, so I can collect
it with that set of changes.Cheers,
Bruce
Quoted 95 lines
Quoted 89 lines
Cheers,
Bruce
Quoted 68 lines
diff --git
a/meta/recipes-kernel/linux/linux-yocto/0001-compiler.h-Undef-before-redefining-__attribute_const.patchb/meta/recipes-kernel/linux/linux-yocto/0001-compiler.h-Undef-before-redefining-__attribute_const.patchnew file mode 100644
index 0000000..b85cc97
---/dev/null
+++b/meta/recipes-kernel/linux/linux-yocto/0001-compiler.h-Undef-before-redefining-__attribute_const.patch(quoted diff) +1
-0@@ -0,0 +1,33 @@ +From 6f92ab6de9d8daeb575949bbbcbc7bcdcebc60af Mon Sep 17 00:00:002001
(quoted diff) +3
-0+From: Khem Raj<[email protected]> +Date: Thu, 5 Jan 2012 11:42:35 -0800 +Subject: [PATCH] compiler.h: Undef before redefining
__attribute_const__(quoted diff) +3
-0+ +This is required to avoid warnings like +util/include/linux/compiler.h:8:0: error: "__attribute_const__"redefined [-Werror]
(quoted diff) +7
-0+ +Signed-off-by: Khem Raj<[email protected]> +--- + 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(quoted diff) +19
-0+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 +meta/recipes-kernel/linux/linux-yocto_3.0.bb +0
-0@@ -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)"
Quoted 8 lines
--
1.7.5.4_______________________________________________
Openembedded-core mailing list
[email protected]
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"Quoted 4 lines
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-coreQuoted 4 lines
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-coreQuoted 8 lines
--
"Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end"_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end"