Re: Is detecting endianness at compile-time unworkable?

2018-08-01 Thread Ævar Arnfjörð Bjarmason
On Tue, Jul 31 2018, Michael Felt wrote: > For AIX: again - the determination is simple. If _AIX is set to 1 then > use BigEndian, or, use: > michael@x071:[/home/michael]uname > AIX > i.e., something like: > $(uname) == "AIX" && BigEndian=1 In lieu of some "let's test this with a compile-test"

Re: Is detecting endianness at compile-time unworkable?

2018-08-01 Thread Ævar Arnfjörð Bjarmason
On Mon, Jul 30 2018, Junio C Hamano wrote: > Ævar Arnfjörð Bjarmason writes: > >> And, as an aside, the reason we can't easily make it better ourselves is >> because the build process for git.git doesn't have a facility to run >> code to detect this type of stuff (the configure script is

Re: Is detecting endianness at compile-time unworkable?

2018-07-31 Thread Eric Wong
Junio C Hamano wrote: > Well, having said all that, I do not think I personally mind if > ./configure learned to include a "compile small program and run it > to determine byte order on the build machine" as part of "we make a > reasonable effort" as long as it cleanly excludes cross building >

Re: Is detecting endianness at compile-time unworkable?

2018-07-31 Thread Michael
On 31/07/2018 16:25, Ævar Arnfjörð Bjarmason wrote: ...the real trick is using these macros outside of GCC / glibc and on older GCC versions. See the github link above, you basically end up with a whitelist of how it looks on different systems / compilers. Sometimes both are defined, sometimes

Re: Is detecting endianness at compile-time unworkable?

2018-07-31 Thread Ævar Arnfjörð Bjarmason
On Tue, Jul 31 2018, Michael Felt wrote: > I hope a I have a "leap forward" > > > On 7/30/2018 11:39 AM, Ævar Arnfjörð Bjarmason wrote: >> Perhaps it's worth taking a step back here and thinking about whether >> this whole thing is unworkable. It was hard enough to get this to work >> on the

Re: Is detecting endianness at compile-time unworkable?

2018-07-31 Thread Michael Felt
I hope a I have a "leap forward" On 7/30/2018 11:39 AM, Ævar Arnfjörð Bjarmason wrote: > Perhaps it's worth taking a step back here and thinking about whether > this whole thing is unworkable. It was hard enough to get this to work > on the combination of Linux, *BSD and Solaris, but I suspect

Re: Is detecting endianness at compile-time unworkable?

2018-07-31 Thread Michael Felt
On 7/30/2018 11:39 AM, Ævar Arnfjörð Bjarmason wrote: > The reason we're in this hole is because we use this > sha1collisiondetection library to do SHA-1, and the reason we have > issues with it specifically (not OpenSSL et al) is because its only > method of detecting endianness is at compile

Re: Is detecting endianness at compile-time unworkable?

2018-07-31 Thread Michael Felt
A small step back... On 7/30/2018 11:39 AM, Ævar Arnfjörð Bjarmason wrote: On Sun, Jul 29 2018, Michael wrote: On 29/07/2018 22:06, brian m. carlson wrote: On Sun, Jul 29, 2018 at 09:48:43PM +0200, Michael wrote: On 29/07/2018 21:27, brian m. carlson wrote: Well, that explains it. I

Re: Is detecting endianness at compile-time unworkable?

2018-07-31 Thread Michael Felt
I have just replied to https://github.com/cr-marcstevens/sha1collisiondetection/pull/42 I checked a gcc compiler on AIX, and I have the defines for vac. I do not have access yet to SLES or RHEL (or Ubuntu), just a "free Debian" on my Power6. * my conclusions|recommendations: a) AIX is

Re: Is detecting endianness at compile-time unworkable?

2018-07-30 Thread Daniel Shumow
The change was definitely made for performance. Removing the if statements, conditioned upon endianess was an approx 10% improvement, which was very important to getting this library accepted into git. Thanks, Dan On Mon, Jul 30, 2018 at 11:32 AM, Junio C Hamano wrote: > Junio C Hamano

Re: Is detecting endianness at compile-time unworkable?

2018-07-30 Thread Junio C Hamano
Junio C Hamano writes: > Ævar Arnfjörð Bjarmason writes: > >> And, as an aside, the reason we can't easily make it better ourselves is >> because the build process for git.git doesn't have a facility to run >> code to detect this type of stuff (the configure script is always >> optional). So we

Re: Is detecting endianness at compile-time unworkable?

2018-07-30 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > And, as an aside, the reason we can't easily make it better ourselves is > because the build process for git.git doesn't have a facility to run > code to detect this type of stuff (the configure script is always > optional). So we can't just run this test

Is detecting endianness at compile-time unworkable?

2018-07-30 Thread Ævar Arnfjörð Bjarmason
On Sun, Jul 29 2018, Michael wrote: > On 29/07/2018 22:06, brian m. carlson wrote: >> On Sun, Jul 29, 2018 at 09:48:43PM +0200, Michael wrote: >>> On 29/07/2018 21:27, brian m. carlson wrote: Well, that explains it. I would recommend submitting a patch to