Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Jul 2015 00:18:21 +0200
From:      Dimitry Andric <dim@FreeBSD.org>
To:        Adrian Chadd <adrian.chadd@gmail.com>
Cc:        Pedro Giffuni <pfg@freebsd.org>, Luigi Rizzo <luigi@freebsd.org>, "src-committers@freebsd.org" <src-committers@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>
Subject:   Re: svn commit: r285284 - head/lib/liblzma
Message-ID:  <F5CD87E5-92B5-4E87-8DAF-18F4510CD113@FreeBSD.org>
In-Reply-To: <CAJ-Vmo=m0Y%2BE0oi5ec5RzyziqObOj=fKY1K-8HzqK8x7D_TcKg@mail.gmail.com>
References:  <201507081836.t68IacJu069563@repo.freebsd.org> <559D9172.9040305@FreeBSD.org> <CAJ-Vmo=m0Y%2BE0oi5ec5RzyziqObOj=fKY1K-8HzqK8x7D_TcKg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
Check whether the path starts with /usr/bin, maybe?  Normally, you would
check for the existence of a random header in a configure script.  But
from within a C source file, it's not that easy.

That said, immintrin.h is available for all usable versions of clang,
and should be available in all versions of gcc >= 4.4 (at least, if I
read gcc's commit history correctly).  And gcc in base is definitely not
4.4. :-)

-Dimitry

> On 09 Jul 2015, at 00:04, Adrian Chadd <adrian.chadd@gmail.com> wrote:
> 
> Is there a blessed way to see whether the compiler we're using is an
> external compiler, or an internal one?
> 
> eg, the version check isn't enough - it's just a number. how do I know
> if it's freebsd clang versus upstream clang?
> (Or in my instance, freebsd-gcc versus upstream-gcc.)
> 
> 
> -a
> 
> 
> On 8 July 2015 at 14:09, Pedro Giffuni <pfg@freebsd.org> wrote:
>> 
>> 
>> On 07/08/15 13:36, Luigi Rizzo wrote:
>>> 
>>> Author: luigi
>>> Date: Wed Jul  8 18:36:37 2015
>>> New Revision: 285284
>>> URL: https://svnweb.freebsd.org/changeset/base/285284
>>> 
>>> Log:
>>>   only enable immintrin when clang is used. The base gcc does not support
>>> it.
>>>      Reviewed by:      delphij
>>> 
>>> Modified:
>>>   head/lib/liblzma/config.h
>>> 
>>> Modified: head/lib/liblzma/config.h
>>> 
>>> ==============================================================================
>>> --- head/lib/liblzma/config.h   Wed Jul  8 18:12:24 2015        (r285283)
>>> +++ head/lib/liblzma/config.h   Wed Jul  8 18:36:37 2015        (r285284)
>>> @@ -150,7 +150,8 @@
>>>  #define HAVE_ICONV 1
>>>    /* Define to 1 if you have the <immintrin.h> header file. */
>>> -#if defined(__FreeBSD__) && defined(__amd64__)
>>> +/* FreeBSD - only with clang because the base gcc does not support it */
>>> +#if defined(__clang__) && defined(__FreeBSD__) && defined(__amd64__)
>>>  #define HAVE_IMMINTRIN_H 1
>>>  #endif
>>> 
>> 
>> FWIW, gcc 4.3+ does have it so this may some undesired (but hidden)
>> effect when building with an external gcc.
>> 
>> Pedro.
>> 
> 


[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.28

iEYEARECAAYFAlWdobMACgkQsF6jCi4glqMbUwCeMAmafMmHyWL7OAoGDtidLBpa
CaIAnitMnvu7gJM2WECH0aqy0H32OwUd
=+Sxq
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F5CD87E5-92B5-4E87-8DAF-18F4510CD113>