Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Apr 2015 09:40:10 -0700
From:      John-Mark Gurney <jmg@funkthat.com>
To:        Craig Rodrigues <rodrigc@FreeBSD.org>
Cc:        "freebsd-testing@freebsd.org" <freebsd-testing@FreeBSD.org>, FreeBSD Toolchain <freebsd-toolchain@FreeBSD.org>
Subject:   Re: Kernel compilation failures with gcc 4.9
Message-ID:  <20150401164010.GW51048@funkthat.com>
In-Reply-To: <CAG=rPVfbApp15R7xO-_EuA%2Bj%2Bb278tJP-ERcdjWhsOX36JaYkg@mail.gmail.com>
References:  <CAG=rPVfA3fVQ__XoBewKh0u0buO9NNt6uB4Yv9EUy2Rn8H%2B2Yw@mail.gmail.com> <507CA323-8304-4FDB-A4B7-24A3683F265E@me.com> <1947119C-82A3-41C7-B9E5-98A99616F551@bsdimp.com> <CAG=rPVfH6hvH9OSf4nM5fk-q0yqVUs8aRfxLEu20F1ikXYd06g@mail.gmail.com> <20150401051051.GT51048@funkthat.com> <CAG=rPVfbApp15R7xO-_EuA%2Bj%2Bb278tJP-ERcdjWhsOX36JaYkg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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@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."



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150401164010.GW51048>