# CFLAGS is for the user to override to, e.g., do a cross build with -O2.
# TCFLAGS is used for compilations with the GCC just built.
# T_CFLAGS is used for all compilations and is overridden by t-* files.
+# TFLAGS is also for the user to override, passed down from the top-level
+# Makefile. It is used for all compilations.
T_CFLAGS =
TCFLAGS =
+TFLAGS =
CFLAGS = @CFLAGS@
CXXFLAGS = @CXXFLAGS@
LDFLAGS = @LDFLAGS@
# Should we build position-independent host code?
PICFLAG = @PICFLAG@
+# The linker flag for the above.
+LD_PICFLAG = @LD_PICFLAG@
+
# Flags to determine code coverage. When coverage is disabled, this will
# contain the optimization flags, as you normally want code coverage
# without optimization.
LINKER_FLAGS = $(CFLAGS)
endif
+enable_host_pie = @enable_host_pie@
+
# Enable Intel CET on Intel CET enabled host if needed.
CET_HOST_FLAGS = @CET_HOST_FLAGS@
COMPILER += $(CET_HOST_FLAGS)
-NO_PIE_CFLAGS = @NO_PIE_CFLAGS@
-NO_PIE_FLAG = @NO_PIE_FLAG@
-
-# We don't want to compile the compilers with -fPIE, it make PCH fail.
-COMPILER += $(NO_PIE_CFLAGS)
+# Maybe compile the compilers with -fPIE or -fPIC.
+COMPILER += $(PICFLAG)
-# Link with -no-pie since we compile the compiler with -fno-PIE.
-LINKER += $(NO_PIE_FLAG)
+# Link with -pie, or -no-pie, depending on the above.
+LINKER += $(LD_PICFLAG)
# Like LINKER, but use a mutex for serializing front end links.
ifeq (@DO_LINK_MUTEX@,true)
# The GCC to use for compiling crt*.o.
# Usually the one we just built.
# Don't use this as a dependency--use $(GCC_PASSES).
-GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) ./xgcc -B./ -B$(build_tooldir)/bin/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include -L$(objdir)/../ld
+GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) ./xgcc -B./ -B$(build_tooldir)/bin/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include -L$(objdir)/../ld $(TFLAGS)
# Set if the compiler was configured with --with-build-sysroot.
SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
ALL_COMPILERFLAGS = $(ALL_CXXFLAGS)
# This is the variable to use when using $(LINKER).
-ALL_LINKERFLAGS = $(ALL_CXXFLAGS)
+ALL_LINKERFLAGS = $(ALL_CXXFLAGS) $(LD_PICFLAG)
# Build and host support libraries.
-# Use the "pic" build of libiberty if --enable-host-shared, unless we are
-# building for mingw.
+# Use the "pic" build of libiberty if --enable-host-shared or --enable-host-pie,
+# unless we are building for mingw.
LIBIBERTY_PICDIR=$(if $(findstring mingw,$(target)),,pic)
-ifeq ($(enable_host_shared),yes)
+ifneq ($(enable_host_shared)$(enable_host_pie),)
LIBIBERTY = ../libiberty/$(LIBIBERTY_PICDIR)/libiberty.a
-BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/$(LIBIBERTY_PICDIR)/libiberty.a
else
LIBIBERTY = ../libiberty/libiberty.a
+endif
+ifeq ($(enable_host_shared),yes)
+BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/$(LIBIBERTY_PICDIR)/libiberty.a
+else
BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/libiberty.a
endif
"MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
"MAKEOVERRIDES=" \
"SHELL=$(SHELL)" \
+ "TFLAGS=$(TFLAGS)" \
"exeext=$(exeext)" \
"build_exeext=$(build_exeext)" \
"objext=$(objext)" \
ANALYZER_OBJS = \
analyzer/analysis-plan.o \
analyzer/analyzer.o \
+ analyzer/analyzer-language.o \
analyzer/analyzer-logging.o \
analyzer/analyzer-pass.o \
analyzer/analyzer-selftests.o \
analyzer/bar-chart.o \
analyzer/call-info.o \
analyzer/call-string.o \
+ analyzer/call-summary.o \
+ analyzer/checker-event.o \
analyzer/checker-path.o \
analyzer/complexity.o \
analyzer/constraint-manager.o \
analyzer/engine.o \
analyzer/feasible-graph.o \
analyzer/function-set.o \
+ analyzer/infinite-recursion.o \
+ analyzer/known-function-manager.o \
analyzer/pending-diagnostic.o \
analyzer/program-point.o \
analyzer/program-state.o \
analyzer/region-model-reachability.o \
analyzer/sm.o \
analyzer/sm-file.o \
+ analyzer/sm-fd.o \
analyzer/sm-malloc.o \
analyzer/sm-pattern-test.o \
analyzer/sm-sensitive.o \
analyzer/store.o \
analyzer/supergraph.o \
analyzer/svalue.o \
- analyzer/trimmed-graph.o
+ analyzer/trimmed-graph.o \
+ analyzer/varargs.o
# Language-independent object files.
# We put the *-match.o and insn-*.o files first so that a parallel make
data-streamer.o \
data-streamer-in.o \
data-streamer-out.o \
- dbxout.o \
dbgcnt.o \
dce.o \
ddg.o \
gimple-range-edge.o \
gimple-range-fold.o \
gimple-range-gori.o \
+ gimple-range-infer.o \
+ gimple-range-op.o \
gimple-range-trace.o \
gimple-ssa-backprop.o \
- gimple-ssa-evrp.o \
- gimple-ssa-evrp-analyze.o \
gimple-ssa-isolate-paths.o \
gimple-ssa-nonnull-compare.o \
gimple-ssa-split-paths.o \
profile-count.o \
range.o \
range-op.o \
+ range-op-float.o \
read-md.o \
read-rtl.o \
read-rtl-function.o \
tree-data-ref.o \
tree-dfa.o \
tree-diagnostic.o \
+ tree-diagnostic-client-data-hooks.o \
tree-diagnostic-path.o \
tree-dump.o \
tree-eh.o \
tree-inline.o \
tree-into-ssa.o \
tree-iterator.o \
+ tree-logical-location.o \
tree-loop-distribution.o \
tree-nested.o \
tree-nrv.o \
value-query.o \
value-range.o \
value-range-equiv.o \
+ value-range-pretty-print.o \
+ value-range-storage.o \
value-relation.o \
value-prof.o \
var-tracking.o \
web.o \
wide-int.o \
wide-int-print.o \
- xcoffout.o \
$(out_object_file) \
$(ANALYZER_OBJS) \
$(EXTRA_OBJS) \
# Objects in libcommon.a, potentially used by all host binaries and with
# no target dependencies.
OBJS-libcommon = diagnostic-spec.o diagnostic.o diagnostic-color.o \
- diagnostic-show-locus.o diagnostic-format-json.o json.o \
+ diagnostic-format-json.o \
+ diagnostic-format-sarif.o \
+ diagnostic-show-locus.o \
edit-context.o \
pretty-print.o intl.o \
+ json.o \
sbitmap.o \
vec.o input.o hash-table.o ggc-none.o memory-block.o \
selftest.o selftest-diagnostic.o sort.o
gcc-ranlib$(exeext) \
genversion$(build_exeext) gcov$(exeext) gcov-dump$(exeext) \
gcov-tool$(exeect) \
- gengtype$(exeext) *.[0-9][0-9].* *.[si] *-checksum.c libbackend.a \
+ gengtype$(exeext) *.[0-9][0-9].* *.[si] *-checksum.cc libbackend.a \
libcommon-target.a libcommon.a libgcc.mk perf.data
# This symlink makes the full installation name of the driver be available
$(STAMP) s-bversion
CFLAGS-toplev.o += -DTARGET_NAME=\"$(target_noncanonical)\"
+CFLAGS-tree-diagnostic-client-data-hooks.o += -DTARGET_NAME=\"$(target_noncanonical)\"
CFLAGS-optinfo-emit-json.o += -DTARGET_NAME=\"$(target_noncanonical)\" $(ZLIBINC)
CFLAGS-analyzer/engine.o += $(ZLIBINC)
simple_generated_c = $(simple_rtl_generated_c) insn-enums.cc
$(simple_generated_h:insn-%.h=s-%) \
-$(simple_generated_c:insn-%.c=s-%): s-%: $(MD_DEPS)
+$(simple_generated_c:insn-%.cc=s-%): s-%: $(MD_DEPS)
$(simple_rtl_generated_h:insn-%.h=s-%) \
-$(simple_rtl_generated_c:insn-%.c=s-%): s-%: insn-conditions.md
+$(simple_rtl_generated_c:insn-%.cc=s-%): s-%: insn-conditions.md
$(simple_generated_h): insn-%.h: s-%; @true
$(SHELL) $(srcdir)/../move-if-change tmp-$*.h insn-$*.h
$(STAMP) s-$*
-$(simple_generated_c): insn-%.c: s-%; @true
-$(simple_generated_c:insn-%.c=s-%): s-%: build/gen%$(build_exeext)
+$(simple_generated_c): insn-%.cc: s-%; @true
+$(simple_generated_c:insn-%.cc=s-%): s-%: build/gen%$(build_exeext)
$(RUN_GEN) build/gen$*$(build_exeext) $(md_file) \
- $(filter insn-conditions.md,$^) > tmp-$*.c
- $(SHELL) $(srcdir)/../move-if-change tmp-$*.c insn-$*.c
+ $(filter insn-conditions.md,$^) > tmp-$*.cc
+ $(SHELL) $(srcdir)/../move-if-change tmp-$*.cc insn-$*.cc
$(STAMP) s-$*
# gencheck doesn't read the machine description, and the file produced
$(SHELL) $(srcdir)/../move-if-change tmp-check.h tree-check.h
$(STAMP) s-check
-# genattrtab produces three files: tmp-{attrtab.c,dfatab.c,latencytab.c}
+# genattrtab produces three files: tmp-{attrtab.cc,dfatab.cc,latencytab.cc}
insn-attrtab.cc insn-dfatab.cc insn-latencytab.cc: s-attrtab ; @true
s-attrtab : $(MD_DEPS) build/genattrtab$(build_exeext) \
insn-conditions.md
$(RUN_GEN) build/genattrtab$(build_exeext) $(md_file) insn-conditions.md \
- -Atmp-attrtab.c -Dtmp-dfatab.c -Ltmp-latencytab.c
+ -Atmp-attrtab.cc -Dtmp-dfatab.cc -Ltmp-latencytab.cc
$(SHELL) $(srcdir)/../move-if-change tmp-attrtab.cc insn-attrtab.cc
$(SHELL) $(srcdir)/../move-if-change tmp-dfatab.cc insn-dfatab.cc
$(SHELL) $(srcdir)/../move-if-change tmp-latencytab.cc insn-latencytab.cc
insn-opinit.cc insn-opinit.h: s-opinit ; @true
s-opinit: $(MD_DEPS) build/genopinit$(build_exeext) insn-conditions.md
$(RUN_GEN) build/genopinit$(build_exeext) $(md_file) \
- insn-conditions.md -htmp-opinit.h -ctmp-opinit.c
+ insn-conditions.md -htmp-opinit.h -ctmp-opinit.cc
$(SHELL) $(srcdir)/../move-if-change tmp-opinit.h insn-opinit.h
$(SHELL) $(srcdir)/../move-if-change tmp-opinit.cc insn-opinit.cc
$(STAMP) s-opinit
# gencondmd doesn't use the standard naming convention.
build/gencondmd.cc: s-conditions; @true
s-conditions: $(MD_DEPS) build/genconditions$(build_exeext)
- $(RUN_GEN) build/genconditions$(build_exeext) $(md_file) > tmp-condmd.c
- $(SHELL) $(srcdir)/../move-if-change tmp-condmd.c build/gencondmd.cc
+ $(RUN_GEN) build/genconditions$(build_exeext) $(md_file) > tmp-condmd.cc
+ $(SHELL) $(srcdir)/../move-if-change tmp-condmd.cc build/gencondmd.cc
$(STAMP) s-conditions
insn-conditions.md: s-condmd; @true
min-insn-modes.cc: s-modes-m; @true
s-modes: build/genmodes$(build_exeext)
- $(RUN_GEN) build/genmodes$(build_exeext) > tmp-modes.c
- $(SHELL) $(srcdir)/../move-if-change tmp-modes.c insn-modes.cc
+ $(RUN_GEN) build/genmodes$(build_exeext) > tmp-modes.cc
+ $(SHELL) $(srcdir)/../move-if-change tmp-modes.cc insn-modes.cc
$(STAMP) s-modes
s-modes-h: build/genmodes$(build_exeext)
$(STAMP) s-modes-inline-h
s-modes-m: build/genmodes$(build_exeext)
- $(RUN_GEN) build/genmodes$(build_exeext) -m > tmp-min-modes.c
- $(SHELL) $(srcdir)/../move-if-change tmp-min-modes.c min-insn-modes.cc
+ $(RUN_GEN) build/genmodes$(build_exeext) -m > tmp-min-modes.cc
+ $(SHELL) $(srcdir)/../move-if-change tmp-min-modes.cc min-insn-modes.cc
$(STAMP) s-modes-m
insn-preds.cc: s-preds; @true
$(RUN_GEN) build/genmddump$(build_exeext) $(md_file) > tmp-mddump.md
s-preds: $(MD_DEPS) build/genpreds$(build_exeext)
- $(RUN_GEN) build/genpreds$(build_exeext) $(md_file) > tmp-preds.c
- $(SHELL) $(srcdir)/../move-if-change tmp-preds.c insn-preds.cc
+ $(RUN_GEN) build/genpreds$(build_exeext) $(md_file) > tmp-preds.cc
+ $(SHELL) $(srcdir)/../move-if-change tmp-preds.cc insn-preds.cc
$(STAMP) s-preds
s-preds-h: $(MD_DEPS) build/genpreds$(build_exeext)
GTFILES = $(CPPLIB_H) $(srcdir)/input.h $(srcdir)/coretypes.h \
$(host_xm_file_list) \
+ $(OPTIONS_H_EXTRA) \
$(tm_file_list) $(HASHTAB_H) $(SPLAY_TREE_H) $(srcdir)/bitmap.h \
$(srcdir)/wide-int.h $(srcdir)/alias.h \
$(srcdir)/coverage.cc $(srcdir)/rtl.h \
$(srcdir)/reload.h $(srcdir)/caller-save.cc $(srcdir)/symtab.cc \
$(srcdir)/alias.cc $(srcdir)/bitmap.cc $(srcdir)/cselib.cc $(srcdir)/cgraph.cc \
$(srcdir)/ipa-prop.cc $(srcdir)/ipa-cp.cc $(srcdir)/ipa-utils.h \
- $(srcdir)/ipa-param-manipulation.h $(srcdir)/ipa-sra.cc $(srcdir)/dbxout.cc \
+ $(srcdir)/ipa-param-manipulation.h $(srcdir)/ipa-sra.cc \
$(srcdir)/ipa-modref.h $(srcdir)/ipa-modref.cc \
$(srcdir)/ipa-modref-tree.h \
$(srcdir)/signop.h \
$(srcdir)/tree-ssanames.h \
$(srcdir)/tree-vrp.h \
$(srcdir)/value-range.h \
+ $(srcdir)/value-range-storage.h \
$(srcdir)/ipa-prop.h \
$(srcdir)/trans-mem.cc \
$(srcdir)/lto-streamer.h \
$(srcdir)/internal-fn.h \
$(srcdir)/calls.cc \
$(srcdir)/omp-general.h \
+ $(srcdir)/analyzer/analyzer-language.cc \
@all_gtfiles@
# Compute the list of GT header files from the corresponding C sources,
GTFILES_H = $(subst /,-, \
$(shell echo $(patsubst $(srcdir)/%,gt-%, \
- $(patsubst %.c,%.h, \
- $(filter %.c, $(GTFILES)))) \
+ $(patsubst %.cc,%.h, \
+ $(filter %.cc, $(GTFILES)))) \
| sed -e "s|/[^ ]*/|/|g" -e "s|gt-config/|gt-|g"))
GTFILES_LANG_H = $(patsubst [%], gtype-%.h, $(filter [%], $(GTFILES)))
set -e; for ml in `cat fixinc_list`; do \
sysroot_headers_suffix=`echo $${ml} | sed -e 's/;.*$$//'`; \
multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \
- fix_dir=include-fixed$${multi_dir}; \
+ include_dir=include$${multi_dir}; \
if $(LIMITS_H_TEST) ; then \
cat $(srcdir)/limitx.h $(T_GLIMITS_H) $(srcdir)/limity.h > tmp-xlimits.h; \
else \
cat $(T_GLIMITS_H) > tmp-xlimits.h; \
fi; \
- $(mkinstalldirs) $${fix_dir}; \
- chmod a+rx $${fix_dir} || true; \
+ $(mkinstalldirs) $${include_dir}; \
+ chmod a+rx $${include_dir} || true; \
$(SHELL) $(srcdir)/../move-if-change \
tmp-xlimits.h tmp-limits.h; \
- rm -f $${fix_dir}/limits.h; \
- cp -p tmp-limits.h $${fix_dir}/limits.h; \
- chmod a+r $${fix_dir}/limits.h; \
+ rm -f $${include_dir}/limits.h; \
+ cp -p tmp-limits.h $${include_dir}/limits.h; \
+ chmod a+r $${include_dir}/limits.h; \
+ cp $(srcdir)/gsyslimits.h $${include_dir}/syslimits.h; \
done
# Install the README
- rm -f include-fixed/README
- cp $(srcdir)/../fixincludes/README-fixinc include-fixed/README
- chmod a+r include-fixed/README
+ if [ x$(STMP_FIXINC) != x ]; then \
+ rm -f include-fixed/README; \
+ cp $(srcdir)/../fixincludes/README-fixinc include-fixed/README; \
+ chmod a+r include-fixed/README; \
+ fi;
$(STAMP) $@
.PHONY: install-gcc-tooldir
cd $(build_objdir)/fixincludes && \
$(SHELL) ./fixinc.sh "$${gcc_dir}/$${fix_dir}" \
$(BUILD_SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS) ); \
- rm -f $${fix_dir}/syslimits.h; \
- if [ -f $${fix_dir}/limits.h ]; then \
- mv $${fix_dir}/limits.h $${fix_dir}/syslimits.h; \
- else \
- cp $(srcdir)/gsyslimits.h $${fix_dir}/syslimits.h; \
- fi; \
- chmod a+r $${fix_dir}/syslimits.h; \
done; \
fi
$(STAMP) stmp-fixinc
-rm -f gt-*
-rm -f gtype.state
# Delete genchecksum outputs
- -rm -f *-checksum.c
+ -rm -f *-checksum.cc
# Delete lock-and-run bits
-rm -rf linkfe.lck lock-stamp.*
-rm -f *.asm
-rm -f site.exp site.bak testsuite/site.exp testsuite/site.bak
-rm -f testsuite/*.log testsuite/*.sum
- -cd testsuite && rm -f x *.x *.x? *.exe *.rpo *.o *.s *.S *.c
+ -cd testsuite && rm -f x *.x *.x? *.exe *.rpo *.o *.s *.S *.cc
-cd testsuite && rm -f *.out *.gcov *$(coverageexts)
-rm -rf ${QMTEST_DIR} stamp-qmtest
-rm -f .gdbinit configargs.h
set -e; for ml in `cat fixinc_list`; do \
multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \
$(mkinstalldirs) $(DESTDIR)$(itoolsdatadir)/include$${multi_dir}; \
- $(INSTALL_DATA) include-fixed$${multi_dir}/limits.h $(DESTDIR)$(itoolsdatadir)/include$${multi_dir}/limits.h; \
+ $(INSTALL_DATA) include$${multi_dir}/limits.h $(DESTDIR)$(itoolsdatadir)/include$${multi_dir}/limits.h; \
done
$(INSTALL_SCRIPT) $(srcdir)/../mkinstalldirs \
$(DESTDIR)$(itoolsdir)/mkinstalldirs ; \
incs="$$incs --include $$dir/TAGS.sub"; \
fi; \
done; \
- $(ETAGS) -o TAGS.sub c-family/*.h c-family/*.c c-family/*.cc \
- *.h *.c *.cc \
+ $(ETAGS) -o TAGS.sub c-family/*.h c-family/*.cc \
+ *.h *.cc \
../include/*.h ../libiberty/*.c \
- ../libcpp/*.c ../libcpp/include/*.h \
+ ../libcpp/*.cc ../libcpp/include/*.h \
--language=none --regex="/\(char\|unsigned int\|int\|bool\|void\|HOST_WIDE_INT\|enum [A-Za-z_0-9]+\) [*]?\([A-Za-z_0-9]+\)/\2/" common.opt \
--language=none --regex="/\(DEF_RTL_EXPR\|DEFTREECODE\|DEFGSCODE\|DEFTIMEVAR\|DEFPARAM\|DEFPARAMENUM5\)[ ]?(\([A-Za-z_0-9]+\)/\2/" rtl.def tree.def gimple.def timevar.def \
; \