diff options
author | Laurynas Biveinis <laurynas.biveinis@gmail.com> | 2006-06-22 21:39:49 +0000 |
---|---|---|
committer | Laurynas Biveinis <laurynas.biveinis@gmail.com> | 2006-06-22 21:39:49 +0000 |
commit | 53e8611b554b2af2bbe590f3e903b0b0ce0596fd (patch) | |
tree | ae88951b497e541292fc138a26ecb9a0877d318d | |
parent | 5de1eb501b50c41b412e689b8b1dce1eb43e94f3 (diff) |
Bootstrapping version of ggc-boehm garbage collector
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/boehms-gc@114910 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | Makefile.def | 3 | ||||
-rw-r--r-- | Makefile.in | 845 | ||||
-rw-r--r-- | gcc/c-lex.c | 6 | ||||
-rwxr-xr-x | gcc/ggc-boehm.c | 362 | ||||
-rw-r--r-- | gcc/ggc-common.c | 46 | ||||
-rw-r--r-- | gcc/ggc.h | 10 | ||||
-rw-r--r-- | gcc/stringpool.c | 32 | ||||
-rw-r--r-- | gcc/vec.c | 18 | ||||
-rw-r--r-- | gcc/vec.h | 4 | ||||
-rw-r--r-- | libcpp/charset.c | 4 | ||||
-rwxr-xr-x | libcpp/configure | 5 | ||||
-rw-r--r-- | libcpp/lex.c | 2 |
12 files changed, 1064 insertions, 273 deletions
diff --git a/Makefile.def b/Makefile.def index 27fdc6dc288..f170d8fa754 100644 --- a/Makefile.def +++ b/Makefile.def @@ -26,7 +26,6 @@ AutoGen definitions Makefile.tpl; build_modules= { module= libiberty; }; build_modules= { module= bison; }; -build_modules= { module= boehm-gc; }; build_modules= { module= byacc; }; build_modules= { module= flex; }; build_modules= { module= m4; }; @@ -42,6 +41,7 @@ host_modules= { module= bfd; lib_path=.libs; bootstrap=true; }; host_modules= { module= opcodes; lib_path=.libs; bootstrap=true; }; host_modules= { module= binutils; bootstrap=true; }; host_modules= { module= bison; no_check_cross= true; }; +host_modules= { module= boehm-gc; bootstrap=true; }; host_modules= { module= byacc; no_check_cross= true; }; host_modules= { module= bzip2; }; host_modules= { module= dejagnu; }; @@ -271,6 +271,7 @@ dependencies = { module=configure-gcc; on=all-binutils; }; dependencies = { module=configure-gcc; on=all-gas; }; dependencies = { module=configure-gcc; on=all-ld; }; dependencies = { module=all-gcc; on=all-libiberty; hard=true; }; +dependencies = { module=all-gcc; on=all-boehms-gc; hard=true; }; dependencies = { module=all-gcc; on=all-intl; }; dependencies = { module=all-gcc; on=all-build-texinfo; }; dependencies = { module=all-gcc; on=all-build-bison; }; diff --git a/Makefile.in b/Makefile.in index f00b4ec580e..df2c86c8c5e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -559,6 +559,7 @@ configure-host: \ maybe-configure-opcodes \ maybe-configure-binutils \ maybe-configure-bison \ + maybe-configure-boehm-gc \ maybe-configure-byacc \ maybe-configure-bzip2 \ maybe-configure-dejagnu \ @@ -664,7 +665,6 @@ all: all-build: maybe-all-build-libiberty all-build: maybe-all-build-bison -all-build: maybe-all-build-boehm-gc all-build: maybe-all-build-byacc all-build: maybe-all-build-flex all-build: maybe-all-build-m4 @@ -687,6 +687,9 @@ all-host: maybe-all-opcodes all-host: maybe-all-binutils @endif binutils-no-bootstrap all-host: maybe-all-bison +@if boehm-gc-no-bootstrap +all-host: maybe-all-boehm-gc +@endif boehm-gc-no-bootstrap all-host: maybe-all-byacc all-host: maybe-all-bzip2 all-host: maybe-all-dejagnu @@ -811,6 +814,7 @@ info-host: maybe-info-bfd info-host: maybe-info-opcodes info-host: maybe-info-binutils info-host: maybe-info-bison +info-host: maybe-info-boehm-gc info-host: maybe-info-byacc info-host: maybe-info-bzip2 info-host: maybe-info-dejagnu @@ -914,6 +918,7 @@ dvi-host: maybe-dvi-bfd dvi-host: maybe-dvi-opcodes dvi-host: maybe-dvi-binutils dvi-host: maybe-dvi-bison +dvi-host: maybe-dvi-boehm-gc dvi-host: maybe-dvi-byacc dvi-host: maybe-dvi-bzip2 dvi-host: maybe-dvi-dejagnu @@ -1017,6 +1022,7 @@ html-host: maybe-html-bfd html-host: maybe-html-opcodes html-host: maybe-html-binutils html-host: maybe-html-bison +html-host: maybe-html-boehm-gc html-host: maybe-html-byacc html-host: maybe-html-bzip2 html-host: maybe-html-dejagnu @@ -1120,6 +1126,7 @@ TAGS-host: maybe-TAGS-bfd TAGS-host: maybe-TAGS-opcodes TAGS-host: maybe-TAGS-binutils TAGS-host: maybe-TAGS-bison +TAGS-host: maybe-TAGS-boehm-gc TAGS-host: maybe-TAGS-byacc TAGS-host: maybe-TAGS-bzip2 TAGS-host: maybe-TAGS-dejagnu @@ -1223,6 +1230,7 @@ install-info-host: maybe-install-info-bfd install-info-host: maybe-install-info-opcodes install-info-host: maybe-install-info-binutils install-info-host: maybe-install-info-bison +install-info-host: maybe-install-info-boehm-gc install-info-host: maybe-install-info-byacc install-info-host: maybe-install-info-bzip2 install-info-host: maybe-install-info-dejagnu @@ -1326,6 +1334,7 @@ install-html-host: maybe-install-html-bfd install-html-host: maybe-install-html-opcodes install-html-host: maybe-install-html-binutils install-html-host: maybe-install-html-bison +install-html-host: maybe-install-html-boehm-gc install-html-host: maybe-install-html-byacc install-html-host: maybe-install-html-bzip2 install-html-host: maybe-install-html-dejagnu @@ -1429,6 +1438,7 @@ installcheck-host: maybe-installcheck-bfd installcheck-host: maybe-installcheck-opcodes installcheck-host: maybe-installcheck-binutils installcheck-host: maybe-installcheck-bison +installcheck-host: maybe-installcheck-boehm-gc installcheck-host: maybe-installcheck-byacc installcheck-host: maybe-installcheck-bzip2 installcheck-host: maybe-installcheck-dejagnu @@ -1532,6 +1542,7 @@ mostlyclean-host: maybe-mostlyclean-bfd mostlyclean-host: maybe-mostlyclean-opcodes mostlyclean-host: maybe-mostlyclean-binutils mostlyclean-host: maybe-mostlyclean-bison +mostlyclean-host: maybe-mostlyclean-boehm-gc mostlyclean-host: maybe-mostlyclean-byacc mostlyclean-host: maybe-mostlyclean-bzip2 mostlyclean-host: maybe-mostlyclean-dejagnu @@ -1635,6 +1646,7 @@ clean-host: maybe-clean-bfd clean-host: maybe-clean-opcodes clean-host: maybe-clean-binutils clean-host: maybe-clean-bison +clean-host: maybe-clean-boehm-gc clean-host: maybe-clean-byacc clean-host: maybe-clean-bzip2 clean-host: maybe-clean-dejagnu @@ -1738,6 +1750,7 @@ distclean-host: maybe-distclean-bfd distclean-host: maybe-distclean-opcodes distclean-host: maybe-distclean-binutils distclean-host: maybe-distclean-bison +distclean-host: maybe-distclean-boehm-gc distclean-host: maybe-distclean-byacc distclean-host: maybe-distclean-bzip2 distclean-host: maybe-distclean-dejagnu @@ -1841,6 +1854,7 @@ maintainer-clean-host: maybe-maintainer-clean-bfd maintainer-clean-host: maybe-maintainer-clean-opcodes maintainer-clean-host: maybe-maintainer-clean-binutils maintainer-clean-host: maybe-maintainer-clean-bison +maintainer-clean-host: maybe-maintainer-clean-boehm-gc maintainer-clean-host: maybe-maintainer-clean-byacc maintainer-clean-host: maybe-maintainer-clean-bzip2 maintainer-clean-host: maybe-maintainer-clean-dejagnu @@ -1999,6 +2013,7 @@ check-host: \ maybe-check-opcodes \ maybe-check-binutils \ maybe-check-bison \ + maybe-check-boehm-gc \ maybe-check-byacc \ maybe-check-bzip2 \ maybe-check-dejagnu \ @@ -2129,6 +2144,7 @@ install-host-nogcc: \ maybe-install-opcodes \ maybe-install-binutils \ maybe-install-bison \ + maybe-install-boehm-gc \ maybe-install-byacc \ maybe-install-bzip2 \ maybe-install-dejagnu \ @@ -2199,6 +2215,7 @@ install-host: \ maybe-install-opcodes \ maybe-install-binutils \ maybe-install-bison \ + maybe-install-boehm-gc \ maybe-install-byacc \ maybe-install-bzip2 \ maybe-install-dejagnu \ @@ -2455,54 +2472,6 @@ all-build-bison: configure-build-bison -.PHONY: configure-build-boehm-gc maybe-configure-build-boehm-gc -maybe-configure-build-boehm-gc: -@if build-boehm-gc -maybe-configure-build-boehm-gc: configure-build-boehm-gc -configure-build-boehm-gc: - @: $(MAKE); $(unstage) - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - test ! -f $(BUILD_SUBDIR)/boehm-gc/Makefile || exit 0; \ - $(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/boehm-gc ; \ - $(BUILD_EXPORTS) \ - echo Configuring in $(BUILD_SUBDIR)/boehm-gc; \ - cd "$(BUILD_SUBDIR)/boehm-gc" || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(BUILD_SUBDIR)/boehm-gc/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/boehm-gc"; \ - libsrcdir="$$s/boehm-gc"; \ - rm -f no-such-file || : ; \ - CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(BUILD_CONFIGARGS) $${srcdiroption} \ - || exit 1 -@endif build-boehm-gc - - - - - -.PHONY: all-build-boehm-gc maybe-all-build-boehm-gc -maybe-all-build-boehm-gc: -@if build-boehm-gc -TARGET-build-boehm-gc=all -maybe-all-build-boehm-gc: all-build-boehm-gc -all-build-boehm-gc: configure-build-boehm-gc - @: $(MAKE); $(unstage) - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(BUILD_EXPORTS) \ - (cd $(BUILD_SUBDIR)/boehm-gc && \ - $(MAKE) $(TARGET-build-boehm-gc)) -@endif build-boehm-gc - - - - - .PHONY: configure-build-byacc maybe-configure-build-byacc maybe-configure-build-byacc: @if gcc-bootstrap @@ -6749,6 +6718,712 @@ maintainer-clean-bison: +.PHONY: configure-boehm-gc maybe-configure-boehm-gc +maybe-configure-boehm-gc: +@if gcc-bootstrap +configure-boehm-gc: stage_current +@endif gcc-bootstrap +@if boehm-gc +maybe-configure-boehm-gc: configure-boehm-gc +configure-boehm-gc: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/boehm-gc/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/boehm-gc ; \ + $(HOST_EXPORTS) \ + echo Configuring in $(HOST_SUBDIR)/boehm-gc; \ + cd "$(HOST_SUBDIR)/boehm-gc" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/boehm-gc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/boehm-gc"; \ + libsrcdir="$$s/boehm-gc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 +@endif boehm-gc + + + +.PHONY: configure-stage1-boehm-gc maybe-configure-stage1-boehm-gc +maybe-configure-stage1-boehm-gc: +@if boehm-gc-bootstrap +maybe-configure-stage1-boehm-gc: configure-stage1-boehm-gc +configure-stage1-boehm-gc: + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/boehm-gc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/boehm-gc/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + echo Configuring stage 1 in $(HOST_SUBDIR)/boehm-gc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/boehm-gc ; \ + cd $(HOST_SUBDIR)/boehm-gc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/boehm-gc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/boehm-gc"; \ + libsrcdir="$$s/boehm-gc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" +@endif boehm-gc-bootstrap + +.PHONY: configure-stage2-boehm-gc maybe-configure-stage2-boehm-gc +maybe-configure-stage2-boehm-gc: +@if boehm-gc-bootstrap +maybe-configure-stage2-boehm-gc: configure-stage2-boehm-gc +configure-stage2-boehm-gc: + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/boehm-gc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/boehm-gc/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage 2 in $(HOST_SUBDIR)/boehm-gc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/boehm-gc ; \ + cd $(HOST_SUBDIR)/boehm-gc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/boehm-gc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/boehm-gc"; \ + libsrcdir="$$s/boehm-gc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif boehm-gc-bootstrap + +.PHONY: configure-stage3-boehm-gc maybe-configure-stage3-boehm-gc +maybe-configure-stage3-boehm-gc: +@if boehm-gc-bootstrap +maybe-configure-stage3-boehm-gc: configure-stage3-boehm-gc +configure-stage3-boehm-gc: + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/boehm-gc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/boehm-gc/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage 3 in $(HOST_SUBDIR)/boehm-gc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/boehm-gc ; \ + cd $(HOST_SUBDIR)/boehm-gc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/boehm-gc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/boehm-gc"; \ + libsrcdir="$$s/boehm-gc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif boehm-gc-bootstrap + +.PHONY: configure-stage4-boehm-gc maybe-configure-stage4-boehm-gc +maybe-configure-stage4-boehm-gc: +@if boehm-gc-bootstrap +maybe-configure-stage4-boehm-gc: configure-stage4-boehm-gc +configure-stage4-boehm-gc: + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/boehm-gc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/boehm-gc/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage 4 in $(HOST_SUBDIR)/boehm-gc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/boehm-gc ; \ + cd $(HOST_SUBDIR)/boehm-gc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/boehm-gc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/boehm-gc"; \ + libsrcdir="$$s/boehm-gc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif boehm-gc-bootstrap + +.PHONY: configure-stageprofile-boehm-gc maybe-configure-stageprofile-boehm-gc +maybe-configure-stageprofile-boehm-gc: +@if boehm-gc-bootstrap +maybe-configure-stageprofile-boehm-gc: configure-stageprofile-boehm-gc +configure-stageprofile-boehm-gc: + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/boehm-gc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/boehm-gc/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage profile in $(HOST_SUBDIR)/boehm-gc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/boehm-gc ; \ + cd $(HOST_SUBDIR)/boehm-gc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/boehm-gc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/boehm-gc"; \ + libsrcdir="$$s/boehm-gc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif boehm-gc-bootstrap + +.PHONY: configure-stagefeedback-boehm-gc maybe-configure-stagefeedback-boehm-gc +maybe-configure-stagefeedback-boehm-gc: +@if boehm-gc-bootstrap +maybe-configure-stagefeedback-boehm-gc: configure-stagefeedback-boehm-gc +configure-stagefeedback-boehm-gc: + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/boehm-gc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/boehm-gc/Makefile || exit 0; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage feedback in $(HOST_SUBDIR)/boehm-gc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/boehm-gc ; \ + cd $(HOST_SUBDIR)/boehm-gc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/boehm-gc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/boehm-gc"; \ + libsrcdir="$$s/boehm-gc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif boehm-gc-bootstrap + + + + + +.PHONY: all-boehm-gc maybe-all-boehm-gc +maybe-all-boehm-gc: +@if gcc-bootstrap +all-boehm-gc: stage_current +@endif gcc-bootstrap +@if boehm-gc +TARGET-boehm-gc=all +maybe-all-boehm-gc: all-boehm-gc +all-boehm-gc: configure-boehm-gc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/boehm-gc && \ + $(MAKE) $(FLAGS_TO_PASS) $(TARGET-boehm-gc)) +@endif boehm-gc + + + +.PHONY: all-stage1-boehm-gc maybe-all-stage1-boehm-gc +.PHONY: clean-stage1-boehm-gc maybe-clean-stage1-boehm-gc +maybe-all-stage1-boehm-gc: +maybe-clean-stage1-boehm-gc: +@if boehm-gc-bootstrap +maybe-all-stage1-boehm-gc: all-stage1-boehm-gc +all-stage1: all-stage1-boehm-gc +TARGET-stage1-boehm-gc = $(TARGET-boehm-gc) +all-stage1-boehm-gc: configure-stage1-boehm-gc + @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/boehm-gc && \ + $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ + $(TARGET-stage1-boehm-gc) + +maybe-clean-stage1-boehm-gc: clean-stage1-boehm-gc +clean-stage1: clean-stage1-boehm-gc +clean-stage1-boehm-gc: + @[ -f $(HOST_SUBDIR)/boehm-gc/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-boehm-gc/Makefile ] \ + || exit 0 ; \ + [ $(current_stage) = stage1 ] || $(MAKE) stage1-start; \ + cd $(HOST_SUBDIR)/boehm-gc && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" clean +@endif boehm-gc-bootstrap + + +.PHONY: all-stage2-boehm-gc maybe-all-stage2-boehm-gc +.PHONY: clean-stage2-boehm-gc maybe-clean-stage2-boehm-gc +maybe-all-stage2-boehm-gc: +maybe-clean-stage2-boehm-gc: +@if boehm-gc-bootstrap +maybe-all-stage2-boehm-gc: all-stage2-boehm-gc +all-stage2: all-stage2-boehm-gc +TARGET-stage2-boehm-gc = $(TARGET-boehm-gc) +all-stage2-boehm-gc: configure-stage2-boehm-gc + @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/boehm-gc && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage2-boehm-gc) + +maybe-clean-stage2-boehm-gc: clean-stage2-boehm-gc +clean-stage2: clean-stage2-boehm-gc +clean-stage2-boehm-gc: + @[ -f $(HOST_SUBDIR)/boehm-gc/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-boehm-gc/Makefile ] \ + || exit 0 ; \ + [ $(current_stage) = stage2 ] || $(MAKE) stage2-start; \ + cd $(HOST_SUBDIR)/boehm-gc && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif boehm-gc-bootstrap + + +.PHONY: all-stage3-boehm-gc maybe-all-stage3-boehm-gc +.PHONY: clean-stage3-boehm-gc maybe-clean-stage3-boehm-gc +maybe-all-stage3-boehm-gc: +maybe-clean-stage3-boehm-gc: +@if boehm-gc-bootstrap +maybe-all-stage3-boehm-gc: all-stage3-boehm-gc +all-stage3: all-stage3-boehm-gc +TARGET-stage3-boehm-gc = $(TARGET-boehm-gc) +all-stage3-boehm-gc: configure-stage3-boehm-gc + @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/boehm-gc && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage3-boehm-gc) + +maybe-clean-stage3-boehm-gc: clean-stage3-boehm-gc +clean-stage3: clean-stage3-boehm-gc +clean-stage3-boehm-gc: + @[ -f $(HOST_SUBDIR)/boehm-gc/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-boehm-gc/Makefile ] \ + || exit 0 ; \ + [ $(current_stage) = stage3 ] || $(MAKE) stage3-start; \ + cd $(HOST_SUBDIR)/boehm-gc && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif boehm-gc-bootstrap + + +.PHONY: all-stage4-boehm-gc maybe-all-stage4-boehm-gc +.PHONY: clean-stage4-boehm-gc maybe-clean-stage4-boehm-gc +maybe-all-stage4-boehm-gc: +maybe-clean-stage4-boehm-gc: +@if boehm-gc-bootstrap +maybe-all-stage4-boehm-gc: all-stage4-boehm-gc +all-stage4: all-stage4-boehm-gc +TARGET-stage4-boehm-gc = $(TARGET-boehm-gc) +all-stage4-boehm-gc: configure-stage4-boehm-gc + @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/boehm-gc && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage4-boehm-gc) + +maybe-clean-stage4-boehm-gc: clean-stage4-boehm-gc +clean-stage4: clean-stage4-boehm-gc +clean-stage4-boehm-gc: + @[ -f $(HOST_SUBDIR)/boehm-gc/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-boehm-gc/Makefile ] \ + || exit 0 ; \ + [ $(current_stage) = stage4 ] || $(MAKE) stage4-start; \ + cd $(HOST_SUBDIR)/boehm-gc && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif boehm-gc-bootstrap + + +.PHONY: all-stageprofile-boehm-gc maybe-all-stageprofile-boehm-gc +.PHONY: clean-stageprofile-boehm-gc maybe-clean-stageprofile-boehm-gc +maybe-all-stageprofile-boehm-gc: +maybe-clean-stageprofile-boehm-gc: +@if boehm-gc-bootstrap +maybe-all-stageprofile-boehm-gc: all-stageprofile-boehm-gc +all-stageprofile: all-stageprofile-boehm-gc +TARGET-stageprofile-boehm-gc = $(TARGET-boehm-gc) +all-stageprofile-boehm-gc: configure-stageprofile-boehm-gc + @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/boehm-gc && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" \ + $(TARGET-stageprofile-boehm-gc) + +maybe-clean-stageprofile-boehm-gc: clean-stageprofile-boehm-gc +clean-stageprofile: clean-stageprofile-boehm-gc +clean-stageprofile-boehm-gc: + @[ -f $(HOST_SUBDIR)/boehm-gc/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-boehm-gc/Makefile ] \ + || exit 0 ; \ + [ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start; \ + cd $(HOST_SUBDIR)/boehm-gc && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean +@endif boehm-gc-bootstrap + + +.PHONY: all-stagefeedback-boehm-gc maybe-all-stagefeedback-boehm-gc +.PHONY: clean-stagefeedback-boehm-gc maybe-clean-stagefeedback-boehm-gc +maybe-all-stagefeedback-boehm-gc: +maybe-clean-stagefeedback-boehm-gc: +@if boehm-gc-bootstrap +maybe-all-stagefeedback-boehm-gc: all-stagefeedback-boehm-gc +all-stagefeedback: all-stagefeedback-boehm-gc +TARGET-stagefeedback-boehm-gc = $(TARGET-boehm-gc) +all-stagefeedback-boehm-gc: configure-stagefeedback-boehm-gc + @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/boehm-gc && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" \ + $(TARGET-stagefeedback-boehm-gc) + +maybe-clean-stagefeedback-boehm-gc: clean-stagefeedback-boehm-gc +clean-stagefeedback: clean-stagefeedback-boehm-gc +clean-stagefeedback-boehm-gc: + @[ -f $(HOST_SUBDIR)/boehm-gc/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-boehm-gc/Makefile ] \ + || exit 0 ; \ + [ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start; \ + cd $(HOST_SUBDIR)/boehm-gc && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean +@endif boehm-gc-bootstrap + + + + + +.PHONY: check-boehm-gc maybe-check-boehm-gc +maybe-check-boehm-gc: +@if boehm-gc +maybe-check-boehm-gc: check-boehm-gc + +check-boehm-gc: + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/boehm-gc && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif boehm-gc + +.PHONY: install-boehm-gc maybe-install-boehm-gc +maybe-install-boehm-gc: +@if boehm-gc +maybe-install-boehm-gc: install-boehm-gc + +install-boehm-gc: installdirs + @: $(MAKE); $(unstage) + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/boehm-gc && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif boehm-gc + +# Other targets (info, dvi, etc.) + +.PHONY: maybe-info-boehm-gc info-boehm-gc +maybe-info-boehm-gc: +@if boehm-gc +maybe-info-boehm-gc: info-boehm-gc + +info-boehm-gc: \ + configure-boehm-gc + @[ -f ./boehm-gc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in boehm-gc" ; \ + (cd $(HOST_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + +@endif boehm-gc + +.PHONY: maybe-dvi-boehm-gc dvi-boehm-gc +maybe-dvi-boehm-gc: +@if boehm-gc +maybe-dvi-boehm-gc: dvi-boehm-gc + +dvi-boehm-gc: \ + configure-boehm-gc + @[ -f ./boehm-gc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in boehm-gc" ; \ + (cd $(HOST_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + +@endif boehm-gc + +.PHONY: maybe-html-boehm-gc html-boehm-gc +maybe-html-boehm-gc: +@if boehm-gc +maybe-html-boehm-gc: html-boehm-gc + +html-boehm-gc: \ + configure-boehm-gc + @[ -f ./boehm-gc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing html in boehm-gc" ; \ + (cd $(HOST_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + html) \ + || exit 1 + +@endif boehm-gc + +.PHONY: maybe-TAGS-boehm-gc TAGS-boehm-gc +maybe-TAGS-boehm-gc: +@if boehm-gc +maybe-TAGS-boehm-gc: TAGS-boehm-gc + +TAGS-boehm-gc: \ + configure-boehm-gc + @[ -f ./boehm-gc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in boehm-gc" ; \ + (cd $(HOST_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + +@endif boehm-gc + +.PHONY: maybe-install-info-boehm-gc install-info-boehm-gc +maybe-install-info-boehm-gc: +@if boehm-gc +maybe-install-info-boehm-gc: install-info-boehm-gc + +install-info-boehm-gc: \ + configure-boehm-gc \ + info-boehm-gc + @[ -f ./boehm-gc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in boehm-gc" ; \ + (cd $(HOST_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + +@endif boehm-gc + +.PHONY: maybe-install-html-boehm-gc install-html-boehm-gc +maybe-install-html-boehm-gc: +@if boehm-gc +maybe-install-html-boehm-gc: install-html-boehm-gc + +install-html-boehm-gc: \ + configure-boehm-gc \ + html-boehm-gc + @[ -f ./boehm-gc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-html in boehm-gc" ; \ + (cd $(HOST_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-html) \ + || exit 1 + +@endif boehm-gc + +.PHONY: maybe-installcheck-boehm-gc installcheck-boehm-gc +maybe-installcheck-boehm-gc: +@if boehm-gc +maybe-installcheck-boehm-gc: installcheck-boehm-gc + +installcheck-boehm-gc: \ + configure-boehm-gc + @[ -f ./boehm-gc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in boehm-gc" ; \ + (cd $(HOST_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + +@endif boehm-gc + +.PHONY: maybe-mostlyclean-boehm-gc mostlyclean-boehm-gc +maybe-mostlyclean-boehm-gc: +@if boehm-gc +maybe-mostlyclean-boehm-gc: mostlyclean-boehm-gc + +mostlyclean-boehm-gc: + @[ -f ./boehm-gc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in boehm-gc" ; \ + (cd $(HOST_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + +@endif boehm-gc + +.PHONY: maybe-clean-boehm-gc clean-boehm-gc +maybe-clean-boehm-gc: +@if boehm-gc +maybe-clean-boehm-gc: clean-boehm-gc + +clean-boehm-gc: + @[ -f ./boehm-gc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in boehm-gc" ; \ + (cd $(HOST_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + +@endif boehm-gc + +.PHONY: maybe-distclean-boehm-gc distclean-boehm-gc +maybe-distclean-boehm-gc: +@if boehm-gc +maybe-distclean-boehm-gc: distclean-boehm-gc + +distclean-boehm-gc: + @[ -f ./boehm-gc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in boehm-gc" ; \ + (cd $(HOST_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + +@endif boehm-gc + +.PHONY: maybe-maintainer-clean-boehm-gc maintainer-clean-boehm-gc +maybe-maintainer-clean-boehm-gc: +@if boehm-gc +maybe-maintainer-clean-boehm-gc: maintainer-clean-boehm-gc + +maintainer-clean-boehm-gc: + @[ -f ./boehm-gc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in boehm-gc" ; \ + (cd $(HOST_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + +@endif boehm-gc + + + .PHONY: configure-byacc maybe-configure-byacc maybe-configure-byacc: @if gcc-bootstrap @@ -39313,6 +39988,11 @@ stage1-start:: mkdir stage1-binutils; \ mv stage1-binutils binutils @endif binutils +@if boehm-gc + @cd $(HOST_SUBDIR); [ -d stage1-boehm-gc ] || \ + mkdir stage1-boehm-gc; \ + mv stage1-boehm-gc boehm-gc +@endif boehm-gc @if gas @cd $(HOST_SUBDIR); [ -d stage1-gas ] || \ mkdir stage1-gas; \ @@ -39373,6 +40053,11 @@ stage1-end:: cd $(HOST_SUBDIR); mv binutils stage1-binutils ; \ fi @endif binutils +@if boehm-gc + @if test -d $(HOST_SUBDIR)/boehm-gc ; then \ + cd $(HOST_SUBDIR); mv boehm-gc stage1-boehm-gc ; \ + fi +@endif boehm-gc @if gas @if test -d $(HOST_SUBDIR)/gas ; then \ cd $(HOST_SUBDIR); mv gas stage1-gas ; \ @@ -39478,6 +40163,12 @@ stage2-start:: mv stage2-binutils binutils ; \ mv stage1-binutils prev-binutils || test -f stage1-lean @endif binutils +@if boehm-gc + @cd $(HOST_SUBDIR); [ -d stage2-boehm-gc ] || \ + mkdir stage2-boehm-gc; \ + mv stage2-boehm-gc boehm-gc ; \ + mv stage1-boehm-gc prev-boehm-gc || test -f stage1-lean +@endif boehm-gc @if gas @cd $(HOST_SUBDIR); [ -d stage2-gas ] || \ mkdir stage2-gas; \ @@ -39550,6 +40241,12 @@ stage2-end:: mv prev-binutils stage1-binutils ; : ; \ fi @endif binutils +@if boehm-gc + @if test -d $(HOST_SUBDIR)/boehm-gc ; then \ + cd $(HOST_SUBDIR); mv boehm-gc stage2-boehm-gc ; \ + mv prev-boehm-gc stage1-boehm-gc ; : ; \ + fi +@endif boehm-gc @if gas @if test -d $(HOST_SUBDIR)/gas ; then \ cd $(HOST_SUBDIR); mv gas stage2-gas ; \ @@ -39685,6 +40382,12 @@ stage3-start:: mv stage3-binutils binutils ; \ mv stage2-binutils prev-binutils || test -f stage2-lean @endif binutils +@if boehm-gc + @cd $(HOST_SUBDIR); [ -d stage3-boehm-gc ] || \ + mkdir stage3-boehm-gc; \ + mv stage3-boehm-gc boehm-gc ; \ + mv stage2-boehm-gc prev-boehm-gc || test -f stage2-lean +@endif boehm-gc @if gas @cd $(HOST_SUBDIR); [ -d stage3-gas ] || \ mkdir stage3-gas; \ @@ -39757,6 +40460,12 @@ stage3-end:: mv prev-binutils stage2-binutils ; : ; \ fi @endif binutils +@if boehm-gc + @if test -d $(HOST_SUBDIR)/boehm-gc ; then \ + cd $(HOST_SUBDIR); mv boehm-gc stage3-boehm-gc ; \ + mv prev-boehm-gc stage2-boehm-gc ; : ; \ + fi +@endif boehm-gc @if gas @if test -d $(HOST_SUBDIR)/gas ; then \ cd $(HOST_SUBDIR); mv gas stage3-gas ; \ @@ -39938,6 +40647,12 @@ stage4-start:: mv stage4-binutils binutils ; \ mv stage3-binutils prev-binutils || test -f stage3-lean @endif binutils +@if boehm-gc + @cd $(HOST_SUBDIR); [ -d stage4-boehm-gc ] || \ + mkdir stage4-boehm-gc; \ + mv stage4-boehm-gc boehm-gc ; \ + mv stage3-boehm-gc prev-boehm-gc || test -f stage3-lean +@endif boehm-gc @if gas @cd $(HOST_SUBDIR); [ -d stage4-gas ] || \ mkdir stage4-gas; \ @@ -40010,6 +40725,12 @@ stage4-end:: mv prev-binutils stage3-binutils ; : ; \ fi @endif binutils +@if boehm-gc + @if test -d $(HOST_SUBDIR)/boehm-gc ; then \ + cd $(HOST_SUBDIR); mv boehm-gc stage4-boehm-gc ; \ + mv prev-boehm-gc stage3-boehm-gc ; : ; \ + fi +@endif boehm-gc @if gas @if test -d $(HOST_SUBDIR)/gas ; then \ cd $(HOST_SUBDIR); mv gas stage4-gas ; \ @@ -40188,6 +40909,12 @@ stageprofile-start:: mv stageprofile-binutils binutils ; \ mv stage1-binutils prev-binutils || test -f stage1-lean @endif binutils +@if boehm-gc + @cd $(HOST_SUBDIR); [ -d stageprofile-boehm-gc ] || \ + mkdir stageprofile-boehm-gc; \ + mv stageprofile-boehm-gc boehm-gc ; \ + mv stage1-boehm-gc prev-boehm-gc || test -f stage1-lean +@endif boehm-gc @if gas @cd $(HOST_SUBDIR); [ -d stageprofile-gas ] || \ mkdir stageprofile-gas; \ @@ -40260,6 +40987,12 @@ stageprofile-end:: mv prev-binutils stage1-binutils ; : ; \ fi @endif binutils +@if boehm-gc + @if test -d $(HOST_SUBDIR)/boehm-gc ; then \ + cd $(HOST_SUBDIR); mv boehm-gc stageprofile-boehm-gc ; \ + mv prev-boehm-gc stage1-boehm-gc ; : ; \ + fi +@endif boehm-gc @if gas @if test -d $(HOST_SUBDIR)/gas ; then \ cd $(HOST_SUBDIR); mv gas stageprofile-gas ; \ @@ -40374,6 +41107,12 @@ stagefeedback-start:: mv stagefeedback-binutils binutils ; \ mv stageprofile-binutils prev-binutils || test -f stageprofile-lean @endif binutils +@if boehm-gc + @cd $(HOST_SUBDIR); [ -d stagefeedback-boehm-gc ] || \ + mkdir stagefeedback-boehm-gc; \ + mv stagefeedback-boehm-gc boehm-gc ; \ + mv stageprofile-boehm-gc prev-boehm-gc || test -f stageprofile-lean +@endif boehm-gc @if gas @cd $(HOST_SUBDIR); [ -d stagefeedback-gas ] || \ mkdir stagefeedback-gas; \ @@ -40446,6 +41185,12 @@ stagefeedback-end:: mv prev-binutils stageprofile-binutils ; : ; \ fi @endif binutils +@if boehm-gc + @if test -d $(HOST_SUBDIR)/boehm-gc ; then \ + cd $(HOST_SUBDIR); mv boehm-gc stagefeedback-boehm-gc ; \ + mv prev-boehm-gc stageprofile-boehm-gc ; : ; \ + fi +@endif boehm-gc @if gas @if test -d $(HOST_SUBDIR)/gas ; then \ cd $(HOST_SUBDIR); mv gas stagefeedback-gas ; \ @@ -40744,6 +41489,7 @@ all-stage3-gcc: all-stage3-libiberty all-stage4-gcc: all-stage4-libiberty all-stageprofile-gcc: all-stageprofile-libiberty all-stagefeedback-gcc: all-stagefeedback-libiberty +all-gcc: all-boehms-gc all-gcc: maybe-all-intl all-stage1-gcc: maybe-all-stage1-intl @@ -41211,6 +41957,7 @@ all-target-winsup: maybe-all-target-libtermcap all-prebootstrap: maybe-all-bfd all-prebootstrap: maybe-all-opcodes all-prebootstrap: maybe-all-binutils +all-prebootstrap: maybe-all-boehm-gc all-prebootstrap: maybe-all-gas all-prebootstrap: maybe-all-intl all-prebootstrap: maybe-all-ld diff --git a/gcc/c-lex.c b/gcc/c-lex.c index ce231ddc4bc..36cc4d14d4b 100644 --- a/gcc/c-lex.c +++ b/gcc/c-lex.c @@ -453,6 +453,8 @@ c_lex_with_flags (tree *value, location_t *loc, unsigned char *cpp_flags) case CPP_STRING: case CPP_WSTRING: + gcc_assert (tok->val.str.len != 0); + if (!c_lex_return_raw_strings) { type = lex_string (tok, value, false); @@ -460,7 +462,7 @@ c_lex_with_flags (tree *value, location_t *loc, unsigned char *cpp_flags) } *value = build_string (tok->val.str.len, (char *) tok->val.str.text); break; - + case CPP_PRAGMA: *value = build_int_cst (NULL, tok->val.pragma); break; @@ -724,6 +726,8 @@ lex_string (const cpp_token *tok, tree *valp, bool objc_string) cpp_string str = tok->val.str; cpp_string *strs = &str; + gcc_assert (str.len != 0); + if (tok->type == CPP_WSTRING) wide = true; diff --git a/gcc/ggc-boehm.c b/gcc/ggc-boehm.c index 9e05aede13d..11586be8548 100755 --- a/gcc/ggc-boehm.c +++ b/gcc/ggc-boehm.c @@ -1,155 +1,207 @@ -#include "config.h"
-#include "system.h"
-#include "options.h"
-#include "params.h"
-#include "timevar.h"
-#include "ggc.h"
-
-#include <gc.h>
-
-static void register_gty_roots(void);
-
-static size_t last_allocated = 0;
-
-void
-init_ggc (void)
-{
- GC_init();
- GC_disable(); /* Do not collect on allocation */
- register_gty_roots();
-}
-
-void *
-ggc_alloc_stat (size_t size MEM_STAT_DECL)
-{
- return GC_MALLOC(size);
-}
-
-void
-ggc_collect (void)
-{
- /* Avoid frequent unnecessary work by skipping collection if the
- total allocations haven't expanded much since the last
- collection. */
- float allocated_last_gc =
- MAX (last_allocated, (size_t)PARAM_VALUE (GGC_MIN_HEAPSIZE) * 1024);
-
- float min_expand = allocated_last_gc * PARAM_VALUE (GGC_MIN_EXPAND) / 100;
-
- if (GC_get_heap_size() < allocated_last_gc + min_expand
- && !ggc_force_collect)
- return;
-
- timevar_push (TV_GC);
- if (!quiet_flag)
- fprintf (stderr, " {GC %luk -> ",
- (unsigned long) GC_get_heap_size() / 1024);
- GC_enable();
- GC_gcollect();
- GC_disable();
- if (!quiet_flag)
- fprintf (stderr, "%luk}", (unsigned long) GC_get_heap_size() / 1024);
- last_allocated = GC_get_heap_size();
- timevar_pop (TV_GC);
-}
-
-void
-ggc_free (void * block)
-{
- GC_FREE(block); /* For some blocks might be unprofitable? */
-}
-
-size_t
-ggc_get_size (const void * block)
-{
- return GC_size(block); /* Note that GC_size may return a bit larger value
- than originally requested */
-}
-
-int
-ggc_marked_p (const void * d)
-{
- abort();
-}
-
-char *
-ggc_pch_alloc_object (struct ggc_pch_data * d, void * p, size_t s, bool b,
- enum gt_types_enum t)
-{
- abort();
-}
-
-void
-ggc_pch_count_object (struct ggc_pch_data * d, void * p, size_t s, bool b,
- enum gt_types_enum t)
-{
- abort();
-}
-
-void
-ggc_pch_finish (struct ggc_pch_data * d, FILE * f)
-{
- abort();
-}
-
-void
-ggc_pch_read (FILE * f, void * p)
-{
- abort();
-}
-
-void
-ggc_pch_this_base (struct ggc_pch_data * d, void * p)
-{
- abort();
-}
-
-void
-ggc_pch_prepare_write (struct ggc_pch_data * d, FILE * f)
-{
- abort();
-}
-
-size_t
-ggc_pch_total_size (struct ggc_pch_data * d)
-{
- abort();
-}
-
-void
-ggc_pch_write_object (struct ggc_pch_data * d, FILE * f, void * p1, void * p2,
- size_t s, bool b)
-{
- abort();
-}
-
-void
-ggc_print_statistics (void)
-{
- abort();
-}
-
-int
-ggc_set_mark (const void * block)
-{
- abort();
-}
-
-struct ggc_pch_data *
-init_ggc_pch (void)
-{
- abort();
-}
-
-void
-register_gty_roots(void)
-{
- const struct ggc_root_tab *const *rt;
- const struct ggc_root_tab *rti;
-
- for (rt = gt_ggc_rtab; *rt; rt++)
- for (rti = *rt; rti->base != NULL; rti++)
- GC_add_roots(rti->base, rti->base + rti->stride);
-
- /* TODO: it might be required to process gt_ggc_cache_rtab here */
-}
+#include "config.h" +#include "system.h" +#include "options.h" +#include "params.h" +#include "timevar.h" +#include "ggc.h" + +#define GC_DEBUG +#include <gc.h> + +static size_t get_used_heap_size(void); +static void register_gty_roots(void); + +static size_t last_allocated = 0; +static ggc_stringpool_roots stringpool_roots; + +void +init_ggc (void) +{ + GC_init(); + GC_disable(); /* Do not collect on allocation */ + register_gty_roots(); + + stringpool_roots.start = NULL; + stringpool_roots.one_after_finish = NULL; +} + +void * +ggc_alloc_stat (size_t size MEM_STAT_DECL) +{ + void * result = GC_MALLOC(size); + return result; +} + +void * +ggc_realloc_stat (void *x, size_t size MEM_STAT_DECL) +{ + void * result = GC_REALLOC(x, size); + return result; +} + +void +ggc_collect (void) +{ + /* Avoid frequent unnecessary work by skipping collection if the + total allocations haven't expanded much since the last + collection. */ + float allocated_last_gc = + MAX (last_allocated, (size_t)PARAM_VALUE (GGC_MIN_HEAPSIZE) * 1024); + + float min_expand = allocated_last_gc * PARAM_VALUE (GGC_MIN_EXPAND) / 100; + + if (GC_get_heap_size() < allocated_last_gc + min_expand + && !ggc_force_collect) + return; + + timevar_push (TV_GC); + if (!quiet_flag) + fprintf (stderr, " {GC %luk -> ", + (unsigned long) get_used_heap_size() / 1024); + + if (!stringpool_roots.start) + stringpool_roots = ggc_register_stringpool_roots(); + else if (ggc_stringpool_moved_p(stringpool_roots)) + { + ggc_unregister_stringpool_roots(stringpool_roots); + stringpool_roots = ggc_register_stringpool_roots(); + } + + GC_enable(); + GC_gcollect(); + GC_disable(); + + if (!quiet_flag) + fprintf (stderr, "%luk}", (unsigned long) get_used_heap_size() / 1024); + last_allocated = GC_get_heap_size(); + timevar_pop (TV_GC); +} + +void +ggc_free (void * block) +{ + GC_FREE(block); /* For some blocks might be unprofitable? */ +} + +size_t +ggc_get_size (const void * block) +{ + return GC_size((void *)block); /* Note that GC_size may return a bit larger + value than originally requested */ +} + +int +ggc_marked_p (const void * d ATTRIBUTE_UNUSED) +{ + abort(); +} + +char * +ggc_pch_alloc_object (struct ggc_pch_data * d ATTRIBUTE_UNUSED, + void * p ATTRIBUTE_UNUSED, size_t s ATTRIBUTE_UNUSED, + bool b ATTRIBUTE_UNUSED, + enum gt_types_enum t ATTRIBUTE_UNUSED) +{ + abort(); +} + +void +ggc_pch_count_object (struct ggc_pch_data * d ATTRIBUTE_UNUSED, + void * p ATTRIBUTE_UNUSED, size_t s ATTRIBUTE_UNUSED, + bool b ATTRIBUTE_UNUSED, + enum gt_types_enum t ATTRIBUTE_UNUSED) +{ + abort(); +} + +void +ggc_pch_finish (struct ggc_pch_data * d ATTRIBUTE_UNUSED, + FILE * f ATTRIBUTE_UNUSED) +{ + abort(); +} + +void +ggc_pch_read (FILE * f ATTRIBUTE_UNUSED, void * p ATTRIBUTE_UNUSED) +{ + abort(); +} + +void +ggc_pch_this_base (struct ggc_pch_data * d ATTRIBUTE_UNUSED, + void * p ATTRIBUTE_UNUSED) +{ + abort(); +} + +void +ggc_pch_prepare_write (struct ggc_pch_data * d ATTRIBUTE_UNUSED, + FILE * f ATTRIBUTE_UNUSED) +{ + abort(); +} + +size_t +ggc_pch_total_size (struct ggc_pch_data * d ATTRIBUTE_UNUSED) +{ + abort(); +} + +void +ggc_pch_write_object (struct ggc_pch_data * d ATTRIBUTE_UNUSED, + FILE * f ATTRIBUTE_UNUSED, void * p1 ATTRIBUTE_UNUSED, + void * p2 ATTRIBUTE_UNUSED, size_t s ATTRIBUTE_UNUSED, + bool b ATTRIBUTE_UNUSED) +{ + abort(); +} + +void +ggc_print_statistics (void) +{ + struct ggc_statistics stats; + memset (&stats, 0, sizeof(stats)); + + last_allocated = 0; + + ggc_print_common_statistics (stderr, &stats); + + fprintf (stderr, + "\nMemory still allocated at the end of the compilation process\n"); + fprintf (stderr, + "Total heap size: %lu\n", (unsigned long)GC_get_heap_size()); + fprintf (stderr, + "Free bytes in the heap: %lu\n", (unsigned long)GC_get_free_bytes()); +} + +int +ggc_set_mark (const void * block ATTRIBUTE_UNUSED) +{ + abort(); +} + +struct ggc_pch_data * +init_ggc_pch (void) +{ + abort(); +} + + +size_t +get_used_heap_size(void) +{ + return GC_get_heap_size() - GC_get_free_bytes(); +} + +void +register_gty_roots(void) +{ + const struct ggc_root_tab *const *rt; + const struct ggc_root_tab *rti; + + for (rt = gt_ggc_rtab; *rt; rt++) + for (rti = *rt; rti->base != NULL; rti++) + GC_add_roots((char *)rti->base, (char *)rti->base + rti->stride); + + /* TODO: it might be required to process gt_ggc_cache_rtab here */ +} diff --git a/gcc/ggc-common.c b/gcc/ggc-common.c index 3da248b6e40..d00f9032c84 100644 --- a/gcc/ggc-common.c +++ b/gcc/ggc-common.c @@ -140,52 +140,6 @@ ggc_alloc_cleared_stat (size_t size MEM_STAT_DECL) return buf; } -/* Resize a block of memory, possibly re-allocating it. */ -void * -ggc_realloc_stat (void *x, size_t size MEM_STAT_DECL) -{ - void *r; - size_t old_size; - - if (x == NULL) - return ggc_alloc_stat (size PASS_MEM_STAT); - - old_size = ggc_get_size (x); - - if (size <= old_size) - { - /* Mark the unwanted memory as unaccessible. We also need to make - the "new" size accessible, since ggc_get_size returns the size of - the pool, not the size of the individually allocated object, the - size which was previously made accessible. Unfortunately, we - don't know that previously allocated size. Without that - knowledge we have to lose some initialization-tracking for the - old parts of the object. An alternative is to mark the whole - old_size as reachable, but that would lose tracking of writes - after the end of the object (by small offsets). Discard the - handle to avoid handle leak. */ - VALGRIND_DISCARD (VALGRIND_MAKE_NOACCESS ((char *) x + size, - old_size - size)); - VALGRIND_DISCARD (VALGRIND_MAKE_READABLE (x, size)); - return x; - } - - r = ggc_alloc_stat (size PASS_MEM_STAT); - - /* Since ggc_get_size returns the size of the pool, not the size of the - individually allocated object, we'd access parts of the old object - that were marked invalid with the memcpy below. We lose a bit of the - initialization-tracking since some of it may be uninitialized. */ - VALGRIND_DISCARD (VALGRIND_MAKE_READABLE (x, old_size)); - - memcpy (r, x, old_size); - - /* The old object is not supposed to be used anymore. */ - ggc_free (x); - - return r; -} - /* Like ggc_alloc_cleared, but performs a multiplication. */ void * ggc_calloc (size_t s1, size_t s2) diff --git a/gcc/ggc.h b/gcc/ggc.h index d6e2303de81..d089c66ee5b 100644 --- a/gcc/ggc.h +++ b/gcc/ggc.h @@ -314,4 +314,14 @@ extern void *ggc_alloc_zone_stat (size_t, struct alloc_zone * MEM_STAT_DECL); #endif +/* Stringpool root information */ +typedef struct ggc_stringpool_roots { + void *start; + void *one_after_finish; +} ggc_stringpool_roots; + +extern ggc_stringpool_roots ggc_register_stringpool_roots (void); +extern void ggc_unregister_stringpool_roots (ggc_stringpool_roots roots); +extern int ggc_stringpool_moved_p (ggc_stringpool_roots roots); + #endif diff --git a/gcc/stringpool.c b/gcc/stringpool.c index 9170380a132..ef734e12092 100644 --- a/gcc/stringpool.c +++ b/gcc/stringpool.c @@ -57,12 +57,11 @@ static struct obstack string_stack; static hashnode alloc_node (hash_table *); static int mark_ident (struct cpp_reader *, hashnode, const void *); -static void ggc_register_stringpool_roots (void); static void * stringpool_ggc_alloc (size_t x) { - return ggc_alloc (x); + return ggc_alloc (x); /* TODO: specialized alloc for no pointers inside? */ } /* Initialize the string pool. */ @@ -183,13 +182,32 @@ ggc_mark_stringpool (void) ht_forall (ident_hash, mark_ident, NULL); } -/* Register the stringpool entries as GGC roots. TODO: why these are handled - specially? */ -void +/* Register the stringpool entries as GGC roots. In contrast to all other + roots, that are static, stringpool may increase and move around in memory. + So it's handled specially. */ +ggc_stringpool_roots ggc_register_stringpool_roots (void) { - GC_add_roots(ident_hash->entries, - ident_hash->entries + sizeof(hashnode) * (1 << ORDER)); + ggc_stringpool_roots result; + result.start = ident_hash->entries; + result.one_after_finish = ident_hash->entries + ident_hash->nslots; + + GC_add_roots (result.start, result.one_after_finish); + + return result; +} + +void +ggc_unregister_stringpool_roots (ggc_stringpool_roots roots) +{ + GC_remove_roots (roots.start, roots.one_after_finish); +} + +int +ggc_stringpool_moved_p (ggc_stringpool_roots roots) +{ + return (roots.start != ident_hash->entries) + || (roots.one_after_finish != ident_hash->entries + ident_hash->nslots); } /* Strings are _not_ GCed, but this routine exists so that a separate diff --git a/gcc/vec.c b/gcc/vec.c index 5d5687475ec..29ab3f27f75 100644 --- a/gcc/vec.c +++ b/gcc/vec.c @@ -34,7 +34,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA #include "tree.h" #include "toplev.h" -struct vec_prefix +struct vec_prefix { unsigned num; unsigned alloc; @@ -60,10 +60,10 @@ calculate_allocation (const struct vec_prefix *pfx, int reserve) /* If there's no prefix, and we've not requested anything, then we will create a NULL vector. */ return 0; - + /* We must have run out of room. */ gcc_assert (alloc - num < (unsigned)(reserve < 0 ? -reserve : reserve)); - + if (reserve < 0) /* Exact size. */ alloc = num + -reserve; @@ -78,7 +78,7 @@ calculate_allocation (const struct vec_prefix *pfx, int reserve) else /* Grow slower when large. */ alloc = (alloc * 3 / 2); - + /* If this is still too small, set it to the right size. */ if (alloc < num + reserve) alloc = num + reserve; @@ -108,15 +108,15 @@ vec_gc_o_reserve (void *vec, int reserve, size_t vec_offset, size_t elt_size { struct vec_prefix *pfx = vec; unsigned alloc = alloc = calculate_allocation (pfx, reserve); - + if (!alloc) return NULL; - + vec = ggc_realloc_stat (vec, vec_offset + alloc * elt_size PASS_MEM_STAT); ((struct vec_prefix *)vec)->alloc = alloc; if (!pfx) ((struct vec_prefix *)vec)->num = 0; - + return vec; } @@ -141,12 +141,12 @@ vec_heap_o_reserve (void *vec, int reserve, size_t vec_offset, size_t elt_size if (!alloc) return NULL; - + vec = xrealloc (vec, vec_offset + alloc * elt_size); ((struct vec_prefix *)vec)->alloc = alloc; if (!pfx) ((struct vec_prefix *)vec)->num = 0; - + return vec; } diff --git a/gcc/vec.h b/gcc/vec.h index 1f134528374..85f31ea31ff 100644 --- a/gcc/vec.h +++ b/gcc/vec.h @@ -87,12 +87,12 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA when the type is defined, and is therefore part of the type. If you need both gc'd and heap allocated versions, you still must have *exactly* one definition of the common non-memory managed base vector. - + If you need to directly manipulate a vector, then the 'address' accessor will return the address of the start of the vector. Also the 'space' predicate will tell you whether there is spare capacity in the vector. You will not normally need to use these two functions. - + Vector types are defined using a DEF_VEC_{O,P,I}(TYPEDEF) macro, to get the non-memory allocation version, and then a DEF_VEC_ALLOC_{O,P,I}(TYPEDEF,ALLOC) macro to get memory managed diff --git a/libcpp/charset.c b/libcpp/charset.c index 78c89816735..17d7d223def 100644 --- a/libcpp/charset.c +++ b/libcpp/charset.c @@ -23,6 +23,8 @@ Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "cpplib.h" #include "internal.h" +#include <assert.h> + /* Character set handling for C-family languages. Terminological note: In what follows, "charset" or "character set" @@ -1317,6 +1319,8 @@ cpp_interpret_string (cpp_reader *pfile, const cpp_string *from, size_t count, for (i = 0; i < count; i++) { + assert (from[i].len != 0); + p = from[i].text; if (*p == 'L') p++; p++; /* Skip leading quote. */ diff --git a/libcpp/configure b/libcpp/configure index 1ef77e8bb36..187d8866872 100755 --- a/libcpp/configure +++ b/libcpp/configure @@ -7264,8 +7264,9 @@ INCINTL= XGETTEXT= GMSGFMT= POSUB= -if test -f ../intl/config.intl; then - . ../intl/config.intl + +if test -f ../intl/config.intl; then + . ../intl/config.intl fi echo "$as_me:$LINENO: checking whether NLS is requested" >&5 echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 diff --git a/libcpp/lex.c b/libcpp/lex.c index cae9b037663..262a59db327 100644 --- a/libcpp/lex.c +++ b/libcpp/lex.c @@ -1317,7 +1317,7 @@ cpp_spell_token (cpp_reader *pfile, const cpp_token *token, { size_t i; const unsigned char * name = NODE_NAME (token->val.node); - + for (i = 0; i < NODE_LEN (token->val.node); i++) if (name[i] & ~0x7F) { |