This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH,i386] Don't use errno when freestanding (was: config/i386/xmmintrin.h: Only #include <mm_malloc.h> if __STDC_HOSTED__)
- From: Jeff Law <law at redhat dot com>
- To: Gerald Pfeifer <gerald at pfeifer dot com>, Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Andreas Tobler <andreast at FreeBSD dot org>, Alexander Kabaev <kan at freebsd dot org>
- Date: Mon, 19 Aug 2019 16:49:32 -0600
- Subject: Re: [PATCH,i386] Don't use errno when freestanding (was: config/i386/xmmintrin.h: Only #include <mm_malloc.h> if __STDC_HOSTED__)
- References: <alpine.LSU.firstname.lastname@example.org> <20171209184549.GE2353@tucnak> <alpine.LSU.email@example.com>
On 8/18/19 10:29 AM, Gerald Pfeifer wrote:
> On Sat, 9 Dec 2017, Jakub Jelinek wrote:
>>> Some users on FreeBSD noticed a problem when trying to use GCC to
>>> build things in a standalone environment that manifests itself as
>>> /usr/local/lib/gcc/x86_64-unknown-freebsd11.0/6.3.0/include/xmmintrin.h:34 from
>>> /usr/local/lib/gcc/x86_64-unknown-freebsd11.0/6.3.0/include/immintrin.h:29 from
>>> In function '_mm_malloc':
>>> error: 'errno' undeclared (first use in this function)
>>> It turns out the clang version of xmmintrin.h does not include mm_malloc.h
>>> if !__STDC_HOSTED__ whereas ours unconditionally does so.
>> Wouldn't it be better to just ifdef out parts of gmm_malloc.h (pmm_malloc.h
>> should be ok)?
> Very good point, Jakub. Thank you!
> Somehow I thought I had submitted this updated patch, but apparently
> not so. :-( (This has been on my autotester for ages.)
> Okay? And if so, okay for GCC 9 after a while?
> 2019-08-18 Gerald Pfeifer <firstname.lastname@example.org>
> * config/i386/gmm_malloc.h: Only include errno.h and use errno
> if __STDC_HOSTED__.