public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/50646] New: configure detects big endian on little endian system.
@ 2011-10-07  1:30 fzvqedi at v dot mintemail.com
  2011-10-07  8:40 ` [Bug c/50646] " rguenth at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: fzvqedi at v dot mintemail.com @ 2011-10-07  1:30 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50646

             Bug #: 50646
           Summary: configure detects big endian on little endian system.
    Classification: Unclassified
           Product: gcc
           Version: 4.5.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: fzvqedi@v.mintemail.com


checking whether byte ordering is bigendian... yes

| int                                                                           
| main ()                                                                       
| {                                                                             
|                                                                               
|            /* Are we little or big endian?  From Harbison&Steele.  */         
|            union                                                              
|            {                                                                  
|              long int l;                                                      
|              char c[sizeof (long int)];                                       
|            } u;                                                               
|            u.l = 1;                                                           
|            return u.c[sizeof (long int) - 1] == 1;                            
|                                                                               
|   ;                                                                           
|   return 0;                                                                   
| }                                
                                                                               
                                                     configure:8171: result:
yes

that test will return 0 on _little endian_
obviously the code was copypasted from a function isBigEndian(), but the author
forgot that returning 0 in main means success.

the reason it came so far is that configure dumbly added some stuff like
#define ssize_t int
to auto-host.h which caused all previous checks to err, because the libc just
typedef'd those types, resulting in:
 error: two or more data types in declaration specifiers
or
error: 'long long long' is too long for GCC


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c/50646] configure detects big endian on little endian system.
  2011-10-07  1:30 [Bug c/50646] New: configure detects big endian on little endian system fzvqedi at v dot mintemail.com
@ 2011-10-07  8:40 ` rguenth at gcc dot gnu.org
  2011-10-07 20:50 ` [Bug bootstrap/50646] " fzvqedi at v dot mintemail.com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-10-07  8:40 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50646

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2011-10-07
                 CC|                            |rwild at gcc dot gnu.org
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-10-07 08:39:39 UTC ---
So ... does this cause any problem for you in GCC?  [note: it's expanded from
AC_C_BIGENDIAN in gcc/configure.ac]

If not, it's a autoconf bug, not a GCC bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug bootstrap/50646] configure detects big endian on little endian system.
  2011-10-07  1:30 [Bug c/50646] New: configure detects big endian on little endian system fzvqedi at v dot mintemail.com
  2011-10-07  8:40 ` [Bug c/50646] " rguenth at gcc dot gnu.org
@ 2011-10-07 20:50 ` fzvqedi at v dot mintemail.com
  2011-10-07 21:46 ` joseph at codesourcery dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: fzvqedi at v dot mintemail.com @ 2011-10-07 20:50 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50646

--- Comment #2 from Roger Meyer <fzvqedi at v dot mintemail.com> 2011-10-07 20:50:23 UTC ---
indeed, it would cause problems. i.e. compile some stuff with wrong endianness
and later silently crash. 

in this specific case here the build stops later on on another error, caused by
another case of configure failing. 

but i may have well overlooked _this_ specific issue, fixing the others that
caused the build errors, and later being clueless why xgcc or something else
segfaults.

since autofocn is "built-in" into gcc, it's both a autofnoc / gcc bug,
and needs to be fixed here and there.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug bootstrap/50646] configure detects big endian on little endian system.
  2011-10-07  1:30 [Bug c/50646] New: configure detects big endian on little endian system fzvqedi at v dot mintemail.com
  2011-10-07  8:40 ` [Bug c/50646] " rguenth at gcc dot gnu.org
  2011-10-07 20:50 ` [Bug bootstrap/50646] " fzvqedi at v dot mintemail.com
@ 2011-10-07 21:46 ` joseph at codesourcery dot com
  2011-10-07 22:28 ` schwab@linux-m68k.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: joseph at codesourcery dot com @ 2011-10-07 21:46 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50646

--- Comment #3 from joseph at codesourcery dot com <joseph at codesourcery dot com> 2011-10-07 21:46:20 UTC ---
Until comparatively recently, the only thing that cared about host 
endianness was decimal floating-point support.  However, now the lexer 
cares as well.

What is the host system for which the endianness test gets that far?  For 
most hosts the endianness would be determined based on the header tests.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug bootstrap/50646] configure detects big endian on little endian system.
  2011-10-07  1:30 [Bug c/50646] New: configure detects big endian on little endian system fzvqedi at v dot mintemail.com
                   ` (2 preceding siblings ...)
  2011-10-07 21:46 ` joseph at codesourcery dot com
@ 2011-10-07 22:28 ` schwab@linux-m68k.org
  2011-10-07 22:31 ` schwab@linux-m68k.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: schwab@linux-m68k.org @ 2011-10-07 22:28 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50646

--- Comment #4 from Andreas Schwab <schwab@linux-m68k.org> 2011-10-07 22:27:41 UTC ---
Your bootstrap compiler must be broken, because the test is correctly
implemented: a successful run of the test program means little endian.  Since
the test exited with non-zero exit status, your system is identified as big
endian.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug bootstrap/50646] configure detects big endian on little endian system.
  2011-10-07  1:30 [Bug c/50646] New: configure detects big endian on little endian system fzvqedi at v dot mintemail.com
                   ` (3 preceding siblings ...)
  2011-10-07 22:28 ` schwab@linux-m68k.org
@ 2011-10-07 22:31 ` schwab@linux-m68k.org
  2011-10-09 23:35 ` fzvqedi at v dot mintemail.com
  2013-11-10 19:38 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: schwab@linux-m68k.org @ 2011-10-07 22:31 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50646

--- Comment #5 from Andreas Schwab <schwab@linux-m68k.org> 2011-10-07 22:30:14 UTC ---
*** Bug 50647 has been marked as a duplicate of this bug. ***


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug bootstrap/50646] configure detects big endian on little endian system.
  2011-10-07  1:30 [Bug c/50646] New: configure detects big endian on little endian system fzvqedi at v dot mintemail.com
                   ` (4 preceding siblings ...)
  2011-10-07 22:31 ` schwab@linux-m68k.org
@ 2011-10-09 23:35 ` fzvqedi at v dot mintemail.com
  2013-11-10 19:38 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: fzvqedi at v dot mintemail.com @ 2011-10-09 23:35 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50646

--- Comment #6 from Roger Meyer <fzvqedi at v dot mintemail.com> 2011-10-09 23:34:47 UTC ---
the host system is aboriginal linux 1.03
armv6l (little endian)
using gcc 4.2.1 on qemu
somehow configure seems to think that the used compiler is a crosscompiler, but
i have no idea why.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug bootstrap/50646] configure detects big endian on little endian system.
  2011-10-07  1:30 [Bug c/50646] New: configure detects big endian on little endian system fzvqedi at v dot mintemail.com
                   ` (5 preceding siblings ...)
  2011-10-09 23:35 ` fzvqedi at v dot mintemail.com
@ 2013-11-10 19:38 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2013-11-10 19:38 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50646

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|---                         |INVALID

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
As reported, this is a bug in the original compiler that was being used.  This
has since been well tested in the 2 years since this was reported and no other
reports of this issue so closing.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-11-10 19:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-07  1:30 [Bug c/50646] New: configure detects big endian on little endian system fzvqedi at v dot mintemail.com
2011-10-07  8:40 ` [Bug c/50646] " rguenth at gcc dot gnu.org
2011-10-07 20:50 ` [Bug bootstrap/50646] " fzvqedi at v dot mintemail.com
2011-10-07 21:46 ` joseph at codesourcery dot com
2011-10-07 22:28 ` schwab@linux-m68k.org
2011-10-07 22:31 ` schwab@linux-m68k.org
2011-10-09 23:35 ` fzvqedi at v dot mintemail.com
2013-11-10 19:38 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).