Re: svn commit: r285284 - head/lib/liblzma

2015-07-09 Thread David Chisnall
On 9 Jul 2015, at 03:53, NGie Cooper yaneurab...@gmail.com wrote: $ cat ~/has_immintrin.c #include sys/cdefs.h #if __has_include(immintrin.h) #error I have immintrin.h #else #error I don't have immintrin.h #endif $ clang -c ~/has_immintrin.c /home/ngie/has_immintrin.c:4:2: error: I

Re: svn commit: r285284 - head/lib/liblzma

2015-07-09 Thread NGie Cooper
On Thu, Jul 9, 2015 at 1:44 AM, David Chisnall thera...@freebsd.org wrote: On 9 Jul 2015, at 03:53, NGie Cooper yaneurab...@gmail.com wrote: $ cat ~/has_immintrin.c #include sys/cdefs.h #if __has_include(immintrin.h) #error I have immintrin.h #else #error I don't have immintrin.h #endif

Re: svn commit: r285284 - head/lib/liblzma

2015-07-09 Thread NGie Cooper
On Thu, Jul 9, 2015 at 2:23 AM, David Chisnall thera...@freebsd.org wrote: On 9 Jul 2015, at 10:19, NGie Cooper yaneurab...@gmail.com wrote: Yes, but this case will fail for gcc 4.3 ~ 4.4 through 5.x if you use my recommended method... I think that’s probably fine. We basically have four

Re: svn commit: r285284 - head/lib/liblzma

2015-07-09 Thread David Chisnall
On 9 Jul 2015, at 10:19, NGie Cooper yaneurab...@gmail.com wrote: Yes, but this case will fail for gcc 4.3 ~ 4.4 through 5.x if you use my recommended method... I think that’s probably fine. We basically have four cases that we care about: - People who are using clang because it’s the

Re: svn commit: r285284 - head/lib/liblzma

2015-07-08 Thread Pedro Giffuni
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:

Re: svn commit: r285284 - head/lib/liblzma

2015-07-08 Thread Dimitry Andric
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

Re: svn commit: r285284 - head/lib/liblzma

2015-07-08 Thread Adrian Chadd
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

Re: svn commit: r285284 - head/lib/liblzma

2015-07-08 Thread Warner Losh
Not in this context, no. Nor should you want to in this context (inside the compiling module). Generally in Makefiles it would be a bad idea too, but there’s sometimes you need to know. But there’s currently not any such instances in the tree. Warner On Jul 8, 2015, at 4:04 PM, Adrian Chadd

Re: svn commit: r285284 - head/lib/liblzma

2015-07-08 Thread Warner Losh
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. Warner On Jul 8, 2015, at 4:28 PM,

Re: svn commit: r285284 - head/lib/liblzma

2015-07-08 Thread NGie Cooper
On Wed, Jul 8, 2015 at 3:18 PM, Dimitry Andric d...@freebsd.org wrote: 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

Re: svn commit: r285284 - head/lib/liblzma

2015-07-08 Thread Pedro Giffuni
On 07/08/15 17:18, Dimitry Andric wrote: 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

Re: svn commit: r285284 - head/lib/liblzma

2015-07-08 Thread Adrian Chadd
On 8 July 2015 at 15:34, Warner Losh i...@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

Re: svn commit: r285284 - head/lib/liblzma

2015-07-08 Thread Adrian Chadd
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 p...@freebsd.org wrote:

Re: svn commit: r285284 - head/lib/liblzma

2015-07-08 Thread Warner Losh
On Jul 8, 2015, at 4:37 PM, Adrian Chadd adrian.ch...@gmail.com wrote: On 8 July 2015 at 15:34, Warner Losh i...@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

Re: svn commit: r285284 - head/lib/liblzma

2015-07-08 Thread Pedro Giffuni
On 07/08/15 17:28, Adrian Chadd wrote: hi, ok. would it be possible to add a blessed way to say this is the freebsd modified compiler in-tree ? Exactly why do you want this? We don't really have many differences with the vendor versions. Look at sys/sys/cdefs.h for examples on how we

Re: svn commit: r285284 - head/lib/liblzma

2015-07-08 Thread John-Mark Gurney
Pedro Giffuni wrote this message on Wed, Jul 08, 2015 at 16:09 -0500: 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

Re: svn commit: r285284 - head/lib/liblzma

2015-07-08 Thread Alexander Kabaev
On Wed, 8 Jul 2015 15:28:17 -0700 Adrian Chadd adrian.ch...@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.

Re: svn commit: r285284 - head/lib/liblzma

2015-07-08 Thread Pedro Giffuni
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)