* [U-Boot] (no subject) @ 2016-02-03 12:42 Peter Robinson 2016-02-03 12:42 ` [U-Boot] [PATCH 1/3] Copy gcc5 over to compiler-gcc6.h as a beginning of support Peter Robinson ` (2 more replies) 0 siblings, 3 replies; 12+ messages in thread From: Peter Robinson @ 2016-02-03 12:42 UTC (permalink / raw) To: u-boot Hi All, Here's a couple of patches to help building on gcc-6. We're rebasing Fedora to gcc-6 for Fedora 24 so this was the first build I've attempted with it. It doesn't fix all problems as I also see an issue that the generated/generic-asm-offsets.h isn't generated early enough in the build process but I couldn't quite work out how to move the generation of that earlier in the process. Full logs of that at the link below. Cheers, Peter https://kojipkgs.fedoraproject.org//work/tasks/1747/12801747/build.log ^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 1/3] Copy gcc5 over to compiler-gcc6.h as a beginning of support 2016-02-03 12:42 [U-Boot] (no subject) Peter Robinson @ 2016-02-03 12:42 ` Peter Robinson 2016-02-03 12:42 ` [U-Boot] [PATCH 2/3] common: env_flags: include common.h even for HOST_CC Peter Robinson 2016-02-03 13:17 ` [U-Boot] your mail Tom Rini 2 siblings, 0 replies; 12+ messages in thread From: Peter Robinson @ 2016-02-03 12:42 UTC (permalink / raw) To: u-boot Add initial support for gcc6 by taking a copy of compiler-gcc5.h Signed-off-by: Peter Robinson <pbrobinson@gmail.com> --- include/linux/compiler-gcc6.h | 65 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 include/linux/compiler-gcc6.h diff --git a/include/linux/compiler-gcc6.h b/include/linux/compiler-gcc6.h new file mode 100644 index 0000000..622117b --- /dev/null +++ b/include/linux/compiler-gcc6.h @@ -0,0 +1,65 @@ +#ifndef __LINUX_COMPILER_H +#error "Please don't include <linux/compiler-gcc6.h> directly, include <linux/compiler.h> instead." +#endif + +#define __used __attribute__((__used__)) +#define __must_check __attribute__((warn_unused_result)) +#define __compiler_offsetof(a, b) __builtin_offsetof(a, b) + +/* Mark functions as cold. gcc will assume any path leading to a call + to them will be unlikely. This means a lot of manual unlikely()s + are unnecessary now for any paths leading to the usual suspects + like BUG(), printk(), panic() etc. [but let's keep them for now for + older compilers] + + Early snapshots of gcc 4.3 don't support this and we can't detect this + in the preprocessor, but we can live with this because they're unreleased. + Maketime probing would be overkill here. + + gcc also has a __attribute__((__hot__)) to move hot functions into + a special section, but I don't see any sense in this right now in + the kernel context */ +#define __cold __attribute__((__cold__)) + +#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) + +#ifndef __CHECKER__ +# define __compiletime_warning(message) __attribute__((warning(message))) +# define __compiletime_error(message) __attribute__((error(message))) +#endif /* __CHECKER__ */ + +/* + * Mark a position in code as unreachable. This can be used to + * suppress control flow warnings after asm blocks that transfer + * control elsewhere. + * + * Early snapshots of gcc 4.5 don't support this and we can't detect + * this in the preprocessor, but we can live with this because they're + * unreleased. Really, we need to have autoconf for the kernel. + */ +#define unreachable() __builtin_unreachable() + +/* Mark a function definition as prohibited from being cloned. */ +#define __noclone __attribute__((__noclone__)) + +/* + * Tell the optimizer that something else uses this function or variable. + */ +#define __visible __attribute__((externally_visible)) + +/* + * GCC 'asm goto' miscompiles certain code sequences: + * + * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670 + * + * Work it around via a compiler barrier quirk suggested by Jakub Jelinek. + * + * (asm goto is automatically volatile - the naming reflects this.) + */ +#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) + +#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP +#define __HAVE_BUILTIN_BSWAP32__ +#define __HAVE_BUILTIN_BSWAP64__ +#define __HAVE_BUILTIN_BSWAP16__ +#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ -- 2.5.0 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 2/3] common: env_flags: include common.h even for HOST_CC 2016-02-03 12:42 [U-Boot] (no subject) Peter Robinson 2016-02-03 12:42 ` [U-Boot] [PATCH 1/3] Copy gcc5 over to compiler-gcc6.h as a beginning of support Peter Robinson @ 2016-02-03 12:42 ` Peter Robinson 2016-02-03 13:41 ` Albert ARIBAUD 2016-02-15 22:34 ` Tom Rini 2016-02-03 13:17 ` [U-Boot] your mail Tom Rini 2 siblings, 2 replies; 12+ messages in thread From: Peter Robinson @ 2016-02-03 12:42 UTC (permalink / raw) To: u-boot When compiling with gcc 6 we get the following error due to ARRAY_SIZE being defined elsewhere. common/env_flags.c:155: undefined reference to `ARRAY_SIZE' Signed-off-by: Peter Robinson <pbrobinson@gmail.com> --- common/env_flags.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/env_flags.c b/common/env_flags.c index 9c3aed1..696adef 100644 --- a/common/env_flags.c +++ b/common/env_flags.c @@ -7,6 +7,7 @@ #include <linux/string.h> #include <linux/ctype.h> +#include <common.h> #ifdef USE_HOSTCC /* Eliminate "ANSI does not permit..." warnings */ #include <stdint.h> @@ -16,7 +17,6 @@ #include <env_flags.h> #define getenv fw_getenv #else -#include <common.h> #include <environment.h> #endif -- 2.5.0 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 2/3] common: env_flags: include common.h even for HOST_CC 2016-02-03 12:42 ` [U-Boot] [PATCH 2/3] common: env_flags: include common.h even for HOST_CC Peter Robinson @ 2016-02-03 13:41 ` Albert ARIBAUD 2016-02-03 16:11 ` Peter Robinson 2016-02-15 22:34 ` Tom Rini 1 sibling, 1 reply; 12+ messages in thread From: Albert ARIBAUD @ 2016-02-03 13:41 UTC (permalink / raw) To: u-boot Hello Peter, On Wed, 3 Feb 2016 12:42:51 +0000, Peter Robinson <pbrobinson@gmail.com> wrote: > When compiling with gcc 6 we get the following error due to ARRAY_SIZE being > defined elsewhere. > > common/env_flags.c:155: undefined reference to `ARRAY_SIZE' > > Signed-off-by: Peter Robinson <pbrobinson@gmail.com> > --- > common/env_flags.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/common/env_flags.c b/common/env_flags.c > index 9c3aed1..696adef 100644 > --- a/common/env_flags.c > +++ b/common/env_flags.c > @@ -7,6 +7,7 @@ > > #include <linux/string.h> > #include <linux/ctype.h> > +#include <common.h> > > #ifdef USE_HOSTCC /* Eliminate "ANSI does not permit..." warnings */ > #include <stdint.h> > @@ -16,7 +17,6 @@ > #include <env_flags.h> > #define getenv fw_getenv > #else > -#include <common.h> > #include <environment.h> > #endif How come this happens only with gcc-6? Previous compilers surely did not 'guess' the proper value of ARRAY_SIZE, right? > -- > 2.5.0 > > _______________________________________________ > U-Boot mailing list > U-Boot at lists.denx.de > http://lists.denx.de/mailman/listinfo/u-boot Amicalement, -- Albert. ^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 2/3] common: env_flags: include common.h even for HOST_CC 2016-02-03 13:41 ` Albert ARIBAUD @ 2016-02-03 16:11 ` Peter Robinson 2016-02-03 17:53 ` Albert ARIBAUD 0 siblings, 1 reply; 12+ messages in thread From: Peter Robinson @ 2016-02-03 16:11 UTC (permalink / raw) To: u-boot Hi Albert, On Wed, Feb 3, 2016 at 1:41 PM, Albert ARIBAUD <albert.u.boot@aribaud.net> wrote: > Hello Peter, > > On Wed, 3 Feb 2016 12:42:51 +0000, Peter Robinson > <pbrobinson@gmail.com> wrote: >> When compiling with gcc 6 we get the following error due to ARRAY_SIZE being >> defined elsewhere. >> >> common/env_flags.c:155: undefined reference to `ARRAY_SIZE' >> >> Signed-off-by: Peter Robinson <pbrobinson@gmail.com> >> --- >> common/env_flags.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/common/env_flags.c b/common/env_flags.c >> index 9c3aed1..696adef 100644 >> --- a/common/env_flags.c >> +++ b/common/env_flags.c >> @@ -7,6 +7,7 @@ >> >> #include <linux/string.h> >> #include <linux/ctype.h> >> +#include <common.h> >> >> #ifdef USE_HOSTCC /* Eliminate "ANSI does not permit..." warnings */ >> #include <stdint.h> >> @@ -16,7 +17,6 @@ >> #include <env_flags.h> >> #define getenv fw_getenv >> #else >> -#include <common.h> >> #include <environment.h> >> #endif > > How come this happens only with gcc-6? Previous compilers surely did not > 'guess' the proper value of ARRAY_SIZE, right? So testing this RC on on Fedora 23 with gcc 5.3.1 I see the same failure, I didn't see it with 2016.01 when using 5.3.1 so I'm not sure what's changed there Peter ^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 2/3] common: env_flags: include common.h even for HOST_CC 2016-02-03 16:11 ` Peter Robinson @ 2016-02-03 17:53 ` Albert ARIBAUD 2016-02-03 19:14 ` Tom Rini 0 siblings, 1 reply; 12+ messages in thread From: Albert ARIBAUD @ 2016-02-03 17:53 UTC (permalink / raw) To: u-boot Hello Peter, On Wed, 3 Feb 2016 16:11:38 +0000, Peter Robinson <pbrobinson@gmail.com> wrote: > Hi Albert, > > On Wed, Feb 3, 2016 at 1:41 PM, Albert ARIBAUD > <albert.u.boot@aribaud.net> wrote: > > Hello Peter, > > > > On Wed, 3 Feb 2016 12:42:51 +0000, Peter Robinson > > <pbrobinson@gmail.com> wrote: > >> When compiling with gcc 6 we get the following error due to ARRAY_SIZE being > >> defined elsewhere. > >> > >> common/env_flags.c:155: undefined reference to `ARRAY_SIZE' > >> > >> Signed-off-by: Peter Robinson <pbrobinson@gmail.com> > >> --- > >> common/env_flags.c | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git a/common/env_flags.c b/common/env_flags.c > >> index 9c3aed1..696adef 100644 > >> --- a/common/env_flags.c > >> +++ b/common/env_flags.c > >> @@ -7,6 +7,7 @@ > >> > >> #include <linux/string.h> > >> #include <linux/ctype.h> > >> +#include <common.h> > >> > >> #ifdef USE_HOSTCC /* Eliminate "ANSI does not permit..." warnings */ > >> #include <stdint.h> > >> @@ -16,7 +17,6 @@ > >> #include <env_flags.h> > >> #define getenv fw_getenv > >> #else > >> -#include <common.h> > >> #include <environment.h> > >> #endif > > > > How come this happens only with gcc-6? Previous compilers surely did not > > 'guess' the proper value of ARRAY_SIZE, right? > > So testing this RC on on Fedora 23 with gcc 5.3.1 I see the same > failure, I didn't see it with 2016.01 when using 5.3.1 so I'm not sure > what's changed there OK, so maybe unrelated to gcc 6. Could you git bisect? > Peter Amicalement, -- Albert. ^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 2/3] common: env_flags: include common.h even for HOST_CC 2016-02-03 17:53 ` Albert ARIBAUD @ 2016-02-03 19:14 ` Tom Rini 0 siblings, 0 replies; 12+ messages in thread From: Tom Rini @ 2016-02-03 19:14 UTC (permalink / raw) To: u-boot On Wed, Feb 03, 2016 at 06:53:11PM +0100, Albert ARIBAUD wrote: > Hello Peter, > > On Wed, 3 Feb 2016 16:11:38 +0000, Peter Robinson > <pbrobinson@gmail.com> wrote: > > Hi Albert, > > > > On Wed, Feb 3, 2016 at 1:41 PM, Albert ARIBAUD > > <albert.u.boot@aribaud.net> wrote: > > > Hello Peter, > > > > > > On Wed, 3 Feb 2016 12:42:51 +0000, Peter Robinson > > > <pbrobinson@gmail.com> wrote: > > >> When compiling with gcc 6 we get the following error due to ARRAY_SIZE being > > >> defined elsewhere. > > >> > > >> common/env_flags.c:155: undefined reference to `ARRAY_SIZE' > > >> > > >> Signed-off-by: Peter Robinson <pbrobinson@gmail.com> > > >> --- > > >> common/env_flags.c | 2 +- > > >> 1 file changed, 1 insertion(+), 1 deletion(-) > > >> > > >> diff --git a/common/env_flags.c b/common/env_flags.c > > >> index 9c3aed1..696adef 100644 > > >> --- a/common/env_flags.c > > >> +++ b/common/env_flags.c > > >> @@ -7,6 +7,7 @@ > > >> > > >> #include <linux/string.h> > > >> #include <linux/ctype.h> > > >> +#include <common.h> > > >> > > >> #ifdef USE_HOSTCC /* Eliminate "ANSI does not permit..." warnings */ > > >> #include <stdint.h> > > >> @@ -16,7 +17,6 @@ > > >> #include <env_flags.h> > > >> #define getenv fw_getenv > > >> #else > > >> -#include <common.h> > > >> #include <environment.h> > > >> #endif > > > > > > How come this happens only with gcc-6? Previous compilers surely did not > > > 'guess' the proper value of ARRAY_SIZE, right? > > > > So testing this RC on on Fedora 23 with gcc 5.3.1 I see the same > > failure, I didn't see it with 2016.01 when using 5.3.1 so I'm not sure > > what's changed there > > OK, so maybe unrelated to gcc 6. Could you git bisect? Please, gcc 5.3.x is one of my regular tests now. But I don't do a tools only build (tossing that on my TODO list..). -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160203/61d13f1e/attachment.sig> ^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 2/3] common: env_flags: include common.h even for HOST_CC 2016-02-03 12:42 ` [U-Boot] [PATCH 2/3] common: env_flags: include common.h even for HOST_CC Peter Robinson 2016-02-03 13:41 ` Albert ARIBAUD @ 2016-02-15 22:34 ` Tom Rini 2016-02-16 11:19 ` Peter Robinson 1 sibling, 1 reply; 12+ messages in thread From: Tom Rini @ 2016-02-15 22:34 UTC (permalink / raw) To: u-boot On Wed, Feb 03, 2016 at 12:42:51PM +0000, Peter Robinson wrote: > When compiling with gcc 6 we get the following error due to ARRAY_SIZE being > defined elsewhere. > > common/env_flags.c:155: undefined reference to `ARRAY_SIZE' > > Signed-off-by: Peter Robinson <pbrobinson@gmail.com> I'm going to take http://patchwork.ozlabs.org/patch/582527/ to fix this instead as I don't want to say that common.h must work in the case of USE_HOSTCC==true (I'm surprised it did, in fact). Thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160215/86a2b068/attachment.sig> ^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 2/3] common: env_flags: include common.h even for HOST_CC 2016-02-15 22:34 ` Tom Rini @ 2016-02-16 11:19 ` Peter Robinson 2016-02-16 12:18 ` Tom Rini 0 siblings, 1 reply; 12+ messages in thread From: Peter Robinson @ 2016-02-16 11:19 UTC (permalink / raw) To: u-boot >> When compiling with gcc 6 we get the following error due to ARRAY_SIZE being >> defined elsewhere. >> >> common/env_flags.c:155: undefined reference to `ARRAY_SIZE' >> >> Signed-off-by: Peter Robinson <pbrobinson@gmail.com> > > I'm going to take http://patchwork.ozlabs.org/patch/582527/ to fix this > instead as I don't want to say that common.h must work in the case of > USE_HOSTCC==true (I'm surprised it did, in fact). Thanks! What ever was pulled into RC2 works for me but I still needed my gcc6 patch. Peter ^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 2/3] common: env_flags: include common.h even for HOST_CC 2016-02-16 11:19 ` Peter Robinson @ 2016-02-16 12:18 ` Tom Rini 0 siblings, 0 replies; 12+ messages in thread From: Tom Rini @ 2016-02-16 12:18 UTC (permalink / raw) To: u-boot On Tue, Feb 16, 2016 at 11:19:43AM +0000, Peter Robinson wrote: > >> When compiling with gcc 6 we get the following error due to ARRAY_SIZE being > >> defined elsewhere. > >> > >> common/env_flags.c:155: undefined reference to `ARRAY_SIZE' > >> > >> Signed-off-by: Peter Robinson <pbrobinson@gmail.com> > > > > I'm going to take http://patchwork.ozlabs.org/patch/582527/ to fix this > > instead as I don't want to say that common.h must work in the case of > > USE_HOSTCC==true (I'm surprised it did, in fact). Thanks! > > What ever was pulled into RC2 works for me but I still needed my gcc6 patch. Somewhere along the lines, Linux stopped having compiler-gccN.h and just has compiler-gcc.h and compiler-clang.h. Would you feel up to making a pass at migrating those changes or should I? Thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160216/a3c77ee0/attachment.sig> ^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] your mail 2016-02-03 12:42 [U-Boot] (no subject) Peter Robinson 2016-02-03 12:42 ` [U-Boot] [PATCH 1/3] Copy gcc5 over to compiler-gcc6.h as a beginning of support Peter Robinson 2016-02-03 12:42 ` [U-Boot] [PATCH 2/3] common: env_flags: include common.h even for HOST_CC Peter Robinson @ 2016-02-03 13:17 ` Tom Rini 2016-02-03 13:20 ` Peter Robinson 2 siblings, 1 reply; 12+ messages in thread From: Tom Rini @ 2016-02-03 13:17 UTC (permalink / raw) To: u-boot On Wed, Feb 03, 2016 at 12:42:49PM +0000, Peter Robinson wrote: > > Hi All, > > Here's a couple of patches to help building on gcc-6. We're rebasing Fedora to gcc-6 for Fedora 24 so this was the first build I've attempted with it. It doesn't fix all problems as I also see an issue that the generated/generic-asm-offsets.h isn't generated early enough in the build process but I couldn't quite work out how to move the generation of that earlier in the process. Full logs of that at the link below. > > Cheers, > Peter > > https://kojipkgs.fedoraproject.org//work/tasks/1747/12801747/build.log Oh fun, I saw some gcc-6 packages in debian/unstable but not a way to make them be "$arch-gcc" and not "$arch-gcc-6". At least with respect to this error, do you see it in the kernel too? If not, maybe there's a semi recent patch we need? -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160203/03335584/attachment.sig> ^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] your mail 2016-02-03 13:17 ` [U-Boot] your mail Tom Rini @ 2016-02-03 13:20 ` Peter Robinson 0 siblings, 0 replies; 12+ messages in thread From: Peter Robinson @ 2016-02-03 13:20 UTC (permalink / raw) To: u-boot >> Here's a couple of patches to help building on gcc-6. We're rebasing Fedora to gcc-6 for Fedora 24 so this was the first build I've attempted with it. It doesn't fix all problems as I also see an issue that the generated/generic-asm-offsets.h isn't generated early enough in the build process but I couldn't quite work out how to move the generation of that earlier in the process. Full logs of that at the link below. >> >> Cheers, >> Peter >> >> https://kojipkgs.fedoraproject.org//work/tasks/1747/12801747/build.log > > Oh fun, I saw some gcc-6 packages in debian/unstable but not a way to > make them be "$arch-gcc" and not "$arch-gcc-6". At least with respect > to this error, do you see it in the kernel too? If not, maybe there's a > semi recent patch we need? I'm not sure if there was issues with the kernel, there could have been since it landed as was fixed before I noticed or maybe the kernel was tested by the toolchains team, I'll see if I can find out. Peter ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2016-02-16 12:18 UTC | newest] Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2016-02-03 12:42 [U-Boot] (no subject) Peter Robinson 2016-02-03 12:42 ` [U-Boot] [PATCH 1/3] Copy gcc5 over to compiler-gcc6.h as a beginning of support Peter Robinson 2016-02-03 12:42 ` [U-Boot] [PATCH 2/3] common: env_flags: include common.h even for HOST_CC Peter Robinson 2016-02-03 13:41 ` Albert ARIBAUD 2016-02-03 16:11 ` Peter Robinson 2016-02-03 17:53 ` Albert ARIBAUD 2016-02-03 19:14 ` Tom Rini 2016-02-15 22:34 ` Tom Rini 2016-02-16 11:19 ` Peter Robinson 2016-02-16 12:18 ` Tom Rini 2016-02-03 13:17 ` [U-Boot] your mail Tom Rini 2016-02-03 13:20 ` Peter Robinson
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.