This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libffi/21782] configure: error: unknown endianess


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]