From mboxrd@z Thu Jan 1 00:00:00 1970 From: "John David Anglin" To: dave@hiauly1.hia.nrc.ca (John David Anglin) Cc: gcc-patches@gcc.gnu.org, egcs-bugs@sourceware.cygnus.com Subject: Re: VAX Ultrix bootstrap failure with gcc-2.96 Date: Wed, 24 May 2000 10:32:00 -0000 Message-id: <200005241725.NAA10242@hiauly1.hia.nrc.ca> References: X-SW-Source: 2000-05/msg01383.html > cc1: Invalid option `-Wno-long-long' > In file included from ../../gcc/cppmain.c:25: > ../../gcc/cpplib.h:189: warning: ANSI C does not support `long long' After several false starts, I think the following patch is a reasonable approach to fixing the problem. The definition of the warning CFLAGS for stage 1 and 2 is moved to configure. The configure code could be easily modified to support more option tests if that is needed at some point in the future. Dave -- J. David Anglin dave.anglin@nrc.ca National Research Council of Canada (613) 990-0752 (FAX: 952-6605) 2000-05-24 J. David Anglin * configure.in: Check for -Wno-long-long option support and improve handling of warning CFLAGS for stages 1 and 2. * Makefile.in (WARN_CFLAGS): Move definition to configure.in. * configure: Regenerate. --- configure.in.orig Wed May 24 12:11:28 2000 +++ configure.in Wed May 24 12:48:20 2000 @@ -329,15 +329,30 @@ gcc_AC_C_LONG_DOUBLE +AC_MSG_CHECKING(whether ${CC-cc} accepts -Wno-long-long) +echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -Wno-long-long -c conftest.c 2>&1`"; then + ac_cv_prog_cc_no_long_long=yes +else + ac_cv_prog_cc_no_long_long=no +fi +rm -f conftest* +echo "$ac_t"$ac_cv_prog_cc_no_long_long 1>&6 + # If the native compiler is GCC, we can enable warnings even in stage1. # That's useful for people building cross-compilers, or just running a # quick `make'. +stage1_warn_cflags=" -W -Wall -Wtraditional -pedantic -Wwrite-strings" +stage2_warn_cflags="$stage1_warn_cflags -Wno-long-long" if test "x$GCC" = "xyes"; then - stage1_warn_cflags='$(WARN_CFLAGS)' + if test $ac_cv_prog_cc_no_long_long = yes; then + stage1_warn_cflags="$stage1_warn_cflags -Wno-long-long" + fi else stage1_warn_cflags="" fi AC_SUBST(stage1_warn_cflags) +AC_SUBST(stage2_warn_cflags) AC_PROG_MAKE_SET --- Makefile.in.orig Sun May 21 14:10:51 2000 +++ Makefile.in Wed May 24 12:48:21 2000 @@ -76,7 +76,7 @@ TCFLAGS = CFLAGS = -g @stage1_warn_cflags@ BOOT_CFLAGS = -O2 $(CFLAGS) -WARN_CFLAGS = -W -Wall -Wtraditional -pedantic -Wno-long-long -Wwrite-strings +WARN_CFLAGS = @stage2_warn_cflags@ LOOSE_CFLAGS = `echo $(CFLAGS)|sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'` # These exists to be overridden by the x-* and t-* files, respectively. X_CFLAGS =