Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Jul 2015 16:42:54 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Adrian Chadd <adrian.chadd@gmail.com>
Cc:        Pedro Giffuni <pfg@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:  <4199933E-38A3-447F-9485-BC4AFC6B370D@bsdimp.com>
In-Reply-To: <CAJ-VmomszUF%2BzRyw4GiUoVqiDf8OYLFa78vHiXMkzZiQwM_e0g@mail.gmail.com>
References:  <201507081836.t68IacJu069563@repo.freebsd.org> <559D9172.9040305@FreeBSD.org> <CAJ-Vmo=m0Y%2BE0oi5ec5RzyziqObOj=fKY1K-8HzqK8x7D_TcKg@mail.gmail.com> <559DA2AE.2090202@FreeBSD.org> <CAJ-VmonxnFt47D6qE199e%2BvxVPxiO5512i=X0R9meY-1Z1r_eQ@mail.gmail.com> <1F6CFFCA-3901-4F18-AF30-EC621E5A4E06@bsdimp.com> <CAJ-VmomszUF%2BzRyw4GiUoVqiDf8OYLFa78vHiXMkzZiQwM_e0g@mail.gmail.com>

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

[-- Attachment #1 --]
> 
> On Jul 8, 2015, at 4:37 PM, Adrian Chadd <adrian.chadd@gmail.com> wrote:
> 
> On 8 July 2015 at 15:34, Warner Losh <imp@bsdimp.com> wrote:
>> I doubt it would ever be useful.
>> For gcc, just test for 4.2.1.
>> For clang, what specific feature do you need to test for?
>> 
>> Do you have a specific use case in mind?
>> 
>> This strikes me as a really bad idea absent some use case that has a real example behind it.
> 
> Well, vendors have in the past shipped modified compilers for systems
> they're doing bring-up on. So if there are differences between the
> in-tree compiler for a given clang version and the vendor supplied
> modified one, I'd like to know.
> 
> I know it's going to be a while until another CPU family with a
> not-yet-upstream compiler comes out..

I’m having trouble understanding when this would be generally useful.
If we have a situation where the exact same clang version as we have in the tree
is also the version of the compiler a vendor released and there’s some substantial
difference between the two such that you need conditional code to make it work
on both, that might be one scenario. But such a scenario hasn’t come up in the
past very often, and generally it has been resolved with an ifdef __arch__ sort of
thing because the in-tree compiler didn’t support that CPU well enough to use,
while the out of tree one did.

Warner

> -a
> 
>> Warner
>> 
>>> On Jul 8, 2015, at 4:28 PM, Adrian Chadd <adrian.chadd@gmail.com> wrote:
>>> 
>>> hi,
>>> 
>>> ok. would it be possible to add a blessed way to say "this is the
>>> freebsd modified compiler in-tree" ?
>>> 
>>> I'd like to see / play around with more external-toolchain driven
>>> building and using it for port bringups.
>>> 
>>> Thanks,
>>> 
>>> 
>>> -adrian
>>> 
>>> 
>>> On 8 July 2015 at 15:22, Pedro Giffuni <pfg@freebsd.org> wrote:
>>>> 
>>>> 
>>>> On 07/08/15 17:04, Adrian Chadd wrote:
>>>>> 
>>>>> Is there a blessed way to see whether the compiler we're using is an
>>>>> external compiler, or an internal one?
>>>> 
>>>> 
>>>> No blessed way: you still have to determine the version of
>>>> the external compiler for most purposes anyways.
>>>> The internal compiler (even clang) always reports itself
>>>> as gcc 4.2.
>>>> 
>>>>> 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.)
>>>> 
>>>> 
>>>> If the compiler reports itself as gcc >= 4.3 it is surely an
>>>> external compiler. The tricky part is that our internal gcc
>>>> supports some gcc 4.3 flags and Apple extensions
>>>> (blocks), but those are not causing a problem AFAICT.
>>>> 
>>>> Pedro.
>>>> 
>>>> 
>>>>> 
>>>>> -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-----
Comment: GPGTools - https://gpgtools.org

iQIcBAEBCgAGBQJVnaduAAoJEGwc0Sh9sBEAQmAP/1BSRgrTwpGDDNGpIX5WjyKY
AsL+fq6fUcykblZerZIyHc9BS2jczpfcnsCxGdceefz7Dn9ccTzcCcyAb8h5LxdY
O6+JOCW8smJtzft1e4KkyKA3BVqJ7rcbGzYXt/pdlOARzJhD694ptRYBGxl2Gbq7
G9Crxlsc4K0uhzChcCQte6zfqtqeic2O8lsFSzh09u+36qZfvcnkmzjJ2/qLaQke
ZDVG3hdNUMlfMCuOap7w9G01j1Fhm2nTOztgTIMIUsiRZLFBLaP/vMmtuwvgWAWC
3c168tLc1/xz0IRqHKZWgx0IRnSBHTN45F/1L+Law2ux8USebBsN1HZ8km8aS9TP
zWDXa9IS38w71WJytzGCd/gRe+TUxS7lOtCmRFGX3/uHMgnSDiWZ1OcJ0Czg3pUs
2sJOj2EsCY5rYg2EtR5VygMjpNODCIwuDKm69mpHPor8ZWK5owCHfyM7HzyMQ7CU
be5RytCcLkPdiUUG3DmFCsu3/rXH+HUpc+JXjUaky0pZHPk1klHfWZ5p54bu08vN
KaIlpHdA4JujE0rYcgqtwe4oPOkIVrSriF2jC1tj6Bsm75YDMjCLvRG0TQzI3quh
T6nrmCSRKpoF1z+t8v1HuHy/5P7gNrAEd/qbK6O7WRJq0h0YV7MpSrDBL6AKQkMf
CxB+lHatLtxg4Q3H9gCp
=P/u+
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4199933E-38A3-447F-9485-BC4AFC6B370D>