public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/32473]  New: fopen_unlocked.c missing include file for MinGW cross compile
@ 2007-06-23 19:01 rob1weld at aol dot com
  2007-06-23 19:49 ` [Bug bootstrap/32473] " pinskia at gcc dot gnu dot org
  2007-06-23 21:05 ` rob1weld at aol dot com
  0 siblings, 2 replies; 3+ messages in thread
From: rob1weld at aol dot com @ 2007-06-23 19:01 UTC (permalink / raw)
  To: gcc-bugs

gcc version 4.1.2 from
http://ftp.gnu.org/gnu/gcc/gcc-4.1.2/gcc-core-4.1.2.tar.bz2 when compiled with
--target=i686-pc-mingw32 on host i686-pc-linux-gnu has trouble when it compiles
/gcc-4.1.2/libiberty/fopen_unlocked.c under certain conditions.


Here is where the error occurs:

/opt/build/gcc-i686-pc-mingw32/./gcc/xgcc
-B/opt/build/gcc-i686-pc-mingw32/./gcc/ -B/opt/mingw32/i686-pc-mingw32/bin/
-B/opt/mingw32/i686-pc-mingw32/lib/ -isystem
/opt/mingw32/i686-pc-mingw32/include -isystem
/opt/mingw32/i686-pc-mingw32/sys-include -c -DHAVE_CONFIG_H -O2 -g -O2  -I.
-I/opt/build/gcc-4.1.2/libiberty/../include  -W -Wall -pedantic -Wwrite-strings
-Wstrict-prototypes /opt/build/gcc-4.1.2/libiberty/fopen_unlocked.c -o
fopen_unlocked.o
In file included from /opt/build/gcc-4.1.2/libiberty/fopen_unlocked.c:73:
/opt/mingw32/i686-pc-mingw32/sys-include/stdio_ext.h:47: error: expected '=',
',', ';', 'asm' or '__attribute__' before 'extern'
/opt/mingw32/i686-pc-mingw32/sys-include/stdio_ext.h: In function '__freading':
/opt/mingw32/i686-pc-mingw32/sys-include/stdio_ext.h:52: error: expected
declaration specifiers before '__THROW'
/opt/mingw32/i686-pc-mingw32/sys-include/stdio_ext.h:57: error: expected '=',
',', ';', 'asm' or '__attribute__' before '__THROW'
...


This problems is caused by these lines in fopen_unlocked.c:

-----
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#ifdef HAVE_STDIO_EXT_H
#include <stdio_ext.h>
#endif

#include "libiberty.h"
-----


They need to be:

-----
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#ifdef HAVE_STDIO_EXT_H
#include <sys/cdefs.h>          /* Added - need sys/cdefs.h (or features.h)
before stdio_ext.h - for *_DECLS */
#include <stdio_ext.h>
#endif

#include "libiberty.h"
-----


Lines 43 and 85 of /opt/mingw32/i686-pc-mingw32/sys-include/stdio_ext.h (which
is placed there with the fixincludes code) have __BEGIN_DECLS and __END_DECLS
but looking at the -save-temps ".i" file they are not defined prior.


The file /usr/include/sys/cdefs.h is where "__BEGIN_DECLS" and "__END_DECLS" is
defined. File "cdefs.h" does mention that it could be included by way of
features.h but that is unneccesary.


Anytime we use "#include <stdio_ext.h>" we must first use "#include
<sys/cdefs.h>" on host Debian GNU/Linux version 2.6.17 --target=i686-pc-mingw32
cross-compiled from i686-pc-linux-gnu.

# /lib/libc.so.6
GNU C Library stable release version 2.6, by Roland McGrath et al.


# /opt/build/gcc-i686-pc-mingw32/gcc/xgcc -v
Using built-in specs.
Target: i686-pc-mingw32
Configured with: /opt/colinux/build/gcc-4.1.2/configure -v
--prefix=/opt/colinux/mingw32 --target=i686-pc-mingw32
--with-headers=/opt/colinux/mingw32/i686-pc-mingw32/include --with-gnu-as
--with-gnu-ld --disable-nls --without-newlib --disable-multilib
--enable-languages=c,c++
Thread model: win32
gcc version 4.1.2


If it is agreed that this is a bug then you will want to update
http://ftp.gnu.org/gnu/gcc/gcc-4.1.2/gcc-core-4.1.2.tar.bz2


-- 
           Summary: fopen_unlocked.c missing include file for MinGW cross
                    compile
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rob1weld at aol dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-mingw32


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


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

* [Bug bootstrap/32473] fopen_unlocked.c missing include file for MinGW cross compile
  2007-06-23 19:01 [Bug bootstrap/32473] New: fopen_unlocked.c missing include file for MinGW cross compile rob1weld at aol dot com
@ 2007-06-23 19:49 ` pinskia at gcc dot gnu dot org
  2007-06-23 21:05 ` rob1weld at aol dot com
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-06-23 19:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2007-06-23 19:49 -------
/opt/mingw32/i686-pc-mingw32/sys-include/stdio_ext.h:47: error: expected '=',

That is a bug in mingw header files and not in GCC, report this bug to mingw
instead of here.


-- 

pinskia at gcc dot gnu dot org changed:

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


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


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

* [Bug bootstrap/32473] fopen_unlocked.c missing include file for MinGW cross compile
  2007-06-23 19:01 [Bug bootstrap/32473] New: fopen_unlocked.c missing include file for MinGW cross compile rob1weld at aol dot com
  2007-06-23 19:49 ` [Bug bootstrap/32473] " pinskia at gcc dot gnu dot org
@ 2007-06-23 21:05 ` rob1weld at aol dot com
  1 sibling, 0 replies; 3+ messages in thread
From: rob1weld at aol dot com @ 2007-06-23 21:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rob1weld at aol dot com  2007-06-23 21:05 -------
OK. I thought since GCC had a number of "#ifdef __MINGW32__" lines in it's
source that the fixes were done on GCC to accommodate the OS (especially on a
cross-compile) in preference to altering system header files to work for GCC.


-- 


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


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

end of thread, other threads:[~2007-06-23 21:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-23 19:01 [Bug bootstrap/32473] New: fopen_unlocked.c missing include file for MinGW cross compile rob1weld at aol dot com
2007-06-23 19:49 ` [Bug bootstrap/32473] " pinskia at gcc dot gnu dot org
2007-06-23 21:05 ` rob1weld at aol dot com

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