patch for -Wno-long-long and early GNAT compilers
Geoffrey Keating
geoffk@redhat.com
Thu Mar 14 01:40:00 GMT 2002
This fixes a bootstrap problem I was hitting in which I was using the
native compiler on my system (maybe 2.96, maybe 3.1, I don't remember)
with an older, possibly 2.8.1, gnatgcc (because you need an ada
compiler to bootstrap with, and that was all I could find). One
supported -Wno-long-long, the other didn't, and so compilation
failed. This fixes it.
Tested by trying to bootstrap GNAT, which got further than before (it
died with SEGV while using the stage1 compiler). I'm not sure what to
do about the next problem, it may have to be worked around in the
current compiler so that people can bootstrap.
--
Geoff Keating <geoffk@redhat.com>
===File ~/patches/ada-wnolonglong.patch=====================
2002-03-14 Geoffrey Keating <geoffk@redhat.com>
* configure.in: Don't pass -Wno-long-long to a ADA compiler
that doesn't support it.
* configure: Regenerate.
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure.in,v
retrieving revision 1.578
diff -p -u -p -r1.578 configure.in
--- configure.in 2002/03/05 00:39:05 1.578
+++ configure.in 2002/03/14 09:32:14
@@ -350,6 +350,9 @@ fi
AC_SUBST(NO_MINUS_C_MINUS_O)
AC_SUBST(OUTPUT_OPTION)
+# See if GNAT has been installed
+gcc_AC_PROG_GNAT
+
AC_CACHE_CHECK(whether ${CC-cc} accepts -Wno-long-long,
ac_cv_prog_cc_no_long_long,
[save_CFLAGS="$CFLAGS"
@@ -357,8 +360,26 @@ CFLAGS="-Wno-long-long"
AC_TRY_COMPILE(,,ac_cv_prog_cc_no_long_long=yes,
ac_cv_prog_cc_no_long_long=no)
CFLAGS="$save_CFLAGS"])
+
+if test x$have_gnat != xno ; then
+AC_CACHE_CHECK(whether ${ADAC} accepts -Wno-long-long,
+ac_cv_prog_adac_no_long_long,
+[cat >conftest.adb <<EOF
+procedure conftest is begin null; end conftest;
+EOF
+if $ADAC -Wno-long-long -c conftest.adb 1>&5 2>&5 ; then
+ ac_cv_prog_adac_no_long_long=yes
+else
+ ac_cv_prog_adac_no_long_long=no
+fi
+rm -f conftest*])
+else
+ ac_cv_prog_adac_no_long_long=yes
+fi
+
strict1_warn=
-if test $ac_cv_prog_cc_no_long_long = yes; then
+if test $ac_cv_prog_cc_no_long_long = yes && \
+ test $ac_cv_prog_adac_no_long_long = yes ; then
strict1_warn="-pedantic -Wno-long-long"
fi
AC_SUBST(strict1_warn)
@@ -477,9 +498,6 @@ AC_CHECK_HEADER(pthread.h, [have_pthread
gcc_AC_C_CHAR_BIT
gcc_AC_C_COMPILE_ENDIAN
gcc_AC_C_FLOAT_FORMAT
-
-# See if GNAT has been installed
-gcc_AC_PROG_GNAT
# See if we have the mktemp command.
AC_CHECK_PROG(have_mktemp_command, mktemp, yes, no)
============================================================
More information about the Gcc-patches
mailing list