From owner-freebsd-toolchain@FreeBSD.ORG Wed Apr 1 16:40:12 2015 Return-Path: Delivered-To: freebsd-toolchain@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2DA6B22E; Wed, 1 Apr 2015 16:40:12 +0000 (UTC) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D64757E1; Wed, 1 Apr 2015 16:40:11 +0000 (UTC) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t31GeAAD013102 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 1 Apr 2015 09:40:10 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id t31GeAUq013101; Wed, 1 Apr 2015 09:40:10 -0700 (PDT) (envelope-from jmg) Date: Wed, 1 Apr 2015 09:40:10 -0700 From: John-Mark Gurney To: Craig Rodrigues Subject: Re: Kernel compilation failures with gcc 4.9 Message-ID: <20150401164010.GW51048@funkthat.com> References: <507CA323-8304-4FDB-A4B7-24A3683F265E@me.com> <1947119C-82A3-41C7-B9E5-98A99616F551@bsdimp.com> <20150401051051.GT51048@funkthat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Wed, 01 Apr 2015 09:40:10 -0700 (PDT) Cc: "freebsd-testing@freebsd.org" , FreeBSD Toolchain X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2015 16:40:12 -0000 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 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 > > /* Get _mm_malloc () and _mm_free (). */ > +#if __STDC_HOSTED__ > #include > +#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."