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

2015-07-09 Thread NGie Cooper
On Thu, Jul 9, 2015 at 2:23 AM, David Chisnall wrote: > On 9 Jul 2015, at 10:19, NGie Cooper 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: > > -

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

2015-07-09 Thread David Chisnall
On 9 Jul 2015, at 10:19, NGie Cooper 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 system compiler [works]

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

2015-07-09 Thread NGie Cooper
On Thu, Jul 9, 2015 at 1:44 AM, David Chisnall wrote: > On 9 Jul 2015, at 03:53, NGie Cooper wrote: >> >> $ cat ~/has_immintrin.c >> #include >> >> #if __has_include() >> #error "I have immintrin.h" >> #else >> #error "I don't have immintrin.h" >> #endif >> $ clang -c ~/has_immintrin.c >> /home/

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

2015-07-09 Thread David Chisnall
On 9 Jul 2015, at 03:53, NGie Cooper wrote: > > $ cat ~/has_immintrin.c > #include > > #if __has_include() > #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 have immintrin.h" > #error "I

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

2015-07-08 Thread NGie Cooper
On Wed, Jul 8, 2015 at 3:18 PM, 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 a

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

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

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

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

2015-07-08 Thread Warner Losh
> > On Jul 8, 2015, at 4:37 PM, Adrian Chadd wrote: > > On 8 July 2015 at 15:34, Warner Losh 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 strik

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 figu

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

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

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, Ad

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 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) alw

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 wrote: > > > On 07/08/

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 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 vers

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 201

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: head/lib/

svn commit: r285284 - head/lib/liblzma

2015-07-08 Thread Luigi Rizzo
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/c