Kernel compilation failures with gcc 4.9

John-Mark Gurney jmg at
Wed Apr 1 05:11:00 UTC 2015

Craig Rodrigues wrote this message on Tue, Mar 31, 2015 at 19:28 -0700:
> On Tue, Mar 31, 2015 at 4:55 PM, Warner Losh <imp at> wrote:
> > > It shouldn't be using the stdlib when it's built with -ffreestanding or
> > -nostdlib.  Can you make sure?
> >
> > The AES stuff breaks the rules, and this is a consequence of it :( That
> > stuff should be fixed.
> Do you have time to help fix compilation with gcc 4.9 of AESNI in the
> kernel?
> It currently does not compile with gcc 4.9.
> See my original bug report here:
> We are trying to fix the kernel build enough with gcc 4.9 so that
> we can at least set up a Jenkins continuous build (with -Werror turned off
> initially).

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:

A similar fix needs to be applied here...

  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