As of commit r149007 (enabling -Werror when building with language Ada), I get these errors on current cygwin: /usr/local/src/trunk/objdir/./prev-gcc/xgcc -B/usr/local/src/trunk/objdir/./prev-gcc/ -B/usr/local/i686-pc-cygwin/bin/ -B/usr/local/i686-pc-cygwin/bin/ -B/usr/local/i686-pc-cygwin/lib/ -isystem /usr/local/i686-pc-cygwin/include -isystem /usr/local/i686-pc-cygwin/sys-include -c -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -Wold-style-definition -Wc++-compat -fno-common -DHAVE_CONFIG_H -I. -Iada -I../../gcc/gcc -I../../gcc/gcc/ada -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -Iyes/include -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber ../../gcc/gcc/ada/cstreams.c -o ada/cstreams.o cc1: warnings being treated as errors In file included from ../../gcc/gcc/ada/cstreams.c:47:0: ../../gcc/gcc/ada/adaint.h:58:0: error: "FOPEN" redefined /usr/include/sys/_default_fcntl.h:95:0: note: this is the location of the previous definition make[3]: *** [ada/cstreams.o] Error 1 /usr/local/src/trunk/objdir/./prev-gcc/xgcc -B/usr/local/src/trunk/objdir/./prev-gcc/ -B/usr/local/i686-pc-cygwin/bin/ -B/usr/local/i686-pc-cygwin/bin/ -B/usr/local/i686-pc-cygwin/lib/ -isystem /usr/local/i686-pc-cygwin/include -isystem /usr/local/i686-pc-cygwin/sys-include -c -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -Wold-style-definition -Wc++-compat -fno-common -DHAVE_CONFIG_H \ -I. -Iada -I../../gcc/gcc -I../../gcc/gcc/ada -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -Iyes/include -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I. -Iada -I../../gcc/gcc -I../../gcc/gcc/ada -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -Iyes/include -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber ../../gcc/gcc/ada/cio.c -o ada/cio.o cc1: warnings being treated as errors In file included from ../../gcc/gcc/ada/cio.c:41:0: ../../gcc/gcc/ada/adaint.h:58:0: error: "FOPEN" redefined /usr/include/sys/_default_fcntl.h:95:0: note: this is the location of the previous definition make[3]: *** [ada/cio.o] Error 1 /usr/local/src/trunk/objdir/./prev-gcc/xgcc -B/usr/local/src/trunk/objdir/./prev-gcc/ -B/usr/local/i686-pc-cygwin/bin/ -B/usr/local/i686-pc-cygwin/bin/ -B/usr/local/i686-pc-cygwin/lib/ -isystem /usr/local/i686-pc-cygwin/include -isystem /usr/local/i686-pc-cygwin/sys-include -c -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -Wold-style-definition -Wc++-compat -fno-common -DHAVE_CONFIG_H \ -I. -Iada -I../../gcc/gcc -I../../gcc/gcc/ada -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -Iyes/include -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I. -Iada -I../../gcc/gcc -I../../gcc/gcc/ada -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -Iyes/include -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber ../../gcc/gcc/ada/cio.c -o ada/cio.o cc1: warnings being treated as errors In file included from ../../gcc/gcc/ada/cio.c:41:0: ../../gcc/gcc/ada/adaint.h:58:0: error: "FOPEN" redefined /usr/include/sys/_default_fcntl.h:95:0: note: this is the location of the previous definition make[3]: *** [ada/cio.o] Error 1 /usr/local/src/trunk/objdir/./prev-gcc/xgcc -B/usr/local/src/trunk/objdir/./prev-gcc/ -B/usr/local/i686-pc-cygwin/bin/ -B/usr/local/i686-pc-cygwin/bin/ -B/usr/local/i686-pc-cygwin/lib/ -isystem /usr/local/i686-pc-cygwin/include -isystem /usr/local/i686-pc-cygwin/sys-include -c -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -Wold-style-definition -Wc++-compat -fno-common -DHAVE_CONFIG_H \ -I. -Iada -I../../gcc/gcc -I../../gcc/gcc/ada -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -Iyes/include -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I. -Iada -I../../gcc/gcc -I../../gcc/gcc/ada -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -Iyes/include -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber ../../gcc/gcc/ada/raise.c -o ada/raise.o cc1: warnings being treated as errors In file included from ../../gcc/gcc/ada/raise.c:46:0: ../../gcc/gcc/ada/adaint.h:58:0: error: "FOPEN" redefined /usr/include/sys/_default_fcntl.h:95:0: note: this is the location of the previous definition make[3]: *** [ada/raise.o] Error 1 /usr/local/src/trunk/objdir/./prev-gcc/xgcc -B/usr/local/src/trunk/objdir/./prev-gcc/ -B/usr/local/i686-pc-cygwin/bin/ -B/usr/local/i686-pc-cygwin/bin/ -B/usr/local/i686-pc-cygwin/lib/ -isystem /usr/local/i686-pc-cygwin/include -isystem /usr/local/i686-pc-cygwin/sys-include -c -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -Wold-style-definition -Wc++-compat -fno-common -DHAVE_CONFIG_H \ -I. -Iada -I../../gcc/gcc -I../../gcc/gcc/ada -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -Iyes/include -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I. -Iada -I../../gcc/gcc -I../../gcc/gcc/ada -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -Iyes/include -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber ../../gcc/gcc/ada/raise.c -o ada/raise.o cc1: warnings being treated as errors In file included from ../../gcc/gcc/ada/raise.c:46:0: ../../gcc/gcc/ada/adaint.h:58:0: error: "FOPEN" redefined /usr/include/sys/_default_fcntl.h:95:0: note: this is the location of the previous definition make[3]: *** [ada/raise.o] Error 1 /usr/local/src/trunk/objdir/./prev-gcc/xgcc -B/usr/local/src/trunk/objdir/./prev-gcc/ -B/usr/local/i686-pc-cygwin/bin/ -B/usr/local/i686-pc-cygwin/bin/ -B/usr/local/i686-pc-cygwin/lib/ -isystem /usr/local/i686-pc-cygwin/include -isystem /usr/local/i686-pc-cygwin/sys-include -c -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -Wold-style-definition -Wc++-compat -fno-common -DHAVE_CONFIG_H -I. -Iada -I../../gcc/gcc -I../../gcc/gcc/ada -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -Iyes/include -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber ../../gcc/gcc/ada/exit.c -o ada/exit.o cc1: warnings being treated as errors In file included from ../../gcc/gcc/ada/exit.c:45:0: ../../gcc/gcc/ada/adaint.h:58:0: error: "FOPEN" redefined /usr/include/sys/_default_fcntl.h:95:0: note: this is the location of the previous definition make[3]: *** [ada/exit.o] Error 1
Well, I see. A redefinition issue. Does the following patch fixes your issue? Index: gcc/gcc/ada/adaint.h =================================================================== --- gcc.orig/gcc/ada/adaint.h 2009-06-22 15:57:24.000000000 +0200 +++ gcc/gcc/ada/adaint.h 2009-06-29 13:52:18.896879700 +0200 @@ -48,6 +48,12 @@ large files. For now we just list the platforms we have manually tested. */ +#undef FOPEN +#undef STAT +#undef FSTAT +#undef LSTAT +#undef STRUCT_STAT + #if defined (__GLIBC__) || defined (sun) || defined (__sgi) #define FOPEN fopen64 #define STAT stat64
Might be safer to rename to GNAT_FOPEN or something like that? FOPEN is likely to be taken on more than one platform.
Yeah, this would be the best way to solve this.
(In reply to comment #2) > Might be safer to rename to GNAT_FOPEN or something like that? FOPEN is likely > to be taken on more than one platform. Which line are you suggesting I test change? I initially thought you meant to just change line no. 58 into reading Index: gcc/ada/adaint.h =================================================================== --- gcc/ada/adaint.h (revision 149128) +++ gcc/ada/adaint.h (working copy) @@ -55,7 +55,7 @@ #define LSTAT lstat64 #define STRUCT_STAT struct stat64 #else -#define FOPEN fopen +#define GNAT_FOPEN fopen #define STAT stat #define FSTAT fstat #define LSTAT lstat but that just got me into this error: gcc -c -g -fkeep-inline-functions -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -Wold-style-definition -fno-common -Wno-error -DHAVE_CONFIG_H -I. -Iada -I../../gcc/gcc -I../../gcc/gcc/ada -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -Iyes/include -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber ../../gcc/gcc/ada/adaint.c -o ada/adaint.o ../../gcc/gcc/ada/adaint.c: In function `__gnat_fopen': ../../gcc/gcc/ada/adaint.c:778: error: called object is not a function ../../gcc/gcc/ada/adaint.c: In function `__gnat_to_canonical_file_list_next': ../../gcc/gcc/ada/adaint.c:3247: warning: cast discards qualifiers from pointer target type make[3]: *** [ada/adaint.o] Error 1 make[3]: Leaving directory `/usr/local/src/trunk/objdir/gcc' make[2]: *** [all-stage1-gcc] Error 2 make[2]: Leaving directory `/usr/local/src/trunk/objdir' make[1]: *** [stage1-bubble] Error 2 make[1]: Leaving directory `/usr/local/src/trunk/objdir' make: *** [all] Error 2
(In reply to comment #4) > (In reply to comment #2) > > Might be safer to rename to GNAT_FOPEN or something like that? FOPEN is likely > > to be taken on more than one platform. > > Which line are you suggesting I test change? I initially thought you meant to > just change line no. 58 into reading > > Index: gcc/ada/adaint.h > =================================================================== > --- gcc/ada/adaint.h (revision 149128) > +++ gcc/ada/adaint.h (working copy) > @@ -55,7 +55,7 @@ > #define LSTAT lstat64 > #define STRUCT_STAT struct stat64 > #else > -#define FOPEN fopen > +#define GNAT_FOPEN fopen > #define STAT stat > #define FSTAT fstat > #define LSTAT lstat > > but that just got me into this error: > ../../gcc/gcc/ada/adaint.c: In function `__gnat_fopen': > ../../gcc/gcc/ada/adaint.c:778: error: called object is not a function It's no good just changing the definition if you don't change the use as well! That's the line of adaint.c that references the FOPEN macro; it's now picking up whatever the system definition of FOPEN is that cause the probem in the first place, which probably makes for mangled gibberish source code. Change it to also use GNAT_FOPEN! (Also before this patch would be ready for mainline it would also be necessary to change the 64-bit definition of FOPEN to GNAT_FOPEN as well.) $ grep -n FOPEN adaint.* adaint.c:778: return FOPEN (path, mode); adaint.h:52:#define FOPEN fopen64 adaint.h:58:#define FOPEN fopen
*** Bug 40857 has been marked as a duplicate of this bug. ***
Created attachment 18253 [details] Rename macros with GNAT_ prefix Now testing this (respun) version of the fix I originally suggested to bug 40857
Subject: Bug 40578 Author: davek Date: Sun Jul 26 15:09:10 2009 New Revision: 150098 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=150098 Log: PR bootstrap/40578 * adaint.h (FOPEN, STAT, FSTAT, LSTAT, STRUCT_STAT): Rename from these (GNAT_FOPEN, GNAT_STAT, GNAT_FSTAT, GNAT_LSTAT, GNAT_STRUCT_STAT): ... to these. (__gnat_stat): Adjust reference to STAT in prototype. * adaint.c (__gnat_try_lock, __gnat_fopen, __gnat_file_length, __gnat_named_file_length, __gnat_file_time_name, __gnat_file_time_fd, __gnat_get_libraries_from_registry, __gnat_stat, __gnat_file_exists, __gnat_is_regular_file, __gnat_is_directory, __gnat_is_readable_file, __gnat_is_writable_file, __gnat_is_executable_file, __gnat_set_writable, __gnat_set_executable, __gnat_set_non_writable, __gnat_set_readable, __gnat_set_non_readable, __gnat_is_symbolic_link, __gnat_copy_attribs): Adjust all references to the above. * cstreams.c (__gnat_is_regular_file_fd): Likewise. Modified: trunk/gcc/ada/ChangeLog trunk/gcc/ada/adaint.c trunk/gcc/ada/adaint.h trunk/gcc/ada/cstreams.c
All done now.
Does the fix mean that GNAT does not support large files on any platform?
(In reply to comment #10) > Does the fix mean that GNAT does not support large files on any platform? > No need to worry, that was reason why I mentioned it would be necessary to change the 64-bit definition as well, back in comment #5, and that's what I did in the final patch. Large file support in GNAT is entirely unchanged.