Kernel compilation failures with gcc 4.9

John-Mark Gurney jmg at funkthat.com
Wed Apr 1 16:40:12 UTC 2015


Craig Rodrigues wrote this message on Wed, Apr 01, 2015 at 07:59 -0700:
> On Tue, Mar 31, 2015 at 10:10 PM, John-Mark Gurney <jmg at funkthat.com> wrote:
> >
> >
> > This is an issue w/ gcc 4.9's headers... It is including stdlib.h,
> > via mm_malloc.h which is conflicting w/ sys/malloc.h's version of free..
> >
> > kan wrapped the include of mm_malloc.h in an #if __STDC_HOSTED__ which is
> > why gcc 4.2 doesn't have the issue per my request a couple years ago:
> > https://svnweb.freebsd.org/changeset/base/r242182
> >
> > A similar fix needs to be applied here...
> 
> 
> Interesting, so r242182 does this inside the gcc header file itself:
> 
> --- head/contrib/gcc/config/i386/xmmintrin.h 2011/03/14 13:31:34 219639
> +++ head/contrib/gcc/config/i386/xmmintrin.h 2012/10/27 17:39:36 242182
> @@ -39,7 +39,9 @@
>  #include <mmintrin.h>
> 
>  /* Get _mm_malloc () and _mm_free ().  */
> +#if __STDC_HOSTED__
>  #include <mm_malloc.h>
> +#endif
> 
> 
> We would need to apply the same patch to the gcc header
> file in gcc 4.9.  I'm not sure if that will be allowed, since the
> direction we are going in is to support gcc as an external toolchain,
> unless we can push that change upstream to gcc.
> I'll let the toolchain@ team decide that one.
> 
> The alternative is to patch the aesni header files.  This patch is
> a bit gross, but I was able to compile an entire GENERIC kernel (including
> aesni) with gcc 4.9:

Yes, I did think of that...  If we do this... We need to make sure
to include a comment about this hack being for GCC, and/or we should
probably make it dependant on GCC...  Don't want to make things worse
for compilers that do it properly...

> +#define _MM_MALLOC_H_INCLUDED 1

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."


More information about the freebsd-testing mailing list