Re: Issues w/ cross-compiling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Eric Blake wrote on Wed, Aug 06, 2008 at 03:19:51PM CEST:
> According to Ralf Wildenhues on 7/8/2008 2:57 PM:
> | This is odd.  I can confirm it though: bcc ("Bruce’s C compiler")
> | doesn't throw a compile error for

> | so I'm wondering whether we should change the test.  Changing
> | AC_LANG_BOOL_COMPILE_TRY(C) in a way so that it doesn't ever
> | warn (thus getting _AC_COMPUTE_INT_COMPILE to silently return
> | bogus results), isn't completely trivial, though
> | (unreachable code vs. code that is optimized away).
>
> What about a combination of approaches?
>
> static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= 1)];
> return sizeof test_array - (test_array[0] = 0);

Oh, well.  This compiler is very unpredictable in its handling of
constant expressions.  Unpredictable in the sense of "not really doing
what you would expect from a nearly ANSI C compiler".

I did some more testing, tried out more variations of boolean error
reporting.  Things only grew more inconclusive.  Then I gave up for a
while.  If you are interested, I can produce a more detailed summary.

AFAIK all tests in Autoconf which use AC_LANG_BOOL_COMPILE_TRY can be
overridden by setting some cache variable correctly.  As another easy
way out, on GNU/Linux binfmt_misc support may be used to actually run
binaries created by bcc (in the simulator), which will help to get
correct test results.

With binfmt_misc support enabled, the Autoconf test suite failed:
Fortran tests (of course); AC_CHECK_LIB, AC_SEARCH_LIBS, and
AC_FUNC_STRTOD due to nonexistent libm; the cross-compile
AC_CHECK_ALIGNOF and AC_CHECK_SIZEOF tests (see above); and finally
the AC_CHECK_DECL test which is the only other non-cross issue, where it
fails to detect that a structure is declared: casting a structure type
name to void yields this error:
| a.c:12.18: error: need non-structure type
| a.c:12.18: error: compiler bug? - botched nodetype calculation

Cheers,
Ralf


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf


[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux