This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libffi/21782] configure: error: unknown endianess
- From: "papadopo at shfj dot cea dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 May 2005 07:51:04 -0000
- Subject: [Bug libffi/21782] configure: error: unknown endianess
- References: <20050527123604.21782.papadopo@shfj.cea.fr>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From papadopo at shfj dot cea dot fr 2005-05-30 07:50 -------
This program builds just fine:
$ cat > conftest.c
main () {
/* Are we little or big endian? From Harbison&Steele. */
union
{
long l;
char c[sizeof (long)];
} u;
u.l = 1;
exit (u.c[sizeof (long) - 1] == 1);
}
$
$ /export/Plocal/GCC-3.3.6/gcc/xgcc -B/export/Plocal/GCC-3.3.6/gcc/
-B/usr/local/gcc-3.3.6/sparc-sun-solaris2.8/bin/
-B/usr/local/gcc-3.3.6/sparc-sun-solaris2.8/lib/ -isystem
/usr/local/gcc-3.3.6/sparc-sun-solaris2.8/include -c -O2 -g -O2 conftest.c
$ echo $?
0
$
As far as I can understand the original error message in config.log is:
[...]
configure: In function `main':
configure:3440: error: `bogus' undeclared (first use in this function)
configure:3440: error: (Each undeclared identifier is reported only once
configure:3440: error: for each function it appears in.)
configure:3440: error: syntax error before "endian"
[...]
and it applies to:
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
int main() {
#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
bogus endian macros
#endif
; return 0; }
In the first test, the one that fails, none of BYTE_ORDER, BIG_ENDIAN or
LITTLE_ENDIAN are defined. The configure script then runs a second test which
doesn't fail as shown above. Somehow the configure script takes into account the
first failure.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21782