This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: Revamp CFLAGS handling [was Re: PATCH: VAX -J assembler option]
- To: law at cygnus dot com
- Subject: PATCH: Revamp CFLAGS handling [was Re: PATCH: VAX -J assembler option]
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- Date: Wed, 23 Aug 2000 15:33:52 -0400 (EDT)
- Cc: gcc-patches at gcc dot gnu dot org
> > 2000-08-17 J. David Anglin <dave@hiauly1.hia.nrc.ca>
> >
> > * vax.h (ASM_SPEC): Pass `-J' to assembler.
> > * x-vax-gcc: New file for bootstrapping with gcc.
> > * x-vax: Use X_CFLAGS rather than X_CPPFLAGS to pass `-J'.
> > * configure.in: Use x-vax-gcc with gcc.
> > * configure: Rebuilt.
> Thanks. Installed.
> jeff
Regarding the above, this is probably my fault but the new file `x-vax-gcc'
didn't get created.
Following a previous suggestion from Jeff, I have worked out a new approach
to handle passing `-J' or `-Wa,-J' when needed. To do this, I had to revamp
the CFLAGS handling in Makefile.in.
WARN_CFLAGS is now handled better and stage 1 warning flags don't make it
to the later stages. I have also improved the passage of warning flags
to various submakes and you may see some additional warning messages that
weren't there before.
I have tested it with a complete bootstrap under i686 linux, running make
both from within and outside gcc directory. I haven't tried any crosses.
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
2000-08-23 J. David Anglin <dave@hiauly1.hia.nrc.ca>
Makefile.in: Revamp handling of cflags to allow different WARN_CFLAGS
for compilations in stage 1 and subsequent stages, respectively.
configure.in (vax): Add compiler-dependent CFLAGS for stage 1.
configure: Rebuilt.
x-vax, x-vax-gcc: Deleted.
--- configure.in.orig Wed Aug 23 00:18:29 2000
+++ configure.in Wed Aug 23 13:15:23 2000
@@ -355,6 +355,19 @@
else
stage1_warn_cflags=""
fi
+
+# Stage specific cflags for build.
+case $build in
+vax-*-*)
+ if test x$GCC = xyes
+ then
+ stage1_warn_cflags="$stage1_warn_cflags -Wa,-J"
+ else
+ stage1_warn_cflags="$stage1_warn_cflags -J"
+ fi
+ ;;
+esac
+
AC_SUBST(stage1_warn_cflags)
AC_SUBST(stage2_warn_cflags)
@@ -3670,11 +3683,6 @@
;;
vax-*-ultrix*) # vaxen running ultrix
tm_file="${tm_file} vax/ultrix.h"
- if test x$GCC = xyes
- then
- xmake_file=vax/x-vax-gcc
- fi
- use_collect2=yes
float_format=vax
;;
vax-*-vms*) # vaxen running VMS
--- Makefile.in.orig Tue Aug 22 14:45:00 2000
+++ Makefile.in Wed Aug 23 14:10:35 2000
@@ -61,23 +61,27 @@
# Various ways of specifying flags for compilations:
# CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
-# BOOT_CFLAGS is the value of CFLAGS to pass
-# to the stage2 and stage3 compilations
-# WARN_CFLAGS are the warning flags to pass to stage2 and stage3.
-# (And for stage 1 if the native compiler is GCC.) It is
-# separate from BOOT_CFLAGS because people tend to override optimization
-# flags and we'd like them to still have warnings turned on. They are free
-# to explicitly turn warnings off if they wish.
+# BOOT_CFLAGS is the value of CFLAGS to pass to the stage2 and stage3
+# compilations.
+# WARN1_CFLAGS are the warning flags to use for most compilations in stage1.
+# WARN2_CFLAGS are the warning flags to pass to stage2, stage3, etc.
+# The warning flags are separate from BOOT_CFLAGS because people tend to
+# override optimization flags and we'd like them to still have warnings
+# turned on. These flags are also used to pass other stage dependent
+# flags from configure. The user is free to explicitly turn these flags
+# off if they wish.
# LOOSE_CFLAGS are the CFLAGS to use when compiling something which is only
# compiled with gcc, such as libgcc and the frontends other than C.
# XCFLAGS is used for most compilations but not when using the GCC just built.
# TCFLAGS is used for compilations with the GCC just built.
XCFLAGS =
TCFLAGS =
-CFLAGS = -g @stage1_warn_cflags@
+CFLAGS = -g
BOOT_CFLAGS = -O2 $(CFLAGS)
-WARN_CFLAGS = @stage2_warn_cflags@
-LOOSE_CFLAGS = `echo $(CFLAGS)|sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'`
+WARN1_CFLAGS = @stage1_warn_cflags@
+WARN2_CFLAGS = @stage2_warn_cflags@
+WARN_CFLAGS = $(WARN1_CFLAGS)
+LOOSE_CFLAGS = `echo $(CFLAGS) $(WARN2_CFLAGS)|sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'`
# These exists to be overridden by the x-* and t-* files, respectively.
X_CFLAGS =
T_CFLAGS =
@@ -558,8 +562,7 @@
# This is the variable actually used when we compile.
# If you change this line, you probably also need to change the definition
# of HOST_CFLAGS in build-make to match.
-ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS) \
- @DEFS@
+ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(WARN_CFLAGS) $(XCFLAGS) @DEFS@
# Likewise.
ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
@@ -633,7 +636,7 @@
"AR_FOR_TARGET=$(AR_FOR_TARGET)" \
"BISON=$(BISON)" \
"BISONFLAGS=$(BISONFLAGS)" \
- "CFLAGS=$(CFLAGS)" \
+ "CFLAGS=$(CFLAGS) $(WARN_CFLAGS)" \
"CLIB=$(CLIB)" \
"GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
"LDFLAGS=$(LDFLAGS)" \
@@ -979,7 +982,8 @@
AR_FOR_TARGET="$(AR_FOR_TARGET)" \
AR_CREATE_FOR_TARGET="$(AR_CREATE_FOR_TARGET)" \
AR_FLAGS_FOR_TARGET="$(AR_FLAGS_FOR_TARGET)" \
- OLDCC="$(OLDCC)" CCLIBFLAGS="$(CCLIBFLAGS)" CFLAGS="$(CFLAGS)" \
+ OLDCC="$(OLDCC)" CCLIBFLAGS="$(CCLIBFLAGS)" \
+ CFLAGS="$(CFLAGS) $(WARN_CFLAGS)" \
RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)" \
RANLIB_TEST_FOR_TARGET="$(RANLIB_TEST_FOR_TARGET)" \
LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)" \
@@ -1010,7 +1014,8 @@
AR_FOR_TARGET="$(AR_FOR_TARGET)" \
AR_CREATE_FOR_TARGET="$(AR_CREATE_FOR_TARGET)" \
AR_FLAGS_FOR_TARGET="$(AR_FLAGS_FOR_TARGET)" \
- OLDCC="$(OLDCC)" CCLIBFLAGS="$(CCLIBFLAGS)" CFLAGS="$(CFLAGS)" \
+ OLDCC="$(OLDCC)" CCLIBFLAGS="$(CCLIBFLAGS)" \
+ CFLAGS="$(CFLAGS) $(WARN_CFLAGS)" \
RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)" \
RANLIB_TEST_FOR_TARGET="$(RANLIB_TEST_FOR_TARGET)" \
LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)" \
@@ -2773,22 +2778,22 @@
# To prevent `make install' from compiling alloca.o and then relinking cc1
# because alloca.o is newer, we permit these recursive makes to compile
# alloca.o. Then cc1 is newer, so it won't have to be relinked.
- $(MAKE) CC="stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage1/ LANGUAGES="$(LANGUAGES)"
+ $(MAKE) CC="stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" CFLAGS="$(BOOT_CFLAGS)" WARN_CFLAGS="$(WARN2_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage1/ LANGUAGES="$(LANGUAGES)"
$(MAKE) stage2
-if test $@ = bootstrap-lean; then rm -rf stage1; cd stage2 ; rm -f $(VOL_FILES); else true; fi
- $(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)"
+ $(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" CFLAGS="$(BOOT_CFLAGS)" WARN_CFLAGS="$(WARN2_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)"
bootstrap2 bootstrap2-lean: force
- $(MAKE) CC="stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage1/ LANGUAGES="$(LANGUAGES)"
+ $(MAKE) CC="stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" CFLAGS="$(BOOT_CFLAGS)" WARN_CFLAGS="$(WARN2_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage1/ LANGUAGES="$(LANGUAGES)"
$(MAKE) stage2
-if test $@ = bootstrap2-lean; then rm -rf stage1; cd stage2 ; rm -f $(VOL_FILES); else true; fi
- $(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)"
+ $(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" CFLAGS="$(BOOT_CFLAGS)" WARN_CFLAGS="$(WARN2_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)"
bootstrap3 bootstrap3-lean: force
- $(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)"
+ $(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" CFLAGS="$(BOOT_CFLAGS)" WARN_CFLAGS="$(WARN2_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)"
bootstrap4 bootstrap4-lean: force
- $(MAKE) CC="stage3/xgcc$(exeext) -Bstage3/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage3/ LANGUAGES="$(LANGUAGES)"
+ $(MAKE) CC="stage3/xgcc$(exeext) -Bstage3/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN2_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage3/ LANGUAGES="$(LANGUAGES)"
# Compare the object files in the current directory with those in the
# stage2 directory.