[Box Backup] LLONG_MAX configure mistake with gcc 4.1.1 (Linux)

Stuart Hickinbottom boxbackup@fluffy.co.uk
Thu, 15 Jun 2006 21:00:38 +0100


I've done some more investigation and I believe GCC 4.1 is applying
optimisations (whether or not you pass -O<anything>) that cause the
sanity check of the determined/compiler-supplied LLONG_MIN/LLONG_MAX to
always fail.

I have filed a GCC 4.1 porting bug for Gentoo (since this effect causes
the package to fail to compile when the system is upgraded to GCC 4.1) here:
http://bugs.gentoo.org/show_bug.cgi?id=136300

As I've noted in that bug I think either GCC is at fault here making
optimisations that assume that integer wrap-around cannot take place, or
else the configure step is wrongly assuming the compiler *won't* do such
optimisations. I suspect it's a standards arbitration to judge who's right!

Does anyone have an opinion on that (referring to the detail in the
Gentoo bug above)? Unless there's something very odd about my system I
think this means that box backup won't compile using GCC 4.1 on any
architecture at the moment.

Stuart

Martin Ebourne wrote:
> On Sat, 2006-06-10 at 07:50 +0100, Stuart Hickinbottom wrote:
>> I have looked into the configure.log and the relevant lines seem to be
>> as follows:
>>
>> ------ gcc 3.4.6 configure.log fragment
>> configure:12051: result: no
>> configure:12058: checking for max value of long long
>> configure:12112: g++ -o conftest -g -O2     conftest.cc -lcrypto -lssl
>> -ldb -lz  >&5
>> configure:12115: $? = 0
>> configure:12117: ./conftest
>> Using system header for LLONG_MIN and LLONG_MAX
>> configure:12120: $? = 0
>> configure:12124: result: 9223372036854775807
>> configure:12131: checking for min value of long long
>> configure:12133: result: -9223372036854775808
>> ------ gcc 4.1.1 configure.log fragment
>> configure:12051: result: no
>> configure:12058: checking for max value of long long
>> configure:12112: g++ -o conftest -g -O2     conftest.cc -lcrypto -lssl
>> -ldb -lz  >&5
>> configure:12115: $? = 0
>> configure:12117: ./conftest
>> Using system header for LLONG_MIN and LLONG_MAX
>> configure:12120: $? = 2
>> configure: program exited with status 2
>> configure: failed program was:
>> ------
>>
>> I can look into this some more if someone could give me a couple of
>> pointers - I've never delved too deeply into configure scripts before
>> (and having done a little now I can see why!).
> 
> Take the failed program as reported in the log, then the compile line it
> gives you above. Compile it manually and presumably you'll get the same
> result. Then debug it in the time honoured fasion. :)
> 
> As an aside, I'm sure I recognise your name. You're not another
> ex-Acorner are you?
> 
> Cheers,
> 
> Martin.
> 
> _______________________________________________
> boxbackup mailing list
> boxbackup@fluffy.co.uk
> http://lists.warhead.org.uk/mailman/listinfo/boxbackup
>