sparse doesn't support indirect_branch attribute
PATCH 1/1 sparse doesn't support indirect_branch attribute
Don't use __attribute__((indirect_branch)) if we're compiling with sparse.
include/linux/compiler-gcc.h +1 -1
@@ -93,7 +93,7 @@#define __weak __attribute__((weak))#define __alias (symbol) __attribute__((alias(#symbol))) -#ifdef RETPOLINE +#if defined(RETPOLINE ) && !defined(__CHECKER__)#define __noretpoline __attribute__((indirect_branch("keep")))#endif
Quoted 12 lines · Matthew Wilcox
Don't use __attribute__((indirect_branch)) if we're compiling with sparse.
Signed-off-by Matthew Wilcox <[email protected]>include/linux/compiler-gcc.h +0
-0
include/linux/compiler-gcc.h line 99
Quoted 8 lines
include/linux/compiler-gcc.h +1
-1@@ -93,7 +93,7 @@#define __weak __attribute__((weak))#define __alias (symbol) __attribute__((alias(#symbol))) -#ifdef RETPOLINE +#if defined(RETPOLINE ) && !defined(__CHECKER__)#define __noretpoline __attribute__((indirect_branch("keep")))#endif
I don't mind the patch, but I did send a patch for this attribute on Feb. 13, 2018, to the sparse mailing list.
Signature · 1 line
~Randy
Quoted 3 lines · Randy Dunlap
I don't mind the patch, but I did send a patch for this attribute on Feb. 13, 2018, to the sparse mailing list.
I think the sparse plan is to just stop warning about unknown attributes, because it doesn't really help users (at most it's a note to a sparse developer).
But sparse doesn't have the same regular releases the kernel has. Oh well.
Linus
Quoted 8 lines · Linus Torvalds
Quoted 3 lines · Randy Dunlap
I don't mind the patch, but I did send a patch for this attribute on Feb. 13, 2018, to the sparse mailing list.
I think the sparse plan is to just stop warning about unknown attributes, because it doesn't really help users (at most it's a note to a sparse developer).
Yes, there are sparse discussions about that.
There is also a kernel kbuild patch from Luc that Masahiro has also merged that does -Wno-unknown-attributes (or however that is spelled).
Quoted 1 line
But sparse doesn't have the same regular releases the kernel has. Oh well.
Right.
Signature · 1 line
~Randy
Quoted 3 lines · Randy Dunlap
There is also a kernel kbuild patch from Luc that Masahiro has also merged that does -Wno-unknown-attributes (or however that is spelled).
That's probably a better interim workaround.
Linus
Quoted 10 lines · Linus Torvalds
Quoted 3 lines · Randy Dunlap
I don't mind the patch, but I did send a patch for this attribute on Feb. 13, 2018, to the sparse mailing list.
I think the sparse plan is to just stop warning about unknown attributes, because it doesn't really help users (at most it's a note to a sparse developer).
But sparse doesn't have the same regular releases the kernel has. Oh well.
To compensate this, I sent a patch to use '-Wno-unknown-attribute' for kernel builds. Masahiro Yamada has already taken it to the linux-kbuild tree. I'm not sure if it's planned for the next -rc or for 4.17, though.
-- Luc Van Oostenryck
2018-02-28 7:36 GMT+09:00 Luc Van Oostenryck <[email protected]>:
Quoted 10 lines · Linus Torvalds
Quoted 9 lines · Randy Dunlap
Quoted 3 lines
I don't mind the patch, but I did send a patch for this attribute on Feb. 13, 2018, to the sparse mailing list.
I think the sparse plan is to just stop warning about unknown attributes, because it doesn't really help users (at most it's a note to a sparse developer).
Quoted 7 lines
Quoted 1 line
But sparse doesn't have the same regular releases the kernel has. Oh well.
To compensate this, I sent a patch to use '-Wno-unknown-attribute' for kernel builds. Masahiro Yamada has already taken it to the linux-kbuild tree. I'm not sure if it's planned for the next -rc or for 4.17, though.
-- Luc Van Oostenryck
I am planning to send it in the next MW (i.e. v4.17-rc1)
If you want me to send this earlier as fixes PR,
please let me know.
Signature · 2 lines
Best Regards Masahiro Yamada
Quoted 11 lines · Masahiro Yamada
2018-02-28 7:36 GMT+09:00 Luc Van Oostenryck <[email protected]>:
Quoted 4 lines
To compensate this, I sent a patch to use '-Wno-unknown-attribute' for kernel builds. Masahiro Yamada has already taken it to the linux-kbuild tree. I'm not sure if it's planned for the next -rc or for 4.17, though.
I am planning to send it in the next MW (i.e. v4.17-rc1)
If you want me to send this earlier as fixes PR,
please let me know.
Hi,
Thanks for having taken this patch promptly.
Given that the warnings is issued more than 148000 and thus tend to drown the other, more useful, warnings in the noise, I think it would be a good thing to have this patch already in 4.16. I should have put this clearly in the patch description.
Best regards,
-- Luc Van Oostenryck
2018-03-01 19:06 GMT+09:00 Luc Van Oostenryck <[email protected]>:
Quoted 15 lines · Masahiro Yamada
Quoted 11 lines
2018-02-28 7:36 GMT+09:00 Luc Van Oostenryck <[email protected]>:
Quoted 4 lines
To compensate this, I sent a patch to use '-Wno-unknown-attribute' for kernel builds. Masahiro Yamada has already taken it to the linux-kbuild tree. I'm not sure if it's planned for the next -rc or for 4.17, though.
I am planning to send it in the next MW (i.e. v4.17-rc1)
If you want me to send this earlier as fixes PR,
please let me know.Hi,
Quoted 8 lines
Thanks for having taken this patch promptly.
Given that the warnings is issued more than 148000 and thus tend to drown the other, more useful, warnings in the noise, I think it would be a good thing to have this patch already in 4.16. I should have put this clearly in the patch description.Best regards,
-- Luc Van Oostenryck
OK. I will send a PR for v4.16-rc4 this weekend.
Signature · 2 lines
Best Regards Masahiro Yamada