--- gcc-4.1-4.1.1.orig/debian/rules.d/binary-cxx-cross.mk
+++ gcc-4.1-4.1.1/debian/rules.d/binary-cxx-cross.mk
@@ -0,0 +1,42 @@
+arch_binaries := $(arch_binaries) cxx
+
+dirs_cxx = \
+ $(docdir) \
+ $(PF)/bin \
+ $(gcc_lib_dir) \
+ $(PF)/share/man/man1
+files_cxx = \
+ $(PF)/bin/$(DEB_TARGET_GNU_TYPE)-g++$(pkg_ver) \
+ $(PF)/share/man/man1/$(DEB_TARGET_GNU_TYPE)-g++$(pkg_ver).1 \
+ $(gcc_lib_dir)/cc1plus
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-cxx: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_cxx)
+ dh_installdirs -p$(p_cxx) $(dirs_cxx)
+ DH_COMPAT=2 dh_movefiles -p$(p_cxx) $(files_cxx)
+# g++ man page is a .so link
+ rm -f $(d_cxx)/$(PF)/share/man/man1/$(DEB_TARGET_GNU_TYPE)-g++$(pkg_ver).1
+ ln -sf $(DEB_TARGET_GNU_TYPE)-gcc$(pkg_ver).1.gz \
+ $(d_cxx)/$(PF)/share/man/man1/$(DEB_TARGET_GNU_TYPE)-g++$(pkg_ver).1.gz
+
+ debian/dh_doclink -p$(p_cxx) $(p_base)
+ debian/dh_rmemptydirs -p$(p_cxx)
+
+ dh_strip -p$(p_cxx)
+ dh_compress -p$(p_cxx)
+ dh_fixperms -p$(p_cxx)
+ dh_shlibdeps -p$(p_cxx)
+ dh_gencontrol -p$(p_cxx) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_cxx)
+ sed 's/cross-/$(TP)/g;s/-ver/$(pkg_ver)/g;s/gcc/g++/g' < debian/gcc-cross.postinst > debian/$(p_cxx)/DEBIAN/postinst
+ sed 's/cross-/$(TP)/g;s/-ver/$(pkg_ver)/g;s/gcc/g++/g' < debian/gcc-cross.prerm > debian/$(p_cxx)/DEBIAN/prerm
+ chmod 755 debian/$(p_cxx)/DEBIAN/{postinst,prerm}
+ dh_md5sums -p$(p_cxx)
+ dh_builddeb -p$(p_cxx)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
--- gcc-4.1-4.1.1.orig/debian/rules.d/binary-fixincl.mk
+++ gcc-4.1-4.1.1/debian/rules.d/binary-fixincl.mk
@@ -0,0 +1,47 @@
+arch_binaries := $(arch_binaries) fixincl
+
+p_fix = fixincludes
+d_fix = debian/$(p_fix)
+
+dirs_fix = \
+ $(docdir)/$(p_base)/fixincludes \
+ $(PF)/share/man/man1 \
+ $(PF)/bin \
+ $(gcc_lexec_dir) \
+ $(gcc_lib_dir)
+files_fix = \
+ $(gcc_lexec_dir)/install-tools \
+ $(gcc_lib_dir)/install-tools
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-fixincl: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_fix)
+ dh_installdirs -p$(p_fix) $(dirs_fix)
+ DH_COMPAT=2 dh_movefiles -p$(p_fix) $(files_fix)
+
+# $(IP) $(builddir)/gcc/fixinc/fixincl $(d_fix)/$(PF)/lib/fixincludes/
+# sed -e "s,^FIXINCL=\(.*\),FIXINCL=/$(PF)/lib/fixincludes/fixincl," \
+# $(builddir)/gcc/fixinc.sh \
+# > $(d_fix)/$(PF)/lib/fixincludes/fixinc.sh
+# chmod 755 $(d_fix)/$(PF)/lib/fixincludes/fixinc.sh
+ $(IR) $(srcdir)/fixincludes/README \
+ $(d_fix)/$(docdir)/$(p_base)/fixincludes
+ sed -e 's,@LIBEXECDIR@,$(gcc_lexec_dir),g' debian/fixincludes.in \
+ > $(d_fix)/$(PF)/bin/fixincludes
+ chmod 755 $(d_fix)/$(PF)/bin/fixincludes
+
+ debian/dh_doclink -p$(p_fix) $(p_base)
+ dh_strip -p$(p_fix)
+ dh_compress -p$(p_fix)
+ dh_fixperms -p$(p_fix)
+ dh_shlibdeps -p$(p_fix)
+ dh_gencontrol -p$(p_fix) -- -v$(DEB_EVERSION) $(common_substvars)
+ dh_installdeb -p$(p_fix)
+ dh_md5sums -p$(p_fix)
+ dh_builddeb -p$(p_fix)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
--- gcc-4.1-4.1.1.orig/debian/rules.d/binary-snapshot.mk
+++ gcc-4.1-4.1.1/debian/rules.d/binary-snapshot.mk
@@ -0,0 +1,87 @@
+arch_binaries := $(arch_binaries) snapshot
+
+p_snap = gcc-snapshot
+d_snap = debian/$(p_snap)
+
+dirs_snap = \
+ $(docdir)/$(p_snap) \
+ usr/lib
+files_snap =
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-snapshot: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_snap)
+ dh_installdirs -p$(p_snap) $(dirs_snap)
+
+ -find $(d) -name '*.gch' -type d | xargs rm -rf
+
+ : # dh_movefiles -p$(p_snap) $(files_snap)
+ rm -f $(d_snap)/$(PF)
+ mv $(d)/$(PF) $(d_snap)/usr/lib/
+
+ rm -rf $(d_snap)/$(PF)/lib/nof
+
+ifeq ($(DEB_TARGET_ARCH),hppa)
+ rm -f $(install_hppa64_stamp)
+
+ : # provide as and ld links
+ dh_link -p $(p_snap) \
+ /usr/bin/hppa64-linux-gnu-as \
+ /$(PF)/lib/gcc/hppa64-linux-gnu/$(GCC_VERSION)/as \
+ /usr/bin/hppa64-linux-gnu-ld \
+ /$(PF)/lib/gcc/hppa64-linux-gnu/$(GCC_VERSION)/ld
+
+ DH_COMPAT=2 dh_movefiles -p$(p_snap) --sourcedir=$(d_hppa64) \
+ $(PF)/libexec \
+ $(PF)/lib \
+ $(PF)/bin/hppa64-linux-gnu-{cpp,gcc}
+endif
+
+ifeq ($(with_check),yes)
+ dh_installdocs -p$(p_snap) test-summary
+ ifeq ($(with_pascal),yes)
+ cp -p gpc-test-summary $(d_snap)/$(docdir)/$(p_snap)/
+ endif
+else
+ dh_installdocs -p$(p_snap)
+endif
+ if [ -f $(buildlibdir)/libstdc++-v3/testsuite/current_symbols.txt ]; \
+ then \
+ cp -p $(buildlibdir)/libstdc++-v3/testsuite/current_symbols.txt \
+ $(d_snap)/$(docdir)/$(p_snap)/libstdc++6_symbols.txt; \
+ fi
+ cp -p debian/README.snapshot \
+ $(d_snap)/$(docdir)/$(p_snap)/README.Debian
+ dh_installchangelogs -p$(p_snap)
+ifeq ($(DEB_TARGET_ARCH),hppa)
+ dh_strip -p$(p_snap) -Xdebug -X.o -X.a
+else
+ dh_strip -p$(p_snap) -Xdebug
+endif
+ dh_compress -p$(p_snap)
+ -find $(d_snap) -type d ! -perm 755 -exec chmod 755 {} \;
+ dh_fixperms -p$(p_snap)
+ifeq ($(biarch),yes)
+ mv $(d_snap)/$(PF)/lib64 .
+endif
+ifeq ($(biarch32),yes)
+ mv $(d_snap)/$(PF)/lib32 .
+endif
+ dh_shlibdeps -p$(p_snap) \
+ -l$(d_snap)/$(PF)/lib:$(d_snap)/$(gcc_lib_dir)
+ifeq ($(biarch),yes)
+ mv lib64 $(d_snap)/$(PF)/
+endif
+ifeq ($(biarch32),yes)
+ mv lib32 $(d_snap)/$(PF)/
+endif
+ dh_gencontrol -p$(p_snap) -- $(common_substvars)
+ dh_installdeb -p$(p_snap)
+ dh_md5sums -p$(p_snap)
+ dh_builddeb -p$(p_snap)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
--- gcc-4.1-4.1.1.orig/debian/rules.d/binary-softfloat.mk
+++ gcc-4.1-4.1.1/debian/rules.d/binary-softfloat.mk
@@ -0,0 +1,33 @@
+arch_binaries := $(arch_binaries) softfloat
+
+p_softfloat = gcc$(pkg_ver)-soft-float
+d_softfloat = debian/$(p_softfloat)
+
+dirs_softfloat = \
+ $(PF)/$(libdir)/soft-float \
+ $(gcc_lib_dir)/soft-float
+
+files_softfloat = \
+ $(PF)/$(libdir)/soft-float \
+ $(gcc_lib_dir)/soft-float
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-softfloat: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_softfloat)
+ dh_installdirs -p$(p_softfloat) $(dirs_softfloat)
+ DH_COMPAT=2 dh_movefiles -p$(p_softfloat) $(files_softfloat)
+ debian/dh_doclink -p$(p_softfloat) $(p_base)
+ dh_strip -p$(p_softfloat) -Xlibgcj.a
+ dh_compress -p$(p_softfloat)
+ dh_fixperms -p$(p_softfloat)
+ dh_shlibdeps -p$(p_softfloat)
+ dh_gencontrol -p$(p_softfloat) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_softfloat)
+ dh_md5sums -p$(p_softfloat)
+ dh_builddeb -p$(p_softfloat)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
--- gcc-4.1-4.1.1.orig/debian/rules.d/binary-treelang.mk
+++ gcc-4.1-4.1.1/debian/rules.d/binary-treelang.mk
@@ -0,0 +1,55 @@
+arch_binaries := $(arch_binaries) treelang
+
+p_tree = treelang$(pkg_ver)
+d_tree = debian/$(p_tree)
+
+dirs_tree = \
+ $(docdir)/$(p_base)/treelang \
+ $(gcc_lexec_dir) \
+ $(PF)/bin \
+ $(PF)/share/info
+
+files_tree = \
+ $(PF)/bin/gtreelang$(pkg_ver) \
+ $(gcc_lexec_dir)/tree1
+
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ files_tree += \
+ $(PF)/share/info/treelang*
+endif
+
+$(binary_stamp)-treelang: $(build_html_stamp) $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_tree)
+ dh_installdirs -p$(p_tree) $(dirs_tree)
+ DH_COMPAT=2 dh_movefiles -p$(p_tree) $(files_tree)
+
+ debian/dh_doclink -p$(p_tree) $(p_base)
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ dh_installdocs -p$(p_tree)
+ rm -f $(d_tree)/$(docdir)/$(p_base)/copyright
+ cp -p html/treelang.html $(d_tree)/$(docdir)/$(p_base)/treelang/
+endif
+ cp -p $(srcdir)/gcc/treelang/README \
+ $(d_tree)/$(docdir)/$(p_base)/treelang/.
+ cp -p $(srcdir)/gcc/treelang/ChangeLog \
+ $(d_tree)/$(docdir)/$(p_base)/treelang/changelog
+ cp -p debian/README.treelang \
+ $(d_tree)/$(docdir)/$(p_base)/treelang/README.Debian
+
+ debian/dh_rmemptydirs -p$(p_tree)
+
+ dh_strip -p$(p_tree)
+ dh_compress -p$(p_tree)
+
+ dh_fixperms -p$(p_tree)
+ dh_shlibdeps -p$(p_tree)
+ dh_gencontrol -p$(p_tree) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_tree)
+ dh_md5sums -p$(p_tree)
+ dh_builddeb -p$(p_tree)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
--- gcc-4.1-4.1.1.orig/debian/rules.d/binary-hppa64.mk
+++ gcc-4.1-4.1.1/debian/rules.d/binary-hppa64.mk
@@ -0,0 +1,29 @@
+arch_binaries := $(arch_binaries) hppa64
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-hppa64: $(install_hppa64_stamp)
+ dh_testdir
+ dh_testroot
+
+# dh_installdirs -p$(p_hppa64)
+
+ : # provide as and ld links
+ dh_link -p $(p_hppa64) \
+ /usr/bin/hppa64-linux-gnu-as \
+ /$(PF)/lib/gcc/hppa64-linux-gnu/$(GCC_VERSION)/as \
+ /usr/bin/hppa64-linux-gnu-ld \
+ /$(PF)/lib/gcc/hppa64-linux-gnu/$(GCC_VERSION)/ld
+
+ debian/dh_doclink -p$(p_hppa64) $(p_base)
+ debian/dh_rmemptydirs -p$(p_hppa64)
+
+ dh_strip -p$(p_hppa64) -X.o -Xlibgcc.a -Xlibgcov.a
+ dh_compress -p$(p_hppa64)
+ dh_fixperms -p$(p_hppa64)
+ dh_shlibdeps -p$(p_hppa64)
+ dh_gencontrol -p$(p_hppa64) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_hppa64)
+ dh_md5sums -p$(p_hppa64)
+ dh_builddeb -p$(p_hppa64)
+
+ touch $@
--- gcc-4.1-4.1.1.orig/debian/rules.d/binary-cxx.mk
+++ gcc-4.1-4.1.1/debian/rules.d/binary-cxx.mk
@@ -0,0 +1,58 @@
+arch_binaries := $(arch_binaries) cxx
+
+dirs_cxx = \
+ $(docdir)/$(p_base)/C++ \
+ $(PF)/bin \
+ $(PF)/share/info \
+ $(gcc_lexec_dir) \
+ $(PF)/share/man/man1
+files_cxx = \
+ $(PF)/bin/g++$(pkg_ver) \
+ $(gcc_lexec_dir)/cc1plus
+
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ files_cxx += \
+ $(PF)/share/man/man1/g++$(pkg_ver).1
+endif
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-cxx: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_cxx)
+ dh_installdirs -p$(p_cxx) $(dirs_cxx)
+ DH_COMPAT=2 dh_movefiles -p$(p_cxx) $(files_cxx)
+
+ ln -sf g++$(pkg_ver) \
+ $(d_cxx)/$(PF)/bin/$(DEB_TARGET_GNU_TYPE)-g++$(pkg_ver)
+ ln -sf g++$(pkg_ver) \
+ $(d_cxx)/$(PF)/bin/$(TARGET_ALIAS)-g++$(pkg_ver)
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+# g++ man page is a .so link
+ rm -f $(d_cxx)/$(PF)/share/man/man1/g++$(pkg_ver).1
+ ln -sf gcc$(pkg_ver).1.gz \
+ $(d_cxx)/$(PF)/share/man/man1/g++$(pkg_ver).1.gz
+ ln -sf g++$(pkg_ver).1.gz \
+ $(d_cxx)/$(PF)/share/man/man1/$(DEB_TARGET_GNU_TYPE)-g++$(pkg_ver).1.gz
+ ln -sf g++$(pkg_ver).1.gz \
+ $(d_cxx)/$(PF)/share/man/man1/$(TARGET_ALIAS)-g++$(pkg_ver).1.gz
+endif
+
+ debian/dh_doclink -p$(p_cxx) $(p_base)
+ cp -p debian/README.C++ $(d_cxx)/$(docdir)/$(p_base)/C++/
+ cp -p $(srcdir)/gcc/cp/ChangeLog \
+ $(d_cxx)/$(docdir)/$(p_base)/C++/changelog
+ debian/dh_rmemptydirs -p$(p_cxx)
+
+ dh_strip -p$(p_cxx)
+ dh_compress -p$(p_cxx)
+ dh_fixperms -p$(p_cxx)
+ dh_shlibdeps -p$(p_cxx)
+ dh_gencontrol -p$(p_cxx) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_cxx)
+ dh_md5sums -p$(p_cxx)
+ dh_builddeb -p$(p_cxx)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
--- gcc-4.1-4.1.1.orig/debian/rules.d/binary-pascal.mk
+++ gcc-4.1-4.1.1/debian/rules.d/binary-pascal.mk
@@ -0,0 +1,100 @@
+arch_binaries := $(arch_binaries) pascal
+indep_binaries := $(indep_binaries) pascal-doc
+
+p_gpc = gpc$(gpc_pkg_ver)
+p_gpcd = gpc$(gpc_pkg_ver)-doc
+
+d_gpc = debian/$(p_gpc)
+d_gpcd = debian/$(p_gpcd)
+
+dirs_gpc = \
+ $(docdir)/$(p_base)/pascal \
+ $(PF)/bin \
+ $(gcc_lexec_dir) \
+ $(gcc_lib_dir)/{include,units} \
+ $(PF)/share/man/man1
+ifeq ($(with_gpidump),yes)
+ files_gpc = \
+ $(PF)/bin/{binobj,gpc,gpc-run,gpidump}$(gpc_pkg_ver) \
+ $(PF)/share/man/man1/{binobj,gpc,gpc-run,gpidump}$(gpc_pkg_ver).1 \
+ $(gcc_lexec_dir)/gpc1 \
+ $(gcc_lib_dir)/{libgpc.a,units} \
+ $(gcc_lib_dir)/include/gpc-in-c.h
+else
+ files_gpc = \
+ $(PF)/bin/{binobj,gpc,gpc-run}$(gpc_pkg_ver) \
+ $(PF)/share/man/man1/{binobj,gpc,gpc-run}$(gpc_pkg_ver).1 \
+ $(gcc_lexec_dir)/gpc1 \
+ $(gcc_lib_dir)/{libgpc.a,units} \
+ $(gcc_lib_dir)/include/gpc-in-c.h
+endif
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-pascal: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_gpc)
+ dh_installdirs -p$(p_gpc) $(dirs_gpc)
+
+ rm -f $(d)/$(PF)/bin/pc $(d)/$(PF)/share/man/man1/pc.1
+ DH_COMPAT=2 dh_movefiles -p$(p_gpc) $(files_gpc)
+
+ debian/dh_doclink -p$(p_gpc) $(p_base)
+ cp -p $(srcdir)/gcc/p/{AUTHORS,FAQ,NEWS,README} \
+ $(d_gpc)/$(docdir)/$(p_base)/pascal/.
+ cp -p $(srcdir)/gcc/p/test/README \
+ $(d_gpc)/$(docdir)/$(p_base)/pascal/README.gpc-test
+ cp -p $(srcdir)/gcc/p/ChangeLog \
+ $(d_gpc)/$(docdir)/$(p_base)/pascal/changelog
+
+# ln -sf ../$(p_gpc)/examples $(d_gpcd)/$(docdir)/$(p_gpcd)/examples
+# ln -sf ../$(p_gpc)/docdemos $(d_gpcd)/$(docdir)/$(p_gpcd)/docdemos
+
+ dh_strip -p$(p_gpc)
+ dh_compress -p$(p_gpc)
+ dh_fixperms -p$(p_gpc)
+ dh_shlibdeps -p$(p_gpc)
+ dh_gencontrol -p$(p_gpc) -- -v$(DEB_GPC_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_gpc)
+ dh_md5sums -p$(p_gpc)
+ dh_builddeb -p$(p_gpc)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-pascal-doc: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_gpcd)
+ dh_installdirs -p$(p_gpcd) \
+ $(docdir)/$(p_base)/pascal \
+ $(PF)/share/info
+ DH_COMPAT=2 dh_movefiles -p$(p_gpcd) \
+ $(PF)/share/info/gpc*$(gpc_pkg_ver)*info*
+ debian/dh_doclink -p$(p_gpcd) $(p_base)
+ dh_installdocs -p$(p_gpcd)
+ rm -f $(d_gpcd)/$(docdir)/$(p_base)/copyright
+ cp -p html/gpc.html html/gpcs.html \
+ $(d_gpcd)/$(docdir)/$(p_base)/pascal/
+ mv $(d)/$(PF)/doc/gpc/demos \
+ $(d_gpcd)/$(docdir)/$(p_base)/pascal/examples
+ mv $(d)/$(PF)/doc/gpc/docdemos \
+ $(d_gpcd)/$(docdir)/$(p_base)/pascal/.
+
+# -$(MAKE) -C $(builddir)/gcc gpc.ps
+# cp -p $(builddir)/gcc/gpc.ps $(d_gpcd)/$(docdir)/$(p_base)/pascal/.
+
+ debian/dh_rmemptydirs -p$(p_gpcd)
+
+ dh_compress -p$(p_gpcd)
+ dh_fixperms -p$(p_gpcd)
+ dh_installdeb -p$(p_gpcd)
+ dh_gencontrol -p$(p_gpcd) -- -v$(DEB_GPC_VERSION) $(common_substvars)
+ dh_md5sums -p$(p_gpcd)
+ dh_builddeb -p$(p_gpcd)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
--- gcc-4.1-4.1.1.orig/debian/rules.d/binary-proto.mk
+++ gcc-4.1-4.1.1/debian/rules.d/binary-proto.mk
@@ -0,0 +1,43 @@
+arch_binaries := $(arch_binaries) proto
+
+p_proto = protoize
+d_proto = debian/$(p_proto)
+
+dirs_proto = \
+ $(docdir) \
+ $(PF)/share/man/man1 \
+ $(PF)/bin
+files_proto = \
+ $(PF)/bin/{protoize,unprotoize} \
+ $(PF)/share/man/man1/{protoize,unprotoize}.1
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-proto: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_proto)
+ dh_installdirs -p$(p_proto) $(dirs_proto)
+
+ifeq ($(versioned_packages),yes)
+ : # rename versioned files back to unversioned ones.
+ for i in protoize unprotoize; do \
+ mv $(d)/$(PF)/bin/$$i$(pkg_ver) $(d)/$(PF)/bin/$$i; \
+ done
+endif
+ $(IR) debian/protoize.1 $(d)/$(PF)/share/man/man1/
+ ln -sf protoize.1 $(d)/$(PF)/share/man/man1/unprotoize.1
+ DH_COMPAT=2 dh_movefiles -p$(p_proto) $(files_proto)
+
+ debian/dh_doclink -p$(p_proto) $(p_base)
+ dh_strip -p$(p_proto)
+ dh_compress -p$(p_proto)
+ dh_fixperms -p$(p_proto)
+ dh_shlibdeps -p$(p_proto)
+ dh_gencontrol -p$(p_proto) -- -v$(DEB_EVERSION) $(common_substvars)
+ dh_installdeb -p$(p_proto)
+ dh_md5sums -p$(p_proto)
+ dh_builddeb -p$(p_proto)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
--- gcc-4.1-4.1.1.orig/debian/rules.d/binary-cpp-cross.mk
+++ gcc-4.1-4.1.1/debian/rules.d/binary-cpp-cross.mk
@@ -0,0 +1,40 @@
+arch_binaries := $(arch_binaries) cpp
+
+dirs_cpp = \
+ $(docdir) \
+ $(PF)/share/man/man1 \
+ $(PF)/bin \
+ $(gcc_lexec_dir)
+
+files_cpp = \
+ $(PF)/bin/$(DEB_TARGET_GNU_TYPE)-cpp$(pkg_ver) \
+ $(PF)/share/man/man1/$(DEB_TARGET_GNU_TYPE)-cpp$(pkg_ver).1 \
+ $(gcc_lexec_dir)/cc1
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-cpp: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_cpp)
+ dh_installdirs -p$(p_cpp) $(dirs_cpp)
+ DH_COMPAT=2 dh_movefiles -p$(p_cpp) $(files_cpp)
+
+ debian/dh_doclink -p$(p_cpp) $(p_base)
+ debian/dh_rmemptydirs -p$(p_cpp)
+
+ dh_strip -p$(p_cpp)
+ dh_compress -p$(p_cpp)
+ dh_fixperms -p$(p_cpp)
+ dh_shlibdeps -p$(p_cpp)
+ dh_gencontrol -p$(p_cpp) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_cpp)
+ sed 's/cross-/$(TP)/g;s/-ver/$(pkg_ver)/g;s/gcc/cpp/g' < debian/gcc-cross.postinst > debian/$(p_cpp)/DEBIAN/postinst
+ sed 's/cross-/$(TP)/g;s/-ver/$(pkg_ver)/g;s/gcc/cpp/g' < debian/gcc-cross.prerm > debian/$(p_cpp)/DEBIAN/prerm
+ chmod 755 debian/$(p_cpp)/DEBIAN/{postinst,prerm}
+ dh_md5sums -p$(p_cpp)
+ dh_builddeb -p$(p_cpp)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
--- gcc-4.1-4.1.1.orig/debian/rules.d/binary-nof-cross.mk
+++ gcc-4.1-4.1.1/debian/rules.d/binary-nof-cross.mk
@@ -0,0 +1,46 @@
+arch_binaries := $(arch_binaries) nof
+
+p_nof = gcc$(pkg_arch)-nof
+d_nof = debian/$(p_nof)
+
+dirs_nof = \
+ $(docdir) \
+ $(PF)/$(DEB_TARGET_GNU_TYPE)/lib/nof
+ifeq ($(with_cdev),yes)
+ dirs_nof += \
+ $(gcc_lib_dir)/nof
+endif
+
+ifeq ($(with_cdev),yes)
+ files_nof = \
+ $(PF)/$(DEB_TARGET_GNU_TYPE)/lib/libgcc_s_nof.so.$(GCC_SONAME) \
+ $(gcc_lib_dir)/libgcc_s_nof.so \
+ $(PF)/$(DEB_TARGET_GNU_TYPE)/lib/nof \
+ $(gcc_lib_dir)/nof
+else
+ files_nof = \
+ lib/libgcc_s_nof.so.$(GCC_SONAME)
+endif
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-nof: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ ln -sf /$(PF)/$(DEB_TARGET_GNU_TYPE)/lib/libgcc_s_nof.so.$(GCC_SONAME) \
+ $(d)/$(gcc_lib_dir)/libgcc_s_nof.so
+
+ rm -rf $(d_nof)
+ dh_installdirs -p$(p_nof) $(dirs_nof)
+ DH_COMPAT=2 dh_movefiles -p$(p_nof) $(files_nof)
+ debian/dh_doclink -p$(p_nof) $(p_base)
+ dh_strip -p$(p_nof)
+ dh_compress -p$(p_nof)
+ dh_fixperms -p$(p_nof)
+ dh_gencontrol -p$(p_nof) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_nof)
+ dh_md5sums -p$(p_nof)
+ dh_builddeb -p$(p_nof)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
--- gcc-4.1-4.1.1.orig/debian/rules.d/binary-cpp.mk
+++ gcc-4.1-4.1.1/debian/rules.d/binary-cpp.mk
@@ -0,0 +1,81 @@
+arch_binaries := $(arch_binaries) cpp
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ indep_binaries := $(indep_binaries) cpp-doc
+endif
+
+dirs_cpp = \
+ $(docdir) \
+ $(PF)/share/man/man1 \
+ $(PF)/bin \
+ $(gcc_lexec_dir)
+
+files_cpp = \
+ $(PF)/bin/cpp$(pkg_ver) \
+ $(gcc_lexec_dir)/cc1
+
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ files_cpp += \
+ $(PF)/share/man/man1/cpp$(pkg_ver).1
+endif
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-cpp: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_cpp)
+ dh_installdirs -p$(p_cpp) $(dirs_cpp)
+ DH_COMPAT=2 dh_movefiles -p$(p_cpp) $(files_cpp)
+
+ ln -sf cpp$(pkg_ver) \
+ $(d_cpp)/$(PF)/bin/$(DEB_TARGET_GNU_TYPE)-cpp$(pkg_ver)
+ ln -sf cpp$(pkg_ver) \
+ $(d_cpp)/$(PF)/bin/$(TARGET_ALIAS)-cpp$(pkg_ver)
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ ln -sf cpp$(pkg_ver).1 \
+ $(d_cpp)/$(PF)/share/man/man1/$(DEB_TARGET_GNU_TYPE)-cpp$(pkg_ver).1
+ ln -sf cpp$(pkg_ver).1 \
+ $(d_cpp)/$(PF)/share/man/man1/$(TARGET_ALIAS)-cpp$(pkg_ver).1
+endif
+
+ debian/dh_doclink -p$(p_cpp) $(p_base)
+ debian/dh_rmemptydirs -p$(p_cpp)
+
+ dh_strip -p$(p_cpp)
+ dh_compress -p$(p_cpp)
+ dh_fixperms -p$(p_cpp)
+ dh_shlibdeps -p$(p_cpp)
+ dh_gencontrol -p$(p_cpp) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_cpp)
+ dh_md5sums -p$(p_cpp)
+ dh_builddeb -p$(p_cpp)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-cpp-doc: $(build_html_stamp) $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_cppd)
+ dh_installdirs -p$(p_cppd) \
+ $(docdir)/$(p_base) \
+ $(PF)/share/info
+ DH_COMPAT=2 dh_movefiles -p$(p_cppd) \
+ $(PF)/share/info/cpp*
+
+ debian/dh_doclink -p$(p_cppd) $(p_base)
+ dh_installdocs -p$(p_cppd) html/cpp.html html/cppinternals.html
+ rm -f $(d_cppd)/$(docdir)/$(p_base)/copyright
+ debian/dh_rmemptydirs -p$(p_cppd)
+
+ dh_compress -p$(p_cppd)
+ dh_fixperms -p$(p_cppd)
+ dh_installdeb -p$(p_cppd)
+ dh_gencontrol -p$(p_cppd) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_md5sums -p$(p_cppd)
+ dh_builddeb -p$(p_cppd)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
--- gcc-4.1-4.1.1.orig/debian/rules.d/binary-nof.mk
+++ gcc-4.1-4.1.1/debian/rules.d/binary-nof.mk
@@ -0,0 +1,56 @@
+arch_binaries := $(arch_binaries) nof
+
+p_nof = gcc$(pkg_ver)-nof
+d_nof = debian/$(p_nof)
+
+dirs_nof = \
+ $(docdir) \
+ $(PF)/$(libdir)/nof
+ifeq ($(with_cdev),yes)
+ dirs_nof += \
+ $(gcc_lib_dir)/nof
+endif
+
+ifeq ($(with_cdev),yes)
+ files_nof = \
+ $(libdir)/libgcc_s_nof.so.$(GCC_SONAME) \
+ $(gcc_lib_dir)/libgcc_s_nof.so \
+ $(PF)/$(libdir)/nof \
+ $(gcc_lib_dir)/nof
+else
+ files_nof = \
+ $(libdir)/libgcc_s_nof.so.$(GCC_SONAME)
+endif
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-nof: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ mv $(d)/$(PF)/$(libdir)/libgcc_s_nof.so.$(GCC_SONAME) $(d)/$(libdir)/.
+ rm -f $(d)/$(PF)/$(libdir)/libgcc_s_nof.so
+ ln -sf /$(libdir)/libgcc_s_nof.so.$(GCC_SONAME) \
+ $(d)/$(gcc_lib_dir)/libgcc_s_nof.so
+
+ rm -rf $(d_nof)
+ dh_installdirs -p$(p_nof) $(dirs_nof)
+ DH_COMPAT=2 dh_movefiles -p$(p_nof) $(files_nof)
+ debian/dh_doclink -p$(p_nof) $(p_base)
+ dh_strip -p$(p_nof)
+ dh_compress -p$(p_nof)
+ dh_fixperms -p$(p_nof)
+ dh_shlibdeps -p$(p_nof)
+
+ dh_makeshlibs -p$(p_nof)
+ : # Only keep the shlibs file for the libgcc_s_nof library
+ fgrep libgcc_s_nof debian/$(p_nof)/DEBIAN/shlibs \
+ > debian/$(p_nof)/DEBIAN/shlibs.tmp
+ mv -f debian/$(p_nof)/DEBIAN/shlibs.tmp debian/$(p_nof)/DEBIAN/shlibs
+
+ dh_gencontrol -p$(p_nof) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_nof)
+ dh_md5sums -p$(p_nof)
+ dh_builddeb -p$(p_nof)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
--- gcc-4.1-4.1.1.orig/debian/rules.d/binary-objcxx.mk
+++ gcc-4.1-4.1.1/debian/rules.d/binary-objcxx.mk
@@ -0,0 +1,38 @@
+arch_binaries := $(arch_binaries) objcxx
+
+p_objcx = gobjc++$(pkg_ver)
+d_objcx = debian/$(p_objcx)
+
+dirs_objcx = \
+ $(docdir)/$(p_base)/Obj-C++ \
+ $(gcc_lexec_dir)
+
+files_objcx = \
+ $(gcc_lexec_dir)/cc1objplus
+
+$(binary_stamp)-objcxx: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_objcx)
+ dh_installdirs -p$(p_objcx) $(dirs_objcx)
+ DH_COMPAT=2 dh_movefiles -p$(p_objcx) $(files_objcx)
+
+ debian/dh_doclink -p$(p_objcx) $(p_base)
+ cp -p $(srcdir)/gcc/objcp/ChangeLog \
+ $(d_objcx)/$(docdir)/$(p_base)/Obj-C++/changelog
+
+ debian/dh_rmemptydirs -p$(p_objcx)
+
+ dh_strip -p$(p_objcx)
+ dh_compress -p$(p_objcx)
+
+ dh_fixperms -p$(p_objcx)
+ dh_shlibdeps -p$(p_objcx)
+ dh_gencontrol -p$(p_objcx) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_objcx)
+ dh_md5sums -p$(p_objcx)
+ dh_builddeb -p$(p_objcx)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
--- gcc-4.1-4.1.1.orig/debian/rules.d/binary-libobjc.mk
+++ gcc-4.1-4.1.1/debian/rules.d/binary-libobjc.mk
@@ -0,0 +1,122 @@
+ifeq ($(with_objcdev),yes)
+ arch_binaries := $(arch_binaries) libobjc
+endif
+ifeq ($(with_lib64objc),yes)
+ arch_binaries := $(arch_binaries) lib64objc
+endif
+ifeq ($(with_lib32objc),yes)
+ arch_binaries := $(arch_binaries) lib32objc
+endif
+
+p_lobjc = libobjc$(OBJC_SONAME)
+p_l32objc = lib32objc$(OBJC_SONAME)
+p_l64objc = lib64objc$(OBJC_SONAME)
+
+d_lobjc = debian/$(p_lobjc)
+d_l32objc = debian/$(p_l32objc)
+d_l64objc = debian/$(p_l64objc)
+
+dirs_lobjc = \
+ $(docdir)/objc \
+ $(PF)/$(libdir)
+files_lobjc = \
+ $(PF)/$(libdir)/libobjc.so.*
+ifeq ($(with_objc_gc),yes)
+ files_lobjc += \
+ $(PF)/$(libdir)/libobjc_gc.so.*
+endif
+
+
+$(binary_stamp)-libobjc: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_lobjc)
+ dh_installdirs -p$(p_lobjc) $(dirs_lobjc)
+# mv $(d)/$(gcc_lib_dir)/libobjc.so.* $(d)/$(PF)/$(libdir)/.
+#ifeq ($(with_objc_gc),yes)
+# mv $(d)/$(gcc_lib_dir)/libobjc_gc.so.* $(d)/$(PF)/$(libdir)/.
+#endif
+ DH_COMPAT=2 dh_movefiles -p$(p_lobjc) $(files_lobjc)
+
+ dh_installdocs -p$(p_lobjc)
+ echo "See /$(docdir)/$(p_base) for more information" \
+ > $(d_lobjc)/$(docdir)/$(p_lobjc)/README.Debian
+ dh_installchangelogs -p$(p_lobjc) $(srcdir)/libobjc/ChangeLog
+
+ debian/dh_rmemptydirs -p$(p_lobjc)
+
+ dh_strip -p$(p_lobjc)
+ dh_compress -p$(p_lobjc)
+
+ dh_fixperms -p$(p_lobjc)
+ b=libobjc; \
+ for ext in preinst postinst prerm postrm; do \
+ for t in '' -dev -dbg; do \
+ v=$(OBJC_SONAME); \
+ if [ -f debian/$$b$$t.$$ext ]; then \
+ cp -pf debian/$$b$$t.$$ext debian/$$b$$v$$t.$$ext; \
+ fi; \
+ done; \
+ done
+ dh_makeshlibs -p$(p_lobjc) -V '$(p_lobjc) (>= $(DEB_SOEVERSION))'
+ dh_shlibdeps -p$(p_lobjc)
+ dh_gencontrol -p$(p_lobjc) -- -v$(DEB_EVERSION) $(common_substvars)
+ dh_installdeb -p$(p_lobjc)
+ dh_md5sums -p$(p_lobjc)
+ dh_builddeb -p$(p_lobjc)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-lib64objc: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_l64objc)
+ dh_installdirs -p$(p_l64objc) \
+ $(PF)/lib64
+ DH_COMPAT=2 dh_movefiles -p$(p_l64objc) \
+ $(PF)/lib64/libobjc.so.*
+
+ debian/dh_doclink -p$(p_l64objc) $(p_base)
+
+ dh_strip -p$(p_l64objc)
+ dh_compress -p$(p_l64objc)
+ dh_fixperms -p$(p_l64objc)
+ dh_makeshlibs -p$(p_l64objc) -V '$(p_l64objc) (>= $(DEB_SOVERSION))'
+# dh_shlibdeps -p$(p_l64objc)
+ dh_gencontrol -p$(p_l64objc) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_l64objc)
+ dh_md5sums -p$(p_l64objc)
+ dh_builddeb -p$(p_l64objc)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-lib32objc: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_l32objc)
+ dh_installdirs -p$(p_l32objc) \
+ $(lib32)
+ DH_COMPAT=2 dh_movefiles -p$(p_l32objc) \
+ $(lib32)/libobjc.so.*
+
+ debian/dh_doclink -p$(p_l32objc) $(p_base)
+
+ dh_strip -p$(p_l32objc)
+ dh_compress -p$(p_l32objc)
+ dh_fixperms -p$(p_l32objc)
+ dh_makeshlibs -p$(p_l32objc) -V '$(p_l32objc) (>= $(DEB_SOVERSION))'
+# dh_shlibdeps -p$(p_l32objc)
+ dh_gencontrol -p$(p_l32objc) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_l32objc)
+ dh_md5sums -p$(p_l32objc)
+ dh_builddeb -p$(p_l32objc)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
--- gcc-4.1-4.1.1.orig/debian/rules.d/binary-fastjar.mk
+++ gcc-4.1-4.1.1/debian/rules.d/binary-fastjar.mk
@@ -0,0 +1,55 @@
+arch_binaries := $(arch_binaries) fastjar
+
+p_fjar = fastjar
+d_fjar = debian/$(p_fjar)
+
+dirs_fjar = \
+ $(docdir)/$(p_fjar) \
+ $(PF)/bin \
+ $(PF)/share/man/man1 \
+ $(PF)/share/info
+
+files_fjar = \
+ $(PF)/bin/{fastjar,grepjar}* \
+ $(PF)/share/man/man1/{fastjar,grepjar}*.1 \
+ $(PF)/share/info/fastjar.info
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-fastjar: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_fjar)
+ dh_installdirs -p$(p_fjar) $(dirs_fjar)
+
+#ifeq ($(versioned_packages),yes)
+# : # rename versioned files back to unversioned ones.
+# for i in fastjar grepjar; do \
+# mv $(d)/$(PF)/bin/$$i$(pkg_ver) $(d)/$(PF)/bin/$$i; \
+# mv $(d)/$(PF)/share/man/man1/$$i$(pkg_ver).1 \
+# $(d)/$(PF)/share/man/man1/$$i.1; \
+# done
+#endif
+ for i in fastjar grepjar; do \
+ ln -s $$i$(pkg_ver) $(d)/$(PF)/bin/$$i; \
+ ln -s $$i$(pkg_ver).1 $(d)/$(PF)/share/man/man1/$$i.1; \
+ done
+
+ DH_COMPAT=2 dh_movefiles -p$(p_fjar) $(files_fjar)
+
+ dh_installdocs -p$(p_fjar) $(srcdir)/fastjar/{CHANGES,NEWS,README}
+ dh_installchangelogs -p$(p_fjar) $(srcdir)/fastjar/ChangeLog
+
+ debian/dh_rmemptydirs -p$(p_fjar)
+
+ dh_strip -p$(p_fjar)
+ dh_compress -p$(p_fjar)
+ dh_fixperms -p$(p_fjar)
+ dh_shlibdeps -p$(p_fjar)
+ dh_gencontrol -p$(p_fjar) -- -v$(DEB_EVERSION) $(common_substvars)
+ dh_installdeb -p$(p_fjar)
+ dh_md5sums -p$(p_fjar)
+ dh_builddeb -p$(p_fjar)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
--- gcc-4.1-4.1.1.orig/debian/rules.d/binary-libgcc-cross.mk
+++ gcc-4.1-4.1.1/debian/rules.d/binary-libgcc-cross.mk
@@ -0,0 +1,158 @@
+ifeq ($(with_libgcc),yes)
+ arch_binaries := $(arch_binaries) libgcc
+endif
+ifeq ($(with_lib64gcc),yes)
+ arch_binaries := $(arch_binaries) lib64gcc
+endif
+ifeq ($(biarch32),yes)
+ arch_binaries := $(arch_binaries) lib32gcc
+endif
+
+p_lgcc = libgcc$(GCC_SONAME)$(cross_lib_arch)
+d_lgcc = debian/$(p_lgcc)
+
+p_l64gcc = lib32gcc$(GCC_SONAME)$(cross_lib_arch)
+d_l64gcc = debian/$(p_l32gcc)
+
+p_l64gcc = lib64gcc$(GCC_SONAME)$(cross_lib_arch)
+d_l64gcc = debian/$(p_l64gcc)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-libgcc: $(install_dependencies)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_lgcc)
+ dh_installdirs -p$(p_lgcc) \
+ $(docdir)/$(p_lgcc) \
+ $(PF)/$(DEB_TARGET_GNU_TYPE)/lib
+
+ifeq ($(with_shared_libgcc),yes)
+ mv $(d)/$(PF)/$(DEB_TARGET_GNU_TYPE)/lib/libgcc_s.so.$(GCC_SONAME) $(d_lgcc)/$(PF)/$(DEB_TARGET_GNU_TYPE)/lib/.
+endif
+
+ dh_installdocs -p$(p_lgcc)
+ dh_installchangelogs -p$(p_lgcc)
+
+ debian/dh_rmemptydirs -p$(p_lgcc)
+ PATH=/usr/share/dpkg-cross:$$PATH dh_strip -p$(p_lgcc)
+ dh_compress -p$(p_lgcc)
+ dh_fixperms -p$(p_lgcc)
+ifeq ($(with_shared_libgcc),yes)
+ dh_makeshlibs -p$(p_lgcc) -V '$(p_lgcc) (>= $(DEB_LIBGCC_SOVERSION))' -n
+ sed s/$(cross_lib_arch)//g < debian/$(p_lgcc)/DEBIAN/shlibs > debian/$(p_lgcc)/DEBIAN/shlibs.fixed
+ mv debian/$(p_lgcc)/DEBIAN/shlibs.fixed debian/$(p_lgcc)/DEBIAN/shlibs
+ cat debian/$(p_lgcc)/DEBIAN/shlibs >> debian/shlibs.local
+endif
+ ARCH=$(DEB_TARGET_ARCH) MAKEFLAGS="CC=something" dh_shlibdeps -p$(p_lgcc)
+ sed 's/\(lib[^ ]*\) /\1$(cross_lib_arch) /g' < debian/$(p_lgcc).substvars > debian/$(p_lgcc).substvars.new
+ mv debian/$(p_lgcc).substvars.new debian/$(p_lgcc).substvars
+ dh_gencontrol -p$(p_lgcc) \
+ -- -v$(DEB_LIBGCC_VERSION) $(common_substvars)
+ b=libgcc; v=$(GCC_SONAME); \
+ for ext in preinst postinst prerm postrm; do \
+ if [ -f debian/$$b$$t.$$ext ]; then \
+ cp -pf debian/$$b$$t.$$ext debian/$$b$$v$$t.$$ext; \
+ fi; \
+ done
+ dh_installdeb -p$(p_lgcc)
+ dh_md5sums -p$(p_lgcc)
+ dh_builddeb -p$(p_lgcc)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-lib64gcc: $(install_dependencies)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_l64gcc)
+ dh_installdirs -p$(p_l64gcc) \
+ $(docdir)/$(p_l64gcc) \
+ $(PF)/$(DEB_TARGET_GNU_TYPE)/lib64
+
+ifeq ($(with_shared_libgcc),yes)
+ mv $(d)/$(PF)/$(DEB_TARGET_GNU_TYPE)/lib64/libgcc_s.so.$(GCC_SONAME) $(d_l64gcc)/$(PF)/$(DEB_TARGET_GNU_TYPE)/lib64/.
+endif
+
+ dh_installdocs -p$(p_l64gcc)
+ dh_installchangelogs -p$(p_l64gcc)
+
+ debian/dh_rmemptydirs -p$(p_l64gcc)
+ PATH=/usr/share/dpkg-cross:$$PATH dh_strip -p$(p_l64gcc)
+ dh_compress -p$(p_l64gcc)
+ dh_fixperms -p$(p_l64gcc)
+ifeq ($(with_shared_libgcc),yes)
+ dh_makeshlibs -p$(p_l64gcc) \
+ -V '$(p_l64gcc) (>= $(DEB_LIBGCC_SOVERSION))' -n
+ sed s/$(cross_lib_arch)//g < debian/$(p_l64gcc)/DEBIAN/shlibs > debian/$(p_l64gcc)/DEBIAN/shlibs.fixed
+ mv debian/$(p_l64gcc)/DEBIAN/shlibs.fixed debian/$(p_l64gcc)/DEBIAN/shlibs
+ cat debian/$(p_l64gcc)/DEBIAN/shlibs >> debian/shlibs.local
+endif
+ ARCH=$(DEB_TARGET_ARCH) MAKEFLAGS="CC=something" dh_shlibdeps -p$(p_l64gcc)
+ sed 's/\(lib[^ ]*\) /\1$(cross_lib_arch) /g' < debian/$(p_l64gcc).substvars > debian/$(p_l64gcc).substvars.new
+ mv debian/$(p_l64gcc).substvars.new debian/$(p_l64gcc).substvars
+ dh_gencontrol -p$(p_l64gcc) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+ b=libgcc; v=$(GCC_SONAME); \
+ for ext in preinst postinst prerm postrm; do \
+ if [ -f debian/$$b$$t.$$ext ]; then \
+ cp -pf debian/$$b$$t.$$ext debian/$$b$$v$$t.$$ext; \
+ fi; \
+ done
+ dh_installdeb -p$(p_l64gcc)
+ dh_md5sums -p$(p_l64gcc)
+ dh_builddeb -p$(p_l64gcc)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+
+$(binary_stamp)-lib32gcc: $(install_dependencies)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_l32gcc)
+ dh_installdirs -p$(p_l32gcc) \
+ $(docdir)/$(p_l32gcc) \
+ $(PF)/$(DEB_TARGET_GNU_TYPE)/lib32
+
+ifeq ($(with_shared_libgcc),yes)
+ mv $(d)/$(PF)/$(DEB_TARGET_GNU_TYPE)/lib32/libgcc_s.so.$(GCC_SONAME) $(d_l32gcc)/$(PF)/$(DEB_TARGET_GNU_TYPE)/lib32/.
+endif
+
+ dh_installdocs -p$(p_l32gcc)
+ dh_installchangelogs -p$(p_l32gcc)
+
+ debian/dh_rmemptydirs -p$(p_l32gcc)
+ PATH=/usr/share/dpkg-cross:$$PATH dh_strip -p$(p_l32gcc)
+ dh_compress -p$(p_l32gcc)
+ dh_fixperms -p$(p_l32gcc)
+ifeq ($(with_shared_libgcc),yes)
+ dh_makeshlibs -p$(p_l32gcc) \
+ -V '$(p_l32gcc) (>= $(DEB_LIBGCC_SOVERSION))' -n
+ sed s/$(cross_lib_arch)//g < debian/$(p_l32gcc)/DEBIAN/shlibs > debian/$(p_l32gcc)/DEBIAN/shlibs.fixed
+ mv debian/$(p_l32gcc)/DEBIAN/shlibs.fixed debian/$(p_l32gcc)/DEBIAN/shlibs
+ cat debian/$(p_l32gcc)/DEBIAN/shlibs >> debian/shlibs.local
+endif
+ ARCH=$(DEB_TARGET_ARCH) MAKEFLAGS="CC=something" dh_shlibdeps -p$(p_l32gcc)
+ sed 's/\(lib[^ ]*\) /\1$(cross_lib_arch) /g' < debian/$(p_l32gcc).substvars > debian/$(p_l32gcc).substvars.new
+ mv debian/$(p_l32gcc).substvars.new debian/$(p_l32gcc).substvars
+ dh_gencontrol -p$(p_l32gcc) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+ b=libgcc; v=$(GCC_SONAME); \
+ for ext in preinst postinst prerm postrm; do \
+ if [ -f debian/$$b$$t.$$ext ]; then \
+ cp -pf debian/$$b$$t.$$ext debian/$$b$$v$$t.$$ext; \
+ fi; \
+ done
+ dh_installdeb -p$(p_l32gcc)
+ dh_md5sums -p$(p_l32gcc)
+ dh_builddeb -p$(p_l32gcc)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
--- gcc-4.1-4.1.1.orig/debian/rules.d/binary-libmudflap.mk
+++ gcc-4.1-4.1.1/debian/rules.d/binary-libmudflap.mk
@@ -0,0 +1,125 @@
+arch_binaries := $(arch_binaries) libmudflap
+ifeq ($(with_lib64mudflap),yes)
+ arch_binaries := $(arch_binaries) lib64mudflap
+endif
+ifeq ($(with_lib32mudflap),yes)
+ arch_binaries := $(arch_binaries) lib32mudflap
+endif
+
+p_mf = libmudflap$(MUDFLAP_SONAME)
+p_l32mf = lib32mudflap$(MUDFLAP_SONAME)
+p_l64mf = lib64mudflap$(MUDFLAP_SONAME)
+p_mfd = libmudflap$(MUDFLAP_SONAME)-dev
+
+d_mf = debian/$(p_mf)
+d_l32mf = debian/$(p_l32mf)
+d_l64mf = debian/$(p_l64mf)
+d_mfd = debian/$(p_mfd)
+
+dirs_mf = \
+ $(docdir)/$(p_mf) \
+ $(PF)/$(libdir)
+files_mf = \
+ $(PF)/$(libdir)/libmudflap*.so.*
+
+dirs_mfd = \
+ $(docdir) \
+ $(PF)/include \
+ $(PF)/$(libdir)
+files_mfd = \
+ $(PF)/include/mf-runtime.h \
+ $(PF)/$(libdir)/libmudflap*.{a,so,la}
+
+ifeq ($(with_lib32mudflap),yes)
+ dirs_mfd += $(lib32)
+ files_mfd += $(lib32)/libmudflap*.{a,so,la}
+endif
+ifeq ($(with_lib64mudflap),yes)
+ dirs_mfd += $(PF)/lib64
+ files_mfd += $(PF)/lib64/libmudflap*.{a,so,la}
+endif
+
+$(binary_stamp)-libmudflap: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_mf) $(d_mfd)
+ dh_installdirs -p$(p_mf) $(dirs_mf)
+ dh_installdirs -p$(p_mfd) $(dirs_mfd)
+
+ DH_COMPAT=2 dh_movefiles -p$(p_mf) $(files_mf)
+ DH_COMPAT=2 dh_movefiles -p$(p_mfd) $(files_mfd)
+
+ dh_installdocs -p$(p_mf)
+ dh_installchangelogs -p$(p_mf) $(srcdir)/libmudflap/ChangeLog
+ cp -p debian/libmudflap.copyright $(d_mf)/$(docdir)/$(p_mf)/copyright
+ debian/dh_doclink -p$(p_mfd) $(p_mf)
+
+ debian/dh_rmemptydirs -p$(p_mf)
+ debian/dh_rmemptydirs -p$(p_mfd)
+
+ dh_strip -p$(p_mf) -p$(p_mfd)
+ dh_compress -p$(p_mf) -p$(p_mfd)
+ dh_fixperms -p$(p_mf) -p$(p_mfd)
+ dh_makeshlibs -p$(p_mf) -V '$(p_mf) (>= $(DEB_SOVERSION))'
+ dh_shlibdeps -p$(p_mf) -p$(p_mfd)
+ dh_gencontrol -p$(p_mf) -p$(p_mfd) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_mf) -p$(p_mfd)
+ dh_md5sums -p$(p_mf) -p$(p_mfd)
+ dh_builddeb -p$(p_mf) -p$(p_mfd)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-lib64mudflap: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_l64mf)
+ dh_installdirs -p$(p_l64mf) \
+ $(PF)/lib64
+ DH_COMPAT=2 dh_movefiles -p$(p_l64mf) \
+ $(PF)/lib64/libmudflap*.so.*
+
+ debian/dh_doclink -p$(p_l64mf) $(p_base)
+
+ dh_strip -p$(p_l64mf)
+ dh_compress -p$(p_l64mf)
+ dh_fixperms -p$(p_l64mf)
+ dh_makeshlibs -p$(p_l64mf) -V '$(p_l64mf) (>= $(DEB_SOVERSION))'
+# dh_shlibdeps -p$(p_l64mf)
+ dh_gencontrol -p$(p_l64mf) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_l64mf)
+ dh_md5sums -p$(p_l64mf)
+ dh_builddeb -p$(p_l64mf)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-lib32mudflap: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_l32mf)
+ dh_installdirs -p$(p_l32mf) \
+ $(lib32)
+ DH_COMPAT=2 dh_movefiles -p$(p_l32mf) \
+ $(lib32)/libmudflap*.so.*
+
+ debian/dh_doclink -p$(p_l32mf) $(p_base)
+
+ dh_strip -p$(p_l32mf)
+ dh_compress -p$(p_l32mf)
+ dh_fixperms -p$(p_l32mf)
+ dh_makeshlibs -p$(p_l32mf) -V '$(p_l32mf) (>= $(DEB_SOVERSION))'
+# dh_shlibdeps -p$(p_l32mf)
+ dh_gencontrol -p$(p_l32mf) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_l32mf)
+ dh_md5sums -p$(p_l32mf)
+ dh_builddeb -p$(p_l32mf)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
--- gcc-4.1-4.1.1.orig/debian/rules.d/binary-base.mk
+++ gcc-4.1-4.1.1/debian/rules.d/binary-base.mk
@@ -0,0 +1,27 @@
+arch_binaries := base $(arch_binaries)
+
+# ---------------------------------------------------------------------------
+# gcc-base
+
+$(binary_stamp)-base: $(install_dependencies)
+ dh_testdir
+ dh_testroot
+ rm -rf $(d_base)
+ dh_installdirs -p$(p_base)
+ dh_installdocs -p$(p_base)
+ifeq ($(with_base_only),yes)
+ dh_installchangelogs -p$(p_base)
+else
+ dh_installchangelogs -p$(p_base) $(srcdir)/ChangeLog
+endif
+ dh_compress -p$(p_base)
+ for i in copyright changelog.Debian.gz; do \
+ ln -f $(d_base)/usr/share/doc/$(p_base)/$$i \
+ $(d_base)/usr/share/doc/$(p_base)/.$$i; \
+ done
+ dh_fixperms -p$(p_base)
+ dh_gencontrol -p$(p_base) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_base)
+ dh_md5sums -p$(p_base)
+ dh_builddeb -p$(p_base)
+ touch $@
--- gcc-4.1-4.1.1.orig/debian/rules.d/binary-libgcc.mk
+++ gcc-4.1-4.1.1/debian/rules.d/binary-libgcc.mk
@@ -0,0 +1,157 @@
+ifeq ($(with_libgcc),yes)
+ arch_binaries := $(arch_binaries) libgcc
+endif
+ifeq ($(with_lib64gcc),yes)
+ arch_binaries := $(arch_binaries) lib64gcc
+endif
+ifeq ($(biarch32),yes)
+ arch_binaries := $(arch_binaries) lib32gcc
+endif
+
+p_lgcc = libgcc$(GCC_SONAME)
+d_lgcc = debian/$(p_lgcc)
+
+p_l32gcc = lib32gcc$(GCC_SONAME)
+d_l32gcc = debian/$(p_l32gcc)
+
+p_l64gcc = lib64gcc$(GCC_SONAME)
+d_l64gcc = debian/$(p_l64gcc)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-libgcc: $(install_dependencies)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_lgcc)
+ dh_installdirs -p$(p_lgcc) \
+ $(docdir)/$(p_lgcc) \
+ $(libdir)
+
+ifeq ($(with_shared_libgcc),yes)
+ mv $(d)/$(PF)/lib/libgcc_s.so.$(GCC_SONAME) $(d_lgcc)/$(libdir)/.
+endif
+
+ifeq ($(with_standalone_gcj)-$(DEB_TARGET_ARCH),yes-hppa)
+ debian/dh_doclink -p$(p_lgcc) $(p_jbase)
+else
+ debian/dh_doclink -p$(p_lgcc) $(p_base)
+endif
+ debian/dh_rmemptydirs -p$(p_lgcc)
+ dh_strip -p$(p_lgcc)
+ dh_compress -p$(p_lgcc)
+ dh_fixperms -p$(p_lgcc)
+ifeq ($(with_shared_libgcc),yes)
+ dh_makeshlibs -p$(p_lgcc) -V '$(p_lgcc) (>= $(DEB_LIBGCC_SOVERSION))'
+ cat debian/$(p_lgcc)/DEBIAN/shlibs >> debian/shlibs.local
+endif
+ dh_shlibdeps -p$(p_lgcc)
+ dh_gencontrol -p$(p_lgcc) \
+ -- -v$(DEB_LIBGCC_VERSION) $(common_substvars)
+
+ mkdir -p $(d_lgcc)/usr/share/lintian/overrides
+ echo '$(p_lgcc): package-name-doesnt-match-sonames' \
+ > $(d_lgcc)/usr/share/lintian/overrides/$(p_lgcc)
+
+ dh_installdeb -p$(p_lgcc)
+ dh_md5sums -p$(p_lgcc)
+ dh_builddeb -p$(p_lgcc)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-lib64gcc: $(install_dependencies)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_l64gcc)
+ dh_installdirs -p$(p_l64gcc) \
+ $(docdir)/$(p_l64gcc) \
+ lib64
+
+ifeq ($(with_shared_libgcc),yes)
+ mv $(d)/$(PF)/lib64/libgcc_s.so.$(GCC_SONAME) $(d_l64gcc)/lib64/.
+endif
+
+ debian/dh_doclink -p$(p_l64gcc) $(p_base)
+ debian/dh_rmemptydirs -p$(p_l64gcc)
+ dh_strip -p$(p_l64gcc)
+ dh_compress -p$(p_l64gcc)
+ dh_fixperms -p$(p_l64gcc)
+ifeq ($(with_shared_libgcc),yes)
+ dh_makeshlibs -p$(p_l64gcc) \
+ -V '$(p_l64gcc) (>= $(DEB_LIBGCC_SOVERSION))'
+# this does not work ... shlibs.local doesn't distinguish 32/64 bit libs
+# cat debian/$(p_l64gcc)/DEBIAN/shlibs >> debian/shlibs.local
+endif
+# dh_shlibdeps -p$(p_l64gcc)
+#/usr/bin/ldd: line 1: /lib/ld64.so.1: cannot execute binary file
+#dpkg-shlibdeps: failure: ldd on `debian/lib64gcc1/lib64/libgcc_s.so.1' gave error exit status 1
+ifeq ($(DEB_TARGET_ARCH),s390)
+ echo 'shlibs:Depends=libc6-s390x (>= 2.3.1-1)' \
+ > debian/$(p_l64gcc).substvars
+endif
+ifeq ($(DEB_TARGET_ARCH),i386)
+ echo 'shlibs:Depends=libc6-amd64' \
+ > debian/$(p_l64gcc).substvars
+endif
+ifeq ($(DEB_TARGET_ARCH),sparc)
+ echo 'shlibs:Depends=libc6-sparc64 (>= 2.3.1-1)' \
+ > debian/$(p_l64gcc).substvars
+endif
+ifeq ($(DEB_TARGET_ARCH),powerpc)
+ # FIXME change dependency when lib64c6 exists
+ echo 'shlibs:Depends=libc6 (>= 0.1)' \
+ > debian/$(p_l64gcc).substvars
+endif
+ dh_gencontrol -p$(p_l64gcc) \
+ -- -v$(DEB_LIBGCC_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_l64gcc)
+ dh_md5sums -p$(p_l64gcc)
+ dh_builddeb -p$(p_l64gcc)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+
+$(binary_stamp)-lib32gcc: $(install_dependencies)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_l32gcc)
+
+ dh_installdirs -p$(p_l32gcc) \
+ $(docdir)/$(p_l32gcc) \
+ $(lib32)
+ mv $(d)/$(lib32)/libgcc_s.so.$(GCC_SONAME) \
+ $(d_l32gcc)/$(lib32)/.
+
+ debian/dh_doclink -p$(p_l32gcc) $(p_base)
+ debian/dh_rmemptydirs -p$(p_l32gcc)
+ dh_strip -p$(p_l32gcc)
+
+ dh_makeshlibs -p$(p_l32gcc) \
+ -V '$(p_l32gcc) (>= $(DEB_LIBGCC_SOVERSION))'
+ifeq ($(DEB_TARGET_ARCH),amd64)
+ echo 'shlibs:Depends=libc6-i386 | ia32-libs' \
+ > debian/$(p_l32gcc).substvars
+endif
+ifeq ($(DEB_TARGET_ARCH),ppc64)
+ echo 'shlibs:Depends=libc6-powerpc' \
+ > debian/$(p_l32gcc).substvars
+endif
+
+ dh_compress -p$(p_l32gcc)
+ dh_fixperms -p$(p_l32gcc)
+ dh_gencontrol -p$(p_l32gcc) \
+ -- -v$(DEB_LIBGCC_VERSION) $(common_substvars)
+ifeq (,$(findstring emul, $(lib32)))
+ rm -f debian/lib32gcc1.preinst
+endif
+ dh_installdeb -p$(p_l32gcc)
+ dh_md5sums -p$(p_l32gcc)
+ dh_builddeb -p$(p_l32gcc)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
--- gcc-4.1-4.1.1.orig/debian/rules.d/binary-fortran.mk
+++ gcc-4.1-4.1.1/debian/rules.d/binary-fortran.mk
@@ -0,0 +1,241 @@
+ifeq ($(with_libfortran),yes)
+ arch_binaries := $(arch_binaries) libfortran
+endif
+ifeq ($(with_lib64fortran),yes)
+ arch_binaries := $(arch_binaries) lib64fortran
+endif
+ifeq ($(with_lib32fortran),yes)
+ arch_binaries := $(arch_binaries) lib32fortran
+endif
+
+ifeq ($(with_fdev),yes)
+ arch_binaries := $(arch_binaries) fdev libfortran-dev
+ ifneq ($(GFDL_INVARIANT_FREE),yes)
+ indep_binaries := $(indep_binaries) fortran-doc
+ endif
+endif
+
+p_g95 = gfortran$(pkg_ver)
+p_g95d = gfortran$(pkg_ver)-doc
+p_flib = libgfortran$(FORTRAN_SONAME)
+p_f32lib= lib32gfortran$(FORTRAN_SONAME)
+p_f64lib= lib64gfortran$(FORTRAN_SONAME)
+p_flibd = libgfortran$(FORTRAN_SONAME)-dev
+
+d_g95 = debian/$(p_g95)
+d_g95d = debian/$(p_g95d)
+d_flib = debian/$(p_flib)
+d_f32lib= debian/$(p_f32lib)
+d_f64lib= debian/$(p_f64lib)
+d_flibd = debian/$(p_flibd)
+
+dirs_g95 = \
+ $(docdir)/$(p_base)/fortran \
+ $(PF)/bin \
+ $(gcc_lexec_dir) \
+ $(gcc_lib_dir)/include \
+ $(PF)/include \
+ $(PF)/share/man/man1
+files_g95 = \
+ $(PF)/bin/gfortran$(pkg_ver) \
+ $(gcc_lexec_dir)/f951
+
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ files_g95 += \
+ $(PF)/share/man/man1/gfortran$(pkg_ver).1
+endif
+
+dirs_flib = \
+ $(docdir)/$(p_base)/fortran \
+ $(PF)/$(libdir) \
+
+files_flib = \
+ $(PF)/$(libdir)/libgfortran.so.*
+
+dirs_flibd = \
+ $(docdir)/$(p_base)/fortran \
+ $(PF)/$(libdir) \
+
+files_flibd = \
+ $(PF)/lib/libgfortran.{a,la,so} \
+ $(PF)/lib/libgfortranbegin.{a,la}
+
+ifeq ($(with_lib64fortran),yes)
+ dirs_flibd += $(PF)/lib64
+ files_flibd += \
+ $(PF)/lib64/libgfortran.{a,la,so} \
+ $(PF)/lib64/libgfortranbegin.{a,la}
+endif
+ifeq ($(with_lib32fortran),yes)
+ dirs_flibd += $(lib32)
+ files_flibd += \
+ $(lib32)/libgfortran.{a,la,so} \
+ $(lib32)/libgfortranbegin.{a,la}
+endif
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-libfortran: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_flib)
+ dh_installdirs -p$(p_flib) $(dirs_flib)
+ DH_COMPAT=2 dh_movefiles -p$(p_flib) $(files_flib)
+ debian/dh_doclink -p$(p_flib) $(p_base)
+
+ dh_strip -p$(p_flib)
+ dh_compress -p$(p_flib)
+ dh_fixperms -p$(p_flib)
+ dh_makeshlibs -p$(p_flib) -V '$(p_flib) (>= $(DEB_SOVERSION))'
+ dh_shlibdeps -p$(p_flib)
+ dh_gencontrol -p$(p_flib) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_flib)
+ dh_md5sums -p$(p_flib)
+ dh_builddeb -p$(p_flib)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-libfortran-dev: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_flibd)
+ dh_installdirs -p$(p_flibd) $(dirs_flibd)
+ DH_COMPAT=2 dh_movefiles -p$(p_flibd) $(files_flibd)
+ debian/dh_doclink -p$(p_flibd) $(p_base)
+
+ debian/dh_rmemptydirs -p$(p_flibd)
+
+ dh_strip -p$(p_flibd)
+ dh_compress -p$(p_flibd)
+ dh_fixperms -p$(p_flibd)
+ dh_shlibdeps -p$(p_flibd)
+ dh_gencontrol -p$(p_flibd) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_flibd)
+ dh_md5sums -p$(p_flibd)
+ dh_builddeb -p$(p_flibd)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-lib64fortran: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_f64lib)
+ dh_installdirs -p$(p_f64lib) \
+ $(PF)/lib64
+ DH_COMPAT=2 dh_movefiles -p$(p_f64lib) \
+ $(PF)/lib64/libgfortran.so.*
+
+ debian/dh_doclink -p$(p_f64lib) $(p_base)
+
+ dh_strip -p$(p_f64lib)
+ dh_compress -p$(p_f64lib)
+ dh_fixperms -p$(p_f64lib)
+ dh_makeshlibs -p$(p_f64lib) -V '$(p_f64lib) (>= $(DEB_SOVERSION))'
+# dh_shlibdeps -p$(p_f64lib)
+ dh_gencontrol -p$(p_f64lib) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_f64lib)
+ dh_md5sums -p$(p_f64lib)
+ dh_builddeb -p$(p_f64lib)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-lib32fortran: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_f32lib)
+ dh_installdirs -p$(p_f32lib) \
+ $(lib32)
+ DH_COMPAT=2 dh_movefiles -p$(p_f32lib) \
+ $(lib32)/libgfortran.so.*
+
+ debian/dh_doclink -p$(p_f32lib) $(p_base)
+
+ dh_strip -p$(p_f32lib)
+ dh_compress -p$(p_f32lib)
+ dh_fixperms -p$(p_f32lib)
+ dh_makeshlibs -p$(p_f32lib) -V '$(p_f32lib) (>= $(DEB_SOVERSION))'
+# dh_shlibdeps -p$(p_f32lib)
+ dh_gencontrol -p$(p_f32lib) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_f32lib)
+ dh_md5sums -p$(p_f32lib)
+ dh_builddeb -p$(p_f32lib)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-fdev: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_g95)
+ dh_installdirs -p$(p_g95) $(dirs_g95)
+
+ DH_COMPAT=2 dh_movefiles -p$(p_g95) $(files_g95)
+
+ ln -sf gfortran$(pkg_ver) \
+ $(d_g95)/$(PF)/bin/$(DEB_TARGET_GNU_TYPE)-gfortran$(pkg_ver)
+ ln -sf gfortran$(pkg_ver) \
+ $(d_g95)/$(PF)/bin/$(TARGET_ALIAS)-gfortran$(pkg_ver)
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ ln -sf gfortran$(pkg_ver).1 \
+ $(d_g95)/$(PF)/share/man/man1/$(DEB_TARGET_GNU_TYPE)-gfortran$(pkg_ver).1
+ ln -sf gfortran$(pkg_ver).1 \
+ $(d_g95)/$(PF)/share/man/man1/$(TARGET_ALIAS)-gfortran$(pkg_ver).1
+endif
+
+ debian/dh_doclink -p$(p_g95) $(p_base)
+
+ cp -p $(srcdir)/gcc/fortran/ChangeLog \
+ $(d_g95)/$(docdir)/$(p_base)/fortran/changelog
+ debian/dh_rmemptydirs -p$(p_g95)
+
+ dh_strip -p$(p_g95)
+ dh_compress -p$(p_g95)
+ dh_fixperms -p$(p_g95)
+ dh_shlibdeps -p$(p_g95)
+ dh_gencontrol -p$(p_g95) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_g95)
+ dh_md5sums -p$(p_g95)
+ dh_builddeb -p$(p_g95)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-fortran-doc: $(build_html_stamp) $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_g95d)
+ dh_installdirs -p$(p_g95d) \
+ $(docdir)/$(p_base)/fortran \
+ $(PF)/share/info
+ DH_COMPAT=2 dh_movefiles -p$(p_g95d) \
+ $(PF)/share/info/gfortran*
+
+ debian/dh_doclink -p$(p_g95d) $(p_base)
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ dh_installdocs -p$(p_g95d)
+ rm -f $(d_g95d)/$(docdir)/$(p_base)/copyright
+ cp -p html/gfortran.html $(d_g95d)/$(docdir)/$(p_base)/fortran/
+endif
+
+ dh_compress -p$(p_g95d)
+ dh_fixperms -p$(p_g95d)
+ dh_installdeb -p$(p_g95d)
+ dh_gencontrol -p$(p_g95d) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_md5sums -p$(p_g95d)
+ dh_builddeb -p$(p_g95d)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
--- gcc-4.1-4.1.1.orig/debian/rules.d/binary-gcc-cross.mk
+++ gcc-4.1-4.1.1/debian/rules.d/binary-gcc-cross.mk
@@ -0,0 +1,109 @@
+arch_binaries := $(arch_binaries) gcc
+
+# gcc must be moved after g77 and g++
+# not all files $(PF)/include/*.h are part of gcc,
+# but it becomes difficult to name all these files ...
+
+dirs_gcc = \
+ $(PF)/bin \
+ $(gcc_lexec_dir) \
+ $(gcc_lib_dir)/include \
+ $(PF)/share/man/man1 $(libdir)
+
+files_gcc = \
+ $(PF)/bin/$(DEB_TARGET_GNU_TYPE)-gcc$(pkg_ver) \
+ $(PF)/share/man/man1/$(DEB_TARGET_GNU_TYPE)-gcc$(pkg_ver).1 \
+ $(gcc_lexec_dir)/collect2 \
+ $(gcc_lib_dir)/{libgcc*,*.o} \
+ $(gcc_lib_dir)/include/README \
+ $(gcc_lib_dir)/include/{float,iso646,limits,std*,syslimits,unwind,varargs}.h \
+ $(shell for d in asm bits gnu linux; do \
+ test -e $(d)/$(gcc_lib_dir)/include/$$d \
+ && echo $(gcc_lib_dir)/include/$$d; \
+ done) \
+ $(shell test -e $(d)/$(gcc_lib_dir)/SYSCALLS.c.X \
+ && echo $(gcc_lib_dir)/SYSCALLS.c.X) \
+ $(shell for h in {,e,p,x}mmintrin.h mm3dnow.h mm_malloc.h; do \
+ test -e $(d)/$(gcc_lib_dir)/include/$$h \
+ && echo $(gcc_lib_dir)/include/$$h; \
+ done) \
+
+
+ifeq ($(biarch),yes)
+ files_gcc += $(gcc_lib_dir)/$(biarchsubdir)/{libgcc*,*.o}
+endif
+ifeq ($(biarch32),yes)
+ files_gcc += $(gcc_lib_dir)/$(biarchsubdir)/{libgcc*,*.o}
+endif
+
+ifeq ($(DEB_TARGET_ARCH),ia64)
+ files_gcc += $(gcc_lib_dir)/include/ia64intrin.h
+endif
+
+ifeq ($(DEB_TARGET_ARCH),m68k)
+ files_gcc += $(gcc_lib_dir)/include/math-68881.h
+endif
+
+ifeq ($(DEB_TARGET_ARCH),$(findstring $(DEB_TARGET_ARCH),powerpc ppc64))
+ files_gcc += $(gcc_lib_dir)/include/{altivec.h,ppc-asm.h}
+endif
+
+usr_doc_files = debian/README.Bugs \
+ $(shell test -f $(srcdir)/FAQ && echo $(srcdir)/FAQ)
+ifeq ($(with_check),yes)
+ usr_doc_files += test-summary
+endif
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-gcc: $(install_dependencies)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_gcc)
+ dh_installdirs -p$(p_gcc) $(dirs_gcc)
+
+ rm -f $(d)/$(PF)/$(libdir)/libgcc_s.so
+ ln -sf /$(PF)/$(DEB_TARGET_GNU_TYPE)/$(libdir)/libgcc_s.so.$(GCC_SONAME) $(d)/$(gcc_lib_dir)/libgcc_s.so
+ifeq ($(biarch),yes)
+ rm -f $(d)/$(PF)/$(lib64)/libgcc_s.so
+ dh_link -p$(p_gcc) \
+ /$(PF)/$(DEB_TARGET_GNU_TYPE)/$(lib64)/libgcc_s.so.$(GCC_SONAME) /$(gcc_lib_dir)/libgcc_s_64.so \
+ /$(PF)/$(DEB_TARGET_GNU_TYPE)/$(lib64)/libgcc_s.so.$(GCC_SONAME) /$(gcc_lib_dir)/$(biarchsubdir)/libgcc_s.so
+endif
+ifeq ($(biarch32),yes)
+ mkdir -p $(d_gcc)/$(gcc_lib_dir)
+ mv $(d)/$(gcc_lib_dir)/$(biarchsubdir) $(d_gcc)/$(gcc_lib_dir)/
+ dh_link -p$(p_gcc) \
+ /$(PF)/$(DEB_TARGET_GNU_TYPE)/lib32/libgcc_s.so.$(GCC_SONAME) /$(gcc_lib_dir)/libgcc_s_32.so \
+ /$(PF)/$(DEB_TARGET_GNU_TYPE)/lib32/libgcc_s.so.$(GCC_SONAME) /$(gcc_lib_dir)/$(biarchsubdir)/libgcc_s_32.so \
+ /$(PF)/$(DEB_TARGET_GNU_TYPE)/lib32/libgcc_s.so.$(GCC_SONAME) /$(gcc_lib_dir)/$(biarchsubdir)/libgcc_s.so
+endif
+
+ DH_COMPAT=2 dh_movefiles -p$(p_gcc) $(files_gcc)
+
+# dh_installdebconf
+ debian/dh_doclink -p$(p_gcc) $(p_base)
+ debian/dh_rmemptydirs -p$(p_gcc)
+ PATH=/usr/share/dpkg-cross:$$PATH dh_strip -p$(p_gcc)
+ dh_compress -p$(p_gcc)
+ dh_fixperms -p$(p_gcc)
+ dh_shlibdeps -p$(p_gcc)
+ dh_gencontrol -p$(p_gcc) -- -v$(DEB_VERSION) $(common_substvars)
+ sed 's/cross-/$(TP)/g;s/-ver/$(pkg_ver)/g' < debian/gcc-cross.postinst > debian/$(p_gcc)/DEBIAN/postinst
+ sed 's/cross-/$(TP)/g;s/-ver/$(pkg_ver)/g' < debian/gcc-cross.prerm > debian/$(p_gcc)/DEBIAN/prerm
+ chmod 755 debian/$(p_gcc)/DEBIAN/{postinst,prerm}
+ dh_installdeb -p$(p_gcc)
+ dh_md5sums -p$(p_gcc)
+ dh_builddeb -p$(p_gcc)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+ : # remove empty directories, when all components are in place
+ for d in `find $(d) -depth -type d -empty 2> /dev/null`; do \
+ while rmdir $$d 2> /dev/null; do d=`dirname $$d`; done; \
+ done
+
+ @echo "Listing installed files not included in any package:"
+ -find $(d) ! -type d
+
--- gcc-4.1-4.1.1.orig/debian/rules.d/binary-libstdcxx.mk
+++ gcc-4.1-4.1.1/debian/rules.d/binary-libstdcxx.mk
@@ -0,0 +1,450 @@
+
+ifeq ($(with_libcxx),yes)
+ arch_binaries := $(arch_binaries) libstdcxx
+endif
+ifeq ($(with_lib64cxx),yes)
+ arch_binaries := $(arch_binaries) lib64stdcxx
+endif
+ifeq ($(with_lib64cxxdbg),yes)
+ arch_binaries := $(arch_binaries) lib64stdcxxdbg
+endif
+ifeq ($(with_lib32cxx),yes)
+ arch_binaries := $(arch_binaries) lib32stdcxx
+endif
+ifeq ($(with_lib32cxxdbg),yes)
+ arch_binaries := $(arch_binaries) lib32stdcxxdbg
+endif
+
+ifeq ($(with_cxxdev),yes)
+ arch_binaries := $(arch_binaries) libstdcxx-dev
+ indep_binaries := $(indep_binaries) libstdcxx-doc
+endif
+
+libstdc_ext = -$(BASE_VERSION)
+
+p_lib = libstdc++$(CXX_SONAME)
+p_lib64 = lib64stdc++$(CXX_SONAME)
+p_lib32 = lib32stdc++$(CXX_SONAME)
+p_dev = libstdc++$(CXX_SONAME)$(libstdc_ext)-dev
+p_pic = libstdc++$(CXX_SONAME)$(libstdc_ext)-pic
+p_dbg = libstdc++$(CXX_SONAME)$(libstdc_ext)-dbg
+p_dbg64 = $(p_lib64)$(libstdc_ext)-dbg
+p_dbg32 = $(p_lib32)$(libstdc_ext)-dbg
+p_libd = libstdc++$(CXX_SONAME)$(libstdc_ext)-doc
+
+d_lib = debian/$(p_lib)
+d_lib64 = debian/$(p_lib64)
+d_lib32 = debian/$(p_lib32)
+d_dev = debian/$(p_dev)
+d_pic = debian/$(p_pic)
+d_dbg = debian/$(p_dbg)
+d_dbg64 = debian/$(p_dbg64)
+d_dbg32 = debian/$(p_dbg32)
+d_libd = debian/$(p_libd)
+
+dirs_dev = \
+ $(docdir)/$(p_base)/C++ \
+ $(PF)/$(libdir) \
+ $(gcc_lib_dir)/include \
+ $(cxx_inc_dir)
+
+files_dev = \
+ $(cxx_inc_dir)/ \
+ $(gcc_lib_dir)/libstdc++.{a,so} \
+ $(gcc_lib_dir)/libsupc++.a
+# Not yet...
+# $(PF)/$(libdir)/lib{supc,stdc}++.la
+
+dirs_dbg = \
+ $(docdir) \
+ $(PF)/$(libdir)/debug \
+ $(gcc_lib_dir)
+files_dbg = \
+ $(PF)/$(libdir)/debug/libstdc++.*
+
+dirs_pic = \
+ $(docdir) \
+ $(gcc_lib_dir)
+files_pic = \
+ $(gcc_lib_dir)/libstdc++_pic.a
+
+ifeq ($(biarch),yes)
+ dirs_dev += $(gcc_lib_dir)/$(biarchsubdir)/
+ files_dev += $(gcc_lib_dir)/$(biarchsubdir)/libstdc++.{a,so} \
+ $(gcc_lib_dir)/$(biarchsubdir)/libsupc++.a
+ dirs_pic += $(gcc_lib_dir)
+ files_pic += $(gcc_lib_dir)/$(biarchsubdir)/libstdc++_pic.a
+endif
+ifeq ($(biarch32),yes)
+ dirs_dev += $(gcc_lib_dir)/$(biarchsubdir)/
+ files_dev += $(gcc_lib_dir)/$(biarchsubdir)/libstdc++.{a,so} \
+ $(gcc_lib_dir)/$(biarchsubdir)/libsupc++.a
+ dirs_pic += $(gcc_lib_dir)
+ files_pic += $(gcc_lib_dir)/$(biarchsubdir)/libstdc++_pic.a
+endif
+
+# ----------------------------------------------------------------------
+
+gxx_baseline_dir = $(shell \
+ sed -n '/^baseline_dir *=/s,.*= *\(.*\)\$$.*$$,\1,p' \
+ $(buildlibdir)/libstdc++-v3/testsuite/Makefile)
+gxx_baseline_file = $(gxx_baseline_dir)/baseline_symbols.txt
+
+debian/README.libstdc++-baseline:
+ cat debian/README.libstdc++-baseline.in \
+ > debian/README.libstdc++-baseline
+
+ baseline_name=`basename $(gxx_baseline_dir)`; \
+ baseline_parentdir=`dirname $(gxx_baseline_dir)`; \
+ compat_baseline_name=""; \
+ if [ -f "$(gxx_baseline_file)" ]; then \
+ ( \
+ echo "A baseline file for $$baseline_name was found."; \
+ echo "Running the check-abi script ..."; \
+ echo ""; \
+ $(MAKE) -C $(buildlibdir)/libstdc++-v3/testsuite \
+ check-abi; \
+ ) >> debian/README.libstdc++-baseline; \
+ else \
+ ( \
+ echo "No baseline file found for $$baseline_name."; \
+ echo "Generating a new baseline file ..."; \
+ echo ""; \
+ ) >> debian/README.libstdc++-baseline; \
+ mkdir $(gxx_baseline_dir); \
+ $(MAKE) -C $(buildlibdir)/libstdc++-v3/testsuite new-abi-baseline; \
+ cat $(gxx_baseline_file) >> debian/README.libstdc++-baseline; \
+ fi
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-libstdcxx: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_lib)
+ dh_installdirs -p$(p_lib) \
+ $(docdir) \
+ $(PF)/$(libdir)
+
+ cp -a $(d)/$(PF)/$(libdir)/libstdc++.so.* \
+ $(d_lib)/$(PF)/$(libdir)/
+
+ debian/dh_doclink -p$(p_lib) $(p_base)
+ debian/dh_rmemptydirs -p$(p_lib)
+
+ dh_strip -p$(p_lib)
+ dh_compress -p$(p_lib)
+ dh_fixperms -p$(p_lib)
+ dh_makeshlibs -p$(p_lib) -V '$(p_lib) (>= $(DEB_STDCXX_SOVERSION))'
+ cat debian/$(p_lib)/DEBIAN/shlibs >> debian/shlibs.local
+ dh_shlibdeps \
+ -L$(p_lgcc) -l:$(d)/$(PF)/lib:$(d_lgcc)/lib:\
+ -p$(p_lib)
+ dh_gencontrol -p$(p_lib) -- -v$(DEB_VERSION) $(common_substvars)
+
+ dh_installdeb -p$(p_lib)
+ dh_md5sums -p$(p_lib)
+ dh_builddeb -p$(p_lib)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-lib64stdcxx: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_lib64)
+ dh_installdirs -p$(p_lib64) \
+ $(docdir) \
+ $(PF)/lib64
+
+ cp -a $(d)/$(PF)/lib64/libstdc++.so.* \
+ $(d_lib64)/$(PF)/lib64/.
+
+ dh_strip -p$(p_lib64)
+
+ debian/dh_doclink -p$(p_lib64) $(p_base)
+ debian/dh_rmemptydirs -p$(p_lib64)
+
+ dh_compress -p$(p_lib64)
+ dh_fixperms -p$(p_lib64)
+ dh_makeshlibs -p$(p_lib64) -V '$(p_lib64) (>= $(DEB_STDCXX_SOVERSION))'
+# pass explicit dependencies to dh_shlibdeps
+# dh_shlibdeps -p$(p_lib64) -L $(p_l64gcc) -l $(d_l64gcc)/lib
+#/usr/bin/ldd: line 1: /lib/ld64.so.1: cannot execute binary file
+#dpkg-shlibdeps: failure: ldd on `debian/lib64gcc1/lib64/libgcc_s.so.1' gave error exit status 1
+ echo 'shlibs:Depends=$(p_l64gcc) (>= $(DEB_LIBGCC_SOVERSION))' \
+ > debian/$(p_lib64).substvars
+ dh_gencontrol -p$(p_lib64) -- -v$(DEB_VERSION) $(common_substvars)
+
+ dh_installdeb -p$(p_lib64)
+ dh_md5sums -p$(p_lib64)
+ dh_builddeb -p$(p_lib64)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-lib64stdcxxdbg: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_dbg64)
+ dh_installdirs -p$(p_dbg64) \
+ $(PF)/lib64
+
+ cp -a $(d)/$(PF)/lib64/libstdc++.so.* \
+ $(d_dbg64)/$(PF)/lib64/.
+ dh_strip -p$(p_dbg64) --keep-debug
+ rm -f $(d_dbg64)/$(PF)/lib64/libstdc++.so.*
+
+# mv $(d)/$(PF)/lib64/debug $(d_dbg64)/$(PF)/lib64/.
+ rm -f $(d_dbg64)/$(PF)/lib64/debug/libstdc++_pic.a
+
+ debian/dh_doclink -p$(p_dbg64) $(p_base)
+ debian/dh_rmemptydirs -p$(p_dbg64)
+
+ dh_compress -p$(p_dbg64)
+ dh_fixperms -p$(p_dbg64)
+ dh_gencontrol -p$(p_dbg64) -- -v$(DEB_VERSION) $(common_substvars)
+
+ dh_installdeb -p$(p_dbg64)
+ dh_md5sums -p$(p_dbg64)
+ dh_builddeb -p$(p_dbg64)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-lib32stdcxx: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_lib32)
+
+ dh_installdirs -p$(p_lib32) \
+ $(docdir) \
+ $(lib32)
+
+ cp -a $(d)/$(lib32)/libstdc++.so.* \
+ $(d_lib32)/$(lib32)/.
+
+ debian/dh_doclink -p$(p_lib32) $(p_base)
+ debian/dh_rmemptydirs -p$(p_lib32)
+
+ dh_strip -p$(p_lib32)
+ dh_compress -p$(p_lib32)
+ dh_fixperms -p$(p_lib32)
+ dh_makeshlibs -p$(p_lib32) -V '$(p_lib32) (>= $(DEB_STDCXX_SOVERSION))'
+ dh_gencontrol -p$(p_lib32) -- -v$(DEB_VERSION) $(common_substvars)
+
+ dh_installdeb -p$(p_lib32)
+ dh_md5sums -p$(p_lib32)
+ dh_builddeb -p$(p_lib32)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-lib32stdcxxdbg: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_dbg32)
+ dh_installdirs -p$(p_dbg32) \
+ $(lib32)
+
+ cp -a $(d)/$(lib32)/libstdc++.so.* \
+ $(d_dbg32)/$(lib32)/.
+ dh_strip -p$(p_dbg32) --keep-debug
+ rm -f $(d_dbg32)/$(lib32)/libstdc++.so.*
+
+ mv $(d)/$(lib32)/debug $(d_dbg32)/$(lib32)/.
+ rm -f $(d_dbg32)/$(lib32)/debug/libstdc++_pic.a
+
+ debian/dh_doclink -p$(p_dbg32) $(p_base)
+ debian/dh_rmemptydirs -p$(p_dbg32)
+
+ dh_compress -p$(p_dbg32)
+ dh_fixperms -p$(p_dbg32)
+ dh_gencontrol -p$(p_dbg32) -- -v$(DEB_VERSION) $(common_substvars)
+
+ dh_installdeb -p$(p_dbg32)
+ dh_md5sums -p$(p_dbg32)
+ dh_builddeb -p$(p_dbg32)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+libcxxdev_deps = $(install_stamp)
+ifeq ($(with_libcxx),yes)
+ libcxxdev_deps += $(binary_stamp)-libstdcxx
+endif
+ifeq ($(with_check),yes)
+ libcxxdev_deps += debian/README.libstdc++-baseline
+endif
+$(binary_stamp)-libstdcxx-dev: $(libcxxdev_deps)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_dev) $(d_pic)
+ dh_installdirs -p$(p_dev) $(dirs_dev)
+ dh_installdirs -p$(p_pic) $(dirs_pic)
+ dh_installdirs -p$(p_dbg) $(dirs_dbg)
+
+ : # - correct libstdc++-v3 file locations
+ mv $(d)/$(PF)/$(libdir)/libsupc++.a $(d)/$(gcc_lib_dir)/
+ mv $(d)/$(PF)/$(libdir)/libstdc++.{a,so} $(d)/$(gcc_lib_dir)/
+ ln -sf ../../../$(DEB_TARGET_GNU_TYPE)/libstdc++.so.$(CXX_SONAME) \
+ $(d)/$(gcc_lib_dir)/libstdc++.so
+ mv $(d)/$(PF)/$(libdir)/libstdc++_pic.a $(d)/$(gcc_lib_dir)/
+
+ rm -f $(d)/$(PF)/$(libdir)/debug/libstdc++_pic.a
+ rm -f $(d)/$(PF)/lib64/debug/libstdc++_pic.a
+
+ : # remove precompiled headers
+ -find $(d) -type d -name '*.gch' | xargs rm -rf
+
+ifeq ($(biarch),yes)
+ mv $(d)/$(PF)/lib64/lib*c++*.{a,so} $(d)/$(gcc_lib_dir)/$(biarchsubdir)/.
+endif
+ifeq ($(biarch32),yes)
+ mv $(d)/$(lib32)/lib*c++*.{a,so} $(d)/$(gcc_lib_dir)/$(biarchsubdir)/.
+endif
+
+ for i in $(d)/$(PF)/include/c++/$(GCC_VERSION)/*-linux; do \
+ if [ -d $$i ]; then mv $$i $$i-gnu; fi; \
+ done
+
+ DH_COMPAT=2 dh_movefiles -p$(p_dev) $(files_dev)
+ DH_COMPAT=2 dh_movefiles -p$(p_pic) $(files_pic)
+ DH_COMPAT=2 dh_movefiles -p$(p_dbg) $(files_dbg)
+
+ dh_link -p$(p_dev) \
+ /$(PF)/$(libdir)/libstdc++.so.$(CXX_SONAME) \
+ /$(gcc_lib_dir)/libstdc++.so \
+ /$(cxx_inc_dir) /$(PF)/include/c++/$(BASE_VERSION)
+
+ifeq ($(biarch),yes)
+ dh_link -p$(p_dev) \
+ /$(PF)/lib64/libstdc++.so.$(CXX_SONAME) \
+ /$(gcc_lib_dir)/$(biarchsubdir)/libstdc++.so
+endif
+ifeq ($(biarch32),yes)
+ dh_link -p$(p_dev) \
+ /$(lib32)/libstdc++.so.$(CXX_SONAME) \
+ /$(gcc_lib_dir)/$(biarchsubdir)/libstdc++.so
+endif
+
+ debian/dh_doclink -p$(p_dev) $(p_base)
+ debian/dh_doclink -p$(p_pic) $(p_base)
+ debian/dh_doclink -p$(p_dbg) $(p_base)
+ cp -p $(srcdir)/libstdc++-v3/ChangeLog \
+ $(d_dev)/$(docdir)/$(p_base)/C++/changelog.libstdc++
+ifeq ($(with_check),yes)
+ cp -p debian/README.libstdc++-baseline \
+ $(d_dev)/$(docdir)/$(p_base)/C++/README.libstdc++-baseline
+ if [ -f $(buildlibdir)/libstdc++-v3/testsuite/current_symbols.txt ]; \
+ then \
+ cp -p $(buildlibdir)/libstdc++-v3/testsuite/current_symbols.txt \
+ $(d_dev)/$(docdir)/$(p_base)/C++/libstdc++_symbols.txt; \
+ fi
+endif
+ cp -p $(srcdir)/libstdc++-v3/config/linker-map.gnu \
+ $(d_pic)/$(gcc_lib_dir)/libstdc++_pic.map
+
+ifeq ($(with_cxxdev),yes)
+ debian/dh_rmemptydirs -p$(p_dev)
+ debian/dh_rmemptydirs -p$(p_pic)
+ debian/dh_rmemptydirs -p$(p_dbg)
+endif
+
+ cp -a $(d)/$(PF)/$(libdir)/libstdc++.so.* \
+ $(d_dbg)/$(PF)/$(libdir)/
+ dh_strip -p$(p_dbg) --keep-debug
+ rm -f $(d_dbg)/$(PF)/$(libdir)/libstdc++.so.*
+
+ dh_strip -p$(p_dev) --dbg-package=$(p_lib)
+ dh_strip -p$(p_pic)
+
+ dh_compress -p$(p_dev) -p$(p_pic) -p$(p_dbg) -X.txt
+ dh_fixperms -p$(p_dev) -p$(p_pic) -p$(p_dbg)
+ifeq ($(biarch),yes)
+ dh_shlibdeps -p$(p_dev) -p$(p_pic) -p$(p_dbg) -Xlib64
+else
+ dh_shlibdeps -p$(p_dev) -p$(p_pic) -p$(p_dbg) -Xlib32/debug
+endif
+ dh_gencontrol -p$(p_dev) -p$(p_pic) -p$(p_dbg) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+
+ dh_installdeb -p$(p_dev) -p$(p_pic) -p$(p_dbg)
+ dh_md5sums -p$(p_dev) -p$(p_pic) -p$(p_dbg)
+ dh_builddeb -p$(p_dev) -p$(p_pic) -p$(p_dbg)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+
+doxygen_doc_dir = $(buildlibdir)/libstdc++-v3/docs/doxygen
+
+doxygen-docs: $(build_doxygen_stamp)
+$(build_doxygen_stamp):
+ rm -rf $(doxygen_doc_dir)/html*
+ $(MAKE) -C $(buildlibdir)/libstdc++-v3 SHELL=/bin/bash doxygen
+ $(MAKE) -C $(buildlibdir)/libstdc++-v3 SHELL=/bin/bash doxygen-man
+ sed -e 's,http://gcc\.gnu\.org/onlinedocs/libstdc++,../html,g' \
+ -e 's,
Main Page,libstdc++-v3 Source: Main Index,' \
+ $(doxygen_doc_dir)/html_user/index.html \
+ > $(doxygen_doc_dir)/html_user/index.html.new
+ mv -f $(doxygen_doc_dir)/html_user/index.html.new \
+ $(doxygen_doc_dir)/html_user/index.html
+
+ -find $(doxygen_doc_dir)/html_user -name 'struct*' -empty | xargs rm -f
+
+ touch $@
+
+$(binary_stamp)-libstdcxx-doc: $(install_stamp) doxygen-docs
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_libd)
+ dh_installdirs -p$(p_libd) \
+ $(docdir)/$(p_base)/libstdc++ \
+ $(PF)/share/man
+
+# debian/dh_doclink -p$(p_libd) $(p_base)
+ dh_link -p$(p_libd) /usr/share/doc/$(p_base) /usr/share/doc/$(p_libd)
+ dh_installdocs -p$(p_libd)
+ rm -f $(d_libd)/$(docdir)/$(p_base)/copyright
+
+ cp -a $(srcdir)/libstdc++-v3/docs/html \
+ $(d_libd)/$(docdir)/$(p_base)/libstdc++/.
+ ln -sf documentation.html \
+ $(d_libd)/$(docdir)/$(p_base)/libstdc++/html/index.html
+ -find $(d_libd)/$(docdir)/$(p_base)/libstdc++/ -name CVS -type d \
+ | xargs rm -rf
+
+ cp -a $(doxygen_doc_dir)/html_user \
+ $(d_libd)/$(docdir)/$(p_base)/libstdc++/.
+ cp -a $(doxygen_doc_dir)/man/man3 \
+ $(d_libd)/$(PF)/share/man/.
+ cp -p $(srcdir)/libstdc++-v3/docs/doxygen/Intro.3 \
+ $(d_libd)/$(PF)/share/man/man3/C++Intro.3
+
+ mkdir -p $(d_libd)/usr/share/lintian/overrides
+ cp -p debian/$(p_libd).overrides \
+ $(d_libd)/usr/share/lintian/overrides/$(p_libd)
+
+ dh_compress -p$(p_libd) -Xhtml/17_intro -X.txt -X.tag
+ dh_fixperms -p$(p_libd)
+ dh_gencontrol -p$(p_libd) -- -v$(DEB_VERSION) $(common_substvars)
+
+ dh_installdeb -p$(p_libd)
+ dh_md5sums -p$(p_libd)
+ dh_builddeb -p$(p_libd)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
--- gcc-4.1-4.1.1.orig/debian/rules.d/binary-objc.mk
+++ gcc-4.1-4.1.1/debian/rules.d/binary-objc.mk
@@ -0,0 +1,64 @@
+arch_binaries := $(arch_binaries) objc
+
+p_objc = gobjc$(pkg_ver)
+d_objc = debian/$(p_objc)
+
+dirs_objc = \
+ $(docdir)/$(p_base)/ObjC \
+ $(gcc_lexec_dir) \
+ $(gcc_lib_dir)/include
+
+files_objc = \
+ $(gcc_lexec_dir)/cc1obj \
+ $(gcc_lib_dir)/include/objc \
+ $(gcc_lib_dir)/{libobjc*.a,libobjc*.la}
+
+$(binary_stamp)-objc: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ mv $(d)/$(PF)/$(libdir)/libobjc*.{a,la} $(d)/$(gcc_lib_dir)/
+
+ rm -rf $(d_objc)
+ dh_installdirs -p$(p_objc) $(dirs_objc)
+ DH_COMPAT=2 dh_movefiles -p$(p_objc) $(files_objc)
+
+ifeq ($(with_lib64objc),yes)
+ mkdir -p $(d_objc)/$(gcc_lib_dir)/$(biarchsubdir)
+ mv $(d)/$(PF)/lib64/libobjc*.{a,la} $(d_objc)/$(gcc_lib_dir)/$(biarchsubdir)/
+ dh_link -p$(p_objc) \
+ /$(PF)/lib64/libobjc.so.$(OBJC_SONAME) /$(gcc_lib_dir)/$(biarchsubdir)/libobjc.so
+endif
+ifeq ($(with_lib32objc),yes)
+ mkdir -p $(d_objc)/$(gcc_lib_dir)/$(biarchsubdir)
+ mv $(d)/$(lib32)/libobjc*.{a,la} $(d_objc)/$(gcc_lib_dir)/$(biarchsubdir)/
+ dh_link -p$(p_objc) \
+ /$(lib32)/libobjc.so.$(OBJC_SONAME) /$(gcc_lib_dir)/$(biarchsubdir)/libobjc.so
+endif
+
+ dh_link -p$(p_objc) \
+ /$(PF)/$(libdir)/libobjc.so.$(OBJC_SONAME) /$(gcc_lib_dir)/libobjc.so
+ifeq ($(with_objc_gc),yes)
+ dh_link -p$(p_objc) \
+ /$(PF)/$(libdir)/libobjc_gc.so.$(OBJC_SONAME) \
+ /$(gcc_lib_dir)/libobjc_gc.so
+endif
+
+ debian/dh_doclink -p$(p_objc) $(p_base)
+ cp -p $(srcdir)/libobjc/{README*,THREADS*} \
+ $(d_objc)/$(docdir)/$(p_base)/ObjC/.
+
+ debian/dh_rmemptydirs -p$(p_objc)
+
+ dh_strip -p$(p_objc)
+ dh_compress -p$(p_objc)
+
+ dh_fixperms -p$(p_objc)
+ dh_shlibdeps -p$(p_objc)
+ dh_gencontrol -p$(p_objc) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_objc)
+ dh_md5sums -p$(p_objc)
+ dh_builddeb -p$(p_objc)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
--- gcc-4.1-4.1.1.orig/debian/rules.d/binary-libstdcxx-cross.mk
+++ gcc-4.1-4.1.1/debian/rules.d/binary-libstdcxx-cross.mk
@@ -0,0 +1,325 @@
+ifeq ($(with_libcxx),yes)
+ arch_binaries := $(arch_binaries) libstdcxx
+endif
+ifeq ($(with_lib64cxx),yes)
+ arch_binaries := $(arch_binaries) lib64stdcxx
+endif
+ifeq ($(biarch32),yes)
+ arch_binaries := $(arch_binaries) lib32stdcxx
+endif
+
+ifeq ($(with_cxxdev),yes)
+ arch_binaries := $(arch_binaries) libstdcxx-dev
+endif
+
+libstdc_ext = -$(BASE_VERSION)
+
+p_lib = libstdc++$(CXX_SONAME)$(cross_lib_arch)
+p_lib64 = lib64stdc++$(CXX_SONAME)$(cross_lib_arch)
+p_lib32 = lib32stdc++$(CXX_SONAME)$(cross_lib_arch)
+p_dev = libstdc++$(CXX_SONAME)$(libstdc_ext)-dev$(cross_lib_arch)
+p_pic = libstdc++$(CXX_SONAME)$(libstdc_ext)-pic$(cross_lib_arch)
+p_dbg = libstdc++$(CXX_SONAME)$(libstdc_ext)-dbg$(cross_lib_arch)
+p_dbg64 = lib64stdc++$(CXX_SONAME)$(libstdc_ext)-dbg$(cross_lib_arch)
+p_dbg32 = lib32stdc++$(CXX_SONAME)$(libstdc_ext)-dbg$(cross_lib_arch)
+
+d_lib = debian/$(p_lib)
+d_lib64 = debian/$(p_lib64)
+d_lib32 = debian/$(p_lib32)
+d_dev = debian/$(p_dev)
+d_pic = debian/$(p_pic)
+d_dbg = debian/$(p_dbg)
+d_dbg64 = debian/$(p_dbg64)
+d_dbg32 = debian/$(p_dbg32)
+
+dirs_lib = \
+ $(docdir) \
+ $(PF)/$(DEB_TARGET_GNU_TYPE)/lib
+
+dirs_lib64 = \
+ $(docdir) \
+ $(PF)/$(DEB_TARGET_GNU_TYPE)/lib64
+
+files_lib = \
+ $(PF)/$(DEB_TARGET_GNU_TYPE)/lib/libstdc++.so.*
+
+files_lib64 = \
+ $(PF)/$(DEB_TARGET_GNU_TYPE)/lib64/libstdc++.so.*
+
+dirs_dev = \
+ $(docdir) \
+ $(PF)/$(DEB_TARGET_GNU_TYPE)/lib \
+ $(gcc_lib_dir)/include \
+ $(cxx_inc_dir)
+
+files_dev = \
+ $(cxx_inc_dir)/ \
+ $(gcc_lib_dir)/libstdc++.{a,so} \
+ $(gcc_lib_dir)/libsupc++.a
+# Not yet...
+# $(PF)/$(libdir)/lib{supc,stdc}++.la
+
+dirs_dbg = \
+ $(docdir) \
+ $(PF)/$(DEB_TARGET_GNU_TYPE)/lib/debug \
+ $(gcc_lib_dir)
+files_dbg = \
+ $(PF)/$(DEB_TARGET_GNU_TYPE)/lib/debug/libstdc++.*
+
+dirs_pic = \
+ $(docdir) \
+ $(gcc_lib_dir)
+files_pic = \
+ $(gcc_lib_dir)/libstdc++_pic.a
+
+ifeq ($(biarch),yes)
+ dirs_dev += $(gcc_lib_dir)/$(biarchsubdir)/
+ files_dev += $(gcc_lib_dir)/$(biarchsubdir)/libstdc++.{a,so} \
+ $(gcc_lib_dir)/$(biarchsubdir)/libsupc++.a
+ dirs_pic += $(gcc_lib_dir)
+ files_pic += $(gcc_lib_dir)/$(biarchsubdir)/libstdc++_pic.a
+endif
+ifeq ($(biarch32),yes)
+ dirs_dev += $(gcc_lib_dir)/$(biarchsubdir)/
+ files_dev += $(gcc_lib_dir)/$(biarchsubdir)/libstdc++.{a,so} \
+ $(gcc_lib_dir)/$(biarchsubdir)/libsupc++.a
+ dirs_pic += $(gcc_lib_dir)
+ files_pic += $(gcc_lib_dir)/$(biarchsubdir)/libstdc++_pic.a
+endif
+
+# ----------------------------------------------------------------------
+
+$(binary_stamp)-libstdcxx: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_lib)
+ dh_installdirs -p$(p_lib) $(dirs_lib)
+ DH_COMPAT=2 dh_movefiles -p$(p_lib) $(files_lib)
+
+ dh_installdocs -p$(p_lib)
+ echo "See /$(docdir)/$(p_base) for more information" \
+ > $(d_lib)/$(docdir)/$(p_lib)/README.Debian
+
+ dh_installchangelogs -p$(p_lib)
+ debian/dh_rmemptydirs -p$(p_lib)
+
+ mkdir -p $(d_dbg)
+ PATH=/usr/share/dpkg-cross:$$PATH dh_strip -p$(p_lib) --keep-debug
+ # The above line puts debugging information into some strange location
+ # that is hardcoded into dh_strip. Move it from there.
+ mkdir -p $(d_lib)/usr/$(DEB_TARGET_GNU_TYPE)/lib/debug
+ mv $(d_lib)/usr/lib/debug/usr/$(DEB_TARGET_GNU_TYPE)/lib/* $(d_lib)/usr/$(DEB_TARGET_GNU_TYPE)/lib/debug/
+ rm -rf $(d_lib)/usr/lib
+ # End workaround
+ find $(d_dbg)
+ tar -C $(d_lib) -c -f - usr/$(DEB_TARGET_GNU_TYPE)/lib/debug | tar -v -C $(d_dbg) -x -f -
+ rm -rf $(d_lib)/usr/$(DEB_TARGET_GNU_TYPE)/lib/debug
+
+ dh_compress -p$(p_lib)
+ dh_fixperms -p$(p_lib)
+ dh_makeshlibs -p$(p_lib) -V '$(p_lib) (>= $(DEB_STDCXX_SOVERSION))' -n
+ sed s/$(cross_lib_arch)//g < debian/$(p_lib)/DEBIAN/shlibs > debian/$(p_lib)/DEBIAN/shlibs.fixed
+ mv debian/$(p_lib)/DEBIAN/shlibs.fixed debian/$(p_lib)/DEBIAN/shlibs
+ ARCH=$(DEB_TARGET_ARCH) MAKEFLAGS="CC=something" dh_shlibdeps -p$(p_lib)
+ sed 's/\(lib[^ ]*\) /\1$(cross_lib_arch) /g' < debian/$(p_lib).substvars > debian/$(p_lib).substvars.new
+ mv debian/$(p_lib).substvars.new debian/$(p_lib).substvars
+ dh_gencontrol -p$(p_lib) -- -v$(DEB_VERSION) $(common_substvars)
+
+ dh_installdeb -p$(p_lib)
+ dh_md5sums -p$(p_lib)
+ dh_builddeb -p$(p_lib)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+
+$(binary_stamp)-lib64stdcxx: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_lib64)
+ dh_installdirs -p$(p_lib64) $(dirs_lib64)
+ DH_COMPAT=2 dh_movefiles -p$(p_lib64) $(files_lib64)
+
+ dh_installdirs -p$(p_dbg64) \
+ $(PF)/$(DEB_TARGET_GNU_TYPE)/lib64
+ mv $(d)/$(PF)/$(DEB_TARGET_GNU_TYPE)/lib64/debug $(d_dbg64)/$(PF)/(DEB_TARGET_GNU_TYPE)/lib64/.
+
+ mkdir -p $(d_dbg64)
+ PATH=/usr/share/dpkg-cross:$$PATH dh_strip -p$(p_lib64) --keep-debug
+ # The above line puts debugging information into some strange location
+ # that is hardcoded into dh_strip. Move it from there.
+ mkdir -p $(d_lib64)/usr/$(DEB_TARGET_GNU_TYPE)/lib64/debug
+ mv $(d_lib64)/usr/lib/debug/usr/$(DEB_TARGET_GNU_TYPE)/lib64/* $(d_lib64)/usr/$(DEB_TARGET_GNU_TYPE)/lib64/debug/
+ rm -rf $(d_lib64)/usr/lib64
+ # End workaround
+ find $(d_lib64)
+ tar -C $(d_lib64) -c -f - usr/$(DEB_TARGET_GNU_TYPE)/lib64/debug | tar -v -C $(d_dbg64) -x -f -
+ rm -rf $(d_lib64)/usr/$(DEB_TARGET_GNU_TYPE)/lib64/debug
+
+ dh_installdocs -p$(p_lib64)
+ echo "See /$(docdir)/$(p_base) for more information" \
+ > $(d_lib64)/$(docdir)/$(p_lib64)/README.Debian
+ dh_installchangelogs -p$(p_lib64)
+ debian/dh_doclink -p$(p_dbg64) $(p_lib64)
+
+ debian/dh_rmemptydirs -p$(p_lib64)
+ dh_compress -p$(p_lib64)
+ dh_fixperms -p$(p_lib64)
+ dh_makeshlibs -p$(p_lib64) -V '$(p_lib64) (>= $(DEB_STDCXX_SOVERSION))' -n
+ sed s/$(cross_lib_arch)//g < debian/$(p_lib64)/DEBIAN/shlibs > debian/$(p_lib64)/DEBIAN/shlibs.fixed
+ mv debian/$(p_lib64)/DEBIAN/shlibs.fixed debian/$(p_lib64)/DEBIAN/shlibs
+ ARCH=$(DEB_TARGET_ARCH) MAKEFLAGS="CC=something" dh_shlibdeps -p$(p_lib64)
+ sed 's/\(lib[^ ]*\) /\1$(cross_lib_arch) /g' < debian/$(p_lib64).substvars > debian/$(p_lib64).substvars.new
+ mv debian/$(p_lib64).substvars.new debian/$(p_lib64).substvars
+ dh_gencontrol -p$(p_lib64) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_gencontrol -p$(p_dbg64) -- -v$(DEB_VERSION) $(common_substvars)
+
+ dh_installdeb -p$(p_lib64)
+ dh_md5sums -p$(p_lib64)
+ dh_builddeb -p$(p_lib64)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+
+$(binary_stamp)-lib32stdcxx: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_lib32)
+ dh_installdirs -p$(p_lib32) $(dirs_lib32)
+ DH_COMPAT=2 dh_movefiles -p$(p_lib32) $(files_lib32)
+
+ dh_installdirs -p$(p_dbg32) \
+ $(PF)/$(DEB_TARGET_GNU_TYPE)/lib32
+ mv $(d)/$(PF)/$(DEB_TARGET_GNU_TYPE)/lib32/debug $(d_dbg32)/$(PF)/(DEB_TARGET_GNU_TYPE)/lib32/.
+
+ mkdir -p $(d_dbg32)
+ PATH=/usr/share/dpkg-cross:$$PATH dh_strip -p$(p_lib32) --keep-debug
+ # The above line puts debugging information into some strange location
+ # that is hardcoded into dh_strip. Move it from there.
+ mkdir -p $(d_lib32)/usr/$(DEB_TARGET_GNU_TYPE)/lib32/debug
+ mv $(d_lib32)/usr/lib/debug/usr/$(DEB_TARGET_GNU_TYPE)/lib32/* $(d_lib32)/usr/$(DEB_TARGET_GNU_TYPE)/lib32/debug/
+ rm -rf $(d_lib32)/usr/lib32
+ # End workaround
+ find $(d_lib32)
+ tar -C $(d_lib32) -c -f - usr/$(DEB_TARGET_GNU_TYPE)/lib/debug | tar -v -C $(d_dbg32) -x -f -
+ rm -rf $(d_lib32)/usr/$(DEB_TARGET_GNU_TYPE)/lib/debug
+
+ dh_installdocs -p$(p_lib32)
+ echo "See /$(docdir)/$(p_base) for more information" \
+ > $(d_lib32)/$(docdir)/$(p_lib32)/README.Debian
+ dh_installchangelogs -p$(p_lib32)
+ debian/dh_doclink -p$(p_dbg32) $(p_lib32)
+
+ debian/dh_rmemptydirs -p$(p_lib32)
+ dh_compress -p$(p_lib32)
+ dh_fixperms -p$(p_lib32)
+
+ sed s/$(cross_lib_arch)//g < debian/$(p_lib32)/DEBIAN/shlibs > debian/$(p_lib32)/DEBIAN/shlibs.fixed
+ mv debian/$(p_lib32)/DEBIAN/shlibs.fixed debian/$(p_lib32)/DEBIAN/shlibs
+ ARCH=$(DEB_TARGET_ARCH) MAKEFLAGS="CC=something" dh_shlibdeps -p$(p_lib32)
+ sed 's/\(lib[^ ]*\) /\1$(cross_lib_arch) /g' < debian/$(p_lib32).substvars > debian/$(p_lib32).substvars.new
+ mv debian/$(p_lib32).substvars.new debian/$(p_lib32).substvars
+ dh_gencontrol -p$(p_lib32) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_gencontrol -p$(p_dbg32) -- -v$(DEB_VERSION) $(common_substvars)
+
+ dh_installdeb -p$(p_lib32)
+ dh_md5sums -p$(p_lib32)
+ dh_builddeb -p$(p_lib32)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+libcxxdev_deps = $(install_stamp)
+ifeq ($(with_libcxx),yes)
+ libcxxdev_deps += $(binary_stamp)-libstdcxx
+endif
+$(binary_stamp)-libstdcxx-dev: $(libcxxdev_deps) \
+ $(binary_stamp)-libstdcxx
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_dev) $(d_pic)
+ dh_installdirs -p$(p_dev) $(dirs_dev)
+ dh_installdirs -p$(p_pic) $(dirs_pic)
+ dh_installdirs -p$(p_dbg) $(dirs_dbg)
+
+ : # - correct libstdc++-v3 file locations
+ mv $(d)/$(PF)/$(DEB_TARGET_GNU_TYPE)/lib/libsupc++.a $(d)/$(gcc_lib_dir)/
+ mv $(d)/$(PF)/$(DEB_TARGET_GNU_TYPE)/lib/libstdc++.{a,so} $(d)/$(gcc_lib_dir)/
+ ln -sf ../../../../$(DEB_TARGET_GNU_TYPE)/lib/libstdc++.so.$(CXX_SONAME) $(d)/$(gcc_lib_dir)/libstdc++.so
+ mv $(d)/$(PF)/$(DEB_TARGET_GNU_TYPE)/lib/libstdc++_pic.a \
+ $(d)/$(gcc_lib_dir)/
+
+ rm -f $(d)/$(PF)/$(DEB_TARGET_GNU_TYPE)/lib/debug/libstdc++_pic.a
+ rm -f $(d)/$(PF)/$(DEB_TARGET_GNU_TYPE)/lib64/debug/libstdc++_pic.a
+
+ : # remove precompiled headers
+ -find $(d) -type d -name '*.gch' | xargs rm -rf
+
+ifeq ($(biarch),yes)
+ mv $(d)/$(PF)/$(DEB_TARGET_GNU_TYPE)/lib64/lib*c++*.a $(d)/$(gcc_lib_dir)/$(biarchsubdir)/.
+ ln -sf ../../../../../lib64/libstdc++.so.$(CXX_SONAME) \
+ $(d)/$(gcc_lib_dir)/$(biarchsubdir)/libstdc++.so
+endif
+ifeq ($(biarch32),yes)
+ mv $(d)/$(PF)/$(DEB_TARGET_GNU_TYPE)/lib32/lib*c++*.a $(d)/$(gcc_lib_dir)/$(biarchsubdir)/.
+ ln -sf ../../../../../lib64/libstdc++.so.$(CXX_SONAME) \
+ $(d)/$(gcc_lib_dir)/$(biarchsubdir)/libstdc++.so
+endif
+
+ for i in $(d)/$(PF)/include/c++/$(GCC_VERSION)/*-linux; do \
+ if [ -d $$i ]; then mv $$i $$i-gnu; fi; \
+ done
+
+ DH_COMPAT=2 dh_movefiles -p$(p_dev) $(files_dev)
+ DH_COMPAT=2 dh_movefiles -p$(p_pic) $(files_pic)
+ DH_COMPAT=2 dh_movefiles -p$(p_dbg) $(files_dbg)
+
+ dh_link -p$(p_dev) \
+ /$(PF)/$(DEB_TARGET_GNU_TYPE)/$(libdir)/libstdc++.so.$(CXX_SONAME) \
+ /$(gcc_lib_dir)/libstdc++.so \
+ /$(cxx_inc_dir) /$(PF)/$(DEB_TARGET_GNU_TYPE)/include/c++/$(BASE_VERSION)
+
+ifeq ($(biarch),yes)
+ dh_link -p$(p_dev) \
+ /$(PF)/$(DEB_TARGET_GNU_TYPE)/lib64/libstdc++.so.$(CXX_SONAME) \
+ /$(gcc_lib_dir)/$(biarchsubdir)/libstdc++.so
+endif
+ifeq ($(biarch32),yes)
+ dh_link -p$(p_dev) \
+ /$(PF)/$(DEB_TARGET_GNU_TYPE)/lib32/libstdc++.so.$(CXX_SONAME) \
+ /$(gcc_lib_dir)/$(biarchsubdir)/libstdc++.so
+endif
+
+ debian/dh_doclink -p$(p_dev) $(p_lib)
+ debian/dh_doclink -p$(p_pic) $(p_lib)
+ debian/dh_doclink -p$(p_dbg) $(p_lib)
+ cp -p $(srcdir)/libstdc++-v3/config/linker-map.gnu \
+ $(d_pic)/$(gcc_lib_dir)/libstdc++_pic.map
+
+ifeq ($(with_cxxdev),yes)
+ debian/dh_rmemptydirs -p$(p_dev)
+ debian/dh_rmemptydirs -p$(p_pic)
+ debian/dh_rmemptydirs -p$(p_dbg)
+endif
+
+ PATH=/usr/share/dpkg-cross:$$PATH dh_strip -p$(p_dev) --dbg-package=$(p_lib)
+ PATH=/usr/share/dpkg-cross:$$PATH dh_strip -p$(p_pic)
+ dh_compress -p$(p_dev) -p$(p_pic) -p$(p_dbg) -X.txt
+ dh_fixperms -p$(p_dev) -p$(p_pic) -p$(p_dbg)
+ dh_gencontrol -p$(p_dev) -p$(p_pic) -p$(p_dbg) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+
+ dh_installdeb -p$(p_dev) -p$(p_pic) -p$(p_dbg)
+ dh_md5sums -p$(p_dev) -p$(p_pic) -p$(p_dbg)
+ dh_builddeb -p$(p_dev) -p$(p_pic) -p$(p_dbg)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
--- gcc-4.1-4.1.1.orig/debian/rules.d/binary-cross.mk
+++ gcc-4.1-4.1.1/debian/rules.d/binary-cross.mk
@@ -0,0 +1,57 @@
+arch_binaries := $(arch_binaries) gcc-cross
+
+dirs_gcc = \
+ $(docdir)/$(p_base)/gcc \
+ $(PF)/bin \
+ $(gcc_lib_dir)/include \
+ $(PF)/share/man/man1
+
+files_gcc = \
+ $(PF)/bin/{$(DEB_TARGET_GNU_TPE)-gcc,$(DEB_TARGET_GNU_TYPE)-cpp}$(pkg_ver) \
+ $(PF)/share/man/man1/{$(DEB_TARGET_GNU_TYPE)-gcc}$(pkg_ver).1 \
+ $(gcc_lib_dir) \
+
+
+files_gcc += \
+ $(shell test -e $(d)/$(gcc_lib_dir)/SYSCALLS.c.X \
+ && echo $(gcc_lib_dir)/SYSCALLS.c.X)
+
+usr_doc_files = debian/README.Bugs \
+ $(shell test -f $(srcdir)/FAQ && echo $(srcdir)/FAQ)
+ifeq ($(with_check),yes)
+ usr_doc_files += test-summary
+endif
+ifeq ($(DEB_HOST_ARCH),sparc)
+ usr_doc_files += debian/README.sparc
+endif
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-gcc-cross: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ rm -rf $(d_gcc)
+ dh_installdirs -p$(p_gcc) $(dirs_gcc)
+ $(IS) debian/c89 $(d)/$(PF)/bin/
+ $(IR) debian/c89.1 $(d)/$(PF)/share/man/man1/
+
+ rm -f $(d)/$(PF)/$(libdir)/libgcc_s.so
+ ln -sf /$(libdir)/libgcc_s.so.$(GCC_SONAME) $(d)/$(gcc_lib_dir)/libgcc_s.so
+
+ DH_COMPAT=2 dh_movefiles -p$(p_gcc) $(files_gcc)
+
+# dh_installdebconf
+ debian/dh_doclink -p$(p_gcc) $(p_base)
+ cp -p $(usr_doc_files) $(d_gcc)/$(docdir)/$(p_base)/.
+ cp -p debian/NEWS.gcc $(d_gcc)/$(docdir)/$(p_base)/NEWS
+ dh_undocumented -p$(p_gcc) gccbug$(pkg_ver).1
+ debian/dh_rmemptydirs -p$(p_gcc)
+ dh_strip -p$(p_gcc)
+ dh_compress -p$(p_gcc)
+ dh_fixperms -p$(p_gcc)
+ dh_shlibdeps -p$(p_gcc)
+ dh_gencontrol -p$(p_gcc) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_gcc)
+ dh_md5sums -p$(p_gcc)
+ dh_builddeb -p$(p_gcc)
+ touch $@
+
--- gcc-4.1-4.1.1.orig/debian/rules.d/binary-source.mk
+++ gcc-4.1-4.1.1/debian/rules.d/binary-source.mk
@@ -0,0 +1,27 @@
+indep_binaries := $(indep_binaries) gcc-source
+
+p_source = gcc$(pkg_ver)-source
+d_source= debian/$(p_source)
+
+$(binary_stamp)-gcc-source:
+ dh_testdir
+ dh_testroot
+
+ dh_install -p$(p_source) $(gcc_tarball) usr/src/gcc$(pkg_ver)
+ dh_install -p$(p_source) debian/patches usr/src/gcc$(pkg_ver)
+ chmod 755 debian/$(p_source)/usr/src/gcc$(pkg_ver)/patches/*
+ rm -rf debian/$(p_source)/usr/src/gcc$(pkg_ver)/patches/.svn
+ dh_install -p$(p_source) \
+ debian/rules.defs debian/rules.patch debian/rules.source \
+ debian/rules.unpack debian/multiarch.inc \
+ usr/src/gcc$(pkg_ver)
+
+ debian/dh_doclink -p$(p_source) $(p_base)
+
+ dh_fixperms -p$(p_source)
+ dh_gencontrol -p$(p_source) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_source)
+ dh_md5sums -p$(p_source)
+ dh_builddeb -p$(p_source)
+
+ touch $@
--- gcc-4.1-4.1.1.orig/debian/rules.d/binary-libssp.mk
+++ gcc-4.1-4.1.1/debian/rules.d/binary-libssp.mk
@@ -0,0 +1,121 @@
+arch_binaries := $(arch_binaries) libssp
+ifeq ($(with_lib64ssp),yes)
+ arch_binaries := $(arch_binaries) lib64ssp
+endif
+ifeq ($(with_lib32ssp),yes)
+ arch_binaries := $(arch_binaries) lib32ssp
+endif
+
+p_ssp = libssp$(SSP_SONAME)
+p_ssp32 = lib32ssp$(SSP_SONAME)
+p_ssp64 = lib64ssp$(SSP_SONAME)
+p_sspd = libssp$(SSP_SONAME)-dev
+
+d_ssp = debian/$(p_ssp)
+d_ssp32 = debian/$(p_ssp32)
+d_ssp64 = debian/$(p_ssp64)
+d_sspd = debian/$(p_sspd)
+
+dirs_ssp = \
+ $(docdir)/$(p_base) \
+ $(PF)/$(libdir)
+files_ssp = \
+ $(PF)/$(libdir)/libssp.so.*
+
+dirs_sspd = \
+ $(docdir) \
+ $(PF)/include \
+ $(PF)/$(libdir)
+files_sspd = \
+ $(gcc_lib_dir)/include/ssp \
+ $(PF)/$(libdir)/libssp.{a,so,la} \
+ $(PF)/$(libdir)/libssp_nonshared.{a,la}
+
+ifeq ($(with_lib32ssp),yes)
+ dirs_sspd += $(lib32)
+ files_sspd += $(lib32)/libssp.{a,la,so}
+ files_sspd += $(lib32)/libssp_nonshared.{a,la}
+endif
+ifeq ($(with_lib64ssp),yes)
+ dirs_sspd += $(PF)/lib64
+ files_sspd += $(PF)/lib64/libssp.{a,la,so}
+ files_sspd += $(PF)/lib64/libssp_nonshared.{a,la}
+endif
+
+$(binary_stamp)-libssp: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_ssp)
+ dh_installdirs -p$(p_ssp)
+
+ DH_COMPAT=2 dh_movefiles -p$(p_ssp) $(files_ssp)
+ debian/dh_doclink -p$(p_ssp) $(p_base)
+
+ debian/dh_rmemptydirs -p$(p_ssp)
+
+ dh_strip -p$(p_ssp)
+ dh_compress -p$(p_ssp)
+ dh_fixperms -p$(p_ssp)
+ dh_makeshlibs -p$(p_ssp) -V '$(p_ssp) (>= $(DEB_SOVERSION))'
+ dh_shlibdeps -p$(p_ssp)
+ dh_gencontrol -p$(p_ssp) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_ssp)
+ dh_md5sums -p$(p_ssp)
+ dh_builddeb -p$(p_ssp)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-lib64ssp: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_ssp64)
+ dh_installdirs -p$(p_ssp64) \
+ $(PF)/lib64
+ DH_COMPAT=2 dh_movefiles -p$(p_ssp64) \
+ $(PF)/lib64/libssp.so.*
+
+ debian/dh_doclink -p$(p_ssp64) $(p_base)
+
+ dh_strip -p$(p_ssp64)
+ dh_compress -p$(p_ssp64)
+ dh_fixperms -p$(p_ssp64)
+ dh_makeshlibs -p$(p_ssp64) -V '$(p_ssp64) (>= $(DEB_SOVERSION))'
+# dh_shlibdeps -p$(p_ssp64)
+ dh_gencontrol -p$(p_ssp64) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_ssp64)
+ dh_md5sums -p$(p_ssp64)
+ dh_builddeb -p$(p_ssp64)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-lib32ssp: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_ssp32)
+ dh_installdirs -p$(p_ssp32) \
+ $(lib32)
+ DH_COMPAT=2 dh_movefiles -p$(p_ssp32) \
+ $(lib32)/libssp.so.*
+
+ debian/dh_doclink -p$(p_ssp32) $(p_base)
+
+ dh_strip -p$(p_ssp32)
+ dh_compress -p$(p_ssp32)
+ dh_fixperms -p$(p_ssp32)
+ dh_makeshlibs -p$(p_ssp32) -V '$(p_ssp32) (>= $(DEB_SOVERSION))'
+# dh_shlibdeps -p$(p_ssp32)
+ dh_gencontrol -p$(p_ssp32) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_ssp32)
+ dh_md5sums -p$(p_ssp32)
+ dh_builddeb -p$(p_ssp32)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
--- gcc-4.1-4.1.1.orig/debian/rules.d/binary-gcc.mk
+++ gcc-4.1-4.1.1/debian/rules.d/binary-gcc.mk
@@ -0,0 +1,228 @@
+arch_binaries := $(arch_binaries) gcc
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ indep_binaries := $(indep_binaries) gcc-doc
+endif
+ifeq ($(with_nls),yes)
+ indep_binaries := $(indep_binaries) gcc-locales
+endif
+
+# gcc must be moved after g77 and g++
+# not all files $(PF)/include/*.h are part of gcc,
+# but it becomes difficult to name all these files ...
+
+dirs_gcc = \
+ $(docdir)/$(p_base)/{gcc,libssp} \
+ $(PF)/bin \
+ $(gcc_lexec_dir) \
+ $(gcc_lib_dir)/include \
+ $(PF)/share/man/man1 $(libdir)
+
+files_gcc = \
+ $(PF)/bin/{gcc,gcov,gccbug}$(pkg_ver) \
+ $(PF)/share/man/man1/gccbug$(pkg_ver).1 \
+ $(gcc_lexec_dir)/collect2 \
+ $(gcc_lib_dir)/{libgcc*,libgcov.a,*.o} \
+ $(gcc_lib_dir)/include/README \
+ $(gcc_lib_dir)/include/{float,iso646,limits,std*,syslimits,unwind,varargs}.h \
+ $(shell for d in asm bits gnu linux; do \
+ test -e $(d)/$(gcc_lib_dir)/include/$$d \
+ && echo $(gcc_lib_dir)/include/$$d; \
+ done) \
+ $(shell test -e $(d)/$(gcc_lib_dir)/SYSCALLS.c.X \
+ && echo $(gcc_lib_dir)/SYSCALLS.c.X) \
+ $(shell for h in {,e,p,x}mmintrin.h mm3dnow.h mm_malloc.h; do \
+ test -e $(d)/$(gcc_lib_dir)/include/$$h \
+ && echo $(gcc_lib_dir)/include/$$h; \
+ done)
+
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ files_gcc += \
+ $(PF)/share/man/man1/{gcc,gcov}$(pkg_ver).1
+endif
+
+ifeq ($(with_libssp),yes)
+ files_gcc += $(gcc_lib_dir)/include/ssp
+endif
+ifeq ($(biarch),yes)
+ files_gcc += $(gcc_lib_dir)/$(biarchsubdir)/{libgcc*,libgcov.a,*.o}
+endif
+ifeq ($(biarch32),yes)
+ files_gcc += $(gcc_lib_dir)/$(biarchsubdir)/{libgcc*,*.o}
+endif
+
+ifeq ($(DEB_HOST_ARCH),ia64)
+ files_gcc += $(gcc_lib_dir)/include/ia64intrin.h
+endif
+
+ifeq ($(DEB_HOST_ARCH),m68k)
+ files_gcc += $(gcc_lib_dir)/include/math-68881.h
+endif
+
+ifeq ($(DEB_TARGET_ARCH),$(findstring $(DEB_TARGET_ARCH),powerpc ppc64))
+ files_gcc += $(gcc_lib_dir)/include/{altivec.h,ppc-asm.h,spe.h}
+endif
+
+usr_doc_files = debian/README.Bugs \
+ $(shell test -f $(srcdir)/FAQ && echo $(srcdir)/FAQ)
+ifeq ($(with_check),yes)
+ usr_doc_files += test-summary
+endif
+
+p_loc = gcc$(pkg_ver)-locales
+d_loc = debian/$(p_loc)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-gcc: $(install_dependencies)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_gcc)
+ dh_installdirs -p$(p_gcc) $(dirs_gcc)
+
+ rm -f $(d)/$(PF)/$(libdir)/libgcc_s.so
+ ln -sf /$(libdir)/libgcc_s.so.$(GCC_SONAME) $(d)/$(gcc_lib_dir)/libgcc_s.so
+
+ifeq ($(biarch),yes)
+ rm -f $(d)/$(PF)/$(lib64)/libgcc_s.so
+ dh_link -p$(p_gcc) \
+ /$(lib64)/libgcc_s.so.$(GCC_SONAME) /$(gcc_lib_dir)/libgcc_s_64.so \
+ /$(lib64)/libgcc_s.so.$(GCC_SONAME) /$(gcc_lib_dir)/$(biarchsubdir)/libgcc_s.so
+endif
+ifeq ($(biarch32),yes)
+ mkdir -p $(d_gcc)/$(gcc_lib_dir)
+ mv $(d)/$(gcc_lib_dir)/$(biarchsubdir) $(d_gcc)/$(gcc_lib_dir)/
+ dh_link -p$(p_gcc) \
+ /$(lib32)/libgcc_s.so.$(GCC_SONAME) /$(gcc_lib_dir)/libgcc_s_32.so \
+ /$(lib32)/libgcc_s.so.$(GCC_SONAME) /$(gcc_lib_dir)/$(biarchsubdir)/libgcc_s_32.so \
+ /$(lib32)/libgcc_s.so.$(GCC_SONAME) /$(gcc_lib_dir)/$(biarchsubdir)/libgcc_s.so
+endif
+ifeq ($(with_libssp),yes)
+ mv $(d)/$(PF)/lib/libssp*.a $(d_gcc)/$(gcc_lib_dir)/
+ rm -f $(d)/$(PF)/lib/libssp*.{la,so}
+ dh_link -p$(p_gcc) \
+ /$(PF)/lib/libssp.so.$(SSP_SONAME) /$(gcc_lib_dir)/libssp.so
+ cp -p $(srcdir)/libssp/ChangeLog \
+ $(d_gcc)/$(docdir)/$(p_base)/libssp/changelog
+ ifeq ($(biarch),yes)
+ mv $(d)/$(PF)/$(lib64)/libssp*.a $(d_gcc)/$(gcc_lib_dir)/$(biarchsubdir)/
+ rm -f $(d)/$(PF)/$(lib64)/$(biarchsubdir)/libssp*.{la,so}
+ dh_link -p$(p_gcc) \
+ /$(PF)/$(lib64)/libssp.so.$(SSP_SONAME) /$(gcc_lib_dir)/$(biarchsubdir)/libssp.so
+ endif
+ ifeq ($(biarch32),yes)
+ mv $(d)/$(lib32)/libssp*.a $(d_gcc)/$(gcc_lib_dir)/$(biarchsubdir)/
+ rm -f $(d)/$(lib32)/$(biarchsubdir)/libssp*.{la,so}
+ dh_link -p$(p_gcc) \
+ /$(lib32)/libssp.so.$(SSP_SONAME) /$(gcc_lib_dir)/$(biarchsubdir)/libssp.so
+ endif
+endif
+ cp -p debian/gccbug.1 $(d)/$(PF)/share/man/man1/gccbug$(pkg_ver).1
+
+ DH_COMPAT=2 dh_movefiles -p$(p_gcc) $(files_gcc)
+
+ ln -sf gcc$(pkg_ver) \
+ $(d_gcc)/$(PF)/bin/$(DEB_TARGET_GNU_TYPE)-gcc$(pkg_ver)
+ ln -sf gcc$(pkg_ver) \
+ $(d_gcc)/$(PF)/bin/$(TARGET_ALIAS)-gcc$(pkg_ver)
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ ln -sf gcc$(pkg_ver).1 \
+ $(d_gcc)/$(PF)/share/man/man1/$(DEB_TARGET_GNU_TYPE)-gcc$(pkg_ver).1
+ ln -sf gcc$(pkg_ver).1 \
+ $(d_gcc)/$(PF)/share/man/man1/$(TARGET_ALIAS)-gcc$(pkg_ver).1
+endif
+
+# dh_installdebconf
+ debian/dh_doclink -p$(p_gcc) $(p_base)
+ cp -p $(usr_doc_files) $(d_gcc)/$(docdir)/$(p_base)/.
+ if [ -f testsuite-comparision ]; then \
+ cp -p testsuite-comparision $(d_gcc)/$(docdir)/$(p_base)/. ; \
+ fi
+ cp -p debian/NEWS.gcc $(d_gcc)/$(docdir)/$(p_base)/NEWS
+ cp -p debian/NEWS.html $(d_gcc)/$(docdir)/$(p_base)/NEWS.html
+ cp -p $(srcdir)/gcc/ChangeLog \
+ $(d_gcc)/$(docdir)/$(p_base)/gcc/changelog
+ if [ -f $(builddir)/gcc/.bad_compare ]; then \
+ ( \
+ echo "The comparision of the stage2 and stage3 object files shows differences."; \
+ echo "The Debian package was modified to ignore these differences."; \
+ echo ""; \
+ echo "The following files differ:"; \
+ echo ""; \
+ cat $(builddir)/gcc/.bad_compare; \
+ ) > $(d_gcc)/$(docdir)/$(p_base)/BOOTSTRAP_COMPARISION_FAILURE; \
+ else \
+ true; \
+ fi
+ debian/dh_rmemptydirs -p$(p_gcc)
+ dh_strip -p$(p_gcc)
+ dh_compress -p$(p_gcc) -X README.Bugs
+ dh_fixperms -p$(p_gcc)
+ dh_shlibdeps -p$(p_gcc)
+ dh_gencontrol -p$(p_gcc) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_gcc)
+ dh_md5sums -p$(p_gcc)
+ dh_builddeb -p$(p_gcc)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+ : # remove empty directories, when all components are in place
+ for d in `find $(d) -depth -type d -empty 2> /dev/null`; do \
+ while rmdir $$d 2> /dev/null; do d=`dirname $$d`; done; \
+ done
+
+ @echo "Listing installed files not included in any package:"
+ -find $(d) ! -type d
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-gcc-locales: $(install_dependencies)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_loc)
+ dh_installdirs -p$(p_loc) \
+ $(docdir)
+ DH_COMPAT=2 dh_movefiles -p$(p_loc) \
+ $(PF)/share/locale/*/*/cpplib*.* \
+ $(PF)/share/locale/*/*/gcc*.*
+
+ debian/dh_doclink -p$(p_loc) $(p_base)
+ debian/dh_rmemptydirs -p$(p_loc)
+
+ dh_compress -p$(p_loc)
+ dh_fixperms -p$(p_loc)
+ dh_installdeb -p$(p_loc)
+ dh_gencontrol -p$(p_loc) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_md5sums -p$(p_loc)
+ dh_builddeb -p$(p_loc)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-gcc-doc: $(build_html_stamp) $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_doc)
+ dh_installdirs -p$(p_doc) \
+ $(docdir)/$(p_base) \
+ $(PF)/share/info
+ DH_COMPAT=2 dh_movefiles -p$(p_doc) \
+ $(PF)/share/info/gcc*
+ rm -f $(d_doc)/$(PF)/share/info/gccinst*
+
+ debian/dh_doclink -p$(p_doc) $(p_base)
+ dh_installdocs -p$(p_doc) html/gcc.html html/gccint.html
+ rm -f $(d_doc)/$(docdir)/$(p_base)/copyright
+ debian/dh_rmemptydirs -p$(p_doc)
+
+ dh_compress -p$(p_doc)
+ dh_fixperms -p$(p_doc)
+ dh_installdeb -p$(p_doc)
+ dh_gencontrol -p$(p_doc) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_md5sums -p$(p_doc)
+ dh_builddeb -p$(p_doc)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
--- gcc-4.1-4.1.1.orig/debian/rules.d/binary-ada.mk
+++ gcc-4.1-4.1.1/debian/rules.d/binary-ada.mk
@@ -0,0 +1,275 @@
+arch_binaries := $(arch_binaries) gnatbase ada
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ indep_binaries := $(indep_binaries) ada-doc
+endif
+
+ifeq ($(with_libgnat),yes)
+ arch_binaries := $(arch_binaries) libgnat
+endif
+
+p_gbase = gnat-$(GNAT_VERSION)-base
+p_gnat = gnat-$(GNAT_VERSION)
+p_lgnat = libgnat-$(GNAT_VERSION)
+p_lgnatvsn = libgnatvsn$(GNAT_VERSION)
+p_lgnatprj = libgnatprj$(GNAT_VERSION)
+p_gnatd = $(p_gnat)-doc
+
+d_gbase = debian/$(p_gbase)
+d_gnat = debian/$(p_gnat)
+d_lgnat = debian/$(p_lgnat)
+d_lgnatvsn = debian/$(p_lgnatvsn)
+d_lgnatprj = debian/$(p_lgnatprj)
+d_gnatd = debian/$(p_gnatd)
+
+GNAT_TOOLS = gnat gnatbind gnatbl gnatchop gnatclean gnatfind gnatkr gnatlink \
+ gnatls gnatmake gnatname gnatprep gnatxref \
+ gprmake
+
+dirs_gnat = \
+ $(docdir)/$(p_base)/Ada \
+ $(PF)/bin \
+ $(PF)/share/man/man1 \
+ $(gcc_lib_dir) \
+ $(gcc_lexec_dir)
+
+files_gnat = \
+ $(gcc_lexec_dir)/gnat1 \
+ $(gcc_lib_dir)/{adalib,adainclude} \
+ $(foreach i,$(GNAT_TOOLS),$(PF)/bin/$(i))
+
+# $(foreach i,$(GNAT_TOOLS),$(PF)/bin/$(i)-$(GNAT_VERSION))
+
+dirs_lgnat = \
+ $(docdir) \
+ $(PF)/lib
+files_lgnat = \
+ $(PF)/$(libdir)/lib{gnat,gnarl}-$(GNAT_SONAME).so.1
+
+$(binary_stamp)-gnatbase: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ dh_installdocs -p$(p_gbase)
+ dh_installchangelogs -p$(p_gbase)
+ dh_compress -p$(p_gbase)
+ dh_fixperms -p$(p_gbase)
+ dh_gencontrol -p$(p_gbase) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_gbase)
+ dh_md5sums -p$(p_gbase)
+ dh_builddeb -p$(p_gbase)
+
+
+$(binary_stamp)-libgnat: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ : # libgnat
+ rm -rf $(d_lgnat)
+ dh_installdirs -p$(p_lgnat) $(dirs_lgnat)
+
+ for lib in lib{gnat,gnarl}; do \
+ vlib=$$lib-$(GNAT_SONAME); \
+ mv $(d)/$(gcc_lib_dir)/adalib/$$vlib.so.1 $(d)/$(PF)/$(libdir)/. ; \
+ rm -f $(d)/$(gcc_lib_dir)/adalib/$$lib.so.1; \
+ done
+ dh_movefiles -p$(p_lgnat) $(files_lgnat)
+
+ debian/dh_doclink -p$(p_lgnat) $(p_gbase)
+
+ debian/dh_rmemptydirs -p$(p_lgnat)
+
+ dh_strip -p$(p_lgnat)
+ dh_compress -p$(p_lgnat)
+ dh_fixperms -p$(p_lgnat)
+ b=libgnat; \
+ for ext in preinst postinst prerm postrm; do \
+ for t in '' -dev -dbg; do \
+ v=$(GNAT_VERSION); \
+ if [ -f debian/$$b$$t.$$ext ]; then \
+ cp -pf debian/$$b$$t.$$ext debian/$$b$$v$$t.$$ext; \
+ fi; \
+ done; \
+ done
+
+ dh_makeshlibs -p$(p_lgnat) -V '$(p_lgnat) (>= $(DEB_SOVERSION))'
+ cat debian/$(p_lgnat)/DEBIAN/shlibs >> debian/shlibs.local
+
+ mkdir -p $(d_lgnat)/usr/share/lintian/overrides
+ cp -p debian/$(p_lgnat).overrides \
+ $(d_lgnat)/usr/share/lintian/overrides/$(p_lgnat)
+
+ dh_shlibdeps -p$(p_lgnat)
+ dh_gencontrol -p$(p_lgnat) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_lgnat)
+ dh_md5sums -p$(p_lgnat)
+ dh_builddeb -p$(p_lgnat)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+
+
+$(binary_stamp)-libgnatvsn:
+ : # libgnatvsn-dev
+ dh_movefiles -plibgnatvsn-dev usr/lib/ada/adalib/gnatvsn
+ dh_movefiles -plibgnatvsn-dev usr/share/ada/adainclude/gnatvsn
+ dh_install -plibgnatvsn-dev \
+ debian/gnatvsn.gpr usr/share/ada/adainclude
+ dh_movefiles -plibgnatvsn-dev usr/lib/libgnatvsn.a
+ dh_link -plibgnatvsn-dev \
+ usr/lib/libgnatvsn.so.$(GNAT_VERSION) \
+ usr/lib/libgnatvsn.so
+ dh_strip -plibgnatvsn-dev -X.a
+ dh_fixperms -plibgnatvsn-dev
+ debian/dh_doclink -plibgnatvsn-dev $(p_gbase)
+ dh_gencontrol -plibgnatvsn-dev -- -v$(DEB_VERSION) $(common_substvars)
+ dh_md5sums -plibgnatvsn-dev
+ dh_builddeb -plibgnatvsn-dev
+
+ : # libgnatvsn
+ dh_movefiles -p$(p_lgnatvsn) usr/lib/libgnatvsn.so.$(GNAT_VERSION)
+ debian/dh_doclink -p$(p_lgnatvsn) $(p_gbase)
+ dh_strip -p$(p_lgnatvsn)
+ dh_makeshlibs -p$(p_lgnatvsn) -V '$(p_lgnatvsn) (>= $(DEB_SOVERSION))'
+ cat debian/$(p_lgnatvsn)/DEBIAN/shlibs >> debian/shlibs.local
+ dh_shlibdeps -p$(p_lgnatvsn)
+ dh_gencontrol -p$(p_lgnatvsn) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_lgnatvsn)
+ dh_md5sums -p$(p_lgnatvsn)
+ dh_builddeb -p$(p_lgnatvsn)
+
+ touch $@
+
+$(binary_stamp)-libgnatprj:
+ : # libgnatprj-dev
+ dh_movefiles -plibgnatprj-dev usr/lib/ada/adalib/gnatprj
+ dh_movefiles -plibgnatprj-dev usr/share/ada/adainclude/gnatprj
+ dh_install -plibgnatprj-dev \
+ debian/gnatprj.gpr usr/share/ada/adainclude
+ dh_movefiles -plibgnatprj-dev usr/lib/libgnatprj.a
+ dh_link -plibgnatprj-dev \
+ usr/lib/libgnatprj.so.$(GNAT_VERSION) \
+ usr/lib/libgnatprj.so
+ dh_strip -plibgnatprj-dev -X.a
+ dh_fixperms -plibgnatprj-dev
+ debian/dh_doclink -plibgnatprj-dev $(p_gbase)
+ dh_gencontrol -plibgnatprj-dev -- -v$(DEB_VERSION) $(common_substvars)
+ dh_md5sums -plibgnatprj-dev
+ dh_builddeb -plibgnatprj-dev
+
+ : # libgnatprj
+ dh_movefiles -p$(p_lgnatprj) usr/lib/libgnatprj.so.$(GNAT_VERSION)
+ debian/dh_doclink -p$(p_lgnatprj) $(p_gbase)
+ dh_strip -p$(p_lgnatprj)
+ dh_makeshlibs -p$(p_lgnatprj) -V '$(p_lgnatprj) (>= $(DEB_SOVERSION))'
+ cat debian/$(p_lgnatprj)/DEBIAN/shlibs >> debian/shlibs.local
+ dh_shlibdeps -p$(p_lgnatprj)
+ dh_gencontrol -p$(p_lgnatprj) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_lgnatprj)
+ dh_md5sums -p$(p_lgnatprj)
+ dh_builddeb -p$(p_lgnatprj)
+
+ touch $@
+
+ifeq ($(with_libgnat),yes)
+$(binary_stamp)-ada: $(install_stamp) $(binary_stamp)-libgnat
+$(binary_stamp)-ada: $(binary_stamp)-libgnatvsn
+$(binary_stamp)-ada: $(binary_stamp)-libgnatprj
+else
+$(binary_stamp)-ada: $(install_stamp)
+endif
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+ : # gnat
+ rm -rf $(d_gnat)
+ dh_installdirs -p$(p_gnat) $(dirs_gnat)
+ dh_movefiles -p$(p_gnat) $(files_gnat)
+
+ifeq ($(PKGSOURCE),gnat-$(BASE_VERSION))
+ mkdir -p $(d_gnat)/$(libexecdir)/gcc/$(TARGET_ALIAS)/$(NEXT_GCC_VERSION)
+ ln -sf ../$(GCC_VERSION)/gnat1 \
+ $(d_gnat)/$(libexecdir)/gcc/$(TARGET_ALIAS)/$(NEXT_GCC_VERSION)/gnat1
+ mkdir -p $(d_gnat)/$(PF)/$(libdir)/gcc/$(TARGET_ALIAS)/$(NEXT_GCC_VERSION)
+ ln -sf ../$(GCC_VERSION)/adalib \
+ $(d_gnat)/$(PF)/$(libdir)/gcc/$(TARGET_ALIAS)/$(NEXT_GCC_VERSION)/adalib
+ ln -sf ../$(GCC_VERSION)/adainclude \
+ $(d_gnat)/$(PF)/$(libdir)/gcc/$(TARGET_ALIAS)/$(NEXT_GCC_VERSION)/adainclude
+endif
+
+ifeq ($(with_libgnat),yes)
+ for lib in lib{gnat,gnarl}; do \
+ vlib=$$lib-$(GNAT_SONAME); \
+ dh_link -p$(p_gnat) \
+ /$(PF)/$(libdir)/$$vlib.so.1 /$(PF)/$(libdir)/$$vlib.so \
+ /$(PF)/$(libdir)/$$vlib.so.1 /$(PF)/$(libdir)/$$lib.so; \
+ done
+endif
+ debian/dh_doclink -p$(p_gnat) $(p_gbase)
+
+ cp -p $(srcdir)/gcc/ada/ChangeLog \
+ $(d_gnat)/$(docdir)/$(p_base)/Ada/changelog
+
+ for i in $(GNAT_TOOLS); do \
+ case "$$i" in \
+ gnat) cp -p debian/gnat.1 $(d_gnat)/$(PF)/share/man/man1/ ;; \
+ *) ln -sf gnat.1 $(d_gnat)/$(PF)/share/man/man1/$$i.1; \
+ esac; \
+ done
+
+ debian/dh_rmemptydirs -p$(p_gnat)
+
+ dh_strip -p$(p_gnat)
+ dh_compress -p$(p_gnat)
+ dh_fixperms -p$(p_gnat)
+ find $(d_gnat) -name '*.ali' | xargs chmod 444
+ dh_shlibdeps -p$(p_gnat)
+ dh_gencontrol -p$(p_gnat) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_gnat)
+ dh_md5sums -p$(p_gnat)
+ dh_builddeb -p$(p_gnat)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+
+ada_info_dir = $(d_gnatd)/$(PF)/share/info
+
+$(binary_stamp)-ada-doc: $(build_html_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_gnatd)
+ dh_installdirs -p$(p_gnatd) \
+ $(docdir)/$(p_base)/Ada \
+ $(PF)/share/info
+
+ cd $(ada_info_dir) && \
+ makeinfo -I $(srcdir)/gcc/doc/include -I $(srcdir)/gcc/ada \
+ -I $(builddir)/gcc \
+ -o gnat_ugn_unw-$(GNAT_VERSION).info \
+ $(builddir)/gcc/doc/gnat_ugn_unw.texi
+ cd $(ada_info_dir) && \
+ makeinfo -I $(srcdir)/gcc/doc/include -I $(srcdir)/gcc/ada \
+ -I $(builddir)/gcc \
+ -o gnat_rm-$(GNAT_VERSION).info \
+ $(srcdir)/gcc/ada/gnat_rm.texi
+ cd $(ada_info_dir) && \
+ makeinfo -I $(srcdir)/gcc/doc/include -I $(srcdir)/gcc/ada \
+ -I $(builddir)/gcc \
+ -o gnat-style-$(GNAT_VERSION).info \
+ $(srcdir)/gcc/ada/gnat-style.texi
+
+ debian/dh_doclink -p$(p_gnatd) $(p_gbase)
+ dh_installdocs -p$(p_gnatd)
+ rm -f $(d_gnatd)/$(docdir)/$(p_base)/copyright
+ cp -p html/gnat_ugn_unw.html html/gnat_rm.html html/gnat-style.html \
+ $(d_gnatd)/$(docdir)/$(p_base)/Ada/
+
+ dh_compress -p$(p_gnatd)
+ dh_fixperms -p$(p_gnatd)
+ dh_installdeb -p$(p_gnatd)
+ dh_gencontrol -p$(p_gnatd) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_md5sums -p$(p_gnatd)
+ dh_builddeb -p$(p_gnatd)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
--- gcc-4.1-4.1.1.orig/debian/rules.d/binary-libffi.mk
+++ gcc-4.1-4.1.1/debian/rules.d/binary-libffi.mk
@@ -0,0 +1,142 @@
+arch_binaries := $(arch_binaries) libffi
+ifeq ($(with_lib64ffi),yes)
+ arch_binaries := $(arch_binaries) lib64ffi
+endif
+ifeq ($(with_lib32ffi),yes)
+ arch_binaries := $(arch_binaries) lib32ffi
+endif
+
+p_ffi = libffi$(FFI_SONAME)
+p_l32ffi= lib32ffi$(FFI_SONAME)
+p_l64ffi= lib64ffi$(FFI_SONAME)
+p_ffid = libffi$(FFI_SONAME)-dev
+
+d_ffi = debian/$(p_ffi)
+d_l32ffi= debian/$(p_l32ffi)
+d_l64ffi= debian/$(p_l64ffi)
+d_ffid = debian/$(p_ffid)
+
+dirs_ffi = \
+ $(docdir)/$(p_ffi) \
+ $(PF)/$(libdir)
+files_ffi = \
+ $(PF)/$(libdir)/libffi.so.*
+
+dirs_ffid = \
+ $(docdir) \
+ $(PF)/include \
+ $(gcc_lib_dir)/include
+files_ffid = \
+ $(gcc_lib_dir)/include/libffi \
+ $(PF)/include/{ffi.h,ffitarget.h} \
+ $(PF)/$(libdir)/libffi.{a,so,la}
+
+ifeq ($(with_lib32ffi),yes)
+ dirs_ffid += $(lib32)
+ files_ffid += $(lib32)/libffi.{a,so,la}
+endif
+ifeq ($(with_lib64ffi),yes)
+ dirs_ffid += $(PF)/lib64
+ files_ffid += $(PF)/lib64/libffi.{a,so,la}
+endif
+
+$(binary_stamp)-libffi: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_ffi) $(d_ffid)
+ dh_installdirs -p$(p_ffi) $(dirs_ffi)
+ dh_installdirs -p$(p_ffid) $(dirs_ffid)
+
+ mv $(d)/$(gcc_lib_dir)/include/libffi/ffitarget.h $(d)/$(PF)/include/.
+
+ DH_COMPAT=2 dh_movefiles -p$(p_ffi) $(files_ffi)
+ DH_COMPAT=2 dh_movefiles -p$(p_ffid) $(files_ffid)
+
+ cp -p $(buildlibdir)/libffi/.libs/libffi_convenience.a \
+ $(d_ffid)/$(PF)/lib/libffi_pic.a
+
+ifeq ($(biarch),yes)
+ cp -p $(buildlibdir)/64/libffi/.libs/libffi_convenience.a \
+ $(d_ffid)/$(PF)/$(lib64)/libffi_pic.a
+endif
+ifeq ($(biarch32),yes)
+ cp -p $(buildlibdir)/32/libffi/.libs/libffi_convenience.a \
+ $(d_ffid)/$(lib32)/libffi_pic.a
+endif
+
+ dh_installdocs -p$(p_ffi) $(srcdir)/libffi/README
+ dh_installchangelogs -p$(p_ffi) $(srcdir)/libffi/ChangeLog
+ cp -p $(srcdir)/libffi/LICENSE $(d_ffi)/$(docdir)/$(p_ffi)/copyright
+ cp -p $(srcdir)/libffi/ChangeLog.libgcj \
+ $(d_ffi)/$(docdir)/$(p_ffi)/changelog.libgcj
+ debian/dh_doclink -p$(p_ffid) $(p_ffi)
+
+ debian/dh_rmemptydirs -p$(p_ffi)
+ debian/dh_rmemptydirs -p$(p_ffid)
+
+ dh_strip -p$(p_ffi) -p$(p_ffid)
+ dh_compress -p$(p_ffi) -p$(p_ffid)
+ dh_fixperms -p$(p_ffi) -p$(p_ffid)
+ dh_makeshlibs -p$(p_ffi) -V '$(p_ffi) (>= $(DEB_FFI_SOVERSION))'
+ dh_shlibdeps -p$(p_ffi) -p$(p_ffid)
+ dh_gencontrol -p$(p_ffi) -p$(p_ffid) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_ffi) -p$(p_ffid)
+ dh_md5sums -p$(p_ffi) -p$(p_ffid)
+ dh_builddeb -p$(p_ffi) -p$(p_ffid)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-lib64ffi: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_l64ffi)
+ dh_installdirs -p$(p_l64ffi) \
+ $(PF)/lib64
+ DH_COMPAT=2 dh_movefiles -p$(p_l64ffi) \
+ $(PF)/lib64/libffi.so.*
+
+ debian/dh_doclink -p$(p_l64ffi) $(p_base)
+
+ dh_strip -p$(p_l64ffi)
+ dh_compress -p$(p_l64ffi)
+ dh_fixperms -p$(p_l64ffi)
+ dh_makeshlibs -p$(p_l64ffi) -V '$(p_l64ffi) (>= $(DEB_SOVERSION))'
+# dh_shlibdeps -p$(p_l64ffi)
+ dh_gencontrol -p$(p_l64ffi) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_l64ffi)
+ dh_md5sums -p$(p_l64ffi)
+ dh_builddeb -p$(p_l64ffi)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-lib32ffi: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_l32ffi)
+ dh_installdirs -p$(p_l32ffi) \
+ $(lib32)
+ DH_COMPAT=2 dh_movefiles -p$(p_l32ffi) \
+ $(lib32)/libffi.so.*
+
+ debian/dh_doclink -p$(p_l32ffi) $(p_base)
+
+ dh_strip -p$(p_l32ffi)
+ dh_compress -p$(p_l32ffi)
+ dh_fixperms -p$(p_l32ffi)
+ dh_makeshlibs -p$(p_l32ffi) -V '$(p_l32ffi) (>= $(DEB_SOVERSION))'
+# dh_shlibdeps -p$(p_l32ffi)
+ dh_gencontrol -p$(p_l32ffi) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_l32ffi)
+ dh_md5sums -p$(p_l32ffi)
+ dh_builddeb -p$(p_l32ffi)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
--- gcc-4.1-4.1.1.orig/debian/rules.d/binary-java.mk
+++ gcc-4.1-4.1.1/debian/rules.d/binary-java.mk
@@ -0,0 +1,732 @@
+ifeq ($(with_separate_libgcj),yes)
+ ifeq ($(PKGSOURCE),gcj-$(BASE_VERSION))
+ arch_binaries := $(arch_binaries) jbase
+ endif
+else
+ arch_binaries := $(arch_binaries) jbase
+endif
+
+ifeq ($(with_gcj),yes)
+ arch_binaries := $(arch_binaries) gcj
+endif
+
+ifeq ($(with_libgcj),yes)
+ ifeq ($(with_java),yes)
+ arch_binaries := $(arch_binaries) java gcjapplet
+ indep_binaries := $(indep_binaries) libgcjjar
+ endif
+
+ ifeq ($(with_common_libs),yes)
+ indep_binaries := $(indep_binaries) libgcj-common
+ endif
+
+ ifeq ($(with_javadev),yes)
+ arch_binaries := $(arch_binaries) libgcjdev libgcjdbg
+ indep_binaries := $(indep_binaries) libgcjsrc libgcjdoc
+ endif
+
+ ifeq ($(with_java32),yes)
+ arch_binaries := $(arch_binaries) java32
+ endif
+endif
+
+PKG_GCJ_EXT = $(subst 0,,$(GCJ_SONAME))
+
+p_jbase = gcj$(pkg_ver)-base
+p_gcj = gcj$(pkg_ver)
+p_gij = gij$(pkg_ver)
+p_jcom = libgcj-common
+p_jlib = libgcj$(PKG_GCJ_EXT)-0
+p_jdbg = libgcj$(PKG_GCJ_EXT)-dbg
+p_jar = libgcj$(PKG_GCJ_EXT)-jar
+p_jlibx = libgcj$(PKG_GCJ_EXT)-awt
+p_jdev = libgcj$(PKG_GCJ_EXT)-dev
+p_jsrc = libgcj$(PKG_GCJ_EXT)-src
+p_view = gappletviewer$(pkg_ver)
+p_plug = gcjwebplugin$(pkg_ver)
+p_jdoc = libgcj-doc
+p_j32lib= lib32gcj$(PKG_GCJ_EXT)-0
+p_j32dev= lib32gcj$(PKG_GCJ_EXT)-dev
+p_j32dbg= lib32gcj$(PKG_GCJ_EXT)-dbg
+
+d_jbase = debian/$(p_jbase)
+d_gcj = debian/$(p_gcj)
+d_gij = debian/$(p_gij)
+d_jcom = debian/$(p_jcom)
+d_jlib = debian/$(p_jlib)
+d_jdbg = debian/$(p_jdbg)
+d_jar = debian/$(p_jar)
+d_jlibx = debian/$(p_jlibx)
+d_jdev = debian/$(p_jdev)
+d_jsrc = debian/$(p_jsrc)
+d_jdoc = debian/$(p_jdoc)
+d_view = debian/$(p_view)
+d_plug = debian/$(p_plug)
+d_j32lib= debian/$(p_j32lib)
+d_j32dev= debian/$(p_j32dev)
+d_j32dbg= debian/$(p_j32dbg)
+
+gcj_vlibdir = $(PF)/$(libdir)/gcj$(pkg_ver)
+gcj_vlib32dir = $(lib32)/gcj$(pkg_ver)
+gcj_vlib64dir = $(PF)/$(lib64)/gcj$(pkg_ver)
+
+dirs_gcj = \
+ $(docdir)/$(p_jbase) \
+ $(PF)/bin \
+ $(PF)/share/man/man1 \
+ $(PF)/share/info \
+ $(gcc_lexec_dir)
+files_gcj = \
+ $(PF)/bin/{gcj,gcjh,gjnih,jv-convert,jv-scan,jcf-dump,gjarsigner,grmic}$(pkg_ver) \
+ $(gcc_lexec_dir)/{jc1,jvgenmain}
+
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ files_gcj += \
+ $(PF)/share/info/gcj* \
+ $(PF)/share/man/man1/{gcj,gcjh,gjnih,jv-convert,jv-scan,jcf-dump,grmic}$(pkg_ver).1
+# $(PF)/share/man/man1/{gcj,gcjh,gjnih,jv-convert,jv-scan,jcf-dump,gjarsigner,grmic}$(pkg_ver).1
+endif
+
+dirs_gij = \
+ $(docdir)/$(p_jbase) \
+ $(PF)/bin \
+ $(PF)/share/man/man1 \
+ var/lib/gcj$(pkg_ver)
+
+files_gij = \
+ $(PF)/bin/{gij,gcj-dbtool,grmiregistry,gkeytool}$(pkg_ver)
+
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ files_gij += \
+ $(PF)/share/man/man1/{gij,gcj-dbtool,grmiregistry}$(pkg_ver).1
+# $(PF)/share/man/man1/{gij,gcj-dbtool,grmiregistry,gkeytool}$(pkg_ver).1
+endif
+
+dirs_jcom = \
+ $(PF)/$(libdir)
+
+files_jcom = \
+ $(PF)/lib/security
+
+dirs_jlib = \
+ $(docdir)/$(p_jbase) \
+ $(gcj_vlibdir) \
+ $(PF)/$(libdir)
+
+files_jlib = \
+ $(PF)/$(libdir)/libgij.so.* \
+ $(PF)/$(libdir)/libgcj-tools.so.* \
+ $(PF)/$(libdir)/libgcj.so.* \
+ $(gcj_vlibdir)/libjvm.so \
+
+# $(gcj_vlibdir)/libgconfpeer.so
+
+ifeq ($(with_java_alsa),yes)
+ files_jlib += \
+ $(gcj_vlibdir)/libgjsmalsa.so
+endif
+
+dirs_jar = \
+ $(PF)/share/java
+
+dirs_jlibx = \
+ $(PF)/$(libdir) \
+ $(gcj_vlibdir) \
+ $(PF)/share/java
+
+files_jlibx = \
+ $(gcj_vlibdir)/libjawt.so \
+ $(gcj_vlibdir)/libgtkpeer.so
+
+dirs_jdev = \
+ $(docdir)/$(p_jbase)/examples \
+ $(PF)/{include,lib} \
+ $(gcc_lib_dir)/include/gcj
+
+files_jdev = \
+ $(cxx_inc_dir)/{org,gcj,java,javax} \
+ $(cxx_inc_dir)/gnu/{awt,classpath,gcj,java,javax} \
+ $(gcc_lib_dir)/include/{jni.h,jni_md.h,jvmpi.h} \
+ $(gcc_lib_dir)/include/{jawt.h,jawt_md.h} \
+ $(gcc_lib_dir)/include/gcj/libgcj-config.h \
+ $(PF)/$(libdir)/libgij.{a,so} \
+ $(PF)/$(libdir)/libgcj.{a,so,spec} \
+ $(PF)/$(libdir)/libgcj-tools.{a,so} \
+ $(PF)/$(libdir)/pkgconfig/libgcj.pc
+
+ifeq ($(with_lib64gcj),yes)
+ dirs_jlib += $(gcj_vlib64dir)
+ files_jlib += \
+ $(gcj_vlib64dir)/libjawt.so \
+ $(gcj_vlib64dir)/lib*peer.so
+endif
+
+ifeq ($(with_standalone_gcj),yes)
+
+ dirs_gcj += \
+ $(gcc_lib_dir)/include \
+ $(PF)/share/man/man1
+
+ files_gcj += \
+ $(PF)/bin/{cpp,gcc,gcov}$(pkg_ver) \
+ $(gcc_lexec_dir)/cc1 \
+ $(gcc_lexec_dir)/collect2 \
+ $(gcc_lib_dir)/{libgcc*,libgcov.a,*.o} \
+ $(gcc_lib_dir)/include/README \
+ $(gcc_lib_dir)/include/{float,iso646,limits,std*,syslimits,unwind,varargs}.h \
+ $(shell for d in asm bits gnu linux; do \
+ test -e $(d)/$(gcc_lib_dir)/include/$$d \
+ && echo $(gcc_lib_dir)/include/$$d; \
+ done) \
+ $(shell test -e $(d)/$(gcc_lib_dir)/SYSCALLS.c.X \
+ && echo $(gcc_lib_dir)/SYSCALLS.c.X) \
+ $(shell for h in {,e,p,x}mmintrin.h mm3dnow.h mm_malloc.h; do \
+ test -e $(d)/$(gcc_lib_dir)/include/$$h \
+ && echo $(gcc_lib_dir)/include/$$h; \
+ done) \
+
+ ifneq ($(GFDL_INVARIANT_FREE),yes)
+ files_gcj += \
+ $(PF)/share/man/man1/{cpp,gcc,gcov}$(pkg_ver).1
+ endif
+
+ ifeq ($(biarch),yes)
+ files_gcj += $(gcc_lib_dir)/$(biarchsubdir)/{libgcc*,libgcov.a,*.o}
+ endif
+ ifeq ($(biarch32),yes)
+ files_gcj += $(gcc_lib_dir)/$(biarchsubdir)/{libgcc*,*.o}
+ endif
+
+ ifeq ($(DEB_HOST_ARCH),ia64)
+ files_gcj += $(gcc_lib_dir)/include/ia64intrin.h
+ endif
+
+ ifeq ($(DEB_HOST_ARCH),m68k)
+ files_gcj += $(gcc_lib_dir)/include/math-68881.h
+ endif
+
+ ifeq ($(DEB_TARGET_ARCH),$(findstring $(DEB_TARGET_ARCH),powerpc ppc64))
+ files_gcj += $(gcc_lib_dir)/include/{altivec.h,ppc-asm.h,spe.h}
+ endif
+
+endif
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-jbase: $(install_dependencies)
+ dh_testdir
+ dh_testroot
+ rm -rf $(d_jbase)
+ dh_installdirs -p$(p_jbase)
+ dh_installdocs -p$(p_jbase)
+ dh_installchangelogs -p$(p_jbase)
+ dh_compress -p$(p_jbase)
+ dh_fixperms -p$(p_jbase)
+ dh_gencontrol -p$(p_jbase) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_jbase)
+ dh_md5sums -p$(p_jbase)
+ dh_builddeb -p$(p_jbase)
+ touch $@
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-libgcj-common: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ dh_installdirs -p$(p_jcom) $(dirs_jcom)
+ [ -d $(d)/$(PF)/$(libdir)/security ] \
+ || mkdir -p $(d)/$(PF)/$(libdir)/security
+ [ -f $(d)/$(PF)/$(libdir)/security/classpath.security ] || \
+ cp $(srcdir)/libjava/java/security/*.security \
+ $(d)/$(PF)/$(libdir)/security/.
+ DH_COMPAT=2 dh_movefiles -p$(p_jcom) $(files_jcom)
+
+ mkdir -p $(d_jcom)/$(PF)/bin
+ install -m755 debian/rebuild-gcj-db $(d_jcom)/$(PF)/bin/
+
+ mkdir -p $(d_jcom)/$(PF)/share/gcj
+ echo "gcj_native_archs = $(gcj_native_archs)" \
+ > $(d_jcom)/$(PF)/share/gcj/debian_defaults
+
+ debian/dh_doclink -p$(p_jcom) $(p_jbase)
+ debian/dh_rmemptydirs -p$(p_jcom)
+ dh_compress -p$(p_jcom)
+ dh_fixperms -p$(p_jcom)
+ dh_gencontrol -p$(p_jcom) -- -v$(DEB_EVERSION) $(common_substvars)
+ dh_installdeb -p$(p_jcom)
+ dh_md5sums -p$(p_jcom)
+ dh_builddeb -p$(p_jcom)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-libgcjjar: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ dh_installdirs -p$(p_jar) $(dirs_jar)
+ mv $(d)/$(PF)/share/java/libgcj-$(BASE_VERSION).jar \
+ $(d_jar)/$(PF)/share/java/
+ mv $(d)/$(PF)/share/java/libgcj-tools-$(BASE_VERSION).jar \
+ $(d_jar)/$(PF)/share/java/
+# mv $(d)/$(PF)/share/java/libgcj-$(GCC_VERSION).jar \
+# $(d_jar)/$(PF)/share/java/
+# mv $(d)/$(PF)/share/java/libgcj-tools-$(GCC_VERSION).jar \
+# $(d_jar)/$(PF)/share/java/
+# ln -sf libgcj-$(GCC_VERSION).jar \
+# $(d_jar)/$(PF)/share/java/libgcj$(pkg_ver).jar
+# ln -sf libgcj-tools-$(GCC_VERSION).jar \
+# $(d_jar)/$(PF)/share/java/libgcj-tools$(pkg_ver).jar
+
+ debian/dh_doclink -p$(p_jar) $(p_jbase)
+ debian/dh_rmemptydirs -p$(p_jar)
+ dh_compress -p$(p_jar)
+ dh_fixperms -p$(p_jar)
+ dh_gencontrol -p$(p_jar) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_jar)
+ dh_md5sums -p$(p_jar)
+ dh_builddeb -p$(p_jar)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-libgcjsrc: $(install_stamp)
+ dh_testdir
+ dh_testroot
+
+ $(MAKE) -C $(buildlibdir)/libjava \
+ DESTDIR=$(PWD)/$(d) install-src.zip
+ mkdir -p $(d_jsrc)/$(PF)/share/java
+ mv $(d)/$(PF)/share/java/src-$(BASE_VERSION).zip \
+ $(d_jsrc)/$(PF)/share/java/libgcj-src-$(BASE_VERSION).zip
+# mv $(d)/$(PF)/share/java/src-$(GCC_VERSION).zip \
+# $(d_jsrc)/$(PF)/share/java/libgcj-src-$(GCC_VERSION).zip
+# ln -s libgcj-src-$(GCC_VERSION).zip \
+# $(d_jsrc)/$(PF)/share/java/libgcj-src$(pkg_ver).zip
+
+ : # add files for the classpath examples
+ cd $(srcdir)/libjava/classpath/examples && \
+ find ! -type d ! -name 'Makefile.??' ! -name '*.java' \
+ | $(builddir)/fastjar/fastjar -uvfM@ \
+ $(PWD)/$(d_jsrc)/$(PF)/share/java/libgcj-src$(pkg_ver).zip
+
+ debian/dh_doclink -p$(p_jsrc) $(p_jbase)
+ debian/dh_rmemptydirs -p$(p_jsrc)
+ dh_compress -p$(p_jsrc)
+ dh_fixperms -p$(p_jsrc)
+ dh_gencontrol -p$(p_jsrc) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_jsrc)
+ dh_md5sums -p$(p_jsrc)
+ dh_builddeb -p$(p_jsrc)
+
+ touch $@
+
+# ----------------------------------------------------------------------
+libgcj_version = $(shell $(builddir)/gcc/xgcc --version \
+ | sed -n '/GCC/s/.*(GCC) *//p')
+libgcj_title = LibGCJ Classpath
+libgcjhbox_href = http://gcc.gnu.org/java
+libgcjhbox = $(title) ($(libgcj_version))
+
+$(build_javadoc_stamp): $(build_stamp)
+ mkdir -p $(builddir)/java-src
+ cd $(builddir)/java-src && $(builddir)/fastjar/fastjar -xf \
+ $(buildlibdir)/libjava/src.zip
+
+ mkdir -p $(builddir)/html
+ gjdoc \
+ -use \
+ -sourcepath "$(builddir)/java-src" \
+ -encoding UTF-8 \
+ -breakiterator \
+ -licensetext \
+ -linksource \
+ -splitindex \
+ -d $(builddir)/html \
+ -doctitle "$(title) $(libgcj_version)" \
+ -windowtitle "$(title) $(libgcj_version) Documentation" \
+ -header "$(classpathbox)" \
+ -footer "$(classpathbox)" \
+ -subpackages gnu:java:javax:org
+
+ $(MAKE) -C $(buildlibdir)/libjava/classpath/examples
+
+ touch $@
+
+
+$(binary_stamp)-libgcjdoc: $(install_stamp) $(build_javadoc_stamp)
+ dh_testdir
+ dh_testroot
+
+ $(MAKE) -C $(buildlibdir)/libjava/classpath/examples \
+ DESTDIR=$(PWD)/$(d_jdoc) \
+ pkgdatadir=/usr/share/doc/$(p_jbase) \
+ install
+
+ dh_installdocs -p$(p_jdoc)
+ dh_installchangelogs -p$(p_jdoc)
+ mkdir -p $(d_jdoc)/usr/share/doc/$(p_jbase)
+ cp -al $(builddir)/html $(d_jdoc)/usr/share/doc/$(p_jbase)/
+ ln -sf ../$(p_jbase)/html $(d_jdoc)/usr/share/doc/$(p_jdoc)/html
+ dh_compress -p$(p_jdoc) -X.java -X.c
+ dh_fixperms -p$(p_jdoc)
+ dh_gencontrol -p$(p_jdoc) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_jdoc)
+ dh_md5sums -p$(p_jdoc)
+ dh_builddeb -p$(p_jdoc)
+
+ touch $@
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-java: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ if [ -d $(d)/$(PF)/$(libdir)/gcj-$(GCC_VERSION) ]; then \
+ ls -l $(d)/$(PF)/$(libdir)/gcj-$(GCC_VERSION); \
+ mv $(d)/$(PF)/$(libdir)/gcj-$(GCC_VERSION)/* $(d)/$(gcj_vlibdir)/; \
+ fi
+
+ dh_installdirs -p$(p_gij) $(dirs_gij)
+ dh_installdirs -p$(p_jlib) $(dirs_jlib)
+ dh_installdirs -p$(p_jlibx) $(dirs_jlibx)
+
+ DH_COMPAT=2 dh_movefiles -p$(p_gij) $(files_gij)
+ DH_COMPAT=2 dh_movefiles -p$(p_jlib) $(files_jlib)
+ DH_COMPAT=2 dh_movefiles -p$(p_jlibx) $(files_jlibx)
+
+ifeq ($(DEB_HOST_ARCH),hppa)
+ mv $(d_gij)/$(PF)/bin/gij$(pkg_ver) \
+ $(d_gij)/$(PF)/bin/gij$(pkg_ver).bin
+ install -m755 debian/gij-hppa $(d_gij)/$(PF)/bin/gij$(pkg_ver)
+endif
+
+ ln -s ../libgcj.so.$(GCJ_SONAME) \
+ $(d_jlib)/$(gcj_vlibdir)/libgcj_bc.so.1
+
+ cp -p $(srcdir)/libjava/{NEWS,README,THANKS} \
+ $(d_jlib)/usr/share/doc/$(p_jbase)/
+
+ debian/dh_doclink -p$(p_gij) $(p_jbase)
+ debian/dh_doclink -p$(p_jlib) $(p_jbase)
+ debian/dh_doclink -p$(p_jlibx) $(p_jbase)
+
+ifeq ($(with_separate_libgcj),yes)
+ ifeq ($(PKGSOURCE),gcj-$(BASE_VERSION))
+ ifeq ($(with_check),yes)
+ cp -p test-summary $(d_gij)/usr/share/doc/$(p_jbase)/test-summary
+ endif
+ endif
+endif
+ cp -p debian/gij-wrapper$(pkg_ver) $(d_gij)/$(PF)/bin/
+ chmod 755 $(d_gij)/$(PF)/bin/gij-wrapper$(pkg_ver)
+ cp -p debian/gij-wrapper$(pkg_ver).1 $(d_gij)/$(PF)/share/man/man1/
+
+ debian/dh_rmemptydirs -p$(p_gij)
+ debian/dh_rmemptydirs -p$(p_jlib)
+ debian/dh_rmemptydirs -p$(p_jlibx)
+
+ mkdir -p $(d_gij)/var/lib/gcj$(pkg_ver)
+
+ dh_makeshlibs -p$(p_jlib) -V '$(p_jlib) (>= $(DEB_GCJ_SOVERSION))'
+ cat debian/$(p_jlib)/DEBIAN/shlibs >> debian/shlibs.local
+
+ dh_makeshlibs -p$(p_jlibx) -V '$(p_jlibx) (>= $(DEB_GCJ_SOVERSION))'
+
+ cd $(d_jlibx)/$(PF)/lib/gcj$(pkg_ver) \
+ && ldd libjawt.so libgtkpeer.so
+ DH_COMPAT=5 dh_strip \
+ -p$(p_gij) -p$(p_jlib) -p$(p_jlibx) --dbg-package=$(p_jdbg)
+ cd $(d_jlibx)/$(PF)/lib/gcj$(pkg_ver) \
+ && ldd libjawt.so libgtkpeer.so
+
+ dh_compress -p$(p_gij) -p$(p_jlib) -p$(p_jlibx)
+ dh_fixperms -p$(p_gij) -p$(p_jlib) -p$(p_jlibx)
+# the libstdc++ binary packages aren't built yet ...
+ echo 'libstdc++ $(CXX_SONAME) libstdc++$(CXX_SONAME) (>= $(DEB_STDCXX_SOVERSION))' \
+ >> debian/shlibs.local
+ -[ -d $(d_l64gcc) ] && mv $(d_l64gcc) $(d_l64gcc).saved
+ dh_shlibdeps \
+ -L$(p_lgcc) \
+ -L$(p_jlib) \
+ -l:$(d)/$(PF)/$(libdir):$(d_lib)/$(PF)/$(libdir):$(d_jlib)/$(PF)/$(libdir):$(d_lgcc)/lib \
+ -p$(p_gij) -p$(p_jlib) -p$(p_jlibx)
+ -[ -d $(d_l64gcc).saved ] && mv $(d_l64gcc).saved $(d_l64gcc)
+ sed -e 's/$(p_jlib)[^,]*//' -e 's/, *,/,/' debian/$(p_jlib).substvars \
+ >> debian/$(p_jlib).substvars.tmp \
+ && mv -f debian/$(p_jlib).substvars.tmp debian/$(p_jlib).substvars
+ dh_gencontrol \
+ -p$(p_gij) -p$(p_jlib) -p$(p_jlibx) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+
+ dh_installdeb -p$(p_gij) -p$(p_jlib) -p$(p_jlibx)
+ dh_md5sums -p$(p_gij) -p$(p_jlib) -p$(p_jlibx)
+ dh_builddeb -p$(p_gij) -p$(p_jlib) -p$(p_jlibx)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-gcj: $(build_html_stamp) $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_gcj)
+ dh_installdirs -p$(p_gcj) $(dirs_gcj)
+
+ mkdir -p $(d_gcj)/usr/share/lintian/overrides
+ cp -p debian/$(p_gcj).overrides \
+ $(d_gcj)/usr/share/lintian/overrides/$(p_gcj)
+ cp -p $(srcdir)/gcc/java/ChangeLog \
+ $(d_gcj)/usr/share/doc/$(p_jbase)/changelog.gcj
+ cp -p $(srcdir)/libjava/ChangeLog \
+ $(d_gcj)/usr/share/doc/$(p_jbase)/changelog.libjava
+
+ifeq ($(with_standalone_gcj),yes)
+ rm -f $(d)/$(PF)/$(libdir)/libgcc_s.so
+ ln -sf /$(libdir)/libgcc_s.so.$(GCC_SONAME) $(d)/$(gcc_lib_dir)/libgcc_s.so
+ ifeq ($(biarch),yes)
+ rm -f $(d)/$(PF)/$(lib64)/libgcc_s.so
+ dh_link -p$(p_gcj) \
+ /$(lib64)/libgcc_s.so.$(GCC_SONAME) /$(gcc_lib_dir)/libgcc_s_64.so \
+ /$(lib64)/libgcc_s.so.$(GCC_SONAME) /$(gcc_lib_dir)/$(biarchsubdir)/libgcc_s.so
+ endif
+ ifeq ($(biarch32),yes)
+ mkdir -p $(d_gcj)/$(gcc_lib_dir)
+ mv $(d)/$(gcc_lib_dir)/$(biarchsubdir) $(d_gcj)/$(gcc_lib_dir)/
+ dh_link -p$(p_gcj) \
+ /$(lib32)/libgcc_s.so.$(GCC_SONAME) /$(gcc_lib_dir)/libgcc_s_32.so \
+ /$(lib32)/libgcc_s.so.$(GCC_SONAME) /$(gcc_lib_dir)/$(biarchsubdir)/libgcc_s_32.so \
+ /$(lib32)/libgcc_s.so.$(GCC_SONAME) /$(gcc_lib_dir)/$(biarchsubdir)/libgcc_s.so
+ endif
+endif
+ DH_COMPAT=2 dh_movefiles -p$(p_gcj) $(files_gcj)
+
+ ln -sf gcj$(pkg_ver) \
+ $(d_gcj)/$(PF)/bin/$(TARGET_ALIAS)-gcj$(pkg_ver)
+
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ ln -sf gcj$(pkg_ver).1 \
+ $(d_gcj)/$(PF)/share/man/man1/$(TARGET_ALIAS)-gcj$(pkg_ver).1
+ cp -p html/gcj.html $(d_gcj)/$(docdir)/$(p_jbase)/
+endif
+ debian/dh_doclink -p$(p_gcj) $(p_jbase)
+
+ cp -p debian/FAQ.gcj $(d_gcj)/$(docdir)/$(p_jbase)/
+
+ cp -p debian/gcj-wrapper$(pkg_ver) $(d_gcj)/$(PF)/bin/
+ chmod 755 $(d_gcj)/$(PF)/bin/gcj-wrapper$(pkg_ver)
+ cp -p debian/gcj-wrapper$(pkg_ver).1 $(d_gcj)/$(PF)/share/man/man1/
+
+ cp -p debian/gcjh-wrapper$(pkg_ver) $(d_gcj)/$(PF)/bin/
+ chmod 755 $(d_gcj)/$(PF)/bin/gcjh-wrapper$(pkg_ver)
+ cp -p debian/gcjh-wrapper$(pkg_ver).1 $(d_gcj)/$(PF)/share/man/man1/
+
+ debian/dh_rmemptydirs -p$(p_gcj)
+
+ dh_strip -p$(p_gcj)
+ dh_compress -p$(p_gcj) -X.java
+ dh_fixperms -p$(p_gcj)
+ dh_shlibdeps -p$(p_gcj)
+ dh_gencontrol -p$(p_gcj) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_gcj)
+ dh_md5sums -p$(p_gcj)
+ dh_builddeb -p$(p_gcj)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-libgcjdev: $(build_html_stamp) $(install_stamp) $(binary_stamp)-java
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ dh_installdirs -p$(p_jdev) $(dirs_jdev)
+
+ DH_COMPAT=2 dh_movefiles -p$(p_jdev) $(files_jdev)
+
+ for i in libgij libgcj libgcj-tools; do \
+ mv $(d_jdev)/$(PF)/$(libdir)/$$i.a $(d_jdev)/$(gcc_lib_dir)/; \
+ dh_link -p$(p_jdev) /$(PF)/$(libdir)/$$i.so.$(GCJ_SONAME) \
+ $(gcc_lib_dir)/$$i.so; \
+ rm -f $(d_jdev)/$(PF)/$(libdir)/$$i.{la,so}; \
+ done
+
+ mv $(d_jdev)/$(PF)/$(libdir)/pkgconfig/libgcj.pc \
+ $(d_jdev)/$(PF)/$(libdir)/pkgconfig/libgcj$(subst 0,,$(GCJ_SONAME)).pc
+
+ mv $(d_jdev)/$(PF)/$(libdir)/libgcj.spec $(d_jdev)/$(gcc_lib_dir)/
+
+ install -m 755 $(d)/$(PF)/lib/libgcj_bc.so.1 \
+ $(d_jdev)/$(gcc_lib_dir)/libgcj_bc.so
+
+ debian/dh_doclink -p$(p_jdev) $(p_jbase)
+
+ debian/dh_rmemptydirs -p$(p_jdev)
+
+ mkdir -p $(d_jdev)/usr/share/lintian/overrides
+ cp -p debian/$(p_jdev).overrides \
+ $(d_jdev)/usr/share/lintian/overrides/$(p_jdev)
+
+ DH_COMPAT=5 dh_strip -p$(p_jdev) --dbg-package=$(p_jdbg)
+ dh_compress -p$(p_jdev) -X.java
+ dh_fixperms -p$(p_jdev)
+ dh_shlibdeps \
+ -L$(p_lgcc) \
+ -l:$(d)/$(PF)/$(libdir):$(d_lib)/$(PF)/$(libdir):$(d_jlib)/$(PF)/$(libdir):$(d_lgcc)/lib \
+ -p$(p_jdev)
+ dh_gencontrol -p$(p_jdev) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_jdev)
+ dh_md5sums -p$(p_jdev)
+ dh_builddeb -p$(p_jdev)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-libgcjdbg: $(install_stamp) $(binary_stamp)-java $(binary_stamp)-libgcjdev $(binary_stamp)-gcjapplet
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ debian/dh_doclink -p$(p_jdbg) $(p_jbase)
+
+ for i in libgij libgcj libgcj-tools; do \
+ ln -sf $$i.so.$(GCJ_SONAME).0.0 \
+ $(d_jdbg)/usr/lib/debug/usr/lib/$$i.so.$(GCJ_SONAME); \
+ done
+
+ dh_compress -p$(p_jdbg)
+ dh_fixperms -p$(p_jdbg)
+ dh_gencontrol -p$(p_jdbg) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_jdbg)
+ dh_md5sums -p$(p_jdbg)
+ dh_builddeb -p$(p_jdbg)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-gcjapplet: $(install_stamp) $(binary_stamp)-java
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ dh_installdirs -p$(p_view) \
+ usr/bin
+ DH_COMPAT=2 dh_movefiles -p$(p_view) \
+ $(PF)/bin/gappletviewer$(pkg_ver)
+
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+# DH_COMPAT=2 dh_movefiles -p$(p_view) \
+# $(PF)/share/man/man1/gappletviewer$(pkg_ver).1
+endif
+
+ifeq ($(with_pkg_plugin),yes)
+ dh_installdirs -p$(p_plug) \
+ $(gcj_vlibdir) \
+ usr/lib/mozilla/plugins \
+ usr/lib/mozilla-firefox/plugins \
+ usr/lib/mozilla-snapshot/plugins
+ DH_COMPAT=2 dh_movefiles -p$(p_plug) \
+ $(gcj_vlibdir)/libgcjwebplugin.*
+else
+ DH_COMPAT=2 dh_movefiles -p$(p_view) \
+ $(gcj_vlibdir)/libgcjwebplugin.*
+endif
+
+ debian/dh_doclink -p$(p_view) $(p_jbase)
+
+ DH_COMPAT=5 dh_strip -p$(p_view) --dbg-package=$(p_jdbg)
+ dh_compress -p$(p_view)
+ dh_fixperms -p$(p_view)
+ dh_gencontrol -p$(p_view) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_view)
+ dh_md5sums -p$(p_view)
+ dh_builddeb -p$(p_view)
+
+ifeq ($(with_pkg_plugin),yes)
+ debian/dh_doclink -p$(p_plug) $(p_jbase)
+
+ DH_COMPAT=5 dh_strip -p$(p_plug) --dbg-package=$(p_jdbg)
+ dh_compress -p$(p_plug)
+ dh_fixperms -p$(p_plug)
+ dh_gencontrol -p$(p_plug) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_plug)
+ dh_md5sums -p$(p_plug)
+ dh_builddeb -p$(p_plug)
+endif
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-java32: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ if [ -d $(d)/$(lib32)/gcj-$(GCC_VERSION) ]; then \
+ mv $(d)/$(lib32)/gcj-$(GCC_VERSION)/* $(d)/$(gcj_vlib32dir)/; \
+ fi
+ rm -f $(d)/$(gcj_vlib32dir)/classmap.db
+
+ dh_installdirs -p$(p_j32lib) \
+ $(PF)/bin \
+ $(gcj_vlib32dir)
+ dh_installdirs -p$(p_j32dev) \
+ $(gcc_lib_dir)/$(biarchsubdir) \
+ $(gcj_vlib32dir)
+
+ for i in gij gcj-dbtool grmiregistry; do \
+ install -m755 debian/tmp32/usr/bin/$$i$(pkg_ver) \
+ $(d_j32lib)/$(PF)/bin/ia32-$$i$(pkg_ver); \
+ done
+
+ mv $(d)/$(lib32)/lib{gij,gcj,gcj-tools}.so.* \
+ $(d_j32lib)/$(lib32)/.
+ mv $(d)/$(gcj_vlib32dir)/lib*.so \
+ $(d_j32lib)/$(gcj_vlib32dir)/.
+
+ ln -s ../libgcj.so.$(GCJ_SONAME) \
+ $(d_j32lib)/$(gcj_vlib32dir)/libgcj_bc.so.1
+
+ for i in libgij libgcj libgcj-tools; do \
+ mv $(d)/$(lib32)/$$i.a $(d_j32dev)/$(gcc_lib_dir)/$(biarchsubdir)/; \
+ dh_link -p$(p_j32dev) /$(lib32)/$$i.so.$(GCJ_SONAME) \
+ $(gcc_lib_dir)/$(biarchsubdir)/$$i.so; \
+ rm -f $(d_j32dev)/$(lib32)/$$i.{la,so}; \
+ done
+
+ install -m 755 $(d)/$(PF)/lib/libgcj_bc.so.1 \
+ $(d_j32dev)/$(gcc_lib_dir)/$(biarchsubdir)/libgcj_bc.so
+
+ debian/dh_doclink -p$(p_j32lib) $(p_jbase)
+ debian/dh_doclink -p$(p_j32dev) $(p_jbase)
+ debian/dh_doclink -p$(p_j32dbg) $(p_jbase)
+
+ DH_COMPAT=5 dh_strip \
+ -p$(p_j32lib) -p$(p_j32dev) --dbg-package=$(p_j32dbg)
+
+ for i in libgij libgcj libgcj-tools; do \
+ ln -sf $$i.so.$(GCJ_SONAME).0.0 \
+ $(d_j32dbg)/usr/lib/debug/$(lib32)/$$i.so.$(GCJ_SONAME); \
+ done
+
+ rm -f $(gcj_vlib32dir)/classmap.db
+ mv $(d)/$(gcj_vlib32dir)/* \
+ $(d_j32dev)/$(gcj_vlib32dir)/.
+
+ debian/dh_rmemptydirs -p$(p_j32lib)
+ debian/dh_rmemptydirs -p$(p_j32dev)
+ debian/dh_rmemptydirs -p$(p_j32dbg)
+
+ dh_compress -p$(p_j32lib) -p$(p_j32dev) -p$(p_j32dbg)
+ dh_fixperms -p$(p_j32lib) -p$(p_j32dev) -p$(p_j32dbg)
+ dh_shlibdeps -p$(p_j32lib) -p$(p_j32dev) -p$(p_j32dbg)
+ dh_gencontrol -p$(p_j32lib) -p$(p_j32dev) -p$(p_j32dbg) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_j32lib) -p$(p_j32dev) -p$(p_j32dbg)
+ dh_md5sums -p$(p_j32lib) -p$(p_j32dev) -p$(p_j32dbg)
+ dh_builddeb -p$(p_j32lib) -p$(p_j32dev) -p$(p_j32dbg)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
--- gcc-4.1-4.1.1.orig/debian/patches/gcc-pfrs-2.dpatch
+++ gcc-4.1-4.1.1/debian/patches/gcc-pfrs-2.dpatch
@@ -0,0 +1,422 @@
+#! /bin/sh -e
+
+# DP: Fix a regression in the backport of PR 28946 from the trunk (H.J. Lu).
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+
+2006-09-05 H.J. Lu
+
+ * config/i386/i386.c (x86_partial_flag_reg_stall): New.
+
+ * config/i386/i386.h (x86_partial_flag_reg_stall): New.
+ (TARGET_PARTIAL_FLAG_REG_STALL): New.
+
+ * config/i386/i386.md (*ashldi3_cmp_rex64): Disabled for
+ TARGET_PARTIAL_FLAG_REG_STALL.
+ (*ashldi3_cconly_rex64): Likewise.
+ (*ashlsi3_cmp): Likewise.
+ (*ashlsi3_cconly): Likewise.
+ (*ashlsi3_cmp_zext): Likewise.
+ (*ashlhi3_cmp): Likewise.
+ (*ashlhi3_cconly): Likewise.
+ (*ashlqi3_cmp): Likewise.
+ (*ashlqi3_cconly): Likewise.
+ (*ashrdi3_cmp_rex64): Likewise.
+ (*ashrdi3_cconly_rex64): Likewise.
+ (*ashrsi3_cmp): Likewise.
+ (*ashrsi3_cconly): Likewise.
+ (*ashrsi3_cmp_zext): Likewise.
+ (*ashrhi3_cmp): Likewise.
+ (*ashrhi3_cconly): Likewise.
+ (*ashrqi3_cmp): Likewise.
+ (*ashrqi3_cconly): Likewise.
+ (*lshrdi3_cmp_rex64): Likewise.
+ (*lshrdi3_cconly_rex64): Likewise.
+ (*lshrsi3_cmp): Likewise.
+ (*lshrsi3_cconly): Likewise.
+ (*lshrsi3_cmp_zext): Likewise.
+ (*lshrhi3_cmp): Likewise.
+ (*lshrhi3_cconly): Likewise.
+ (*lshrqi2_cmp): Likewise.
+ (*lshrqi2_cconly): Likewise.
+
+Index: gcc/config/i386/i386.h
+===================================================================
+--- gcc/config/i386/i386.h (revision 116756)
++++ gcc/config/i386/i386.h (revision 116757)
+@@ -164,6 +164,7 @@ extern const int x86_use_bt;
+ extern const int x86_cmpxchg, x86_cmpxchg8b, x86_cmpxchg16b, x86_xadd;
+ extern const int x86_use_incdec;
+ extern const int x86_pad_returns;
++extern const int x86_partial_flag_reg_stall;
+ extern int x86_prefetch_sse;
+
+ #define TARGET_USE_LEAVE (x86_use_leave & TUNEMASK)
+@@ -182,6 +183,7 @@ extern int x86_prefetch_sse;
+ #define TARGET_USE_SAHF ((x86_use_sahf & TUNEMASK) && !TARGET_64BIT)
+ #define TARGET_MOVX (x86_movx & TUNEMASK)
+ #define TARGET_PARTIAL_REG_STALL (x86_partial_reg_stall & TUNEMASK)
++#define TARGET_PARTIAL_FLAG_REG_STALL (x86_partial_flag_reg_stall & TUNEMASK)
+ #define TARGET_USE_HIMODE_FIOP (x86_use_himode_fiop & TUNEMASK)
+ #define TARGET_USE_SIMODE_FIOP (x86_use_simode_fiop & TUNEMASK)
+ #define TARGET_USE_MOV0 (x86_use_mov0 & TUNEMASK)
+Index: gcc/config/i386/i386.md
+===================================================================
+--- gcc/config/i386/i386.md (revision 116756)
++++ gcc/config/i386/i386.md (revision 116757)
+@@ -10396,7 +10396,12 @@
+ (set (match_operand:DI 0 "nonimmediate_operand" "=rm")
+ (ashift:DI (match_dup 1) (match_dup 2)))]
+ "TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode)
+- && ix86_binary_operator_ok (ASHIFT, DImode, operands)"
++ && ix86_binary_operator_ok (ASHIFT, DImode, operands)
++ && (optimize_size
++ || !TARGET_PARTIAL_FLAG_REG_STALL
++ || (operands[2] == const1_rtx
++ && (TARGET_SHIFT1
++ || (TARGET_DOUBLE_WITH_ADD && REG_P (operands[0])))))"
+ {
+ switch (get_attr_type (insn))
+ {
+@@ -10432,7 +10437,12 @@
+ (const_int 0)))
+ (clobber (match_scratch:DI 0 "=r"))]
+ "TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode)
+- && ix86_binary_operator_ok (ASHIFT, DImode, operands)"
++ && ix86_binary_operator_ok (ASHIFT, DImode, operands)
++ && (optimize_size
++ || !TARGET_PARTIAL_FLAG_REG_STALL
++ || (operands[2] == const1_rtx
++ && (TARGET_SHIFT1
++ || TARGET_DOUBLE_WITH_ADD)))"
+ {
+ switch (get_attr_type (insn))
+ {
+@@ -10713,7 +10723,12 @@
+ (set (match_operand:SI 0 "nonimmediate_operand" "=rm")
+ (ashift:SI (match_dup 1) (match_dup 2)))]
+ "ix86_match_ccmode (insn, CCGOCmode)
+- && ix86_binary_operator_ok (ASHIFT, SImode, operands)"
++ && ix86_binary_operator_ok (ASHIFT, SImode, operands)
++ && (optimize_size
++ || !TARGET_PARTIAL_FLAG_REG_STALL
++ || (operands[2] == const1_rtx
++ && (TARGET_SHIFT1
++ || (TARGET_DOUBLE_WITH_ADD && REG_P (operands[0])))))"
+ {
+ switch (get_attr_type (insn))
+ {
+@@ -10749,7 +10764,12 @@
+ (const_int 0)))
+ (clobber (match_scratch:SI 0 "=r"))]
+ "ix86_match_ccmode (insn, CCGOCmode)
+- && ix86_binary_operator_ok (ASHIFT, SImode, operands)"
++ && ix86_binary_operator_ok (ASHIFT, SImode, operands)
++ && (optimize_size
++ || !TARGET_PARTIAL_FLAG_REG_STALL
++ || (operands[2] == const1_rtx
++ && (TARGET_SHIFT1
++ || TARGET_DOUBLE_WITH_ADD)))"
+ {
+ switch (get_attr_type (insn))
+ {
+@@ -10786,7 +10806,12 @@
+ (set (match_operand:DI 0 "register_operand" "=r")
+ (zero_extend:DI (ashift:SI (match_dup 1) (match_dup 2))))]
+ "TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode)
+- && ix86_binary_operator_ok (ASHIFT, SImode, operands)"
++ && ix86_binary_operator_ok (ASHIFT, SImode, operands)
++ && (optimize_size
++ || !TARGET_PARTIAL_FLAG_REG_STALL
++ || (operands[2] == const1_rtx
++ && (TARGET_SHIFT1
++ || TARGET_DOUBLE_WITH_ADD)))"
+ {
+ switch (get_attr_type (insn))
+ {
+@@ -10905,7 +10930,12 @@
+ (set (match_operand:HI 0 "nonimmediate_operand" "=rm")
+ (ashift:HI (match_dup 1) (match_dup 2)))]
+ "ix86_match_ccmode (insn, CCGOCmode)
+- && ix86_binary_operator_ok (ASHIFT, HImode, operands)"
++ && ix86_binary_operator_ok (ASHIFT, HImode, operands)
++ && (optimize_size
++ || !TARGET_PARTIAL_FLAG_REG_STALL
++ || (operands[2] == const1_rtx
++ && (TARGET_SHIFT1
++ || (TARGET_DOUBLE_WITH_ADD && REG_P (operands[0])))))"
+ {
+ switch (get_attr_type (insn))
+ {
+@@ -10941,7 +10971,12 @@
+ (const_int 0)))
+ (clobber (match_scratch:HI 0 "=r"))]
+ "ix86_match_ccmode (insn, CCGOCmode)
+- && ix86_binary_operator_ok (ASHIFT, HImode, operands)"
++ && ix86_binary_operator_ok (ASHIFT, HImode, operands)
++ && (optimize_size
++ || !TARGET_PARTIAL_FLAG_REG_STALL
++ || (operands[2] == const1_rtx
++ && (TARGET_SHIFT1
++ || TARGET_DOUBLE_WITH_ADD)))"
+ {
+ switch (get_attr_type (insn))
+ {
+@@ -11099,7 +11134,12 @@
+ (set (match_operand:QI 0 "nonimmediate_operand" "=qm")
+ (ashift:QI (match_dup 1) (match_dup 2)))]
+ "ix86_match_ccmode (insn, CCGOCmode)
+- && ix86_binary_operator_ok (ASHIFT, QImode, operands)"
++ && ix86_binary_operator_ok (ASHIFT, QImode, operands)
++ && (optimize_size
++ || !TARGET_PARTIAL_FLAG_REG_STALL
++ || (operands[2] == const1_rtx
++ && (TARGET_SHIFT1
++ || (TARGET_DOUBLE_WITH_ADD && REG_P (operands[0])))))"
+ {
+ switch (get_attr_type (insn))
+ {
+@@ -11135,7 +11175,12 @@
+ (const_int 0)))
+ (clobber (match_scratch:QI 0 "=q"))]
+ "ix86_match_ccmode (insn, CCGOCmode)
+- && ix86_binary_operator_ok (ASHIFT, QImode, operands)"
++ && ix86_binary_operator_ok (ASHIFT, QImode, operands)
++ && (optimize_size
++ || !TARGET_PARTIAL_FLAG_REG_STALL
++ || (operands[2] == const1_rtx
++ && (TARGET_SHIFT1
++ || TARGET_DOUBLE_WITH_ADD)))"
+ {
+ switch (get_attr_type (insn))
+ {
+@@ -11332,7 +11377,9 @@
+ (set (match_operand:DI 0 "nonimmediate_operand" "=rm")
+ (ashiftrt:DI (match_dup 1) (match_dup 2)))]
+ "TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode)
+- && ix86_binary_operator_ok (ASHIFTRT, DImode, operands)"
++ && ix86_binary_operator_ok (ASHIFTRT, DImode, operands)
++ && (optimize_size
++ || !TARGET_PARTIAL_FLAG_REG_STALL)"
+ "sar{q}\t{%2, %0|%0, %2}"
+ [(set_attr "type" "ishift")
+ (set_attr "mode" "DI")])
+@@ -11345,7 +11392,9 @@
+ (const_int 0)))
+ (clobber (match_scratch:DI 0 "=r"))]
+ "TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode)
+- && ix86_binary_operator_ok (ASHIFTRT, DImode, operands)"
++ && ix86_binary_operator_ok (ASHIFTRT, DImode, operands)
++ && (optimize_size
++ || !TARGET_PARTIAL_FLAG_REG_STALL)"
+ "sar{q}\t{%2, %0|%0, %2}"
+ [(set_attr "type" "ishift")
+ (set_attr "mode" "DI")])
+@@ -11579,7 +11628,9 @@
+ (set (match_operand:SI 0 "nonimmediate_operand" "=rm")
+ (ashiftrt:SI (match_dup 1) (match_dup 2)))]
+ "ix86_match_ccmode (insn, CCGOCmode)
+- && ix86_binary_operator_ok (ASHIFTRT, SImode, operands)"
++ && ix86_binary_operator_ok (ASHIFTRT, SImode, operands)
++ && (optimize_size
++ || !TARGET_PARTIAL_FLAG_REG_STALL)"
+ "sar{l}\t{%2, %0|%0, %2}"
+ [(set_attr "type" "ishift")
+ (set_attr "mode" "SI")])
+@@ -11592,7 +11643,9 @@
+ (const_int 0)))
+ (clobber (match_scratch:SI 0 "=r"))]
+ "ix86_match_ccmode (insn, CCGOCmode)
+- && ix86_binary_operator_ok (ASHIFTRT, SImode, operands)"
++ && ix86_binary_operator_ok (ASHIFTRT, SImode, operands)
++ && (optimize_size
++ || !TARGET_PARTIAL_FLAG_REG_STALL)"
+ "sar{l}\t{%2, %0|%0, %2}"
+ [(set_attr "type" "ishift")
+ (set_attr "mode" "SI")])
+@@ -11606,7 +11659,9 @@
+ (set (match_operand:DI 0 "register_operand" "=r")
+ (zero_extend:DI (ashiftrt:SI (match_dup 1) (match_dup 2))))]
+ "TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode)
+- && ix86_binary_operator_ok (ASHIFTRT, SImode, operands)"
++ && ix86_binary_operator_ok (ASHIFTRT, SImode, operands)
++ && (optimize_size
++ || !TARGET_PARTIAL_FLAG_REG_STALL)"
+ "sar{l}\t{%2, %k0|%k0, %2}"
+ [(set_attr "type" "ishift")
+ (set_attr "mode" "SI")])
+@@ -11692,7 +11747,9 @@
+ (set (match_operand:HI 0 "nonimmediate_operand" "=rm")
+ (ashiftrt:HI (match_dup 1) (match_dup 2)))]
+ "ix86_match_ccmode (insn, CCGOCmode)
+- && ix86_binary_operator_ok (ASHIFTRT, HImode, operands)"
++ && ix86_binary_operator_ok (ASHIFTRT, HImode, operands)
++ && (optimize_size
++ || !TARGET_PARTIAL_FLAG_REG_STALL)"
+ "sar{w}\t{%2, %0|%0, %2}"
+ [(set_attr "type" "ishift")
+ (set_attr "mode" "HI")])
+@@ -11705,7 +11762,9 @@
+ (const_int 0)))
+ (clobber (match_scratch:HI 0 "=r"))]
+ "ix86_match_ccmode (insn, CCGOCmode)
+- && ix86_binary_operator_ok (ASHIFTRT, HImode, operands)"
++ && ix86_binary_operator_ok (ASHIFTRT, HImode, operands)
++ && (optimize_size
++ || !TARGET_PARTIAL_FLAG_REG_STALL)"
+ "sar{w}\t{%2, %0|%0, %2}"
+ [(set_attr "type" "ishift")
+ (set_attr "mode" "HI")])
+@@ -11819,7 +11878,9 @@
+ (set (match_operand:QI 0 "nonimmediate_operand" "=qm")
+ (ashiftrt:QI (match_dup 1) (match_dup 2)))]
+ "ix86_match_ccmode (insn, CCGOCmode)
+- && ix86_binary_operator_ok (ASHIFTRT, QImode, operands)"
++ && ix86_binary_operator_ok (ASHIFTRT, QImode, operands)
++ && (optimize_size
++ || !TARGET_PARTIAL_FLAG_REG_STALL)"
+ "sar{b}\t{%2, %0|%0, %2}"
+ [(set_attr "type" "ishift")
+ (set_attr "mode" "QI")])
+@@ -11832,7 +11893,9 @@
+ (const_int 0)))
+ (clobber (match_scratch:QI 0 "=q"))]
+ "ix86_match_ccmode (insn, CCGOCmode)
+- && ix86_binary_operator_ok (ASHIFTRT, QImode, operands)"
++ && ix86_binary_operator_ok (ASHIFTRT, QImode, operands)
++ && (optimize_size
++ || !TARGET_PARTIAL_FLAG_REG_STALL)"
+ "sar{b}\t{%2, %0|%0, %2}"
+ [(set_attr "type" "ishift")
+ (set_attr "mode" "QI")])
+@@ -11976,7 +12039,9 @@
+ (set (match_operand:DI 0 "nonimmediate_operand" "=rm")
+ (lshiftrt:DI (match_dup 1) (match_dup 2)))]
+ "TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode)
+- && ix86_binary_operator_ok (LSHIFTRT, HImode, operands)"
++ && ix86_binary_operator_ok (LSHIFTRT, HImode, operands)
++ && (optimize_size
++ || !TARGET_PARTIAL_FLAG_REG_STALL)"
+ "shr{q}\t{%2, %0|%0, %2}"
+ [(set_attr "type" "ishift")
+ (set_attr "mode" "DI")])
+@@ -11989,7 +12054,9 @@
+ (const_int 0)))
+ (clobber (match_scratch:DI 0 "=r"))]
+ "TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode)
+- && ix86_binary_operator_ok (LSHIFTRT, HImode, operands)"
++ && ix86_binary_operator_ok (LSHIFTRT, HImode, operands)
++ && (optimize_size
++ || !TARGET_PARTIAL_FLAG_REG_STALL)"
+ "shr{q}\t{%2, %0|%0, %2}"
+ [(set_attr "type" "ishift")
+ (set_attr "mode" "DI")])
+@@ -12147,7 +12214,9 @@
+ (set (match_operand:SI 0 "nonimmediate_operand" "=rm")
+ (lshiftrt:SI (match_dup 1) (match_dup 2)))]
+ "ix86_match_ccmode (insn, CCGOCmode)
+- && ix86_binary_operator_ok (LSHIFTRT, HImode, operands)"
++ && ix86_binary_operator_ok (LSHIFTRT, HImode, operands)
++ && (optimize_size
++ || !TARGET_PARTIAL_FLAG_REG_STALL)"
+ "shr{l}\t{%2, %0|%0, %2}"
+ [(set_attr "type" "ishift")
+ (set_attr "mode" "SI")])
+@@ -12160,7 +12229,9 @@
+ (const_int 0)))
+ (clobber (match_scratch:SI 0 "=r"))]
+ "ix86_match_ccmode (insn, CCGOCmode)
+- && ix86_binary_operator_ok (LSHIFTRT, HImode, operands)"
++ && ix86_binary_operator_ok (LSHIFTRT, HImode, operands)
++ && (optimize_size
++ || !TARGET_PARTIAL_FLAG_REG_STALL)"
+ "shr{l}\t{%2, %0|%0, %2}"
+ [(set_attr "type" "ishift")
+ (set_attr "mode" "SI")])
+@@ -12174,7 +12245,9 @@
+ (set (match_operand:DI 0 "register_operand" "=r")
+ (lshiftrt:DI (zero_extend:DI (match_dup 1)) (match_dup 2)))]
+ "TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode)
+- && ix86_binary_operator_ok (LSHIFTRT, HImode, operands)"
++ && ix86_binary_operator_ok (LSHIFTRT, HImode, operands)
++ && (optimize_size
++ || !TARGET_PARTIAL_FLAG_REG_STALL)"
+ "shr{l}\t{%2, %k0|%k0, %2}"
+ [(set_attr "type" "ishift")
+ (set_attr "mode" "SI")])
+@@ -12260,7 +12333,9 @@
+ (set (match_operand:HI 0 "nonimmediate_operand" "=rm")
+ (lshiftrt:HI (match_dup 1) (match_dup 2)))]
+ "ix86_match_ccmode (insn, CCGOCmode)
+- && ix86_binary_operator_ok (LSHIFTRT, HImode, operands)"
++ && ix86_binary_operator_ok (LSHIFTRT, HImode, operands)
++ && (optimize_size
++ || !TARGET_PARTIAL_FLAG_REG_STALL)"
+ "shr{w}\t{%2, %0|%0, %2}"
+ [(set_attr "type" "ishift")
+ (set_attr "mode" "HI")])
+@@ -12273,7 +12348,9 @@
+ (const_int 0)))
+ (clobber (match_scratch:HI 0 "=r"))]
+ "ix86_match_ccmode (insn, CCGOCmode)
+- && ix86_binary_operator_ok (LSHIFTRT, HImode, operands)"
++ && ix86_binary_operator_ok (LSHIFTRT, HImode, operands)
++ && (optimize_size
++ || !TARGET_PARTIAL_FLAG_REG_STALL)"
+ "shr{w}\t{%2, %0|%0, %2}"
+ [(set_attr "type" "ishift")
+ (set_attr "mode" "HI")])
+@@ -12386,7 +12463,9 @@
+ (set (match_operand:QI 0 "nonimmediate_operand" "=qm")
+ (lshiftrt:QI (match_dup 1) (match_dup 2)))]
+ "ix86_match_ccmode (insn, CCGOCmode)
+- && ix86_binary_operator_ok (LSHIFTRT, QImode, operands)"
++ && ix86_binary_operator_ok (LSHIFTRT, QImode, operands)
++ && (optimize_size
++ || !TARGET_PARTIAL_FLAG_REG_STALL)"
+ "shr{b}\t{%2, %0|%0, %2}"
+ [(set_attr "type" "ishift")
+ (set_attr "mode" "QI")])
+@@ -12399,7 +12478,9 @@
+ (const_int 0)))
+ (clobber (match_scratch:QI 0 "=q"))]
+ "ix86_match_ccmode (insn, CCGOCmode)
+- && ix86_binary_operator_ok (LSHIFTRT, QImode, operands)"
++ && ix86_binary_operator_ok (LSHIFTRT, QImode, operands)
++ && (optimize_size
++ || !TARGET_PARTIAL_FLAG_REG_STALL)"
+ "shr{b}\t{%2, %0|%0, %2}"
+ [(set_attr "type" "ishift")
+ (set_attr "mode" "QI")])
+Index: gcc/config/i386/i386.c
+===================================================================
+--- gcc/config/i386/i386.c (revision 116756)
++++ gcc/config/i386/i386.c (revision 116757)
+@@ -761,6 +761,7 @@ const int x86_use_sahf = m_PPRO | m_K6 |
+ with partial reg. dependencies used by Athlon/P4 based chips, it is better
+ to leave it off for generic32 for now. */
+ const int x86_partial_reg_stall = m_PPRO;
++const int x86_partial_flag_reg_stall = m_GENERIC;
+ const int x86_use_himode_fiop = m_386 | m_486 | m_K6;
+ const int x86_use_simode_fiop = ~(m_PPRO | m_ATHLON_K8 | m_PENT | m_GENERIC);
+ const int x86_use_mov0 = m_K6;
--- gcc-4.1-4.1.1.orig/debian/patches/disable-biarch-check.dpatch
+++ gcc-4.1-4.1.1/debian/patches/disable-biarch-check.dpatch
@@ -0,0 +1,44 @@
+#! /bin/sh -e
+
+# DP: For biarch builds, disable the testsuite for the non-default architecture
+# DP: for runtime libraries, which are not built by default (libjava).
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+--- libjava/testsuite/Makefile.in~ 2005-09-29 23:53:39.213898000 +0200
++++ libjava/testsuite/Makefile.in 2005-09-29 23:55:33.382541760 +0200
+@@ -346,12 +346,14 @@
+
+
+ check-DEJAGNU: site.exp
++ runtestflags="`echo '$(RUNTESTFLAGS)' | sed 's/,-m[36][24]//'`"; \
++ case "$$runtestflags" in *\\{\\}) runtestflags=; esac; \
+ srcdir=`$(am__cd) $(srcdir) && pwd`; export srcdir; \
+ EXPECT=$(EXPECT); export EXPECT; \
+ runtest=$(RUNTEST); \
+ if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
+ l='$(DEJATOOL)'; for tool in $$l; do \
+- $$runtest $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \
++ $$runtest $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) $$runtestflags; \
+ done; \
+ else echo "WARNING: could not find \`runtest'" 1>&2; :;\
+ fi
--- gcc-4.1-4.1.1.orig/debian/patches/pr29198.dpatch
+++ gcc-4.1-4.1.1/debian/patches/pr29198.dpatch
@@ -0,0 +1,119 @@
+#! /bin/sh -e
+
+# DP: Fix PR target/29198, taken from the gcc-4_1-branch.
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+
+2006-10-06 Jakub Jelinek
+
+ PR target/29198
+ * config/i386/i386.c (legitimize_pic_address): Reject TLS symbols.
+ * config/i386/predicates.md (local_symbolic_operand): Likewise.
+
+2006-10-06 Jakub Jelinek
+
+ PR target/29198
+ * gcc.dg/tls/opt-12.c: New test.
+
+Index: gcc/testsuite/gcc.dg/tls/opt-12.c
+===================================================================
+--- gcc/testsuite/gcc.dg/tls/opt-12.c (revision 0)
++++ gcc/testsuite/gcc.dg/tls/opt-12.c (revision 117486)
+@@ -0,0 +1,50 @@
++/* PR target/29198 */
++/* { dg-do run } */
++/* { dg-options "-O2 -fpic" } */
++/* { dg-require-effective-target tls_runtime } */
++/* { dg-require-effective-target fpic } */
++
++extern void abort (void);
++
++int f2 (int, int, int, int);
++struct s { char b[4]; };
++__thread struct s thra[2];
++
++void
++__attribute__((noinline))
++f1 (int a1, int a2)
++{
++ int i, j;
++ for (i = 0; i < 4; i++)
++ {
++ int tot = 0;
++ for (j = 0; j < 4; j++)
++ tot += f2 (a1, a2, i, j);
++ *(&thra[0].b[0] + i) = tot;
++ }
++}
++
++int
++__attribute__((noinline))
++f2 (int a, int b, int c, int d)
++{
++ return a + b + c + d;
++}
++
++int
++main (void)
++{
++ f1 (0, 0);
++ if (thra[0].b[0] != 6
++ || thra[0].b[1] != 10
++ || thra[0].b[2] != 14
++ || thra[0].b[3] != 18)
++ abort ();
++ f1 (2, 3);
++ if (thra[0].b[0] != 26
++ || thra[0].b[1] != 30
++ || thra[0].b[2] != 34
++ || thra[0].b[3] != 38)
++ abort ();
++ return 0;
++}
+Index: gcc/config/i386/predicates.md
+===================================================================
+--- gcc/config/i386/predicates.md (revision 117485)
++++ gcc/config/i386/predicates.md (revision 117486)
+@@ -442,6 +442,9 @@
+ if (GET_CODE (op) != SYMBOL_REF)
+ return 0;
+
++ if (SYMBOL_REF_TLS_MODEL (op) != 0)
++ return 0;
++
+ if (SYMBOL_REF_LOCAL_P (op))
+ return 1;
+
+Index: gcc/config/i386/i386.c
+===================================================================
+--- gcc/config/i386/i386.c (revision 117485)
++++ gcc/config/i386/i386.c (revision 117486)
+@@ -6151,7 +6151,7 @@
+ new = reg;
+ }
+ }
+- else if (GET_CODE (addr) == SYMBOL_REF)
++ else if (GET_CODE (addr) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (addr) == 0)
+ {
+ if (TARGET_64BIT)
+ {
--- gcc-4.1-4.1.1.orig/debian/patches/mips-libjava-interp.dpatch
+++ gcc-4.1-4.1.1/debian/patches/mips-libjava-interp.dpatch
@@ -0,0 +1,39 @@
+#! /bin/sh -e
+
+# DP: Enable the libjava interpreter on mips/mipsel.
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ #cd ${dir}gcc && autoconf
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ #rm ${dir}gcc/configure
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+--- libjava/configure.host~ 2006-04-22 01:59:20.293222320 +0200
++++ libjava/configure.host 2006-04-22 02:02:17.173332456 +0200
+@@ -90,6 +90,9 @@
+ enable_java_net_default=no
+ enable_getenv_properties_default=no
+ ;;
++ mips*-linux*)
++ libgcj_interpreter=yes
++ ;;
+ i686-*|i586-*|i486-*|i386-*)
+ sysdeps_dir=i386
+ # With -fomit-frame-pointer -maccumulate-outgoing-args (implied),
--- gcc-4.1-4.1.1.orig/debian/patches/m68k-save_pic.dpatch
+++ gcc-4.1-4.1.1/debian/patches/m68k-save_pic.dpatch
@@ -0,0 +1,51 @@
+#! /bin/sh -e
+
+# All lines beginning with `# DPATCH:' are a description of the patch.
+# DP: gcc/config/m68k/m68k.c:
+# DP: correctly save the pic register, when not done by reload()
+# DP: (fixes _Unwind_RaiseException and thus exception handling)
+# DP: fixes 345574
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p1 < $0
+ #cd ${dir}gcc && autoconf
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p1 < $0
+ #rm ${dir}gcc/configure
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+# append the patch here and adjust the -p? flag in the patch calls.
+
+---
+ gcc/config/m68k/m68k.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+Index: gcc-4.1/gcc/config/m68k/m68k.c
+===================================================================
+--- gcc-4.1.orig/gcc/config/m68k/m68k.c
++++ gcc-4.1/gcc/config/m68k/m68k.c
+@@ -466,7 +466,8 @@ m68k_save_reg (unsigned int regno, bool
+ {
+ if (flag_pic && regno == PIC_OFFSET_TABLE_REGNUM)
+ {
+- if (current_function_uses_pic_offset_table)
++ if (current_function_uses_pic_offset_table ||
++ current_function_has_nonlocal_label)
+ return true;
+ if (!current_function_is_leaf && TARGET_ID_SHARED_LIBRARY)
+ return true;
--- gcc-4.1-4.1.1.orig/debian/patches/ppc64-ada.dpatch
+++ gcc-4.1-4.1.1/debian/patches/ppc64-ada.dpatch
@@ -0,0 +1,257 @@
+#! /bin/sh -e
+
+# DP: Add gcc/ada/system-linux-ppc64.ads and use it in gcc/ada/Makefile.in
+# DP:
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p1 < $0
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p1 < $0
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+diff -urN src.orig/gcc/ada/Makefile.in src/gcc/ada/Makefile.in
+--- src.orig/gcc/ada/Makefile.in 2005-05-02 16:39:32.000000000 +0200
++++ src/gcc/ada/Makefile.in 2005-05-02 16:36:37.000000000 +0200
+@@ -1346,6 +1346,31 @@
+ LIBRARY_VERSION := $(LIB_VERSION)
+ endif
+
++ifeq ($(strip $(filter-out powerpc64% linux%,$(arch) $(osys))),)
++ LIBGNAT_TARGET_PAIRS = \
++ a-intnam.ads" (Left, Right : Address) return Boolean;
++ function ">=" (Left, Right : Address) return Boolean;
++ function "=" (Left, Right : Address) return Boolean;
++
++ pragma Import (Intrinsic, "<");
++ pragma Import (Intrinsic, "<=");
++ pragma Import (Intrinsic, ">");
++ pragma Import (Intrinsic, ">=");
++ pragma Import (Intrinsic, "=");
++
++ -- Other System-Dependent Declarations
++
++ type Bit_Order is (High_Order_First, Low_Order_First);
++ Default_Bit_Order : constant Bit_Order := High_Order_First;
++
++ -- Priority-related Declarations (RM D.1)
++
++ Max_Priority : constant Positive := 30;
++ Max_Interrupt_Priority : constant Positive := 31;
++
++ subtype Any_Priority is Integer range 0 .. 31;
++ subtype Priority is Any_Priority range 0 .. 30;
++ subtype Interrupt_Priority is Any_Priority range 31 .. 31;
++
++ Default_Priority : constant Priority := 15;
++
++private
++
++ type Address is mod Memory_Size;
++ Null_Address : constant Address := 0;
++
++ --------------------------------------
++ -- System Implementation Parameters --
++ --------------------------------------
++
++ -- These parameters provide information about the target that is used
++ -- by the compiler. They are in the private part of System, where they
++ -- can be accessed using the special circuitry in the Targparm unit
++ -- whose source should be consulted for more detailed descriptions
++ -- of the individual switch values.
++
++ AAMP : constant Boolean := False;
++ Backend_Divide_Checks : constant Boolean := False;
++ Backend_Overflow_Checks : constant Boolean := False;
++ Command_Line_Args : constant Boolean := True;
++ Configurable_Run_Time : constant Boolean := False;
++ Denorm : constant Boolean := True;
++ Duration_32_Bits : constant Boolean := False;
++ Exit_Status_Supported : constant Boolean := True;
++ Fractional_Fixed_Ops : constant Boolean := False;
++ Frontend_Layout : constant Boolean := False;
++ Functions_Return_By_DSP : constant Boolean := False;
++ Machine_Overflows : constant Boolean := False;
++ Machine_Rounds : constant Boolean := True;
++ OpenVMS : constant Boolean := False;
++ Preallocated_Stacks : constant Boolean := False;
++ Signed_Zeros : constant Boolean := True;
++ Stack_Check_Default : constant Boolean := False;
++ Stack_Check_Probes : constant Boolean := False;
++ Support_64_Bit_Divides : constant Boolean := True;
++ Support_Aggregates : constant Boolean := True;
++ Support_Composite_Assign : constant Boolean := True;
++ Support_Composite_Compare : constant Boolean := True;
++ Support_Long_Shifts : constant Boolean := True;
++ Suppress_Standard_Library : constant Boolean := False;
++ Use_Ada_Main_Program_Name : constant Boolean := False;
++ ZCX_By_Default : constant Boolean := True;
++ GCC_ZCX_Support : constant Boolean := True;
++ Front_End_ZCX_Support : constant Boolean := False;
++
++ -- Obsolete entries, to be removed eventually (bootstrap issues!)
++
++ High_Integrity_Mode : constant Boolean := False;
++ Long_Shifts_Inlined : constant Boolean := True;
++
++end System;
+diff -urN tmp/gcc/ada/s-auxdec.ads src/gcc/ada/s-auxdec.ads
+--- tmp/gcc/ada/s-auxdec.ads 2004-06-11 12:47:36.000000000 +0200
++++ src/gcc/ada/s-auxdec.ads 2005-05-03 11:34:17.000000000 +0200
+@@ -108,13 +108,13 @@
+ pragma Warnings (Off);
+
+ type F_Float is digits 6;
+- pragma Float_Representation (VAX_Float, F_Float);
++-- pragma Float_Representation (VAX_Float, F_Float);
+
+ type D_Float is digits 9;
+- pragma Float_Representation (Vax_Float, D_Float);
++-- pragma Float_Representation (Vax_Float, D_Float);
+
+ type G_Float is digits 15;
+- pragma Float_Representation (Vax_Float, G_Float);
++-- pragma Float_Representation (Vax_Float, G_Float);
+
+ -- Floating point type declarations for IEEE floating point data types
+
+--- tmp/gcc/ada/s-vaflop.ads 2003-10-21 15:42:18.000000000 +0200
++++ src/gcc/ada/s-vaflop.ads 2005-05-03 15:24:24.000000000 +0200
+@@ -40,15 +40,15 @@
+ -- Suppress warnings if not on Alpha/VAX
+
+ type D is digits 9;
+- pragma Float_Representation (VAX_Float, D);
++-- pragma Float_Representation (VAX_Float, D);
+ -- D Float type on Vax
+
+ type G is digits 15;
+- pragma Float_Representation (VAX_Float, G);
++-- pragma Float_Representation (VAX_Float, G);
+ -- G Float type on Vax
+
+ type F is digits 6;
+- pragma Float_Representation (VAX_Float, F);
++-- pragma Float_Representation (VAX_Float, F);
+ -- F Float type on Vax
+
+ type S is digits 6;
--- gcc-4.1-4.1.1.orig/debian/patches/m68k-dwarf.dpatch
+++ gcc-4.1-4.1.1/debian/patches/m68k-dwarf.dpatch
@@ -0,0 +1,76 @@
+#! /bin/sh -e
+
+# All lines beginning with `# DPATCH:' are a description of the patch.
+# DP: correct the dwarf frame information, but preserve compatibility
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p1 < $0
+ #cd ${dir}gcc && autoconf
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p1 < $0
+ #rm ${dir}gcc/configure
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+# append the patch here and adjust the -p? flag in the patch calls.
+
+---
+ gcc/config/m68k/m68k.c | 4 ++++
+ gcc/config/m68k/m68k.h | 9 ++++++++-
+ 2 files changed, 12 insertions(+), 1 deletion(-)
+
+Index: gcc-4.1/gcc/config/m68k/m68k.c
+===================================================================
+--- gcc-4.1.orig/gcc/config/m68k/m68k.c
++++ gcc-4.1/gcc/config/m68k/m68k.c
+@@ -3390,5 +3390,9 @@ m68k_regno_mode_ok (int regno, enum mach
+ && GET_MODE_UNIT_SIZE (mode) <= 12)
+ return true;
+ }
++ else if (regno == 24)
++ {
++ return GET_MODE_SIZE (mode) == 4;
++ }
+ return false;
+ }
+Index: gcc-4.1/gcc/config/m68k/m68k.h
+===================================================================
+--- gcc-4.1.orig/gcc/config/m68k/m68k.h
++++ gcc-4.1/gcc/config/m68k/m68k.h
+@@ -174,6 +174,13 @@ Boston, MA 02110-1301, USA. */
+ register elimination. */
+ #define FIRST_PSEUDO_REGISTER 25
+
++/* Number of hardware registers that go into the DWARF-2 unwind info. This
++ should be 24, but to prevent compability problems leave it at 25. */
++#define DWARF_FRAME_REGISTERS 25
++
++#define DWARF_FRAME_RETURN_COLUMN 24
++#define DWARF_ALT_FRAME_RETURN_COLUMN 25
++
+ /* All m68k targets (except AmigaOS) use %a5 as the PIC register */
+ #define PIC_OFFSET_TABLE_REGNUM (flag_pic ? 13 : INVALID_REGNUM)
+
+@@ -251,7 +258,7 @@ Boston, MA 02110-1301, USA. */
+ for the 68881 registers, a single register is always enough for
+ anything that can be stored in them at all. */
+ #define HARD_REGNO_NREGS(REGNO, MODE) \
+- ((REGNO) >= 16 ? GET_MODE_NUNITS (MODE) \
++ ((REGNO) >= 16 && (REGNO) <= 23 ? GET_MODE_NUNITS (MODE) \
+ : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
+
+ /* A C expression that is nonzero if hard register NEW_REG can be
--- gcc-4.1-4.1.1.orig/debian/patches/link-libs.dpatch
+++ gcc-4.1-4.1.1/debian/patches/link-libs.dpatch
@@ -0,0 +1,157 @@
+#! /bin/sh -e
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+--- gcc/config/t-slibgcc-elf-ver.orig 2005-09-05 00:10:57.095357312 +0000
++++ gcc/config/t-slibgcc-elf-ver 2005-09-05 00:11:37.932149176 +0000
+@@ -14,6 +14,7 @@
+ SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
+ -Wl,--soname=$(SHLIB_SONAME) \
+ -Wl,--version-script=$(SHLIB_MAP) \
++ -Wl,-O1 \
+ -o $(SHLIB_DIR)/$(SHLIB_SONAME).tmp @multilib_flags@ \
+ $(SHLIB_OBJS) $(SHLIB_LC) && \
+ rm -f $(SHLIB_DIR)/$(SHLIB_SOLINK) && \
+--- libobjc/Makefile.in.orig 2005-09-05 00:10:57.091357920 +0000
++++ libobjc/Makefile.in 2005-09-05 00:15:00.266389696 +0000
+@@ -273,11 +273,13 @@
+ libobjc$(libext).la: $(OBJS)
+ $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS) \
+ -rpath $(toolexeclibdir) \
++ -Wl,-O1 \
+ -version-info $(LIBOBJC_VERSION) $(extra_ldflags_libobjc)
+
+ libobjc_gc$(libext).la: $(OBJS_GC)
+ $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS_GC) \
+ -rpath $(toolexeclibdir) \
++ -Wl,-O1 \
+ -version-info $(LIBOBJC_GC_VERSION) $(extra_ldflags_libobjc)
+
+ #
+--- libffi/Makefile.am.orig 2005-09-05 00:10:57.077360048 +0000
++++ libffi/Makefile.am 2005-09-05 00:11:37.877157536 +0000
+@@ -150,7 +150,7 @@
+
+ AM_CFLAGS = -Wall -g -fexceptions
+
+-libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
++libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` -Wl,-O1
+
+ AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
+ AM_CCASFLAGS = $(AM_CPPFLAGS)
+--- libffi/Makefile.in.orig 2005-09-05 00:10:57.095357312 +0000
++++ libffi/Makefile.in 2005-09-05 00:11:37.932149176 +0000
+@@ -416,7 +416,7 @@
+ libffi_convenience_la_SOURCES = $(libffi_la_SOURCES)
+ nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
+ AM_CFLAGS = -Wall -g -fexceptions
+-libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
++libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` -Wl,-O1
+ AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
+ AM_CCASFLAGS = $(AM_CPPFLAGS)
+ all: fficonfig.h
+--- libgfortran/Makefile.am.orig 2005-08-11 18:01:02.000000000 +0000
++++ libgfortran/Makefile.am 2005-09-05 00:17:34.659918312 +0000
+@@ -8,7 +8,7 @@
+
+ toolexeclib_LTLIBRARIES = libgfortran.la libgfortranbegin.la
+
+-libgfortran_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` -lm $(extra_ldflags_libgfortran)
++libgfortran_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` -lm $(extra_ldflags_libgfortran) -Wl,-O1
+
+ ## This should really go in the compiler lib dir, not the system lib dir.
+ libgfortranbegin_la_SOURCES = fmain.c
+--- libgfortran/Makefile.in.orig 2005-09-03 09:44:48.000000000 +0000
++++ libgfortran/Makefile.in 2005-09-05 00:18:05.382247808 +0000
+@@ -309,7 +309,7 @@
+ ACLOCAL_AMFLAGS = -I ../config
+ gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
+ toolexeclib_LTLIBRARIES = libgfortran.la libgfortranbegin.la
+-libgfortran_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` -lm $(extra_ldflags_libgfortran)
++libgfortran_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` -lm $(extra_ldflags_libgfortran) -Wl,-O1
+ libgfortranbegin_la_SOURCES = fmain.c
+ libgfortranbegin_la_LDFLAGS = -static
+ AM_CPPFLAGS = -iquote$(srcdir)/io
+--- libjava/Makefile.am.orig 2005-09-05 00:10:57.078359896 +0000
++++ libjava/Makefile.am 2005-09-05 00:13:11.509923192 +0000
+@@ -96,7 +96,7 @@
+ GCJLINK = $(LIBTOOL) --tag=GCJ --mode=link $(GCJ) -L$(here) $(JC1FLAGS) \
+ $(LDFLAGS) -o $@
+ LIBLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXX) -L$(here) $(JC1FLAGS) \
+- $(LDFLAGS) $(extra_ldflags_libjava) -o $@
++ $(LDFLAGS) $(extra_ldflags_libjava) -Wl,-O1 -o $@
+
+ GCC_UNWIND_INCLUDE = @GCC_UNWIND_INCLUDE@
+
+--- libjava/Makefile.in.orig 2005-09-05 00:10:57.089358224 +0000
++++ libjava/Makefile.in 2005-09-05 00:13:57.763891520 +0000
+@@ -647,7 +647,7 @@
+ $(LDFLAGS) -o $@
+
+ LIBLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXX) -L$(here) $(JC1FLAGS) \
+- $(LDFLAGS) $(extra_ldflags_libjava) -o $@
++ $(LDFLAGS) $(extra_ldflags_libjava) -Wl,-O1 -o $@
+
+ WARNINGS = -Wextra -Wall
+ AM_CXXFLAGS = \
+--- libmudflap/Makefile.am.orig 2005-06-15 00:47:03.000000000 +0000
++++ libmudflap/Makefile.am 2005-09-05 00:19:21.098737152 +0000
+@@ -32,7 +32,7 @@
+ mf-hooks2.c
+ libmudflap_la_LIBADD =
+ libmudflap_la_DEPENDENCIES = $(libmudflap_la_LIBADD)
+-libmudflap_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
++libmudflap_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` -Wl,-O1
+
+ clean-local:
+ rm -f pth/*.o pth/*.lo
+--- libmudflap/Makefile.in.orig 2005-07-17 20:52:57.000000000 +0000
++++ libmudflap/Makefile.in 2005-09-05 00:19:42.890424312 +0000
+@@ -238,7 +238,7 @@
+
+ libmudflap_la_LIBADD =
+ libmudflap_la_DEPENDENCIES = $(libmudflap_la_LIBADD)
+-libmudflap_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
++libmudflap_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` -Wl,-O1
+ libmudflapth_la_SOURCES =
+ libmudflapth_la_LIBADD = \
+ pth/mf-runtime.lo \
+--- libstdc++-v3/src/Makefile.am.orig 2005-09-05 00:10:57.091357920 +0000
++++ libstdc++-v3/src/Makefile.am 2005-09-05 00:11:37.931149328 +0000
+@@ -167,6 +167,7 @@
+ libstdc___la_DEPENDENCIES = ${version_dep} $(libstdc___la_LIBADD)
+
+ libstdc___la_LDFLAGS = \
++ -Wl,-O1 \
+ -version-info $(libtool_VERSION) ${version_arg} -lm
+
+
+--- libstdc++-v3/src/Makefile.in.orig 2005-09-05 00:10:57.094357464 +0000
++++ libstdc++-v3/src/Makefile.in 2005-09-05 00:11:37.931149328 +0000
+@@ -360,6 +360,7 @@
+
+ libstdc___la_DEPENDENCIES = ${version_dep} $(libstdc___la_LIBADD)
+ libstdc___la_LDFLAGS = \
++ -Wl,-O1 \
+ -version-info $(libtool_VERSION) ${version_arg} -lm
+
+
--- gcc-4.1-4.1.1.orig/debian/patches/libjava-backport2.dpatch
+++ gcc-4.1-4.1.1/debian/patches/libjava-backport2.dpatch
@@ -0,0 +1,2266 @@
+#! /bin/sh -e
+
+# DP: updates from the redhat/gcc-4_1-branch for the libjava backport
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+
+Index: gcc/java/jcf-write.c
+===================================================================
+--- gcc/java/jcf-write.c (revision 117035)
++++ gcc/java/jcf-write.c (revision 117036)
+@@ -2651,10 +2651,14 @@
+ if (TREE_CODE (f) != VOID_TYPE)
+ {
+ int size = TYPE_IS_WIDE (f) ? 2 : 1;
++ /* Always note the push here, so that we correctly
++ compute the required maximum stack size. */
++ NOTE_PUSH (size);
+ if (target == IGNORE_TARGET)
+- emit_pop (size, state);
+- else
+- NOTE_PUSH (size);
++ {
++ emit_pop (size, state);
++ NOTE_POP (size);
++ }
+ }
+ break;
+ }
+Index: gcc/java/jvspec.c
+===================================================================
+--- gcc/java/jvspec.c (revision 117035)
++++ gcc/java/jvspec.c (revision 117036)
+@@ -1,6 +1,6 @@
+ /* Specific flags and argument handling of the front-end of the
+ GNU compiler for the Java(TM) language.
+- Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
++ Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
+
+ This file is part of GCC.
+@@ -358,7 +358,6 @@
+ else if (strcmp (argv[i], "-fsyntax-only") == 0
+ || strcmp (argv[i], "--syntax-only") == 0)
+ {
+- want_spec_file = 0;
+ library = 0;
+ will_link = 0;
+ continue;
+Index: gcc/java/ChangeLog
+===================================================================
+--- gcc/java/ChangeLog (revision 117035)
++++ gcc/java/ChangeLog (revision 117036)
+@@ -1,3 +1,30 @@
++2006-09-12 Tom Tromey
++
++ * expr.c (push_value): Always flush quick stack.
++
++2006-09-12 Tom Tromey
++
++ PR java/29013:
++ * jcf-write.c (generate_bytecode_insns) : Always note
++ the push of the called method's return result.
++
++2006-09-12 Tom Tromey
++
++ * jvspec.c (lang_specific_driver): Read spec file even if
++ -fsyntax-only.
++
++2006-09-12 Tom Tromey
++
++ PR java/28754:
++ * expr.c (expand_java_field_op): Initialize field's declaring
++ interface if necessary.
++
++2006-09-12 Tom Tromey
++
++ PR java/28892:
++ * expr.c (expand_java_field_op): No error for assignments not in
++ class initializer or constructor.
++
+ 2006-08-22 Andrew Haley
+
+ * decl.c (java_add_stmt): Give the statement list a type.
+Index: gcc/java/expr.c
+===================================================================
+--- gcc/java/expr.c (revision 117035)
++++ gcc/java/expr.c (revision 117036)
+@@ -301,6 +301,13 @@
+ TREE_CHAIN (node) = quick_stack;
+ quick_stack = node;
+ }
++ /* If the value has a side effect, then we need to evaluate it
++ whether or not the result is used. If the value ends up on the
++ quick stack and is then popped, this won't happen -- so we flush
++ the quick stack. It is safest to simply always flush, though,
++ since TREE_SIDE_EFFECTS doesn't capture COMPONENT_REF, and for
++ the latter we may need to strip conversions. */
++ flush_quick_stack ();
+ }
+
+ /* Pop a type from the type stack.
+@@ -2837,7 +2844,12 @@
+ field_ref = build_field_ref (field_ref, self_type, field_name);
+ if (is_static
+ && ! flag_indirect_dispatch)
+- field_ref = build_class_init (self_type, field_ref);
++ {
++ tree context = DECL_CONTEXT (field_ref);
++ if (context != self_type && CLASS_INTERFACE (TYPE_NAME (context)))
++ field_ref = build_class_init (context, field_ref);
++ field_ref = build_class_init (self_type, field_ref);
++ }
+ if (is_putting)
+ {
+ flush_quick_stack ();
+@@ -2846,21 +2858,10 @@
+ if (DECL_CONTEXT (field_decl) != current_class)
+ error ("assignment to final field %q+D not in field's class",
+ field_decl);
+- else if (FIELD_STATIC (field_decl))
+- {
+- if (!DECL_CLINIT_P (current_function_decl))
+- warning (0, "assignment to final static field %q+D not in "
+- "class initializer",
+- field_decl);
+- }
+- else
+- {
+- tree cfndecl_name = DECL_NAME (current_function_decl);
+- if (! DECL_CONSTRUCTOR_P (current_function_decl)
+- && !ID_FINIT_P (cfndecl_name))
+- warning (0, "assignment to final field %q+D not in constructor",
+- field_decl);
+- }
++ /* We used to check for assignments to final fields not
++ occurring in the class initializer or in a constructor
++ here. However, this constraint doesn't seem to be
++ enforced by the JVM. */
+ }
+
+ if (TREE_THIS_VOLATILE (field_decl))
+
+
+Index: libjava/Makefile.in
+===================================================================
+--- libjava/Makefile.in (revision 116606)
++++ libjava/Makefile.in (working copy)
+@@ -9238,7 +9238,21 @@
+ rm -rf $$JARDIR $$JARDIR.stamp
+
+ libgcj-tools-$(gcc_version).jar: classpath/tools/tools.jar
+- cp $< $@
++ javasrcdir=`cd $(srcdir) && pwd`; \
++ JARDIR=`mktemp -d $@.XXXXXX` || exit 1; \
++ touch -r $$javasrcdir/../gcc/ChangeLog $$JARDIR.stamp; \
++ [ $$javasrcdir/../gcc/java/ChangeLog -nt $$JARDIR.stamp ] \
++ && touch -r $$javasrcdir/../gcc/java/ChangeLog $$JARDIR.stamp; \
++ [ $$javasrcdir/ChangeLog -nt $$JARDIR.stamp ] \
++ && touch -r $$javasrcdir/ChangeLog $$JARDIR.stamp; \
++ cd $$JARDIR || exit 1; \
++ $(JAR) -xf ../$<; \
++ rm -rf META-INF; \
++ find -type f | xargs touch -r ../$$JARDIR.stamp; \
++ find -type d | xargs touch -r ../$$JARDIR.stamp; \
++ find * | LC_ALL=C sort | $(JAR) -cfM@E ../$@ || exit 1; \
++ cd ..; \
++ rm -rf $$JARDIR $$JARDIR.stamp
+
+ mostlyclean-local:
+ find . -name '*.lo' -print | xargs $(LIBTOOL) rm -f
+Index: libjava/libgcj_bc.c
+===================================================================
+--- libjava/libgcj_bc.c (revision 116606)
++++ libjava/libgcj_bc.c (working copy)
+@@ -92,3 +92,19 @@
+ void _Jv_AttachCurrentThread () {}
+ void _Jv_AttachCurrentThreadAsDaemon () {}
+ void _Jv_DetachCurrentThread () {}
++
++
++/* Classes for primitive types. */
++
++#define DECLARE_PRIM_TYPE(NAME) \
++ int _Jv_##NAME##Class;
++
++DECLARE_PRIM_TYPE(byte)
++DECLARE_PRIM_TYPE(short)
++DECLARE_PRIM_TYPE(int)
++DECLARE_PRIM_TYPE(long)
++DECLARE_PRIM_TYPE(boolean)
++DECLARE_PRIM_TYPE(char)
++DECLARE_PRIM_TYPE(float)
++DECLARE_PRIM_TYPE(double)
++DECLARE_PRIM_TYPE(void)
+Index: libjava/classpath/native/jni/gconf-peer/Makefile.in
+===================================================================
+--- libjava/classpath/native/jni/gconf-peer/Makefile.in (revision 116606)
++++ libjava/classpath/native/jni/gconf-peer/Makefile.in (working copy)
+@@ -313,6 +313,7 @@
+ libgconfpeer_la_LIBADD = $(top_builddir)/native/jni/classpath/native_state.lo \
+ $(top_builddir)/native/jni/classpath/jcl.lo
+
++libgconfpeer_la_LDFLAGS = -avoid-version
+ AM_LDFLAGS = @CLASSPATH_MODULE@ @GCONF_LIBS@ @GDK_LIBS@
+ AM_CPPFLAGS = @CLASSPATH_INCLUDES@
+ AM_CFLAGS = @WARNING_CFLAGS@ @ERROR_CFLAGS@ @GCONF_CFLAGS@ @GDK_CFLAGS@
+Index: libjava/classpath/native/jni/gconf-peer/Makefile.am
+===================================================================
+--- libjava/classpath/native/jni/gconf-peer/Makefile.am (revision 116606)
++++ libjava/classpath/native/jni/gconf-peer/Makefile.am (working copy)
+@@ -5,6 +5,8 @@
+ libgconfpeer_la_LIBADD = $(top_builddir)/native/jni/classpath/native_state.lo \
+ $(top_builddir)/native/jni/classpath/jcl.lo
+
++libgconfpeer_la_LDFLAGS = -avoid-version
++
+ AM_LDFLAGS = @CLASSPATH_MODULE@ @GCONF_LIBS@ @GDK_LIBS@
+
+ AM_CPPFLAGS = @CLASSPATH_INCLUDES@
+Index: libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
+===================================================================
+--- libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c (revision 116606)
++++ libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c (working copy)
+@@ -1,5 +1,5 @@
+ /* gtkchoicepeer.c -- Native implementation of GtkChoicePeer
+- Copyright (C) 1998, 1999 Free Software Foundation, Inc.
++ Copyright (C) 1998, 1999, 2006 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+@@ -52,7 +52,7 @@
+
+ postChoiceItemEventID = (*cp_gtk_gdk_env())->GetMethodID (cp_gtk_gdk_env(), gtkchoicepeer,
+ "postChoiceItemEvent",
+- "(Ljava/lang/String;I)V");
++ "(I)V");
+ }
+
+ static void selection_changed_cb (GtkComboBox *combobox, jobject peer);
+@@ -106,39 +106,7 @@
+ }
+
+ JNIEXPORT void JNICALL
+-Java_gnu_java_awt_peer_gtk_GtkChoicePeer_append
+- (JNIEnv *env, jobject obj, jobjectArray items)
+-{
+- gpointer ptr;
+- jsize count, i;
+- GtkWidget *bin;
+-
+- gdk_threads_enter ();
+-
+- ptr = NSA_GET_PTR (env, obj);
+- bin = choice_get_widget (GTK_WIDGET (ptr));
+-
+- count = (*env)->GetArrayLength (env, items);
+-
+- for (i = 0; i < count; i++)
+- {
+- jobject item;
+- const char *label;
+-
+- item = (*env)->GetObjectArrayElement (env, items, i);
+- label = (*env)->GetStringUTFChars (env, item, NULL);
+-
+- gtk_combo_box_append_text (GTK_COMBO_BOX (bin), label);
+-
+- (*env)->ReleaseStringUTFChars (env, item, label);
+- (*env)->DeleteLocalRef(env, item);
+- }
+-
+- gdk_threads_leave ();
+-}
+-
+-JNIEXPORT void JNICALL
+-Java_gnu_java_awt_peer_gtk_GtkChoicePeer_nativeAdd
++Java_gnu_java_awt_peer_gtk_GtkChoicePeer_add
+ (JNIEnv *env, jobject obj, jstring item, jint index)
+ {
+ void *ptr;
+@@ -170,14 +138,16 @@
+
+ ptr = NSA_GET_PTR (env, obj);
+ bin = choice_get_widget (GTK_WIDGET (ptr));
+-
++
++ /* First, unselect everything, to avoid problems when removing items. */
++ gtk_combo_box_set_active (GTK_COMBO_BOX (bin), -1);
+ gtk_combo_box_remove_text (GTK_COMBO_BOX (bin), index);
+
+ gdk_threads_leave ();
+ }
+
+-JNIEXPORT void JNICALL
+-Java_gnu_java_awt_peer_gtk_GtkChoicePeer_nativeRemoveAll
++JNIEXPORT void JNICALL
++Java_gnu_java_awt_peer_gtk_GtkChoicePeer_nativeRemoveAll
+ (JNIEnv *env, jobject obj)
+ {
+ void *ptr;
+@@ -224,8 +194,7 @@
+
+ ptr = NSA_GET_PTR (env, obj);
+ bin = choice_get_widget (GTK_WIDGET (ptr));
+-
+- gtk_combo_box_set_active (GTK_COMBO_BOX (bin), index);
++ gtk_combo_box_set_active (GTK_COMBO_BOX (bin), (gint)index);
+ }
+
+ JNIEXPORT jint JNICALL
+@@ -251,26 +220,11 @@
+ static void
+ selection_changed_cb (GtkComboBox *combobox, jobject peer)
+ {
+- jstring label;
+- GtkTreeModel *model;
+- GtkTreeIter iter;
+- gchar *selected;
+- gint index;
++ gint index = gtk_combo_box_get_active(combobox);
+
+- index = gtk_combo_box_get_active(combobox);
+-
+ if (index >= 0)
+- {
+- model = gtk_combo_box_get_model (combobox);
+- gtk_combo_box_get_active_iter (combobox, &iter);
+- gtk_tree_model_get (model, &iter, 0, &selected, -1);
+- label = (*cp_gtk_gdk_env())->NewStringUTF (cp_gtk_gdk_env(), selected);
+-
+- (*cp_gtk_gdk_env())->CallVoidMethod (cp_gtk_gdk_env(), peer,
+- postChoiceItemEventID,
+- label,
+- (jint) AWT_ITEM_SELECTED);
+- }
++ (*cp_gtk_gdk_env())->CallVoidMethod (cp_gtk_gdk_env(), peer,
++ postChoiceItemEventID, (jint)index );
+ }
+
+ static GtkWidget *
+Index: libjava/classpath/native/fdlibm/mprec.c
+===================================================================
+--- libjava/classpath/native/fdlibm/mprec.c (revision 116606)
++++ libjava/classpath/native/fdlibm/mprec.c (working copy)
+@@ -666,7 +666,7 @@
+ _DEFUN (ulp, (_x), double _x)
+ {
+ union double_union x, a;
+- register __Long L;
++ register int32_t L;
+
+ x.d = _x;
+
+Index: libjava/classpath/gnu/java/nio/charset/US_ASCII.java
+===================================================================
+--- libjava/classpath/gnu/java/nio/charset/US_ASCII.java (revision 116606)
++++ libjava/classpath/gnu/java/nio/charset/US_ASCII.java (working copy)
+@@ -134,6 +134,19 @@
+ super (cs, 1.0f, 1.0f);
+ }
+
++ public boolean canEncode(char c)
++ {
++ return c <= 0x7f;
++ }
++
++ public boolean canEncode(CharSequence cs)
++ {
++ for (int i = 0; i < cs.length(); ++i)
++ if (! canEncode(cs.charAt(i)))
++ return false;
++ return true;
++ }
++
+ protected CoderResult encodeLoop (CharBuffer in, ByteBuffer out)
+ {
+ // TODO: Optimize this in the case in.hasArray() / out.hasArray()
+@@ -141,7 +154,7 @@
+ {
+ char c = in.get ();
+
+- if (c > Byte.MAX_VALUE)
++ if (c > 0x7f)
+ {
+ in.position (in.position () - 1);
+ return CoderResult.unmappableForLength (1);
+Index: libjava/classpath/gnu/java/nio/charset/ISO_8859_1.java
+===================================================================
+--- libjava/classpath/gnu/java/nio/charset/ISO_8859_1.java (revision 116606)
++++ libjava/classpath/gnu/java/nio/charset/ISO_8859_1.java (working copy)
+@@ -128,6 +128,19 @@
+ super (cs, 1.0f, 1.0f);
+ }
+
++ public boolean canEncode(char c)
++ {
++ return c <= 0xff;
++ }
++
++ public boolean canEncode(CharSequence cs)
++ {
++ for (int i = 0; i < cs.length(); ++i)
++ if (! canEncode(cs.charAt(i)))
++ return false;
++ return true;
++ }
++
+ protected CoderResult encodeLoop (CharBuffer in, ByteBuffer out)
+ {
+ // TODO: Optimize this in the case in.hasArray() / out.hasArray()
+Index: libjava/classpath/gnu/java/nio/charset/ByteCharset.java
+===================================================================
+--- libjava/classpath/gnu/java/nio/charset/ByteCharset.java (revision 116606)
++++ libjava/classpath/gnu/java/nio/charset/ByteCharset.java (working copy)
+@@ -156,6 +156,22 @@
+ }
+ }
+
++ public boolean canEncode(char c)
++ {
++ byte b = (c < lookup.length) ? lookup[c] : 0;
++ return b != 0 || c == 0;
++ }
++
++ public boolean canEncode(CharSequence cs)
++ {
++ for (int i = 0; i < cs.length(); ++i)
++ {
++ if (! canEncode(cs.charAt(i)))
++ return false;
++ }
++ return true;
++ }
++
+ protected CoderResult encodeLoop (CharBuffer in, ByteBuffer out)
+ {
+ // TODO: Optimize this in the case in.hasArray() / out.hasArray()
+Index: libjava/classpath/gnu/java/net/protocol/http/HTTPURLConnection.java
+===================================================================
+--- libjava/classpath/gnu/java/net/protocol/http/HTTPURLConnection.java (revision 116606)
++++ libjava/classpath/gnu/java/net/protocol/http/HTTPURLConnection.java (working copy)
+@@ -149,6 +149,14 @@
+ final Credentials creds = (username == null) ? null :
+ new Credentials (username, password);
+
++ if ("POST".equals(method))
++ {
++ String contentType = requestHeaders.getValue("Content-Type");
++ if (null == contentType)
++ requestHeaders.addValue("Content-Type",
++ "application/x-www-form-urlencoded");
++ }
++
+ boolean retry;
+ do
+ {
+Index: libjava/classpath/gnu/java/awt/peer/gtk/GtkChoicePeer.java
+===================================================================
+--- libjava/classpath/gnu/java/awt/peer/gtk/GtkChoicePeer.java (revision 116606)
++++ libjava/classpath/gnu/java/awt/peer/gtk/GtkChoicePeer.java (working copy)
+@@ -39,12 +39,15 @@
+ package gnu.java.awt.peer.gtk;
+
+ import java.awt.Choice;
++import java.awt.AWTEvent;
+ import java.awt.event.ItemEvent;
+ import java.awt.peer.ChoicePeer;
+
+ public class GtkChoicePeer extends GtkComponentPeer
+ implements ChoicePeer
+ {
++ private int selected;
++
+ public GtkChoicePeer (Choice c)
+ {
+ super (c);
+@@ -52,31 +55,33 @@
+ int count = c.getItemCount ();
+ if (count > 0)
+ {
+- String items[] = new String[count];
+ for (int i = 0; i < count; i++)
+- items[i] = c.getItem (i);
+-
+- append (items);
++ add( c.getItem(i), i );
++
++ selected = c.getSelectedIndex();
++ if( selected >= 0 )
++ select( selected );
+ }
+-
+- int selected = c.getSelectedIndex();
+- if (selected >= 0)
+- select(selected);
++ else
++ selected = -1;
+ }
+
+ native void create ();
+
+- native void append (String items[]);
+ native int nativeGetSelected ();
+- native void nativeAdd (String item, int index);
+- native void nativeRemove (int index);
+- native void nativeRemoveAll ();
+
+ native void connectSignals ();
+
+ native void selectNative (int position);
++
+ native void selectNativeUnlocked (int position);
+
++ public native void add (String item, int index);
++
++ native void nativeRemove(int index);
++
++ native void nativeRemoveAll();
++
+ public void select (int position)
+ {
+ if (Thread.currentThread() == GtkToolkit.mainThread)
+@@ -85,42 +90,18 @@
+ selectNative (position);
+ }
+
+- public void add (String item, int index)
++ public void remove( int index )
+ {
+- int before = nativeGetSelected();
+-
+- nativeAdd (item, index);
+-
+- /* Generate an ItemEvent if we added the first one or
+- if we inserted at or before the currently selected item. */
+- if ((before < 0) || (before >= index))
+- {
+- // Must set our state before notifying listeners
+- ((Choice) awtComponent).select (((Choice) awtComponent).getItem (0));
+- postItemEvent (((Choice) awtComponent).getItem (0), ItemEvent.SELECTED);
+- }
++ // Ensure the triggering of an event when removing item zero if zero is the
++ // selected item, even though the selected index doesn't change.
++ if( index == 0 && selected == 0 )
++ selected = -1;
++ nativeRemove( index );
+ }
+
+- public void remove (int index)
++ public void removeAll()
+ {
+- int before = nativeGetSelected();
+- int after;
+-
+- nativeRemove (index);
+- after = nativeGetSelected();
+-
+- /* Generate an ItemEvent if we are removing the currently selected item
+- and there are at least one item left. */
+- if ((before == index) && (after >= 0))
+- {
+- // Must set our state before notifying listeners
+- ((Choice) awtComponent).select (((Choice) awtComponent).getItem (0));
+- postItemEvent (((Choice) awtComponent).getItem (0), ItemEvent.SELECTED);
+- }
+- }
+-
+- public void removeAll ()
+- {
++ selected = -1; // we do not want to trigger a select event here.
+ nativeRemoveAll();
+ }
+
+@@ -129,8 +110,34 @@
+ add (item, position);
+ }
+
+- protected void postChoiceItemEvent (String label, int stateChange)
++ /**
++ * Callback from the native side on an item-select event,
++ * which posts an event. The event is only posted if it represents an actual
++ * change. Selected is set to the peer's state initially, so that the
++ * first call to select(int) from the constructor will not trigger an event.
++ * (it should not)
++ */
++ protected void postChoiceItemEvent ( int index )
+ {
+- postItemEvent (label, stateChange);
++ if( selected != index )
++ {
++ selected = index;
++ postItemEvent (((Choice) awtComponent).getItem( selected ),
++ ItemEvent.SELECTED);
++ }
+ }
++
++ /**
++ * Catches the event and calls Choice.select() if the component state
++ * needs updating.
++ */
++ public void handleEvent (AWTEvent event)
++ {
++ super.handleEvent( event );
++ if( event instanceof ItemEvent )
++ if( ((ItemEvent)event).getItemSelectable() == awtComponent &&
++ ((ItemEvent)event).getStateChange() == ItemEvent.SELECTED )
++ ((Choice)awtComponent).select( selected );
++ }
+ }
++
+Index: libjava/classpath/gnu/javax/net/ssl/provider/SSLSocket.java
+===================================================================
+--- libjava/classpath/gnu/javax/net/ssl/provider/SSLSocket.java (revision 116606)
++++ libjava/classpath/gnu/javax/net/ssl/provider/SSLSocket.java (working copy)
+@@ -845,7 +845,6 @@
+ {
+ return super.isBound();
+ }
+- //throw new UnsupportedOperationException("1.4 methods not enabled");
+ }
+
+ public boolean isClosed()
+@@ -858,149 +857,138 @@
+ {
+ return super.isClosed();
+ }
+- //throw new UnsupportedOperationException("1.4 methods not enabled");
+ }
+
+- //public SocketAddress getRemoteSocketAddress()
+- //{
+- // if (underlyingSocket != null)
+- // {
+- // return underlyingSocket.getRemoteSocketAddress();
+- // }
+- // else
+- // {
+- // return super.getRemoteSocketAddress();
+- // }
+- //}
++ public SocketAddress getRemoteSocketAddress()
++ {
++ if (underlyingSocket != null)
++ {
++ return underlyingSocket.getRemoteSocketAddress();
++ }
++ else
++ {
++ return super.getRemoteSocketAddress();
++ }
++ }
+
+ public void setOOBInline(boolean flag) throws SocketException
+ {
+- //if (underlyingSocket != null)
+- // {
+- // underlyingSocket.setOOBInline(flag);
+- // }
+- //else
+- // {
+- // super.setOOBInline(flag);
+- // }
+- throw new UnsupportedOperationException("1.4 methods not enabled");
++ if (underlyingSocket != null)
++ {
++ underlyingSocket.setOOBInline(flag);
++ }
++ else
++ {
++ super.setOOBInline(flag);
++ }
+ }
+
+ public boolean getOOBInline() throws SocketException
+ {
+- //if (underlyingSocket != null)
+- // {
+- // return underlyingSocket.getOOBInline();
+- // }
+- //else
+- // {
+- // return super.getOOBInline();
+- // }
+- throw new UnsupportedOperationException("1.4 methods not enabled");
++ if (underlyingSocket != null)
++ {
++ return underlyingSocket.getOOBInline();
++ }
++ else
++ {
++ return super.getOOBInline();
++ }
+ }
+
+ public void setKeepAlive(boolean flag) throws SocketException
+ {
+- //if (underlyingSocket != null)
+- // {
+- // underlyingSocket.setKeepAlive(flag);
+- // }
+- //else
+- // {
+- // super.setKeepAlive(flag);
+- // }
+- throw new UnsupportedOperationException("1.4 methods not enabled");
++ if (underlyingSocket != null)
++ {
++ underlyingSocket.setKeepAlive(flag);
++ }
++ else
++ {
++ super.setKeepAlive(flag);
++ }
+ }
+
+ public boolean getKeepAlive() throws SocketException
+ {
+- //if (underlyingSocket != null)
+- // {
+- // return underlyingSocket.getKeepAlive();
+- // }
+- //else
+- // {
+- // return super.getKeepAlive();
+- // }
+- throw new UnsupportedOperationException("1.4 methods not enabled");
++ if (underlyingSocket != null)
++ {
++ return underlyingSocket.getKeepAlive();
++ }
++ else
++ {
++ return super.getKeepAlive();
++ }
+ }
+
+ public void setTrafficClass(int clazz) throws SocketException
+ {
+- //if (underlyingSocket != null)
+- // {
+- // underlyingSocket.setTrafficClass(clazz);
+- // }
+- //else
+- // {
+- // super.setTrafficClass(clazz);
+- // }
+- throw new UnsupportedOperationException("1.4 methods not enabled");
++ if (underlyingSocket != null)
++ {
++ underlyingSocket.setTrafficClass(clazz);
++ }
++ else
++ {
++ super.setTrafficClass(clazz);
++ }
+ }
+
+ public int getTrafficClass() throws SocketException
+ {
+- //if (underlyingSocket != null)
+- // {
+- // return underlyingSocket.getTrafficClass();
+- // }
+- //else
+- // {
+- // return super.getTrafficClass();
+- // }
+- throw new UnsupportedOperationException("1.4 methods not enabled");
++ if (underlyingSocket != null)
++ {
++ return underlyingSocket.getTrafficClass();
++ }
++ else
++ {
++ return super.getTrafficClass();
++ }
+ }
+
+ public void setReuseAddress(boolean flag) throws SocketException
+ {
+- //if (underlyingSocket != null)
+- // {
+- // underlyingSocket.setReuseAddress(flag);
+- // }
+- //else
+- // {
+- // super.setReuseAddress(flag);
+- // }
+- throw new UnsupportedOperationException("1.4 methods not enabled");
++ if (underlyingSocket != null)
++ {
++ underlyingSocket.setReuseAddress(flag);
++ }
++ else
++ {
++ super.setReuseAddress(flag);
++ }
+ }
+
+ public boolean getReuseAddress() throws SocketException
+ {
+- //if (underlyingSocket != null)
+- // {
+- // return underlyingSocket.getReuseAddress();
+- // }
+- //else
+- // {
+- // return super.getReuseAddress();
+- // }
+- throw new UnsupportedOperationException("1.4 methods not enabled");
++ if (underlyingSocket != null)
++ {
++ return underlyingSocket.getReuseAddress();
++ }
++ else
++ {
++ return super.getReuseAddress();
++ }
+ }
+
+ public void shutdownInput() throws IOException
+ {
+- //if (underlyingSocket != null)
+- // {
+- // underlyingSocket.shutdownInput();
+- // }
+- //else
+- // {
+- // super.shutdownInput();
+- // }
+- throw new UnsupportedOperationException("1.4 methods not enabled");
++ if (underlyingSocket != null)
++ {
++ underlyingSocket.shutdownInput();
++ }
++ else
++ {
++ super.shutdownInput();
++ }
+ }
+
+ public void shutdownOutput() throws IOException
+ {
+- //if (underlyingSocket != null)
+- // {
+- // underlyingSocket.shutdownOutput();
+- // }
+- //else
+- // {
+- // super.shutdownOutput();
+- // }
+- throw new UnsupportedOperationException("1.4 methods not enabled");
++ if (underlyingSocket != null)
++ {
++ underlyingSocket.shutdownOutput();
++ }
++ else
++ {
++ super.shutdownOutput();
++ }
+ }
+
+ public boolean isConnected()
+@@ -1013,33 +1001,30 @@
+ {
+ return super.isConnected();
+ }
+- //throw new UnsupportedOperationException("1.4 methods not enabled");
+ }
+
+ public boolean isInputShutdown()
+ {
+- //if (underlyingSocket != null)
+- // {
+- // return underlyingSocket.isInputShutdown();
+- // }
+- //else
+- // {
+- // return super.isInputShutdown();
+- // }
+- throw new UnsupportedOperationException("1.4 methods not enabled");
++ if (underlyingSocket != null)
++ {
++ return underlyingSocket.isInputShutdown();
++ }
++ else
++ {
++ return super.isInputShutdown();
++ }
+ }
+
+ public boolean isOutputShutdown()
+ {
+- //if (underlyingSocket != null)
+- // {
+- // return underlyingSocket.isOutputShutdown();
+- // }
+- //else
+- // {
+- // return super.isOutputShutdown();
+- // }
+- throw new UnsupportedOperationException("1.4 methods not enabled");
++ if (underlyingSocket != null)
++ {
++ return underlyingSocket.isOutputShutdown();
++ }
++ else
++ {
++ return super.isOutputShutdown();
++ }
+ }
+
+ protected void finalize()
+Index: libjava/classpath/tools/gnu/classpath/tools/appletviewer/Main.java
+===================================================================
+--- libjava/classpath/tools/gnu/classpath/tools/appletviewer/Main.java (revision 116606)
++++ libjava/classpath/tools/gnu/classpath/tools/appletviewer/Main.java (working copy)
+@@ -44,10 +44,12 @@
+ import gnu.classpath.tools.getopt.Parser;
+ import java.applet.Applet;
+ import java.awt.Dimension;
++import java.io.BufferedReader;
+ import java.io.FileInputStream;
+ import java.io.FileOutputStream;
+ import java.io.IOException;
+ import java.io.InputStream;
++import java.io.InputStreamReader;
+ import java.io.OutputStream;
+ import java.net.URL;
+ import java.util.ArrayList;
+@@ -249,6 +251,7 @@
+
+ if (pluginMode)
+ {
++ // Plugin will warn user about missing security manager.
+ InputStream in;
+ OutputStream out;
+
+@@ -259,6 +262,33 @@
+ }
+ else
+ {
++ // Warn user about missing security manager.
++ System.err.println("WARNING: CURRENTLY GAPPLETVIEWER RUNS WITH NO SECURITY MANAGER.\n\n"
++ + "THIS MEANS THAT APPLETS YOU LOAD CAN DO ANYTHING A JAVA APPLICATION\n"
++ + "THAT YOU DOWNLOAD AND RUN CAN DO. BE *VERY* CAREFUL WHICH APPLETS YOU RUN.\n"
++ + "DO NOT USE GAPPLETVIEWER ON YOUR SYSTEM IF YOUR SYSTEM STORES IMPORTANT DATA.\n"
++ + "THIS DATA CAN BE DESTROYED OR STOLEN IF YOU LOAD A MALICIOUS APPLET.\n");
++
++ System.err.println("[press 'c' or 'C' to continue or anything else to quit]");
++
++ BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
++ String response = null;
++
++ try
++ {
++ response = stdin.readLine();
++ }
++ catch (IOException e)
++ {
++ System.err.println("failed to read response to warning message: " + e);
++ System.exit(1);
++ }
++
++ if (!(response.equals("c") || response.equals("C")))
++ {
++ System.exit(0);
++ }
++
+ if (code == null)
+ {
+ // The --code option wasn't given and there are no URL
+Index: libjava/classpath/java/net/SocketPermission.java
+===================================================================
+--- libjava/classpath/java/net/SocketPermission.java (revision 116606)
++++ libjava/classpath/java/net/SocketPermission.java (working copy)
+@@ -164,13 +164,57 @@
+ */
+ public SocketPermission(String hostport, String actions)
+ {
+- super(hostport);
++ super(maybeBracketIPv6Address(hostport));
+
+- setHostPort(hostport);
++ setHostPort(getName());
+ setActions(actions);
+ }
+
+ /**
++ * IPv6 addresses in the hostport must either be enclosed by
++ * "[" and "]" or be specified in the full uncompressed form.
++ * In the latter case proprietary JVMs will quote the address
++ * with "[" and "]", so we do to.
++ */
++ private static String maybeBracketIPv6Address(String hostport)
++ {
++ if (hostport.length() == 0 || hostport.charAt(0) == '[')
++ return hostport;
++
++ int colons = 0, last_colon = 0;
++ for (int i = 0; i < hostport.length(); i++)
++ {
++ if (hostport.charAt(i) == ':')
++ {
++ if (i - last_colon == 1)
++ throw new IllegalArgumentException("Ambiguous hostport part");
++ colons++;
++ last_colon = i;
++ }
++ }
++
++ switch (colons)
++ {
++ case 0:
++ case 1:
++ // a hostname or IPv4 address
++ return hostport;
++
++ case 7:
++ // an IPv6 address with no ports
++ return "[" + hostport + "]";
++
++ case 8:
++ // an IPv6 address with ports
++ return "[" + hostport.substring(0, last_colon) + "]"
++ + hostport.substring(last_colon);
++
++ default:
++ throw new IllegalArgumentException("Ambiguous hostport part");
++ }
++ }
++
++ /**
+ * Parse the hostport argument to the constructor.
+ */
+ private void setHostPort(String hostport)
+Index: libjava/classpath/java/net/NetworkInterface.java
+===================================================================
+--- libjava/classpath/java/net/NetworkInterface.java (revision 116606)
++++ libjava/classpath/java/net/NetworkInterface.java (working copy)
+@@ -112,10 +112,7 @@
+ InetAddress addr = (InetAddress) addresses.nextElement();
+ try
+ {
+- String hostAddress = addr.getHostAddress();
+- if (addr instanceof Inet6Address)
+- hostAddress = "[" + hostAddress + "]";
+- s.checkConnect(hostAddress, 58000);
++ s.checkConnect(addr.getHostAddress(), 58000);
+ tmpInetAddresses.add(addr);
+ }
+ catch (SecurityException e)
+Index: libjava/classpath/java/awt/Choice.java
+===================================================================
+--- libjava/classpath/java/awt/Choice.java (revision 116606)
++++ libjava/classpath/java/awt/Choice.java (working copy)
+@@ -1,5 +1,5 @@
+ /* Choice.java -- Java choice button widget.
+- Copyright (C) 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
++ Copyright (C) 1999, 2000, 2001, 2002, 2004, 2006 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+@@ -51,56 +51,47 @@
+ import javax.accessibility.AccessibleRole;
+
+ /**
+- * This class implements a drop down choice list.
+- *
+- * @author Aaron M. Renn (arenn@urbanophile.com)
+- */
++ * This class implements a drop down choice list.
++ *
++ * @author Aaron M. Renn (arenn@urbanophile.com)
++ */
+ public class Choice extends Component
+ implements ItemSelectable, Serializable, Accessible
+ {
++ /**
++ * The number used to generate the name returned by getName.
++ */
++ private static transient long next_choice_number;
+
+-/*
+- * Static Variables
+- */
++ // Serialization constant
++ private static final long serialVersionUID = -4075310674757313071L;
+
+-/**
+- * The number used to generate the name returned by getName.
+- */
+-private static transient long next_choice_number;
++ /**
++ * @serial A list of items for the choice box, which can be null
.
++ * This is package-private to avoid an accessor method.
++ */
++ Vector pItems = new Vector();
+
+-// Serialization constant
+-private static final long serialVersionUID = -4075310674757313071L;
++ /**
++ * @serial The index of the selected item in the choice box.
++ */
++ private int selectedIndex = -1;
+
+-/*************************************************************************/
++ /**
++ * ItemListener chain
++ */
++ private ItemListener item_listeners;
+
+-/*
+- * Instance Variables
+- */
+-
+-/**
+- * @serial A list of items for the choice box, which can be null
.
+- * This is package-private to avoid an accessor method.
+- */
+-Vector pItems = new Vector();
+-
+-/**
+- * @serial The index of the selected item in the choice box.
+- */
+-private int selectedIndex = -1;
+-
+-// Listener chain
+-private ItemListener item_listeners;
+-
+-/**
+- * This class provides accessibility support for the
+- * combo box.
+- *
+- * @author Jerry Quinn (jlquinn@optonline.net)
+- * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+- */
++ /**
++ * This class provides accessibility support for the
++ * combo box.
++ *
++ * @author Jerry Quinn (jlquinn@optonline.net)
++ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
++ */
+ protected class AccessibleAWTChoice
+- extends AccessibleAWTComponent
+- implements AccessibleAction
++ extends AccessibleAWTComponent
++ implements AccessibleAction
+ {
+
+ /**
+@@ -186,19 +177,12 @@
+ if (i < 0 || i >= pItems.size())
+ return false;
+
+- Choice.this.processItemEvent(new ItemEvent(Choice.this,
+- ItemEvent.ITEM_STATE_CHANGED,
+- this, ItemEvent.SELECTED));
++ Choice.this.select( i );
++
+ return true;
+ }
+ }
+
+-/*************************************************************************/
+-
+-/*
+- * Constructors
+- */
+-
+ /**
+ * Initializes a new instance of Choice
.
+ *
+@@ -211,398 +195,324 @@
+ throw new HeadlessException ();
+ }
+
+-/*************************************************************************/
++ /**
++ * Returns the number of items in the list.
++ *
++ * @return The number of items in the list.
++ */
++ public int getItemCount()
++ {
++ return countItems ();
++ }
+
+-/*
+- * Instance Methods
+- */
++ /**
++ * Returns the number of items in the list.
++ *
++ * @return The number of items in the list.
++ *
++ * @deprecated This method is deprecated in favor of getItemCount
.
++ */
++ public int countItems()
++ {
++ return pItems.size();
++ }
+
+-/**
+- * Returns the number of items in the list.
+- *
+- * @return The number of items in the list.
+- */
+-public int
+-getItemCount()
+-{
+- return countItems ();
+-}
++ /**
++ * Returns the item at the specified index in the list.
++ *
++ * @param index The index into the list to return the item from.
++ *
++ * @exception ArrayIndexOutOfBoundsException If the index is invalid.
++ */
++ public String getItem(int index)
++ {
++ return (String)pItems.elementAt(index);
++ }
+
+-/*************************************************************************/
++ /**
++ * Adds the specified item to this choice box.
++ *
++ * @param item The item to add.
++ *
++ * @exception NullPointerException If the item's value is null
++ *
++ * @since 1.1
++ */
++ public synchronized void add(String item)
++ {
++ if (item == null)
++ throw new NullPointerException ("item must be non-null");
+
+-/**
+- * Returns the number of items in the list.
+- *
+- * @return The number of items in the list.
+- *
+- * @deprecated This method is deprecated in favor of getItemCount
.
+- */
+-public int
+-countItems()
+-{
+- return(pItems.size());
+-}
++ pItems.addElement(item);
+
+-/*************************************************************************/
++ if (peer != null)
++ ((ChoicePeer) peer).add(item, getItemCount() - 1);
+
+-/**
+- * Returns the item at the specified index in the list.
+- *
+- * @param index The index into the list to return the item from.
+- *
+- * @exception ArrayIndexOutOfBoundsException If the index is invalid.
+- */
+-public String
+-getItem(int index)
+-{
+- return((String)pItems.elementAt(index));
+-}
++ if (selectedIndex == -1)
++ select( 0 );
++ }
+
+-/*************************************************************************/
++ /**
++ * Adds the specified item to this choice box.
++ *
++ * This method is oboslete since Java 2 platform 1.1. Please use @see add
++ * instead.
++ *
++ * @param item The item to add.
++ *
++ * @exception NullPointerException If the item's value is equal to null
++ */
++ public synchronized void addItem(String item)
++ {
++ add(item);
++ }
+
+-/**
+- * Adds the specified item to this choice box.
+- *
+- * @param item The item to add.
+- *
+- * @exception NullPointerException If the item's value is null
+- *
+- * @since 1.1
+- */
+-public synchronized void
+-add(String item)
+-{
+- if (item == null)
+- throw new NullPointerException ("item must be non-null");
++ /** Inserts an item into this Choice. Existing items are shifted
++ * upwards. If the new item is the only item, then it is selected.
++ * If the currently selected item is shifted, then the first item is
++ * selected. If the currently selected item is not shifted, then it
++ * remains selected.
++ *
++ * @param item The item to add.
++ * @param index The index at which the item should be inserted.
++ *
++ * @exception IllegalArgumentException If index is less than 0
++ */
++ public synchronized void insert(String item, int index)
++ {
++ if (index < 0)
++ throw new IllegalArgumentException ("index may not be less then 0");
+
+- pItems.addElement(item);
++ if (index > getItemCount ())
++ index = getItemCount ();
+
+- int i = pItems.size () - 1;
+- if (peer != null)
+- {
+- ChoicePeer cp = (ChoicePeer) peer;
+- cp.add (item, i);
+- }
+- else if (selectedIndex == -1)
+- select(0);
+-}
++ pItems.insertElementAt(item, index);
+
+-/*************************************************************************/
++ if (peer != null)
++ ((ChoicePeer) peer).add (item, index);
+
+-/**
+- * Adds the specified item to this choice box.
+- *
+- * This method is oboslete since Java 2 platform 1.1. Please use @see add
+- * instead.
+- *
+- * @param item The item to add.
+- *
+- * @exception NullPointerException If the item's value is equal to null
+- */
+-public synchronized void
+-addItem(String item)
+-{
+- add(item);
+-}
++ if (selectedIndex == -1 || selectedIndex >= index)
++ select(0);
++ }
+
+-/*************************************************************************/
++ /**
++ * Removes the specified item from the choice box.
++ *
++ * @param item The item to remove.
++ *
++ * @exception IllegalArgumentException If the specified item doesn't exist.
++ */
++ public synchronized void remove(String item)
++ {
++ int index = pItems.indexOf(item);
++ if (index == -1)
++ throw new IllegalArgumentException ("item \""
++ + item + "\" not found in Choice");
++ remove(index);
++ }
+
+-/** Inserts an item into this Choice. Existing items are shifted
+- * upwards. If the new item is the only item, then it is selected.
+- * If the currently selected item is shifted, then the first item is
+- * selected. If the currently selected item is not shifted, then it
+- * remains selected.
+- *
+- * @param item The item to add.
+- * @param index The index at which the item should be inserted.
+- *
+- * @exception IllegalArgumentException If index is less than 0
+- */
+-public synchronized void
+-insert(String item, int index)
+-{
+- if (index < 0)
+- throw new IllegalArgumentException ("index may not be less then 0");
++ /**
++ * Removes the item at the specified index from the choice box.
++ *
++ * @param index The index of the item to remove.
++ *
++ * @exception IndexOutOfBoundsException If the index is not valid.
++ */
++ public synchronized void remove(int index)
++ {
++ if ((index < 0) || (index > getItemCount()))
++ throw new IllegalArgumentException("Bad index: " + index);
+
+- if (index > getItemCount ())
+- index = getItemCount ();
++ pItems.removeElementAt(index);
+
+- pItems.insertElementAt(item, index);
++ if (peer != null)
++ ((ChoicePeer) peer).remove( index );
+
+- if (peer != null)
+- {
+- ChoicePeer cp = (ChoicePeer) peer;
+- cp.add (item, index);
+- }
+- else if (selectedIndex == -1 || selectedIndex >= index)
+- select(0);
+-}
++ if( getItemCount() == 0 )
++ selectedIndex = -1;
++ else
++ {
++ if( selectedIndex > index )
++ selectedIndex--;
++ else if( selectedIndex == index )
++ selectedIndex = 0;
+
+-/*************************************************************************/
++ if( peer != null )
++ ((ChoicePeer)peer).select( selectedIndex );
++ }
++ }
+
+-/**
+- * Removes the specified item from the choice box.
+- *
+- * @param item The item to remove.
+- *
+- * @exception IllegalArgumentException If the specified item doesn't exist.
+- */
+-public synchronized void
+-remove(String item)
+-{
+- int index = pItems.indexOf(item);
+- if (index == -1)
+- throw new IllegalArgumentException ("item \""
+- + item + "\" not found in Choice");
+- remove(index);
+-}
+-
+-/*************************************************************************/
+-
+-/**
+- * Removes the item at the specified index from the choice box.
+- *
+- * @param index The index of the item to remove.
+- *
+- * @exception IndexOutOfBoundsException If the index is not valid.
+- */
+-public synchronized void
+-remove(int index)
+-{
+- if ((index < 0) || (index > getItemCount()))
+- throw new IllegalArgumentException("Bad index: " + index);
+-
+- pItems.removeElementAt(index);
+-
+- if (peer != null)
+- {
+- ChoicePeer cp = (ChoicePeer) peer;
+- cp.remove (index);
+- }
+- else
+- {
+- if (getItemCount() == 0)
+- selectedIndex = -1;
+- else if (index == selectedIndex)
+- select(0);
+- }
+-
+- if (selectedIndex > index)
+- --selectedIndex;
+-}
+-
+-/*************************************************************************/
+-
+-/**
+- * Removes all of the objects from this choice box.
+- */
+-public synchronized void
+-removeAll()
+-{
+- if (getItemCount() <= 0)
+- return;
++ /**
++ * Removes all of the objects from this choice box.
++ */
++ public synchronized void removeAll()
++ {
++ if (getItemCount() <= 0)
++ return;
+
+- pItems.removeAllElements ();
++ pItems.removeAllElements ();
+
+- if (peer != null)
+- {
+- ChoicePeer cp = (ChoicePeer) peer;
+- cp.removeAll ();
+- }
++ if (peer != null)
++ {
++ ChoicePeer cp = (ChoicePeer) peer;
++ cp.removeAll ();
++ }
+
+- selectedIndex = -1;
+-}
++ selectedIndex = -1;
++ }
+
+-/*************************************************************************/
++ /**
++ * Returns the currently selected item, or null if no item is
++ * selected.
++ *
++ * @return The currently selected item.
++ */
++ public synchronized String getSelectedItem()
++ {
++ return (selectedIndex == -1
++ ? null
++ : ((String)pItems.elementAt(selectedIndex)));
++ }
+
+-/**
+- * Returns the currently selected item, or null if no item is
+- * selected.
+- *
+- * @return The currently selected item.
+- */
+-public synchronized String
+-getSelectedItem()
+-{
+- return (selectedIndex == -1
+- ? null
+- : ((String)pItems.elementAt(selectedIndex)));
+-}
++ /**
++ * Returns an array with one row containing the selected item.
++ *
++ * @return An array containing the selected item.
++ */
++ public synchronized Object[] getSelectedObjects()
++ {
++ if (selectedIndex == -1)
++ return null;
+
+-/*************************************************************************/
++ Object[] objs = new Object[1];
++ objs[0] = pItems.elementAt(selectedIndex);
+
+-/**
+- * Returns an array with one row containing the selected item.
+- *
+- * @return An array containing the selected item.
+- */
+-public synchronized Object[]
+-getSelectedObjects()
+-{
+- if (selectedIndex == -1)
+- return null;
++ return objs;
++ }
+
+- Object[] objs = new Object[1];
+- objs[0] = pItems.elementAt(selectedIndex);
++ /**
++ * Returns the index of the selected item.
++ *
++ * @return The index of the selected item.
++ */
++ public int getSelectedIndex()
++ {
++ return selectedIndex;
++ }
+
+- return(objs);
+-}
++ /**
++ * Forces the item at the specified index to be selected.
++ *
++ * @param index The index of the row to make selected.
++ *
++ * @exception IllegalArgumentException If the specified index is invalid.
++ */
++ public synchronized void select(int index)
++ {
++ if ((index < 0) || (index >= getItemCount()))
++ throw new IllegalArgumentException("Bad index: " + index);
+
+-/*************************************************************************/
++ if( selectedIndex == index )
++ return;
+
+-/**
+- * Returns the index of the selected item.
+- *
+- * @return The index of the selected item.
+- */
+-public int
+-getSelectedIndex()
+-{
+- return(selectedIndex);
+-}
++ selectedIndex = index;
++ if( peer != null )
++ ((ChoicePeer)peer).select( index );
++ }
+
+-/*************************************************************************/
++ /**
++ * Forces the named item to be selected.
++ *
++ * @param item The item to be selected.
++ *
++ * @exception IllegalArgumentException If the specified item does not exist.
++ */
++ public synchronized void select(String item)
++ {
++ int index = pItems.indexOf(item);
++ if( index >= 0 )
++ select( index );
++ }
+
+-/**
+- * Forces the item at the specified index to be selected.
+- *
+- * @param index The index of the row to make selected.
+- *
+- * @exception IllegalArgumentException If the specified index is invalid.
+- */
+-public synchronized void
+-select(int index)
+-{
+- if ((index < 0) || (index >= getItemCount()))
+- throw new IllegalArgumentException("Bad index: " + index);
++ /**
++ * Creates the native peer for this object.
++ */
++ public void addNotify()
++ {
++ if (peer == null)
++ peer = getToolkit ().createChoice (this);
++ super.addNotify ();
++ }
+
+- if (pItems.size() > 0) {
+- selectedIndex = index;
+- ChoicePeer cp = (ChoicePeer) peer;
+- if (cp != null) {
+- cp.select(index);
+- }
++ /**
++ * Adds the specified listener to the list of registered listeners for
++ * this object.
++ *
++ * @param listener The listener to add.
++ */
++ public synchronized void addItemListener(ItemListener listener)
++ {
++ item_listeners = AWTEventMulticaster.add(item_listeners, listener);
+ }
+-}
+
+-/*************************************************************************/
++ /**
++ * Removes the specified listener from the list of registered listeners for
++ * this object.
++ *
++ * @param listener The listener to remove.
++ */
++ public synchronized void removeItemListener(ItemListener listener)
++ {
++ item_listeners = AWTEventMulticaster.remove(item_listeners, listener);
++ }
+
+-/**
+- * Forces the named item to be selected.
+- *
+- * @param item The item to be selected.
+- *
+- * @exception IllegalArgumentException If the specified item does not exist.
+- */
+-public synchronized void
+-select(String item)
+-{
+- int index = pItems.indexOf(item);
+- if (index >= 0)
+- select(index);
+-}
++ /**
++ * Processes this event by invoking processItemEvent()
if the
++ * event is an instance of ItemEvent
, otherwise the event
++ * is passed to the superclass.
++ *
++ * @param event The event to process.
++ */
++ protected void processEvent(AWTEvent event)
++ {
++ if (event instanceof ItemEvent)
++ processItemEvent((ItemEvent)event);
++ else
++ super.processEvent(event);
++ }
+
+-/*************************************************************************/
+-
+-/**
+- * Creates the native peer for this object.
+- */
+-public void
+-addNotify()
+-{
+- if (peer == null)
+- peer = getToolkit ().createChoice (this);
+- super.addNotify ();
+-}
+-
+-/*************************************************************************/
+-
+-/**
+- * Adds the specified listener to the list of registered listeners for
+- * this object.
+- *
+- * @param listener The listener to add.
+- */
+-public synchronized void
+-addItemListener(ItemListener listener)
+-{
+- item_listeners = AWTEventMulticaster.add(item_listeners, listener);
+-}
+-
+-/*************************************************************************/
+-
+-/**
+- * Removes the specified listener from the list of registered listeners for
+- * this object.
+- *
+- * @param listener The listener to remove.
+- */
+-public synchronized void
+-removeItemListener(ItemListener listener)
+-{
+- item_listeners = AWTEventMulticaster.remove(item_listeners, listener);
+-}
+-
+-/*************************************************************************/
+-
+-/**
+- * Processes this event by invoking processItemEvent()
if the
+- * event is an instance of ItemEvent
, otherwise the event
+- * is passed to the superclass.
+- *
+- * @param event The event to process.
+- */
+-protected void
+-processEvent(AWTEvent event)
+-{
+- if (event instanceof ItemEvent)
+- processItemEvent((ItemEvent)event);
+- else
+- super.processEvent(event);
+-}
+-
+-void
+-dispatchEventImpl(AWTEvent e)
+-{
+- if (e.id <= ItemEvent.ITEM_LAST
+- && e.id >= ItemEvent.ITEM_FIRST
+- && (item_listeners != null || (eventMask & AWTEvent.ITEM_EVENT_MASK) != 0))
+- processEvent(e);
+- else
++ void dispatchEventImpl(AWTEvent e)
++ {
+ super.dispatchEventImpl(e);
+-}
+
+-/*************************************************************************/
++ if( e.id <= ItemEvent.ITEM_LAST && e.id >= ItemEvent.ITEM_FIRST &&
++ ( item_listeners != null ||
++ ( eventMask & AWTEvent.ITEM_EVENT_MASK ) != 0 ) )
++ processEvent(e);
++ }
+
+-/**
+- * Processes item event by dispatching to any registered listeners.
+- *
+- * @param event The event to process.
+- */
+-protected void
+-processItemEvent(ItemEvent event)
+-{
+- int index = pItems.indexOf((String) event.getItem());
+- // Don't call back into the peers when selecting index here
+- if (event.getStateChange() == ItemEvent.SELECTED)
+- this.selectedIndex = index;
+- if (item_listeners != null)
+- item_listeners.itemStateChanged(event);
+-}
++ /**
++ * Processes item event by dispatching to any registered listeners.
++ *
++ * @param event The event to process.
++ */
++ protected void processItemEvent(ItemEvent event)
++ {
++ int index = pItems.indexOf((String) event.getItem());
++ if (item_listeners != null)
++ item_listeners.itemStateChanged(event);
++ }
+
+-/*************************************************************************/
++ /**
++ * Returns a debugging string for this object.
++ *
++ * @return A debugging string for this object.
++ */
++ protected String paramString()
++ {
++ return "selectedIndex=" + selectedIndex + "," + super.paramString();
++ }
+
+-/**
+- * Returns a debugging string for this object.
+- *
+- * @return A debugging string for this object.
+- */
+-protected String
+-paramString()
+-{
+- return ("selectedIndex=" + selectedIndex + "," + super.paramString());
+-}
+-
+ /**
+ * Returns an array of all the objects currently registered as FooListeners
+ * upon this Choice. FooListeners are registered using the addFooListener
+Index: libjava/classpath/include/gnu_java_awt_peer_gtk_GtkChoicePeer.h
+===================================================================
+--- libjava/classpath/include/gnu_java_awt_peer_gtk_GtkChoicePeer.h (revision 116606)
++++ libjava/classpath/include/gnu_java_awt_peer_gtk_GtkChoicePeer.h (working copy)
+@@ -11,9 +11,8 @@
+ #endif
+
+ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkChoicePeer_create (JNIEnv *env, jobject);
+-JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkChoicePeer_append (JNIEnv *env, jobject, jobjectArray);
+ JNIEXPORT jint JNICALL Java_gnu_java_awt_peer_gtk_GtkChoicePeer_nativeGetSelected (JNIEnv *env, jobject);
+-JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkChoicePeer_nativeAdd (JNIEnv *env, jobject, jstring, jint);
++JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkChoicePeer_add (JNIEnv *env, jobject, jstring, jint);
+ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkChoicePeer_nativeRemove (JNIEnv *env, jobject, jint);
+ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkChoicePeer_nativeRemoveAll (JNIEnv *env, jobject);
+ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkChoicePeer_connectSignals (JNIEnv *env, jobject);
+Index: libjava/classpath/ChangeLog
+===================================================================
+--- libjava/classpath/ChangeLog (revision 116606)
++++ libjava/classpath/ChangeLog (working copy)
+@@ -1,3 +1,33 @@
++2006-08-02 Sven de Marothy
++
++ * gnu/java/awt/peer/gtk/GtkChoicePeer.java
++ (remove): Force event on removing item 0 when it's selected.
++ (handleEvent): Always call Choice.selected().
++ * java/awt/Choice.java:
++ (remove): Simplify and correct.
++
++2006-07-30 Sven de Marothy
++
++ * java/awt/Choice.java:
++ (accessibleAction): Call select() directly.
++ (add, insert, remove): Reimplement.
++ (dispatchEventImpl): Always call super.
++ (processItemEvent): Does not set the index.
++ * include/gnu_java_awt_peer_gtk_GtkChoicePeer.h
++ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
++ (append): removed.
++ (nativeAdd): Name changed to add.
++ (selection_changed_cb): Simplify callback.
++ * gnu/java/awt/peer/gtk/GtkChoicePeer.java
++ (selected): New field.
++ (add): Replaced with native impl.
++ (handleEvent): New method.
++
++2006-09-08 Thomas Fitzsimmons
++
++ * tools/gnu/classpath/tools/appletviewer/Main.java: Warn about
++ missing security manager when run in standalone mode.
++
+ 2006-07-06 Paul Eggert
+
+ Port to hosts whose 'sort' and 'tail' implementations
+Index: libjava/classpath/ChangeLog.gcj
+===================================================================
+--- libjava/classpath/ChangeLog.gcj (revision 116606)
++++ libjava/classpath/ChangeLog.gcj (working copy)
+@@ -1,3 +1,53 @@
++2006-09-25 Tom Tromey
++
++ * native/jni/gconf-peer/Makefile.in: Rebuilt.
++ * native/jni/gconf-peer/Makefile.am (libgconfpeer_la_LDFLAGS): New
++ variable.
++
++2006-09-25 Tom Tromey
++
++ PR libgcj/29178:
++ * gnu/java/nio/charset/US_ASCII.java (Encoder.canEncode): New method.
++ (Encoder.canEncode): Likewise.
++ (Encoder.encodeLoop): Return unmappable for all non-ASCII characters.
++ * gnu/java/nio/charset/ByteCharset.java (Encoder.canEncode): New
++ method.
++ (Encoder.canEncode): Likewise.
++ * gnu/java/nio/charset/ISO_8859_1.java (Encoder.canEncode): New
++ method.
++ (Encoder.canEncode): Likewise.
++
++2006-09-22 David Daney
++
++ PR classpath/28661
++ * gnu/java/net/protocol/http/HTTPURLConnection.java (connect): Add
++ default content-type for POST method.
++
++2006-09-25 Mark Wielaard
++
++ Suggested by Aaron M. Ucko
++ Fixes bug #29203
++ * native/fdlibm/mprec.c (ulp): Define L as int32_t.
++
++2006-09-18 Tom Tromey
++
++ * gnu/javax/net/ssl/provider/SSLSocket.java (isBound, isClosed,
++ isConnected): Removed old comment.
++ (getRemoteSocketAddress): Uncommented.
++ (setOOBInline, getOOBInline, setKeepAlive, getKeepAlive,
++ setTrafficClass, getTrafficClass, setReuseAddress,
++ getReuseAddress, shutdownInput, shutdownOutput, isInputShutdown,
++ isOutputShutdown): Uncommented.
++
++2006-08-29 Gary Benson
++
++ * java/net/SocketPermission.java
++ (maybeBracketIPv6Address): New method.
++ (): Pass the hostport argument through the above.
++
++ * java/net/NetworkInterface.java (getInetAddresses):
++ Revert the previous change.
++
+ 2006-08-24 Gary Benson
+
+ * java/net/NetworkInterface.java (getInetAddresses): Bracket IPv6
+Index: libjava/ChangeLog
+===================================================================
+--- libjava/ChangeLog (revision 116606)
++++ libjava/ChangeLog (working copy)
+@@ -1,3 +1,27 @@
++2006-09-27 Tom Tromey
++
++ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=201712
++ * java/util/Locale.java (hashcode): No longer transient.
++ (writeObject): Use ObjectOutputStream.PutField and
++ defaultWriteObject.
++ (readObject): Use defaultReadObject.
++
++2006-09-19 Mark Wielaard
++
++ Fixes bug #29137
++ * java/util/logging/LogManager.java (addLogger): Always check for
++ existing children of a new Logger.
++
++2006-09-19 Tom Tromey
++
++ * java/util/logging/LogManager.java: Re-merged with Classpath.
++
++2006-08-31 Tom Tromey
++
++ PR libgcj/28698:
++ * libgcj_bc.c (DECLARE_PRIM_TYPE): New macro. Declare primitive
++ classes.
++
+ 2006-08-22 Thomas Fitzsimmons
+
+ PR libgcj/27890
+Index: libjava/java/util/Locale.java
+===================================================================
+--- libjava/java/util/Locale.java (revision 116606)
++++ libjava/java/util/Locale.java (working copy)
+@@ -1,5 +1,5 @@
+ /* Locale.java -- i18n locales
+- Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
++ Copyright (C) 1998, 1999, 2001, 2002, 2005, 2006 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+@@ -190,7 +190,7 @@
+ *
+ * @serial should be -1 in serial streams
+ */
+- private transient int hashcode;
++ private int hashcode;
+
+ /**
+ * The default locale. Except for during bootstrapping, this should never be
+@@ -839,11 +839,9 @@
+ private void writeObject(ObjectOutputStream s)
+ throws IOException
+ {
+- s.writeObject(language);
+- s.writeObject(country);
+- s.writeObject(variant);
+- // Hashcode field is always written as -1.
+- s.writeInt(-1);
++ ObjectOutputStream.PutField fields = s.putFields();
++ fields.put("hashcode", -1);
++ s.defaultWriteObject();
+ }
+
+ /**
+@@ -857,10 +855,10 @@
+ private void readObject(ObjectInputStream s)
+ throws IOException, ClassNotFoundException
+ {
+- language = ((String) s.readObject()).intern();
+- country = ((String) s.readObject()).intern();
+- variant = ((String) s.readObject()).intern();
+- // Recompute hashcode.
++ s.defaultReadObject();
++ language = language.intern();
++ country = country.intern();
++ variant = variant.intern();
+ hashcode = language.hashCode() ^ country.hashCode() ^ variant.hashCode();
+ }
+ } // class Locale
+Index: libjava/java/util/logging/LogManager.java
+===================================================================
+--- libjava/java/util/logging/LogManager.java (revision 116606)
++++ libjava/java/util/logging/LogManager.java (working copy)
+@@ -39,6 +39,8 @@
+
+ package java.util.logging;
+
++import gnu.classpath.SystemProperties;
++
+ import java.beans.PropertyChangeListener;
+ import java.beans.PropertyChangeSupport;
+ import java.io.ByteArrayInputStream;
+@@ -50,12 +52,11 @@
+ import java.util.Enumeration;
+ import java.util.HashMap;
+ import java.util.Iterator;
++import java.util.List;
+ import java.util.Map;
+ import java.util.Properties;
+ import java.util.StringTokenizer;
+
+-import gnu.classpath.SystemProperties;
+-
+ /**
+ * The LogManager
maintains a hierarchical namespace
+ * of Logger objects and manages properties for configuring the logging
+@@ -108,11 +109,23 @@
+ public class LogManager
+ {
+ /**
++ * The object name for the logging management bean.
++ * @since 1.5
++ */
++ public static final String LOGGING_MXBEAN_NAME
++ = "java.util.logging:type=Logging";
++
++ /**
+ * The singleton LogManager instance.
+ */
+ private static LogManager logManager;
+
+ /**
++ * The singleton logging bean.
++ */
++ private static LoggingMXBean loggingBean;
++
++ /**
+ * The registered named loggers; maps the name of a Logger to
+ * a WeakReference to it.
+ */
+@@ -305,24 +318,21 @@
+ * When adding "foo.bar", the logger "foo.bar.baz" should change
+ * its parent to "foo.bar".
+ */
+- if (parent != Logger.root)
++ for (Iterator iter = loggers.keySet().iterator(); iter.hasNext();)
+ {
+- for (Iterator iter = loggers.keySet().iterator(); iter.hasNext();)
+- {
+- Logger possChild = (Logger) ((WeakReference) loggers.get(iter.next()))
+- .get();
+- if ((possChild == null) || (possChild == logger)
+- || (possChild.getParent() != parent))
+- continue;
+-
+- if (! possChild.getName().startsWith(name))
+- continue;
+-
+- if (possChild.getName().charAt(name.length()) != '.')
+- continue;
+-
+- possChild.setParent(logger);
+- }
++ Logger possChild = (Logger) ((WeakReference) loggers.get(iter.next()))
++ .get();
++ if ((possChild == null) || (possChild == logger)
++ || (possChild.getParent() != parent))
++ continue;
++
++ if (! possChild.getName().startsWith(name))
++ continue;
++
++ if (possChild.getName().charAt(name.length()) != '.')
++ continue;
++
++ possChild.setParent(logger);
+ }
+
+ return true;
+@@ -836,11 +846,11 @@
+ }
+ catch (ClassNotFoundException e)
+ {
+- warn(property, className, "class not found");
++ warn(property, className, "class not found", e);
+ }
+ catch (IllegalAccessException e)
+ {
+- warn(property, className, "illegal access");
++ warn(property, className, "illegal access", e);
+ }
+ catch (InstantiationException e)
+ {
+@@ -848,7 +858,7 @@
+ }
+ catch (java.lang.LinkageError e)
+ {
+- warn(property, className, "linkage error");
++ warn(property, className, "linkage error", e);
+ }
+
+ return null;
+@@ -909,4 +919,63 @@
+ }
+ }
+
++ /**
++ * Return the logging bean. There is a single logging bean per
++ * VM instance.
++ * @since 1.5
++ */
++ public static synchronized LoggingMXBean getLoggingMXBean()
++ {
++ if (loggingBean == null)
++ {
++ loggingBean = new LoggingMXBean()
++ {
++ public String getLoggerLevel(String logger)
++ {
++ LogManager mgr = getLogManager();
++ Logger l = mgr.getLogger(logger);
++ if (l == null)
++ return null;
++ Level lev = l.getLevel();
++ if (lev == null)
++ return "";
++ return lev.getName();
++ }
++
++ public List getLoggerNames()
++ {
++ LogManager mgr = getLogManager();
++ // This is inefficient, but perhaps better for maintenance.
++ return Collections.list(mgr.getLoggerNames());
++ }
++
++ public String getParentLoggerName(String logger)
++ {
++ LogManager mgr = getLogManager();
++ Logger l = mgr.getLogger(logger);
++ if (l == null)
++ return null;
++ l = l.getParent();
++ if (l == null)
++ return "";
++ return l.getName();
++ }
++
++ public void setLoggerLevel(String logger, String level)
++ {
++ LogManager mgr = getLogManager();
++ Logger l = mgr.getLogger(logger);
++ if (l == null)
++ throw new IllegalArgumentException("no logger named " + logger);
++ Level newLevel;
++ if (level == null)
++ newLevel = null;
++ else
++ newLevel = Level.parse(level);
++ l.setLevel(newLevel);
++ }
++ };
++ }
++ return loggingBean;
++ }
+ }
+Index: libjava/Makefile.am
+===================================================================
+--- libjava/Makefile.am (revision 116606)
++++ libjava/Makefile.am (working copy)
+@@ -332,7 +332,21 @@
+ rm -rf $$JARDIR $$JARDIR.stamp
+
+ libgcj-tools-$(gcc_version).jar: classpath/tools/tools.jar
+- cp $< $@
++ javasrcdir=`cd $(srcdir) && pwd`; \
++ JARDIR=`mktemp -d $@.XXXXXX` || exit 1; \
++ touch -r $$javasrcdir/../gcc/ChangeLog $$JARDIR.stamp; \
++ [ $$javasrcdir/../gcc/java/ChangeLog -nt $$JARDIR.stamp ] \
++ && touch -r $$javasrcdir/../gcc/java/ChangeLog $$JARDIR.stamp; \
++ [ $$javasrcdir/ChangeLog -nt $$JARDIR.stamp ] \
++ && touch -r $$javasrcdir/ChangeLog $$JARDIR.stamp; \
++ cd $$JARDIR || exit 1; \
++ $(JAR) -xf ../$<; \
++ rm -rf META-INF; \
++ find -type f | xargs touch -r ../$$JARDIR.stamp; \
++ find -type d | xargs touch -r ../$$JARDIR.stamp; \
++ find * | LC_ALL=C sort | $(JAR) -cfM@E ../$@ || exit 1; \
++ cd ..; \
++ rm -rf $$JARDIR $$JARDIR.stamp
+
+ CLEANFILES = libgcj-$(gcc_version).jar libgcj-tools-$(gcc_version).jar
+ DISTCLEANFILES = native.dirs
--- gcc-4.1-4.1.1.orig/debian/patches/pr27880.dpatch
+++ gcc-4.1-4.1.1/debian/patches/pr27880.dpatch
@@ -0,0 +1,73 @@
+#! /bin/sh -e
+
+# DP: Backport of PR target/27880 to the gcc-4_1-branch.
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ cd ${dir}gcc && autoconf
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ rm ${dir}gcc/configure
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+From: Steve Ellcey
+Sender: gcc-patches-owner@gcc.gnu.org
+To: gcc-patches@gcc.gnu.org
+Subject: Patch for PR target/27880 (Use of _Unwind_GetIPInfo)
+Date: Fri, 6 Oct 2006 14:07:57 -0700 (PDT)
+
+In addition to the uses of _Unwind_GetIPInfo that are in libstdc++ and
+libjava (already fixed), there is a use of it in unwind-c.c which is
+compiled into libgcc on IA64 Linux when using --with-system-libunwind.
+
+This patch is to ifdef that use of _Unwind_GetIPInfo so that when
+--with-system-libunwind is specified and the system unwind library does
+not contain _Unwind_GetIPInfo we will not generate any uses of it.
+
+For any cross-build, we assume that _Unwind_GetIPInfo exists.
+
+I am regression testing now (with and without --with-system-libunwind),
+OK for checkin on main line if testing goes OK?
+
+Steve Ellcey
+sje@cup.hp.com
+
+
+
+2006-10-06 Steve Ellcey
+
+ PR target/27880
+ * configure.ac (HAVE_GETIPINFO): Check for _Unwind_GetIPInfo.
+ * unwind-c.c (PERSONALITY_FUNCTION): Ifdef use of _Unwind_GetIPInfo.
+
+Index: unwind-c.c
+===================================================================
+--- gcc/unwind-c.c (revision 117385)
++++ gcc/unwind-c.c (working copy)
+@@ -157,7 +157,11 @@ PERSONALITY_FUNCTION (int version,
+
+ /* Parse the LSDA header. */
+ p = parse_lsda_header (context, language_specific_data, &info);
++#ifdef HAVE_GETIPINFO
+ ip = _Unwind_GetIPInfo (context, &ip_before_insn);
++#else
++ ip = _Unwind_GetIP (context);
++#endif
+ if (! ip_before_insn)
+ --ip;
+ landing_pad = 0;
--- gcc-4.1-4.1.1.orig/debian/patches/libjava-lib32-properties.dpatch
+++ gcc-4.1-4.1.1/debian/patches/libjava-lib32-properties.dpatch
@@ -0,0 +1,85 @@
+#! /bin/sh -e
+
+# DP: - When running the i386 binaries on amd64, adjust the properties
+# DP: java.home, gnu.classpath.home.url, sun.boot.class.path,
+# DP: gnu.gcj.precompiled.db.path.
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ cd ${dir}libjava && autoconf
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ rm -f ${dir}libjava/configure
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+--- libjava/gnu/classpath/natSystemProperties.cc.orig 2006-09-10 14:07:47.130718000 +0200
++++ libjava/gnu/classpath/natSystemProperties.cc 2006-09-10 16:30:31.640718000 +0200
+@@ -209,6 +209,18 @@
+ // part we do this because most people specify only --prefix and
+ // nothing else when installing gcj. Plus, people are free to
+ // redefine `java.home' with `-D' if necessary.
++ struct utsname u;
++#if defined(__linux__) && defined (__i386__)
++ uname (&u);
++ if (! strcmp ("x86_64", u.machine))
++ {
++ SET ("java.home", "/usr/lib32/jvm/java-1.4.2-gcj-4.1-1.4.2.0/jre");
++ SET ("gnu.classpath.home", "/usr");
++ SET ("gnu.classpath.home.url", "file:///usr/lib/../lib32");
++ }
++ else
++#endif
++ {
+ SET ("java.home", JAVA_HOME);
+ SET ("gnu.classpath.home", PREFIX);
+ // This is set to $(toolexeclibdir) because we use this to find
+@@ -217,11 +229,11 @@
+ strcpy (val2, "file://");
+ strcat (val2, TOOLEXECLIBDIR);
+ SET ("gnu.classpath.home.url", val2);
++ }
+
+ SET ("file.encoding", default_file_encoding);
+
+ #ifdef HAVE_UNAME
+- struct utsname u;
+ if (! uname (&u))
+ {
+ SET ("os.name", u.sysname);
+@@ -348,11 +360,21 @@
+ // without overriding java.endorsed.dirs.
+ SET ("gnu.gcj.runtime.endorsed.dirs", GCJ_ENDORSED_DIRS);
+
++#if defined(__linux__) && defined (__i386__)
++ if (! strcmp ("x86_64", u.machine))
++ {
++ SET ("sun.boot.class.path", "/usr/lib32/jvm/java-1.4.2-gcj-4.1-1.4.2.0/jre/lib/rt.jar");
++ SET ("gnu.gcj.precompiled.db.path", "/var/lib32/gcj-4.1/classmap.db");
++ }
++ else
++#endif
++ {
+ // The path to libgcj's boot classes
+ SET ("sun.boot.class.path", BOOT_CLASS_PATH);
+
+ // If there is a default system database, set it.
+ SET ("gnu.gcj.precompiled.db.path", LIBGCJ_DEFAULT_DATABASE);
++ }
+
+ // Set some properties according to whatever was compiled in with
+ // `-D'. Important: after this point, the only properties that
--- gcc-4.1-4.1.1.orig/debian/patches/gccbug.dpatch
+++ gcc-4.1-4.1.1/debian/patches/gccbug.dpatch
@@ -0,0 +1,36 @@
+#! /bin/sh -e
+
+# DP: Use sensible-editor instead of vi as fallback editor
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+--- gcc/gccbug.in~ 2003-03-01 00:51:42.000000000 +0100
++++ gcc/gccbug.in 2003-03-02 12:08:36.000000000 +0100
+@@ -134,7 +134,7 @@
+ # If they don't have a preferred editor set, then use
+ if [ -z "$VISUAL" ]; then
+ if [ -z "$EDITOR" ]; then
+- EDIT=vi
++ EDIT=/usr/bin/sensible-editor
+ else
+ EDIT="$EDITOR"
+ fi
--- gcc-4.1-4.1.1.orig/debian/patches/pr25524.dpatch
+++ gcc-4.1-4.1.1/debian/patches/pr25524.dpatch
@@ -0,0 +1,491 @@
+#! /bin/sh -e
+
+# DP: Backport PR libstdc++/25524 from the trunk
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+gcc:
+
+2006-01-20 Joseph S. Myers
+
+ PR libstdc++/25524
+ * cppdefault.h (struct default_include): Add multilib flag.
+ * cppdefault.c (cpp_include_defaults): Set it.
+ * c.opt (-imultilib): New option.
+ * c-opts.c (imultilib): New.
+ (c_common_handle_option): Handle -imultilib.
+ (c_common_post_options): Likewise.
+ * c-incpath.c (add_standard_paths, register_include_chains):
+ Likewise.
+ * c-incpath.h (register_include_chains): Add extra parameter.
+ * gcc.c (do_spec_1): Generate -imultilib option.
+ (The Specs Language): Update %I description.
+ (process_command): Update copyright notice.
+ * doc/cppopts.texi (-imultilib): Document.
+ * doc/invoke.texi (-imultilib): Include in option summary.
+ (%I): Update specs documentation.
+
+libstdc++-v3:
+
+2006-01-20 Joseph S. Myers
+
+ PR libstdc++/25524
+ * include/Makefile.am: Install host-specific headers in multilib
+ subdirectory.
+ * include/Makefile.in: Regenerate.
+
+#Index: gcc/doc/cppopts.texi
+#===================================================================
+#--- gcc/doc/cppopts.texi (revision 114541)
+#+++ gcc/doc/cppopts.texi (working copy)
+#@@ -1,4 +1,4 @@
+#-@c Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+#+@c Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+# @c Free Software Foundation, Inc.
+# @c This is part of the CPP and GCC manuals.
+# @c For copying conditions, see the file gcc.texi.
+#@@ -483,6 +483,11 @@
+# This option is like the @option{--sysroot} option, but applies only to
+# header files. See the @option{--sysroot} option for more information.
+#
+#+@item -imultilib @var{dir}
+#+@opindex imultilib
+#+Use @var{dir} as a subdirectory of the directory containing
+#+target-specific C++ headers.
+#+
+# @item -isystem @var{dir}
+# @opindex isystem
+# Search @var{dir} for header files, after all directories specified by
+#Index: gcc/doc/invoke.texi
+#===================================================================
+#--- gcc/doc/invoke.texi (revision 114541)
+#+++ gcc/doc/invoke.texi (working copy)
+#@@ -5,8 +5,8 @@
+#
+# @ignore
+# @c man begin COPYRIGHT
+#-Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
+#-1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+#+Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+#+1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+#
+# Permission is granted to copy, distribute and/or modify this document
+# under the terms of the GNU Free Documentation License, Version 1.2 or
+#@@ -352,7 +352,7 @@
+# -include @var{file} -imacros @var{file} @gol
+# -iprefix @var{file} -iwithprefix @var{dir} @gol
+# -iwithprefixbefore @var{dir} -isystem @var{dir} @gol
+#--isysroot @var{dir} @gol
+#+-imultilib @var{dir} -isysroot @var{dir} @gol
+# -M -MM -MF -MG -MP -MQ -MT -nostdinc @gol
+# -P -fworking-directory -remap @gol
+# -trigraphs -undef -U@var{macro} -Wp,@var{option} @gol
+#@@ -6800,9 +6800,9 @@
+#
+# @item %I
+# Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
+#-@option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}), and
+#+@option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
+# @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
+#-as necessary.
+#+and @option{-imultilib} as necessary.
+#
+# @item %s
+# Current argument is the name of a library or startup file of some sort.
+Index: gcc/gcc.c
+===================================================================
+--- gcc/gcc.c (revision 114541)
++++ gcc/gcc.c (working copy)
+@@ -439,8 +439,8 @@
+ SUFFIX characters following %O as they would following, for
+ example, `.o'.
+ %I Substitute any of -iprefix (made from GCC_EXEC_PREFIX), -isysroot
+- (made from TARGET_SYSTEM_ROOT), and -isystem (made from COMPILER_PATH
+- and -B options) as necessary.
++ (made from TARGET_SYSTEM_ROOT), -isystem (made from COMPILER_PATH
++ and -B options) and -imultilib as necessary.
+ %s current argument is the name of a library or startup file of some sort.
+ Search for that file in a standard list of directories
+ and substitute the full name found.
+@@ -4885,6 +4885,15 @@
+ {
+ struct prefix_list *pl = include_prefixes.plist;
+
++ if (multilib_dir)
++ {
++ do_spec_1 ("-imultilib", 1, NULL);
++ /* Make this a separate argument. */
++ do_spec_1 (" ", 0, NULL);
++ do_spec_1 (multilib_dir, 1, NULL);
++ do_spec_1 (" ", 0, NULL);
++ }
++
+ if (gcc_exec_prefix)
+ {
+ do_spec_1 ("-iprefix", 1, NULL);
+Index: gcc/cppdefault.c
+===================================================================
+--- gcc/cppdefault.c (revision 114541)
++++ gcc/cppdefault.c (working copy)
+@@ -1,6 +1,6 @@
+ /* CPP Library.
+ Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+- 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
++ 1999, 2000, 2003, 2004, 2006 Free Software Foundation, Inc.
+ Contributed by Per Bothner, 1994-95.
+ Based on CCCP program by Paul Rubin, June 1986
+ Adapted to ANSI C, Richard Stallman, Jan 1987
+@@ -48,44 +48,44 @@
+ = {
+ #ifdef GPLUSPLUS_INCLUDE_DIR
+ /* Pick up GNU C++ generic include files. */
+- { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0 },
++ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0, 0 },
+ #endif
+ #ifdef GPLUSPLUS_TOOL_INCLUDE_DIR
+ /* Pick up GNU C++ target-dependent include files. */
+- { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0 },
++ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0, 1 },
+ #endif
+ #ifdef GPLUSPLUS_BACKWARD_INCLUDE_DIR
+ /* Pick up GNU C++ backward and deprecated include files. */
+- { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0 },
++ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0, 0 },
+ #endif
+ #ifdef LOCAL_INCLUDE_DIR
+ /* /usr/local/include comes before the fixincluded header files. */
+- { LOCAL_INCLUDE_DIR, 0, 0, 1, 1 },
++ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 },
+ #endif
+ #ifdef PREFIX_INCLUDE_DIR
+- { PREFIX_INCLUDE_DIR, 0, 0, 1, 0 },
++ { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0 },
+ #endif
+ #ifdef GCC_INCLUDE_DIR
+ /* This is the dir for fixincludes and for gcc's private headers. */
+- { GCC_INCLUDE_DIR, "GCC", 0, 0, 0 },
++ { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 },
+ #endif
+ #ifdef CROSS_INCLUDE_DIR
+ /* One place the target system's headers might be. */
+- { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0 },
++ { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0 },
+ #endif
+ #ifdef TOOL_INCLUDE_DIR
+ /* Another place the target system's headers might be. */
+- { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0 },
++ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0 },
+ #endif
+ #ifdef SYSTEM_INCLUDE_DIR
+ /* Some systems have an extra dir of include files. */
+- { SYSTEM_INCLUDE_DIR, 0, 0, 0, 1 },
++ { SYSTEM_INCLUDE_DIR, 0, 0, 0, 1, 0 },
+ #endif
+ #ifdef STANDARD_INCLUDE_DIR
+ /* /usr/include comes dead last. */
+- { STANDARD_INCLUDE_DIR, STANDARD_INCLUDE_COMPONENT, 0, 0, 1 },
++ { STANDARD_INCLUDE_DIR, STANDARD_INCLUDE_COMPONENT, 0, 0, 1, 0 },
+ #endif
+- { 0, 0, 0, 0, 0 }
++ { 0, 0, 0, 0, 0, 0 }
+ };
+ #endif /* no INCLUDE_DEFAULTS */
+
+Index: gcc/cppdefault.h
+===================================================================
+--- gcc/cppdefault.h (revision 114541)
++++ gcc/cppdefault.h (working copy)
+@@ -1,6 +1,6 @@
+ /* CPP Library.
+ Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+- 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
++ 1999, 2000, 2003, 2004, 2006 Free Software Foundation, Inc.
+ Contributed by Per Bothner, 1994-95.
+ Based on CCCP program by Paul Rubin, June 1986
+ Adapted to ANSI C, Richard Stallman, Jan 1987
+@@ -43,6 +43,9 @@
+ C++. */
+ const char add_sysroot; /* FNAME should be prefixed by
+ cpp_SYSROOT. */
++ const char multilib; /* FNAME should have the multilib path
++ specified with -imultilib
++ appended. */
+ };
+
+ extern const struct default_include cpp_include_defaults[];
+Index: gcc/c.opt
+===================================================================
+--- gcc/c.opt (revision 114541)
++++ gcc/c.opt (working copy)
+@@ -753,6 +753,10 @@
+ C ObjC C++ ObjC++ Joined Separate
+ -imacros Accept definition of macros in
+
++imultilib
++C ObjC C++ ObjC++ Joined Separate
++-imultilib Set to be the multilib include subdirectory
++
+ include
+ C ObjC C++ ObjC++ Joined Separate
+ -include Include the contents of before other files
+Index: gcc/c-opts.c
+===================================================================
+--- gcc/c-opts.c (revision 114541)
++++ gcc/c-opts.c (working copy)
+@@ -79,6 +79,9 @@
+ /* The prefix given by -iprefix, if any. */
+ static const char *iprefix;
+
++/* The multilib directory given by -imultilib, if any. */
++static const char *imultilib;
++
+ /* The system root, if any. Overridden by -isysroot. */
+ static const char *sysroot = TARGET_SYSTEM_ROOT;
+
+@@ -816,6 +819,10 @@
+ defer_opt (code, arg);
+ break;
+
++ case OPT_imultilib:
++ imultilib = arg;
++ break;
++
+ case OPT_iprefix:
+ iprefix = arg;
+ break;
+@@ -970,7 +977,7 @@
+
+ sanitize_cpp_opts ();
+
+- register_include_chains (parse_in, sysroot, iprefix,
++ register_include_chains (parse_in, sysroot, iprefix, imultilib,
+ std_inc, std_cxx_inc && c_dialect_cxx (), verbose);
+
+ flag_inline_trees = 1;
+Index: gcc/c-incpath.c
+===================================================================
+--- gcc/c-incpath.c (revision 114541)
++++ gcc/c-incpath.c (working copy)
+@@ -1,6 +1,7 @@
+ /* Set up combined include path chain for the preprocessor.
+ Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+- 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
++ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
++ Free Software Foundation, Inc.
+
+ Broken out of cppinit.c and cppfiles.c and rewritten Mar 2003.
+
+@@ -45,8 +46,10 @@
+ # define INO_T_COPY(DEST, SRC) (DEST) = (SRC)
+ #endif
+
++static const char dir_separator_str[] = { DIR_SEPARATOR, 0 };
++
+ static void add_env_var_paths (const char *, int);
+-static void add_standard_paths (const char *, const char *, int);
++static void add_standard_paths (const char *, const char *, const char *, int);
+ static void free_path (struct cpp_dir *, int);
+ static void merge_include_chains (cpp_reader *, int);
+ static struct cpp_dir *remove_duplicates (cpp_reader *, struct cpp_dir *,
+@@ -120,7 +123,8 @@
+
+ /* Append the standard include chain defined in cppdefault.c. */
+ static void
+-add_standard_paths (const char *sysroot, const char *iprefix, int cxx_stdinc)
++add_standard_paths (const char *sysroot, const char *iprefix,
++ const char *imultilib, int cxx_stdinc)
+ {
+ const struct default_include *p;
+ size_t len;
+@@ -142,6 +146,8 @@
+ if (!strncmp (p->fname, cpp_GCC_INCLUDE_DIR, len))
+ {
+ char *str = concat (iprefix, p->fname + len, NULL);
++ if (p->multilib && imultilib)
++ str = concat (str, dir_separator_str, imultilib, NULL);
+ add_path (str, SYSTEM, p->cxx_aware, false);
+ }
+ }
+@@ -160,6 +166,9 @@
+ else
+ str = update_path (p->fname, p->component);
+
++ if (p->multilib && imultilib)
++ str = concat (str, dir_separator_str, imultilib, NULL);
++
+ add_path (str, SYSTEM, p->cxx_aware, false);
+ }
+ }
+@@ -357,8 +366,8 @@
+ removal, and registration with cpplib. */
+ void
+ register_include_chains (cpp_reader *pfile, const char *sysroot,
+- const char *iprefix, int stdinc, int cxx_stdinc,
+- int verbose)
++ const char *iprefix, const char *imultilib,
++ int stdinc, int cxx_stdinc, int verbose)
+ {
+ static const char *const lang_env_vars[] =
+ { "C_INCLUDE_PATH", "CPLUS_INCLUDE_PATH",
+@@ -380,7 +389,7 @@
+
+ /* Finally chain on the standard directories. */
+ if (stdinc)
+- add_standard_paths (sysroot, iprefix, cxx_stdinc);
++ add_standard_paths (sysroot, iprefix, imultilib, cxx_stdinc);
+
+ target_c_incpath.extra_includes (sysroot, iprefix, stdinc);
+
+Index: gcc/c-incpath.h
+===================================================================
+--- gcc/c-incpath.h (revision 114541)
++++ gcc/c-incpath.h (working copy)
+@@ -1,5 +1,5 @@
+ /* Set up combined include path for the preprocessor.
+- Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
++ Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+@@ -18,7 +18,8 @@
+ extern void split_quote_chain (void);
+ extern void add_path (char *, int, int, bool);
+ extern void register_include_chains (cpp_reader *, const char *,
+- const char *, int, int, int);
++ const char *, const char *,
++ int, int, int);
+ extern void add_cpp_dir_path (struct cpp_dir *, int);
+
+ struct target_c_incpath_s {
+Index: libstdc++-v3/include/Makefile.in
+===================================================================
+--- libstdc++-v3/include/Makefile.in (revision 114541)
++++ libstdc++-v3/include/Makefile.in (working copy)
+@@ -822,6 +822,7 @@
+ @GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE@c_compatibility_headers_extra = ${c_compatibility_headers}
+ host_srcdir = ${glibcxx_srcdir}/$(OS_INC_SRCDIR)
+ host_builddir = ./${host_alias}/bits
++host_installdir = ${gxx_include_dir}/${host_alias}$(MULTISUBDIR)/bits
+ host_headers = \
+ ${host_srcdir}/ctype_base.h \
+ ${host_srcdir}/ctype_inline.h \
+@@ -858,6 +859,7 @@
+
+ pch_input = ${host_builddir}/stdc++.h
+ pch_output_builddir = ${host_builddir}/stdc++.h.gch
++pch_output_installdir = ${host_installdir}/stdc++.h.gch
+ pch_source = ${glibcxx_srcdir}/include/stdc++.h
+ PCHFLAGS = -Winvalid-pch -Wno-deprecated -x c++-header $(CXXFLAGS)
+ @GLIBCXX_BUILD_PCH_FALSE@pch_build =
+@@ -1279,9 +1281,9 @@
+ # are copied here.
+ install-freestanding-headers:
+ $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}
+- $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${host_builddir}
++ $(mkinstalldirs) $(DESTDIR)${host_installdir}
+ for file in ${host_srcdir}/os_defines.h ${host_builddir}/c++config.h; do \
+- $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${host_builddir}; done
++ $(INSTALL_DATA) $${file} $(DESTDIR)${host_installdir}; done
+ $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${std_builddir}
+ $(INSTALL_DATA) ${std_builddir}/limits $(DESTDIR)${gxx_include_dir}/${std_builddir}
+ $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${c_base_builddir}
+@@ -1341,15 +1343,15 @@
+ $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${debug_builddir}
+ for file in ${debug_headers}; do \
+ $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${debug_builddir}; done
+- $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${host_builddir}
++ $(mkinstalldirs) $(DESTDIR)${host_installdir}
+ for file in ${host_headers} ${host_headers_extra} \
+ ${thread_host_headers}; do \
+- $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${host_builddir}; done
++ $(INSTALL_DATA) $${file} $(DESTDIR)${host_installdir}; done
+
+ install-pch:
+- $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${pch_output_builddir}
++ $(mkinstalldirs) $(DESTDIR)${pch_output_installdir}
+ for file in ${pch_output_builddir}/*; do \
+- $(INSTALL_DATA) $$file $(DESTDIR)${gxx_include_dir}/${pch_output_builddir}; done
++ $(INSTALL_DATA) $$file $(DESTDIR)${pch_output_installdir}; done
+
+ # Stop implicit '.o' make rules from ever stomping on extensionless
+ # headers, in the improbable case where some foolish, crack-addled
+Index: libstdc++-v3/include/Makefile.am
+===================================================================
+--- libstdc++-v3/include/Makefile.am (revision 114541)
++++ libstdc++-v3/include/Makefile.am (working copy)
+@@ -1,6 +1,7 @@
+ ## Makefile for the include subdirectory of the GNU C++ Standard library.
+ ##
+-## Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
++## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006
++## Free Software Foundation, Inc.
+ ##
+ ## This file is part of the libstdc++ version 3 distribution.
+ ## Process this file with automake to produce Makefile.in.
+@@ -612,6 +613,7 @@
+
+ host_srcdir = ${glibcxx_srcdir}/$(OS_INC_SRCDIR)
+ host_builddir = ./${host_alias}/bits
++host_installdir = ${gxx_include_dir}/${host_alias}$(MULTISUBDIR)/bits
+ host_headers = \
+ ${host_srcdir}/ctype_base.h \
+ ${host_srcdir}/ctype_inline.h \
+@@ -646,6 +648,7 @@
+
+ pch_input = ${host_builddir}/stdc++.h
+ pch_output_builddir = ${host_builddir}/stdc++.h.gch
++pch_output_installdir = ${host_installdir}/stdc++.h.gch
+ pch_source = ${glibcxx_srcdir}/include/stdc++.h
+ PCHFLAGS=-Winvalid-pch -Wno-deprecated -x c++-header $(CXXFLAGS)
+ if GLIBCXX_BUILD_PCH
+@@ -907,9 +910,9 @@
+ # are copied here.
+ install-freestanding-headers:
+ $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}
+- $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${host_builddir}
++ $(mkinstalldirs) $(DESTDIR)${host_installdir}
+ for file in ${host_srcdir}/os_defines.h ${host_builddir}/c++config.h; do \
+- $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${host_builddir}; done
++ $(INSTALL_DATA) $${file} $(DESTDIR)${host_installdir}; done
+ $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${std_builddir}
+ $(INSTALL_DATA) ${std_builddir}/limits $(DESTDIR)${gxx_include_dir}/${std_builddir}
+ $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${c_base_builddir}
+@@ -969,15 +972,15 @@
+ $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${debug_builddir}
+ for file in ${debug_headers}; do \
+ $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${debug_builddir}; done
+- $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${host_builddir}
++ $(mkinstalldirs) $(DESTDIR)${host_installdir}
+ for file in ${host_headers} ${host_headers_extra} \
+ ${thread_host_headers}; do \
+- $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${host_builddir}; done
++ $(INSTALL_DATA) $${file} $(DESTDIR)${host_installdir}; done
+
+ install-pch:
+- $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${pch_output_builddir}
++ $(mkinstalldirs) $(DESTDIR)${pch_output_installdir}
+ for file in ${pch_output_builddir}/*; do \
+- $(INSTALL_DATA) $$file $(DESTDIR)${gxx_include_dir}/${pch_output_builddir}; done
++ $(INSTALL_DATA) $$file $(DESTDIR)${pch_output_installdir}; done
+
+ # By adding these files here, automake will remove them for 'make clean'
+ CLEANFILES = ${pch_input} ${pch_output_builddir}/*
--- gcc-4.1-4.1.1.orig/debian/patches/multiarch-lib.dpatch
+++ gcc-4.1-4.1.1/debian/patches/multiarch-lib.dpatch
@@ -0,0 +1,52 @@
+#! /bin/sh -e
+
+# multiarch-lib.dpatch by Stephen Frost
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+diff -urN gcc.old/config/i386/t-linux64 gcc/config/i386/t-linux64
+--- gcc.old/config/i386/t-linux64 2002-11-28 15:47:02.000000000 +0100
++++ gcc/config/i386/t-linux64 2004-07-10 07:28:01.000000000 +0200
+@@ -6,7 +6,7 @@
+
+ MULTILIB_OPTIONS = m64/m32
+ MULTILIB_DIRNAMES = 64 32
+-MULTILIB_OSDIRNAMES = ../lib64 ../lib
++MULTILIB_OSDIRNAMES = x86_64-linux i486-linux
+
+ LIBGCC = stmp-multilib
+ INSTALL_LIBGCC = install-multilib
+diff -urN gcc.old/config/t-linux gcc/config/t-linux
+--- gcc.old/config/t-linux 2004-05-04 18:09:38.000000000 +0200
++++ gcc/config/t-linux 2004-07-10 07:28:01.000000000 +0200
+@@ -11,3 +11,11 @@
+ LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c \
+ $(srcdir)/unwind-sjlj.c $(srcdir)/gthr-gnat.c $(srcdir)/unwind-c.c
+ LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c
++
++MULTILIB_OPTIONS = m32
++MULTILIB_DIRNAMES = 32
++MULTILIB_OSDIRNAMES = $TARGET_ARCH
++
++LIBGCC = stmp-multilib
++INSTALL_LIBGCC = install-multilib
++
--- gcc-4.1-4.1.1.orig/debian/patches/libjava-ia32fix.dpatch
+++ gcc-4.1-4.1.1/debian/patches/libjava-ia32fix.dpatch
@@ -0,0 +1,41 @@
+#! /bin/sh -e
+
+# DP: fix/hack to build 32bit libjava on amd64.
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+--- libjava/include/i386-signal.h~ 2004-09-26 20:38:48.000000000 +0000
++++ libjava/include/i386-signal.h 2005-06-01 18:16:15.107898552 +0000
+@@ -19,6 +19,13 @@
+ #define HANDLE_SEGV 1
+ #define HANDLE_FPE 1
+
++#ifndef SYS_sigaction
++#define SYS_sigaction SYS_rt_sigaction
++#endif
++#ifndef __NR_sigreturn
++#define __NR_sigreturn __NR_rt_sigreturn
++#endif
++
+ #define SIGNAL_HANDLER(_name) \
+ static void _name (int _dummy __attribute__ ((__unused__)))
+
--- gcc-4.1-4.1.1.orig/debian/patches/kbsd-gnu-ada.dpatch
+++ gcc-4.1-4.1.1/debian/patches/kbsd-gnu-ada.dpatch
@@ -0,0 +1,590 @@
+#! /bin/sh -e
+
+# Description: Ada support for GNU/k*BSD
+# Author: Aurelien Jarno
+# Status: not yet submitted upstream.
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p1 < $0
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p1 < $0
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+# append the patch here and adjust the -p? flag in the patch calls.
+
+--- gcc-4.1.0.old/gcc/ada/Makefile.in 2005-04-07 22:03:50.000000000 +0200
++++ gcc-4.1.0/gcc/ada/Makefile.in 2005-11-28 21:14:23.000000000 +0100
+@@ -835,6 +835,34 @@
+ endif
+ endif
+
++ifeq ($(strip $(filter-out %86 kfreebsd%,$(arch) $(osys))),)
++ LIBGNAT_TARGET_PAIRS = \
++ a-intnam.ads) of Signal;
++
++ Unmasked : constant Signal_Set := (
++ SIGTRAP,
++ -- To enable debugging on multithreaded applications, mark SIGTRAP to
++ -- be kept unmasked.
++
++ SIGBUS,
++
++ SIGTTIN, SIGTTOU, SIGTSTP,
++ -- Keep these three signals unmasked so that background processes
++ -- and IO behaves as normal "C" applications
++
++ SIGPROF,
++ -- To avoid confusing the profiler
++
++ SIGKILL, SIGSTOP,
++ -- These two signals actually cannot be masked;
++ -- POSIX simply won't allow it.
++
++ SIGLTHRRES, SIGLTHRCAN, SIGLTHRDBG);
++ -- These three signals are used by GNU/LinuxThreads starting from
++ -- glibc 2.1 (future 2.2).
++
++ Reserved : constant Signal_Set :=
++ -- I am not sure why the following signal is reserved.
++ -- I guess they are not supported by this version of GNU/kFreeBSD.
++ (0 .. 0 => SIGVTALRM);
++
++ type sigset_t is private;
++
++ function sigaddset (set : access sigset_t; sig : Signal) return int;
++ pragma Import (C, sigaddset, "sigaddset");
++
++ function sigdelset (set : access sigset_t; sig : Signal) return int;
++ pragma Import (C, sigdelset, "sigdelset");
++
++ function sigfillset (set : access sigset_t) return int;
++ pragma Import (C, sigfillset, "sigfillset");
++
++ function sigismember (set : access sigset_t; sig : Signal) return int;
++ pragma Import (C, sigismember, "sigismember");
++
++ function sigemptyset (set : access sigset_t) return int;
++ pragma Import (C, sigemptyset, "sigemptyset");
++
++ -- sigcontext is architecture dependent, so define it private
++ type struct_sigcontext is private;
++
++ type struct_sigaction is record
++ sa_handler : System.Address;
++ sa_flags : int;
++ sa_mask : sigset_t;
++ end record;
++ pragma Convention (C, struct_sigaction);
++
++ type struct_sigaction_ptr is access all struct_sigaction;
++
++ SIG_BLOCK : constant := 1;
++ SIG_UNBLOCK : constant := 2;
++ SIG_SETMASK : constant := 3;
++
++ SIG_DFL : constant := 0;
++ SIG_IGN : constant := 1;
++
++ SA_SIGINFO : constant := 16#0040#;
++
++ function sigaction
++ (sig : Signal;
++ act : struct_sigaction_ptr;
++ oact : struct_sigaction_ptr) return int;
++ pragma Import (C, sigaction, "sigaction");
++
++ ----------
++ -- Time --
++ ----------
++
++ type timespec is private;
++
++ function To_Duration (TS : timespec) return Duration;
++ pragma Inline (To_Duration);
++
++ function To_Timespec (D : Duration) return timespec;
++ pragma Inline (To_Timespec);
++
++ type struct_timeval is private;
++
++ function To_Duration (TV : struct_timeval) return Duration;
++ pragma Inline (To_Duration);
++
++ function To_Timeval (D : Duration) return struct_timeval;
++ pragma Inline (To_Timeval);
++
++ function gettimeofday
++ (tv : access struct_timeval;
++ tz : System.Address := System.Null_Address) return int;
++ pragma Import (C, gettimeofday, "gettimeofday");
++
++ function sysconf (name : int) return long;
++ pragma Import (C, sysconf);
++
++ SC_CLK_TCK : constant := 2;
++
++ -------------------------
++ -- Priority Scheduling --
++ -------------------------
++
++ SCHED_FIFO : constant := 1;
++ SCHED_OTHER : constant := 2;
++ SCHED_RR : constant := 3;
++
++ -------------
++ -- Process --
++ -------------
++
++ type pid_t is private;
++
++ function kill (pid : pid_t; sig : Signal) return int;
++ pragma Import (C, kill, "kill");
++
++ function getpid return pid_t;
++ pragma Import (C, getpid, "getpid");
++
++ -------------
++ -- Threads --
++ -------------
++
++ type Thread_Body is access
++ function (arg : System.Address) return System.Address;
++
++ function Thread_Body_Access is new
++ Unchecked_Conversion (System.Address, Thread_Body);
++
++ type pthread_t is new unsigned_long;
++ subtype Thread_Id is pthread_t;
++
++ function To_pthread_t is new Unchecked_Conversion
++ (unsigned_long, pthread_t);
++
++ type pthread_mutex_t is limited private;
++ type pthread_cond_t is limited private;
++ type pthread_attr_t is limited private;
++ type pthread_mutexattr_t is limited private;
++ type pthread_condattr_t is limited private;
++ type pthread_key_t is private;
++
++ PTHREAD_CREATE_DETACHED : constant := 1;
++
++ -----------
++ -- Stack --
++ -----------
++
++ function Get_Stack_Base (thread : pthread_t) return Address;
++ pragma Inline (Get_Stack_Base);
++ -- This is a dummy procedure to share some GNULLI files
++
++ ---------------------------------------
++ -- Nonstandard Thread Initialization --
++ ---------------------------------------
++
++ procedure pthread_init;
++ pragma Inline (pthread_init);
++ -- This is a dummy procedure to share some GNULLI files
++
++ -------------------------
++ -- POSIX.1c Section 3 --
++ -------------------------
++
++ function sigwait (set : access sigset_t; sig : access Signal) return int;
++ pragma Import (C, sigwait, "sigwait");
++
++ function pthread_kill (thread : pthread_t; sig : Signal) return int;
++ pragma Import (C, pthread_kill, "pthread_kill");
++
++ type sigset_t_ptr is access all sigset_t;
++
++ function pthread_sigmask
++ (how : int;
++ set : sigset_t_ptr;
++ oset : sigset_t_ptr) return int;
++ pragma Import (C, pthread_sigmask, "pthread_sigmask");
++
++ --------------------------
++ -- POSIX.1c Section 11 --
++ --------------------------
++
++ function pthread_mutexattr_init
++ (attr : access pthread_mutexattr_t) return int;
++ pragma Import (C, pthread_mutexattr_init, "pthread_mutexattr_init");
++
++ function pthread_mutexattr_destroy
++ (attr : access pthread_mutexattr_t) return int;
++ pragma Import (C, pthread_mutexattr_destroy, "pthread_mutexattr_destroy");
++
++ function pthread_mutex_init
++ (mutex : access pthread_mutex_t;
++ attr : access pthread_mutexattr_t) return int;
++ pragma Import (C, pthread_mutex_init, "pthread_mutex_init");
++
++ function pthread_mutex_destroy (mutex : access pthread_mutex_t) return int;
++ pragma Import (C, pthread_mutex_destroy, "pthread_mutex_destroy");
++
++ function pthread_mutex_lock (mutex : access pthread_mutex_t) return int;
++ pragma Import (C, pthread_mutex_lock, "pthread_mutex_lock");
++
++ function pthread_mutex_unlock (mutex : access pthread_mutex_t) return int;
++ pragma Import (C, pthread_mutex_unlock, "pthread_mutex_unlock");
++
++ function pthread_condattr_init
++ (attr : access pthread_condattr_t) return int;
++ pragma Import (C, pthread_condattr_init, "pthread_condattr_init");
++
++ function pthread_condattr_destroy
++ (attr : access pthread_condattr_t) return int;
++ pragma Import (C, pthread_condattr_destroy, "pthread_condattr_destroy");
++
++ function pthread_cond_init
++ (cond : access pthread_cond_t;
++ attr : access pthread_condattr_t) return int;
++ pragma Import (C, pthread_cond_init, "pthread_cond_init");
++
++ function pthread_cond_destroy (cond : access pthread_cond_t) return int;
++ pragma Import (C, pthread_cond_destroy, "pthread_cond_destroy");
++
++ function pthread_cond_signal (cond : access pthread_cond_t) return int;
++ pragma Import (C, pthread_cond_signal, "pthread_cond_signal");
++
++ function pthread_cond_wait
++ (cond : access pthread_cond_t;
++ mutex : access pthread_mutex_t) return int;
++ pragma Import (C, pthread_cond_wait, "pthread_cond_wait");
++
++ function pthread_cond_timedwait
++ (cond : access pthread_cond_t;
++ mutex : access pthread_mutex_t;
++ abstime : access timespec) return int;
++ pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait");
++
++ Relative_Timed_Wait : constant Boolean := False;
++ -- pthread_cond_timedwait requires an absolute delay time
++
++ --------------------------
++ -- POSIX.1c Section 13 --
++ --------------------------
++
++ type struct_sched_param is record
++ sched_priority : int; -- scheduling priority
++ end record;
++ pragma Convention (C, struct_sched_param);
++
++ function pthread_setschedparam
++ (thread : pthread_t;
++ policy : int;
++ param : access struct_sched_param) return int;
++ pragma Import (C, pthread_setschedparam, "pthread_setschedparam");
++
++ function pthread_attr_setschedpolicy
++ (attr : access pthread_attr_t;
++ policy : int) return int;
++ pragma Import
++ (C, pthread_attr_setschedpolicy, "pthread_attr_setschedpolicy");
++
++ function sched_yield return int;
++ pragma Import (C, sched_yield, "sched_yield");
++
++ ---------------------------
++ -- P1003.1c - Section 16 --
++ ---------------------------
++
++ function pthread_attr_init
++ (attributes : access pthread_attr_t) return int;
++ pragma Import (C, pthread_attr_init, "pthread_attr_init");
++
++ function pthread_attr_destroy
++ (attributes : access pthread_attr_t) return int;
++ pragma Import (C, pthread_attr_destroy, "pthread_attr_destroy");
++
++ function pthread_attr_setdetachstate
++ (attr : access pthread_attr_t;
++ detachstate : int) return int;
++ pragma Import
++ (C, pthread_attr_setdetachstate, "pthread_attr_setdetachstate");
++
++ function pthread_attr_setstacksize
++ (attr : access pthread_attr_t;
++ stacksize : size_t) return int;
++ pragma Import (C, pthread_attr_setstacksize, "pthread_attr_setstacksize");
++
++ function pthread_create
++ (thread : access pthread_t;
++ attributes : access pthread_attr_t;
++ start_routine : Thread_Body;
++ arg : System.Address) return int;
++ pragma Import (C, pthread_create, "pthread_create");
++
++ procedure pthread_exit (status : System.Address);
++ pragma Import (C, pthread_exit, "pthread_exit");
++
++ function pthread_self return pthread_t;
++ pragma Import (C, pthread_self, "pthread_self");
++
++ --------------------------
++ -- POSIX.1c Section 17 --
++ --------------------------
++
++ function pthread_setspecific
++ (key : pthread_key_t;
++ value : System.Address) return int;
++ pragma Import (C, pthread_setspecific, "pthread_setspecific");
++
++ function pthread_getspecific (key : pthread_key_t) return System.Address;
++ pragma Import (C, pthread_getspecific, "pthread_getspecific");
++
++ type destructor_pointer is access procedure (arg : System.Address);
++
++ function pthread_key_create
++ (key : access pthread_key_t;
++ destructor : destructor_pointer) return int;
++ pragma Import (C, pthread_key_create, "pthread_key_create");
++
++private
++
++ type sigset_t is array (1 .. 4) of unsigned;
++
++ -- In FreeBSD the component sa_handler turns out to
++ -- be one a union type, and the selector is a macro:
++ -- #define sa_handler __sigaction_u._handler
++ -- #define sa_sigaction __sigaction_u._sigaction
++
++ -- Should we add a signal_context type here ?
++ -- How could it be done independent of the CPU architecture ?
++ -- sigcontext type is opaque, so it is architecturally neutral.
++ -- It is always passed as an access type, so define it as an empty record
++ -- since the contents are not used anywhere.
++ type struct_sigcontext is null record;
++ pragma Convention (C, struct_sigcontext);
++
++ type pid_t is new int;
++
++ type time_t is new long;
++
++ type timespec is record
++ tv_sec : time_t;
++ tv_nsec : long;
++ end record;
++ pragma Convention (C, timespec);
++
++ type struct_timeval is record
++ tv_sec : time_t;
++ tv_usec : time_t;
++ end record;
++ pragma Convention (C, struct_timeval);
++
++ type pthread_attr_t is record
++ detachstate : int;
++ schedpolicy : int;
++ schedparam : struct_sched_param;
++ inheritsched : int;
++ scope : int;
++ guardsize : size_t;
++ stackaddr_set : int;
++ stackaddr : System.Address;
++ stacksize : size_t;
++ end record;
++ pragma Convention (C, pthread_attr_t);
++
++ type pthread_condattr_t is record
++ dummy : int;
++ end record;
++ pragma Convention (C, pthread_condattr_t);
++
++ type pthread_mutexattr_t is record
++ mutexkind : int;
++ end record;
++ pragma Convention (C, pthread_mutexattr_t);
++
++ type struct_pthread_fast_lock is record
++ status : long;
++ spinlock : int;
++ end record;
++ pragma Convention (C, struct_pthread_fast_lock);
++
++ type pthread_mutex_t is record
++ m_reserved : int;
++ m_count : int;
++ m_owner : System.Address;
++ m_kind : int;
++ m_lock : struct_pthread_fast_lock;
++ end record;
++ pragma Convention (C, pthread_mutex_t);
++
++ type pthread_cond_t is array (0 .. 47) of unsigned_char;
++ pragma Convention (C, pthread_cond_t);
++
++ type pthread_key_t is new unsigned;
++
++end System.OS_Interface;
--- gcc-4.1-4.1.1.orig/debian/patches/m68k-autoinc.dpatch
+++ gcc-4.1-4.1.1/debian/patches/m68k-autoinc.dpatch
@@ -0,0 +1,156 @@
+#! /bin/sh -e
+
+# All lines beginning with `# DPATCH:' are a description of the patch.
+# DP: recognize a few more autoinc possibilities
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p1 < $0
+ #cd ${dir}gcc && autoconf
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p1 < $0
+ #rm ${dir}gcc/configure
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+# append the patch here and adjust the -p? flag in the patch calls.
+
+---
+ gcc/flow.c | 51 +++++++++++++++++++++++++++++++++++++++++----------
+ 1 file changed, 41 insertions(+), 10 deletions(-)
+
+Index: gcc-4.1/gcc/flow.c
+===================================================================
+--- gcc-4.1.orig/gcc/flow.c
++++ gcc-4.1/gcc/flow.c
+@@ -1766,7 +1766,6 @@ propagate_one_insn (struct propagate_blo
+ && REG_P (SET_DEST (x))
+ && (GET_CODE (SET_SRC (x)) == PLUS
+ || GET_CODE (SET_SRC (x)) == MINUS)
+- && XEXP (SET_SRC (x), 0) == SET_DEST (x)
+ && GET_CODE (XEXP (SET_SRC (x), 1)) == CONST_INT
+ /* Ok, look for a following memory ref we can combine with.
+ If one is found, change the memory ref to a PRE_INC
+@@ -3428,13 +3427,25 @@ attempt_auto_inc (struct propagate_block
+ rtx set = single_set (incr);
+ rtx q = SET_DEST (set);
+ rtx y = SET_SRC (set);
+- int opnum = XEXP (y, 0) == incr_reg ? 0 : 1;
++ rtx *loc = &SET_SRC (set);
+ int changed;
+
+ /* Make sure this reg appears only once in this insn. */
+ if (count_occurrences (PATTERN (insn), incr_reg, 1) != 1)
+ return;
+
++ if (GET_CODE (y) != PLUS)
++ {
++ if (MEM_P (y) && GET_CODE (XEXP (y, 0)) == PLUS)
++ loc = &XEXP (y, 0);
++ else if (MEM_P (q) && GET_CODE (XEXP (q, 0)) == PLUS)
++ loc = &XEXP (q, 0);
++ else
++ abort();
++ y = *loc;
++ q = NULL_RTX;
++ }
++
+ if (dead_or_set_p (incr, incr_reg)
+ /* Mustn't autoinc an eliminable register. */
+ && (regno >= FIRST_PSEUDO_REGISTER
+@@ -3446,7 +3457,7 @@ attempt_auto_inc (struct propagate_block
+ if (! validate_change (insn, &XEXP (mem, 0), inc, 0))
+ return;
+ }
+- else if (REG_P (q)
++ else if (q && REG_P (q)
+ /* PREV_INSN used here to check the semi-open interval
+ [insn,incr). */
+ && ! reg_used_between_p (q, PREV_INSN (insn), incr)
+@@ -3461,6 +3472,7 @@ attempt_auto_inc (struct propagate_block
+ Change it to q = p, ...*q..., q = q+size.
+ Then fall into the usual case. */
+ rtx insns, temp;
++ int opnum = XEXP (y, 0) == incr_reg ? 0 : 1;
+
+ start_sequence ();
+ emit_move_insn (q, incr_reg);
+@@ -3533,13 +3545,13 @@ attempt_auto_inc (struct propagate_block
+
+ /* Modify the old increment-insn to simply copy
+ the already-incremented value of our register. */
+- changed = validate_change (incr, &SET_SRC (set), incr_reg, 0);
++ changed = validate_change (incr, loc, incr_reg, 0);
+ gcc_assert (changed);
+
+ /* If that makes it a no-op (copying the register into itself) delete
+ it so it won't appear to be a "use" and a "set" of this
+ register. */
+- if (REGNO (SET_DEST (set)) == REGNO (incr_reg))
++ if (q && REGNO (q) == REGNO (incr_reg))
+ {
+ /* If the original source was dead, it's dead now. */
+ rtx note;
+@@ -3613,7 +3625,18 @@ find_auto_inc (struct propagate_block_in
+ y = SET_SRC (set);
+
+ if (GET_CODE (y) != PLUS)
+- return;
++ {
++ if (MEM_P (y) && GET_CODE (XEXP (y, 0)) == PLUS)
++ y = XEXP (y, 0);
++ else
++ {
++ y = SET_DEST (set);
++ if (MEM_P (y) && GET_CODE (XEXP (y, 0)) == PLUS)
++ y = XEXP (y, 0);
++ else
++ return;
++ }
++ }
+
+ if (REG_P (XEXP (y, 0)) && REGNO (XEXP (y, 0)) == REGNO (addr))
+ inc_val = XEXP (y, 1);
+@@ -4172,10 +4195,6 @@ try_pre_increment_1 (struct propagate_bl
+ && ! dead_or_set_p (y, SET_DEST (x))
+ && try_pre_increment (y, SET_DEST (x), amount))
+ {
+- /* We have found a suitable auto-increment and already changed
+- insn Y to do it. So flush this increment instruction. */
+- propagate_block_delete_insn (insn);
+-
+ /* Count a reference to this reg for the increment insn we are
+ deleting. When a reg is incremented, spilling it is worse,
+ so we want to make that less likely. */
+@@ -4185,6 +4204,18 @@ try_pre_increment_1 (struct propagate_bl
+ REG_N_SETS (regno)++;
+ }
+
++ if (XEXP (SET_SRC (x), 0) != SET_DEST (x))
++ {
++ int change;
++ change = validate_change (insn, &SET_SRC (x), XEXP (SET_SRC (x), 0), 0);
++ gcc_assert(change);
++ return 0;
++ }
++
++ /* We have found a suitable auto-increment and already changed
++ insn Y to do it. So flush this increment instruction. */
++ propagate_block_delete_insn (insn);
++
+ /* Flush any remembered memories depending on the value of
+ the incremented register. */
+ invalidate_mems_from_set (pbi, SET_DEST (x));
--- gcc-4.1-4.1.1.orig/debian/patches/autoreconf.dpatch
+++ gcc-4.1-4.1.1/debian/patches/autoreconf.dpatch
@@ -0,0 +1,26 @@
+#! /bin/sh -e
+
+# DP: autoreconf several directories for proper mipsen libtool support
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ for i in libstdc++-v3 zlib; do
+ (cd ${dir}/${i} ; autoreconf --force)
+ done
+ ;;
+ -unpatch)
+ echo unable to unpatch autoreconf.
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
--- gcc-4.1-4.1.1.orig/debian/patches/ignore-comp-fail.dpatch
+++ gcc-4.1-4.1.1/debian/patches/ignore-comp-fail.dpatch
@@ -0,0 +1,38 @@
+#! /bin/sh -e
+
+# DP: Ignore the bootstrap comparision failure
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+--- gcc/Makefile.in~ 2004-02-06 08:03:12.000000000 +0100
++++ gcc/Makefile.in 2004-02-14 10:27:19.000000000 +0100
+@@ -3567,7 +3567,9 @@
+ if [ -f .bad_compare ]; then \
+ echo "Bootstrap comparison failure!"; \
+ cat .bad_compare; \
+- exit 1; \
++ echo ""; \
++ echo "Ignore the comparision failure!"; \
++ true; \
+ else \
+ case "$@" in \
+ *-lean ) rm -rf stage$$stage ;; \
--- gcc-4.1-4.1.1.orig/debian/patches/gcc-textdomain.dpatch
+++ gcc-4.1-4.1.1/debian/patches/gcc-textdomain.dpatch
@@ -0,0 +1,103 @@
+#! /bin/sh -e
+
+# DP: Set gettext's domain and textdomain to the versioned package name.
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+
+--- gcc/Makefile.in.orig 2005-09-04 23:32:54.003440040 +0000
++++ gcc/Makefile.in 2005-09-04 23:40:10.954013456 +0000
+@@ -4565,8 +4565,8 @@
+ dir=$(localedir)/$$lang/LC_MESSAGES; \
+ echo $(mkinstalldirs) $(DESTDIR)$$dir; \
+ $(mkinstalldirs) $(DESTDIR)$$dir || exit 1; \
+- echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/gcc.mo; \
+- $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/gcc.mo; \
++ echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/gcc-4.1.mo; \
++ $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/gcc-4.1.mo; \
+ done
+
+ # Rule for regenerating the message template (gcc.pot).
+--- gcc/intl.c.orig 2005-09-04 23:32:54.006439584 +0000
++++ gcc/intl.c 2005-09-04 23:36:37.933397512 +0000
+@@ -51,8 +51,8 @@
+ setlocale (LC_ALL, "");
+ #endif
+
+- (void) bindtextdomain ("gcc", LOCALEDIR);
+- (void) textdomain ("gcc");
++ (void) bindtextdomain ("gcc-4.1", LOCALEDIR);
++ (void) textdomain ("gcc-4.1");
+
+ /* Opening quotation mark. */
+ open_quote = _("`");
+--- libcpp/Makefile.in.orig 2005-09-04 23:32:54.009439128 +0000
++++ libcpp/Makefile.in 2005-09-04 23:33:24.607787472 +0000
+@@ -47,6 +47,7 @@
+ LIBICONV = @LIBICONV@
+ LIBINTL = @LIBINTL@
+ PACKAGE = @PACKAGE@
++PACKAGE_SUFFIX = -4.1
+ RANLIB = @RANLIB@
+ SHELL = @SHELL@
+ USED_CATALOGS = @USED_CATALOGS@
+@@ -66,6 +67,7 @@
+
+ INCLUDES = -I$(srcdir) -I. -I$(srcdir)/../include @INCINTL@ \
+ -I$(srcdir)/include
++CPPFLAGS += -DPACKAGE_SUFFIX=\"$(strip $(PACKAGE_SUFFIX))\"
+
+ ALL_CFLAGS = $(CFLAGS) $(WARN_CFLAGS) $(INCLUDES) $(CPPFLAGS)
+
+@@ -156,8 +158,8 @@
+ else continue; \
+ fi; \
+ dir=$(localedir)/$$lang/LC_MESSAGES; \
+- echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
+- $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
++ echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE)$(PACKAGE_SUFFIX).mo; \
++ $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE)$(PACKAGE_SUFFIX).mo; \
+ done
+
+ mostlyclean:
+--- libcpp/system.h.orig 2005-09-04 23:32:54.006439584 +0000
++++ libcpp/system.h 2005-09-04 23:33:24.606787624 +0000
+@@ -260,7 +260,7 @@
+ #endif
+
+ #ifndef _
+-# define _(msgid) dgettext (PACKAGE, msgid)
++# define _(msgid) dgettext (PACKAGE PACKAGE_SUFFIX, msgid)
+ #endif
+
+ #ifndef N_
+--- libcpp/init.c.orig 2005-09-04 23:32:54.008439280 +0000
++++ libcpp/init.c 2005-09-04 23:33:24.607787472 +0000
+@@ -122,7 +122,7 @@
+ init_trigraph_map ();
+
+ #ifdef ENABLE_NLS
+- (void) bindtextdomain (PACKAGE, LOCALEDIR);
++ (void) bindtextdomain (PACKAGE PACKAGE_SUFFIX, LOCALEDIR);
+ #endif
+ }
+ }
--- gcc-4.1-4.1.1.orig/debian/patches/libjava-hppa.dpatch
+++ gcc-4.1-4.1.1/debian/patches/libjava-hppa.dpatch
@@ -0,0 +1,64 @@
+#! /bin/sh -e
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+From: "John David Anglin"
+Sender: gcc-patches-owner@gcc.gnu.org
+To: gcc-patches@gcc.gnu.org, java-patches@gcc.gnu.org
+Subject: [committed] Change default for enable_hash_synchronization_default on PA-RISC
+Date: Tue, 13 Jun 2006 21:51:55 -0400 (EDT)
+
+I've noticed that we get occassional failures of process intensive
+tests in the libjava testsuite (e.g., Process_3). Carlos O'Donell
+indicated that hashing locks might be unsafe because of the special
+way locks are handled in parisc-linux. I've also seen a few failures
+in the libjava suite on hpux. So, I've decided that it would be
+better to be conservative in this regard.
+
+With the patch installed, I've seen no libjava testsuite failures
+on hppa-unknown-linux-gnu on the trunk in several runs.
+
+Committed to trunk. If the patch works out, I will probably backport.
+
+Dave
+--
+J. David Anglin dave.anglin@nrc-cnrc.gc.ca
+National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
+
+# DP: 2006-06-13 John David Anglin
+# DP:
+# DP: * configure.host (hppa*-*): Set 'enable_hash_synchronization_default' to
+# DP: no.
+
+Index: configure.host
+===================================================================
+--- libjava/configure.host (revision 114624)
++++ libjava/configure.host (working copy)
+@@ -130,7 +130,7 @@
+ hppa*-*)
+ sysdeps_dir=pa
+ libgcj_interpreter=yes
+- enable_hash_synchronization_default=yes
++ enable_hash_synchronization_default=no
+ ;;
+ powerpc64*-*)
+ sysdeps_dir=powerpc
--- gcc-4.1-4.1.1.orig/debian/patches/hppa-cbranch2.dpatch
+++ gcc-4.1-4.1.1/debian/patches/hppa-cbranch2.dpatch
@@ -0,0 +1,626 @@
+#! /bin/sh -e
+
+# All lines beginning with `# DPATCH:' are a description of the patch.
+# DP: Fix for PR target/26743 (hppa)
+# DP: Backport from gcc trunk 2006-04-12 by tausq@debian.org
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ #cd ${dir}gcc && autoconf
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ #rm ${dir}gcc/configure
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+From: "John David Anglin"
+Sender: gcc-patches-owner@gcc.gnu.org
+To: gcc-patches@gcc.gnu.org
+Subject: [committed] Define symbolic constants for maximum branch offsets in pa.md
+Date: Tue, 11 Apr 2006 14:34:18 -0400 (EDT)
+
+The enclosed change is to facilitate changing the maximum branch
+offsets. There should be no change in functionality.
+
+Tested on hppa-unknown-linux-gnu. Applied to trunk.
+
+Dave
+
+2006-04-11 John David Anglin
+
+ * pa.md (MAX_12BIT_OFFSET, MAX_17BIT_OFFSET): Define and use new
+ symbolic constants in branch patterns.
+
+--- gcc/config/pa/pa.md.orig 2006-04-19 11:33:06.396048656 +0200
++++ gcc/config/pa/pa.md 2006-04-19 11:35:52.790752816 +0200
+@@ -1,6 +1,6 @@
+ ;;- Machine description for HP PA-RISC architecture for GCC compiler
+ ;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+-;; 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
++;; 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+ ;; Contributed by the Center for Software Science at the University
+ ;; of Utah.
+
+@@ -52,6 +52,16 @@
+ (UNSPECV_LONGJMP 5) ; builtin_longjmp
+ ])
+
++;; Maximum pc-relative branch offsets.
++
++;; These numbers are a bit smaller than the maximum allowable offsets
++;; so that a few instructions may be inserted before the actual branch.
++
++(define_constants
++ [(MAX_12BIT_OFFSET 8184) ; 12-bit branch
++ (MAX_17BIT_OFFSET 262100) ; 17-bit branch
++ ])
++
+ ;; Insn type. Used to default other attribute values.
+
+ ;; type "unary" insns have one input operand (1) and one output operand (0)
+@@ -1713,10 +1723,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 24)
+@@ -1742,10 +1752,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 24)
+@@ -1769,10 +1779,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 24)
+@@ -1798,10 +1808,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 24)
+@@ -1824,10 +1834,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 24)
+@@ -1853,10 +1863,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 24)
+@@ -1882,10 +1892,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -1910,10 +1920,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -1938,10 +1948,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -1966,10 +1976,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -1994,10 +2004,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -2022,10 +2032,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -2050,10 +2060,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -2078,10 +2088,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -2107,10 +2117,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -2135,10 +2145,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -2163,10 +2173,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -2191,10 +2201,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -2219,10 +2229,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -2247,10 +2257,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -2275,10 +2285,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -2303,10 +2313,10 @@
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -2355,7 +2365,7 @@
+ [(set_attr "type" "fbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 32)
+@@ -2399,7 +2409,7 @@
+ [(set_attr "type" "fbranch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 12)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -7142,11 +7152,11 @@
+ (cond [(eq (symbol_ref "jump_in_call_delay (insn)") (const_int 1))
+ (if_then_else (lt (abs (minus (match_dup 0)
+ (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (const_int 8))
+ (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 4)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 20)
+@@ -8968,10 +8978,10 @@
+ ;; Short branch has length of 4
+ ;; Long branch has length of 8, 20, 24 or 28
+ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 24)
+@@ -8984,10 +8994,10 @@
+ (if_then_else (eq_attr "alternative" "1")
+ (if_then_else (lt (match_dup 3) (pc))
+ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 24))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 24)
+ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 24))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 28)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 44)
+@@ -8995,10 +9005,10 @@
+ (const_int 40)]
+ (const_int 48))
+ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 24)
+ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 28)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 44)
+@@ -9010,10 +9020,10 @@
+ ;; Extra goo to deal with additional reload insns.
+ (if_then_else (lt (match_dup 3) (pc))
+ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 12)
+ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 16)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 32)
+@@ -9021,10 +9031,10 @@
+ (const_int 28)]
+ (const_int 36))
+ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 12)
+ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 16)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 32)
+@@ -9051,10 +9061,10 @@
+ ;; Short branch has length of 4
+ ;; Long branch has length of 8, 20, 24 or 28
+ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 24)
+@@ -9067,10 +9077,10 @@
+ (if_then_else (eq_attr "alternative" "1")
+ (if_then_else (lt (match_dup 3) (pc))
+ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 12)
+ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 16)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 32)
+@@ -9078,10 +9088,10 @@
+ (const_int 28)]
+ (const_int 36))
+ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 12)
+ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 16)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 32)
+@@ -9092,10 +9102,10 @@
+ ;; Loop counter in memory or sar case.
+ ;; Extra goo to deal with additional reload insns.
+ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 8)
+ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 12)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -9123,10 +9133,10 @@
+ ;; Short branch has length of 4
+ ;; Long branch has length of 8
+ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 24)
+@@ -9139,10 +9149,10 @@
+ (if_then_else (eq_attr "alternative" "1")
+ (if_then_else (lt (match_dup 3) (pc))
+ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 12)
+ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 16)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 32)
+@@ -9150,10 +9160,10 @@
+ (const_int 28)]
+ (const_int 36))
+ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 12)
+ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 16)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 32)
+@@ -9164,10 +9174,10 @@
+ ;; Loop counter in memory or SAR case.
+ ;; Extra goo to deal with additional reload insns.
+ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 8)
+ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 12)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 28)
+@@ -9188,10 +9198,10 @@
+ [(set_attr "type" "parallel_branch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 24)
+@@ -9211,10 +9221,10 @@
+ [(set_attr "type" "parallel_branch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 24)
+@@ -9234,10 +9244,10 @@
+ [(set_attr "type" "parallel_branch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 24)
+@@ -9257,10 +9267,10 @@
+ [(set_attr "type" "parallel_branch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 24)
+@@ -9280,10 +9290,10 @@
+ [(set_attr "type" "parallel_branch")
+ (set (attr "length")
+ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
++ (const_int MAX_12BIT_OFFSET))
+ (const_int 4)
+ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 262100))
++ (const_int MAX_17BIT_OFFSET))
+ (const_int 8)
+ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
+ (const_int 24)
--- gcc-4.1-4.1.1.orig/debian/patches/libjava-jnipath.dpatch
+++ gcc-4.1-4.1.1/debian/patches/libjava-jnipath.dpatch
@@ -0,0 +1,94 @@
+#! /bin/sh -e
+
+# DP: - Add /usr/lib/jni to java.library.path.
+# DP: - When running the i386 binaries on amd64, look in
+# DP: - /usr/lib32/gcj-x.y and /usr/lib32/jni instead.
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+--- libjava/gnu/classpath/natSystemProperties.cc~ 2006-08-02 00:53:40.000000000 +0200
++++ libjava/gnu/classpath/natSystemProperties.cc 2006-08-19 00:41:50.063803000 +0200
+@@ -141,6 +141,34 @@
+ return retval;
+ }
+
++static char*
++AppendJniLibdir (char *path, struct utsname *u)
++{
++ char* retval;
++ const char* jnilibdir = "/usr/lib/jni";
++
++#if defined(__linux__) && defined (__i386__)
++ if (! strcmp ("x86_64", u->machine))
++ jnilibdir = "/usr/lib32/jni";
++#endif
++
++ if (path)
++ {
++ jsize total = strlen (path)
++ + (sizeof (PATH_SEPARATOR) - 1) + strlen (jnilibdir) + 1;
++ retval = (char*) _Jv_Malloc (total);
++ strcpy (retval, path);
++ strcat (retval, PATH_SEPARATOR);
++ strcat (retval, jnilibdir);
++ }
++ else
++ {
++ retval = (char*) _Jv_Malloc (strlen (jnilibdir) + 1);
++ strcpy (retval, jnilibdir);
++ }
++ return retval;
++}
++
+ void
+ gnu::classpath::SystemProperties::insertSystemProperties (java::util::Properties *newprops)
+ {
+@@ -370,8 +398,13 @@
+ // Prepend GCJ_VERSIONED_LIBDIR to the module load path so that
+ // libgcj will find its own JNI libraries, like libgtkpeer.so.
+ char* val = PrependVersionedLibdir (path);
+- _Jv_SetDLLSearchPath (val);
++
++ // Append jnilibdir
++ char* val2 = AppendJniLibdir (val, &u);
++
++ _Jv_SetDLLSearchPath (val2);
+ _Jv_Free (val);
++ _Jv_Free (val2);
+ }
+ else
+ {
+@@ -379,9 +412,12 @@
+ #ifdef USE_LTDL
+ char *libpath = getenv (LTDL_SHLIBPATH_VAR);
+ char* val = _Jv_PrependVersionedLibdir (libpath);
+- SET ("java.library.path", val);
+- _Jv_SetDLLSearchPath (val);
++ // Append jnilibdir
++ char* val2 = AppendJniLibdir (val, &u);
++ SET ("java.library.path", val2);
++ _Jv_SetDLLSearchPath (val2);
+ _Jv_Free (val);
++ _Jv_Free (val2);
+ #else
+ SET ("java.library.path", "");
+ #endif
--- gcc-4.1-4.1.1.orig/debian/patches/libjava-lib32subdir.dpatch
+++ gcc-4.1-4.1.1/debian/patches/libjava-lib32subdir.dpatch
@@ -0,0 +1,93 @@
+#! /bin/sh -e
+
+# DP: - When running the i386 binaries on amd64, look in /usr/lib32/gcj-x.y
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+--- libjava/prims.cc~ 2006-07-28 10:24:31.000000000 +0200
++++ libjava/prims.cc 2006-08-19 00:47:15.993803000 +0200
+@@ -21,6 +21,10 @@
+ #include
+ #endif
+
++#ifdef HAVE_UNAME
++#include
++#endif
++
+ #include
+ #include
+ #include
+@@ -1725,12 +1729,28 @@
+ _Jv_PrependVersionedLibdir (char* libpath)
+ {
+ char* retval = 0;
++#define GCJ_VERSIONED_SUBDIR "gcj-4.1"
++#define GCJ_VERSIONED_LIB32DIR "/usr/lib32/" GCJ_VERSIONED_SUBDIR
++ const char* vlibdir = GCJ_VERSIONED_LIBDIR;
++ int vlibdir_size = sizeof (GCJ_VERSIONED_LIBDIR);
++
++#if defined(__linux__) && defined (__i386__)
++ struct utsname u;
++ if (! uname (&u))
++ {
++ if (! strcmp ("x86_64", u.machine))
++ {
++ vlibdir = GCJ_VERSIONED_LIB32DIR;
++ vlibdir_size = sizeof (GCJ_VERSIONED_LIB32DIR);
++ }
++ }
++#endif
+
+ if (libpath && libpath[0] != '\0')
+ {
+ if (! strncmp (libpath,
+- GCJ_VERSIONED_LIBDIR,
+- sizeof (GCJ_VERSIONED_LIBDIR) - 1))
++ vlibdir,
++ vlibdir_size - 1))
+ {
+ // LD_LIBRARY_PATH is already prefixed with
+ // GCJ_VERSIONED_LIBDIR.
+@@ -1741,10 +1761,10 @@
+ {
+ // LD_LIBRARY_PATH is not prefixed with
+ // GCJ_VERSIONED_LIBDIR.
+- jsize total = (sizeof (GCJ_VERSIONED_LIBDIR) - 1)
++ jsize total = (vlibdir_size - 1)
+ + (sizeof (PATH_SEPARATOR) - 1) + strlen (libpath) + 1;
+ retval = (char*) _Jv_Malloc (total);
+- strcpy (retval, GCJ_VERSIONED_LIBDIR);
++ strcpy (retval, vlibdir);
+ strcat (retval, PATH_SEPARATOR);
+ strcat (retval, libpath);
+ }
+@@ -1752,8 +1772,8 @@
+ else
+ {
+ // LD_LIBRARY_PATH was not specified or is empty.
+- retval = (char*) _Jv_Malloc (sizeof (GCJ_VERSIONED_LIBDIR));
+- strcpy (retval, GCJ_VERSIONED_LIBDIR);
++ retval = (char*) _Jv_Malloc (vlibdir_size);
++ strcpy (retval, vlibdir);
+ }
+
+ return retval;
--- gcc-4.1-4.1.1.orig/debian/patches/gpc-names.dpatch
+++ gcc-4.1-4.1.1/debian/patches/gpc-names.dpatch
@@ -0,0 +1,117 @@
+#! /bin/sh -e
+
+# DP: versioned gpc names
+
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch) patch $pdir -f --no-backup-if-mismatch -p1 < $0;;
+ -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p1 < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+--- src-old/gcc/p/doc/en/gpc.texi Mon Oct 9 09:32:26 2000
++++ src-native/gcc/p/doc/en/gpc.texi Tue Dec 19 21:04:21 2000
+@@ -28,11 +28,11 @@
+
+ @dircategory GNU programming tools
+ @direntry
+-* GPC: (gpc). The GNU Pascal Compiler.
++* GPC-2.1-3.3: (gpc-2.1-3.3). The GNU Pascal Compiler.
+ @end direntry
+ @dircategory Individual utilities
+ @direntry
+-* GPC: (gpc)Invoking GPC. The GNU Pascal Compiler.
++* GPC-2.1-3.3: (gpc-2.1-3.3)Invoking GPC. The GNU Pascal Compiler.
+ @end direntry
+
+ @c Version numbers appear twice: in lowercase and capitalized for headlines.
+
+--- src/gcc/p/Make-lang.in~ 2003-08-31 10:13:01.000000000 +0200
++++ src/gcc/p/Make-lang.in 2003-08-31 10:20:51.000000000 +0200
+@@ -711,42 +711,42 @@
+ pascal.start.encap:
+ pascal.rest.encap:
+
+-pascal.info: $(srcdir)/p/doc/info/gpc.info \
+- $(srcdir)/p/doc/info/gpcs.info \
+- $(srcdir)/p/doc/info/gpcs-de.info \
+- $(srcdir)/p/doc/info/gpc-hr.info \
+- $(srcdir)/p/doc/info/gpcs-hr.info \
+- $(srcdir)/p/doc/info/gpc-es.info \
+- $(srcdir)/p/doc/info/gpcs-es.info
++pascal.info: $(srcdir)/p/doc/info/gpc-2.1$(iv).info \
++ $(srcdir)/p/doc/info/gpcs-2.1$(iv).info \
++ $(srcdir)/p/doc/info/gpcs-de-2.1$(iv).info \
++ $(srcdir)/p/doc/info/gpc-hr-2.1$(iv).info \
++ $(srcdir)/p/doc/info/gpcs-hr-2.1$(iv).info \
++ $(srcdir)/p/doc/info/gpc-es-2.1$(iv).info \
++ $(srcdir)/p/doc/info/gpcs-es-2.1$(iv).info
+ pascal.dvi: gpc.dvi
+
+-$(srcdir)/p/doc/info/gpc.info: $(GPC_TEXI_EN)
++$(srcdir)/p/doc/info/gpc-2.1$(iv).info: $(GPC_TEXI_EN)
+ [ -d "$(srcdir)/p/doc/info" ] || $(srcdir)/p/script/mkdir-p "$(srcdir)/p/doc/info"
+- $(MAKEINFO_EN) -o $(srcdir)/p/doc/info/gpc.info gpc.texi
++ $(MAKEINFO_EN) -o $(srcdir)/p/doc/info/gpc-2.1$(iv).info gpc.texi
+
+-$(srcdir)/p/doc/info/gpcs.info: $(GPC_TEXI_EN)
++$(srcdir)/p/doc/info/gpcs-2.1$(iv).info: $(GPC_TEXI_EN)
+ [ -d "$(srcdir)/p/doc/info" ] || $(srcdir)/p/script/mkdir-p "$(srcdir)/p/doc/info"
+- $(MAKEINFO_EN) --no-split -o $(srcdir)/p/doc/info/gpcs.info gpcs.texi
++ $(MAKEINFO_EN) --no-split -o $(srcdir)/p/doc/info/gpcs-2.1$(iv).info gpcs.texi
+
+-$(srcdir)/p/doc/info/gpcs-de.info: $(GPC_TEXI_DE)
++$(srcdir)/p/doc/info/gpcs-de-2.1$(iv).info: $(GPC_TEXI_DE)
+ [ -d "$(srcdir)/p/doc/info" ] || $(srcdir)/p/script/mkdir-p "$(srcdir)/p/doc/info"
+- $(MAKEINFO_DE) --no-split -o $(srcdir)/p/doc/info/gpcs-de.info gpcs.texi
++ $(MAKEINFO_DE) --no-split -o $(srcdir)/p/doc/info/gpcs-de-2.1$(iv).info gpcs.texi
+
+-$(srcdir)/p/doc/info/gpc-hr.info: $(GPC_TEXI_HR)
++$(srcdir)/p/doc/info/gpc-hr-2.1$(iv).info: $(GPC_TEXI_HR)
+ [ -d "$(srcdir)/p/doc/info" ] || $(srcdir)/p/script/mkdir-p "$(srcdir)/p/doc/info"
+- $(MAKEINFO_HR) -o $(srcdir)/p/doc/info/gpc-hr.info gpc.texi
++ $(MAKEINFO_HR) -o $(srcdir)/p/doc/info/gpc-hr-2.1$(iv).info gpc.texi
+
+-$(srcdir)/p/doc/info/gpcs-hr.info: $(GPC_TEXI_HR)
++$(srcdir)/p/doc/info/gpcs-hr-2.1$(iv).info: $(GPC_TEXI_HR)
+ [ -d "$(srcdir)/p/doc/info" ] || $(srcdir)/p/script/mkdir-p "$(srcdir)/p/doc/info"
+- $(MAKEINFO_HR) --no-split -o $(srcdir)/p/doc/info/gpcs-hr.info gpcs.texi
++ $(MAKEINFO_HR) --no-split -o $(srcdir)/p/doc/info/gpcs-hr-2.1$(iv).info gpcs.texi
+
+-$(srcdir)/p/doc/info/gpc-es.info: $(GPC_TEXI_ES)
++$(srcdir)/p/doc/info/gpc-es-2.1$(iv).info: $(GPC_TEXI_ES)
+ [ -d "$(srcdir)/p/doc/info" ] || $(srcdir)/p/script/mkdir-p "$(srcdir)/p/doc/info"
+- $(MAKEINFO_ES) -o $(srcdir)/p/doc/info/gpc-es.info gpc.texi
++ $(MAKEINFO_ES) -o $(srcdir)/p/doc/info/gpc-es-2.1$(iv).info gpc.texi
+
+-$(srcdir)/p/doc/info/gpcs-es.info: $(GPC_TEXI_ES)
++$(srcdir)/p/doc/info/gpcs-es-2.1$(iv).info: $(GPC_TEXI_ES)
+ [ -d "$(srcdir)/p/doc/info" ] || $(srcdir)/p/script/mkdir-p "$(srcdir)/p/doc/info"
+- $(MAKEINFO_ES) --no-split -o $(srcdir)/p/doc/info/gpcs-es.info gpcs.texi
++ $(MAKEINFO_ES) --no-split -o $(srcdir)/p/doc/info/gpcs-es-2.1$(iv).info gpcs.texi
+
+ gpc.dvi: $(GPC_TEXI_EN)
+ TEXINPUTS=$(srcdir)/p/doc:$(srcdir)/p/doc/images:$$TEXINPUTS \
+@@ -942,11 +942,11 @@
+ fi
+
+ pascal.install-info: pascal.install-info-man-dirs pascal.info
+- rm -f $(DESTDIR)$(infodir)/gpc.info* $(DESTDIR)$(infodir)/gpcs.info* $(DESTDIR)$(infodir)/gpcs-de.info* $(DESTDIR)$(infodir)/gpcs-hr.info* $(DESTDIR)$(infodir)/gpcs-es.info*
+- for f in `cd $(srcdir)/p/doc/info && echo gpc.info* gpcs*.info*`; do \
++ rm -f $(DESTDIR)$(infodir)/gpc*.info* $(DESTDIR)$(infodir)/gpcs*.info* $(DESTDIR)$(infodir)/gpcs-de*.info* $(DESTDIR)$(infodir)/gpcs-hr*.info* $(DESTDIR)$(infodir)/gpcs-es*.info*
++ for f in `cd $(srcdir)/p/doc/info && echo gpc-2.1$(iv).info* gpcs*.info*`; do \
+ $(INSTALL_DATA) $(srcdir)/p/doc/info/$$f $(DESTDIR)$(infodir)/$$f || exit 1; \
+ done
+- chmod a-x $(DESTDIR)$(infodir)/gpc.info* $(DESTDIR)$(infodir)/gpcs.info* $(DESTDIR)$(infodir)/gpcs-de.info* $(DESTDIR)$(infodir)/gpcs-hr.info* $(DESTDIR)$(infodir)/gpcs-es.info*
++ chmod a-x $(DESTDIR)$(infodir)/gpc*.info* $(DESTDIR)$(infodir)/gpcs*.info* $(DESTDIR)$(infodir)/gpcs-de*.info* $(DESTDIR)$(infodir)/gpcs-hr*.info* $(DESTDIR)$(infodir)/gpcs-es*.info*
+
+ pascal.install-man: pascal.install-info-man-dirs $(srcdir)/p/doc/en/gpc.1 $(srcdir)/p/doc/generated/gpc-run.1
+ -if [ -f gpc1$(exeext) ]; then \
--- gcc-4.1-4.1.1.orig/debian/patches/libjava-subdir.dpatch
+++ gcc-4.1-4.1.1/debian/patches/libjava-subdir.dpatch
@@ -0,0 +1,157 @@
+#! /bin/sh -e
+
+# DP: - Set the libjava sublibdir to /usr/lib/gcj-4.1
+# DP: - Set the default libgcj database dir to /var/lib/gcj-4.1
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ cd ${dir}libjava && autoconf
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ rm -f ${dir}libjava/configure
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+--- libjava/configure.ac.orig 2006-09-09 13:39:06.060718000 +0200
++++ libjava/configure.ac 2006-09-09 13:39:19.260718000 +0200
+@@ -439,6 +439,9 @@
+ AS_HELP_STRING([--with-java-home=DIRECTORY],
+ [value of java.home system property]),
+ [JAVA_HOME="${withval}"], [JAVA_HOME=""])
++if test -n "$with_multisubdir"; then
++ JAVA_HOME=`echo $JAVA_HOME | sed "s,/usr/lib/,/usr/lib$with_multisubdir/,"`
++fi
+ AM_CONDITIONAL(JAVA_HOME_SET, test ! -z "$JAVA_HOME")
+ AC_SUBST(JAVA_HOME)
+
+@@ -1292,15 +1295,17 @@
+ # Determine where the standard .db file and GNU Classpath JNI
+ # libraries are found.
+ multi_os_directory=`$CC -print-multi-os-directory`
++short_version=`sed -r 's/([[0-9]]+\.[[0-9]]+).*/\1/' $srcdir/../gcc/BASE-VER`
+ case $multi_os_directory in
+ .)
+- dbexecdir='$(libdir)/gcj-$(gcc_version)' # Avoid /.
++ dbexecdir='$(libdir)/'gcj-$short_version # Avoid /.
+ ;;
+ *)
+- dbexecdir='$(libdir)/'$multi_os_directory'/gcj-$(gcc_version)'
++ dbexecdir='$(libdir)/'$multi_os_directory/gcj-$short_version
+ ;;
+ esac
+ AC_SUBST(dbexecdir)
++ac_configure_args="$ac_configure_args --with-native-libdir=\$\(toolexeclibdir\)/gcj-$short_version"
+
+ # Determine gcj version number.
+ gcjversion=`$GCJ -v 2>&1 | sed -n 's/^.*version \([[^ ]]*\).*$/\1/p'`
+--- libjava/Makefile.am.orig 2006-09-09 13:39:06.140718000 +0200
++++ libjava/Makefile.am 2006-09-09 13:39:19.260718000 +0200
+@@ -5,7 +5,8 @@
+ ACLOCAL_AMFLAGS = -I . -I .. -I ../config
+
+ # May be used by various substitution variables.
+-gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
++gcc_full_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
++gcc_version := $(shell sed -r 's/([0-9]+\.[0-9]+).*/\1/' $(top_srcdir)/../gcc/BASE-VER)
+
+ SUBDIRS = $(DIRLTDL) gcj include classpath
+ if TESTSUBDIR
+@@ -27,7 +28,7 @@
+ target_noncanonical = @target_noncanonical@
+
+ # This is required by TL_AC_GXX_INCLUDE_DIR.
+-libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)
++libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_full_version)
+
+ ##
+ ## What gets installed, and where.
+@@ -126,7 +127,7 @@
+ -DGCJ_ENDORSED_DIRS="\"$(jardir)/gcj-endorsed\"" \
+ -DGCJ_VERSIONED_LIBDIR="\"$(dbexecdir)\"" \
+ -DPATH_SEPARATOR="\"$(CLASSPATH_SEPARATOR)\"" \
+- -DLIBGCJ_DEFAULT_DATABASE="\"$(dbexecdir)/$(db_name)\"" \
++ -DLIBGCJ_DEFAULT_DATABASE="\"$(subst /usr,/var,$(dbexecdir))/$(db_name)\"" \
+ -DLIBGCJ_DEFAULT_DATABASE_PATH_TAIL="\"$(db_pathtail)\"" \
+ -DTOOLEXECLIBDIR="\"$(toolexeclibdir)\""
+
+--- libjava/Makefile.in.orig 2006-09-09 13:39:06.160718000 +0200
++++ libjava/Makefile.in 2006-09-09 13:40:26.670718000 +0200
+@@ -668,7 +668,7 @@
+ libdir = @libdir@
+ libexecdir = @libexecdir@
+ libgcj_basedir = @libgcj_basedir@
+-libstdcxx_incdir = @libstdcxx_incdir@
++libstdcxx_incdir = c++/$(gcc_full_version)
+ localstatedir = @localstatedir@
+ mandir = @mandir@
+ mkdir_p = @mkdir_p@
+@@ -696,7 +696,8 @@
+ ACLOCAL_AMFLAGS = -I . -I .. -I ../config
+
+ # May be used by various substitution variables.
+-gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
++gcc_full_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
++gcc_version := $(shell sed -r 's/([0-9]+\.[0-9]+).*/\1/' $(top_srcdir)/../gcc/BASE-VER)
+ SUBDIRS = $(DIRLTDL) gcj include classpath $(am__append_1)
+
+ # write_entries_to_file - writes each entry in a list
+@@ -709,7 +710,7 @@
+ write_entries_to_file = $(shell rm -f $(2) || :) $(shell touch $(2)) $(foreach object,$(1),$(shell echo $(object) >> $(2)))
+
+ # This is required by TL_AC_GXX_INCLUDE_DIR.
+-libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)
++libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_full_version)
+ toolexeclib_LTLIBRARIES = libgcj.la libgij.la libgcj-tools.la \
+ $(am__append_2) $(am__append_3)
+ toolexecmainlib_DATA = libgcj.spec
+@@ -753,7 +754,7 @@
+ -DGCJ_ENDORSED_DIRS="\"$(jardir)/gcj-endorsed\"" \
+ -DGCJ_VERSIONED_LIBDIR="\"$(dbexecdir)\"" \
+ -DPATH_SEPARATOR="\"$(CLASSPATH_SEPARATOR)\"" \
+- -DLIBGCJ_DEFAULT_DATABASE="\"$(dbexecdir)/$(db_name)\"" \
++ -DLIBGCJ_DEFAULT_DATABASE="\"$(subst /usr,/var,$(dbexecdir))/$(db_name)\"" \
+ -DLIBGCJ_DEFAULT_DATABASE_PATH_TAIL="\"$(db_pathtail)\"" \
+ -DTOOLEXECLIBDIR="\"$(toolexeclibdir)\""
+
+--- gcc/java/Make-lang.in~ 2006-09-11 08:41:56.950718000 +0200
++++ gcc/java/Make-lang.in 2006-09-11 09:25:28.160718000 +0200
+@@ -385,12 +385,13 @@
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(ZLIBINC) \
+ $(srcdir)/java/jcf-io.c $(OUTPUT_OPTION)
+
++short_version := $(shell echo $(version) | sed -r 's/([0-9]+\.[0-9]+).*/\1/')
+ # jcf-path.o needs a -D.
+ java/jcf-path.o: java/jcf-path.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+ java/jcf.h
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
+- -DLIBGCJ_ZIP_FILE='"$(datadir)/java/libgcj-$(version).jar"' \
+- -DDEFAULT_TARGET_VERSION=\"$(version)\" \
++ -DLIBGCJ_ZIP_FILE='"$(datadir)/java/libgcj-$(short_version).jar"' \
++ -DDEFAULT_TARGET_VERSION=\"$(short_version)\" \
+ $(srcdir)/java/jcf-path.c $(OUTPUT_OPTION)
+
+ # create gjnih's object
+--- libjava/testsuite/lib/libjava.exp~ 2006-09-11 08:41:49.890718000 +0200
++++ libjava/testsuite/lib/libjava.exp 2006-09-11 09:12:50.470718000 +0200
+@@ -174,6 +174,7 @@
+ set text [eval exec "$GCJ_UNDER_TEST -B$specdir -v 2>@ stdout"]
+ regexp " version \[^\n\r\]*" $text version
+ set libjava_version [lindex $version 1]
++ set libjava_version "4.1"
+
+ verbose "version: $libjava_version"
+
--- gcc-4.1-4.1.1.orig/debian/patches/pr29154.dpatch
+++ gcc-4.1-4.1.1/debian/patches/pr29154.dpatch
@@ -0,0 +1,121 @@
+#! /bin/sh -e
+
+# DP: Fix PR c/29154, taken from the gcc-4_1-branch.
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+
+2006-10-02 Jakub Jelinek
+
+ PR c/29154
+ * gimplify.c (gimplify_self_mod_expr): Run inner expression's post
+ side effects after the outer expression's post side effects.
+
+2006-10-02 Jakub Jelinek
+
+ PR c/29154
+ * gcc.c-torture/execute/20060929-1.c: New test.
+
+Index: gcc/testsuite/gcc.c-torture/execute/20060929-1.c
+===================================================================
+--- gcc/testsuite/gcc.c-torture/execute/20060929-1.c (revision 0)
++++ gcc/testsuite/gcc.c-torture/execute/20060929-1.c (revision 117367)
+@@ -0,0 +1,44 @@
++/* PR c/29154 */
++
++extern void abort (void);
++
++void
++foo (int **p, int *q)
++{
++ *(*p++)++ = *q++;
++}
++
++void
++bar (int **p, int *q)
++{
++ **p = *q++;
++ *(*p++)++;
++}
++
++void
++baz (int **p, int *q)
++{
++ **p = *q++;
++ (*p++)++;
++}
++
++int
++main (void)
++{
++ int i = 42, j = 0;
++ int *p = &i;
++ foo (&p, &j);
++ if (p - 1 != &i || j != 0 || i != 0)
++ abort ();
++ i = 43;
++ p = &i;
++ bar (&p, &j);
++ if (p - 1 != &i || j != 0 || i != 0)
++ abort ();
++ i = 44;
++ p = &i;
++ baz (&p, &j);
++ if (p - 1 != &i || j != 0 || i != 0)
++ abort ();
++ return 0;
++}
+Index: gcc/gimplify.c
+===================================================================
+--- gcc/gimplify.c (revision 117366)
++++ gcc/gimplify.c (revision 117367)
+@@ -1717,7 +1717,7 @@
+ bool want_value)
+ {
+ enum tree_code code;
+- tree lhs, lvalue, rhs, t1;
++ tree lhs, lvalue, rhs, t1, post = NULL, *orig_post_p = post_p;
+ bool postfix;
+ enum tree_code arith_code;
+ enum gimplify_status ret;
+@@ -1734,6 +1734,11 @@
+ else
+ postfix = false;
+
++ /* For postfix, make sure the inner expression's post side effects
++ are executed after side effects from this expression. */
++ if (postfix)
++ post_p = &post;
++
+ /* Add or subtract? */
+ if (code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR)
+ arith_code = PLUS_EXPR;
+@@ -1764,7 +1769,8 @@
+
+ if (postfix)
+ {
+- gimplify_and_add (t1, post_p);
++ gimplify_and_add (t1, orig_post_p);
++ append_to_statement_list (post, orig_post_p);
+ *expr_p = lhs;
+ return GS_ALL_DONE;
+ }
--- gcc-4.1-4.1.1.orig/debian/patches/ada-symbolic-tracebacks.dpatch
+++ gcc-4.1-4.1.1/debian/patches/ada-symbolic-tracebacks.dpatch
@@ -0,0 +1,333 @@
+#! /bin/sh -e
+
+# DP: - Enable support for symbolic tracebacks in exceptions (delete the dummy
+# DP: convert_addresses from adaint.c, and provide a real one separately.)
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+Ported Jürgen Pfeifer's patch to enable symbolic tracebacks on Debian
+GNU/Linux.
+
+The binary distribution of GNAT 3.15p comes with an old version of
+binutils that includes a library, libaddr2line.a. This library does
+not exist in recent versions of binutils. The patch works around this
+by calling /usr/bin/addr2line (still part of binutils) and parsing the
+output. See debian/convert_addresses.c for the gory details.
+
+I have modified convert_addresses.c to not use a shell script anymore;
+Debian controls the version of binutils which is installed. Also, I
+use execve instead of execle.
+
+--
+Ludovic Brenta.
+
+
+--- gcc/ada/adaint.c~ 2005-11-15 14:52:31.000000000 +0100
++++ gcc/ada/adaint.c 2006-04-23 14:43:55.000000000 +0200
+@@ -2541,33 +2541,6 @@
+ }
+ #endif
+
+-#if defined (CROSS_COMPILE) \
+- || (! ((defined (sparc) || defined (i386)) && defined (sun) \
+- && defined (__SVR4)) \
+- && ! (defined (linux) && (defined (i386) || defined (__x86_64__))) \
+- && ! (defined (linux) && defined (__ia64__)) \
+- && ! defined (__FreeBSD__) \
+- && ! defined (__hpux__) \
+- && ! defined (__APPLE__) \
+- && ! defined (_AIX) \
+- && ! (defined (__alpha__) && defined (__osf__)) \
+- && ! defined (__MINGW32__) \
+- && ! (defined (__mips) && defined (__sgi)))
+-
+-/* Dummy function to satisfy g-trasym.o. See the preprocessor conditional
+- just above for a list of native platforms that provide a non-dummy
+- version of this procedure in libaddr2line.a. */
+-
+-void
+-convert_addresses (void *addrs ATTRIBUTE_UNUSED,
+- int n_addr ATTRIBUTE_UNUSED,
+- void *buf ATTRIBUTE_UNUSED,
+- int *len ATTRIBUTE_UNUSED)
+-{
+- *len = 0;
+-}
+-#endif
+-
+ #if defined (_WIN32)
+ int __gnat_argument_needs_quote = 1;
+ #else
+--- gcc/ada/g-trasym.adb~ Thu Oct 24 11:02:18 2002
++++ gcc/ada/g-trasym.adb Fri Jul 4 16:16:30 2003
+@@ -33,16 +33,16 @@
+ ------------------------------------------------------------------------------
+
+ -- Run-time symbolic traceback support
++-- This file has been modified by Juergen Pfeifer (31-Dec-1999) for
++-- the purpose to support the Ada for Linux Team implementation of
++-- convert_addresses. This implementation has the advantage to run
++-- on the binutils as they are deployed on Linux.
+
+ with System.Soft_Links;
+ with Ada.Exceptions.Traceback; use Ada.Exceptions.Traceback;
+
+ package body GNAT.Traceback.Symbolic is
+
+- pragma Linker_Options ("-laddr2line");
+- pragma Linker_Options ("-lbfd");
+- pragma Linker_Options ("-liberty");
+-
+ package TSL renames System.Soft_Links;
+
+ ------------------------
+@@ -56,16 +56,19 @@
+ buf : System.Address;
+ len : System.Address);
+ pragma Import (C, convert_addresses, "convert_addresses");
+- -- This is the procedure version of the Ada aware addr2line that will
+- -- use argv[0] as the executable containing the debug information.
+- -- This procedure is provided by libaddr2line on targets that support
+- -- it. A dummy version is in a-adaint.c for other targets so that build
+- -- of shared libraries doesn't generate unresolved symbols.
++ -- This is the ALT Linux specific version adapted to the binutils
++ -- deployed with most Linuxes. These binutils already have an
++ -- addr2line tool that demangles Ada symbolic names, but there are
++ -- version dependant variants for the option names. Therefore our
++ -- implementation spawns a shell script that does normalization of
++ -- the option and then executes addr2line and communicates with it
++ -- through a bidirectional pipe.
+ --
+ -- Note that this procedure is *not* thread-safe.
+
+- Res : String (1 .. 256 * Traceback'Length);
+- Len : Integer;
++ B_Size : constant Integer := 256 * Traceback'Length;
++ Len : Integer := B_Size;
++ Res : String (1 .. B_Size);
+
+ begin
+ if Traceback'Length > 0 then
+--- gcc/ada/convert_addresses.c~ 1970-01-01 01:00:00.000000000 +0100
++++ gcc/ada/convert_addresses.c 2005-04-27 15:06:51.000000000 +0200
+@@ -0,0 +1,157 @@
++/*
++ Copyright (C) 1999 by Juergen Pfeifer
++ Ada for Linux Team (ALT)
++
++ Permission is hereby granted, free of charge, to any person obtaining a
++ copy of this software and associated documentation files (the
++ "Software"), to deal in the Software without restriction, including
++ without limitation the rights to use, copy, modify, merge, publish,
++ distribute, distribute with modifications, sublicense, and/or sell
++ copies of the Software, and to permit persons to whom the Software is
++ furnished to do so, subject to the following conditions:
++
++ The above copyright notice and this permission notice shall be included
++ in all copies or substantial portions of the Software.
++
++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
++ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++ IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
++ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
++ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
++ THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++
++ Except as contained in this notice, the name(s) of the above copyright
++ holders shall not be used in advertising or otherwise to promote the
++ sale, use or other dealings in this Software without prior written
++ authorization.
++*/
++#include
++#include
++#include
++#include
++#include
++#include
++
++#define STDIN_FILENO 0
++#define STDOUT_FILENO 1
++#define MAX_LINE 1024
++
++#define CLOSE1 close(fd1[0]); close(fd1[1])
++#define CLOSE2 close(fd2[0]); close(fd2[1])
++#define RESTSIG sigaction(SIGPIPE,&oact,NULL)
++
++void convert_addresses
++( void* addrs[],
++ int n_addr,
++ char* buf,
++ int* len)
++{
++ int max_len = *len;
++ pid_t pid = getpid();
++ pid_t child;
++
++ struct sigaction act, oact;
++
++ int fd1[2], fd2[2];
++ char exe_name[128];
++
++ *buf = 0; *len = 0;
++ /* Thanx to the /proc filesystem we can very easily reference our own
++ executable image:-)*/
++ snprintf(exe_name,sizeof(exe_name),"--exe=/proc/%ld/exe", (long)pid);
++
++ act.sa_handler = SIG_IGN;
++ sigemptyset(&act.sa_mask);
++ act.sa_flags = 0;
++ if (sigaction(SIGPIPE,&act,&oact) < 0)
++ return;
++
++ if (pipe(fd1) >= 0) {
++ if (pipe(fd2)>=0) {
++ if ((child = fork()) < 0) {
++ CLOSE1; CLOSE2; RESTSIG;
++ return;
++ }
++ else {
++ if (0==child) {
++ close(fd1[1]);
++ close(fd2[0]);
++ if (fd1[0] != STDIN_FILENO) {
++ if (dup2(fd1[0],STDIN_FILENO) != STDIN_FILENO) {
++ CLOSE1; CLOSE2;
++ }
++ close(fd1[0]);
++ }
++ if (fd2[1] != STDOUT_FILENO) {
++ if (dup2(fd2[1],STDOUT_FILENO) != STDOUT_FILENO) {
++ CLOSE1; CLOSE2;
++ }
++ close(fd2[1]);
++ }
++ {
++ /* As pointed out by Florian Weimer to me, it is a
++ security threat to call the script with a user defined
++ environment and using the path. That would be Trojans
++ pleasure. Therefore we use the absolute path to
++ addr2line and an empty environment. That should be
++ safe.
++ */
++ char *const argv[] = { "addr2line",
++ exe_name,
++ "--demangle=gnat",
++ "--functions",
++ "--basenames",
++ NULL };
++ char *const envp[] = { NULL };
++ if (execve("/usr/bin/addr2line", argv, envp) < 0) {
++ CLOSE1; CLOSE2;
++ }
++ }
++ }
++ else {
++ int i, n;
++ char hex[16];
++ char line[MAX_LINE + 1];
++ char *p;
++ char *s = buf;
++
++ /* Parent context */
++ close(fd1[0]);
++ close(fd2[1]);
++
++ for(i=0; i < n_addr; i++) {
++ snprintf(hex,sizeof(hex),"%p\n",addrs[i]);
++ write(fd1[1],hex,strlen(hex));
++ n = read(fd2[0],line,MAX_LINE);
++ if (n<=0)
++ break;
++ line[n]=0;
++ /* We have approx. 16 additional chars for "%p in " clause.
++ We use this info to prevent a buffer overrun.
++ */
++ if (n + 16 + (*len) > max_len)
++ break;
++ p = strchr(line,'\n');
++ if (p) {
++ if (*(p+1)) {
++ *p = 0;
++ *len += snprintf(s, (max_len - (*len)), "%p in %s at %s",addrs[i], line, p+1);
++ }
++ else {
++ *len += snprintf(s, (max_len - (*len)), "%p at %s",addrs[i], line);
++ }
++ s = buf + (*len);
++ }
++ }
++ close(fd1[1]);
++ close(fd2[0]);
++ }
++ }
++ }
++ else {
++ CLOSE1;
++ }
++ }
++ RESTSIG;
++}
+--- gcc/ada/Makefile.in.orig 2006-04-17 19:39:15.848644432 +0000
++++ gcc/ada/Makefile.in 2006-04-17 19:43:14.794319168 +0000
+@@ -1352,7 +1352,7 @@
+ include $(fsrcdir)/Makefile.rtl
+
+ GNATRTL_OBJS = $(GNATRTL_NONTASKING_OBJS) $(GNATRTL_TASKING_OBJS) \
+- g-trasym.o memtrack.o
++ g-trasym.o memtrack.o convert_addresses.o
+
+ # Default run time files
+
+@@ -1507,7 +1507,6 @@
+ for file in rts/*.ali; do \
+ $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
+ done
+- -$(INSTALL_DATA) rts/g-trasym$(objext) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
+ -cd rts; for file in *$(arext);do \
+ $(INSTALL_DATA) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
+ $(RANLIB_FOR_TARGET) $(DESTDIR)$(ADA_RTL_OBJ_DIR)/$$file; \
+@@ -1607,7 +1606,7 @@
+ $(GNATRTL_OBJS)
+ $(RM) rts/libgnat$(arext) rts/libgnarl$(arext)
+ $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgnat$(arext) \
+- $(addprefix rts/,$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS))
++ $(addprefix rts/,$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) g-trasym.o convert_addresses.o)
+ ifneq ($(PREFIX_OBJS),)
+ $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgccprefix$(arext) \
+ $(PREFIX_OBJS);
+@@ -1637,6 +1636,7 @@
+ $(TARGET_LIBGCC2_CFLAGS) \
+ -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
++ g-trasym.o convert_addresses.o \
+ $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(MISCLIB) -lm
+ cd rts; ../../xgcc -B../../ -shared $(GNATLIBCFLAGS) \
+@@ -1859,6 +1859,7 @@
+ sysdep.o : sysdep.c
+ raise-gcc.o : raise-gcc.c raise.h
+ raise.o : raise.c raise.h
++convert_addresses.o : convert_addresses.c
+
+ gen-soccon: gen-soccon.c gsocket.h
+ $(CC) $(ALL_CFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
--- gcc-4.1-4.1.1.orig/debian/patches/libjava-biarch-alsa.dpatch
+++ gcc-4.1-4.1.1/debian/patches/libjava-biarch-alsa.dpatch
@@ -0,0 +1,48 @@
+#! /bin/sh -e
+
+# DP: Fix linking with the correct biarch asound library
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ #cd ${dir}libjava && automake
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+--- libjava/classpath/native/jni/midi-alsa/Makefile.am~ 2006-08-01 03:07:25.837525512 +0200
++++ libjava/classpath/native/jni/midi-alsa/Makefile.am 2006-08-01 03:08:35.101995712 +0200
+@@ -4,7 +4,7 @@
+ gnu_javax_sound_midi_alsa_AlsaPortDevice.c \
+ gnu_javax_sound_midi_alsa_AlsaMidiDeviceProvider.c
+
+-libgjsmalsa_la_LIBADD = -lasound
++libgjsmalsa_la_LIBADD = `case "$(CC)" in *-m64*) echo -L/usr/lib64;; *-m32*) echo -L/usr/lib32; esac` -lasound
+ libgjsmalsa_la_LDFLAGS = -avoid-version
+
+ AM_LDFLAGS = @CLASSPATH_MODULE@
+--- libjava/classpath/native/jni/midi-alsa/Makefile.in~ 2006-08-01 03:07:25.838525360 +0200
++++ libjava/classpath/native/jni/midi-alsa/Makefile.in 2006-08-01 03:08:56.001818456 +0200
+@@ -310,7 +310,7 @@
+ gnu_javax_sound_midi_alsa_AlsaPortDevice.c \
+ gnu_javax_sound_midi_alsa_AlsaMidiDeviceProvider.c
+
+-libgjsmalsa_la_LIBADD = -lasound
++libgjsmalsa_la_LIBADD = `case "$(CC)" in *-m64*) echo -L/usr/lib64;; *-m32*) echo -L/usr/lib32; esac` -lasound
+ libgjsmalsa_la_LDFLAGS = -avoid-version
+ AM_LDFLAGS = @CLASSPATH_MODULE@
+ AM_CPPFLAGS = @CLASSPATH_INCLUDES@ `pkg-config --cflags-only-I alsa`
--- gcc-4.1-4.1.1.orig/debian/patches/fastjar-doc.dpatch
+++ gcc-4.1-4.1.1/debian/patches/fastjar-doc.dpatch
@@ -0,0 +1,45 @@
+#! /bin/sh -e
+
+# DP: fastjar.texi: Directly define the gcctabopt and gccoptlist macros.
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+--- fastjar/fastjar.texi~ 2006-02-08 05:55:47.000000000 +0000
++++ fastjar/fastjar.texi 2006-08-29 19:31:40.590718000 +0000
+@@ -10,7 +10,16 @@
+ @c When this manual is copyrighted.
+ @set copyrights-fastjar 2002
+
+-@include gcc-common.texi
++@macro gcctabopt{body}
++@code{\body\}
++@end macro
++@macro gccoptlist{body}
++@smallexample
++\body\
++@end smallexample
++@end macro
++
++@include gcc-vers.texi
+
+ @c Versions
+ @set which-gcj GCC-@value{version-GCC}
--- gcc-4.1-4.1.1.orig/debian/patches/ada-driver.dpatch
+++ gcc-4.1-4.1.1/debian/patches/ada-driver.dpatch
@@ -0,0 +1,41 @@
+#! /bin/sh -e
+
+# DP: Look for gcc-3.3, gcc-3.4 and gcc-4.0 as gcc with Ada support.
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ cd ${dir}gcc && autoconf
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ rm ${dir}gcc/configure
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+
+--- gcc/aclocal.m4~ Sat Mar 2 00:37:42 2002
++++ gcc/aclocal.m4 Sat Apr 6 13:01:36 2002
+@@ -312,6 +312,10 @@
+ ${ac_tool_prefix}$user_cc $user_cc \
+ ${ac_tool_prefix}gcc gcc \
+ ${ac_tool_prefix}cc cc \
++ ${ac_tool_prefix}gcc-4.1 gcc-4.1 \
++ ${ac_tool_prefix}gcc-4.0 gcc-4.0 \
++ ${ac_tool_prefix}gcc-3.4 gcc-3.4 \
++ ${ac_tool_prefix}gcc-3.3 gcc-3.3 \
+ ${ac_tool_prefix}gnatgcc gnatgcc \
+ ${ac_tool_prefix}gnatcc gnatcc \
+ ${ac_tool_prefix}adagcc adagcc \
--- gcc-4.1-4.1.1.orig/debian/patches/ada-acats.dpatch
+++ gcc-4.1-4.1.1/debian/patches/ada-acats.dpatch
@@ -0,0 +1,78 @@
+#! /bin/sh -e
+
+# DP: - When running the ACATS, look for the gnat tools in their new
+# DP: directory (build/gnattools), and for the shared libraries in
+# DP: build/gcc/ada/rts, build/libgnatvsn and build/libgnatprj.
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+--- gcc/testsuite/ada/acats/run_acats~
++++ gcc/testsuite/ada/acats/run_acats 2006-04-22 08:57:50.933824704 +0200
+@@ -11,23 +11,42 @@
+ host_gnatmake=`type gnatmake | awk '{print $3}'`
+ ROOT=`${PWDCMD-pwd}`
+ BASE=`cd $ROOT/../../..; ${PWDCMD-pwd}`
+-
+-PATH=$BASE:$ROOT:$PATH
+-ADA_INCLUDE_PATH=$BASE/ada/rts
++GNATTOOLS=`cd $BASE/../gnattools; ${PWDCMD-pwd}`
++LIBGNATVSN=`cd $BASE/../libgnatvsn; ${PWDCMD-pwd}`
++LIBGNATPRJ=`cd $BASE/../libgnatprj; ${PWDCMD-pwd}`
++
++PATH=$GNATTOOLS:$BASE:$ROOT:$PATH
++ADA_INCLUDE_DIR=$BASE/ada/rts
++ADA_INCLUDE_PATH=$ADA_INCLUDE_DIR:$LIBGNATVSN:$LIBGNATPRJ
+ LD_LIBRARY_PATH=$ADA_INCLUDE_PATH:$BASE:$LD_LIBRARY_PATH
+ ADA_OBJECTS_PATH=$ADA_INCLUDE_PATH
+
+-if [ ! -d $ADA_INCLUDE_PATH ]; then
++if [ ! -d $ADA_INCLUDE_DIR ]; then
+ echo gnatlib missing, exiting.
+ exit 1
+ fi
+
+-if [ ! -f $BASE/gnatchop ]; then
++if [ ! -d $GNATTOOLS ]; then
++ echo gnattools missing, exiting.
++ exit 1
++fi
++
++if [ ! -d $LIBGNATVSN ]; then
++ echo libgnatvsn missing, exiting.
++ exit 1
++fi
++
++if [ ! -d $LIBGNATPRJ ]; then
++ echo libgnatprj missing, exiting.
++ exit 1
++fi
++
++if [ ! -f $GNATTOOLS/gnatchop ]; then
+ echo gnattools missing, exiting.
+ exit 1
+ fi
+
+-if [ ! -f $BASE/gnatmake ]; then
++if [ ! -f $GNATTOOLS/gnatmake ]; then
+ echo gnattools missing, exiting.
+ exit 1
+ fi
--- gcc-4.1-4.1.1.orig/debian/patches/libjava-stacktrace.dpatch
+++ gcc-4.1-4.1.1/debian/patches/libjava-stacktrace.dpatch
@@ -0,0 +1,70 @@
+#! /bin/sh -e
+
+# DP: libgcj: Lookup source file name and line number in separated
+# DP: debug files found in /usr/lib/debug
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+
+--- libjava/stacktrace.cc.orig 2006-06-16 13:54:07.078577632 +0200
++++ libjava/stacktrace.cc 2006-06-16 13:56:08.032189888 +0200
+@@ -20,6 +20,11 @@
+ #endif
+
+ #include
++#include
++#include
++#ifdef HAVE_UNISTD_H
++#include
++#endif
+
+ #include
+ #include
+@@ -222,6 +227,28 @@
+ finder->lookup (binaryName, (jlong) offset);
+ *sourceFileName = finder->getSourceFile();
+ *lineNum = finder->getLineNum();
++ if (*lineNum == -1 && info.file_name[0] == '/')
++ {
++ const char *debugPrefix = "/usr/lib/debug";
++ char *debugPath = (char *) malloc (strlen(debugPrefix)
++ + strlen(info.file_name)
++ + 2);
++
++ if (debugPath)
++ {
++ strcpy (debugPath, debugPrefix);
++ strcat (debugPath, info.file_name);
++ //printf ("%s: 0x%x\n", debugPath, offset);
++ if (!access (debugPath, R_OK))
++ {
++ binaryName = JvNewStringUTF (debugPath);
++ finder->lookup (binaryName, (jlong) offset);
++ *sourceFileName = finder->getSourceFile();
++ *lineNum = finder->getLineNum();
++ }
++ free (debugPath);
++ }
++ }
+ if (*lineNum == -1 && NameFinder::showRaw())
+ {
+ gnu::gcj::runtime::StringBuffer *t =
--- gcc-4.1-4.1.1.orig/debian/patches/i386-biarch.dpatch
+++ gcc-4.1-4.1.1/debian/patches/i386-biarch.dpatch
@@ -0,0 +1,306 @@
+#! /bin/sh -e
+
+# DP: biarch patches for i386/x86_64
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p1 < $0
+ cd ${dir}libcpp && autoconf
+ cd ${dir}libjava && autoconf
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p1 < $0
+ cd ${dir}libcpp && autoconf
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+
+--- src/gcc/config/i386/linux.h.orig 2005-08-14 21:55:36.674107407 +0200
++++ src/gcc/config/i386/linux.h 2005-08-14 21:56:41.002717189 +0200
+@@ -164,6 +164,7 @@
+ } \
+ } while (0)
+
++#ifdef __i386__
+ /* Used by crtstuff.c to initialize the base of data-relative relocations.
+ These are GOT relative on x86, so return the pic register. */
+ #ifdef __PIC__
+@@ -183,6 +184,7 @@
+ "addl\t$_GLOBAL_OFFSET_TABLE_+[.-.LPR%=],%0" \
+ : "=d"(BASE))
+ #endif
++#endif
+
+ #undef NEED_INDICATE_EXEC_STACK
+ #define NEED_INDICATE_EXEC_STACK 1
+--- src/gcc/config/i386/linux64.h.orig 2005-08-10 19:53:01.000000000 +0200
++++ src/gcc/config/i386/linux64.h 2006-09-29 11:19:27.588388000 +0200
+@@ -19,8 +19,11 @@
+ the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
+
++#ifndef TARGET_VERSION
+ #define TARGET_VERSION fprintf (stderr, " (x86-64 Linux/ELF)");
++#endif
+
++#undef TARGET_OS_CPP_BUILTINS
+ #define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+@@ -55,6 +58,7 @@
+ done. */
+
+ #undef LINK_SPEC
++#if TARGET_64BIT_DEFAULT
+ #define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} \
+ %{shared:-shared} \
+ %{!shared: \
+@@ -69,8 +73,22 @@
+ #define ENDFILE_SPEC \
+ "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
+ %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+-
++#else
++#define LINK_SPEC "%{m64:-m elf_x86_64} %{!m64:-m elf_i386} \
++ %{shared:-shared} \
++ %{!shared: \
++ %{!static: \
++ %{rdynamic:-export-dynamic} \
++ %{!m64:%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
++ %{m64:%{!dynamic-linker:-dynamic-linker /lib64/ld-linux-x86-64.so.2}}} \
++ %{static:-static}}"
++#endif
++
++#if TARGET_64BIT_DEFAULT
+ #define MULTILIB_DEFAULTS { "m64" }
++#else
++#define MULTILIB_DEFAULTS { "m32" }
++#endif
+
+ #undef NEED_INDICATE_EXEC_STACK
+ #define NEED_INDICATE_EXEC_STACK 1
+@@ -81,6 +99,7 @@
+ #define REG_NAME(reg) reg
+
+ #ifdef TARGET_LIBC_PROVIDES_SSP
++#undef TARGET_THREAD_SSP_OFFSET
+ /* i386 glibc provides __stack_chk_guard in %gs:0x14,
+ x86_64 glibc provides it in %fs:0x28. */
+ #define TARGET_THREAD_SSP_OFFSET (TARGET_64BIT ? 0x28 : 0x14)
+--- src/gcc/config.gcc.orig 2005-08-14 22:02:01.262199664 +0200
++++ src/gcc/config.gcc 2005-08-14 22:03:18.527917829 +0200
+@@ -1014,12 +1014,14 @@
+ i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu)
+ # Intel 80386's running GNU/*
+ # with ELF format using glibc 2
+- tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h i386/linux.h"
++ tm_file="i386/biarch.h ${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h i386/linux.h i386/x86-64.h i386/linux64.h"
+ case ${target} in
+ i[34567]86-*-knetbsd*-gnu) tm_file="${tm_file} knetbsd-gnu.h i386/knetbsd-gnu.h" ;;
+ i[34567]86-*-kfreebsd*-gnu) tm_file="${tm_file} kfreebsd-gnu.h i386/kfreebsd-gnu.h" ;;
+ esac
+- tmake_file="${tmake_file} i386/t-crtstuff i386/t-crtfm"
++ #tmake_file="${tmake_file} i386/t-crtstuff i386/t-crtfm"
++ tmake_file="${tmake_file} i386/t-crtfm i386/t-linux64"
++ need_64bit_hwint=yes
+ ;;
+ x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu)
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h \
+--- src/libffi/src/x86/ffitarget.h.orig 2005-08-14 21:55:36.677106503 +0200
++++ src/libffi/src/x86/ffitarget.h 2005-08-14 21:56:41.011714477 +0200
+@@ -33,6 +33,11 @@
+ #define X86
+ #endif
+
++#if defined (X86) && defined (__x86_64__)
++#undef X86
++#define X86_64
++#endif
++
+ /* ---- Generic type definitions ----------------------------------------- */
+
+ #ifndef LIBFFI_ASM
+--- src/libffi/Makefile.am.orig 2005-08-14 21:55:36.677106503 +0200
++++ src/libffi/Makefile.am 2005-08-14 21:56:41.012714176 +0200
+@@ -88,7 +88,7 @@
+ nodist_libffi_la_SOURCES += src/mips/ffi.c src/mips/o32.S
+ endif
+ if X86
+-nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/sysv.S
++nodist_libffi_la_SOURCES += src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S
+ endif
+ if X86_WIN32
+ nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/win32.S
+--- src/libffi/Makefile.in.orig 2005-08-14 21:55:36.678106202 +0200
++++ src/libffi/Makefile.in 2005-08-14 21:56:41.013713874 +0200
+@@ -41,7 +41,7 @@
+ target_triplet = @target@
+ @MIPS_IRIX_TRUE@am__append_1 = src/mips/ffi.c src/mips/o32.S src/mips/n32.S
+ @MIPS_LINUX_TRUE@am__append_2 = src/mips/ffi.c src/mips/o32.S
+-@X86_TRUE@am__append_3 = src/x86/ffi.c src/x86/sysv.S
++@X86_TRUE@am__append_3 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S
+ @X86_WIN32_TRUE@am__append_4 = src/x86/ffi.c src/x86/win32.S
+ @SPARC_TRUE@am__append_5 = src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S
+ @ALPHA_TRUE@am__append_6 = src/alpha/ffi.c src/alpha/osf.S
+@@ -94,7 +94,8 @@
+ @MIPS_IRIX_TRUE@am__objects_1 = src/mips/ffi.lo src/mips/o32.lo \
+ @MIPS_IRIX_TRUE@ src/mips/n32.lo
+ @MIPS_LINUX_TRUE@am__objects_2 = src/mips/ffi.lo src/mips/o32.lo
+-@X86_TRUE@am__objects_3 = src/x86/ffi.lo src/x86/sysv.lo
++@X86_TRUE@am__objects_3 = src/x86/ffi64.lo src/x86/unix64.lo \
++@X86_TRUE@ src/x86/ffi.lo src/x86/sysv.lo
+ @X86_WIN32_TRUE@am__objects_4 = src/x86/ffi.lo src/x86/win32.lo
+ @SPARC_TRUE@am__objects_5 = src/sparc/ffi.lo src/sparc/v8.lo \
+ @SPARC_TRUE@ src/sparc/v9.lo
+--- src/libjava/include/i386-signal.h.orig 2005-08-14 21:55:36.678106202 +0200
++++ src/libjava/include/i386-signal.h 2005-08-14 21:56:41.014713573 +0200
+@@ -11,6 +11,10 @@
+
+
+ #ifndef JAVA_SIGNAL_H
++#ifdef __x86_64__
++#include "x86_64-signal.h"
++#else
++
+ #define JAVA_SIGNAL_H 1
+
+ #include
+@@ -163,6 +167,6 @@
+ * Also, there is at the present time no unwind info in the
+ * linuxthreads library's signal handlers and so we can't unwind
+ * through them anyway. */
+-
++#endif /* ! __x86_64__ */
+ #endif /* JAVA_SIGNAL_H */
+
+--- src/libjava/sysdep/i386/locks.h.orig 2005-08-14 21:55:36.679105900 +0200
++++ src/libjava/sysdep/i386/locks.h 2005-08-14 21:56:41.014713573 +0200
+@@ -24,10 +24,17 @@
+ obj_addr_t new_val)
+ {
+ char result;
+- __asm__ __volatile__("lock; cmpxchgl %2, %0; setz %1"
+- : "=m"(*addr), "=q"(result)
++#ifdef __x86_64__
++ __asm__ __volatile__("lock; cmpxchgq %2, %0; setz %1"
++ : "=m"(*(addr)), "=q"(result)
+ : "r" (new_val), "a"(old), "m"(*addr)
+ : "memory");
++#else
++ __asm__ __volatile__("lock; cmpxchgl %2, %0; setz %1"
++ : "=m"(*(addr)), "=q"(result)
++ : "r" (new_val), "a"(old), "m"(*addr)
++ : "memory");
++#endif
+ return (bool) result;
+ }
+
+--- src/libjava/configure.ac~ 2006-01-27 22:46:01.437990736 +0100
++++ src/libjava/configure.ac 2006-01-27 22:50:09.561270264 +0100
+@@ -932,16 +932,17 @@
+ AC_CHECK_LIB(dl, dladdr, [
+ AC_DEFINE(HAVE_DLADDR, 1, [Define if you have dladdr()])])
+
+- if test x"$build" = x"$host"; then
+- AC_CHECK_FILES(/proc/self/exe, [
+- AC_DEFINE(HAVE_PROC_SELF_EXE, 1, [Define if you have /proc/self/exe])])
+- else
+- case $host in
+- *-linux*)
+- AC_DEFINE(HAVE_PROC_SELF_EXE, 1, [Define if you have /proc/self/exe])
+- ;;
+- esac
+- fi
++ case $host in
++ *-linux*)
++ AC_DEFINE(HAVE_PROC_SELF_EXE, 1, [Define if you have /proc/self/exe])
++ ;;
++ *)
++ if test x"$build" = x"$host"; then
++ AC_CHECK_FILES(/proc/self/exe, [
++ AC_DEFINE(HAVE_PROC_SELF_EXE, 1, [Define if you have /proc/self/exe])])
++ fi
++ ;;
++ esac
+
+ AM_ICONV
+ AM_LC_MESSAGES
+--- src/libcpp/configure.ac.orig 2005-08-14 21:55:36.681105298 +0200
++++ src/libcpp/configure.ac 2005-08-14 21:56:59.832041789 +0200
+@@ -116,6 +116,7 @@
+ arm*-*-eabi* | \
+ arm*-*-symbianelf* | \
+ x86_64-*-* | \
++ i[34567]86-*-* | \
+ ia64-*-* | \
+ hppa*64*-*-* | parisc*64*-*-* | \
+ i[34567]86-*-solaris2.1[0-9]* | \
+--- src/gcc/config/i386/biarch.h.orig 2005-08-14 21:56:41.001717490 +0200
++++ src/gcc/config/i386/biarch.h 2005-08-14 21:56:41.001717490 +0200
+@@ -0,0 +1,26 @@
++/* Make configure files to produce biarch compiler defaulting to 32bit mode.
++ This file must be included very first, while the OS specific file later
++ to overwrite otherwise wrong defaults.
++ Copyright (C) 2001, 2004 Free Software Foundation, Inc.
++ Contributed by Bo Thorsen .
++
++This file is part of GCC.
++
++GCC is free software; you can redistribute it and/or modify
++it under the terms of the GNU General Public License as published by
++the Free Software Foundation; either version 2, or (at your option)
++any later version.
++
++GCC is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++GNU General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with GCC; see the file COPYING. If not, write to
++the Free Software Foundation, 59 Temple Place - Suite 330,
++Boston, MA 02111-1307, USA. */
++
++#define TARGET_64BIT_DEFAULT 0
++#define TARGET_BI_ARCH 1
++#define DRIVER_SELF_SPECS "%{m64:%{!mtune:-mtune=x86-64}}"
+--- src/libtool.m4.orig 2005-08-14 21:55:36.680105599 +0200
++++ src/libtool.m4 2005-08-14 21:56:41.016712970 +0200
+@@ -191,14 +191,14 @@
+ rm -rf conftest*
+ ;;
+
+-x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
++i[[3456]]86-*-linux*|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case "`/usr/bin/file conftest.o`" in
+ *32-bit*)
+ case $host in
+- x86_64-*linux*)
++ i[[3456]]86-*-linux*|x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+@@ -214,7 +214,7 @@
+ ;;
+ *64-bit*)
+ case $host in
+- x86_64-*linux*)
++ i[[3456]]86-*-linux*|x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
--- gcc-4.1-4.1.1.orig/debian/patches/pr26885-doc.dpatch
+++ gcc-4.1-4.1.1/debian/patches/pr26885-doc.dpatch
@@ -0,0 +1,112 @@
+#! /bin/sh -e
+
+# DP: Proposed patch for PR driver/26885 (doc files)
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ #cd ${dir}gcc && autoconf
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ #rm ${dir}gcc/configure
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+Date: Tue, 2 May 2006 13:23:54 -0700
+
+gcc/
+
+2006-04-22 H.J. Lu
+
+ PR driver/26885
+ * Makefile.in (GCC_OBJS): New.
+ (OBJS-common): Add opts-common.o.
+ (xgcc$(exeext)): Replace gcc.o with $(GCC_OBJS).
+ (cpp$(exeext)): Likewise.
+ (gcc.o): Also depend on opts.h.
+ (opts-common.o): New.
+
+ * common.opt (gcoff): Add Negative(gdwarf-2).
+ (gdwarf-2): Add Negative(gstabs).
+ (gstabs): Add Negative(gstabs+).
+ (gstabs+): Add Negative(gvms).
+ (gvms): Add Negative(gxcoff).
+ (gxcoff): Add Negative(gxcoff+).
+ (gxcoff+): Add Negative(gcoff).
+ * config/i386/i386.opt (m32): Add Negative(m64).
+ (m64): Add Negative(m32).
+
+ * doc/options.texi: Document the Negative option.
+
+ * gcc.c: Include "opts.h".
+ (main): Call prune_options after expandargv.
+
+ * optc-gen.awk: Generate common declarations for all flag
+ variables in options.c. Output the neg_index field.
+
+ * opts.c (find_opt): Moved to ...
+ * opts-common.c: Here. New file.
+
+ * opts.h (cl_option): Add a neg_index field.
+ (find_opt): New.
+ (prune_options): Likewise.
+
+gcc/cp/
+
+2006-04-22 H.J. Lu
+
+ PR driver/26885
+ * Make-lang.in (GXX_OBJS): Replace gcc.o with $(GCC_OBJS).
+
+gcc/fortran/
+
+2006-04-22 H.J. Lu
+
+ PR driver/26885
+ * Make-lang.in (GFORTRAN_D_OBJS): Replace gcc.o with
+ $(GCC_OBJS).
+
+gcc/java/
+
+2006-04-22 H.J. Lu
+
+ PR driver/26885
+ * Make-lang.in ($(GCJ)$(exeext)): Replace gcc.o with
+ $(GCC_OBJS).
+
+gcc/treelang/
+
+2006-04-22 H.J. Lu
+
+ PR driver/26885
+ * Make-lang.in (gtreelang$(exeext)): Replace gcc.o with
+ $(GCC_OBJS).
+
+--- gcc/doc/options.texi.orig 2006-05-07 13:23:52.294265896 +0200
++++ gcc/doc/options.texi 2006-05-07 13:24:36.553537464 +0200
+@@ -100,6 +100,12 @@
+ ``f'', ``W'' or ``m'' are assumed to have a ``no-'' form unless this
+ property is used.
+
++@item Negative(@var{othername})
++The option will turn off another option @var{othername}, which is the
++the option name with the leading ``-'' removed. This chain action will
++propagate through the @code{Negative} property of the option to be
++turned off.
++
+ @item Joined
+ @itemx Separate
+ The option takes a mandatory argument. @code{Joined} indicates
--- gcc-4.1-4.1.1.orig/debian/patches/gpc-updates.dpatch
+++ gcc-4.1-4.1.1/debian/patches/gpc-updates.dpatch
@@ -0,0 +1,296 @@
+#! /bin/sh -e
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+--- gcc/p/predef.def~ 2006-02-14 08:14:19.000000000 +0100
++++ gcc/p/predef.def 2006-02-28 18:24:42.585086192 +0100
+@@ -33,6 +33,10 @@
+ The identifiers that are only attributes don't have separate
+ comments and are documented under `attribute'. */
+
++#if defined(noinline)
++#undef noinline
++#endif
++
+ PREDEF_ID (all, GNU_PASCAL) /* extension (`export foo = all') */
+ PREDEF_ID (export, E_O_PASCAL) /* module interface export */
+ PREDEF_ID (ignorable, GNU_PASCAL)
+--- gcc/tree.h.pp 2006-04-12 02:49:20.204667824 +0200
++++ gcc/tree.h 2006-04-12 02:49:23.218209696 +0200
+@@ -3781,6 +3781,7 @@
+ extern unsigned crc32_string (unsigned, const char *);
+ extern void clean_symbol_name (char *);
+ extern tree get_file_function_name_long (const char *);
++extern tree get_set_constructor_bytes (tree, unsigned char *, int);
+ extern tree get_callee_fndecl (tree);
+ extern void change_decl_assembler_name (tree, tree);
+ extern int type_num_arguments (tree);
+
+--- gcc/p/gpc.c.orig 2006-04-11 19:49:24.000000000 +0200
++++ gcc/p/gpc.c 2006-04-12 11:41:56.000000000 +0200
+@@ -629,6 +629,12 @@
+
+ static const char *if_exists_spec_function (int, const char **);
+ static const char *if_exists_else_spec_function (int, const char **);
++#ifdef GCC_4
++static const char *replace_outfile_spec_function (int, const char **);
++#endif
++#ifdef GCC_4_1
++static const char *version_compare_spec_function (int, const char **);
++#endif
+
+ /* The Specs Language
+
+@@ -1319,6 +1325,10 @@
+ {0, 0, 0}
+ };
+
++#ifdef GCC_4_1
++#include "regex.h"
++#endif
++
+ /* Number of elements in default_compilers, not counting the terminator. */
+
+ static const int n_default_compilers = ARRAY_SIZE (default_compilers) - 1;
+@@ -1932,6 +1942,12 @@
+ {
+ { "if-exists", if_exists_spec_function },
+ { "if-exists-else", if_exists_else_spec_function },
++#ifdef GCC_4
++ { "replace-outfile", replace_outfile_spec_function },
++#endif
++#ifdef GCC_4_1
++ { "version-compare", version_compare_spec_function },
++#endif
+ { 0, 0 }
+ };
+
+@@ -8422,6 +8438,149 @@
+ return argv[1];
+ }
+
++#ifdef GCC_4
++/* replace-outfile built-in spec function.
++
++ This looks for the first argument in the outfiles array's name and
++ replaces it with the second argument. */
++
++static const char *
++replace_outfile_spec_function (int argc, const char **argv)
++{
++ int i;
++ /* Must have exactly two arguments. */
++ if (argc != 2)
++ abort ();
++
++ for (i = 0; i < n_infiles; i++)
++ {
++ if (outfiles[i] && !strcmp (outfiles[i], argv[0]))
++ outfiles[i] = xstrdup (argv[1]);
++ }
++ return NULL;
++}
++#endif
++
++#ifdef GCC_4_1
++/* Given two version numbers, compares the two numbers.
++ A version number must match the regular expression
++ ([1-9][0-9]*|0)(\.([1-9][0-9]*|0))*
++*/
++static int
++compare_version_strings (const char *v1, const char *v2)
++{
++ int rresult;
++ regex_t r;
++
++ if (regcomp (&r, "^([1-9][0-9]*|0)(\\.([1-9][0-9]*|0))*$",
++ REG_EXTENDED | REG_NOSUB) != 0)
++ abort ();
++ rresult = regexec (&r, v1, 0, NULL, 0);
++ if (rresult == REG_NOMATCH)
++ fatal ("invalid version number `%s'", v1);
++ else if (rresult != 0)
++ abort ();
++ rresult = regexec (&r, v2, 0, NULL, 0);
++ if (rresult == REG_NOMATCH)
++ fatal ("invalid version number `%s'", v2);
++ else if (rresult != 0)
++ abort ();
++
++ return strverscmp (v1, v2);
++}
++
++
++/* version_compare built-in spec function.
++
++ This takes an argument of the following form:
++
++ []
++
++ and produces "result" if the comparison evaluates to true,
++ and nothing if it doesn't.
++
++ The supported values are:
++
++ >= true if switch is a later (or same) version than arg1
++ !> opposite of >=
++ < true if switch is an earlier version than arg1
++ !< opposite of <
++ >< true if switch is arg1 or later, and earlier than arg2
++ <> true if switch is earlier than arg1 or is arg2 or later
++
++ If the switch is not present, the condition is false unless
++ the first character of the is '!'.
++
++ For example,
++ %:version-compare(>= 10.3 mmacosx-version-min= -lmx)
++ adds -lmx if -mmacosx-version-min=10.3.9 was passed. */
++
++static const char *
++version_compare_spec_function (int argc, const char **argv)
++{
++ int comp1, comp2;
++ size_t switch_len;
++ const char *switch_value = NULL;
++ int nargs = 1, i;
++ bool result;
++
++ if (argc < 3)
++ fatal ("too few arguments to %%:version-compare");
++ if (argv[0][0] == '\0')
++ abort ();
++ if ((argv[0][1] == '<' || argv[0][1] == '>') && argv[0][0] != '!')
++ nargs = 2;
++ if (argc != nargs + 3)
++ fatal ("too many arguments to %%:version-compare");
++
++ switch_len = strlen (argv[nargs + 1]);
++ for (i = 0; i < n_switches; i++)
++ if (!strncmp (switches[i].part1, argv[nargs + 1], switch_len)
++ && check_live_switch (i, switch_len))
++ switch_value = switches[i].part1 + switch_len;
++
++ if (switch_value == NULL)
++ comp1 = comp2 = -1;
++ else
++ {
++ comp1 = compare_version_strings (switch_value, argv[1]);
++ if (nargs == 2)
++ comp2 = compare_version_strings (switch_value, argv[2]);
++ else
++ comp2 = -1; /* This value unused. */
++ }
++
++ switch (argv[0][0] << 8 | argv[0][1])
++ {
++ case '>' << 8 | '=':
++ result = comp1 >= 0;
++ break;
++ case '!' << 8 | '<':
++ result = comp1 >= 0 || switch_value == NULL;
++ break;
++ case '<' << 8:
++ result = comp1 < 0;
++ break;
++ case '!' << 8 | '>':
++ result = comp1 < 0 || switch_value == NULL;
++ break;
++ case '>' << 8 | '<':
++ result = comp1 >= 0 && comp2 < 0;
++ break;
++ case '<' << 8 | '>':
++ result = comp1 < 0 || comp2 >= 0;
++ break;
++
++ default:
++ fatal ("unknown operator '%s' in %%:version-compare", argv[0]);
++ }
++ if (! result)
++ return NULL;
++
++ return argv[nargs + 2];
++}
++#endif
++
+ /* GPC specific code */
+
+ /* Delete the automake temp file (if present) and exit(). */
+--- gcc/p/rts/gpc.pas~ 2006-03-06 16:31:29.000000000 +0100
++++ gcc/p/rts/gpc.pas 2006-06-05 13:40:32.116418992 +0200
+@@ -60,7 +60,7 @@
+ General Public License. }
+
+ {$gnu-pascal,I-}
+-{$if __GPC_RELEASE__ <> 20060215}
++{$if __GPC_RELEASE__ <> 20060325}
+ {$error
+ Trying to compile gpc.pas with a non-matching GPC version is likely
+ to cause problems.
+--- gcc/p/Make-lang.in.orig 2006-06-06 18:30:43.093386000 +0000
++++ gcc/p/Make-lang.in 2006-06-06 18:35:58.723386000 +0000
+@@ -559,8 +559,9 @@
+ $(srcdir)/p/script/extract-doc-demos -o p/docdemos $(srcdir)/p/doc/*.texi $(srcdir)/p/doc/generated/*.texi $(srcdir)/p/doc/en/*.texi
+ $(STAMP) "$@"
+
+-p/gpc.o: $(srcdir)/p/gpc.c $(CONFIG_H) multilib.h Makefile \
+- $(lang_specs_files) $(srcdir)/p/p-version.h specs.h
++p/gpc.o: $(srcdir)/p/gpc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) intl.h multilib.h \
++ Makefile $(lang_specs_files) specs.h prefix.h $(GCC_H) $(FLAGS_H) \
++ configargs.h $(OBSTACK_H) opts.h $(srcdir)/p/p-version.h specs.h
+ $(CC) -DGPC $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(GPC_ALL_WARNINGS) $(INCLUDES) \
+ $(DRIVER_DEFINES) -c `echo $(srcdir)/p/gpc.c | sed 's,^\./,,'` -o $@
+
+@@ -584,17 +585,17 @@
+ help2man -N "$<" | sed -e s/@version@/$(gpc_version)/ > "$@" || { rm -f "$@"; false; }
+
+ # Headers and flags for GPC specific files.
+-GPC_GBE_H=$(CONFIG_H) system.h tree.h input.h rtl.h flags.h output.h expr.h \
+- except.h function.h convert.h toplev.h $(GPC_GCC_VERSION_H)
++GPC_GBE_H=$(CONFIG_H) $(SYSTEM_H) $(TM_H) $(TREE_H) $(FLAGS_H) $(RTL_H) $(FLAGS_H) \
++ output.h $(EXPR_H) except.h convert.h toplev.h $(GPC_GCC_VERSION_H)
+ P_H=$(GPC_GBE_H) p/gpc.h p/plant.h p/p-tree.def p/predef.def \
+ $(srcdir)/p/parse.h p/gbe.h
+ ALL_GPC_FLAGS=$(ALL_CFLAGS) $(ALL_CPPFLAGS) $(GPC_ALL_WARNINGS) $(INCLUDES) \
+ -DGPC -DGPC_UNITS_DIR=\"$(unitsubdir)\" -I$(srcdir)/p
+
+ # Headers and flags for patched backend files.
+-GPC_BE_H=$(GPC_GBE_H) defaults.h machmode.h machmode.def real.h recog.h \
+- regs.h reload.h typeclass.h xcoffout.h \
+- insn-attr.h insn-codes.h insn-config.h insn-flags.h
++GPC_BE_H=$(GPC_GBE_H) defaults.h $(MACHMODE_H) real.h $(RECOG_H) \
++ $(REGS_H) reload.h typeclass.h xcoffout.h \
++ $(INSN_ATTR_H) insn-codes.h insn-config.h insn-flags.h
+ ALL_GPC_GBE_FLAGS=$(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -DGPC
+
+ p/gpcpp.o: p/gpcpp.c p/p-version.h p/gpc-options.h p/lang-options.h \
+@@ -723,7 +724,10 @@
+ p/stor-layout.o: stor-layout.c $(GPC_BE_H)
+ $(CC) -o $@ -c $(ALL_GPC_GBE_FLAGS) $<
+
+-p/toplev.o: toplev.c $(GPC_BE_H) p/lang-options.h
++p/toplev.o: toplev.c $(GPC_BE_H) p/lang-options.h $(COVERAGE_H) \
++ $(DIAGNOSTIC_H) $(BASIC_BLOCK_H) $(TIMEVAR_H) $(PARAMS_H) $(TM_P_H) \
++ $(TARGET_H) $(CFGLAYOUT_H) $(CFGLOOP_H) $(CGRAPH_H) $(GGC_H) \
++ $(INTEGRATE_H) $(CPPLIB_H) opts.h params.def
+ $(CC) -o $@ -c $(ALL_GPC_GBE_FLAGS) $(MAYBE_TARGET_DEFAULT) \
+ $(MAYBE_USE_COLLECT2) -DTARGET_NAME=\"$(target_alias)\" $<
+
--- gcc-4.1-4.1.1.orig/debian/patches/ld-lib-path.dpatch
+++ gcc-4.1-4.1.1/debian/patches/ld-lib-path.dpatch
@@ -0,0 +1,41 @@
+#! /bin/sh -e
+
+# DP: Add /gcc/ada/rts to the runtime gcc library path.
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ cd ${dir} && autoconf
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ cd ${dir} && autoconf
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+--- configure.in~ 2004-11-13 20:06:43.000000000 +0100
++++ configure.in 2004-11-14 09:24:02.000000000 +0100
+@@ -2344,9 +2344,9 @@
+ *)
+ eval "d=\$$RPATH_ENVVAR"
+ if test x"$d" != x; then
+- d="$pwd/gcc:$d"
++ d="$pwd/gcc:$pwd/gcc/ada/rts:$d"
+ else
+- d="$pwd/gcc"
++ d="$pwd/gcc:$pwd/gcc/ada/rts"
+ fi
+ SET_GCC_LIB_PATH="\$(RPATH_ENVVAR)=$d; export \$(RPATH_ENVVAR);"
+ ;;
--- gcc-4.1-4.1.1.orig/debian/patches/gcc-version.dpatch
+++ gcc-4.1-4.1.1/debian/patches/gcc-version.dpatch
@@ -0,0 +1,35 @@
+#! /bin/sh -e
+
+# DP: Add package identification to the gcc version string
+
+pkgversion=
+if [ -n "$DEB_VERSION" ]; then
+ pkgversion=" $DEB_VERSION"
+fi
+
+dist=Debian
+dist=$(lsb_release -is)
+
+dir=gcc
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ dir=$3/gcc
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ sed -e "/#define VERSUFFIX/s/\".*/\" ($dist$pkgversion)\"/" \
+ $dir/version.c > $dir/version.c.new \
+ && mv -f $dir/version.c.new $dir/version.c
+ ;;
+ -unpatch)
+ sed -e '/#define VERSUFFIX/s/".*/""/' \
+ $dir/version.c > $dir/version.c.new \
+ && mv -f $dir/version.c.new $dir/version.c
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
--- gcc-4.1-4.1.1.orig/debian/patches/gcc-ice-hack.dpatch
+++ gcc-4.1-4.1.1/debian/patches/gcc-ice-hack.dpatch
@@ -0,0 +1,341 @@
+#! /bin/sh -e
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ #cd ${dir}gcc && autoconf
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ #rm ${dir}gcc/configure
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+# DP: 2004-01-23 Jakub Jelinek
+# DP:
+# DP: * system.h (ICE_EXIT_CODE): Define.
+# DP: * gcc.c (execute): Don't free first string early, but at the end
+# DP: of the function. Call retry_ice if compiler exited with
+# DP: ICE_EXIT_CODE.
+# DP: (retry_ice): New function.
+# DP: * diagnostic.c (diagnostic_count_diagnostic,
+# DP: diagnostic_action_after_output, error_recursion): Exit with
+# DP: ICE_EXIT_CODE instead of FATAL_EXIT_CODE.
+
+--- gcc/diagnostic.c.orig 2006-02-19 01:21:52.378523968 +0100
++++ gcc/diagnostic.c 2006-02-19 01:24:48.939682592 +0100
+@@ -257,14 +257,14 @@
+ "See %s for instructions.\n", bug_report_url);
+ fnotice (stderr, "For Debian GNU/Linux specific bug reporting instructions,\n"
+ "see %s.\n", debian_bug_report_url);
+- exit (FATAL_EXIT_CODE);
++ exit (ICE_EXIT_CODE);
+
+ case DK_FATAL:
+ if (context->abort_on_error)
+ real_abort ();
+
+ fnotice (stderr, "compilation terminated.\n");
+- exit (FATAL_EXIT_CODE);
++ exit (ICE_EXIT_CODE);
+
+ default:
+ gcc_unreachable ();
+--- gcc/gcc.c.orig 2006-02-19 01:21:52.377524120 +0100
++++ gcc/gcc.c 2006-02-19 01:22:35.519965472 +0100
+@@ -346,6 +346,9 @@
+ #if defined(HAVE_TARGET_OBJECT_SUFFIX) || defined(HAVE_TARGET_EXECUTABLE_SUFFIX)
+ static const char *convert_filename (const char *, int, int);
+ #endif
++#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS))
++static void retry_ice (const char *prog, const char **argv);
++#endif
+
+ static const char *if_exists_spec_function (int, const char **);
+ static const char *if_exists_else_spec_function (int, const char **);
+@@ -2830,7 +2833,7 @@
+ }
+ }
+
+- if (string != commands[i].prog)
++ if (i && string != commands[i].prog)
+ free ((void *) string);
+ }
+
+@@ -2888,6 +2891,16 @@
+ else if (WIFEXITED (status)
+ && WEXITSTATUS (status) >= MIN_FATAL_STATUS)
+ {
++#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS))
++ /* For ICEs in cc1, cc1obj, cc1plus see if it is
++ reproducible or not. */
++ char *p;
++ if (WEXITSTATUS (status) == ICE_EXIT_CODE
++ && i == 0
++ && (p = strrchr (commands[0].argv[0], DIR_SEPARATOR))
++ && ! strncmp (p + 1, "cc1", 3))
++ retry_ice (commands[0].prog, commands[0].argv);
++#endif
+ if (WEXITSTATUS (status) > greatest_status)
+ greatest_status = WEXITSTATUS (status);
+ ret_code = -1;
+@@ -2908,6 +2921,9 @@
+ }
+ }
+
++ if (commands[0].argv[0] != commands[0].prog)
++ free ((PTR) commands[0].argv[0]);
++
+ return ret_code;
+ }
+ }
+@@ -5889,6 +5905,224 @@
+ switches[switchnum].validated = 1;
+ }
+
++#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS))
++#define RETRY_ICE_ATTEMPTS 2
++
++static void
++retry_ice (const char *prog, const char **argv)
++{
++ int nargs, out_arg = -1, quiet = 0, attempt;
++ int pid, retries, sleep_interval;
++ const char **new_argv;
++ char *temp_filenames[RETRY_ICE_ATTEMPTS * 2 + 2];
++
++ if (input_filename == NULL || ! strcmp (input_filename, "-"))
++ return;
++
++ for (nargs = 0; argv[nargs] != NULL; ++nargs)
++ /* Only retry compiler ICEs, not preprocessor ones. */
++ if (! strcmp (argv[nargs], "-E"))
++ return;
++ else if (argv[nargs][0] == '-' && argv[nargs][1] == 'o')
++ {
++ if (out_arg == -1)
++ out_arg = nargs;
++ else
++ return;
++ }
++ /* If the compiler is going to output any time information,
++ it might vary between invocations. */
++ else if (! strcmp (argv[nargs], "-quiet"))
++ quiet = 1;
++ else if (! strcmp (argv[nargs], "-ftime-report"))
++ return;
++
++ if (out_arg == -1 || !quiet)
++ return;
++
++ memset (temp_filenames, '\0', sizeof (temp_filenames));
++ new_argv = alloca ((nargs + 3) * sizeof (const char *));
++ memcpy (new_argv, argv, (nargs + 1) * sizeof (const char *));
++ new_argv[nargs++] = "-frandom-seed=0";
++ new_argv[nargs] = NULL;
++ if (new_argv[out_arg][2] == '\0')
++ new_argv[out_arg + 1] = "-";
++ else
++ new_argv[out_arg] = "-o-";
++
++ for (attempt = 0; attempt < RETRY_ICE_ATTEMPTS + 1; ++attempt)
++ {
++ int fd = -1;
++ int status;
++
++ temp_filenames[attempt * 2] = make_temp_file (".out");
++ temp_filenames[attempt * 2 + 1] = make_temp_file (".err");
++
++ if (attempt == RETRY_ICE_ATTEMPTS)
++ {
++ int i;
++ int fd1, fd2;
++ struct stat st1, st2;
++ size_t n, len;
++ char *buf;
++
++ buf = xmalloc (8192);
++
++ for (i = 0; i < 2; ++i)
++ {
++ fd1 = open (temp_filenames[i], O_RDONLY);
++ fd2 = open (temp_filenames[2 + i], O_RDONLY);
++
++ if (fd1 < 0 || fd2 < 0)
++ {
++ i = -1;
++ close (fd1);
++ close (fd2);
++ break;
++ }
++
++ if (fstat (fd1, &st1) < 0 || fstat (fd2, &st2) < 0)
++ {
++ i = -1;
++ close (fd1);
++ close (fd2);
++ break;
++ }
++
++ if (st1.st_size != st2.st_size)
++ {
++ close (fd1);
++ close (fd2);
++ break;
++ }
++
++ len = 0;
++ for (n = st1.st_size; n; n -= len)
++ {
++ len = n;
++ if (len > 4096)
++ len = 4096;
++
++ if (read (fd1, buf, len) != (int) len
++ || read (fd2, buf + 4096, len) != (int) len)
++ {
++ i = -1;
++ break;
++ }
++
++ if (memcmp (buf, buf + 4096, len) != 0)
++ break;
++ }
++
++ close (fd1);
++ close (fd2);
++
++ if (n)
++ break;
++ }
++
++ free (buf);
++ if (i == -1)
++ break;
++
++ if (i != 2)
++ {
++ notice ("The bug is not reproducible, so it is likely a hardware or OS problem.\n");
++ break;
++ }
++
++ fd = open (temp_filenames[attempt * 2], O_RDWR);
++ if (fd < 0)
++ break;
++ write (fd, "//", 2);
++ for (i = 0; i < nargs; i++)
++ {
++ write (fd, " ", 1);
++ write (fd, new_argv[i], strlen (new_argv[i]));
++ }
++ write (fd, "\n", 1);
++ new_argv[nargs] = "-E";
++ new_argv[nargs + 1] = NULL;
++ }
++
++ /* Fork a subprocess; wait and retry if it fails. */
++ sleep_interval = 1;
++ pid = -1;
++ for (retries = 0; retries < 4; retries++)
++ {
++ pid = fork ();
++ if (pid >= 0)
++ break;
++ sleep (sleep_interval);
++ sleep_interval *= 2;
++ }
++
++ if (pid < 0)
++ break;
++ else if (pid == 0)
++ {
++ if (attempt != RETRY_ICE_ATTEMPTS)
++ fd = open (temp_filenames[attempt * 2], O_RDWR);
++ if (fd < 0)
++ exit (-1);
++ if (fd != 1)
++ {
++ close (1);
++ dup (fd);
++ close (fd);
++ }
++
++ fd = open (temp_filenames[attempt * 2 + 1], O_RDWR);
++ if (fd < 0)
++ exit (-1);
++ if (fd != 2)
++ {
++ close (2);
++ dup (fd);
++ close (fd);
++ }
++
++ if (prog == new_argv[0])
++ execvp (prog, (char *const *) new_argv);
++ else
++ execv (new_argv[0], (char *const *) new_argv);
++ exit (-1);
++ }
++
++ if (waitpid (pid, &status, 0) < 0)
++ break;
++
++ if (attempt < RETRY_ICE_ATTEMPTS
++ && (! WIFEXITED (status) || WEXITSTATUS (status) != ICE_EXIT_CODE))
++ {
++ notice ("The bug is not reproducible, so it is likely a hardware or OS problem.\n");
++ break;
++ }
++ else if (attempt == RETRY_ICE_ATTEMPTS)
++ {
++ close (fd);
++ if (WIFEXITED (status)
++ && WEXITSTATUS (status) == SUCCESS_EXIT_CODE)
++ {
++ notice ("Preprocessed source stored into %s file, please attach this to your bugreport.\n",
++ temp_filenames[attempt * 2]);
++ /* Make sure it is not deleted. */
++ free (temp_filenames[attempt * 2]);
++ temp_filenames[attempt * 2] = NULL;
++ break;
++ }
++ }
++ }
++
++ for (attempt = 0; attempt < RETRY_ICE_ATTEMPTS * 2 + 2; attempt++)
++ if (temp_filenames[attempt])
++ {
++ unlink (temp_filenames[attempt]);
++ free (temp_filenames[attempt]);
++ }
++}
++#endif
++
+ /* Search for a file named NAME trying various prefixes including the
+ user's -B prefix and some standard ones.
+ Return the absolute file name found. If nothing is found, return NAME. */
+--- gcc/system.h.orig 2006-02-19 01:21:52.370525184 +0100
++++ gcc/system.h 2006-02-19 01:22:35.513966384 +0100
+@@ -227,6 +227,10 @@
+ # endif
+ #endif
+
++#ifndef ICE_EXIT_CODE
++# define ICE_EXIT_CODE 27
++#endif
++
+ #ifdef HAVE_UNISTD_H
+ # include
+ #endif
--- gcc-4.1-4.1.1.orig/debian/patches/sparc64-build.dpatch
+++ gcc-4.1-4.1.1/debian/patches/sparc64-build.dpatch
@@ -0,0 +1,58 @@
+#! /bin/sh -e
+# sparc64-build.dpatch by
+#
+# DP: Allows sparc64 to build more simply
+
+if [ $# -eq 3 ] && [ "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch -f --no-backup-if-mismatch -p0 < $0;;
+ -unpatch)
+ patch -f --no-backup-if-mismatch -R -p0 < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1;;
+esac
+
+exit 0
+
+diff -urNad gcc/config/sparc/linux64.h sparc64-build.gcc-3.3/src/gcc/config/sparc/linux64.h
+--- gcc/config/sparc/linux64.h 2003-03-13 08:40:33.000000000 +0000
++++ gcc/config/sparc/linux64.h 2003-03-13 08:46:18.000000000 +0000
+@@ -37,8 +37,8 @@
+ + MASK_STACK_BIAS + MASK_APP_REGS + MASK_FPU + MASK_LONG_DOUBLE_128)
+ #endif
+
+-#undef ASM_CPU_DEFAULT_SPEC
+-#define ASM_CPU_DEFAULT_SPEC "-Av9a"
++#undef ASM_CPU64_DEFAULT_SPEC
++#define ASM_CPU64_DEFAULT_SPEC "-Av9a"
+
+ #ifdef SPARC_BI_ARCH
+
+--- gcc/config.gcc 2004-06-29 01:44:04.000000000 -0400
++++ gcc/config.gcc 2004-07-05 10:46:52.813558531 -0400
+@@ -1828,8 +1828,17 @@
+ use_fixproto=yes
+ ;;
+ sparc-*-linux*) # SPARC's running GNU/Linux, libc6
++ # If cpu is specified, assume we want a 32/64 compiler
++ if test x$with_cpu = x; then
+ tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/linux.h"
+ tmake_file="${tmake_file} sparc/t-crtfm"
++ else
++ tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/linux64.h"
++ tmake_file="${tmake_file} sparc/t-linux64 sparc/t-crtfm"
++ float_format=sparc
++ fi
++# tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/linux.h"
++# tmake_file="${tmake_file} sparc/t-crtfm"
+ ;;
+ sparc-*-rtems*)
+ tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sol2.h sparc/sol2.h sparc/elf.h sparc/rtemself.h rtems.h"
--- gcc-4.1-4.1.1.orig/debian/patches/arm-libffi.dpatch
+++ gcc-4.1-4.1.1/debian/patches/arm-libffi.dpatch
@@ -0,0 +1,218 @@
+#! /bin/sh -e
+
+# DP: Add closure support to libffi for arm
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p1 < $0
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p1 < $0
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+diff -uprN src/libffi/src/arm.old/ffi.c src/libffi/src/arm/ffi.c
+--- src/libffi/src/arm.old/ffi.c 2004-10-27 16:10:21.000000000 +0100
++++ src/libffi/src/arm/ffi.c 2005-12-31 16:07:04.787839432 +0000
+@@ -183,3 +183,121 @@ void ffi_call(/*@dependent@*/ ffi_cif *c
+ break;
+ }
+ }
++
++/** private members **/
++
++static void ffi_prep_incoming_args_SYSV (char *stack, void **ret,
++ void** args, ffi_cif* cif);
++
++void ffi_closure_SYSV (ffi_closure *);
++
++/* This function is jumped to by the trampoline */
++
++unsigned int
++ffi_closure_SYSV_inner (closure, respp, args)
++ ffi_closure *closure;
++ void **respp;
++ void *args;
++{
++ // our various things...
++ ffi_cif *cif;
++ void **arg_area;
++
++ cif = closure->cif;
++ arg_area = (void**) alloca (cif->nargs * sizeof (void*));
++
++ /* this call will initialize ARG_AREA, such that each
++ * element in that array points to the corresponding
++ * value on the stack; and if the function returns
++ * a structure, it will re-set RESP to point to the
++ * structure return address. */
++
++ ffi_prep_incoming_args_SYSV(args, respp, arg_area, cif);
++
++ (closure->fun) (cif, *respp, arg_area, closure->user_data);
++
++ return cif->flags;
++}
++
++/*@-exportheader@*/
++static void
++ffi_prep_incoming_args_SYSV(char *stack, void **rvalue,
++ void **avalue, ffi_cif *cif)
++/*@=exportheader@*/
++{
++ register unsigned int i;
++ register void **p_argv;
++ register char *argp;
++ register ffi_type **p_arg;
++
++ argp = stack;
++
++ if ( cif->flags == FFI_TYPE_STRUCT ) {
++ *rvalue = *(void **) argp;
++ argp += 4;
++ }
++
++ p_argv = avalue;
++
++ for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++)
++ {
++ size_t z;
++
++ /* Align if necessary */
++ if ((sizeof(int) - 1) & (unsigned) argp) {
++ argp = (char *) ALIGN(argp, sizeof(int));
++ }
++
++ z = (*p_arg)->size;
++
++ /* because we're little endian, this is what it turns into. */
++
++ *p_argv = (void*) argp;
++
++ p_argv++;
++ argp += z;
++ }
++
++ return;
++}
++
++/* How to make a trampoline. */
++
++#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \
++({ unsigned char *__tramp = (unsigned char*)(TRAMP); \
++ unsigned int __fun = (unsigned int)(FUN); \
++ unsigned int __ctx = (unsigned int)(CTX); \
++ *(unsigned int*) &__tramp[0] = 0xe92d000f; /* stmfd sp!, {r0-r3} */ \
++ *(unsigned int*) &__tramp[4] = 0xe59f0000; /* ldr r0, [pc] */ \
++ *(unsigned int*) &__tramp[8] = 0xe59ff000; /* ldr pc, [pc] */ \
++ *(unsigned int*) &__tramp[12] = __ctx; \
++ *(unsigned int*) &__tramp[16] = __fun; \
++ register unsigned long _beg __asm ("a1") = (unsigned long) (&__tramp[0]); \
++ register unsigned long _end __asm ("a2") = (unsigned long) (&__tramp[19]); \
++ register unsigned long _flg __asm ("a3") = 0; \
++ __asm __volatile ("swi 0x9f0002 @ sys_cacheflush" \
++ : "=r" (_beg) \
++ : "0" (_beg), "r" (_end), "r" (_flg)); \
++ })
++
++
++/* the cif must already be prep'ed */
++
++ffi_status
++ffi_prep_closure (ffi_closure* closure,
++ ffi_cif* cif,
++ void (*fun)(ffi_cif*,void*,void**,void*),
++ void *user_data)
++{
++ FFI_ASSERT (cif->abi == FFI_SYSV);
++
++ FFI_INIT_TRAMPOLINE (&closure->tramp[0], \
++ &ffi_closure_SYSV, \
++ (void*)closure);
++
++ closure->cif = cif;
++ closure->user_data = user_data;
++ closure->fun = fun;
++
++ return FFI_OK;
++}
+diff -uprN src/libffi/src/arm.old/ffitarget.h src/libffi/src/arm/ffitarget.h
+--- src/libffi/src/arm.old/ffitarget.h 2003-10-21 20:07:50.000000000 +0100
++++ src/libffi/src/arm/ffitarget.h 2005-12-31 16:07:04.309912088 +0000
+@@ -40,7 +40,8 @@ typedef enum ffi_abi {
+
+ /* ---- Definitions for closures ----------------------------------------- */
+
+-#define FFI_CLOSURES 0
++#define FFI_CLOSURES 1
++#define FFI_TRAMPOLINE_SIZE 20
+ #define FFI_NATIVE_RAW_API 0
+
+ #endif
+diff -uprN src/libffi/src/arm.old/sysv.S src/libffi/src/arm/sysv.S
+--- src/libffi/src/arm.old/sysv.S 2004-10-27 16:10:22.000000000 +0100
++++ src/libffi/src/arm/sysv.S 2005-12-31 16:07:05.146784864 +0000
+@@ -207,3 +207,51 @@ LSYM(Lepilogue):
+ .ffi_call_SYSV_end:
+ .size CNAME(ffi_call_SYSV),.ffi_call_SYSV_end-CNAME(ffi_call_SYSV)
+
++/*
++ unsigned int FFI_HIDDEN
++ ffi_closure_SYSV_inner (closure, respp, args)
++ ffi_closure *closure;
++ void **respp;
++ void *args;
++*/
++
++ARM_FUNC_START ffi_closure_SYSV
++ add ip, sp, #16
++ stmfd sp!, {ip, lr}
++ add r2, sp, #8
++ sub sp, sp, #16
++ str sp, [sp, #8]
++ add r1, sp, #8
++ bl ffi_closure_SYSV_inner
++ cmp r0, #FFI_TYPE_INT
++ beq .Lretint
++ cmp r0, #FFI_TYPE_FLOAT
++ beq .Lretfloat
++ cmp r0, #FFI_TYPE_DOUBLE
++ beq .Lretdouble
++ cmp r0, #FFI_TYPE_LONGDOUBLE
++ beq .Lretlongdouble
++ cmp r0, #FFI_TYPE_SINT64
++ beq .Lretlonglong
++.Lclosure_epilogue:
++ add sp, sp, #16
++ ldmfd sp, {sp, pc}
++.Lretint:
++ ldr r0, [sp]
++ b .Lclosure_epilogue
++.Lretlonglong:
++ ldr r0, [sp]
++ ldr r1, [sp, #4]
++ b .Lclosure_epilogue
++.Lretfloat:
++ ldfs f0, [sp]
++ b .Lclosure_epilogue
++.Lretdouble:
++ ldfd f0, [sp]
++ b .Lclosure_epilogue
++.Lretlongdouble:
++ ldfd f0, [sp]
++ b .Lclosure_epilogue
++.ffi_closure_SYSV_end:
++ .size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV)
++
--- gcc-4.1-4.1.1.orig/debian/patches/m68k-fjump.dpatch
+++ gcc-4.1-4.1.1/debian/patches/m68k-fjump.dpatch
@@ -0,0 +1,320 @@
+#! /bin/sh -e
+
+# All lines beginning with `# DPATCH:' are a description of the patch.
+# DP: gcc/config/m68k/m68k.md:
+# DP: always use as fjcc pseudo op, we rely heavily on as
+# DP: to generate the right size for the jump instructions
+# DP: fixes #359281
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p1 < $0
+ #cd ${dir}gcc && autoconf
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p1 < $0
+ #rm ${dir}gcc/configure
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+# append the patch here and adjust the -p? flag in the patch calls.
+
+---
+ gcc/config/m68k/m68k.md | 90 ++++++++++++++----------------------------------
+ 1 file changed, 27 insertions(+), 63 deletions(-)
+
+Index: gcc-4.1/gcc/config/m68k/m68k.md
+===================================================================
+--- gcc-4.1.orig/gcc/config/m68k/m68k.md
++++ gcc-4.1/gcc/config/m68k/m68k.md
+@@ -5562,10 +5562,7 @@
+ (pc)))]
+ ""
+ {
+- if (MOTOROLA)
+- OUTPUT_JUMP ("jbeq %l0", "fbeq %l0", "jbeq %l0");
+- else
+- OUTPUT_JUMP ("jeq %l0", "fjeq %l0", "jeq %l0");
++ OUTPUT_JUMP ("jeq %l0", "fjeq %l0", "jeq %l0");
+ })
+
+ (define_insn "bne"
+@@ -5576,10 +5573,7 @@
+ (pc)))]
+ ""
+ {
+- if (MOTOROLA)
+- OUTPUT_JUMP ("jbne %l0", "fbne %l0", "jbne %l0");
+- else
+- OUTPUT_JUMP ("jne %l0", "fjne %l0", "jne %l0");
++ OUTPUT_JUMP ("jne %l0", "fjne %l0", "jne %l0");
+ })
+
+ (define_insn "bgt"
+@@ -5590,10 +5584,7 @@
+ (pc)))]
+ ""
+ {
+- if (MOTOROLA)
+- OUTPUT_JUMP ("jbgt %l0", "fbgt %l0", 0);
+- else
+- OUTPUT_JUMP ("jgt %l0", "fjgt %l0", 0);
++ OUTPUT_JUMP ("jgt %l0", "fjgt %l0", 0);
+ })
+
+ (define_insn "bgtu"
+@@ -5615,10 +5606,7 @@
+ (pc)))]
+ ""
+ {
+- if (MOTOROLA)
+- OUTPUT_JUMP ("jblt %l0", "fblt %l0", "jbmi %l0");
+- else
+- OUTPUT_JUMP ("jlt %l0", "fjlt %l0", "jmi %l0");
++ OUTPUT_JUMP ("jlt %l0", "fjlt %l0", "jmi %l0");
+ })
+
+ (define_insn "bltu"
+@@ -5640,10 +5628,7 @@
+ (pc)))]
+ ""
+ {
+- if (MOTOROLA)
+- OUTPUT_JUMP ("jbge %l0", "fbge %l0", "jbpl %l0");
+- else
+- OUTPUT_JUMP ("jge %l0", "fjge %l0", "jpl %l0");
++ OUTPUT_JUMP ("jge %l0", "fjge %l0", "jpl %l0");
+ })
+
+ (define_insn "bgeu"
+@@ -5665,10 +5650,7 @@
+ (pc)))]
+ ""
+ {
+- if (MOTOROLA)
+- OUTPUT_JUMP ("jble %l0", "fble %l0", 0);
+- else
+- OUTPUT_JUMP ("jle %l0", "fjle %l0", 0);
++ OUTPUT_JUMP ("jle %l0", "fjle %l0", 0);
+ })
+
+ (define_insn "bleu"
+@@ -5690,7 +5672,7 @@
+ "TARGET_68881"
+ {
+ gcc_assert (cc_prev_status.flags & CC_IN_68881);
+- return MOTOROLA ? "fbor %l0" : "fjor %l0";
++ return "fjor %l0";
+ })
+
+ (define_insn "bunordered"
+@@ -5701,7 +5683,7 @@
+ "TARGET_68881"
+ {
+ gcc_assert (cc_prev_status.flags & CC_IN_68881);
+- return MOTOROLA ? "fbun %l0" : "fjun %l0";
++ return "fjun %l0";
+ })
+
+ (define_insn "buneq"
+@@ -5712,7 +5694,7 @@
+ "TARGET_68881"
+ {
+ gcc_assert (cc_prev_status.flags & CC_IN_68881);
+- return MOTOROLA ? "fbueq %l0" : "fjueq %l0";
++ return "fjueq %l0";
+ })
+
+ (define_insn "bunge"
+@@ -5723,7 +5705,7 @@
+ "TARGET_68881"
+ {
+ gcc_assert (cc_prev_status.flags & CC_IN_68881);
+- return MOTOROLA ? "fbuge %l0" : "fjuge %l0";
++ return "fjuge %l0";
+ })
+
+ (define_insn "bungt"
+@@ -5734,7 +5716,7 @@
+ "TARGET_68881"
+ {
+ gcc_assert (cc_prev_status.flags & CC_IN_68881);
+- return MOTOROLA ? "fbugt %l0" : "fjugt %l0";
++ return "fjugt %l0";
+ })
+
+ (define_insn "bunle"
+@@ -5745,7 +5727,7 @@
+ "TARGET_68881"
+ {
+ gcc_assert (cc_prev_status.flags & CC_IN_68881);
+- return MOTOROLA ? "fbule %l0" : "fjule %l0";
++ return "fjule %l0";
+ })
+
+ (define_insn "bunlt"
+@@ -5756,7 +5738,7 @@
+ "TARGET_68881"
+ {
+ gcc_assert (cc_prev_status.flags & CC_IN_68881);
+- return MOTOROLA ? "fbult %l0" : "fjult %l0";
++ return "fjult %l0";
+ })
+
+ (define_insn "bltgt"
+@@ -5767,7 +5749,7 @@
+ "TARGET_68881"
+ {
+ gcc_assert (cc_prev_status.flags & CC_IN_68881);
+- return MOTOROLA ? "fbogl %l0" : "fjogl %l0";
++ return "fjogl %l0";
+ })
+
+ ;; Negated conditional jump instructions.
+@@ -5780,10 +5762,7 @@
+ (label_ref (match_operand 0 "" ""))))]
+ ""
+ {
+- if (MOTOROLA)
+- OUTPUT_JUMP ("jbne %l0", "fbne %l0", "jbne %l0");
+- else
+- OUTPUT_JUMP ("jne %l0", "fjne %l0", "jne %l0");
++ OUTPUT_JUMP ("jne %l0", "fjne %l0", "jne %l0");
+ })
+
+ (define_insn ""
+@@ -5794,10 +5773,7 @@
+ (label_ref (match_operand 0 "" ""))))]
+ ""
+ {
+- if (MOTOROLA)
+- OUTPUT_JUMP ("jbeq %l0", "fbeq %l0", "jbeq %l0");
+- else
+- OUTPUT_JUMP ("jeq %l0", "fjeq %l0", "jeq %l0");
++ OUTPUT_JUMP ("jeq %l0", "fjeq %l0", "jeq %l0");
+ })
+
+ (define_insn ""
+@@ -5808,10 +5784,7 @@
+ (label_ref (match_operand 0 "" ""))))]
+ ""
+ {
+- if (MOTOROLA)
+- OUTPUT_JUMP ("jble %l0", "fbngt %l0", 0);
+- else
+- OUTPUT_JUMP ("jle %l0", "fjngt %l0", 0);
++ OUTPUT_JUMP ("jle %l0", "fjngt %l0", 0);
+ })
+
+ (define_insn ""
+@@ -5833,10 +5806,7 @@
+ (label_ref (match_operand 0 "" ""))))]
+ ""
+ {
+- if (MOTOROLA)
+- OUTPUT_JUMP ("jbge %l0", "fbnlt %l0", "jbpl %l0");
+- else
+- OUTPUT_JUMP ("jge %l0", "fjnlt %l0", "jpl %l0");
++ OUTPUT_JUMP ("jge %l0", "fjnlt %l0", "jpl %l0");
+ })
+
+ (define_insn ""
+@@ -5858,10 +5828,7 @@
+ (label_ref (match_operand 0 "" ""))))]
+ ""
+ {
+- if (MOTOROLA)
+- OUTPUT_JUMP ("jblt %l0", "fbnge %l0", "jbmi %l0");
+- else
+- OUTPUT_JUMP ("jlt %l0", "fjnge %l0", "jmi %l0");
++ OUTPUT_JUMP ("jlt %l0", "fjnge %l0", "jmi %l0");
+ })
+
+ (define_insn ""
+@@ -5883,10 +5850,7 @@
+ (label_ref (match_operand 0 "" ""))))]
+ ""
+ {
+- if (MOTOROLA)
+- OUTPUT_JUMP ("jbgt %l0", "fbnle %l0", 0);
+- else
+- OUTPUT_JUMP ("jgt %l0", "fjnle %l0", 0);
++ OUTPUT_JUMP ("jgt %l0", "fjnle %l0", 0);
+ })
+
+ (define_insn ""
+@@ -5908,7 +5872,7 @@
+ "TARGET_68881"
+ {
+ gcc_assert (cc_prev_status.flags & CC_IN_68881);
+- return MOTOROLA ? "fbun %l0" : "fjun %l0";
++ return "fjun %l0";
+ })
+
+ (define_insn "*bunordered_rev"
+@@ -5919,7 +5883,7 @@
+ "TARGET_68881"
+ {
+ gcc_assert (cc_prev_status.flags & CC_IN_68881);
+- return MOTOROLA ? "fbor %l0" : "fjor %l0";
++ return "fjor %l0";
+ })
+
+ (define_insn "*buneq_rev"
+@@ -5930,7 +5894,7 @@
+ "TARGET_68881"
+ {
+ gcc_assert (cc_prev_status.flags & CC_IN_68881);
+- return MOTOROLA ? "fbogl %l0" : "fjogl %l0";
++ return "fjogl %l0";
+ })
+
+ (define_insn "*bunge_rev"
+@@ -5941,7 +5905,7 @@
+ "TARGET_68881"
+ {
+ gcc_assert (cc_prev_status.flags & CC_IN_68881);
+- return MOTOROLA ? "fbolt %l0" : "fjolt %l0";
++ return "fjolt %l0";
+ })
+
+ (define_insn "*bunle_rev"
+@@ -5952,7 +5916,7 @@
+ "TARGET_68881"
+ {
+ gcc_assert (cc_prev_status.flags & CC_IN_68881);
+- return MOTOROLA ? "fbogt %l0" : "fjogt %l0";
++ return "fjogt %l0";
+ })
+
+ (define_insn "*bunlt_rev"
+@@ -5963,7 +5927,7 @@
+ "TARGET_68881"
+ {
+ gcc_assert (cc_prev_status.flags & CC_IN_68881);
+- return MOTOROLA ? "fboge %l0" : "fjoge %l0";
++ return "fjoge %l0";
+ })
+
+ (define_insn "*bltgt_rev"
+@@ -5974,7 +5938,7 @@
+ "TARGET_68881"
+ {
+ gcc_assert (cc_prev_status.flags & CC_IN_68881);
+- return MOTOROLA ? "fbueq %l0" : "fjueq %l0";
++ return "fjueq %l0";
+ })
+
+ ;; Unconditional and other jump instructions
--- gcc-4.1-4.1.1.orig/debian/patches/pr26885.dpatch
+++ gcc-4.1-4.1.1/debian/patches/pr26885.dpatch
@@ -0,0 +1,754 @@
+#! /bin/sh -e
+
+# DP: Proposed patch for PR driver/26885
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ #cd ${dir}gcc && autoconf
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ #rm ${dir}gcc/configure
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+Date: Tue, 2 May 2006 13:23:54 -0700
+
+gcc/
+
+2006-04-22 H.J. Lu
+
+ PR driver/26885
+ * Makefile.in (GCC_OBJS): New.
+ (OBJS-common): Add opts-common.o.
+ (xgcc$(exeext)): Replace gcc.o with $(GCC_OBJS).
+ (cpp$(exeext)): Likewise.
+ (gcc.o): Also depend on opts.h.
+ (opts-common.o): New.
+
+ * common.opt (gcoff): Add Negative(gdwarf-2).
+ (gdwarf-2): Add Negative(gstabs).
+ (gstabs): Add Negative(gstabs+).
+ (gstabs+): Add Negative(gvms).
+ (gvms): Add Negative(gxcoff).
+ (gxcoff): Add Negative(gxcoff+).
+ (gxcoff+): Add Negative(gcoff).
+ * config/i386/i386.opt (m32): Add Negative(m64).
+ (m64): Add Negative(m32).
+
+ * doc/options.texi: Document the Negative option.
+
+ * gcc.c: Include "opts.h".
+ (main): Call prune_options after expandargv.
+
+ * optc-gen.awk: Generate common declarations for all flag
+ variables in options.c. Output the neg_index field.
+
+ * opts.c (find_opt): Moved to ...
+ * opts-common.c: Here. New file.
+
+ * opts.h (cl_option): Add a neg_index field.
+ (find_opt): New.
+ (prune_options): Likewise.
+
+gcc/cp/
+
+2006-04-22 H.J. Lu
+
+ PR driver/26885
+ * Make-lang.in (GXX_OBJS): Replace gcc.o with $(GCC_OBJS).
+
+gcc/fortran/
+
+2006-04-22 H.J. Lu
+
+ PR driver/26885
+ * Make-lang.in (GFORTRAN_D_OBJS): Replace gcc.o with
+ $(GCC_OBJS).
+
+gcc/java/
+
+2006-04-22 H.J. Lu
+
+ PR driver/26885
+ * Make-lang.in ($(GCJ)$(exeext)): Replace gcc.o with
+ $(GCC_OBJS).
+
+gcc/treelang/
+
+2006-04-22 H.J. Lu
+
+ PR driver/26885
+ * Make-lang.in (gtreelang$(exeext)): Replace gcc.o with
+ $(GCC_OBJS).
+
+#--- gcc/doc/options.texi.orig 2006-05-07 13:23:52.294265896 +0200
+#+++ gcc/doc/options.texi 2006-05-07 13:24:36.553537464 +0200
+#@@ -100,6 +100,12 @@
+# ``f'', ``W'' or ``m'' are assumed to have a ``no-'' form unless this
+# property is used.
+#
+#+@item Negative(@var{othername})
+#+The option will turn off another option @var{othername}, which is the
+#+the option name with the leading ``-'' removed. This chain action will
+#+propagate through the @code{Negative} property of the option to be
+#+turned off.
+#+
+# @item Joined
+# @itemx Separate
+# The option takes a mandatory argument. @code{Joined} indicates
+--- gcc/java/Make-lang.in.orig 2006-05-07 13:23:52.299265136 +0200
++++ gcc/java/Make-lang.in 2006-05-07 13:24:36.559536552 +0200
+@@ -67,10 +67,10 @@
+ $(INCLUDES) $(srcdir)/java/jvspec.c $(OUTPUT_OPTION))
+
+ # Create the compiler driver for $(GCJ).
+-$(GCJ)$(exeext): gcc.o jvspec.o version.o \
++$(GCJ)$(exeext): $(GCC_OBJS) jvspec.o version.o \
+ prefix.o intl.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
+- $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o jvspec.o prefix.o intl.o \
+- version.o $(EXTRA_GCC_OBJS) $(LIBS)
++ $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) jvspec.o \
++ prefix.o intl.o version.o $(EXTRA_GCC_OBJS) $(LIBS)
+
+ # Create a version of the $(GCJ) driver which calls the cross-compiler.
+ $(GCJ)-cross$(exeext): $(GCJ)$(exeext)
+--- gcc/cp/Make-lang.in.orig 2006-05-07 13:23:52.294265896 +0200
++++ gcc/cp/Make-lang.in 2006-05-07 13:24:36.552537616 +0200
+@@ -60,7 +60,7 @@
+ $(INCLUDES) $(srcdir)/cp/g++spec.c)
+
+ # Create the compiler driver for g++.
+-GXX_OBJS = gcc.o g++spec.o intl.o prefix.o version.o
++GXX_OBJS = $(GCC_OBJS) g++spec.o intl.o prefix.o version.o
+ g++$(exeext): $(GXX_OBJS) $(EXTRA_GCC_OBJS) $(LIBDEPS)
+ $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
+ $(GXX_OBJS) $(EXTRA_GCC_OBJS) $(LIBS)
+--- gcc/fortran/Make-lang.in.orig 2006-05-07 13:23:52.295265744 +0200
++++ gcc/fortran/Make-lang.in 2006-05-07 13:24:36.553537464 +0200
+@@ -92,7 +92,7 @@
+ $(INCLUDES) $(srcdir)/fortran/gfortranspec.c)
+
+ # Create the compiler driver gfortran.
+-GFORTRAN_D_OBJS = gcc.o gfortranspec.o version.o prefix.o intl.o
++GFORTRAN_D_OBJS = $(GCC_OBJS) gfortranspec.o version.o prefix.o intl.o
+ gfortran$(exeext): $(GFORTRAN_D_OBJS) $(EXTRA_GCC_OBJS) $(LIBDEPS)
+ $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
+ $(GFORTRAN_D_OBJS) $(EXTRA_GCC_OBJS) $(LIBS)
+--- gcc/treelang/Make-lang.in.orig 2006-05-07 13:23:52.401249632 +0200
++++ gcc/treelang/Make-lang.in 2006-05-07 13:24:36.563535944 +0200
+@@ -87,10 +87,10 @@
+ $(BACKEND) $(LIBS) attribs.o
+
+ # Create the compiler driver treelang.
+-gtreelang$(exeext): gcc.o version.o prefix.o intl.o $(EXTRA_GCC_OBJS) \
++gtreelang$(exeext): $(GCC_OBJS) version.o prefix.o intl.o $(EXTRA_GCC_OBJS) \
+ $(LIBDEPS) treelang/spec.o
+ $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ treelang/spec.o \
+- gcc.o version.o prefix.o intl.o $(EXTRA_GCC_OBJS) $(LIBS)
++ $(GCC_OBJS) version.o prefix.o intl.o $(EXTRA_GCC_OBJS) $(LIBS)
+
+
+
+--- gcc/config/i386/i386.opt.orig 2006-05-07 13:23:52.294265896 +0200
++++ gcc/config/i386/i386.opt 2006-05-07 13:24:36.552537616 +0200
+@@ -24,7 +24,7 @@
+ sizeof(long double) is 16
+
+ m32
+-Target RejectNegative Report InverseMask(64BIT)
++Target RejectNegative Negative(m64) Report InverseMask(64BIT)
+ Generate 32bit i386 code
+
+ m386
+@@ -40,7 +40,7 @@
+ ;; Deprecated
+
+ m64
+-Target RejectNegative Report Mask(64BIT)
++Target RejectNegative Negative(m32) Report Mask(64BIT)
+ Generate 64bit x86-64 code
+
+ m80387
+--- gcc/Makefile.in.orig 2006-05-07 13:23:52.292266200 +0200
++++ gcc/Makefile.in 2006-05-07 13:27:07.959520256 +0200
+@@ -931,6 +931,9 @@
+ # Target specific, C++ specific object file
+ CXX_TARGET_OBJS=@cxx_target_objs@
+
++# Object files for gcc driver.
++GCC_OBJS = gcc.o opts-common.o options.o
++
+ # Language-specific object files for C and Objective C.
+ C_AND_OBJC_OBJS = attribs.o c-errors.o c-lex.o c-pragma.o c-decl.o c-typeck.o \
+ c-convert.o c-aux-info.o c-common.o c-opts.o c-format.o c-semantics.o \
+@@ -971,7 +974,7 @@
+ insn-extract.o insn-opinit.o insn-output.o insn-peep.o insn-recog.o \
+ integrate.o intl.o jump.o langhooks.o lcm.o lists.o local-alloc.o \
+ loop.o mode-switching.o modulo-sched.o optabs.o options.o opts.o \
+- params.o postreload.o postreload-gcse.o predict.o \
++ opts-common.o params.o postreload.o postreload-gcse.o predict.o \
+ insn-preds.o pointer-set.o \
+ print-rtl.o print-tree.o profile.o value-prof.o var-tracking.o \
+ real.o recog.o reg-stack.o regclass.o regmove.o regrename.o \
+@@ -1215,18 +1218,18 @@
+ # We call this executable `xgcc' rather than `gcc'
+ # to avoid confusion if the current directory is in the path
+ # and CC is `gcc'. It is renamed to `gcc' when it is installed.
+-xgcc$(exeext): gcc.o gccspec.o version.o intl.o prefix.o \
++xgcc$(exeext): $(GCC_OBJS) gccspec.o version.o intl.o prefix.o \
+ version.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
+- $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o gccspec.o intl.o \
+- prefix.o version.o $(EXTRA_GCC_OBJS) $(LIBS)
++ $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) gccspec.o \
++ intl.o prefix.o version.o $(EXTRA_GCC_OBJS) $(LIBS)
+
+ # cpp is to cpp0 as gcc is to cc1.
+ # The only difference from xgcc is that it's linked with cppspec.o
+ # instead of gccspec.o.
+-cpp$(exeext): gcc.o cppspec.o version.o intl.o prefix.o \
++cpp$(exeext): $(GCC_OBJS) cppspec.o version.o intl.o prefix.o \
+ version.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
+- $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o cppspec.o intl.o \
+- prefix.o version.o $(EXTRA_GCC_OBJS) $(LIBS)
++ $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) cppspec.o \
++ intl.o prefix.o version.o $(EXTRA_GCC_OBJS) $(LIBS)
+
+ # Create links to binutils, especially for in-tree builds, to make -B.
+ # use them. We need hard links so that directories can be shuffled
+@@ -1607,7 +1610,7 @@
+
+ gcc.o: gcc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) intl.h multilib.h \
+ Makefile $(lang_specs_files) specs.h prefix.h $(GCC_H) $(FLAGS_H) \
+- configargs.h $(OBSTACK_H)
++ configargs.h $(OBSTACK_H) opts.h
+ (SHLIB_LINK='$(SHLIB_LINK)' \
+ SHLIB_MULTILIB='$(SHLIB_MULTILIB)'; \
+ $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
+@@ -2020,6 +2023,8 @@
+ coretypes.h $(TREE_H) $(TM_H) langhooks.h $(GGC_H) $(RTL_H) \
+ output.h $(DIAGNOSTIC_H) $(TM_P_H) $(INSN_ATTR_H) intl.h $(TARGET_H) \
+ $(FLAGS_H) $(PARAMS_H) tree-pass.h
++opts-common.o : opts-common.c opts.h $(CONFIG_H) $(SYSTEM_H) \
++ coretypes.h intl.h
+ targhooks.o : targhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_H) \
+ $(EXPR_H) $(TM_H) $(RTL_H) $(TM_P_H) function.h output.h toplev.h \
+ $(MACHMODE_H) $(TARGET_DEF_H) $(TARGET_H) $(GGC_H) gt-targhooks.h
+--- gcc/common.opt.orig 2006-05-07 13:23:52.293266048 +0200
++++ gcc/common.opt 2006-05-07 13:24:36.551537768 +0200
+@@ -1050,11 +1050,11 @@
+ Generate debug information in default format
+
+ gcoff
+-Common JoinedOrMissing
++Common JoinedOrMissing Negative(gdwarf-2)
+ Generate debug information in COFF format
+
+ gdwarf-2
+-Common JoinedOrMissing
++Common JoinedOrMissing Negative(gstabs)
+ Generate debug information in DWARF v2 format
+
+ ggdb
+@@ -1062,23 +1062,23 @@
+ Generate debug information in default extended format
+
+ gstabs
+-Common JoinedOrMissing
++Common JoinedOrMissing Negative(gstabs+)
+ Generate debug information in STABS format
+
+ gstabs+
+-Common JoinedOrMissing
++Common JoinedOrMissing Negative(gvms)
+ Generate debug information in extended STABS format
+
+ gvms
+-Common JoinedOrMissing
++Common JoinedOrMissing Negative(gxcoff)
+ Generate debug information in VMS format
+
+ gxcoff
+-Common JoinedOrMissing
++Common JoinedOrMissing Negative(gxcoff+)
+ Generate debug information in XCOFF format
+
+ gxcoff+
+-Common JoinedOrMissing
++Common JoinedOrMissing Negative(gcoff)
+ Generate debug information in extended XCOFF format
+
+ o
+--- gcc/gcc.c.orig 2006-05-07 13:23:52.298265288 +0200
++++ gcc/gcc.c 2006-05-07 13:24:36.558536704 +0200
+@@ -86,6 +86,7 @@
+ #include "prefix.h"
+ #include "gcc.h"
+ #include "flags.h"
++#include "opts.h"
+
+ /* By default there is no special suffix for target executables. */
+ /* FIXME: when autoconf is fixed, remove the host check - dj */
+@@ -6032,6 +6033,8 @@
+
+ xmalloc_set_program_name (programname);
+
++ prune_options (&argc, &argv);
++
+ #ifdef GCC_DRIVER_HOST_INITIALIZATION
+ /* Perform host dependent initialization when needed. */
+ GCC_DRIVER_HOST_INITIALIZATION;
+--- gcc/optc-gen.awk.orig 2006-05-07 13:23:52.299265136 +0200
++++ gcc/optc-gen.awk 2006-05-07 13:24:36.559536552 +0200
+@@ -62,20 +62,27 @@
+ print "#include " quote "opts.h" quote
+ print "#include " quote "intl.h" quote
+ print ""
++print "int target_flags;"
++print ""
+
+ for (i = 0; i < n_opts; i++) {
+ name = var_name(flags[i]);
+ if (name == "")
+ continue;
+
+- if (flag_set_p("VarExists", flags[i]))
+- continue;
+-
+- init = opt_args("Init", flags[i])
+- if (init != "")
+- init = " = " init;
+- else if (name in var_seen)
+- continue;
++ if (flag_set_p("VarExists", flags[i])) {
++ # Need it for the gcc driver.
++ if (name in var_seen)
++ continue;
++ init = ""
++ }
++ else {
++ init = opt_args("Init", flags[i])
++ if (init != "")
++ init = " = " init;
++ else if (name in var_seen)
++ continue;
++ }
+
+ print "/* Set by -" opts[i] "."
+ print " " help[i] " */"
+@@ -107,8 +114,21 @@
+
+ print "const struct cl_option cl_options[] =\n{"
+
+-for (i = 0; i < n_opts; i++)
++j = 0
++for (i = 0; i < n_opts; i++) {
+ back_chain[i] = "N_OPTS";
++ indices[opts[i]] = j;
++ # Combine the flags of identical switches. Switches
++ # appear many times if they are handled by many front
++ # ends, for example.
++ while( i + 1 != n_opts && opts[i] == opts[i + 1] ) {
++ flags[i + 1] = flags[i] " " flags[i + 1];
++ i++;
++ back_chain[i] = "N_OPTS";
++ indices[opts[i]] = j;
++ }
++ j++;
++}
+
+ for (i = 0; i < n_opts; i++) {
+ # Combine the flags of identical switches. Switches
+@@ -147,8 +167,21 @@
+ else
+ hlp = quote help[i] quote;
+
+- printf(" { %c-%s%c,\n %s,\n %s, %u,\n",
+- quote, opts[i], quote, hlp, back_chain[i], len)
++ neg = opt_args("Negative", flags[i]);
++ if (neg != "")
++ idx = indices[neg]
++ else {
++ if (flag_set_p("RejectNegative", flags[i]))
++ idx = -1;
++ else {
++ if (opts[i] ~ "^[Wfm]")
++ idx = indices[opts[i]];
++ else
++ idx = -1;
++ }
++ }
++ printf(" { %c-%s%c,\n %s,\n %s, %u, %d,\n",
++ quote, opts[i], quote, hlp, back_chain[i], len, idx)
+ condition = opt_args("Condition", flags[i])
+ cl_flags = switch_flags(flags[i])
+ if (condition != "")
+--- gcc/opts-common.c.orig 2006-05-07 13:23:52.326261032 +0200
++++ gcc/opts-common.c 2006-05-07 13:24:36.560536400 +0200
+@@ -0,0 +1,233 @@
++/* Command line option handling.
++ Copyright (C) 2006 Free Software Foundation, Inc.
++
++This file is part of GCC.
++
++GCC is free software; you can redistribute it and/or modify it under
++the terms of the GNU General Public License as published by the Free
++Software Foundation; either version 2, or (at your option) any later
++version.
++
++GCC is distributed in the hope that it will be useful, but WITHOUT ANY
++WARRANTY; without even the implied warranty of MERCHANTABILITY or
++FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++for more details.
++
++You should have received a copy of the GNU General Public License
++along with GCC; see the file COPYING. If not, write to the Free
++Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
++02110-1301, USA. */
++
++#include "config.h"
++#include "system.h"
++#include "intl.h"
++#include "coretypes.h"
++#include "opts.h"
++
++/* Perform a binary search to find which option the command-line INPUT
++ matches. Returns its index in the option array, and N_OPTS
++ (cl_options_count) on failure.
++
++ This routine is quite subtle. A normal binary search is not good
++ enough because some options can be suffixed with an argument, and
++ multiple sub-matches can occur, e.g. input of "-pedantic" matching
++ the initial substring of "-pedantic-errors".
++
++ A more complicated example is -gstabs. It should match "-g" with
++ an argument of "stabs". Suppose, however, that the number and list
++ of switches are such that the binary search tests "-gen-decls"
++ before having tested "-g". This doesn't match, and as "-gen-decls"
++ is less than "-gstabs", it will become the lower bound of the
++ binary search range, and "-g" will never be seen. To resolve this
++ issue, opts.sh makes "-gen-decls" point, via the back_chain member,
++ to "-g" so that failed searches that end between "-gen-decls" and
++ the lexicographically subsequent switch know to go back and see if
++ "-g" causes a match (which it does in this example).
++
++ This search is done in such a way that the longest match for the
++ front end in question wins. If there is no match for the current
++ front end, the longest match for a different front end is returned
++ (or N_OPTS if none) and the caller emits an error message. */
++size_t
++find_opt (const char *input, int lang_mask)
++{
++ size_t mn, mx, md, opt_len;
++ size_t match_wrong_lang;
++ int comp;
++
++ mn = 0;
++ mx = cl_options_count;
++
++ /* Find mn such this lexicographical inequality holds:
++ cl_options[mn] <= input < cl_options[mn + 1]. */
++ while (mx - mn > 1)
++ {
++ md = (mn + mx) / 2;
++ opt_len = cl_options[md].opt_len;
++ comp = strncmp (input, cl_options[md].opt_text + 1, opt_len);
++
++ if (comp < 0)
++ mx = md;
++ else
++ mn = md;
++ }
++
++ /* This is the switch that is the best match but for a different
++ front end, or cl_options_count if there is no match at all. */
++ match_wrong_lang = cl_options_count;
++
++ /* Backtrace the chain of possible matches, returning the longest
++ one, if any, that fits best. With current GCC switches, this
++ loop executes at most twice. */
++ do
++ {
++ const struct cl_option *opt = &cl_options[mn];
++
++ /* Is the input either an exact match or a prefix that takes a
++ joined argument? */
++ if (!strncmp (input, opt->opt_text + 1, opt->opt_len)
++ && (input[opt->opt_len] == '\0' || (opt->flags & CL_JOINED)))
++ {
++ /* If language is OK, return it. */
++ if (opt->flags & lang_mask)
++ return mn;
++
++ /* If we haven't remembered a prior match, remember this
++ one. Any prior match is necessarily better. */
++ if (match_wrong_lang == cl_options_count)
++ match_wrong_lang = mn;
++ }
++
++ /* Try the next possibility. This is cl_options_count if there
++ are no more. */
++ mn = opt->back_chain;
++ }
++ while (mn != cl_options_count);
++
++ /* Return the best wrong match, or cl_options_count if none. */
++ return match_wrong_lang;
++}
++
++/* Return true if NEXT_OPT_IDX cancels OPT_IDX. Return false if the
++ next one is the same as ORIG_NEXT_OPT_IDX. */
++
++static bool
++cancel_option (int opt_idx, int next_opt_idx, int orig_next_opt_idx)
++{
++ /* An option can be canceled by the same option or an option with
++ Negative. */
++ if (cl_options [next_opt_idx].neg_index == opt_idx)
++ return true;
++
++ if (cl_options [next_opt_idx].neg_index != orig_next_opt_idx)
++ return cancel_option (opt_idx, cl_options [next_opt_idx].neg_index,
++ orig_next_opt_idx);
++
++ return false;
++}
++
++/* Filter out options canceled by the ones after them. */
++
++void
++prune_options (int *argcp, char ***argvp)
++{
++ int argc = *argcp;
++ int *options = xmalloc (argc * sizeof (*options));
++ char **argv = xmalloc (argc * sizeof (char *));
++ int i, arg_count, need_prune = 0;
++ const struct cl_option *option;
++ size_t opt_index;
++
++ /* Scan all arguments. */
++ for (i = 1; i < argc; i++)
++ {
++ int value = 1;
++ const char *opt = (*argvp) [i];
++
++ opt_index = find_opt (opt + 1, -1);
++ if (opt_index == cl_options_count
++ && (opt[1] == 'W' || opt[1] == 'f' || opt[1] == 'm')
++ && opt[2] == 'n' && opt[3] == 'o' && opt[4] == '-')
++ {
++ char *dup;
++
++ /* Drop the "no-" from negative switches. */
++ size_t len = strlen (opt) - 3;
++
++ dup = XNEWVEC (char, len + 1);
++ dup[0] = '-';
++ dup[1] = opt[1];
++ memcpy (dup + 2, opt + 5, len - 2 + 1);
++ opt = dup;
++ value = 0;
++ opt_index = find_opt (opt + 1, -1);
++ free (dup);
++ }
++
++ if (opt_index == cl_options_count)
++ {
++cont:
++ options [i] = 0;
++ continue;
++ }
++
++ option = &cl_options[opt_index];
++ if (option->neg_index < 0)
++ goto cont;
++
++ /* Reject negative form of switches that don't take negatives as
++ unrecognized. */
++ if (!value && (option->flags & CL_REJECT_NEGATIVE))
++ goto cont;
++
++ options [i] = (int) opt_index;
++ need_prune |= options [i];
++ }
++
++ if (!need_prune)
++ goto done;
++
++ /* Remove arguments which are negated by others after them. */
++ argv [0] = (*argvp) [0];
++ arg_count = 1;
++ for (i = 1; i < argc; i++)
++ {
++ int j, opt_idx;
++
++ opt_idx = options [i];
++ if (opt_idx)
++ {
++ int next_opt_idx;
++ for (j = i + 1; j < argc; j++)
++ {
++ next_opt_idx = options [j];
++ if (next_opt_idx
++ && cancel_option (opt_idx, next_opt_idx,
++ next_opt_idx))
++ break;
++ }
++ }
++ else
++ goto keep;
++
++ if (j == argc)
++ {
++keep:
++ argv [arg_count] = (*argvp) [i];
++ arg_count++;
++ }
++ }
++
++ if (arg_count != argc)
++ {
++ *argcp = arg_count;
++ *argvp = argv;
++ }
++ else
++ {
++done:
++ free (argv);
++ }
++
++ free (options);
++}
+--- gcc/opts.c.orig 2006-05-07 13:23:52.400249784 +0200
++++ gcc/opts.c 2006-05-07 13:28:05.064838928 +0200
+@@ -101,7 +101,6 @@
+ const char **in_fnames;
+ unsigned num_in_fnames;
+
+-static size_t find_opt (const char *, int);
+ static int common_handle_option (size_t scode, const char *arg, int value);
+ static void handle_param (const char *);
+ static void set_Wextra (int);
+@@ -119,90 +118,6 @@
+ static void set_debug_level (enum debug_info_type type, int extended,
+ const char *arg);
+
+-/* Perform a binary search to find which option the command-line INPUT
+- matches. Returns its index in the option array, and N_OPTS
+- (cl_options_count) on failure.
+-
+- This routine is quite subtle. A normal binary search is not good
+- enough because some options can be suffixed with an argument, and
+- multiple sub-matches can occur, e.g. input of "-pedantic" matching
+- the initial substring of "-pedantic-errors".
+-
+- A more complicated example is -gstabs. It should match "-g" with
+- an argument of "stabs". Suppose, however, that the number and list
+- of switches are such that the binary search tests "-gen-decls"
+- before having tested "-g". This doesn't match, and as "-gen-decls"
+- is less than "-gstabs", it will become the lower bound of the
+- binary search range, and "-g" will never be seen. To resolve this
+- issue, opts.sh makes "-gen-decls" point, via the back_chain member,
+- to "-g" so that failed searches that end between "-gen-decls" and
+- the lexicographically subsequent switch know to go back and see if
+- "-g" causes a match (which it does in this example).
+-
+- This search is done in such a way that the longest match for the
+- front end in question wins. If there is no match for the current
+- front end, the longest match for a different front end is returned
+- (or N_OPTS if none) and the caller emits an error message. */
+-static size_t
+-find_opt (const char *input, int lang_mask)
+-{
+- size_t mn, mx, md, opt_len;
+- size_t match_wrong_lang;
+- int comp;
+-
+- mn = 0;
+- mx = cl_options_count;
+-
+- /* Find mn such this lexicographical inequality holds:
+- cl_options[mn] <= input < cl_options[mn + 1]. */
+- while (mx - mn > 1)
+- {
+- md = (mn + mx) / 2;
+- opt_len = cl_options[md].opt_len;
+- comp = strncmp (input, cl_options[md].opt_text + 1, opt_len);
+-
+- if (comp < 0)
+- mx = md;
+- else
+- mn = md;
+- }
+-
+- /* This is the switch that is the best match but for a different
+- front end, or cl_options_count if there is no match at all. */
+- match_wrong_lang = cl_options_count;
+-
+- /* Backtrace the chain of possible matches, returning the longest
+- one, if any, that fits best. With current GCC switches, this
+- loop executes at most twice. */
+- do
+- {
+- const struct cl_option *opt = &cl_options[mn];
+-
+- /* Is the input either an exact match or a prefix that takes a
+- joined argument? */
+- if (!strncmp (input, opt->opt_text + 1, opt->opt_len)
+- && (input[opt->opt_len] == '\0' || (opt->flags & CL_JOINED)))
+- {
+- /* If language is OK, return it. */
+- if (opt->flags & lang_mask)
+- return mn;
+-
+- /* If we haven't remembered a prior match, remember this
+- one. Any prior match is necessarily better. */
+- if (match_wrong_lang == cl_options_count)
+- match_wrong_lang = mn;
+- }
+-
+- /* Try the next possibility. This is cl_options_count if there
+- are no more. */
+- mn = opt->back_chain;
+- }
+- while (mn != cl_options_count);
+-
+- /* Return the best wrong match, or cl_options_count if none. */
+- return match_wrong_lang;
+-}
+-
+ /* If ARG is a non-negative integer made up solely of digits, return its
+ value, otherwise return -1. */
+ static int
+--- gcc/opts.h.orig 2006-05-07 13:23:52.401249632 +0200
++++ gcc/opts.h 2006-05-07 13:24:36.563535944 +0200
+@@ -46,6 +46,7 @@
+ const char *help;
+ unsigned short back_chain;
+ unsigned char opt_len;
++ int neg_index;
+ unsigned int flags;
+ void *flag_var;
+ enum cl_var_type var_type;
+@@ -83,6 +84,8 @@
+
+ extern unsigned num_in_fnames;
+
++size_t find_opt (const char *input, int lang_mask);
++extern void prune_options (int *argcp, char ***argvp);
+ extern void decode_options (unsigned int argc, const char **argv);
+ extern int option_enabled (int opt_idx);
+ extern bool get_option_state (int, struct cl_option_state *);
--- gcc-4.1-4.1.1.orig/debian/patches/libjava-soname.dpatch
+++ gcc-4.1-4.1.1/debian/patches/libjava-soname.dpatch
@@ -0,0 +1,34 @@
+#! /bin/sh -e
+
+# DP: Bump the libgcj soversion.
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+
+--- libjava/libtool-version~ 2006-01-18 22:52:29.000000000 +0100
++++ libjava/libtool-version 2006-04-03 23:32:44.934656864 +0200
+@@ -3,4 +3,4 @@
+ # a separate file so that version updates don't involve re-running
+ # automake.
+ # CURRENT:REVISION:AGE
+-7:0:0
++70:0:0
--- gcc-4.1-4.1.1.orig/debian/patches/ada-link-lib.dpatch
+++ gcc-4.1-4.1.1/debian/patches/ada-link-lib.dpatch
@@ -0,0 +1,2139 @@
+#! /bin/sh -e
+
+# DP: - Install the shared Ada libraries as '.so.1', not '.so' to conform
+# DP: to the Debian policy.
+# DP: - Don't include a runtime link path (-rpath), when linking binaries.
+# DP: - Build the shared libraries on hppa-linux.
+# DP: - Instead of building libada as a target library only, build it as
+# DP: both a host and, if different, target library.
+# DP: - Build the GNAT tools in their top-level directory; do not use
+# DP: recursive makefiles.
+# DP: - Link the GNAT tools dynamically.
+# DP: - Fix a bug in src/gnattools/configure.ac whereby a nonexistent version
+# DP: of indepsw's body was selected. Regenerate configure. (PR ada/27300)
+
+# This patch seems large, but the hunks in Makefile.in are actually
+# generated from Makefile.def using autogen.
+
+dir=./
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ cd ${dir} && autoconf2.13
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ rm -f ${dir}configure
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+--- configure.in~
++++ configure.in 2006-04-12 09:30:12.000000000 +0200
+@@ -123,7 +123,7 @@
+
+ # these libraries are used by various programs built for the host environment
+ #
+-host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib libcpp"
++host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib libcpp libada"
+
+ # these tools are built for the host environment
+ # Note, the powerpc-eabi build depends on sim occurring before gdb in order to
+@@ -229,7 +229,7 @@
+
+ # Similarly, some are only suitable for cross toolchains.
+ # Remove these if host=target.
+-cross_only="target-libgloss target-newlib target-opcodes"
++cross_only="target-libgloss target-newlib target-opcodes target-libada"
+
+ case $is_cross_compiler in
+ no) skipdirs="${skipdirs} ${cross_only}" ;;
+--- gcc/ada/config-lang.in~
++++ gcc/ada/config-lang.in 2006-04-26 08:17:42.000000000 +0000
+@@ -39,7 +39,7 @@
+ outputs=ada/Makefile
+
+ target_libs="target-libada"
+-lang_dirs="gnattools"
++lang_dirs="libada gnattools"
+
+ # Ada will not work until the front end starts emitting GIMPLE trees.
+ build_by_default=no
+--- gcc/ada/link.c~
++++ gcc/ada/link.c 2006-04-12 09:30:12.000000000 +0200
+@@ -164,8 +164,8 @@
+
+ #elif defined (linux)
+ const char *__gnat_object_file_option = "";
+-const char *__gnat_run_path_option = "-Wl,-rpath,";
+-char __gnat_shared_libgnat_default = STATIC;
++const char *__gnat_run_path_option = "";
++char __gnat_shared_libgnat_default = SHARED;
+ int __gnat_link_max = 8192;
+ unsigned char __gnat_objlist_file_supported = 1;
+ unsigned char __gnat_using_gnu_linker = 1;
+--- gcc/ada/Makefile.in~
++++ gcc/ada/Makefile.in 2006-04-12 15:02:23.000000000 +0200
+@@ -115,7 +115,7 @@
+ MAKEINFO = makeinfo
+ TEXI2DVI = texi2dvi
+ GNATBIND = $(STAGE_PREFIX)gnatbind
+-GNATBIND_FLAGS = -static -x
++GNATBIND_FLAGS = -shared -x
+ ADA_CFLAGS =
+ ADAFLAGS = -W -Wall -gnatpg -gnata
+ SOME_ADAFLAGS =-gnata
+@@ -247,7 +247,6 @@
+ LIBDEPS = $(LIBINTL_DEP) $(LIBIBERTY)
+ # Default is no TGT_LIB; one might be passed down or something
+ TGT_LIB =
+-TOOLS_LIBS = $(LIBGNAT) $(EXTRA_GNATTOOLS_OBJS) link.o ../../../libiberty/libiberty.a $(SYSLIBS) $(TGT_LIB)
+
+ # Specify the directories to be searched for header files.
+ # Both . and srcdir are used, in that order,
+@@ -293,30 +292,6 @@
+ # defined in this file into the environment.
+ .NOEXPORT:
+
+-# Lists of files for various purposes.
+-
+-GNATLINK_OBJS = gnatlink.o \
+- a-except.o ali.o alloc.o butil.o casing.o csets.o debug.o fmap.o fname.o gnatvsn.o \
+- hostparm.o indepsw.o interfac.o i-c.o i-cstrin.o namet.o opt.o osint.o output.o rident.o \
+- s-exctab.o s-secsta.o s-stalib.o s-stoele.o sdefault.o stylesw.o switch.o system.o \
+- table.o tree_io.o types.o validsw.o widechar.o
+-
+-GNATMAKE_OBJS = a-except.o ctrl_c.o ali.o ali-util.o s-casuti.o \
+- alloc.o atree.o binderr.o butil.o casing.o csets.o debug.o elists.o einfo.o\
+- erroutc.o errutil.o err_vars.o fmap.o fname.o fname-uf.o fname-sf.o \
+- gnatmake.o gnatvsn.o hostparm.o interfac.o i-c.o i-cstrin.o krunch.o lib.o \
+- make.o makeusg.o makeutl.o mlib.o mlib-fil.o mlib-prj.o mlib-tgt.o mlib-utl.o \
+- namet.o nlists.o opt.o osint.o osint-m.o output.o \
+- prj.o prj-attr.o prj-attr-pm.o prj-com.o prj-dect.o prj-env.o prj-err.o prj-ext.o prj-nmsc.o \
+- prj-pars.o prj-part.o prj-proc.o prj-strt.o prj-tree.o prj-util.o \
+- rident.o s-exctab.o s-secsta.o s-stalib.o s-stoele.o \
+- scans.o scng.o sdefault.o sfn_scan.o s-purexc.o s-htable.o \
+- sinfo.o sinput.o sinput-c.o sinput-p.o \
+- snames.o stand.o stringt.o styleg.o stylesw.o system.o validsw.o switch.o switch-m.o \
+- table.o targparm.o tempdir.o tree_io.o types.o \
+- uintp.o uname.o urealp.o usage.o widechar.o \
+- $(EXTRA_GNATMAKE_OBJS)
+-
+ # Convert the target variable into a space separated list of architecture,
+ # manufacturer, and operating system and assign each of those to its own
+ # variable.
+@@ -408,8 +383,6 @@
+ g-socthi.adb&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p1 < $0
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p1 < $0
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+--- src/libjava/configure.host.old 2005-12-31 16:06:00.900551776 +0000
++++ src/libjava/configure.host 2005-12-31 16:06:25.879754360 +0000
+@@ -98,6 +98,9 @@
+ enable_hash_synchronization_default=yes
+ slow_pthread_self=yes
+ ;;
++ arm*-*)
++ libgcj_interpreter=yes
++ ;;
+ x86_64-*)
+ sysdeps_dir=x86-64
+ libgcj_flags="${libgcj_flags} -ffloat-store -fno-omit-frame-pointer"
--- gcc-4.1-4.1.1.orig/debian/patches/sparc-niagara-doc.dpatch
+++ gcc-4.1-4.1.1/debian/patches/sparc-niagara-doc.dpatch
@@ -0,0 +1,112 @@
+#! /bin/sh -e
+
+# DP: Backport of sparc niagara support (doc files).
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ #cd ${dir}gcc && autoconf
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+ #rm ${dir}gcc/configure
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+2006-03-02 David S. Miller
+
+ Sun Niagara specific optimizations.
+ * config.gcc: Recognize niagara as target.
+ * config/sparc/sparc.h (SPARC_RELAXED_ORDERING): Mention Niagara.
+ (TARGET_CPU_niagara): Define.
+ (CPP_CPU64_DEFAULT_SPEC): Define __sparc_v9__ for Niagara.
+ (ASM_CPU64_DEFAULT_SPEC): Pass -Av9b for Niagara.
+ (CPP_CPU_SPEC): Handle -mcpu=niagara.
+ (ASM_CPU_SPEC): Likewise.
+ (PROCESSOR_NIAGARA): New enum entry.
+ (REGISTER_MOVE_COST): Handle Niagara.
+ (BRANCH_COST, PREFETCH_BLOCK, SIMULTANEOUS_PREFETCHES): Likewise.
+ * config/sparc/sparc.c (niagara_costs): New processor_costs entry.
+ (sparc_override_options): Recognize "niagara", set appropriate
+ default MASK_* values for it, and align functions to 32-bytes
+ by default just like ULTRASPARC/ULTRASPARC3.
+ (sparc_initialize_trampoline): Handle niagara like ultrasparc.
+ (sparc64_initialize_trampoline): Likewise.
+ (sparc_use_sched_lookahead): Use zero for niagara.
+ (sparc_issue_rate): Use one for niagara.
+ * config/sparc/niagara.md: New file.
+ * config/sparc/sparc.md: Include it.
+ * config/sparc/sol2-bi.h (CPP_CPU64_DEFAULT_SPEC,
+ ASM_CPU32_DEFAULT_SPEC, ASM_CPU64_DEFAULT_SPEC): Set appropriately
+ when default cpu is niagara.
+ (CPP_CPU_SPEC): Handle -mcpu=niagara.
+ (ASM_CPU_SPEC): Likewise.
+ * config/sparc/sol2.h (ASM_CPU_DEFAULT_SPEC): Set appropriately
+ when default cpu is niagara.
+ (ASM_CPU_SPEC): Handle -mcpu=niagara.
+ * config/sparc/linux64.h: Handle a default of TARGET_CPU_niagara
+ just like v9/ultrasparc/ultrasparc3.
+ * doc/invoke.texi: Add documentation for "niagara" and improve
+ existing documentation for ultrasparc variants.
+
+Index: gcc/doc/invoke.texi
+===================================================================
+--- gcc/doc/invoke.texi (revision 111647)
++++ gcc/doc/invoke.texi (working copy)
+@@ -12268,8 +12268,8 @@
+ for machine type @var{cpu_type}. Supported values for @var{cpu_type} are
+ @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
+ @samp{f930}, @samp{f934}, @samp{hypersparc}, @samp{sparclite86x},
+-@samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc}, and
+-@samp{ultrasparc3}.
++@samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
++@samp{ultrasparc3}, and @samp{niagara}.
+
+ Default instruction scheduling parameters are used for values that select
+ an architecture and not an implementation. These are @samp{v7}, @samp{v8},
+@@ -12283,7 +12283,7 @@
+ v8: supersparc, hypersparc
+ sparclite: f930, f934, sparclite86x
+ sparclet: tsc701
+- v9: ultrasparc, ultrasparc3
++ v9: ultrasparc, ultrasparc3, niagara
+ @end smallexample
+
+ By default (unless configured otherwise), GCC generates code for the V7
+@@ -12317,9 +12317,11 @@
+ architecture. This adds 64-bit integer and floating-point move instructions,
+ 3 additional floating-point condition code registers and conditional move
+ instructions. With @option{-mcpu=ultrasparc}, the compiler additionally
+-optimizes it for the Sun UltraSPARC I/II chips. With
++optimizes it for the Sun UltraSPARC I/II/IIi chips. With
+ @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
+-Sun UltraSPARC III chip.
++Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips. With
++@option{-mcpu=niagara}, the compiler additionally optimizes it for
++Sun UltraSPARC T1 chips.
+
+ @item -mtune=@var{cpu_type}
+ @opindex mtune
+@@ -12331,8 +12333,8 @@
+ @option{-mtune=@var{cpu_type}}, but the only useful values are those
+ that select a particular cpu implementation. Those are @samp{cypress},
+ @samp{supersparc}, @samp{hypersparc}, @samp{f930}, @samp{f934},
+-@samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc}, and
+-@samp{ultrasparc3}.
++@samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
++@samp{ultrasparc3}, and @samp{niagara}.
+
+ @item -mv8plus
+ @itemx -mno-v8plus
--- gcc-4.1-4.1.1.orig/debian/patches/gpc-gcc-4.1.diff
+++ gcc-4.1-4.1.1/debian/patches/gpc-gcc-4.1.diff
@@ -0,0 +1,1487 @@
+diff -ru ../gcc-4.1.0.orig/gcc/config/i386/i386.c gcc-4.1.0/gcc/config/i386/i386.c
+--- ../gcc-4.1.0.orig/gcc/config/i386/i386.c 2006-01-11 14:32:44.000000000 +0100
++++ gcc-4.1.0/gcc/config/i386/i386.c 2006-04-04 21:31:03.000000000 +0200
+@@ -2733,6 +2733,30 @@
+ }
+ break;
+
++ case SET_TYPE:
++ if (bytes <= 4)
++ {
++ classes[0] = X86_64_INTEGERSI_CLASS;
++ return 1;
++ }
++ else if (bytes <= 8)
++ {
++ classes[0] = X86_64_INTEGER_CLASS;
++ return 1;
++ }
++ else if (bytes <= 12)
++ {
++ classes[0] = X86_64_INTEGER_CLASS;
++ classes[1] = X86_64_INTEGERSI_CLASS;
++ return 2;
++ }
++ else
++ {
++ classes[0] = X86_64_INTEGER_CLASS;
++ classes[1] = X86_64_INTEGER_CLASS;
++ return 2;
++ }
++
+ default:
+ gcc_unreachable ();
+ }
+Only in gcc-4.1.0/gcc/config/i386: i386.c.orig
+Only in gcc-4.1.0/gcc/config/i386: i386.c~
+diff -ru ../gcc-4.1.0.orig/gcc/config/ia64/ia64.c gcc-4.1.0/gcc/config/ia64/ia64.c
+--- ../gcc-4.1.0.orig/gcc/config/ia64/ia64.c 2006-02-04 23:13:20.000000000 +0100
++++ gcc-4.1.0/gcc/config/ia64/ia64.c 2006-04-05 02:08:45.000000000 +0200
+@@ -3819,6 +3819,7 @@
+ case BOOLEAN_TYPE: case CHAR_TYPE: case POINTER_TYPE:
+ case OFFSET_TYPE: case REFERENCE_TYPE: case METHOD_TYPE:
+ case LANG_TYPE: case FUNCTION_TYPE:
++ case SET_TYPE:
+ return VOIDmode;
+
+ /* Fortran complex types are supposed to be HFAs, so we need to handle
+Only in gcc-4.1.0/gcc/config/ia64: ia64.c.orig
+Only in gcc-4.1.0/gcc/config/ia64: ia64.c.rej
+Only in gcc-4.1.0/gcc/config/ia64: ia64.c~
+diff -ru ../gcc-4.1.0.orig/gcc/config/sparc/sparc.c gcc-4.1.0/gcc/config/sparc/sparc.c
+--- ../gcc-4.1.0.orig/gcc/config/sparc/sparc.c 2006-02-11 09:38:51.000000000 +0100
++++ gcc-4.1.0/gcc/config/sparc/sparc.c 2006-04-05 02:10:26.000000000 +0200
+@@ -7019,6 +7019,7 @@
+ case VECTOR_TYPE:
+ case CHAR_TYPE: /* GNU Pascal CHAR type. Not used in C. */
+ case BOOLEAN_TYPE: /* GNU Fortran BOOLEAN type. */
++ case SET_TYPE: /* GNU Pascal SET type. */
+ case LANG_TYPE: /* ? */
+ return qualifiers;
+
+Only in gcc-4.1.0/gcc/config/sparc: sparc.c.orig
+Only in gcc-4.1.0/gcc/config/sparc: sparc.c.rej
+Only in gcc-4.1.0/gcc/config/sparc: sparc.c~
+diff -ru ../gcc-4.1.0.orig/gcc/dbxout.c gcc-4.1.0/gcc/dbxout.c
+--- ../gcc-4.1.0.orig/gcc/dbxout.c 2005-10-06 02:47:21.000000000 +0200
++++ gcc-4.1.0/gcc/dbxout.c 2006-04-08 02:50:05.000000000 +0200
+@@ -1916,7 +1916,7 @@
+ {
+ stabstr_S ("@s");
+ stabstr_D (BITS_PER_UNIT * int_size_in_bytes (type));
+- stabstr_S (";-20;");
++ stabstr_S (";-20");
+ }
+ else
+ {
+@@ -1933,7 +1933,7 @@
+ {
+ stabstr_S ("@s");
+ stabstr_D (BITS_PER_UNIT * int_size_in_bytes (type));
+- stabstr_S (";-16;");
++ stabstr_S (";-16");
+ }
+ else /* Define as enumeral type (False, True) */
+ stabstr_S ("eFalse:0,True:1,;");
+@@ -1972,6 +1972,22 @@
+ }
+ break;
+
++ case SET_TYPE:
++ if (use_gnu_debug_info_extensions)
++ {
++ stabstr_S ("@s");
++ stabstr_D (BITS_PER_UNIT * int_size_in_bytes (type));
++ stabstr_C (';');
++
++ /* Check if a bitstring type, which in Chill is
++ different from a [power]set. */
++ if (TYPE_STRING_FLAG (type))
++ stabstr_S ("@S;");
++ }
++ stabstr_C ('S');
++ dbxout_type (TYPE_DOMAIN (type), 0);
++ break;
++
+ case ARRAY_TYPE:
+ /* Make arrays of packed bits look like bitstrings for chill. */
+ if (TYPE_PACKED (type) && use_gnu_debug_info_extensions)
+@@ -2435,7 +2451,7 @@
+ we see following the TREE_TYPE chain. */
+
+ t = type;
+- while (POINTER_TYPE_P (t))
++ while (POINTER_TYPE_P (t) && !TYPE_NAME (t))
+ t = TREE_TYPE (t);
+
+ /* RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE, and ENUMERAL_TYPE
+Only in gcc-4.1.0/gcc: dbxout.c~
+diff -ru ../gcc-4.1.0.orig/gcc/dwarf2out.c gcc-4.1.0/gcc/dwarf2out.c
+--- ../gcc-4.1.0.orig/gcc/dwarf2out.c 2006-02-04 23:13:20.000000000 +0100
++++ gcc-4.1.0/gcc/dwarf2out.c 2006-04-04 21:16:16.000000000 +0200
+@@ -8218,6 +8218,7 @@
+ case OFFSET_TYPE:
+ case LANG_TYPE:
+ case VECTOR_TYPE:
++ case SET_TYPE:
+ return 0;
+
+ default:
+@@ -9014,9 +9015,12 @@
+ {
+ dw_loc_descr_ref ret, ret1;
+ int have_address = 0;
+- int unsignedp = TYPE_UNSIGNED (TREE_TYPE (loc));
++ int unsignedp /* = TYPE_UNSIGNED (TREE_TYPE (loc)) */;
+ enum dwarf_location_atom op;
+
++ gcc_assert (TREE_TYPE (loc));
++ unsignedp = TYPE_UNSIGNED (TREE_TYPE (loc));
++
+ /* ??? Most of the time we do not take proper care for sign/zero
+ extending the values properly. Hopefully this won't be a real
+ problem... */
+@@ -9390,6 +9394,19 @@
+ }
+ break;
+
++#ifdef GPC
++ case REAL_CST:
++ case FLOAT_EXPR:
++ case RDIV_EXPR:
++ case STRING_CST:
++ /* In Pascal it's possible for array bounds to contain floating point
++ expressions (e.g., p/test/emil11c.pas). I don't know if it's
++ possible to represent them in dwarf2, but it doesn't seem terribly
++ important since this occurs quite rarely. -- Frank */
++ return 0;
++#endif
++
++
+ case FIX_TRUNC_EXPR:
+ case FIX_CEIL_EXPR:
+ case FIX_FLOOR_EXPR:
+@@ -11142,6 +11159,16 @@
+ add_type_attribute (array_die, element_type, 0, 0, context_die);
+ }
+
++static void
++gen_set_type_die (tree type, dw_die_ref context_die)
++{
++ dw_die_ref type_die
++ = new_die (DW_TAG_set_type, scope_die_for (type, context_die), type);
++
++ equate_type_number_to_die (type, type_die);
++ add_type_attribute (type_die, TREE_TYPE (type), 0, 0, context_die);
++}
++
+ #if 0
+ static void
+ gen_entry_point_die (tree decl, dw_die_ref context_die)
+@@ -12499,6 +12526,11 @@
+ gen_ptr_to_mbr_type_die (type, context_die);
+ break;
+
++ case SET_TYPE:
++ gen_type_die (TYPE_DOMAIN (type), context_die);
++ gen_set_type_die (type, context_die);
++ break;
++
+ case FUNCTION_TYPE:
+ /* Force out return type (in case it wasn't forced out already). */
+ gen_type_die (TREE_TYPE (type), context_die);
+diff -ru ../gcc-4.1.0.orig/gcc/expr.c gcc-4.1.0/gcc/expr.c
+--- ../gcc-4.1.0.orig/gcc/expr.c 2006-02-03 19:31:14.000000000 +0100
++++ gcc-4.1.0/gcc/expr.c 2006-04-04 21:16:16.000000000 +0200
+@@ -4635,6 +4635,10 @@
+ case REFERENCE_TYPE:
+ return 1;
+
++ case SET_TYPE:
++ /* @@@@@@ return something more accurate ... */
++ return -1;
++
+ case VOID_TYPE:
+ case METHOD_TYPE:
+ case FUNCTION_TYPE:
+@@ -4655,6 +4659,10 @@
+ HOST_WIDE_INT nz_elts, nc_elts, count, elts;
+ bool must_clear;
+
++ if (TREE_TYPE (exp) && TREE_CODE (TREE_TYPE (exp)) == SET_TYPE)
++ /* If there are no ranges of true bits, it is all zero. */
++ return CONSTRUCTOR_ELTS (exp) == NULL_TREE;
++
+ categorize_ctor_elements (exp, &nz_elts, &nc_elts, &count, &must_clear);
+ if (must_clear)
+ return 1;
+@@ -5289,6 +5297,229 @@
+ gen_rtx_PARALLEL (GET_MODE (target), vector)));
+ break;
+ }
++
++ case SET_TYPE:
++ {
++ tree elt = CONSTRUCTOR_ELTS (exp);
++ unsigned HOST_WIDE_INT nbytes = int_size_in_bytes (type), nbits;
++ tree domain = TYPE_DOMAIN (type);
++ tree domain_min, domain_max, bitlength;
++
++ /* The default implementation strategy is to extract the constant
++ parts of the constructor, use that to initialize the target,
++ and then "or" in whatever non-constant ranges we need in addition.
++
++ If a large set is all zero or all ones, it is
++ probably better to set it using memset (if available) or bzero.
++ Also, if a large set has just a single range, it may also be
++ better to first clear all the first clear the set (using
++ bzero/memset), and set the bits we want. */
++
++ /* Check for all zeros. */
++ if (elt == NULL_TREE && size > 0)
++ {
++ if (!cleared)
++ clear_storage (target, GEN_INT (size), BLOCK_OP_NORMAL);
++ return;
++ }
++
++#ifndef GPC
++ domain_min = convert (sizetype, TYPE_MIN_VALUE (domain));
++ domain_max = convert (sizetype, TYPE_MAX_VALUE (domain));
++#else /* GPC */
++ domain_min = convert (sbitsizetype, TYPE_MIN_VALUE (domain));
++ domain_max = convert (sbitsizetype, TYPE_MAX_VALUE (domain));
++
++ /* Align the set. */
++ if (set_alignment)
++ domain_min = size_binop (BIT_AND_EXPR, domain_min, sbitsize_int (-(int)
++set_alignment));
++
++#endif /* GPC */
++ bitlength = size_binop (PLUS_EXPR,
++ size_binop (MINUS_EXPR, domain_max, domain_min),
++#ifndef GPC
++ ssize_int (1));
++#else /* GPC */
++ sbitsize_int (1));
++#endif /* GPC */
++
++#ifdef GPC
++ if (TREE_INT_CST_HIGH (bitlength)) {
++ error ("set size too big for host integers");
++ return;
++ }
++#endif /* GPC */
++ nbits = tree_low_cst (bitlength, 1);
++#ifdef GPC
++ bitlength = convert (sizetype, bitlength);
++#endif /* GPC */
++
++ /* For "small" sets, or "medium-sized" (up to 32 bytes) sets that
++ are "complicated" (more than one range), initialize (the
++ constant parts) by copying from a constant. */
++ if (GET_MODE (target) != BLKmode || nbits <= 2 * BITS_PER_WORD
++ || (nbytes <= 32 && TREE_CHAIN (elt) != NULL_TREE))
++ {
++#ifndef GPC
++ unsigned int set_word_size = TYPE_ALIGN (TREE_TYPE (exp));
++#endif /* not GPC */
++ enum machine_mode mode = mode_for_size (set_word_size, MODE_INT, 1);
++ char *bit_buffer = alloca (nbits);
++ HOST_WIDE_INT word = 0;
++ unsigned int bit_pos = 0;
++ unsigned int ibit = 0;
++ unsigned int offset = 0; /* In bytes from beginning of set. */
++
++ elt = get_set_constructor_bits (exp, bit_buffer, nbits);
++ for (;;)
++ {
++ if (bit_buffer[ibit])
++ {
++#ifndef GPC
++ if (BYTES_BIG_ENDIAN)
++#else /* GPC */
++ if (set_words_big_endian)
++#endif /* GPC */
++ word |= (((HOST_WIDE_INT)1) << (set_word_size - 1 - bit_pos));
++ else
++ word |= ((HOST_WIDE_INT)1) << bit_pos;
++ }
++
++ bit_pos++; ibit++;
++ if (bit_pos >= set_word_size || ibit == nbits)
++ {
++ if (word != 0 || ! cleared)
++ {
++ rtx datum = gen_int_mode (word, mode);
++ rtx to_rtx;
++
++ /* The assumption here is that it is safe to use
++ XEXP if the set is multi-word, but not if
++ it's single-word. */
++ if (GET_CODE (target) == MEM)
++ to_rtx = adjust_address (target, mode, offset);
++ else if (offset == 0)
++ to_rtx = target;
++ else
++ abort ();
++ emit_move_insn (to_rtx, datum);
++ }
++
++ if (ibit == nbits)
++ break;
++ word = 0;
++ bit_pos = 0;
++ offset += set_word_size / BITS_PER_UNIT;
++ }
++ }
++ }
++ else if (!cleared)
++ /* GPC expects bits outside the range to be cleared. (fjf1010.pas)
++ Though this check might be "dead" in this GCC version since it only
++ applies to single ranges with constant bounds, and those are apparently
++ always stored as constants anyway, not initialized via `__setbits'. */
++#ifndef GPC
++ /* Don't bother clearing storage if the set is all ones. */
++ if (TREE_CHAIN (elt) != NULL_TREE
++ || (TREE_PURPOSE (elt) == NULL_TREE
++ ? nbits != 1
++ : ( ! host_integerp (TREE_VALUE (elt), 0)
++ || ! host_integerp (TREE_PURPOSE (elt), 0)
++ || (tree_low_cst (TREE_VALUE (elt), 0)
++ - tree_low_cst (TREE_PURPOSE (elt), 0) + 1
++ != (HOST_WIDE_INT) nbits))))
++#endif
++ clear_storage (target, expr_size (exp), BLOCK_OP_NORMAL);
++
++ for (; elt != NULL_TREE; elt = TREE_CHAIN (elt))
++ {
++ /* Start of range of element or NULL. */
++ tree startbit = TREE_PURPOSE (elt);
++ /* End of range of element, or element value. */
++ tree endbit = TREE_VALUE (elt);
++ HOST_WIDE_INT startb, endb;
++ rtx bitlength_rtx, startbit_rtx, endbit_rtx, targetx;
++
++ bitlength_rtx = expand_expr (bitlength,
++ NULL_RTX, MEM, EXPAND_CONST_ADDRESS);
++
++ /* Handle non-range tuple element like [ expr ]. */
++ if (startbit == NULL_TREE)
++ {
++ startbit = save_expr (endbit);
++ endbit = startbit;
++ }
++
++#ifndef GPC
++ startbit = convert (sizetype, startbit);
++ endbit = convert (sizetype, endbit);
++#endif /* not GPC */
++ if (! integer_zerop (domain_min))
++ {
++#ifdef GPC
++ startbit = convert (sbitsizetype, startbit);
++ endbit = convert (sbitsizetype, endbit);
++#endif /* GPC */
++ startbit = size_binop (MINUS_EXPR, startbit, domain_min);
++ endbit = size_binop (MINUS_EXPR, endbit, domain_min);
++ }
++#ifdef GPC
++ startbit = convert (sizetype, startbit);
++ endbit = convert (sizetype, endbit);
++#endif /* GPC */
++ startbit_rtx = expand_expr (startbit, NULL_RTX, MEM,
++ EXPAND_CONST_ADDRESS);
++ endbit_rtx = expand_expr (endbit, NULL_RTX, MEM,
++ EXPAND_CONST_ADDRESS);
++
++ if (REG_P (target))
++ {
++ targetx
++ = assign_temp
++ ((build_qualified_type ((*lang_hooks.types.type_for_mode)
++ (GET_MODE (target), 0),
++ TYPE_QUAL_CONST)),
++ 0, 1, 1);
++ emit_move_insn (targetx, target);
++ }
++
++ else if (GET_CODE (target) == MEM)
++ targetx = target;
++ else
++ abort ();
++
++ /* Optimization: If startbit and endbit are constants divisible
++ by BITS_PER_UNIT, call memset instead. */
++ if (
++ TREE_CODE (startbit) == INTEGER_CST
++ && TREE_CODE (endbit) == INTEGER_CST
++ && (startb = TREE_INT_CST_LOW (startbit)) % BITS_PER_UNIT == 0
++ && (endb = TREE_INT_CST_LOW (endbit) + 1) % BITS_PER_UNIT == 0)
++ {
++ emit_library_call (memset_libfunc, LCT_NORMAL,
++ VOIDmode, 3,
++ plus_constant (XEXP (targetx, 0),
++ startb / BITS_PER_UNIT),
++ Pmode,
++ constm1_rtx, TYPE_MODE (integer_type_node),
++ GEN_INT ((endb - startb) / BITS_PER_UNIT),
++ TYPE_MODE (sizetype));
++ }
++ else
++ emit_library_call (setbits_libfunc, LCT_NORMAL,
++ VOIDmode, 4, XEXP (targetx, 0),
++ Pmode, bitlength_rtx, TYPE_MODE (sizetype),
++ startbit_rtx, TYPE_MODE (sizetype),
++ endbit_rtx, TYPE_MODE (sizetype));
++
++ if (REG_P (target))
++ if (REG_P (target))
++ emit_move_insn (target, targetx);
++ }
++
++ break;
++ }
+
+ default:
+ gcc_unreachable ();
+@@ -5588,9 +5819,19 @@
+ index, then convert to sizetype and multiply by the size of
+ the array element. */
+ if (! integer_zerop (low_bound))
++#ifdef GPC
++ /* I think that address arithmetic should always be done on
++ sizetype or its variants -- for Pascal signed seems to be the
++ correct choice (and generates slightly better code). -- Waldek */
++ index = convert (sizetype, convert (bitsizetype,
++ size_binop (MINUS_EXPR,
++ convert (sbitsizetype, index),
++ convert (sbitsizetype, low_bound))));
++#else
++
+ index = fold_build2 (MINUS_EXPR, TREE_TYPE (index),
+ index, low_bound);
+-
++#endif
+ offset = size_binop (PLUS_EXPR, offset,
+ size_binop (MULT_EXPR,
+ convert (sizetype, index),
+@@ -6687,11 +6928,18 @@
+ /* Variables inherited from containing functions should have
+ been lowered by this point. */
+ context = decl_function_context (exp);
+- gcc_assert (!context
++// gcc_assert
++ if (!context
+ || context == current_function_decl
+ || TREE_STATIC (exp)
+ /* ??? C++ creates functions that are not TREE_STATIC. */
+- || TREE_CODE (exp) == FUNCTION_DECL);
++ || TREE_CODE (exp) == FUNCTION_DECL)
++ ;
++ else
++ {
++ debug_tree (exp);
++ gcc_unreachable ();
++ }
+
+ /* This is the case of an array whose size is to be determined
+ from its initializer, while the initializer is still being parsed.
+@@ -8624,7 +8872,7 @@
+ tree
+ string_constant (tree arg, tree *ptr_offset)
+ {
+- tree array, offset;
++ tree array, offset, lb = size_zero_node;
+ STRIP_NOPS (arg);
+
+ if (TREE_CODE (arg) == ADDR_EXPR)
+@@ -8638,6 +8886,7 @@
+ {
+ array = TREE_OPERAND (arg, 0);
+ offset = size_zero_node;
++ goto do_lb;
+ }
+ else if (TREE_CODE (TREE_OPERAND (arg, 0)) == ARRAY_REF)
+ {
+@@ -8646,6 +8895,7 @@
+ if (TREE_CODE (array) != STRING_CST
+ && TREE_CODE (array) != VAR_DECL)
+ return 0;
++ lb = array_ref_low_bound (TREE_OPERAND (arg, 0));
+ }
+ else
+ return 0;
+@@ -8674,10 +8924,26 @@
+ }
+ else
+ return 0;
++ do_lb:
++ if (TREE_TYPE (array) && TREE_CODE (TREE_TYPE (array)) == ARRAY_TYPE)
++ {
++ tree domain_type = TYPE_DOMAIN (TREE_TYPE (array));
++ if (domain_type && TYPE_MIN_VALUE (domain_type))
++#if 0
++ lb = SUBSTITUTE_PLACEHOLDER_IN_EXPR (
++ TYPE_MIN_VALUE (domain_type), array);
++#else
++ lb = TYPE_MIN_VALUE (domain_type);
++#endif
++ }
+ }
+ else
+ return 0;
+
++ if (! integer_zerop (lb))
++ offset = size_diffop (fold_convert (sizetype, offset),
++ fold_convert (sizetype, lb));
++
+ if (TREE_CODE (array) == STRING_CST)
+ {
+ *ptr_offset = convert (sizetype, offset);
+diff -ru ../gcc-4.1.0.orig/gcc/fold-const.c gcc-4.1.0/gcc/fold-const.c
+--- ../gcc-4.1.0.orig/gcc/fold-const.c 2006-02-03 19:02:04.000000000 +0100
++++ gcc-4.1.0/gcc/fold-const.c 2006-04-04 21:16:16.000000000 +0200
+@@ -5956,6 +5956,10 @@
+ HOST_WIDE_INT hpart;
+ int overflow;
+
++ /* Overflow check does not work for unsigned numbers */
++ if (TYPE_UNSIGNED (TREE_TYPE (arg0)))
++ return NULL_TREE;
++
+ /* We have to do this the hard way to detect unsigned overflow.
+ prod = int_const_binop (MULT_EXPR, arg01, arg1, 0); */
+ overflow = mul_double (TREE_INT_CST_LOW (arg01),
+diff -ru ../gcc-4.1.0.orig/gcc/function.c gcc-4.1.0/gcc/function.c
+--- ../gcc-4.1.0.orig/gcc/function.c 2006-01-04 10:13:56.000000000 +0100
++++ gcc-4.1.0/gcc/function.c 2006-04-04 22:51:00.000000000 +0200
+@@ -3111,7 +3111,11 @@
+ if (TYPE_P (t))
+ {
+ if (POINTER_TYPE_P (t))
++#ifndef GPC
+ *walk_subtrees = 1;
++#else
++ *walk_subtrees = 0;
++#endif
+ else if (TYPE_SIZE (t) && !TREE_CONSTANT (TYPE_SIZE (t))
+ && !TYPE_SIZES_GIMPLIFIED (t))
+ {
+Only in gcc-4.1.0/gcc: function.c~
+diff -ru ../gcc-4.1.0.orig/gcc/gcc.c gcc-4.1.0/gcc/gcc.c
+--- ../gcc-4.1.0.orig/gcc/gcc.c 2006-01-21 19:29:08.000000000 +0100
++++ gcc-4.1.0/gcc/gcc.c 2006-04-04 22:38:05.000000000 +0200
+@@ -794,8 +794,8 @@
+ "%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
+ %1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*}\
+ %{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}%{!c:%{!S:-auxbase %b}}\
+- %{g*} %{O*} %{W*&pedantic*} %{w} %{std*&ansi&trigraphs}\
+- %{v:-version} %{pg:-p} %{p} %{f*} %{undef}\
++ %{g*} %{O*} %{f*&W*&pedantic*&w} %{std*&ansi&trigraphs}\
++ %{v:-version} %{pg:-p} %{p} %{undef}\
+ %{Qn:-fno-ident} %{--help:--help}\
+ %{--target-help:--target-help}\
+ %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+diff -ru ../gcc-4.1.0.orig/gcc/gimplify.c gcc-4.1.0/gcc/gimplify.c
+--- ../gcc-4.1.0.orig/gcc/gimplify.c 2006-02-13 22:29:13.000000000 +0100
++++ gcc-4.1.0/gcc/gimplify.c 2006-04-04 22:38:45.000000000 +0200
+@@ -342,7 +342,7 @@
+
+ /* Create a new temporary name with PREFIX. Returns an identifier. */
+
+-static GTY(()) unsigned int tmp_var_id_num;
++static GTY(()) unsigned int tmp_var_id_num = 155419;
+
+ tree
+ create_tmp_var_name (const char *prefix)
+@@ -2704,15 +2704,35 @@
+ cref = build (ARRAY_REF, array_elt_type, unshare_expr (object),
+ purpose, NULL_TREE, NULL_TREE);
+ }
++#if 0
++ else if (DECL_BIT_FIELD (purpose))
++ {
++ tree bioff = size_binop (PLUS_EXPR,
++ DECL_FIELD_BIT_OFFSET (purpose),
++ size_binop (MULT_EXPR,
++ bitsize_int (BITS_PER_UNIT),
++ convert (bitsizetype, DECL_FIELD_OFFSET (purpose))));
++ cref = build3 (BIT_FIELD_REF, TREE_TYPE (purpose),
++ unshare_expr (object), bioff,
++ DECL_SIZE (purpose));
++ BIT_FIELD_REF_UNSIGNED (cref) = TYPE_UNSIGNED (TREE_TYPE (purpose));
++ }
++#endif
+ else
+ {
+- gcc_assert (TREE_CODE (purpose) == FIELD_DECL);
++// gcc_assert (TREE_CODE (purpose) == FIELD_DECL);
++ if (TREE_CODE (purpose) != FIELD_DECL)
++ {
++ debug_tree (purpose);
++ gcc_unreachable ();
++ }
+ cref = build (COMPONENT_REF, TREE_TYPE (purpose),
+ unshare_expr (object), purpose, NULL_TREE);
+ }
+
+ if (TREE_CODE (value) == CONSTRUCTOR
+- && TREE_CODE (TREE_TYPE (value)) != VECTOR_TYPE)
++ && TREE_CODE (TREE_TYPE (value)) != VECTOR_TYPE
++ && TREE_CODE (TREE_TYPE (value)) != SET_TYPE)
+ gimplify_init_ctor_eval (cref, CONSTRUCTOR_ELTS (value),
+ pre_p, cleared);
+ else
+@@ -2743,6 +2763,10 @@
+ if (TREE_CODE (ctor) != CONSTRUCTOR)
+ return GS_UNHANDLED;
+
++ ret = lang_hooks.gimplify_expr (&TREE_OPERAND (*expr_p, 1), pre_p, post_p);
++ if (ret != GS_UNHANDLED)
++ return ret;
++
+ ret = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
+ is_gimple_lvalue, fb_lvalue);
+ if (ret == GS_ERROR)
+@@ -2784,7 +2808,7 @@
+ DECL_INITIAL (object) = ctor;
+ TREE_STATIC (object) = 1;
+ if (!DECL_NAME (object))
+- DECL_NAME (object) = create_tmp_var_name ("C");
++ DECL_NAME (object) = create_tmp_var_name ("c_C");
+ walk_tree (&DECL_INITIAL (object), force_labels_r, NULL, NULL);
+
+ /* ??? C++ doesn't automatically append a . to the
+@@ -2857,7 +2881,7 @@
+
+ if (size > 0 && !can_move_by_pieces (size, align))
+ {
+- tree new = create_tmp_var_raw (type, "C");
++ tree new = create_tmp_var_raw (type, "r_C");
+
+ gimple_add_tmp_var (new);
+ TREE_STATIC (new) = 1;
+@@ -4507,6 +4531,10 @@
+ goto dont_recalculate;
+
+ default:
++ if (!(TREE_CODE (*expr_p) == TRUTH_AND_EXPR
++ || TREE_CODE (*expr_p) == TRUTH_OR_EXPR
++ || TREE_CODE (*expr_p) == TRUTH_XOR_EXPR))
++ debug_tree (*expr_p);
+ gcc_assert (TREE_CODE (*expr_p) == TRUTH_AND_EXPR
+ || TREE_CODE (*expr_p) == TRUTH_OR_EXPR
+ || TREE_CODE (*expr_p) == TRUTH_XOR_EXPR);
+@@ -4692,6 +4720,10 @@
+ return ret;
+ }
+
++extern void (*lang_remember_gimplified_type)(tree);
++
++void (*lang_remember_gimplified_type)(tree) = 0;
++
+ /* Look through TYPE for variable-sized objects and gimplify each such
+ size that we find. Add to LIST_P any statements generated. */
+
+@@ -4712,6 +4744,12 @@
+
+ TYPE_SIZES_GIMPLIFIED (type) = 1;
+
++ if (lang_remember_gimplified_type)
++ lang_remember_gimplified_type (type);
++
++ gimplify_one_sizepos (&TYPE_SIZE (type), list_p);
++ gimplify_one_sizepos (&TYPE_SIZE_UNIT (type), list_p);
++
+ switch (TREE_CODE (type))
+ {
+ case INTEGER_TYPE:
+@@ -4742,12 +4780,16 @@
+ if (TREE_CODE (field) == FIELD_DECL)
+ {
+ gimplify_one_sizepos (&DECL_FIELD_OFFSET (field), list_p);
+- gimplify_type_sizes (TREE_TYPE (field), list_p);
+ }
++ for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
++ if (TREE_CODE (field) == FIELD_DECL)
++ gimplify_type_sizes (TREE_TYPE (field), list_p);
+ break;
+
+ case POINTER_TYPE:
+ case REFERENCE_TYPE:
++ break;
++
+ gimplify_type_sizes (TREE_TYPE (type), list_p);
+ break;
+
+@@ -4755,9 +4797,6 @@
+ break;
+ }
+
+- gimplify_one_sizepos (&TYPE_SIZE (type), list_p);
+- gimplify_one_sizepos (&TYPE_SIZE_UNIT (type), list_p);
+-
+ for (t = TYPE_NEXT_VARIANT (type); t; t = TYPE_NEXT_VARIANT (t))
+ {
+ TYPE_SIZE (t) = TYPE_SIZE (type);
+@@ -4766,6 +4805,11 @@
+ }
+ }
+
++
++extern void (*lang_remember_gimplified_sizepos)(tree *);
++
++void (*lang_remember_gimplified_sizepos)(tree *) = 0;
++
+ /* A subroutine of gimplify_type_sizes to make sure that *EXPR_P,
+ a size or position, has had all of its SAVE_EXPRs evaluated.
+ We add any required statements to STMT_P. */
+@@ -4775,6 +4819,12 @@
+ {
+ tree type, expr = *expr_p;
+
++ if (expr == NULL_TREE || TREE_CODE (expr) == INTEGER_CST)
++ return;
++
++ if (lang_remember_gimplified_sizepos)
++ lang_remember_gimplified_sizepos(expr_p);
++
+ /* We don't do anything if the value isn't there, is constant, or contains
+ A PLACEHOLDER_EXPR. We also don't want to do anything if it's already
+ a VAR_DECL. If it's a VAR_DECL from another function, the gimplifier
+@@ -4878,9 +4928,18 @@
+ a pointer to the array type. We must allow this in order to
+ properly represent assigning the address of an array in C into
+ pointer to the element type. */
++/*
+ gcc_assert (TREE_CODE (otype) == ARRAY_TYPE
+ && POINTER_TYPE_P (ptype)
+ && cpt_same_type (TREE_TYPE (otype), dtype));
++*/
++ if (!(TREE_CODE (otype) == ARRAY_TYPE
++ && POINTER_TYPE_P (ptype)
++ && cpt_same_type (TREE_TYPE (otype), dtype)))
++ {
++ debug_tree (t);
++ gcc_unreachable ();
++ }
+ break;
+ }
+ break;
+diff -ru ../gcc-4.1.0.orig/gcc/ipa-type-escape.c gcc-4.1.0/gcc/ipa-type-escape.c
+--- ../gcc-4.1.0.orig/gcc/ipa-type-escape.c 2005-09-25 07:28:01.000000000 +0200
++++ gcc-4.1.0/gcc/ipa-type-escape.c 2006-04-04 21:16:16.000000000 +0200
+@@ -260,9 +260,23 @@
+ type_to_consider (tree type)
+ {
+ /* Strip the *'s off. */
++ tree otype = type;
++ long cnt = 0;
++ long ocnt = 0;
+ type = TYPE_MAIN_VARIANT (type);
+ while (POINTER_TYPE_P (type) || TREE_CODE (type) == ARRAY_TYPE)
+- type = TYPE_MAIN_VARIANT (TREE_TYPE (type));
++ {
++ type = TYPE_MAIN_VARIANT (TREE_TYPE (type));
++ if (type == otype)
++ return false;
++ if (cnt > ocnt)
++ {
++ ocnt += cnt;
++ otype = type;
++ }
++ else
++ cnt ++;
++ }
+
+ switch (TREE_CODE (type))
+ {
+Only in gcc-4.1.0/gcc: p
+diff -ru ../gcc-4.1.0.orig/gcc/print-tree.c gcc-4.1.0/gcc/print-tree.c
+--- ../gcc-4.1.0.orig/gcc/print-tree.c 2005-10-13 01:34:09.000000000 +0200
++++ gcc-4.1.0/gcc/print-tree.c 2006-04-04 21:16:16.000000000 +0200
+@@ -580,7 +580,7 @@
+
+ if (TREE_CODE (node) == ENUMERAL_TYPE)
+ print_node (file, "values", TYPE_VALUES (node), indent + 4);
+- else if (TREE_CODE (node) == ARRAY_TYPE)
++ else if (TREE_CODE (node) == ARRAY_TYPE || TREE_CODE (node) == SET_TYPE)
+ print_node (file, "domain", TYPE_DOMAIN (node), indent + 4);
+ else if (TREE_CODE (node) == VECTOR_TYPE)
+ fprintf (file, " nunits %d", (int) TYPE_VECTOR_SUBPARTS (node));
+diff -ru ../gcc-4.1.0.orig/gcc/reload1.c gcc-4.1.0/gcc/reload1.c
+--- ../gcc-4.1.0.orig/gcc/reload1.c 2006-02-24 02:18:27.000000000 +0100
++++ gcc-4.1.0/gcc/reload1.c 2006-04-04 21:16:16.000000000 +0200
+@@ -1252,7 +1252,10 @@
+ reg_equiv_memory_loc = 0;
+
+ if (offsets_known_at)
+- free (offsets_known_at);
++ {
++// free (offsets_known_at);
++ offsets_known_at = 0;
++ }
+ if (offsets_at)
+ free (offsets_at);
+
+diff -ru ../gcc-4.1.0.orig/gcc/stor-layout.c gcc-4.1.0/gcc/stor-layout.c
+--- ../gcc-4.1.0.orig/gcc/stor-layout.c 2006-02-14 17:12:56.000000000 +0100
++++ gcc-4.1.0/gcc/stor-layout.c 2006-04-04 21:17:03.000000000 +0200
+@@ -19,6 +19,7 @@
+ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA. */
+
++/* @@ PATCHED FOR GPC 20060322 @@ */
+
+ #include "config.h"
+ #include "system.h"
+@@ -53,6 +54,21 @@
+ called only by a front end. */
+ static int reference_types_internal = 0;
+
++/* If nonzero, the alignment of a bitstring or (power-)set value, in bits.
++ May be overridden by front-ends. */
++unsigned int set_alignment = 0;
++
++/* The word size of a bitstring or (power-)set value, in bits.
++ Must be non-zero.
++ May be overridden by front-ends. */
++unsigned int set_word_size = BITS_PER_UNIT;
++
++/* If non-zero, bits in (power-)sets start with the highest bit.
++ May be overridden by front-ends.
++ In order to be backward-compatible, the Chill frontend should
++ initialize this to BYTES_BIG_ENDIAN. */
++unsigned int set_words_big_endian = 0;
++
+ static void finalize_record_size (record_layout_info);
+ static void finalize_type_size (tree);
+ static void place_union_field (record_layout_info, tree);
+@@ -1881,6 +1897,50 @@
+ }
+ break;
+
++ case SET_TYPE: /* Used by Chill and Pascal. */
++ if (TREE_CODE (TYPE_MAX_VALUE (TYPE_DOMAIN (type))) != INTEGER_CST
++ || TREE_CODE (TYPE_MIN_VALUE (TYPE_DOMAIN (type))) != INTEGER_CST)
++ abort ();
++ else
++ {
++ int alignment = set_alignment ? set_alignment : set_word_size;
++ tree lower_bound = convert (sbitsizetype,
++ TYPE_MIN_VALUE (TYPE_DOMAIN (type)));
++ tree upper_bound = convert (sbitsizetype,
++ TYPE_MAX_VALUE (TYPE_DOMAIN (type)));
++ tree size_in_bits, rounded_size;
++ if (set_alignment)
++ {
++ lower_bound = round_down (lower_bound, alignment);
++ }
++ size_in_bits = size_binop (PLUS_EXPR,
++ size_binop (MINUS_EXPR,
++ upper_bound,
++ lower_bound),
++ sbitsize_int(1));
++ rounded_size = round_up (size_in_bits, alignment);
++
++ if ( TREE_INT_CST_HIGH (rounded_size)
++ || TREE_INT_CST_LOW (rounded_size) > (unsigned) alignment)
++ {
++ TYPE_MODE (type) = BLKmode;
++ }
++ else
++ {
++ TYPE_MODE (type) = mode_for_size (alignment, MODE_INT, 1);
++ }
++
++ TYPE_SIZE (type) = convert (bitsizetype, rounded_size);
++ TYPE_SIZE_UNIT (type) = convert (sizetype,
++ size_binop ( CEIL_DIV_EXPR,
++ rounded_size,
++ sbitsize_int (BITS_PER_UNIT)));
++ TYPE_ALIGN (type) = alignment;
++ TYPE_USER_ALIGN (type) = 0;
++ TYPE_PRECISION (type) = TREE_INT_CST_LOW (size_in_bits);
++ }
++ break;
++
+ default:
+ gcc_unreachable ();
+ }
+@@ -1977,9 +2037,9 @@
+ t = build_distinct_type_copy (type);
+ /* We do want to use sizetype's cache, as we will be replacing that
+ type. */
+- TYPE_CACHED_VALUES (t) = TYPE_CACHED_VALUES (sizetype);
+- TYPE_CACHED_VALUES_P (t) = TYPE_CACHED_VALUES_P (sizetype);
+- TREE_TYPE (TYPE_CACHED_VALUES (t)) = type;
++ TYPE_CACHED_VALUES (t) = NULL_TREE /* TYPE_CACHED_VALUES (sizetype) */;
++ TYPE_CACHED_VALUES_P (t) = 0 ; /* TYPE_CACHED_VALUES_P (sizetype);
++ TREE_TYPE (TYPE_CACHED_VALUES (t)) = type; */
+ TYPE_UID (t) = TYPE_UID (sizetype);
+ TYPE_IS_SIZETYPE (t) = 1;
+
+@@ -1991,8 +2051,8 @@
+ TYPE_NAME (t) = get_identifier ("bit_size_type");
+ /* We do want to use bitsizetype's cache, as we will be replacing that
+ type. */
+- TYPE_CACHED_VALUES (t) = TYPE_CACHED_VALUES (bitsizetype);
+- TYPE_CACHED_VALUES_P (t) = TYPE_CACHED_VALUES_P (bitsizetype);
++ TYPE_CACHED_VALUES (t) = NULL_TREE /* TYPE_CACHED_VALUES (bitsizetype) */;
++ TYPE_CACHED_VALUES_P (t) = 0 /* TYPE_CACHED_VALUES_P (bitsizetype) */;
+ TYPE_PRECISION (t) = precision;
+ TYPE_UID (t) = TYPE_UID (bitsizetype);
+ TYPE_IS_SIZETYPE (t) = 1;
+Only in gcc-4.1.0/gcc: stor-layout.c~
+diff -ru ../gcc-4.1.0.orig/gcc/toplev.c gcc-4.1.0/gcc/toplev.c
+--- ../gcc-4.1.0.orig/gcc/toplev.c 2006-02-04 23:13:20.000000000 +0100
++++ gcc-4.1.0/gcc/toplev.c 2006-04-09 17:33:48.000000000 +0200
+@@ -803,9 +803,13 @@
+ /* A subroutine of check_global_declarations. Issue appropriate warnings
+ for the global declaration DECL. */
+
++volatile int dump_global_decl_trees = 0;
+ void
+ check_global_declaration_1 (tree decl)
+ {
++ if (dump_global_decl_trees)
++ debug_tree (decl);
++
+ /* Warn about any function declared static but not defined. We don't
+ warn about variables, because many programs have static variables
+ that exist only to get some text into the object file. */
+@@ -1110,6 +1114,27 @@
+ void
+ print_version (FILE *file, const char *indent)
+ {
++#ifdef GPC
++ extern const char *lang_version_string;
++ static const char fmt1[] =
++#ifdef __GNUC__
++ N_("%s%s%s version %s%s (%s)\n%s\tcompiled by GNU C version %s.\n")
++#else
++ N_("%s%s%s version %s%s (%s) compiled by CC.\n")
++#endif
++ ;
++ static const char fmt2[] =
++ N_("%s%sGGC heuristics: --param ggc-min-expand=%d --param ggc-min-heapsize=%d\n");
++#ifndef __VERSION__
++#define __VERSION__ "[?]"
++#endif
++
++ fprintf (file,
++ file == stderr ? _(fmt1) : fmt1,
++ indent, *indent != 0 ? " " : "",
++ lang_hooks.name, lang_version_string, version_string, TARGET_NAME,
++ indent, __VERSION__);
++#else
+ static const char fmt1[] =
+ #ifdef __GNUC__
+ N_("%s%s%s version %s (%s)\n%s\tcompiled by GNU C version %s.\n")
+@@ -1122,11 +1147,13 @@
+ #ifndef __VERSION__
+ #define __VERSION__ "[?]"
+ #endif
++
+ fprintf (file,
+ file == stderr ? _(fmt1) : fmt1,
+ indent, *indent != 0 ? " " : "",
+ lang_hooks.name, version_string, TARGET_NAME,
+ indent, __VERSION__);
++#endif
+ fprintf (file,
+ file == stderr ? _(fmt2) : fmt2,
+ indent, *indent != 0 ? " " : "",
+Only in gcc-4.1.0/gcc: toplev.c~
+diff -ru ../gcc-4.1.0.orig/gcc/tree-cfg.c gcc-4.1.0/gcc/tree-cfg.c
+--- ../gcc-4.1.0.orig/gcc/tree-cfg.c 2006-02-16 16:23:24.000000000 +0100
++++ gcc-4.1.0/gcc/tree-cfg.c 2006-04-04 21:16:16.000000000 +0200
+@@ -3642,10 +3642,17 @@
+ if (decl_function_context (LABEL_EXPR_LABEL (stmt))
+ != current_function_decl)
+ {
+- error ("label %s has incorrect context in bb %d",
+- IDENTIFIER_POINTER (DECL_NAME (LABEL_EXPR_LABEL (stmt))),
+- bb->index);
+- err = 1;
++ tree ldecl = DECL_NAME (LABEL_EXPR_LABEL (stmt));
++ const char * ln = ldecl ? IDENTIFIER_POINTER (ldecl): "????";
++#if 0
++ error ("label %s has incorrect context in bb %d\n",
++ IDENTIFIER_POINTER (DECL_NAME (LABEL_EXPR_LABEL (stmt))),
++ bb->index);
++#else
++ error ("label %s has incorrect context in bb %d\n", ln,
++ bb->index);
++#endif
++ err = 1;
+ }
+ }
+
+diff -ru ../gcc-4.1.0.orig/gcc/tree-flow-inline.h gcc-4.1.0/gcc/tree-flow-inline.h
+--- ../gcc-4.1.0.orig/gcc/tree-flow-inline.h 2006-02-09 15:00:59.000000000 +0100
++++ gcc-4.1.0/gcc/tree-flow-inline.h 2006-04-04 21:55:58.000000000 +0200
+@@ -1492,7 +1492,8 @@
+ return false;
+
+ return (AGGREGATE_TYPE_P (TREE_TYPE (v)) &&
+- TREE_CODE (TREE_TYPE (v)) != ARRAY_TYPE);
++ TREE_CODE (TREE_TYPE (v)) != ARRAY_TYPE
++ && TREE_CODE (TREE_TYPE (v)) != SET_TYPE);
+ }
+
+
+Only in gcc-4.1.0/gcc: tree-flow-inline.h~
+diff -ru ../gcc-4.1.0.orig/gcc/tree-nested.c gcc-4.1.0/gcc/tree-nested.c
+--- ../gcc-4.1.0.orig/gcc/tree-nested.c 2005-10-03 22:57:45.000000000 +0200
++++ gcc-4.1.0/gcc/tree-nested.c 2006-04-04 21:16:16.000000000 +0200
+@@ -1170,6 +1170,8 @@
+ if (!elt)
+ return NULL_TREE;
+ new_label = elt->new;
++ DECL_CONTEXT (new_label) = DECL_CONTEXT (label);
++// mark_decl_referenced (new_label);
+
+ /* If there's any possibility that the previous statement falls through,
+ then we must branch around the new non-local label. */
+diff -ru ../gcc-4.1.0.orig/gcc/tree-sra.c gcc-4.1.0/gcc/tree-sra.c
+--- ../gcc-4.1.0.orig/gcc/tree-sra.c 2005-11-21 01:55:57.000000000 +0100
++++ gcc-4.1.0/gcc/tree-sra.c 2006-04-04 21:16:16.000000000 +0200
+@@ -1368,6 +1368,9 @@
+ && (!can_completely_scalarize_p (elt)
+ || !type_can_instantiate_all_elements (elt->type)))
+ use_block_copy = true;
++ if (TREE_TYPE (elt->type)
++ && full_size != full_count*TYPE_PRECISION (TREE_TYPE (elt->type)))
++ use_block_copy = true;
+ }
+ elt->use_block_copy = use_block_copy;
+
+diff -ru ../gcc-4.1.0.orig/gcc/tree-ssa-dom.c gcc-4.1.0/gcc/tree-ssa-dom.c
+--- ../gcc-4.1.0.orig/gcc/tree-ssa-dom.c 2005-11-18 14:32:05.000000000 +0100
++++ gcc-4.1.0/gcc/tree-ssa-dom.c 2006-04-04 21:16:16.000000000 +0200
+@@ -2802,12 +2802,26 @@
+ val_type = TREE_TYPE (val);
+
+ /* While both types are pointers, get the type of the object
+- pointed to. */
+- while (POINTER_TYPE_P (op_type) && POINTER_TYPE_P (val_type))
+- {
+- op_type = TREE_TYPE (op_type);
+- val_type = TREE_TYPE (val_type);
+- }
++ pointed to. Do not get trapped in cycles. */
++ {
++ long cnt = 0, maxcnt = 11;
++ tree op_type0 = op_type;
++ while (POINTER_TYPE_P (op_type) && POINTER_TYPE_P (val_type))
++ {
++ op_type = TREE_TYPE (op_type);
++ val_type = TREE_TYPE (val_type);
++ if (op_type == op_type0)
++ return false;
++ cnt ++;
++ if (cnt > maxcnt)
++ {
++ op_type0 = op_type;
++ maxcnt += maxcnt;
++ if (maxcnt < 0)
++ return false;
++ }
++ }
++ }
+
+ /* Make sure underlying types match before propagating a constant by
+ converting the constant to the proper type. Note that convert may
+diff -ru ../gcc-4.1.0.orig/gcc/tree.c gcc-4.1.0/gcc/tree.c
+--- ../gcc-4.1.0.orig/gcc/tree.c 2006-01-29 23:24:10.000000000 +0100
++++ gcc-4.1.0/gcc/tree.c 2006-04-04 21:16:16.000000000 +0200
+@@ -801,9 +801,16 @@
+ if (t)
+ {
+ /* Make sure no one is clobbering the shared constant. */
++ if (!(TREE_TYPE (t) == type))
++ debug_tree (t);
+ gcc_assert (TREE_TYPE (t) == type);
++ if (!(TREE_INT_CST_LOW (t) == low))
++ debug_tree (t);
+ gcc_assert (TREE_INT_CST_LOW (t) == low);
++ if (!(TREE_INT_CST_HIGH (t) == hi))
++ debug_tree (t);
+ gcc_assert (TREE_INT_CST_HIGH (t) == hi);
++
+ }
+ else
+ {
+@@ -2132,6 +2139,7 @@
+ || CONTAINS_PLACEHOLDER_P (TYPE_MAX_VALUE (type)));
+
+ case ARRAY_TYPE:
++ case SET_TYPE:
+ /* We're already checked the component type (TREE_TYPE), so just check
+ the index type. */
+ return type_contains_placeholder_p (TYPE_DOMAIN (type));
+@@ -3143,7 +3151,8 @@
+ if (EXPR_LOCUS (node)
+ && EXPR_LINENO (node) == line
+ && (EXPR_FILENAME (node) == file
+- || !strcmp (EXPR_FILENAME (node), file)))
++ || (EXPR_FILENAME (node) && file
++ && ! strcmp (EXPR_FILENAME (node), file))))
+ {
+ last_annotated_node = EXPR_LOCUS (node);
+ return;
+@@ -3155,7 +3164,8 @@
+ if (last_annotated_node
+ && last_annotated_node->line == line
+ && (last_annotated_node->file == file
+- || !strcmp (last_annotated_node->file, file)))
++ || (last_annotated_node->file && file
++ && ! strcmp (last_annotated_node->file, file))))
+ {
+ SET_EXPR_LOCUS (node, last_annotated_node);
+ return;
+@@ -4996,6 +5006,7 @@
+ TYPE_SIZE_UNIT (itype) = TYPE_SIZE_UNIT (type);
+ TYPE_ALIGN (itype) = TYPE_ALIGN (type);
+ TYPE_USER_ALIGN (itype) = TYPE_USER_ALIGN (type);
++ TYPE_UNSIGNED (itype) = TYPE_UNSIGNED (type);
+
+ if (host_integerp (lowval, 0) && highval != 0 && host_integerp (highval, 0))
+ return type_hash_canon (tree_low_cst (highval, 0)
+@@ -5957,6 +5968,137 @@
+ return get_file_function_name_long (p);
+ }
+
++/* Expand (the constant part of) a SET_TYPE CONSTRUCTOR node.
++ The result is placed in BUFFER (which has length BIT_SIZE),
++ with one bit in each char ('\000' or '\001').
++
++ If the constructor is constant, NULL_TREE is returned.
++ Otherwise, a TREE_LIST of the non-constant elements is emitted. */
++
++tree
++get_set_constructor_bits (tree init, char *buffer, int bit_size)
++{
++ int i;
++ tree vals;
++ HOST_WIDE_INT domain_min
++ = tree_low_cst (TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (init))), 0);
++ HOST_WIDE_INT low_limit = domain_min;
++ tree non_const_bits = NULL_TREE;
++
++ if (set_alignment)
++ /* Note: `domain_min -= domain_min % set_alignment' would be wrong for negative
++ numbers (rounding towards 0, while we have to round towards -inf). */
++ domain_min &= -(int) set_alignment;
++
++ low_limit -= domain_min;
++
++ for (i = 0; i < bit_size; i++)
++ buffer[i] = 0;
++
++ for (vals = TREE_OPERAND (init, 0) /* CONSTRUCTOR_ELTS (init) */;
++ vals != NULL_TREE; vals = TREE_CHAIN (vals))
++ {
++ if (!host_integerp (TREE_VALUE (vals), 0)
++ || (TREE_PURPOSE (vals) != NULL_TREE
++ && !host_integerp (TREE_PURPOSE (vals), 0)))
++ non_const_bits
++ = tree_cons (TREE_PURPOSE (vals), TREE_VALUE (vals), non_const_bits);
++ else if (TREE_PURPOSE (vals) != NULL_TREE)
++ {
++ /* Set a range of bits to ones. */
++ HOST_WIDE_INT lo_index
++ = tree_low_cst (TREE_PURPOSE (vals), 0) - domain_min;
++ HOST_WIDE_INT hi_index
++ = tree_low_cst (TREE_VALUE (vals), 0) - domain_min;
++
++ if (lo_index < low_limit || hi_index >= bit_size)
++ {
++ error ("invalid initializer for set");
++ return NULL_TREE;
++ }
++
++ gcc_assert (lo_index >= 0);
++ gcc_assert (lo_index < bit_size);
++ gcc_assert (hi_index >= 0);
++ gcc_assert (hi_index < bit_size);
++ for (; lo_index <= hi_index; lo_index++)
++ buffer[lo_index] = 1;
++ }
++ else
++ {
++ /* Set a single bit to one. */
++ HOST_WIDE_INT index
++ = tree_low_cst (TREE_VALUE (vals), 0) - domain_min;
++ if (index < 0 || index >= bit_size)
++ {
++ error ("invalid initializer for set");
++ return NULL_TREE;
++ }
++ buffer[index] = 1;
++ }
++ }
++ return non_const_bits;
++}
++
++/* Expand (the constant part of) a SET_TYPE CONSTRUCTOR node.
++ The result is placed in BUFFER (which is an array of bytes).
++ If the constructor is constant, NULL_TREE is returned.
++ Otherwise, a TREE_LIST of the non-constant elements is emitted. */
++
++tree
++get_set_constructor_bytes (tree init, unsigned char *buffer, int wd_size)
++{
++ int i;
++#ifdef GPC
++ int bit_size = wd_size * BITS_PER_UNIT;
++ unsigned int bit_pos = 0;
++#else /* not GPC */
++ int set_word_size = BITS_PER_UNIT;
++ int bit_size = wd_size * set_word_size;
++ int bit_pos = 0;
++#endif /* not GPC */
++ unsigned char *bytep = buffer;
++ char *bit_buffer = alloca (bit_size);
++ tree non_const_bits = get_set_constructor_bits (init, bit_buffer, bit_size);
++
++ for (i = 0; i < wd_size; i++)
++ buffer[i] = 0;
++
++ for (i = 0; i < bit_size; i++)
++ {
++#ifdef GPC
++ if (bit_buffer[i])
++ {
++ int k = bit_pos / BITS_PER_UNIT;
++ if (WORDS_BIG_ENDIAN)
++ k = set_word_size / BITS_PER_UNIT - 1 - k;
++ if (set_words_big_endian)
++ bytep[k] |= (1 << (BITS_PER_UNIT - 1 - bit_pos % BITS_PER_UNIT));
++ else
++ bytep[k] |= (1 << (bit_pos % BITS_PER_UNIT));
++ }
++ bit_pos++;
++ if (bit_pos >= set_word_size)
++ {
++ bit_pos = 0;
++ bytep += set_word_size / BITS_PER_UNIT;
++ }
++#else /* not GPC */
++ if (bit_buffer[i])
++ {
++ if (BYTES_BIG_ENDIAN)
++ *bytep |= (1 << (set_word_size - 1 - bit_pos));
++ else
++ *bytep |= 1 << bit_pos;
++ }
++ bit_pos++;
++ if (bit_pos >= set_word_size)
++ bit_pos = 0, bytep++;
++#endif
++ }
++ return non_const_bits;
++}
++
+ #if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
+
+ /* Complain that the tree code of NODE does not match the expected 0
+@@ -6627,6 +6769,15 @@
+ {
+ unsigned HOST_WIDE_INT idx;
+
++#if 0
++ /* Set is empty if it has no elements. */
++ if (TREE_CODE (TREE_TYPE (init)) == SET_TYPE && elt)
++ return false;
++#else
++ if (TREE_CODE (TREE_TYPE (init)) == SET_TYPE)
++ gcc_unreachable ();
++#endif
++
+ FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (init), idx, elt)
+ if (!initializer_zerop (elt))
+ return false;
+diff -ru ../gcc-4.1.0.orig/gcc/tree.def gcc-4.1.0/gcc/tree.def
+--- ../gcc-4.1.0.orig/gcc/tree.def 2006-02-10 18:32:10.000000000 +0100
++++ gcc-4.1.0/gcc/tree.def 2006-04-04 21:16:16.000000000 +0200
+@@ -254,6 +254,12 @@
+ includes the hidden argument for "self". */
+ DEFTREECODE (METHOD_TYPE, "method_type", tcc_type, 0)
+
++/* Types of sets for Pascal. Special fields are the same as
++ in an array type. The target type is always a boolean type.
++ Used for both bitstrings and powersets in Chill;
++ TYPE_STRING_FLAG indicates a bitstring. */
++DEFTREECODE (SET_TYPE, "set_type", tcc_type, 0)
++
+ /* This is a language-specific kind of type.
+ Its meaning is defined by the language front end.
+ layout_type does not know how to lay this out,
+diff -ru ../gcc-4.1.0.orig/gcc/tree.h gcc-4.1.0/gcc/tree.h
+--- ../gcc-4.1.0.orig/gcc/tree.h 2006-02-14 15:36:15.000000000 +0100
++++ gcc-4.1.0/gcc/tree.h 2006-04-04 21:16:31.000000000 +0200
+@@ -704,6 +704,9 @@
+ #define NOT_RECORD_OR_UNION_CHECK(T) \
+ TREE_NOT_CHECK3 (T, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE)
+
++#define ARRAY_OR_SET_CHECK(T) \
++ TREE_CHECK2 (T, ARRAY_TYPE, SET_TYPE)
++
+ #define NUMERICAL_TYPE_CHECK(T) \
+ TREE_CHECK5 (T, INTEGER_TYPE, ENUMERAL_TYPE, BOOLEAN_TYPE, \
+ CHAR_TYPE, REAL_TYPE)
+@@ -817,7 +820,8 @@
+
+ #define AGGREGATE_TYPE_P(TYPE) \
+ (TREE_CODE (TYPE) == ARRAY_TYPE || TREE_CODE (TYPE) == RECORD_TYPE \
+- || TREE_CODE (TYPE) == UNION_TYPE || TREE_CODE (TYPE) == QUAL_UNION_TYPE)
++ || TREE_CODE (TYPE) == UNION_TYPE || TREE_CODE (TYPE) == QUAL_UNION_TYPE \
++ || TREE_CODE (TYPE) == SET_TYPE)
+
+ /* Nonzero if TYPE represents a pointer or reference type.
+ (It should be renamed to INDIRECT_TYPE_P.) Keep these checks in
+@@ -1618,7 +1622,7 @@
+ #define TYPE_SIZE_UNIT(NODE) (TYPE_CHECK (NODE)->type.size_unit)
+ #define TYPE_MODE(NODE) (TYPE_CHECK (NODE)->type.mode)
+ #define TYPE_VALUES(NODE) (ENUMERAL_TYPE_CHECK (NODE)->type.values)
+-#define TYPE_DOMAIN(NODE) (ARRAY_TYPE_CHECK (NODE)->type.values)
++#define TYPE_DOMAIN(NODE) (ARRAY_OR_SET_CHECK (NODE)->type.values)
+ #define TYPE_FIELDS(NODE) (RECORD_OR_UNION_CHECK (NODE)->type.values)
+ #define TYPE_CACHED_VALUES(NODE) (TYPE_CHECK(NODE)->type.values)
+ #define TYPE_ORIG_SIZE_TYPE(NODE) \
+@@ -3535,6 +3539,15 @@
+ /* and its original value in bytes, specified via -fpack-struct=. */
+ extern unsigned int initial_max_fld_align;
+
++/* If nonzero, the alignment of a bitstring or (power-)set value, in bits. */
++extern unsigned int set_alignment;
++
++/* The word size of a bitstring or (power-)set value, in bits. */
++extern unsigned int set_word_size;
++
++/* If non-zero, bits in (power-)sets start with the highest bit. */
++extern unsigned int set_words_big_endian;
++
+ /* Concatenate two lists (chains of TREE_LIST nodes) X and Y
+ by making the last node in X point to Y.
+ Returns X, except if X is 0 returns Y. */
+Only in gcc-4.1.0/gcc: tree.h.orig
+diff -ru ../gcc-4.1.0.orig/gcc/varasm.c gcc-4.1.0/gcc/varasm.c
+--- ../gcc-4.1.0.orig/gcc/varasm.c 2005-12-24 09:56:10.000000000 +0100
++++ gcc-4.1.0/gcc/varasm.c 2006-04-04 21:16:16.000000000 +0200
+@@ -2446,6 +2446,18 @@
+ + const_hash_1 (TREE_IMAGPART (exp)));
+
+ case CONSTRUCTOR:
++ if (TREE_CODE (TREE_TYPE (exp)) == SET_TYPE)
++ {
++ char *tmp;
++
++ len = int_size_in_bytes (TREE_TYPE (exp));
++ tmp = alloca (len);
++ gcc_unreachable ();
++ get_set_constructor_bytes (exp, (unsigned char *) tmp, len);
++ p = tmp;
++ break;
++ }
++ else
+ {
+ unsigned HOST_WIDE_INT idx;
+ tree value;
+@@ -2571,6 +2583,30 @@
+ typecode = TREE_CODE (TREE_TYPE (t1));
+ if (typecode != TREE_CODE (TREE_TYPE (t2)))
+ return 0;
++ if (typecode == SET_TYPE)
++ {
++ int len = int_size_in_bytes (TREE_TYPE (t2));
++ unsigned char *tmp1, *tmp2;
++
++ if (TYPE_MAIN_VARIANT (TREE_TYPE (t1)) !=
++ TYPE_MAIN_VARIANT (TREE_TYPE (t2)))
++ return 0;
++
++ if (int_size_in_bytes (TREE_TYPE (t1)) != len)
++ return 0;
++
++ tmp1 = alloca (len);
++ tmp2 = alloca (len);
++
++ gcc_unreachable ();
++ if (get_set_constructor_bytes (t1, tmp1, len) != NULL_TREE)
++ return 0;
++ if (get_set_constructor_bytes (t2, tmp2, len) != NULL_TREE)
++ return 0;
++
++ return memcmp (tmp1, tmp2, len) == 0;
++ }
++
+
+ if (typecode == ARRAY_TYPE)
+ {
+@@ -2703,6 +2739,24 @@
+ VEC(constructor_elt, gc) *v;
+ unsigned HOST_WIDE_INT idx;
+ tree purpose, value;
++
++#if 0
++ tree list = copy_list (CONSTRUCTOR_ELTS (exp));
++ tree tail;
++
++ CONSTRUCTOR_ELTS (copy) = list;
++ for (tail = list; tail; tail = TREE_CHAIN (tail))
++ TREE_VALUE (tail) = copy_constant (TREE_VALUE (tail));
++
++ if (TREE_CODE (TREE_TYPE (exp)) == SET_TYPE)
++ for (tail = list; tail; tail = TREE_CHAIN (tail))
++ TREE_PURPOSE (tail) = copy_constant (TREE_PURPOSE (tail));
++
++ return copy;
++#else
++ if (TREE_CODE (TREE_TYPE (exp)) == SET_TYPE)
++ gcc_unreachable ();
++#endif
+
+ v = VEC_alloc(constructor_elt, gc, VEC_length(constructor_elt,
+ CONSTRUCTOR_ELTS (exp)));
+@@ -3743,7 +3797,12 @@
+ /* Allow conversions to struct or union types if the value
+ inside is okay. */
+ if (TREE_CODE (dest_type) == RECORD_TYPE
+- || TREE_CODE (dest_type) == UNION_TYPE)
++ || TREE_CODE (dest_type) == UNION_TYPE
++#ifdef GPC
++ || TREE_CODE (TREE_TYPE (value)) == ARRAY_TYPE
++#endif
++ )
++
+ return initializer_constant_valid_p (src, endtype);
+ }
+ break;
+@@ -4032,6 +4091,23 @@
+ output_constructor (exp, size, align);
+ return;
+
++ case SET_TYPE:
++ if (TREE_CODE (exp) == INTEGER_CST)
++ assemble_integer (expand_expr (exp, NULL_RTX,
++ VOIDmode, EXPAND_INITIALIZER),
++ thissize, align, 1);
++ else if (TREE_CODE (exp) == CONSTRUCTOR)
++ {
++ unsigned char *buffer = alloca (thissize);
++ gcc_unreachable ();
++ if (get_set_constructor_bytes (exp, buffer, thissize))
++ abort ();
++ assemble_string ((char *) buffer, thissize);
++ }
++ else
++ error ("unknown set constructor type");
++ return;
++
+ case ERROR_MARK:
+ return;
+
--- gcc-4.1-4.1.1.orig/debian/patches/libjava-backport.dpatch
+++ gcc-4.1-4.1.1/debian/patches/libjava-backport.dpatch
@@ -0,0 +1,816692 @@
+#! /bin/sh -e
+
+# DP: gcc/java / libjava backport / classpath-0.92
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+ dir="$3/"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch)
+ patch $pdir -f --no-backup-if-mismatch -p1 < $0
+ #cd ${dir}gcc && autoconf
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p1 < $0
+ #rm ${dir}gcc/configure
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+
+diff -urN old/boehm-gc/aclocal.m4 src/boehm-gc/aclocal.m4
+--- old/boehm-gc/aclocal.m4 2006-05-25 01:46:15.000000000 +0200
++++ src/boehm-gc/aclocal.m4 2006-08-28 19:14:18.110718000 +0200
+@@ -1,7 +1,7 @@
+-# generated automatically by aclocal 1.9.3 -*- Autoconf -*-
++# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
+
+-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+-# Free Software Foundation, Inc.
++# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
++# 2005 Free Software Foundation, Inc.
+ # This file is free software; the Free Software Foundation
+ # gives unlimited permission to copy and/or distribute it,
+ # with or without modifications, as long as this notice is preserved.
+@@ -11,23 +11,11 @@
+ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ # PARTICULAR PURPOSE.
+
+-# -*- Autoconf -*-
+-# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+-# Generated from amversion.in; do not edit by hand.
+-
+-# This program is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2, or (at your option)
+-# any later version.
+-
+-# This program is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-# GNU General Public License for more details.
+-
+-# You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
++# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
+
+ # AM_AUTOMAKE_VERSION(VERSION)
+ # ----------------------------
+@@ -40,26 +28,15 @@
+ # Call AM_AUTOMAKE_VERSION so it can be traced.
+ # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+ AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+- [AM_AUTOMAKE_VERSION([1.9.3])])
+-
+-# AM_AUX_DIR_EXPAND
+-
+-# Copyright (C) 2001, 2003 Free Software Foundation, Inc.
++ [AM_AUTOMAKE_VERSION([1.9.6])])
+
+-# This program is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2, or (at your option)
+-# any later version.
++# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+-# This program is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-# GNU General Public License for more details.
+-
+-# You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+-# 02111-1307, USA.
++# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
+
+ # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+ # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
+@@ -106,26 +83,16 @@
+ am_aux_dir=`cd $ac_aux_dir && pwd`
+ ])
+
+-# AM_CONDITIONAL -*- Autoconf -*-
+-
+-# Copyright (C) 1997, 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
+-
+-# This program is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2, or (at your option)
+-# any later version.
++# AM_CONDITIONAL -*- Autoconf -*-
+
+-# This program is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-# GNU General Public License for more details.
+-
+-# You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+-# 02111-1307, USA.
++# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
++# Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
+
+-# serial 6
++# serial 7
+
+ # AM_CONDITIONAL(NAME, SHELL-CONDITION)
+ # -------------------------------------
+@@ -149,26 +116,15 @@
+ Usually this means the macro was only invoked conditionally.]])
+ fi])])
+
+-# serial 7 -*- Autoconf -*-
+
+-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
++# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+ # Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
+
+-# This program is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2, or (at your option)
+-# any later version.
+-
+-# This program is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-# GNU General Public License for more details.
+-
+-# You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+-# 02111-1307, USA.
+-
++# serial 8
+
+ # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+ # written in clear, in which case automake, when reading aclocal.m4,
+@@ -177,7 +133,6 @@
+ # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+-
+ # _AM_DEPENDENCIES(NAME)
+ # ----------------------
+ # See how the compiler implements dependency checking.
+@@ -317,27 +272,16 @@
+ AC_SUBST([AMDEPBACKSLASH])
+ ])
+
+-# Generate code to set up dependency tracking. -*- Autoconf -*-
+-
+-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
+-# Free Software Foundation, Inc.
++# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+-# This program is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2, or (at your option)
+-# any later version.
+-
+-# This program is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-# GNU General Public License for more details.
+-
+-# You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+-# 02111-1307, USA.
++# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
++# Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
+
+-#serial 2
++#serial 3
+
+ # _AM_OUTPUT_DEPENDENCY_COMMANDS
+ # ------------------------------
+@@ -396,30 +340,19 @@
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+ ])
+
+-# Do all the work for Automake. -*- Autoconf -*-
++# Do all the work for Automake. -*- Autoconf -*-
+
+-# This macro actually does too much some checks are only needed if
+-# your package does certain things. But this isn't really a big deal.
+-
+-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
++# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+ # Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
+
+-# This program is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2, or (at your option)
+-# any later version.
+-
+-# This program is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-# GNU General Public License for more details.
+-
+-# You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+-# 02111-1307, USA.
++# serial 12
+
+-# serial 11
++# This macro actually does too much. Some checks are only needed if
++# your package does certain things. But this isn't really a big deal.
+
+ # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+ # AM_INIT_AUTOMAKE([OPTIONS])
+@@ -521,87 +454,31 @@
+ done
+ echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
+
++# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
+ # AM_PROG_INSTALL_SH
+ # ------------------
+ # Define $install_sh.
+-
+-# Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+-
+-# This program is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2, or (at your option)
+-# any later version.
+-
+-# This program is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-# GNU General Public License for more details.
+-
+-# You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+-# 02111-1307, USA.
+-
+ AC_DEFUN([AM_PROG_INSTALL_SH],
+ [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+ install_sh=${install_sh-"$am_aux_dir/install-sh"}
+ AC_SUBST(install_sh)])
+
+-# -*- Autoconf -*-
+-# Copyright (C) 2003 Free Software Foundation, Inc.
+-
+-# This program is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2, or (at your option)
+-# any later version.
+-
+-# This program is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-# GNU General Public License for more details.
+-
+-# You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+-# 02111-1307, USA.
+-
+-# serial 1
+-
+-# Check whether the underlying file-system supports filenames
+-# with a leading dot. For instance MS-DOS doesn't.
+-AC_DEFUN([AM_SET_LEADING_DOT],
+-[rm -rf .tst 2>/dev/null
+-mkdir .tst 2>/dev/null
+-if test -d .tst; then
+- am__leading_dot=.
+-else
+- am__leading_dot=_
+-fi
+-rmdir .tst 2>/dev/null
+-AC_SUBST([am__leading_dot])])
+-
+-# Add --enable-maintainer-mode option to configure.
++# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
+ # From Jim Meyering
+
+-# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004
++# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
+ # Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
+
+-# This program is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2, or (at your option)
+-# any later version.
+-
+-# This program is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-# GNU General Public License for more details.
+-
+-# You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+-# 02111-1307, USA.
+-
+-# serial 3
++# serial 4
+
+ AC_DEFUN([AM_MAINTAINER_MODE],
+ [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+@@ -620,26 +497,15 @@
+
+ AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
+
+-# Check to see how 'make' treats includes. -*- Autoconf -*-
++# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+-# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+-
+-# This program is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2, or (at your option)
+-# any later version.
+-
+-# This program is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-# GNU General Public License for more details.
+-
+-# You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+-# 02111-1307, USA.
++# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
+
+-# serial 2
++# serial 3
+
+ # AM_MAKE_INCLUDE()
+ # -----------------
+@@ -683,29 +549,17 @@
+ rm -f confinc confmf
+ ])
+
+-# serial 2
++# Copyright (C) 1999, 2000, 2001, 2003, 2005 Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# serial 3
+
+ # AM_PROG_CC_C_O
+ # --------------
+ # Like AC_PROG_CC_C_O, but changed for automake.
+-
+-# Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
+-
+-# This program is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2, or (at your option)
+-# any later version.
+-
+-# This program is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-# GNU General Public License for more details.
+-
+-# You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+-# 02111-1307, USA.
+-
+ AC_DEFUN([AM_PROG_CC_C_O],
+ [AC_REQUIRE([AC_PROG_CC_C_O])dnl
+ AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+@@ -723,27 +577,16 @@
+ fi
+ ])
+
+-# -*- Autoconf -*-
++# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
++# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
++# Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
+
+-# Copyright (C) 1997, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
+-
+-# This program is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2, or (at your option)
+-# any later version.
+-
+-# This program is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-# GNU General Public License for more details.
+-
+-# You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+-# 02111-1307, USA.
+-
+-# serial 3
++# serial 4
+
+ # AM_MISSING_PROG(NAME, PROGRAM)
+ # ------------------------------
+@@ -769,27 +612,16 @@
+ fi
+ ])
+
++# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
+ # AM_PROG_MKDIR_P
+ # ---------------
+ # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
+-
+-# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+-
+-# This program is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2, or (at your option)
+-# any later version.
+-
+-# This program is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-# GNU General Public License for more details.
+-
+-# You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+-# 02111-1307, USA.
+-
++#
+ # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
+ # created by `make install' are always world readable, even if the
+ # installer happens to have an overly restrictive umask (e.g. 077).
+@@ -843,25 +675,14 @@
+ fi
+ AC_SUBST([mkdir_p])])
+
+-# Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004
++# Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005
+ # Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
+
+-# This program is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2, or (at your option)
+-# any later version.
+-
+-# This program is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-# GNU General Public License for more details.
+-
+-# You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+-# 02111-1307, USA.
+-
+-# serial 4
++# serial 5
+
+ # AM_ENABLE_MULTILIB([MAKEFILE], [REL-TO-TOP-SRCDIR])
+ # ---------------------------------------------------
+@@ -912,26 +733,15 @@
+ CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ CC="$CC"])])dnl
+
+-# Helper functions for option handling. -*- Autoconf -*-
++# Helper functions for option handling. -*- Autoconf -*-
+
+-# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+-
+-# This program is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2, or (at your option)
+-# any later version.
+-
+-# This program is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-# GNU General Public License for more details.
+-
+-# You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+-# 02111-1307, USA.
++# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
+
+-# serial 2
++# serial 3
+
+ # _AM_MANGLE_OPTION(NAME)
+ # -----------------------
+@@ -956,28 +766,16 @@
+ AC_DEFUN([_AM_IF_OPTION],
+ [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+-#
+-# Check to make sure that the build environment is sane.
+-#
+-
+-# Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc.
+-
+-# This program is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2, or (at your option)
+-# any later version.
++# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+-# This program is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-# GNU General Public License for more details.
+-
+-# You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+-# 02111-1307, USA.
++# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
++# Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
+
+-# serial 3
++# serial 4
+
+ # AM_SANITY_CHECK
+ # ---------------
+@@ -1020,25 +818,14 @@
+ fi
+ AC_MSG_RESULT(yes)])
+
+-# AM_PROG_INSTALL_STRIP
+-
+-# Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+-
+-# This program is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2, or (at your option)
+-# any later version.
+-
+-# This program is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-# GNU General Public License for more details.
+-
+-# You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+-# 02111-1307, USA.
++# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
+
++# AM_PROG_INSTALL_STRIP
++# ---------------------
+ # One issue with vendor `install' (even GNU) is that you can't
+ # specify the program used to strip binaries. This is especially
+ # annoying in cross-compiling environments, where the build's strip
+@@ -1061,25 +848,13 @@
+
+ # Check how to create a tarball. -*- Autoconf -*-
+
+-# Copyright (C) 2004 Free Software Foundation, Inc.
+-
+-# This program is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2, or (at your option)
+-# any later version.
+-
+-# This program is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-# GNU General Public License for more details.
+-
+-# You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+-# 02111-1307, USA.
+-
+-# serial 1
++# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
+
++# serial 2
+
+ # _AM_PROG_TAR(FORMAT)
+ # --------------------
+@@ -1168,5 +943,7 @@
+ ]) # _AM_PROG_TAR
+
+ m4_include([../config/acx.m4])
++m4_include([../config/depstand.m4])
++m4_include([../config/lead-dot.m4])
+ m4_include([../config/no-executables.m4])
+ m4_include([../libtool.m4])
+diff -urN old/boehm-gc/aix_irix_threads.c src/boehm-gc/aix_irix_threads.c
+--- old/boehm-gc/aix_irix_threads.c 2004-08-23 23:40:17.000000000 +0200
++++ src/boehm-gc/aix_irix_threads.c 2006-08-28 19:14:18.110718000 +0200
+@@ -1,689 +0,0 @@
+-/*
+- * Copyright (c) 1991-1995 by Xerox Corporation. All rights reserved.
+- * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved.
+- * Copyright (c) 1999-2003 by Hewlett-Packard Company. All rights reserved.
+- *
+- * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
+- * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
+- *
+- * Permission is hereby granted to use or copy this program
+- * for any purpose, provided the above notices are retained on all copies.
+- * Permission to modify the code and to distribute modified code is granted,
+- * provided the above notices are retained, and a notice that the code was
+- * modified is included with the above copyright notice.
+- */
+-/*
+- * Support code for Irix (>=6.2) Pthreads and for AIX pthreads.
+- * This relies on properties
+- * not guaranteed by the Pthread standard. It may or may not be portable
+- * to other implementations.
+- *
+- * Note that there is a lot of code duplication between this file and
+- * (pthread_support.c, pthread_stop_world.c). They should be merged.
+- * Pthread_support.c should be directly usable.
+- *
+- * Please avoid adding new ports here; use the generic pthread support
+- * as a base instead.
+- */
+-
+-# include "private/gc_priv.h"
+-
+-# if defined(GC_IRIX_THREADS) || defined(GC_AIX_THREADS)
+-
+-# include
+-# include
+-# include
+-# include
+-# include
+-# include
+-# include
+-# include
+-
+-#undef pthread_create
+-#undef pthread_sigmask
+-#undef pthread_join
+-
+-#if defined(GC_IRIX_THREADS) && !defined(MUTEX_RECURSIVE_NP)
+-#define MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
+-#endif
+-
+-void GC_thr_init();
+-
+-#if 0
+-void GC_print_sig_mask()
+-{
+- sigset_t blocked;
+- int i;
+-
+- if (pthread_sigmask(SIG_BLOCK, NULL, &blocked) != 0)
+- ABORT("pthread_sigmask");
+- GC_printf0("Blocked: ");
+- for (i = 1; i <= MAXSIG; i++) {
+- if (sigismember(&blocked, i)) { GC_printf1("%ld ",(long) i); }
+- }
+- GC_printf0("\n");
+-}
+-#endif
+-
+-/* We use the allocation lock to protect thread-related data structures. */
+-
+-/* The set of all known threads. We intercept thread creation and */
+-/* joins. We never actually create detached threads. We allocate all */
+-/* new thread stacks ourselves. These allow us to maintain this */
+-/* data structure. */
+-/* Protected by GC_thr_lock. */
+-/* Some of this should be declared volatile, but that's incosnsistent */
+-/* with some library routine declarations. */
+-typedef struct GC_Thread_Rep {
+- struct GC_Thread_Rep * next; /* More recently allocated threads */
+- /* with a given pthread id come */
+- /* first. (All but the first are */
+- /* guaranteed to be dead, but we may */
+- /* not yet have registered the join.) */
+- pthread_t id;
+- word stop;
+-# define NOT_STOPPED 0
+-# define PLEASE_STOP 1
+-# define STOPPED 2
+- word flags;
+-# define FINISHED 1 /* Thread has exited. */
+-# define DETACHED 2 /* Thread is intended to be detached. */
+- ptr_t stack_cold; /* cold end of the stack */
+- ptr_t stack_hot; /* Valid only when stopped. */
+- /* But must be within stack region at */
+- /* all times. */
+- void * status; /* Used only to avoid premature */
+- /* reclamation of any data it might */
+- /* reference. */
+-} * GC_thread;
+-
+-GC_thread GC_lookup_thread(pthread_t id);
+-
+-/*
+- * The only way to suspend threads given the pthread interface is to send
+- * signals. Unfortunately, this means we have to reserve
+- * a signal, and intercept client calls to change the signal mask.
+- */
+-#if 0 /* DOB: 6.1 */
+-# if defined(GC_AIX_THREADS)
+-# define SIG_SUSPEND SIGUSR1
+-# else
+-# define SIG_SUSPEND (SIGRTMIN + 6)
+-# endif
+-#endif
+-
+-pthread_mutex_t GC_suspend_lock = PTHREAD_MUTEX_INITIALIZER;
+- /* Number of threads stopped so far */
+-pthread_cond_t GC_suspend_ack_cv = PTHREAD_COND_INITIALIZER;
+-pthread_cond_t GC_continue_cv = PTHREAD_COND_INITIALIZER;
+-
+-void GC_suspend_handler(int sig)
+-{
+- int dummy;
+- GC_thread me;
+- sigset_t all_sigs;
+- sigset_t old_sigs;
+- int i;
+-
+- if (sig != SIG_SUSPEND) ABORT("Bad signal in suspend_handler");
+- me = GC_lookup_thread(pthread_self());
+- /* The lookup here is safe, since I'm doing this on behalf */
+- /* of a thread which holds the allocation lock in order */
+- /* to stop the world. Thus concurrent modification of the */
+- /* data structure is impossible. */
+- if (PLEASE_STOP != me -> stop) {
+- /* Misdirected signal. */
+- pthread_mutex_unlock(&GC_suspend_lock);
+- return;
+- }
+- pthread_mutex_lock(&GC_suspend_lock);
+- me -> stack_hot = (ptr_t)(&dummy);
+- me -> stop = STOPPED;
+- pthread_cond_signal(&GC_suspend_ack_cv);
+- pthread_cond_wait(&GC_continue_cv, &GC_suspend_lock);
+- pthread_mutex_unlock(&GC_suspend_lock);
+- /* GC_printf1("Continuing 0x%x\n", pthread_self()); */
+-}
+-
+-
+-GC_bool GC_thr_initialized = FALSE;
+-
+-
+-# define THREAD_TABLE_SZ 128 /* Must be power of 2 */
+-volatile GC_thread GC_threads[THREAD_TABLE_SZ];
+-
+-void GC_push_thread_structures GC_PROTO((void))
+-{
+- GC_push_all((ptr_t)(GC_threads), (ptr_t)(GC_threads)+sizeof(GC_threads));
+-}
+-
+-/* Add a thread to GC_threads. We assume it wasn't already there. */
+-/* Caller holds allocation lock. */
+-GC_thread GC_new_thread(pthread_t id)
+-{
+- int hv = ((word)id) % THREAD_TABLE_SZ;
+- GC_thread result;
+- static struct GC_Thread_Rep first_thread;
+- static GC_bool first_thread_used = FALSE;
+-
+- GC_ASSERT(I_HOLD_LOCK());
+- if (!first_thread_used) {
+- result = &first_thread;
+- first_thread_used = TRUE;
+- /* Dont acquire allocation lock, since we may already hold it. */
+- } else {
+- result = (struct GC_Thread_Rep *)
+- GC_generic_malloc_inner(sizeof(struct GC_Thread_Rep), NORMAL);
+- }
+- if (result == 0) return(0);
+- result -> id = id;
+- result -> next = GC_threads[hv];
+- GC_threads[hv] = result;
+- /* result -> flags = 0; */
+- /* result -> stop = 0; */
+- return(result);
+-}
+-
+-/* Delete a thread from GC_threads. We assume it is there. */
+-/* (The code intentionally traps if it wasn't.) */
+-/* Caller holds allocation lock. */
+-/* We explicitly pass in the GC_thread we're looking for, since */
+-/* if a thread has been joined, but we have not yet */
+-/* been notified, then there may be more than one thread */
+-/* in the table with the same pthread id. */
+-/* This is OK, but we need a way to delete a specific one. */
+-void GC_delete_gc_thread(pthread_t id, GC_thread gc_id)
+-{
+- int hv = ((word)id) % THREAD_TABLE_SZ;
+- register GC_thread p = GC_threads[hv];
+- register GC_thread prev = 0;
+-
+- GC_ASSERT(I_HOLD_LOCK());
+- while (p != gc_id) {
+- prev = p;
+- p = p -> next;
+- }
+- if (prev == 0) {
+- GC_threads[hv] = p -> next;
+- } else {
+- prev -> next = p -> next;
+- }
+-}
+-
+-/* Return a GC_thread corresponding to a given thread_t. */
+-/* Returns 0 if it's not there. */
+-/* Caller holds allocation lock or otherwise inhibits */
+-/* updates. */
+-/* If there is more than one thread with the given id we */
+-/* return the most recent one. */
+-GC_thread GC_lookup_thread(pthread_t id)
+-{
+- int hv = ((word)id) % THREAD_TABLE_SZ;
+- register GC_thread p = GC_threads[hv];
+-
+- /* I either hold the lock, or i'm being called from the stop-the-world
+- * handler. */
+-#if defined(GC_AIX_THREADS)
+- GC_ASSERT(I_HOLD_LOCK()); /* no stop-the-world handler needed on AIX */
+-#endif
+- while (p != 0 && !pthread_equal(p -> id, id)) p = p -> next;
+- return(p);
+-}
+-
+-#if defined(GC_AIX_THREADS)
+-void GC_stop_world()
+-{
+- pthread_t my_thread = pthread_self();
+- register int i;
+- register GC_thread p;
+- register int result;
+- struct timespec timeout;
+-
+- GC_ASSERT(I_HOLD_LOCK());
+- for (i = 0; i < THREAD_TABLE_SZ; i++) {
+- for (p = GC_threads[i]; p != 0; p = p -> next) {
+- if (p -> id != my_thread) {
+- pthread_suspend_np(p->id);
+- }
+- }
+- }
+- /* GC_printf1("World stopped 0x%x\n", pthread_self()); */
+-}
+-
+-void GC_start_world()
+-{
+- GC_thread p;
+- unsigned i;
+- pthread_t my_thread = pthread_self();
+-
+- /* GC_printf0("World starting\n"); */
+- GC_ASSERT(I_HOLD_LOCK());
+- for (i = 0; i < THREAD_TABLE_SZ; i++) {
+- for (p = GC_threads[i]; p != 0; p = p -> next) {
+- if (p -> id != my_thread) {
+- pthread_continue_np(p->id);
+- }
+- }
+- }
+-}
+-
+-#else /* GC_AIX_THREADS */
+-
+-/* Caller holds allocation lock. */
+-void GC_stop_world()
+-{
+- pthread_t my_thread = pthread_self();
+- register int i;
+- register GC_thread p;
+- register int result;
+- struct timespec timeout;
+-
+- GC_ASSERT(I_HOLD_LOCK());
+- for (i = 0; i < THREAD_TABLE_SZ; i++) {
+- for (p = GC_threads[i]; p != 0; p = p -> next) {
+- if (p -> id != my_thread) {
+- if (p -> flags & FINISHED) {
+- p -> stop = STOPPED;
+- continue;
+- }
+- p -> stop = PLEASE_STOP;
+- result = pthread_kill(p -> id, SIG_SUSPEND);
+- /* GC_printf1("Sent signal to 0x%x\n", p -> id); */
+- switch(result) {
+- case ESRCH:
+- /* Not really there anymore. Possible? */
+- p -> stop = STOPPED;
+- break;
+- case 0:
+- break;
+- default:
+- ABORT("pthread_kill failed");
+- }
+- }
+- }
+- }
+- pthread_mutex_lock(&GC_suspend_lock);
+- for (i = 0; i < THREAD_TABLE_SZ; i++) {
+- for (p = GC_threads[i]; p != 0; p = p -> next) {
+- while (p -> id != my_thread && p -> stop != STOPPED) {
+- clock_gettime(CLOCK_REALTIME, &timeout);
+- timeout.tv_nsec += 50000000; /* 50 msecs */
+- if (timeout.tv_nsec >= 1000000000) {
+- timeout.tv_nsec -= 1000000000;
+- ++timeout.tv_sec;
+- }
+- result = pthread_cond_timedwait(&GC_suspend_ack_cv,
+- &GC_suspend_lock,
+- &timeout);
+- if (result == ETIMEDOUT) {
+- /* Signal was lost or misdirected. Try again. */
+- /* Duplicate signals should be benign. */
+- result = pthread_kill(p -> id, SIG_SUSPEND);
+- }
+- }
+- }
+- }
+- pthread_mutex_unlock(&GC_suspend_lock);
+- /* GC_printf1("World stopped 0x%x\n", pthread_self()); */
+-}
+-
+-/* Caller holds allocation lock. */
+-void GC_start_world()
+-{
+- GC_thread p;
+- unsigned i;
+-
+- /* GC_printf0("World starting\n"); */
+- GC_ASSERT(I_HOLD_LOCK());
+- for (i = 0; i < THREAD_TABLE_SZ; i++) {
+- for (p = GC_threads[i]; p != 0; p = p -> next) {
+- p -> stop = NOT_STOPPED;
+- }
+- }
+- pthread_mutex_lock(&GC_suspend_lock);
+- /* All other threads are at pthread_cond_wait in signal handler. */
+- /* Otherwise we couldn't have acquired the lock. */
+- pthread_mutex_unlock(&GC_suspend_lock);
+- pthread_cond_broadcast(&GC_continue_cv);
+-}
+-
+-#endif /* GC_AIX_THREADS */
+-
+-
+-/* We hold allocation lock. Should do exactly the right thing if the */
+-/* world is stopped. Should not fail if it isn't. */
+-void GC_push_all_stacks()
+-{
+- register int i;
+- register GC_thread p;
+- register ptr_t hot, cold;
+- pthread_t me = pthread_self();
+-
+- /* GC_init() should have been called before GC_push_all_stacks is
+- * invoked, and GC_init calls GC_thr_init(), which sets
+- * GC_thr_initialized. */
+- GC_ASSERT(GC_thr_initialized);
+-
+- /* GC_printf1("Pushing stacks from thread 0x%x\n", me); */
+- GC_ASSERT(I_HOLD_LOCK());
+- for (i = 0; i < THREAD_TABLE_SZ; i++) {
+- for (p = GC_threads[i]; p != 0; p = p -> next) {
+- if (p -> flags & FINISHED) continue;
+- cold = p->stack_cold;
+- if (!cold) cold=GC_stackbottom; /* 0 indicates 'original stack' */
+- if (pthread_equal(p -> id, me)) {
+- hot = GC_approx_sp();
+- } else {
+-# ifdef GC_AIX_THREADS
+- /* AIX doesn't use signals to suspend, so we need to get an */
+- /* accurate hot stack pointer. */
+- /* See http://publib16.boulder.ibm.com/pseries/en_US/libs/basetrf1/pthread_getthrds_np.htm */
+- pthread_t id = p -> id;
+- struct __pthrdsinfo pinfo;
+- int regbuf[64];
+- int val = sizeof(regbuf);
+- int retval = pthread_getthrds_np(&id, PTHRDSINFO_QUERY_ALL, &pinfo,
+- sizeof(pinfo), regbuf, &val);
+- if (retval != 0) {
+- printf("ERROR: pthread_getthrds_np() failed in GC\n");
+- abort();
+- }
+- /* according to the AIX ABI,
+- "the lowest possible valid stack address is 288 bytes (144 + 144)
+- less than the current value of the stack pointer. Functions may
+- use this stack space as volatile storage which is not preserved
+- across function calls."
+- ftp://ftp.penguinppc64.org/pub/people/amodra/PPC-elf64abi.txt.gz
+- */
+- hot = (ptr_t)(unsigned long)pinfo.__pi_ustk-288;
+- cold = (ptr_t)pinfo.__pi_stackend; /* more precise */
+- /* push the registers too, because they won't be on stack */
+- GC_push_all_eager((ptr_t)&pinfo.__pi_context,
+- (ptr_t)((&pinfo.__pi_context)+1));
+- GC_push_all_eager((ptr_t)regbuf, ((ptr_t)regbuf)+val);
+-# else
+- hot = p -> stack_hot;
+-# endif
+- }
+-# ifdef STACK_GROWS_UP
+- GC_push_all_stack(cold, hot);
+-# else
+- /* printf("thread 0x%x: hot=0x%08x cold=0x%08x\n", p -> id, hot, cold); */
+- GC_push_all_stack(hot, cold);
+-# endif
+- }
+- }
+-}
+-
+-
+-/* We hold the allocation lock. */
+-void GC_thr_init()
+-{
+- GC_thread t;
+- struct sigaction act;
+-
+- if (GC_thr_initialized) return;
+- GC_ASSERT(I_HOLD_LOCK());
+- GC_thr_initialized = TRUE;
+-#ifndef GC_AIX_THREADS
+- (void) sigaction(SIG_SUSPEND, 0, &act);
+- if (act.sa_handler != SIG_DFL)
+- ABORT("Previously installed SIG_SUSPEND handler");
+- /* Install handler. */
+- act.sa_handler = GC_suspend_handler;
+- act.sa_flags = SA_RESTART;
+- (void) sigemptyset(&act.sa_mask);
+- if (0 != sigaction(SIG_SUSPEND, &act, 0))
+- ABORT("Failed to install SIG_SUSPEND handler");
+-#endif
+- /* Add the initial thread, so we can stop it. */
+- t = GC_new_thread(pthread_self());
+- /* use '0' to indicate GC_stackbottom, since GC_init() has not
+- * completed by the time we are called (from GC_init_inner()) */
+- t -> stack_cold = 0; /* the original stack. */
+- t -> stack_hot = (ptr_t)(&t);
+- t -> flags = DETACHED;
+-}
+-
+-int GC_pthread_sigmask(int how, const sigset_t *set, sigset_t *oset)
+-{
+- sigset_t fudged_set;
+-
+-#ifdef GC_AIX_THREADS
+- return(pthread_sigmask(how, set, oset));
+-#endif
+-
+- if (set != NULL && (how == SIG_BLOCK || how == SIG_SETMASK)) {
+- fudged_set = *set;
+- sigdelset(&fudged_set, SIG_SUSPEND);
+- set = &fudged_set;
+- }
+- return(pthread_sigmask(how, set, oset));
+-}
+-
+-struct start_info {
+- void *(*start_routine)(void *);
+- void *arg;
+- word flags;
+- pthread_mutex_t registeredlock;
+- pthread_cond_t registered;
+- int volatile registereddone;
+-};
+-
+-void GC_thread_exit_proc(void *arg)
+-{
+- GC_thread me;
+-
+- LOCK();
+- me = GC_lookup_thread(pthread_self());
+- me -> flags |= FINISHED;
+- /* reclaim DETACHED thread right away; otherwise wait until join() */
+- if (me -> flags & DETACHED) {
+- GC_delete_gc_thread(pthread_self(), me);
+- }
+- UNLOCK();
+-}
+-
+-int GC_pthread_join(pthread_t thread, void **retval)
+-{
+- int result;
+- GC_thread thread_gc_id;
+-
+- LOCK();
+- thread_gc_id = GC_lookup_thread(thread);
+- /* This is guaranteed to be the intended one, since the thread id */
+- /* cant have been recycled by pthreads. */
+- UNLOCK();
+- GC_ASSERT(!(thread_gc_id->flags & DETACHED));
+- result = pthread_join(thread, retval);
+- /* Some versions of the Irix pthreads library can erroneously */
+- /* return EINTR when the call succeeds. */
+- if (EINTR == result) result = 0;
+- GC_ASSERT(thread_gc_id->flags & FINISHED);
+- LOCK();
+- /* Here the pthread thread id may have been recycled. */
+- GC_delete_gc_thread(thread, thread_gc_id);
+- UNLOCK();
+- return result;
+-}
+-
+-void * GC_start_routine(void * arg)
+-{
+- int dummy;
+- struct start_info * si = arg;
+- void * result;
+- GC_thread me;
+- pthread_t my_pthread;
+- void *(*start)(void *);
+- void *start_arg;
+-
+- my_pthread = pthread_self();
+- /* If a GC occurs before the thread is registered, that GC will */
+- /* ignore this thread. That's fine, since it will block trying to */
+- /* acquire the allocation lock, and won't yet hold interesting */
+- /* pointers. */
+- LOCK();
+- /* We register the thread here instead of in the parent, so that */
+- /* we don't need to hold the allocation lock during pthread_create. */
+- /* Holding the allocation lock there would make REDIRECT_MALLOC */
+- /* impossible. It probably still doesn't work, but we're a little */
+- /* closer ... */
+- /* This unfortunately means that we have to be careful the parent */
+- /* doesn't try to do a pthread_join before we're registered. */
+- me = GC_new_thread(my_pthread);
+- me -> flags = si -> flags;
+- me -> stack_cold = (ptr_t) &dummy; /* this now the 'start of stack' */
+- me -> stack_hot = me->stack_cold;/* this field should always be sensible */
+- UNLOCK();
+- start = si -> start_routine;
+- start_arg = si -> arg;
+-
+- pthread_mutex_lock(&(si->registeredlock));
+- si->registereddone = 1;
+- pthread_cond_signal(&(si->registered));
+- pthread_mutex_unlock(&(si->registeredlock));
+- /* si went away as soon as we did this unlock */
+-
+- pthread_cleanup_push(GC_thread_exit_proc, 0);
+- result = (*start)(start_arg);
+- me -> status = result;
+- pthread_cleanup_pop(1);
+- /* This involves acquiring the lock, ensuring that we can't exit */
+- /* while a collection that thinks we're alive is trying to stop */
+- /* us. */
+- return(result);
+-}
+-
+-int
+-GC_pthread_create(pthread_t *new_thread,
+- const pthread_attr_t *attr,
+- void *(*start_routine)(void *), void *arg)
+-{
+- int result;
+- GC_thread t;
+- int detachstate;
+- word my_flags = 0;
+- struct start_info * si;
+- /* This is otherwise saved only in an area mmapped by the thread */
+- /* library, which isn't visible to the collector. */
+-
+- LOCK();
+- /* GC_INTERNAL_MALLOC implicitly calls GC_init() if required */
+- si = (struct start_info *)GC_INTERNAL_MALLOC(sizeof(struct start_info),
+- NORMAL);
+- GC_ASSERT(GC_thr_initialized); /* initialized by GC_init() */
+- UNLOCK();
+- if (0 == si) return(ENOMEM);
+- pthread_mutex_init(&(si->registeredlock), NULL);
+- pthread_cond_init(&(si->registered),NULL);
+- pthread_mutex_lock(&(si->registeredlock));
+- si -> start_routine = start_routine;
+- si -> arg = arg;
+-
+- pthread_attr_getdetachstate(attr, &detachstate);
+- if (PTHREAD_CREATE_DETACHED == detachstate) my_flags |= DETACHED;
+- si -> flags = my_flags;
+- result = pthread_create(new_thread, attr, GC_start_routine, si);
+-
+- /* Wait until child has been added to the thread table. */
+- /* This also ensures that we hold onto si until the child is done */
+- /* with it. Thus it doesn't matter whether it is otherwise */
+- /* visible to the collector. */
+-
+- if (0 == result) {
+- si->registereddone = 0;
+- while (!si->registereddone)
+- pthread_cond_wait(&(si->registered), &(si->registeredlock));
+- }
+- pthread_mutex_unlock(&(si->registeredlock));
+-
+- pthread_cond_destroy(&(si->registered));
+- pthread_mutex_destroy(&(si->registeredlock));
+- LOCK();
+- GC_INTERNAL_FREE(si);
+- UNLOCK();
+-
+- return(result);
+-}
+-
+-/* For now we use the pthreads locking primitives on HP/UX */
+-
+-VOLATILE GC_bool GC_collecting = 0; /* A hint that we're in the collector and */
+- /* holding the allocation lock for an */
+- /* extended period. */
+-
+-/* Reasonably fast spin locks. Basically the same implementation */
+-/* as STL alloc.h. */
+-
+-#define SLEEP_THRESHOLD 3
+-
+-volatile unsigned int GC_allocate_lock = 0;
+-#define GC_TRY_LOCK() !GC_test_and_set(&GC_allocate_lock)
+-#define GC_LOCK_TAKEN GC_allocate_lock
+-
+-void GC_lock()
+-{
+-# define low_spin_max 30 /* spin cycles if we suspect uniprocessor */
+-# define high_spin_max 1000 /* spin cycles for multiprocessor */
+- static unsigned spin_max = low_spin_max;
+- unsigned my_spin_max;
+- static unsigned last_spins = 0;
+- unsigned my_last_spins;
+- volatile unsigned junk;
+-# define PAUSE junk *= junk; junk *= junk; junk *= junk; junk *= junk
+- int i;
+-
+- if (GC_TRY_LOCK()) {
+- return;
+- }
+- junk = 0;
+- my_spin_max = spin_max;
+- my_last_spins = last_spins;
+- for (i = 0; i < my_spin_max; i++) {
+- if (GC_collecting) goto yield;
+- if (i < my_last_spins/2 || GC_LOCK_TAKEN) {
+- PAUSE;
+- continue;
+- }
+- if (GC_TRY_LOCK()) {
+- /*
+- * got it!
+- * Spinning worked. Thus we're probably not being scheduled
+- * against the other process with which we were contending.
+- * Thus it makes sense to spin longer the next time.
+- */
+- last_spins = i;
+- spin_max = high_spin_max;
+- return;
+- }
+- }
+- /* We are probably being scheduled against the other process. Sleep. */
+- spin_max = low_spin_max;
+-yield:
+- for (i = 0;; ++i) {
+- if (GC_TRY_LOCK()) {
+- return;
+- }
+- if (i < SLEEP_THRESHOLD) {
+- sched_yield();
+- } else {
+- struct timespec ts;
+-
+- if (i > 26) i = 26;
+- /* Don't wait for more than about 60msecs, even */
+- /* under extreme contention. */
+- ts.tv_sec = 0;
+- ts.tv_nsec = 1 << i;
+- nanosleep(&ts, 0);
+- }
+- }
+-}
+-
+-# else /* !GC_IRIX_THREADS && !GC_AIX_THREADS */
+-
+-#ifndef LINT
+- int GC_no_Irix_threads;
+-#endif
+-
+-# endif /* IRIX_THREADS */
+-
+diff -urN old/boehm-gc/allchblk.c src/boehm-gc/allchblk.c
+--- old/boehm-gc/allchblk.c 2005-02-09 22:33:02.000000000 +0100
++++ src/boehm-gc/allchblk.c 2006-08-28 19:14:18.110718000 +0200
+@@ -285,8 +285,8 @@
+ GET_HDR(hhdr -> hb_prev, phdr);
+ phdr -> hb_next = hhdr -> hb_next;
+ }
++ FREE_ASSERT(GC_free_bytes[index] >= hhdr -> hb_sz);
+ INCR_FREE_BYTES(index, - (signed_word)(hhdr -> hb_sz));
+- FREE_ASSERT(GC_free_bytes[index] >= 0);
+ if (0 != hhdr -> hb_next) {
+ hdr * nhdr;
+ GC_ASSERT(!IS_FORWARDING_ADDR_OR_NIL(NHDR(hhdr)));
+diff -urN old/boehm-gc/alloc.c src/boehm-gc/alloc.c
+--- old/boehm-gc/alloc.c 2004-08-28 02:41:41.000000000 +0200
++++ src/boehm-gc/alloc.c 2006-08-28 19:14:18.110718000 +0200
+@@ -92,6 +92,16 @@
+
+ # include "version.h"
+
++#if defined(SAVE_CALL_CHAIN) && \
++ !(defined(REDIRECT_MALLOC) && defined(GC_HAVE_BUILTIN_BACKTRACE))
++# define SAVE_CALL_CHAIN_IN_GC
++ /* This is only safe if the call chain save mechanism won't end up */
++ /* calling GC_malloc. The GNU C library documentation suggests */
++ /* that backtrace doesn't use malloc, but at least the initial */
++ /* call in some versions does seem to invoke the dynamic linker, */
++ /* which uses malloc. */
++#endif
++
+ /* some more variables */
+
+ extern signed_word GC_mem_found; /* Number of reclaimed longwords */
+@@ -196,7 +206,8 @@
+ /* had been reallocated this round. Finalization is user */
+ /* visible progress. And if we don't count this, we have */
+ /* stability problems for programs that finalize all objects. */
+- result += GC_words_wasted;
++ if ((GC_words_wasted >> 3) < result)
++ result += GC_words_wasted;
+ /* This doesn't reflect useful work. But if there is lots of */
+ /* new fragmentation, the same is probably true of the heap, */
+ /* and the collection will be correspondingly cheaper. */
+@@ -221,6 +232,8 @@
+ {
+ # define NWORDS 64
+ word frames[NWORDS];
++ /* Some compilers will warn that frames was set but never used. */
++ /* That's the whole idea ... */
+ register int i;
+
+ for (i = 0; i < NWORDS; i++) frames[i] = 0;
+@@ -293,7 +306,7 @@
+ # endif
+ if (GC_stopped_mark(GC_time_limit == GC_TIME_UNLIMITED?
+ GC_never_stop_func : GC_timeout_stop_func)) {
+-# ifdef SAVE_CALL_CHAIN
++# ifdef SAVE_CALL_CHAIN_IN_GC
+ GC_save_callers(GC_last_stack);
+ # endif
+ GC_finish_collection();
+@@ -358,7 +371,7 @@
+ }
+ GC_invalidate_mark_state(); /* Flush mark stack. */
+ GC_clear_marks();
+-# ifdef SAVE_CALL_CHAIN
++# ifdef SAVE_CALL_CHAIN_IN_GC
+ GC_save_callers(GC_last_stack);
+ # endif
+ GC_is_full_gc = TRUE;
+@@ -413,7 +426,7 @@
+ for (i = GC_deficit; i < GC_RATE*n; i++) {
+ if (GC_mark_some((ptr_t)0)) {
+ /* Need to finish a collection */
+-# ifdef SAVE_CALL_CHAIN
++# ifdef SAVE_CALL_CHAIN_IN_GC
+ GC_save_callers(GC_last_stack);
+ # endif
+ # ifdef PARALLEL_MARK
+@@ -929,7 +942,7 @@
+ # endif
+ expansion_slop = WORDS_TO_BYTES(min_words_allocd()) + 4*MAXHINCR*HBLKSIZE;
+ if (GC_last_heap_addr == 0 && !((word)space & SIGNB)
+- || GC_last_heap_addr != 0 && GC_last_heap_addr < (ptr_t)space) {
++ || (GC_last_heap_addr != 0 && GC_last_heap_addr < (ptr_t)space)) {
+ /* Assume the heap is growing up */
+ GC_greatest_plausible_heap_addr =
+ (GC_PTR)GC_max((ptr_t)GC_greatest_plausible_heap_addr,
+@@ -992,7 +1005,7 @@
+ GC_bool ignore_off_page;
+ {
+ if (!GC_incremental && !GC_dont_gc &&
+- (GC_dont_expand && GC_words_allocd > 0 || GC_should_collect())) {
++ ((GC_dont_expand && GC_words_allocd > 0) || GC_should_collect())) {
+ GC_gcollect_inner();
+ } else {
+ word blocks_to_get = GC_heapsize/(HBLKSIZE*GC_free_space_divisor)
+@@ -1001,6 +1014,9 @@
+ if (blocks_to_get > MAXHINCR) {
+ word slop;
+
++ /* Get the minimum required to make it likely that we */
++ /* can satisfy the current request in the presence of black- */
++ /* listing. This will probably be more than MAXHINCR. */
+ if (ignore_off_page) {
+ slop = 4;
+ } else {
+diff -urN old/boehm-gc/alpha_mach_dep.S src/boehm-gc/alpha_mach_dep.S
+--- old/boehm-gc/alpha_mach_dep.S 2003-07-28 05:46:07.000000000 +0200
++++ src/boehm-gc/alpha_mach_dep.S 2006-08-28 19:14:18.110718000 +0200
+@@ -1,4 +1,3 @@
+- # $Id: alpha_mach_dep.s,v 1.2 1993/01/18 22:54:51 dosser Exp $
+ .arch ev6
+
+ .text
+@@ -12,13 +11,13 @@
+ .mask 0x04000000, 0
+ .frame $sp, 16, $26, 0
+
+- # $0 integer result
+- # $1-$8 temp regs - not preserved cross calls
+- # $9-$15 call saved regs
+- # $16-$21 argument regs - not preserved cross calls
+- # $22-$28 temp regs - not preserved cross calls
+- # $29 global pointer - not preserved cross calls
+- # $30 stack pointer
++/* $0 integer result */
++/* $1-$8 temp regs - not preserved cross calls */
++/* $9-$15 call saved regs */
++/* $16-$21 argument regs - not preserved cross calls */
++/* $22-$28 temp regs - not preserved cross calls */
++/* $29 global pointer - not preserved cross calls */
++/* $30 stack pointer */
+
+ # define call_push(x) \
+ mov x, $16; \
+@@ -33,12 +32,12 @@
+ call_push($14)
+ call_push($15)
+
+- # $f0-$f1 floating point results
+- # $f2-$f9 call saved regs
+- # $f10-$f30 temp regs - not preserved cross calls
++/* $f0-$f1 floating point results */
++/* $f2-$f9 call saved regs */
++/* $f10-$f30 temp regs - not preserved cross calls */
+
+- # Use the most efficient transfer method for this hardware.
+- # Bit 1 detects the FIX extension, which includes ftoit.
++ /* Use the most efficient transfer method for this hardware. */
++ /* Bit 1 detects the FIX extension, which includes ftoit. */
+ amask 2, $0
+ bne $0, $use_stack
+
+diff -urN old/boehm-gc/ChangeLog src/boehm-gc/ChangeLog
+--- old/boehm-gc/ChangeLog 2006-05-25 01:42:41.000000000 +0200
++++ src/boehm-gc/ChangeLog 2006-08-28 19:17:32.350718000 +0200
+@@ -1,13 +1,85 @@
++2006-08-21 Bryce McKinlay
++
++ PR libgcj/13212:
++ * configure.ac: Check for pthread_getattr_np(). Remove
++ GC_PTHREAD_SYM_VERSION detection.
++ * include/gc.h (GC_register_my_thread, GC_unregister_my_thread,
++ GC_get_thread_stack_base): New declarations.
++ * pthread_support.c (GC_register_my_thread, GC_unregister_my_thread,
++ GC_get_thread_stack_base): New functions.
++ (GC_delete_thread): Don't try to free the first_thread.
++ * misc.c (GC_init_inner): Use GC_get_thread_stack_base() if possible.
++ (pthread_create_, constr): Removed.
++ (pthread_create): Don't rename.
++ * include/gc_ext_config.h.in: Rebuilt.
++ * include/gc_pthread_redirects.h (pthread_create): Define
++ unconditionally.
++ * include/gc_config.h.in: Rebuilt.
++ * configure: Rebuilt.
++
++2006-06-21 Keith Seitz
++
++ * pthread_stop_world.c (GC_suspend_handler): Redirect to suspension
++ routine if signal is received and thread is flagged SUSPENDED.
++ (suspend_self): New function.
++ (GC_suspend_thread): New function.
++ (GC_resume_thread): New function.
++ * include/gc.h (GC_suspend_thread): Declare.
++ (GC_resumet_thread): Declare.
++ * include/private/pthread_support.h (SUSPENDED): New GC_thread
++ flag.
++
++2006-06-20 Ranjit Mathew
++
++ Backport Windows 9x/ME VirtualQuery() fix from GC 6.7.
++ * os_dep.c (GC_wnt): Define.
++ (GC_init_win32): Set GC_wnt.
++ * dyn_load.c (GC_register_dynamic_libraries): Consider MEM_PRIVATE
++ sections also on Windows 9x/ME.
++
++2006-06-02 Geoffrey Keating
++
++ * configure.ac: Define HAS_PPC_THREAD_STATE_R0,
++ HAS_PPC_THREAD_STATE___R0, HAS_PPC_THREAD_STATE64_R0,
++ HAS_PPC_THREAD_STATE64___R0, HAS_I386_THREAD_STATE_EAX,
++ HAS_I386_THREAD_STATE___EAX.
++ * configure: Regenerate.
++ * include/gc_config.h.in: Regenerate.
++ * darwin_stop_world.c (PPC_RED_ZONE_SIZE): Use standard Darwin
++ macro names to determine value.
++ (THREAD_STATE): New.
++ (THREAD_FLD): New.
++ (GC_push_all_stacks): Use THREAD_STATE and THREAD_FLD in both versions.
++
+ 2006-05-24 Release Manager
+
+ * GCC 4.1.1 released.
+
++2006-05-24 Carlos O'Donell
++
++ * Makefile.am: Add install-html target.
++ * Makefile.in: Regenerate.
++ * aclocal.m4: Regenerate.
++ * include/Makefile.in: Regenerate.
++
++2006-03-07 Andrew Haley
++
++ * dyn_load.c (GC_has_static_roots): Declare.
++ (GC_register_dynlib_callback): Call GC_has_static_roots.
++
+ 2006-04-11 Bryce McKinlay
+
+ * darwin_stop_world.c (GC_push_all_stacks, GC_stop_world,
+ GC_start_world): Call vm_deallocate to free act_list. Fix from
+ Bruce Mitchener.
+
++2006-03-24 Andreas Tobler
++ John David Anglin
++
++ * configure.ac (THREADS): Add REENTRANT for *-*-hpux11*.
++ Warn about POSIX threads not being supported for *-*-hpux10*.
++ * configure: Regenerate.
++
+ 2006-02-28 Release Manager
+
+ * GCC 4.1.0 released.
+@@ -16,6 +88,12 @@
+
+ * pthread_support.c: Conditionally include dlfcn.h.
+
++2006-02-08 Jakub Jelinek
++
++ * ia64_save_regs_in_stack.s: Moved to...
++ * ia64_save_regs_in_stack.S: ... this. Add .note.GNU-stack
++ on Linux.
++
+ 2006-02-06 Jakub Jelinek
+ Anthony Green
+ Tom Tromey
+diff -urN old/boehm-gc/configure src/boehm-gc/configure
+--- old/boehm-gc/configure 2006-05-25 01:46:15.000000000 +0200
++++ src/boehm-gc/configure 2006-08-28 19:17:32.350718000 +0200
+@@ -1767,7 +1767,7 @@
+
+ # Define the identity of the package.
+ PACKAGE=gc
+- VERSION=6.3
++ VERSION=6.6
+
+
+ # Some tools Automake needs.
+@@ -5409,9 +5409,9 @@
+ _ACEOF
+
+ ;;
+- *-*-hpux*)
+- { echo "$as_me:$LINENO: WARNING: \"Only HP/UX 11 threads are supported.\"" >&5
+-echo "$as_me: WARNING: \"Only HP/UX 11 threads are supported.\"" >&2;}
++ *-*-hpux11*)
++ { echo "$as_me:$LINENO: WARNING: \"Only HP-UX 11 POSIX threads are supported.\"" >&5
++echo "$as_me: WARNING: \"Only HP-UX 11 POSIX threads are supported.\"" >&2;}
+
+ cat >>confdefs.h <<\_ACEOF
+ #define GC_HPUX_THREADS 1
+@@ -5433,6 +5433,16 @@
+ _ACEOF
+
+ THREADLIBS="-lpthread -lrt"
++ # HPUX needs REENTRANT for the _r calls.
++
++cat >>confdefs.h <<\_ACEOF
++#define _REENTRANT 1
++_ACEOF
++
++ ;;
++ *-*-hpux10*)
++ { echo "$as_me:$LINENO: WARNING: \"Only HP-UX 11 POSIX threads are supported.\"" >&5
++echo "$as_me: WARNING: \"Only HP-UX 11 POSIX threads are supported.\"" >&2;}
+ ;;
+ *-*-freebsd*)
+ { echo "$as_me:$LINENO: WARNING: \"FreeBSD does not yet fully support threads with Boehm GC.\"" >&5
+@@ -5486,107 +5496,783 @@
+ #define PARALLEL_MARK 1
+ _ACEOF
+
+- fi
+- ;;
+- *-*-osf*)
++ fi
++ ;;
++ *-*-osf*)
++
++cat >>confdefs.h <<\_ACEOF
++#define GC_OSF1_THREADS 1
++_ACEOF
++
++ if test "${enable_parallel_mark}" = yes; then
++ cat >>confdefs.h <<\_ACEOF
++#define PARALLEL_MARK 1
++_ACEOF
++
++ cat >>confdefs.h <<\_ACEOF
++#define THREAD_LOCAL_ALLOC 1
++_ACEOF
++
++ # May want to enable it in other cases, too.
++ # Measurements havent yet been done.
++ fi
++ AM_CPPFLAGS="$AM_CPPFLAGS -pthread"
++ THREADLIBS="-lpthread -lrt"
++ ;;
++ esac
++ ;;
++ win32)
++ cat >>confdefs.h <<\_ACEOF
++#define GC_WIN32_THREADS 1
++_ACEOF
++
++ ;;
++ dgux386)
++ THREADS=dgux386
++echo "$as_me:$LINENO: result: $THREADLIBS" >&5
++echo "${ECHO_T}$THREADLIBS" >&6
++ # Use pthread GCC switch
++ THREADLIBS=-pthread
++ if test "${enable_parallel_mark}" = yes; then
++ cat >>confdefs.h <<\_ACEOF
++#define PARALLEL_MARK 1
++_ACEOF
++
++ fi
++ cat >>confdefs.h <<\_ACEOF
++#define THREAD_LOCAL_ALLOC 1
++_ACEOF
++
++
++cat >>confdefs.h <<\_ACEOF
++#define GC_DGUX386_THREADS 1
++_ACEOF
++
++
++cat >>confdefs.h <<\_ACEOF
++#define DGUX_THREADS 1
++_ACEOF
++
++ # Enable _POSIX4A_DRAFT10_SOURCE with flag -pthread
++ AM_CPPFLAGS="-pthread $AM_CPPFLAGS"
++ ;;
++ aix)
++ THREADS=posix
++ THREADLIBS=-lpthread
++ cat >>confdefs.h <<\_ACEOF
++#define GC_AIX_THREADS 1
++_ACEOF
++
++ cat >>confdefs.h <<\_ACEOF
++#define _REENTRANT 1
++_ACEOF
++
++ ;;
++ decosf1 | irix | mach | os2 | solaris | dce | vxworks)
++ { { echo "$as_me:$LINENO: error: thread package $THREADS not yet supported" >&5
++echo "$as_me: error: thread package $THREADS not yet supported" >&2;}
++ { (exit 1); exit 1; }; }
++ ;;
++ *)
++ { { echo "$as_me:$LINENO: error: $THREADS is an unknown thread package" >&5
++echo "$as_me: error: $THREADS is an unknown thread package" >&2;}
++ { (exit 1); exit 1; }; }
++ ;;
++esac
++
++
++case "$host" in
++ powerpc-*-darwin*)
++ powerpc_darwin=true
++ ;;
++esac
++
++
++if test x$powerpc_darwin = xtrue; then
++ POWERPC_DARWIN_TRUE=
++ POWERPC_DARWIN_FALSE='#'
++else
++ POWERPC_DARWIN_TRUE='#'
++ POWERPC_DARWIN_FALSE=
++fi
++
++
++# Darwin needs a few extra special tests to deal with variation in the
++# system headers.
++case "$host" in
++ powerpc*-*-darwin*)
++ echo "$as_me:$LINENO: checking for ppc_thread_state_t.r0" >&5
++echo $ECHO_N "checking for ppc_thread_state_t.r0... $ECHO_C" >&6
++if test "${ac_cv_member_ppc_thread_state_t_r0+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#include
++
++int
++main ()
++{
++static ppc_thread_state_t ac_aggr;
++if (ac_aggr.r0)
++return 0;
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag"
++ || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_member_ppc_thread_state_t_r0=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#include
++
++int
++main ()
++{
++static ppc_thread_state_t ac_aggr;
++if (sizeof ac_aggr.r0)
++return 0;
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag"
++ || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_member_ppc_thread_state_t_r0=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_member_ppc_thread_state_t_r0=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_member_ppc_thread_state_t_r0" >&5
++echo "${ECHO_T}$ac_cv_member_ppc_thread_state_t_r0" >&6
++if test $ac_cv_member_ppc_thread_state_t_r0 = yes; then
++
++cat >>confdefs.h <<\_ACEOF
++#define HAS_PPC_THREAD_STATE_R0
++_ACEOF
++
++fi
++
++ echo "$as_me:$LINENO: checking for ppc_thread_state_t.__r0" >&5
++echo $ECHO_N "checking for ppc_thread_state_t.__r0... $ECHO_C" >&6
++if test "${ac_cv_member_ppc_thread_state_t___r0+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#include
++
++int
++main ()
++{
++static ppc_thread_state_t ac_aggr;
++if (ac_aggr.__r0)
++return 0;
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag"
++ || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_member_ppc_thread_state_t___r0=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#include
++
++int
++main ()
++{
++static ppc_thread_state_t ac_aggr;
++if (sizeof ac_aggr.__r0)
++return 0;
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag"
++ || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_member_ppc_thread_state_t___r0=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_member_ppc_thread_state_t___r0=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_member_ppc_thread_state_t___r0" >&5
++echo "${ECHO_T}$ac_cv_member_ppc_thread_state_t___r0" >&6
++if test $ac_cv_member_ppc_thread_state_t___r0 = yes; then
++
++cat >>confdefs.h <<\_ACEOF
++#define HAS_PPC_THREAD_STATE___R0
++_ACEOF
++
++fi
++
++ echo "$as_me:$LINENO: checking for ppc_thread_state64_t.r0" >&5
++echo $ECHO_N "checking for ppc_thread_state64_t.r0... $ECHO_C" >&6
++if test "${ac_cv_member_ppc_thread_state64_t_r0+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#include
++
++int
++main ()
++{
++static ppc_thread_state64_t ac_aggr;
++if (ac_aggr.r0)
++return 0;
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag"
++ || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_member_ppc_thread_state64_t_r0=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#include
++
++int
++main ()
++{
++static ppc_thread_state64_t ac_aggr;
++if (sizeof ac_aggr.r0)
++return 0;
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag"
++ || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_member_ppc_thread_state64_t_r0=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_member_ppc_thread_state64_t_r0=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_member_ppc_thread_state64_t_r0" >&5
++echo "${ECHO_T}$ac_cv_member_ppc_thread_state64_t_r0" >&6
++if test $ac_cv_member_ppc_thread_state64_t_r0 = yes; then
++
++cat >>confdefs.h <<\_ACEOF
++#define HAS_PPC_THREAD_STATE64_R0
++_ACEOF
++
++fi
++
++ echo "$as_me:$LINENO: checking for ppc_thread_state64_t.__r0" >&5
++echo $ECHO_N "checking for ppc_thread_state64_t.__r0... $ECHO_C" >&6
++if test "${ac_cv_member_ppc_thread_state64_t___r0+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#include
++
++int
++main ()
++{
++static ppc_thread_state64_t ac_aggr;
++if (ac_aggr.__r0)
++return 0;
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag"
++ || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_member_ppc_thread_state64_t___r0=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#include
++
++int
++main ()
++{
++static ppc_thread_state64_t ac_aggr;
++if (sizeof ac_aggr.__r0)
++return 0;
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag"
++ || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_member_ppc_thread_state64_t___r0=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_member_ppc_thread_state64_t___r0=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_member_ppc_thread_state64_t___r0" >&5
++echo "${ECHO_T}$ac_cv_member_ppc_thread_state64_t___r0" >&6
++if test $ac_cv_member_ppc_thread_state64_t___r0 = yes; then
++
++cat >>confdefs.h <<\_ACEOF
++#define HAS_PPC_THREAD_STATE64___R0
++_ACEOF
++
++fi
++
++ ;;
++ i?86*-*-darwin*)
++ echo "$as_me:$LINENO: checking for i386_thread_state_t.eax" >&5
++echo $ECHO_N "checking for i386_thread_state_t.eax... $ECHO_C" >&6
++if test "${ac_cv_member_i386_thread_state_t_eax+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#include
++
++int
++main ()
++{
++static i386_thread_state_t ac_aggr;
++if (ac_aggr.eax)
++return 0;
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag"
++ || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_member_i386_thread_state_t_eax=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#include
++
++int
++main ()
++{
++static i386_thread_state_t ac_aggr;
++if (sizeof ac_aggr.eax)
++return 0;
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag"
++ || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_member_i386_thread_state_t_eax=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_member_i386_thread_state_t_eax=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_member_i386_thread_state_t_eax" >&5
++echo "${ECHO_T}$ac_cv_member_i386_thread_state_t_eax" >&6
++if test $ac_cv_member_i386_thread_state_t_eax = yes; then
+
+ cat >>confdefs.h <<\_ACEOF
+-#define GC_OSF1_THREADS 1
+-_ACEOF
+-
+- if test "${enable_parallel_mark}" = yes; then
+- cat >>confdefs.h <<\_ACEOF
+-#define PARALLEL_MARK 1
++#define HAS_I386_THREAD_STATE_EAX
+ _ACEOF
+
+- cat >>confdefs.h <<\_ACEOF
+-#define THREAD_LOCAL_ALLOC 1
+-_ACEOF
++fi
+
+- # May want to enable it in other cases, too.
+- # Measurements havent yet been done.
+- fi
+- AM_CPPFLAGS="$AM_CPPFLAGS -pthread"
+- THREADLIBS="-lpthread -lrt"
+- ;;
+- esac
+- ;;
+- win32)
+- cat >>confdefs.h <<\_ACEOF
+-#define GC_WIN32_THREADS 1
++ echo "$as_me:$LINENO: checking for i386_thread_state_t.__eax" >&5
++echo $ECHO_N "checking for i386_thread_state_t.__eax... $ECHO_C" >&6
++if test "${ac_cv_member_i386_thread_state_t___eax+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
+ _ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#include
+
+- ;;
+- dgux386)
+- THREADS=dgux386
+-echo "$as_me:$LINENO: result: $THREADLIBS" >&5
+-echo "${ECHO_T}$THREADLIBS" >&6
+- # Use pthread GCC switch
+- THREADLIBS=-pthread
+- if test "${enable_parallel_mark}" = yes; then
+- cat >>confdefs.h <<\_ACEOF
+-#define PARALLEL_MARK 1
++int
++main ()
++{
++static i386_thread_state_t ac_aggr;
++if (ac_aggr.__eax)
++return 0;
++ ;
++ return 0;
++}
+ _ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag"
++ || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_member_i386_thread_state_t___eax=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
+
+- fi
+- cat >>confdefs.h <<\_ACEOF
+-#define THREAD_LOCAL_ALLOC 1
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
+ _ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#include
+
+-
+-cat >>confdefs.h <<\_ACEOF
+-#define GC_DGUX386_THREADS 1
++int
++main ()
++{
++static i386_thread_state_t ac_aggr;
++if (sizeof ac_aggr.__eax)
++return 0;
++ ;
++ return 0;
++}
+ _ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag"
++ || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_member_i386_thread_state_t___eax=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
+
++ac_cv_member_i386_thread_state_t___eax=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_member_i386_thread_state_t___eax" >&5
++echo "${ECHO_T}$ac_cv_member_i386_thread_state_t___eax" >&6
++if test $ac_cv_member_i386_thread_state_t___eax = yes; then
+
+ cat >>confdefs.h <<\_ACEOF
+-#define DGUX_THREADS 1
+-_ACEOF
+-
+- # Enable _POSIX4A_DRAFT10_SOURCE with flag -pthread
+- AM_CPPFLAGS="-pthread $AM_CPPFLAGS"
+- ;;
+- aix)
+- THREADS=posix
+- THREADLIBS=-lpthread
+- cat >>confdefs.h <<\_ACEOF
+-#define GC_AIX_THREADS 1
++#define HAS_I386_THREAD_STATE___EAX
+ _ACEOF
+
+- cat >>confdefs.h <<\_ACEOF
+-#define _REENTRANT 1
+-_ACEOF
++fi
+
+ ;;
+- decosf1 | irix | mach | os2 | solaris | dce | vxworks)
+- { { echo "$as_me:$LINENO: error: thread package $THREADS not yet supported" >&5
+-echo "$as_me: error: thread package $THREADS not yet supported" >&2;}
+- { (exit 1); exit 1; }; }
+- ;;
+- *)
+- { { echo "$as_me:$LINENO: error: $THREADS is an unknown thread package" >&5
+-echo "$as_me: error: $THREADS is an unknown thread package" >&2;}
+- { (exit 1); exit 1; }; }
+- ;;
+-esac
+-
+-
+-case "$host" in
+- powerpc-*-darwin*)
+- powerpc_darwin=true
+- ;;
++ *) ;;
+ esac
+
+-
+-if test x$powerpc_darwin = xtrue; then
+- POWERPC_DARWIN_TRUE=
+- POWERPC_DARWIN_FALSE='#'
+-else
+- POWERPC_DARWIN_TRUE='#'
+- POWERPC_DARWIN_FALSE=
+-fi
+-
+-
+ # We never want libdl on darwin. It is a fake libdl that just ends up making
+ # dyld calls anyway
+ case "$host" in
+@@ -5759,6 +6445,119 @@
+ ;;
+ esac
+
++# Checks for pthreads functions
++#
++oldLIBS="$LIBS"
++LIBS="$LIBS $THREADLIBS"
++
++for ac_func in pthread_getattr_np
++do
++as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
++echo "$as_me:$LINENO: checking for $ac_func" >&5
++echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
++if eval "test \"\${$as_ac_var+set}\" = set"; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ if test x$gcc_no_link = xyes; then
++ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
++echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
++ { (exit 1); exit 1; }; }
++fi
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++/* Define $ac_func to an innocuous variant, in case declares $ac_func.
++ For example, HP-UX 11i declares gettimeofday. */
++#define $ac_func innocuous_$ac_func
++
++/* System header to define __stub macros and hopefully few prototypes,
++ which can conflict with char $ac_func (); below.
++ Prefer to if __STDC__ is defined, since
++ exists even on freestanding compilers. */
++
++#ifdef __STDC__
++# include
++#else
++# include
++#endif
++
++#undef $ac_func
++
++/* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++{
++#endif
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char $ac_func ();
++/* The GNU C library defines this for functions which it implements
++ to always fail with ENOSYS. Some functions are actually named
++ something starting with __ and the normal name is an alias. */
++#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
++choke me
++#else
++char (*f) () = $ac_func;
++#endif
++#ifdef __cplusplus
++}
++#endif
++
++int
++main ()
++{
++return f != $ac_func;
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag"
++ || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ eval "$as_ac_var=yes"
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++eval "$as_ac_var=no"
++fi
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
++echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
++if test `eval echo '${'$as_ac_var'}'` = yes; then
++ cat >>confdefs.h <<_ACEOF
++#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
++_ACEOF
++
++fi
++done
++
++LIBS="$oldLIBS"
++
+ # Configuration of machine-dependent code
+ #
+ # We don't set NO_EXECUTE_PERMISSION by default because gcj (and
+@@ -6627,29 +7426,6 @@
+
+ fi
+
+-symver=
+-case "$target" in
+- *-*-linux* )
+- cat > conftest.c <
+-void *tf (void *arg) { (void) arg; return NULL; }
+-int main (void) { pthread_t th; pthread_create (&th, NULL, tf, NULL); return 0; }
+-EOF
+- if $CC $CFLAGS -pthread -o conftest conftest.c > /dev/null 2>&1; then
+- symver=`readelf -s conftest 2> /dev/null | sed -n '/UND pthread_create@/{s/^.*@//;s/ .*$//;p;q}'`
+- fi
+- rm -f conftest conftest.c
+- ;;
+-esac
+-if test -n "$symver"; then
+-
+-cat >>confdefs.h <<_ACEOF
+-#define GC_PTHREAD_SYM_VERSION "$symver"
+-_ACEOF
+-
+-fi
+-
+-
+ if test -n "$with_cross_host" &&
+ test x"$with_cross_host" != x"no"; then
+ toolexecdir='$(exec_prefix)/$(target_noncanonical)'
+diff -urN old/boehm-gc/configure.ac src/boehm-gc/configure.ac
+--- old/boehm-gc/configure.ac 2006-02-07 02:05:55.000000000 +0100
++++ src/boehm-gc/configure.ac 2006-08-28 19:17:32.340718000 +0200
+@@ -1,4 +1,4 @@
+-# Copyright (c) 1999, 2000, 2001, 2002, 2003 by Red Hat, Inc. All rights reserved.
++# Copyright (c) 1999, 2000, 2001, 2002, 2003, 2006 by Red Hat, Inc. All rights reserved.
+ # Copyright 2004 Nathanael Nerode
+ #
+ # THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
+@@ -36,7 +36,7 @@
+ mkinstalldirs="`cd $ac_aux_dir && ${PWDCMD-pwd}`/mkinstalldirs"
+ AC_SUBST(mkinstalldirs)
+
+-AM_INIT_AUTOMAKE(gc, 6.3, no-define)
++AM_INIT_AUTOMAKE(gc, 6.6, no-define)
+
+ # The autoconf 2.5x version of the no-executables hack.
+ GCC_NO_EXECUTABLES
+@@ -140,8 +140,8 @@
+ AC_DEFINE(GC_AIX_THREADS,1,[support AIX threads])
+ AC_DEFINE(_REENTRANT,1)
+ ;;
+- *-*-hpux*)
+- AC_MSG_WARN("Only HP/UX 11 threads are supported.")
++ *-*-hpux11*)
++ AC_MSG_WARN("Only HP-UX 11 POSIX threads are supported.")
+ AC_DEFINE(GC_HPUX_THREADS,1,[enables support for HP/UX 11 pthreads])
+ AC_DEFINE(_POSIX_C_SOURCE,199506L,[POSIX version of C Source])
+ if test "${enable_parallel_mark}" = yes; then
+@@ -149,6 +149,11 @@
+ fi
+ AC_DEFINE(THREAD_LOCAL_ALLOC,1)
+ THREADLIBS="-lpthread -lrt"
++ # HPUX needs REENTRANT for the _r calls.
++ AC_DEFINE(_REENTRANT, 1, [Required define if using POSIX threads])
++ ;;
++ *-*-hpux10*)
++ AC_MSG_WARN("Only HP-UX 11 POSIX threads are supported.")
+ ;;
+ *-*-freebsd*)
+ AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.")
+@@ -227,6 +232,39 @@
+ esac
+ AM_CONDITIONAL(POWERPC_DARWIN,test x$powerpc_darwin = xtrue)
+
++# Darwin needs a few extra special tests to deal with variation in the
++# system headers.
++case "$host" in
++ powerpc*-*-darwin*)
++ AC_CHECK_MEMBER(ppc_thread_state_t.r0,
++ AC_DEFINE(HAS_PPC_THREAD_STATE_R0,,[ppc_thread_state_t has field r0]),,
++ [#include ])
++ AC_CHECK_MEMBER(ppc_thread_state_t.__r0,
++ AC_DEFINE(HAS_PPC_THREAD_STATE___R0,,dnl
++ [ppc_thread_state_t has field __r0]),,
++ [#include ])
++ AC_CHECK_MEMBER(ppc_thread_state64_t.r0,
++ AC_DEFINE(HAS_PPC_THREAD_STATE64_R0,,dnl
++ [ppc_thread_state64_t has field r0]),,
++ [#include ])
++ AC_CHECK_MEMBER(ppc_thread_state64_t.__r0,
++ AC_DEFINE(HAS_PPC_THREAD_STATE64___R0,,dnl
++ [ppc_thread_state64_t has field __r0]),,
++ [#include ])
++ ;;
++ i?86*-*-darwin*)
++ AC_CHECK_MEMBER(i386_thread_state_t.eax,
++ AC_DEFINE(HAS_I386_THREAD_STATE_EAX,,dnl
++ [i386_thread_state_t has field eax]),,
++ [#include ])
++ AC_CHECK_MEMBER(i386_thread_state_t.__eax,
++ AC_DEFINE(HAS_I386_THREAD_STATE___EAX,,dnl
++ [i386_thread_state_t has field __eax]),,
++ [#include ])
++ ;;
++ *) ;;
++esac
++
+ # We never want libdl on darwin. It is a fake libdl that just ends up making
+ # dyld calls anyway
+ case "$host" in
+@@ -291,6 +329,13 @@
+ ;;
+ esac
+
++# Checks for pthreads functions
++#
++oldLIBS="$LIBS"
++LIBS="$LIBS $THREADLIBS"
++AC_CHECK_FUNCS([pthread_getattr_np])
++LIBS="$oldLIBS"
++
+ # Configuration of machine-dependent code
+ #
+ # We don't set NO_EXECUTE_PERMISSION by default because gcj (and
+@@ -450,25 +495,6 @@
+ AC_DEFINE(USE_MMAP, 1, [use MMAP instead of sbrk to get new memory])
+ fi
+
+-symver=
+-case "$target" in
+- *-*-linux* )
+- cat > conftest.c <
+-void *tf (void *arg) { (void) arg; return NULL; }
+-int main (void) { pthread_t th; pthread_create (&th, NULL, tf, NULL); return 0; }
+-EOF
+- if $CC $CFLAGS -pthread -o conftest conftest.c > /dev/null 2>&1; then
+- symver=`readelf -s conftest 2> /dev/null | sed -n '/UND pthread_create@/{s/^.*@//;s/ .*$//;p;q}'`
+- fi
+- rm -f conftest conftest.c
+- ;;
+-esac
+-if test -n "$symver"; then
+- AC_DEFINE_UNQUOTED(GC_PTHREAD_SYM_VERSION, "$symver", [symbol version of pthread_create])
+-fi
+-
+-
+ if test -n "$with_cross_host" &&
+ test x"$with_cross_host" != x"no"; then
+ toolexecdir='$(exec_prefix)/$(target_noncanonical)'
+diff -urN old/boehm-gc/cord/cordprnt.c src/boehm-gc/cord/cordprnt.c
+--- old/boehm-gc/cord/cordprnt.c 2004-08-14 01:05:36.000000000 +0200
++++ src/boehm-gc/cord/cordprnt.c 2006-08-28 19:14:18.110718000 +0200
+@@ -59,7 +59,7 @@
+ register int result = 0;
+ register int current_number = 0;
+ register int saw_period = 0;
+- register int saw_number;
++ register int saw_number = 0;
+ register int chars_so_far = 0;
+ register char current;
+
+@@ -243,7 +243,7 @@
+ char * str = va_arg(args, char *);
+ register char c;
+
+- while (c = *str++) {
++ while ((c = *str++)) {
+ CORD_ec_append(result, c);
+ }
+ goto done;
+@@ -320,7 +320,7 @@
+ if (buf != result[0].ec_bufptr) {
+ register char c;
+
+- while (c = *buf++) {
++ while ((c = *buf++)) {
+ CORD_ec_append(result, c);
+ }
+ } else {
+diff -urN old/boehm-gc/cord/cordtest.c src/boehm-gc/cord/cordtest.c
+--- old/boehm-gc/cord/cordtest.c 2004-08-14 01:05:36.000000000 +0200
++++ src/boehm-gc/cord/cordtest.c 2006-08-28 19:14:18.120718000 +0200
+@@ -221,7 +221,7 @@
+ if (CORD_cmp(result, result2) != 0)ABORT("CORD_sprintf goofed 5");
+ }
+
+-main()
++int main()
+ {
+ # ifdef THINK_C
+ printf("cordtest:\n");
+diff -urN old/boehm-gc/darwin_stop_world.c src/boehm-gc/darwin_stop_world.c
+--- old/boehm-gc/darwin_stop_world.c 2006-04-11 23:55:41.000000000 +0200
++++ src/boehm-gc/darwin_stop_world.c 2006-08-28 19:14:18.120718000 +0200
+@@ -14,7 +14,44 @@
+ Page 50: "If a leaf procedure's red zone usage would exceed 224 bytes, then
+ it must set up a stack frame just like routines that call other routines."
+ */
+-#define PPC_RED_ZONE_SIZE 224
++#if defined(__ppc__)
++# define PPC_RED_ZONE_SIZE 224
++#elif defined(__ppc64__)
++# define PPC_RED_ZONE_SIZE 320
++#endif
++
++/* Try to work out the right way to access thread state structure members.
++ The structure has changed its definition in different Darwin versions. */
++#if defined(__ppc__)
++# define THREAD_STATE ppc_thread_state_t
++# if defined (HAS_PPC_THREAD_STATE_R0)
++# define THREAD_FLD(x) x
++# elif defined (HAS_PPC_THREAD_STATE___R0)
++# define THREAD_FLD(x) __ ## x
++# else
++# error can not work out how to access fields of ppc_thread_state_t
++# endif
++#elif defined(__ppc64__)
++# define THREAD_STATE ppc_thread_state64_t
++# if defined (HAS_PPC_THREAD_STATE64_R0)
++# define THREAD_FLD(x) x
++# elif defined (HAS_PPC_THREAD_STATE64___R0)
++# define THREAD_FLD(x) __ ## x
++# else
++# error can not work out how to access fields of ppc_thread_state64_t
++# endif
++#elif defined(__i386__)
++# define THREAD_STATE i386_thread_state_t
++# if defined (HAS_I386_THREAD_STATE_EAX)
++# define THREAD_FLD(x) x
++# elif defined (HAS_I386_THREAD_STATE___EAX)
++# define THREAD_FLD(x) __ ## x
++# else
++# error can not work out how to access fields of i386_thread_state_t
++# endif
++#else
++# error unknown architecture
++#endif
+
+ typedef struct StackFrame {
+ unsigned long savedSP;
+@@ -24,12 +61,17 @@
+ unsigned long savedRTOC;
+ } StackFrame;
+
+-
+-unsigned int FindTopOfStack(unsigned int stack_start) {
++unsigned long FindTopOfStack(unsigned int stack_start) {
+ StackFrame *frame;
+
+ if (stack_start == 0) {
+- __asm__ volatile("lwz %0,0(r1)" : "=r" (frame));
++# ifdef POWERPC
++# if CPP_WORDSZ == 32
++ __asm__ volatile("lwz %0,0(r1)" : "=r" (frame));
++# else
++ __asm__ volatile("ld %0,0(r1)" : "=r" (frame));
++# endif
++# endif
+ } else {
+ frame = (StackFrame *)stack_start;
+ }
+@@ -38,7 +80,7 @@
+ /* GC_printf1("FindTopOfStack start at sp = %p\n", frame); */
+ # endif
+ do {
+- if (frame->savedSP == NULL) break;
++ if (frame->savedSP == 0) break;
+ /* if there are no more stack frames, stop */
+
+ frame = (StackFrame*)frame->savedSP;
+@@ -54,9 +96,88 @@
+ /* GC_printf1("FindTopOfStack finish at sp = %p\n", frame); */
+ # endif
+
+- return (unsigned int)frame;
++ return (unsigned long)frame;
+ }
+
++#ifdef DARWIN_DONT_PARSE_STACK
++void GC_push_all_stacks() {
++ int i;
++ kern_return_t r;
++ GC_thread p;
++ pthread_t me;
++ ptr_t lo, hi;
++ THREAD_STATE state;
++ mach_msg_type_number_t thread_state_count = MACHINE_THREAD_STATE_COUNT;
++
++ me = pthread_self();
++ if (!GC_thr_initialized) GC_thr_init();
++
++ for(i=0;inext) {
++ if(p -> flags & FINISHED) continue;
++ if(pthread_equal(p->id,me)) {
++ lo = GC_approx_sp();
++ } else {
++ /* Get the thread state (registers, etc) */
++ r = thread_get_state(
++ p->stop_info.mach_thread,
++ MACHINE_THREAD_STATE,
++ (natural_t*)&state,
++ &thread_state_count);
++ if(r != KERN_SUCCESS) ABORT("thread_get_state failed");
++
++ lo = (void*)(state . THREAD_FLD (r1) - PPC_RED_ZONE_SIZE);
++
++ GC_push_one(state . THREAD_FLD (r0));
++ GC_push_one(state . THREAD_FLD (r2));
++ GC_push_one(state . THREAD_FLD (r3));
++ GC_push_one(state . THREAD_FLD (r4));
++ GC_push_one(state . THREAD_FLD (r5));
++ GC_push_one(state . THREAD_FLD (r6));
++ GC_push_one(state . THREAD_FLD (r7));
++ GC_push_one(state . THREAD_FLD (r8));
++ GC_push_one(state . THREAD_FLD (r9));
++ GC_push_one(state . THREAD_FLD (r10));
++ GC_push_one(state . THREAD_FLD (r11));
++ GC_push_one(state . THREAD_FLD (r12));
++ GC_push_one(state . THREAD_FLD (r13));
++ GC_push_one(state . THREAD_FLD (r14));
++ GC_push_one(state . THREAD_FLD (r15));
++ GC_push_one(state . THREAD_FLD (r16));
++ GC_push_one(state . THREAD_FLD (r17));
++ GC_push_one(state . THREAD_FLD (r18));
++ GC_push_one(state . THREAD_FLD (r19));
++ GC_push_one(state . THREAD_FLD (r20));
++ GC_push_one(state . THREAD_FLD (r21));
++ GC_push_one(state . THREAD_FLD (r22));
++ GC_push_one(state . THREAD_FLD (r23));
++ GC_push_one(state . THREAD_FLD (r24));
++ GC_push_one(state . THREAD_FLD (r25));
++ GC_push_one(state . THREAD_FLD (r26));
++ GC_push_one(state . THREAD_FLD (r27));
++ GC_push_one(state . THREAD_FLD (r28));
++ GC_push_one(state . THREAD_FLD (r29));
++ GC_push_one(state . THREAD_FLD (r30));
++ GC_push_one(state . THREAD_FLD (r31));
++ } /* p != me */
++ if(p->flags & MAIN_THREAD)
++ hi = GC_stackbottom;
++ else
++ hi = p->stack_end;
++#if DEBUG_THREADS
++ GC_printf3("Darwin: Stack for thread 0x%lx = [%lx,%lx)\n",
++ (unsigned long) p -> id,
++ (unsigned long) lo,
++ (unsigned long) hi
++ );
++#endif
++ GC_push_all_stack(lo,hi);
++ } /* for(p=GC_threads[i]...) */
++ } /* for(i=0;ip_flags & PF_W) ) break;
+ start = ((char *)(p->p_vaddr)) + info->dlpi_addr;
++
++ if (GC_has_static_roots
++ && !GC_has_static_roots(info->dlpi_name, start, p->p_memsz))
++ break;
++
+ GC_add_roots_inner(start, start + p->p_memsz, TRUE);
+ }
+ break;
+@@ -485,7 +509,6 @@
+ GC_FirstDLOpenedLinkMap()
+ {
+ ElfW(Dyn) *dp;
+- struct r_debug *r;
+ static struct link_map *cachedResult = 0;
+
+ if( _DYNAMIC == 0) {
+@@ -494,6 +517,12 @@
+ if( cachedResult == 0 ) {
+ int tag;
+ for( dp = _DYNAMIC; (tag = dp->d_tag) != 0; dp++ ) {
++ /* FIXME: The DT_DEBUG header is not mandated by the */
++ /* ELF spec. This code appears to be dependent on */
++ /* idiosynchracies of older GNU tool chains. If this code */
++ /* fails for you, the real problem is probably that it is */
++ /* being used at all. You should be getting the */
++ /* dl_iterate_phdr version. */
+ if( tag == DT_DEBUG ) {
+ struct link_map *lm
+ = ((struct r_debug *)(dp->d_un.d_ptr))->r_map;
+@@ -618,7 +647,8 @@
+ }
+ for (i = 0; i < needed_sz; i++) {
+ flags = addr_map[i].pr_mflags;
+- if ((flags & (MA_BREAK | MA_STACK | MA_PHYS)) != 0) goto irrelevant;
++ if ((flags & (MA_BREAK | MA_STACK | MA_PHYS
++ | MA_FETCHOP | MA_NOTCACHED)) != 0) goto irrelevant;
+ if ((flags & (MA_READ | MA_WRITE)) != (MA_READ | MA_WRITE))
+ goto irrelevant;
+ /* The latter test is empirically useless in very old Irix */
+@@ -758,25 +788,27 @@
+
+ /* Should [start, start+len) be treated as a frame buffer */
+ /* and ignored? */
+- /* Unfortunately, we currently have no real way to tell */
+- /* automatically, and rely largely on user input. */
+- /* FIXME: If we had more data on this phenomenon (e.g. */
+- /* is start aligned to a MB multiple?) we should be able to */
+- /* do better. */
++ /* Unfortunately, we currently are not quite sure how to tell */
++ /* this automatically, and rely largely on user input. */
++ /* We expect that any mapping with type MEM_MAPPED (which */
++ /* apparently excludes library data sections) can be safely */
++ /* ignored. But we're too chicken to do that in this */
++ /* version. */
+ /* Based on a very limited sample, it appears that: */
+- /* - Frame buffer mappings appear as mappings of length */
+- /* 2**n MB - 192K. (We guess the 192K can vary a bit.) */
+- /* - Have a stating address at best 64K aligned. */
+- /* I'd love more information about the mapping, since I */
+- /* can't reproduce the problem. */
+- static GC_bool is_frame_buffer(ptr_t start, size_t len)
++ /* - Frame buffer mappings appear as mappings of large */
++ /* length, usually a bit less than a power of two. */
++ /* - The definition of "a bit less" in the above cannot */
++ /* be made more precise. */
++ /* - Have a starting address at best 64K aligned. */
++ /* - Have type == MEM_MAPPED. */
++ static GC_bool is_frame_buffer(ptr_t start, size_t len, DWORD tp)
+ {
+ static GC_bool initialized = FALSE;
+ # define MB (1024*1024)
+ # define DEFAULT_FB_MB 15
+ # define MIN_FB_MB 3
+
+- if (GC_disallow_ignore_fb) return FALSE;
++ if (GC_disallow_ignore_fb || tp != MEM_MAPPED) return FALSE;
+ if (!initialized) {
+ char * ignore_fb_string = GETENV("GC_IGNORE_FB");
+
+@@ -828,6 +860,9 @@
+ }
+ # endif /* DEBUG_VIRTUALQUERY */
+
++ extern GC_bool GC_wnt; /* Is Windows NT derivative. */
++ /* Defined and set in os_dep.c. */
++
+ void GC_register_dynamic_libraries()
+ {
+ MEMORY_BASIC_INFORMATION buf;
+@@ -869,7 +904,12 @@
+ * !is_frame_buffer(p, buf.RegionSize, buf.Type)
+ * instead of just checking for MEM_IMAGE.
+ * If something breaks, change it back. */
+- && buf.Type == MEM_IMAGE) {
++ /* There is some evidence that we cannot always
++ * ignore MEM_PRIVATE sections under Windows ME
++ * and predecessors. Hence we now also check for
++ * that case. */
++ && (buf.Type == MEM_IMAGE ||
++ !GC_wnt && buf.Type == MEM_PRIVATE)) {
+ # ifdef DEBUG_VIRTUALQUERY
+ GC_dump_meminfo(&buf);
+ # endif
+@@ -1125,21 +1165,22 @@
+ static void GC_dyld_image_add(struct mach_header* hdr, unsigned long slide) {
+ unsigned long start,end,i;
+ const struct section *sec;
++ if (GC_no_dls) return;
+ for(i=0;isize == 0) continue;
+- start = slide + sec->addr;
+- end = start + sec->size;
+-# ifdef DARWIN_DEBUG
+- GC_printf4("Adding section at %p-%p (%lu bytes) from image %s\n",
++ if(sec == NULL || sec->size == 0) continue;
++ start = slide + sec->addr;
++ end = start + sec->size;
++# ifdef DARWIN_DEBUG
++ GC_printf4("Adding section at %p-%p (%lu bytes) from image %s\n",
+ start,end,sec->size,GC_dyld_name_for_hdr(hdr));
+-# endif
++# endif
+ GC_add_roots((char*)start,(char*)end);
+- }
+-# ifdef DARWIN_DEBUG
+- GC_print_static_roots();
+-# endif
++ }
++# ifdef DARWIN_DEBUG
++ GC_print_static_roots();
++# endif
+ }
+
+ /* This should never be called by a thread holding the lock */
+@@ -1152,15 +1193,15 @@
+ if(sec == NULL || sec->size == 0) continue;
+ start = slide + sec->addr;
+ end = start + sec->size;
+-# ifdef DARWIN_DEBUG
++# ifdef DARWIN_DEBUG
+ GC_printf4("Removing section at %p-%p (%lu bytes) from image %s\n",
+ start,end,sec->size,GC_dyld_name_for_hdr(hdr));
+ # endif
+ GC_remove_roots((char*)start,(char*)end);
+ }
+-# ifdef DARWIN_DEBUG
+- GC_print_static_roots();
+-# endif
++# ifdef DARWIN_DEBUG
++ GC_print_static_roots();
++# endif
+ }
+
+ void GC_register_dynamic_libraries() {
+diff -urN old/boehm-gc/include/gc_config.h.in src/boehm-gc/include/gc_config.h.in
+--- old/boehm-gc/include/gc_config.h.in 2006-02-07 02:05:55.000000000 +0100
++++ src/boehm-gc/include/gc_config.h.in 2006-08-28 19:17:32.350718000 +0200
+@@ -45,9 +45,6 @@
+ /* support for Tru64 pthreads */
+ #undef GC_OSF1_THREADS
+
+-/* symbol version of pthread_create */
+-#undef GC_PTHREAD_SYM_VERSION
+-
+ /* support for Solaris pthreads */
+ #undef GC_SOLARIS_PTHREADS
+
+@@ -57,12 +54,33 @@
+ /* support for win32 threads */
+ #undef GC_WIN32_THREADS
+
++/* i386_thread_state_t has field eax */
++#undef HAS_I386_THREAD_STATE_EAX
++
++/* i386_thread_state_t has field __eax */
++#undef HAS_I386_THREAD_STATE___EAX
++
++/* ppc_thread_state64_t has field r0 */
++#undef HAS_PPC_THREAD_STATE64_R0
++
++/* ppc_thread_state64_t has field __r0 */
++#undef HAS_PPC_THREAD_STATE64___R0
++
++/* ppc_thread_state_t has field r0 */
++#undef HAS_PPC_THREAD_STATE_R0
++
++/* ppc_thread_state_t has field __r0 */
++#undef HAS_PPC_THREAD_STATE___R0
++
+ /* Define to 1 if you have the header file. */
+ #undef HAVE_INTTYPES_H
+
+ /* Define to 1 if you have the header file. */
+ #undef HAVE_MEMORY_H
+
++/* Define to 1 if you have the `pthread_getattr_np' function. */
++#undef HAVE_PTHREAD_GETATTR_NP
++
+ /* Define to 1 if you have the header file. */
+ #undef HAVE_STDINT_H
+
+@@ -154,5 +172,5 @@
+ /* POSIX version of C Source */
+ #undef _POSIX_C_SOURCE
+
+-/* Use reentrant code */
++/* Required define if using POSIX threads */
+ #undef _REENTRANT
+diff -urN old/boehm-gc/include/gc_config_macros.h src/boehm-gc/include/gc_config_macros.h
+--- old/boehm-gc/include/gc_config_macros.h 2004-08-14 01:05:36.000000000 +0200
++++ src/boehm-gc/include/gc_config_macros.h 2006-08-28 19:14:18.130718000 +0200
+@@ -59,6 +59,10 @@
+ # define GC_DGUX386_THREADS
+ # define GC_PTHREADS
+ # endif
++# if defined(_AIX)
++# define GC_AIX_THREADS
++# define GC_PTHREADS
++# endif
+ #endif /* GC_THREADS */
+
+ #if defined(GC_THREADS) && !defined(GC_PTHREADS) && \
+diff -urN old/boehm-gc/include/gc_cpp.h src/boehm-gc/include/gc_cpp.h
+--- old/boehm-gc/include/gc_cpp.h 2004-08-14 01:05:36.000000000 +0200
++++ src/boehm-gc/include/gc_cpp.h 2006-08-28 19:14:18.130718000 +0200
+@@ -74,7 +74,7 @@
+ collectable. See the interface gc.h for low-level facilities for
+ handling such cycles of objects with clean-up.
+
+-The collector cannot guarrantee that it will find all inaccessible
++The collector cannot guarantee that it will find all inaccessible
+ objects. In practice, it finds almost all of them.
+
+
+diff -urN old/boehm-gc/include/gc_ext_config.h.in src/boehm-gc/include/gc_ext_config.h.in
+--- old/boehm-gc/include/gc_ext_config.h.in 2006-02-07 02:05:55.000000000 +0100
++++ src/boehm-gc/include/gc_ext_config.h.in 2006-08-28 19:17:32.350718000 +0200
+@@ -4,4 +4,4 @@
+
+ #undef THREAD_LOCAL_ALLOC
+
+-#undef GC_PTHREAD_SYM_VERSION
++#undef HAVE_PTHREAD_GETATTR_NP
+diff -urN old/boehm-gc/include/gc.h src/boehm-gc/include/gc.h
+--- old/boehm-gc/include/gc.h 2005-01-02 04:35:57.000000000 +0100
++++ src/boehm-gc/include/gc.h 2006-08-28 19:17:32.340718000 +0200
+@@ -55,7 +55,7 @@
+ # include
+ # include "gc_config_macros.h"
+
+-# if defined(__STDC__) || defined(__cplusplus)
++# if defined(__STDC__) || defined(__cplusplus) || defined(_AIX)
+ # define GC_PROTO(args) args
+ typedef void * GC_PTR;
+ # define GC_CONST const
+@@ -69,7 +69,6 @@
+ extern "C" {
+ # endif
+
+-
+ /* Define word and signed_word to be unsigned and signed types of the */
+ /* size as char * or void *. There seems to be no way to do this */
+ /* even semi-portably. The following is probably no better/worse */
+@@ -152,7 +151,7 @@
+ /* ordered finalization. Default value is */
+ /* determined by JAVA_FINALIZATION macro. */
+
+-GC_API void (* GC_finalizer_notifier)();
++GC_API void (* GC_finalizer_notifier) GC_PROTO((void));
+ /* Invoked by the collector when there are */
+ /* objects to be finalized. Invoked at most */
+ /* once per GC cycle. Never invoked unless */
+@@ -214,7 +213,7 @@
+ /* least N/GC_free_space_divisor bytes between */
+ /* collections, where N is the heap size plus */
+ /* a rough estimate of the root set size. */
+- /* Initially, GC_free_space_divisor = 4. */
++ /* Initially, GC_free_space_divisor = 3. */
+ /* Increasing its value will use less space */
+ /* but more collection time. Decreasing it */
+ /* will appreciably decrease collection time */
+@@ -340,6 +339,9 @@
+ /* the base of the user object. */
+ /* Return 0 if displaced_pointer doesn't point to within a valid */
+ /* object. */
++/* Note that a deallocated object in the garbage collected heap */
++/* may be considered valid, even if it has been deallocated with */
++/* GC_free. */
+ GC_API GC_PTR GC_base GC_PROTO((GC_PTR displaced_pointer));
+
+ /* Given a pointer to the base of an object, return its size in bytes. */
+@@ -877,7 +879,7 @@
+
+ /* Safer assignment of a pointer to a nonstack location. */
+ #ifdef GC_DEBUG
+-# ifdef __STDC__
++# if defined(__STDC__) || defined(_AIX)
+ # define GC_PTR_STORE(p, q) \
+ (*(void **)GC_is_visible(p) = GC_is_valid_displacement(q))
+ # else
+@@ -909,6 +911,25 @@
+ # if defined(PCR) || defined(GC_SOLARIS_THREADS) || \
+ defined(GC_PTHREADS) || defined(GC_WIN32_THREADS)
+ /* Any flavor of threads except SRC_M3. */
++
++/* Register the current thread as a new thread whose stack(s) should */
++/* be traced by the GC. */
++/* If a platform does not implicitly do so, this must be called before */
++/* a thread can allocate garbage collected memory, or assign pointers */
++/* to the garbage collected heap. Once registered, a thread will be */
++/* stopped during garbage collections. */
++GC_API void GC_register_my_thread GC_PROTO((void));
++
++/* Register the current thread, with the indicated stack base, as */
++/* a new thread whose stack(s) should be traced by the GC. If a */
++/* platform does not implicitly do so, this must be called before a */
++/* thread can allocate garbage collected memory, or assign pointers */
++/* to the garbage collected heap. Once registered, a thread will be */
++/* stopped during garbage collections. */
++GC_API void GC_unregister_my_thread GC_PROTO((void));
++
++GC_API GC_PTR GC_get_thread_stack_base GC_PROTO((void));
++
+ /* This returns a list of objects, linked through their first */
+ /* word. Its use can greatly reduce lock contention problems, since */
+ /* the allocation lock can be acquired and released many fewer times. */
+@@ -918,10 +939,19 @@
+ GC_PTR GC_malloc_many(size_t lb);
+ #define GC_NEXT(p) (*(GC_PTR *)(p)) /* Retrieve the next element */
+ /* in returned list. */
+-extern void GC_thr_init(); /* Needed for Solaris/X86 */
++extern void GC_thr_init GC_PROTO((void));/* Needed for Solaris/X86 */
+
+ #endif /* THREADS && !SRC_M3 */
+
++/* Register a callback to control the scanning of dynamic libraries.
++ When the GC scans the static data of a dynamic library, it will
++ first call a user-supplied routine with filename of the library and
++ the address and length of the memory region. This routine should
++ return nonzero if that region should be scanned. */
++GC_API void GC_register_has_static_roots_callback
++ (int (*callback)(const char *, void *, size_t));
++
++
+ #if defined(GC_WIN32_THREADS) && !defined(__CYGWIN32__) && !defined(__CYGWIN__)
+ # include
+
+@@ -972,12 +1002,32 @@
+ # define GC_INIT() { extern end, etext; \
+ GC_noop(&end, &etext); }
+ #else
+-# if defined(__CYGWIN32__) && defined(GC_DLL) || defined (_AIX)
++# if defined(__CYGWIN32__) || defined (_AIX)
+ /*
+ * Similarly gnu-win32 DLLs need explicit initialization from
+ * the main program, as does AIX.
+ */
+-# define GC_INIT() { GC_add_roots(DATASTART, DATAEND); }
++# ifdef __CYGWIN32__
++ extern int _data_start__[];
++ extern int _data_end__[];
++ extern int _bss_start__[];
++ extern int _bss_end__[];
++# define GC_MAX(x,y) ((x) > (y) ? (x) : (y))
++# define GC_MIN(x,y) ((x) < (y) ? (x) : (y))
++# define GC_DATASTART ((GC_PTR) GC_MIN(_data_start__, _bss_start__))
++# define GC_DATAEND ((GC_PTR) GC_MAX(_data_end__, _bss_end__))
++# ifdef GC_DLL
++# define GC_INIT() { GC_add_roots(GC_DATASTART, GC_DATAEND); }
++# else
++# define GC_INIT()
++# endif
++# endif
++# if defined(_AIX)
++ extern int _data[], _end[];
++# define GC_DATASTART ((GC_PTR)((ulong)_data))
++# define GC_DATAEND ((GC_PTR)((ulong)_end))
++# define GC_INIT() { GC_add_roots(GC_DATASTART, GC_DATAEND); }
++# endif
+ # else
+ # if defined(__APPLE__) && defined(__MACH__) || defined(GC_WIN32_THREADS)
+ # define GC_INIT() { GC_init(); }
+@@ -1008,4 +1058,14 @@
+ } /* end of extern "C" */
+ #endif
+
++/* External thread suspension support. These functions do not implement
++ * suspension counts or any other higher-level abstraction. Threads which
++ * have been suspended numerous times will resume with the very first call
++ * to GC_resume_thread.
++ */
++#if defined(GC_PTHREADS) && !defined(GC_SOLARIS_THREADS) \
++ && !defined(GC_WIN32_THREADS) && !defined(GC_DARWIN_THREADS)
++GC_API void GC_suspend_thread GC_PROTO((pthread_t));
++GC_API void GC_resume_thread GC_PROTO((pthread_t));
++#endif
+ #endif /* _GC_H */
+diff -urN old/boehm-gc/include/gc_pthread_redirects.h src/boehm-gc/include/gc_pthread_redirects.h
+--- old/boehm-gc/include/gc_pthread_redirects.h 2006-02-07 02:05:55.000000000 +0100
++++ src/boehm-gc/include/gc_pthread_redirects.h 2006-08-28 19:17:32.350718000 +0200
+@@ -68,9 +68,7 @@
+ # undef pthread_detach
+ #endif
+
+-#ifndef GC_PTHREAD_SYM_VERSION
+ # define pthread_create GC_pthread_create
+-#endif
+ # define pthread_join GC_pthread_join
+ # define pthread_detach GC_pthread_detach
+
+diff -urN old/boehm-gc/include/Makefile.in src/boehm-gc/include/Makefile.in
+--- old/boehm-gc/include/Makefile.in 2005-03-02 00:25:50.000000000 +0100
++++ src/boehm-gc/include/Makefile.in 2006-08-28 19:14:18.130718000 +0200
+@@ -1,8 +1,8 @@
+-# Makefile.in generated by automake 1.9.3 from Makefile.am.
++# Makefile.in generated by automake 1.9.6 from Makefile.am.
+ # @configure_input@
+
+ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+-# 2003, 2004 Free Software Foundation, Inc.
++# 2003, 2004, 2005 Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+ # gives unlimited permission to copy and/or distribute it,
+ # with or without modifications, as long as this notice is preserved.
+@@ -43,6 +43,8 @@
+ $(srcdir)/gc_ext_config.h.in
+ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
++ $(top_srcdir)/../config/depstand.m4 \
++ $(top_srcdir)/../config/lead-dot.m4 \
+ $(top_srcdir)/../config/no-executables.m4 \
+ $(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
+ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+diff -urN old/boehm-gc/include/new_gc_alloc.h src/boehm-gc/include/new_gc_alloc.h
+--- old/boehm-gc/include/new_gc_alloc.h 2004-08-14 01:05:36.000000000 +0200
++++ src/boehm-gc/include/new_gc_alloc.h 2006-08-28 19:14:18.130718000 +0200
+@@ -109,7 +109,7 @@
+ enum { GC_word_alignment = GC_byte_alignment/GC_bytes_per_word };
+
+ inline void * &GC_obj_link(void * p)
+-{ return *(void **)p; }
++{ return *reinterpret_cast(p); }
+
+ // Compute a number of words >= n+1 bytes.
+ // The +1 allows for pointers one past the end.
+@@ -228,7 +228,7 @@
+ } else {
+ flh = GC_objfreelist_ptr + nwords;
+ GC_obj_link(p) = *flh;
+- memset((char *)p + GC_bytes_per_word, 0,
++ memset(reinterpret_cast(p) + GC_bytes_per_word, 0,
+ GC_bytes_per_word * (nwords - 1));
+ *flh = p;
+ GC_aux::GC_mem_recently_freed += nwords;
+@@ -352,9 +352,9 @@
+ public: \
+ static T *allocate(size_t n) \
+ { return 0 == n? 0 : \
+- (T*) alloc::ptr_free_allocate(n * sizeof (T)); } \
++ reinterpret_cast(alloc::ptr_free_allocate(n * sizeof (T))); } \
+ static T *allocate(void) \
+- { return (T*) alloc::ptr_free_allocate(sizeof (T)); } \
++ { return reinterpret_cast(alloc::ptr_free_allocate(sizeof (T))); } \
+ static void deallocate(T *p, size_t n) \
+ { if (0 != n) alloc::ptr_free_deallocate(p, n * sizeof (T)); } \
+ static void deallocate(T *p) \
+diff -urN old/boehm-gc/include/private/gcconfig.h src/boehm-gc/include/private/gcconfig.h
+--- old/boehm-gc/include/private/gcconfig.h 2005-09-06 16:22:01.000000000 +0200
++++ src/boehm-gc/include/private/gcconfig.h 2006-08-28 19:14:18.130718000 +0200
+@@ -55,7 +55,7 @@
+ # endif
+
+ /* And one for FreeBSD: */
+-# if defined(__FreeBSD__)
++# if defined(__FreeBSD__) && !defined(FREEBSD)
+ # define FREEBSD
+ # endif
+
+@@ -97,6 +97,10 @@
+ # define ARM32
+ # define mach_type_known
+ # endif
++# if defined(NETBSD) && defined(__sh__)
++# define SH
++# define mach_type_known
++# endif
+ # if defined(vax)
+ # define VAX
+ # ifdef ultrix
+@@ -127,6 +131,9 @@
+ # endif
+ # endif
+ # endif /* !LINUX */
++# if defined(__NetBSD__) && defined(__MIPSEL__)
++# undef ULTRIX
++# endif
+ # define mach_type_known
+ # endif
+ # if defined(DGUX) && (defined(i386) || defined(__i386__))
+@@ -167,7 +174,7 @@
+ # define mach_type_known
+ # endif
+ # if defined(sparc) && defined(unix) && !defined(sun) && !defined(linux) \
+- && !defined(__OpenBSD__) && !(__NetBSD__)
++ && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__FreeBSD__)
+ # define SPARC
+ # define DRSNX
+ # define mach_type_known
+@@ -198,14 +205,16 @@
+ # if defined(_PA_RISC1_0) || defined(_PA_RISC1_1) || defined(_PA_RISC2_0) \
+ || defined(hppa) || defined(__hppa__)
+ # define HP_PA
+-# ifndef LINUX
++# if !defined(LINUX) && !defined(HPUX)
+ # define HPUX
+ # endif
+ # define mach_type_known
+ # endif
+ # if defined(__ia64) && defined(_HPUX_SOURCE)
+ # define IA64
+-# define HPUX
++# ifndef HPUX
++# define HPUX
++# endif
+ # define mach_type_known
+ # endif
+ # if defined(__BEOS__) && defined(_X86_)
+@@ -235,7 +244,8 @@
+ # endif
+ # define mach_type_known
+ # endif
+-# if defined(LINUX) && (defined(powerpc) || defined(__powerpc__) || defined(powerpc64) || defined(__powerpc64__))
++# if defined(LINUX) && (defined(powerpc) || defined(__powerpc__) || \
++ defined(powerpc64) || defined(__powerpc64__))
+ # define POWERPC
+ # define mach_type_known
+ # endif
+@@ -287,17 +297,15 @@
+ # define MACOS
+ # define mach_type_known
+ # endif
+-# if defined(macosx) \
+- || defined(__APPLE__) && defined(__MACH__) && defined(__ppc__) \
+- || defined(__APPLE__) && defined(__MACH__) && defined(__ppc64__)
+-# define DARWIN
++# if defined(macosx) || (defined(__APPLE__) && defined(__MACH__))
++# define DARWIN
++# if defined(__ppc__) || defined(__ppc64__)
+ # define POWERPC
+ # define mach_type_known
+-# endif
+-# if defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
+-# define DARWIN
++# elif defined(__i386__)
+ # define I386
+ --> Not really supported, but at least we recognize it.
++# endif
+ # endif
+ # if defined(NeXT) && defined(mc68000)
+ # define M68K
+@@ -326,6 +334,10 @@
+ # define X86_64
+ # define mach_type_known
+ # endif
++# if defined(FREEBSD) && defined(__sparc__)
++# define SPARC
++# define mach_type_known
++#endif
+ # if defined(bsdi) && (defined(i386) || defined(__i386__))
+ # define I386
+ # define BSDI
+@@ -486,6 +498,9 @@
+ /* POWERPC ==> IBM/Apple PowerPC */
+ /* (MACOS(<=9),DARWIN(incl.MACOSX),*/
+ /* LINUX, NETBSD, NOSYS variants) */
++ /* Handles 32 and 64-bit variants. */
++ /* AIX should be handled here, but */
++ /* that's called an RS6000. */
+ /* CRIS ==> Axis Etrax */
+ /* M32R ==> Renesas M32R */
+
+@@ -493,12 +508,12 @@
+ /*
+ * For each architecture and OS, the following need to be defined:
+ *
+- * CPP_WORD_SZ is a simple integer constant representing the word size.
++ * CPP_WORDSZ is a simple integer constant representing the word size.
+ * in bits. We assume byte addressibility, where a byte has 8 bits.
+- * We also assume CPP_WORD_SZ is either 32 or 64.
++ * We also assume CPP_WORDSZ is either 32 or 64.
+ * (We care about the length of pointers, not hardware
+ * bus widths. Thus a 64 bit processor with a C compiler that uses
+- * 32 bit pointers should use CPP_WORD_SZ of 32, not 64. Default is 32.)
++ * 32 bit pointers should use CPP_WORDSZ of 32, not 64. Default is 32.)
+ *
+ * MACH_TYPE is a string representation of the machine type.
+ * OS_TYPE is analogous for the OS.
+@@ -615,7 +630,8 @@
+ */
+ # if defined(__GNUC__) && ((__GNUC__ >= 3) || \
+ (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)) \
+- && !defined(__INTEL_COMPILER)
++ && !defined(__INTEL_COMPILER) \
++ && !defined(__PATHCC__)
+ # define HAVE_BUILTIN_UNWIND_INIT
+ # endif
+
+@@ -651,8 +667,7 @@
+ # define OS_TYPE "LINUX"
+ # define STACKBOTTOM ((ptr_t)0xf0000000)
+ # define USE_GENERIC_PUSH_REGS
+-# define USE_MMAP
+- /* We never got around to the assembly version. */
++ /* We never got around to the assembly version. */
+ /* # define MPROTECT_VDB - Reported to not work 9/17/01 */
+ # ifdef __ELF__
+ # define DYNAMIC_LOADING
+@@ -740,7 +755,7 @@
+ # endif
+ # endif
+
+-# ifdef POWERPC
++# if defined(POWERPC)
+ # define MACH_TYPE "POWERPC"
+ # ifdef MACOS
+ # define ALIGNMENT 2 /* Still necessary? Could it be 4? */
+@@ -753,10 +768,12 @@
+ # define DATAEND /* not needed */
+ # endif
+ # ifdef LINUX
+-# if (defined (powerpc64) || defined(__powerpc64__))
++# if defined(__powerpc64__)
+ # define ALIGNMENT 8
+ # define CPP_WORDSZ 64
+-# define HBLKSIZE 4096
++# ifndef HBLKSIZE
++# define HBLKSIZE 4096
++# endif
+ # else
+ # define ALIGNMENT 4
+ # endif
+@@ -770,7 +787,7 @@
+ # define DATAEND (_end)
+ # endif
+ # ifdef DARWIN
+-# if (defined (__ppc64__))
++# ifdef __ppc64__
+ # define ALIGNMENT 8
+ # define CPP_WORDSZ 64
+ # else
+@@ -787,8 +804,10 @@
+ # define USE_MMAP_ANON
+ # define USE_ASM_PUSH_REGS
+ /* This is potentially buggy. It needs more testing. See the comments in
+- os_dep.c */
+-# define MPROTECT_VDB
++ os_dep.c. It relies on threads to track writes. */
++# ifdef GC_DARWIN_THREADS
++/* # define MPROTECT_VDB -- diabled for now. May work for some apps. */
++# endif
+ # include
+ # define GETPAGESIZE() getpagesize()
+ # if defined(USE_PPC_PREFETCH) && defined(__GNUC__)
+@@ -975,6 +994,23 @@
+ # define DATASTART ((ptr_t)(etext))
+ # endif
+ # endif
++# ifdef FREEBSD
++# define OS_TYPE "FREEBSD"
++# define SIG_SUSPEND SIGUSR1
++# define SIG_THR_RESTART SIGUSR2
++# define FREEBSD_STACKBOTTOM
++# ifdef __ELF__
++# define DYNAMIC_LOADING
++# endif
++ extern char etext[];
++ extern char edata[];
++ extern char end[];
++# define NEED_FIND_LIMIT
++# define DATASTART ((ptr_t)(&etext))
++# define DATAEND (GC_find_limit (DATASTART, TRUE))
++# define DATASTART2 ((ptr_t)(&edata))
++# define DATAEND2 ((ptr_t)(&end))
++# endif
+ # endif
+
+ # ifdef I386
+@@ -1158,26 +1194,8 @@
+ # endif
+ # ifdef CYGWIN32
+ # define OS_TYPE "CYGWIN32"
+- extern int _data_start__[];
+- extern int _data_end__[];
+- extern int _bss_start__[];
+- extern int _bss_end__[];
+- /* For binutils 2.9.1, we have */
+- /* DATASTART = _data_start__ */
+- /* DATAEND = _bss_end__ */
+- /* whereas for some earlier versions it was */
+- /* DATASTART = _bss_start__ */
+- /* DATAEND = _data_end__ */
+- /* To get it right for both, we take the */
+- /* minumum/maximum of the two. */
+-# ifndef MAX
+-# define MAX(x,y) ((x) > (y) ? (x) : (y))
+-# endif
+-# ifndef MIN
+-# define MIN(x,y) ((x) < (y) ? (x) : (y))
+-# endif
+-# define DATASTART ((ptr_t) MIN(_data_start__, _bss_start__))
+-# define DATAEND ((ptr_t) MAX(_data_end__, _bss_end__))
++# define DATASTART ((ptr_t)GC_DATASTART) /* From gc.h */
++# define DATAEND ((ptr_t)GC_DATAEND)
+ # undef STACK_GRAN
+ # define STACK_GRAN 0x10000
+ # define HEURISTIC1
+@@ -1388,8 +1406,8 @@
+ # define DATAEND /* not needed */
+ # endif
+ # if defined(NETBSD)
+-# define OS_TYPE "NETBSD"
+ # define ALIGNMENT 4
++# define OS_TYPE "NETBSD"
+ # define HEURISTIC2
+ # define USE_GENERIC_PUSH_REGS
+ # ifdef __ELF__
+@@ -1421,6 +1439,8 @@
+ # define CPP_WORDSZ 32
+ # define STACKBOTTOM ((ptr_t)((ulong)&errno))
+ # endif
++# define USE_MMAP
++# define USE_MMAP_ANON
+ /* From AIX linker man page:
+ _text Specifies the first location of the program.
+ _etext Specifies the first location after the program.
+@@ -1567,7 +1587,7 @@
+ /* the text segment immediately follows the stack. */
+ /* Hence we give an upper pound. */
+ /* This is currently unused, since we disabled HEURISTIC2 */
+- extern int __start[];
++ extern int __start[];
+ # define HEURISTIC2_LIMIT ((ptr_t)((word)(__start) & ~(getpagesize()-1)))
+ # ifndef GC_OSF1_THREADS
+ /* Unresolved signal issues with threads. */
+@@ -1728,7 +1748,7 @@
+ # define USE_GENERIC_PUSH_REGS
+ # ifdef UTS4
+ # define OS_TYPE "UTS4"
+- extern int etext[];
++ extern int etext[];
+ extern int _etext[];
+ extern int _end[];
+ extern ptr_t GC_SysVGetDataStart();
+@@ -1742,18 +1762,20 @@
+ # define MACH_TYPE "S390"
+ # define USE_GENERIC_PUSH_REGS
+ # ifndef __s390x__
+-# define ALIGNMENT 4
+-# define CPP_WORDSZ 32
++# define ALIGNMENT 4
++# define CPP_WORDSZ 32
+ # else
+-# define ALIGNMENT 8
+-# define CPP_WORDSZ 64
+-# define HBLKSIZE 4096
++# define ALIGNMENT 8
++# define CPP_WORDSZ 64
++# endif
++# ifndef HBLKSIZE
++# define HBLKSIZE 4096
+ # endif
+ # ifdef LINUX
+ # define OS_TYPE "LINUX"
+ # define LINUX_STACKBOTTOM
+ # define DYNAMIC_LOADING
+- extern int __data_start[];
++ extern int __data_start[];
+ # define DATASTART ((ptr_t)(__data_start))
+ extern int _end[];
+ # define DATAEND (_end)
+@@ -1859,6 +1881,13 @@
+ extern int _end[];
+ # define DATAEND (_end)
+ # endif
++# ifdef NETBSD
++# define OS_TYPE "NETBSD"
++# define HEURISTIC2
++# define DATASTART GC_data_start
++# define USE_GENERIC_PUSH_REGS
++# define DYNAMIC_LOADING
++# endif
+ # endif
+
+ # ifdef SH4
+@@ -2107,7 +2136,8 @@
+ # define THREADS
+ # endif
+
+-# if defined(HP_PA) || defined(M88K) || defined(POWERPC) && !defined(DARWIN) \
++# if defined(HP_PA) || defined(M88K) \
++ || defined(POWERPC) && !defined(DARWIN) \
+ || defined(LINT) || defined(MSWINCE) || defined(ARM32) || defined(CRIS) \
+ || (defined(I386) && defined(__LCC__))
+ /* Use setjmp based hack to mark from callee-save registers. */
+@@ -2249,7 +2279,7 @@
+ # else
+ # if defined(AMIGA) && defined(GC_AMIGA_FASTALLOC)
+ extern void *GC_amiga_get_mem(size_t size);
+-# define GET_MEM(bytes) HBLKPTR((size_t) \
++# define GET_MEM(bytes) HBLKPTR((size_t) \
+ GC_amiga_get_mem((size_t)bytes + GC_page_size) \
+ + GC_page_size-1)
+ # else
+@@ -2265,4 +2295,10 @@
+
+ #endif /* GC_PRIVATE_H */
+
++#if defined(_AIX) && !defined(__GNUC__) && !defined(__STDC__)
++ /* IBMs xlc compiler doesn't appear to follow the convention of */
++ /* defining __STDC__ to be zero in extended mode. */
++# define __STDC__ 0
++#endif
++
+ # endif /* GCCONFIG_H */
+diff -urN old/boehm-gc/include/private/gc_hdrs.h src/boehm-gc/include/private/gc_hdrs.h
+--- old/boehm-gc/include/private/gc_hdrs.h 2003-07-28 06:18:23.000000000 +0200
++++ src/boehm-gc/include/private/gc_hdrs.h 2006-08-28 19:14:18.130718000 +0200
+@@ -108,7 +108,7 @@
+
+ /* Analogous to GET_HDR, except that in the case of large objects, it */
+ /* Returns the header for the object beginning, and updates p. */
+-/* Returns &GC_bad_header instead of 0. All of this saves a branch */
++/* Returns GC_invalid_header instead of 0. All of this saves a branch */
+ /* in the fast path. */
+ # define HC_GET_HDR(p, hhdr, source) \
+ { \
+diff -urN old/boehm-gc/include/private/gc_locks.h src/boehm-gc/include/private/gc_locks.h
+--- old/boehm-gc/include/private/gc_locks.h 2005-09-16 00:35:52.000000000 +0200
++++ src/boehm-gc/include/private/gc_locks.h 2006-08-28 19:14:18.130718000 +0200
+@@ -139,6 +139,25 @@
+ # define GC_TEST_AND_SET_DEFINED
+ # endif
+ # if defined(POWERPC)
++# if 0 /* CPP_WORDSZ == 64 totally broken to use int locks with ldarx */
++ inline static int GC_test_and_set(volatile unsigned int *addr) {
++ unsigned long oldval;
++ unsigned long temp = 1; /* locked value */
++
++ __asm__ __volatile__(
++ "1:\tldarx %0,0,%3\n" /* load and reserve */
++ "\tcmpdi %0, 0\n" /* if load is */
++ "\tbne 2f\n" /* non-zero, return already set */
++ "\tstdcx. %2,0,%1\n" /* else store conditional */
++ "\tbne- 1b\n" /* retry if lost reservation */
++ "\tsync\n" /* import barrier */
++ "2:\t\n" /* oldval is zero if we set */
++ : "=&r"(oldval), "=p"(addr)
++ : "r"(temp), "1"(addr)
++ : "cr0","memory");
++ return (int)oldval;
++ }
++# else
+ inline static int GC_test_and_set(volatile unsigned int *addr) {
+ int oldval;
+ int temp = 1; /* locked value */
+@@ -156,12 +175,13 @@
+ : "cr0","memory");
+ return oldval;
+ }
+-# define GC_TEST_AND_SET_DEFINED
+- inline static void GC_clear(volatile unsigned int *addr) {
+- __asm__ __volatile__("eieio" : : : "memory");
+- *(addr) = 0;
+- }
+-# define GC_CLEAR_DEFINED
++# endif
++# define GC_TEST_AND_SET_DEFINED
++ inline static void GC_clear(volatile unsigned int *addr) {
++ __asm__ __volatile__("lwsync" : : : "memory");
++ *(addr) = 0;
++ }
++# define GC_CLEAR_DEFINED
+ # endif
+ # if defined(ALPHA)
+ inline static int GC_test_and_set(volatile unsigned int * addr)
+@@ -282,6 +302,8 @@
+ # define GC_test_and_set(addr) test_and_set((void *)addr,1)
+ # endif
+ # else
++# include
++# include
+ # define GC_test_and_set(addr) __test_and_set32((void *)addr,1)
+ # define GC_clear(addr) __lock_release(addr);
+ # define GC_CLEAR_DEFINED
+@@ -354,7 +376,7 @@
+ # endif
+
+ # if defined(GC_PTHREADS) && !defined(GC_SOLARIS_THREADS) \
+- && !defined(GC_IRIX_THREADS) && !defined(GC_WIN32_THREADS)
++ && !defined(GC_WIN32_THREADS)
+ # define NO_THREAD (pthread_t)(-1)
+ # include
+ # if defined(PARALLEL_MARK)
+@@ -401,6 +423,29 @@
+
+ # if defined(POWERPC)
+ # if !defined(GENERIC_COMPARE_AND_SWAP)
++# if CPP_WORDSZ == 64
++ /* Returns TRUE if the comparison succeeded. */
++ inline static GC_bool GC_compare_and_exchange(volatile GC_word *addr,
++ GC_word old, GC_word new_val)
++ {
++ unsigned long result, dummy;
++ __asm__ __volatile__(
++ "1:\tldarx %0,0,%5\n"
++ "\tcmpd %0,%4\n"
++ "\tbne 2f\n"
++ "\tstdcx. %3,0,%2\n"
++ "\tbne- 1b\n"
++ "\tsync\n"
++ "\tli %1, 1\n"
++ "\tb 3f\n"
++ "2:\tli %1, 0\n"
++ "3:\t\n"
++ : "=&r" (dummy), "=r" (result), "=p" (addr)
++ : "r" (new_val), "r" (old), "2"(addr)
++ : "cr0","memory");
++ return (GC_bool) result;
++ }
++# else
+ /* Returns TRUE if the comparison succeeded. */
+ inline static GC_bool GC_compare_and_exchange(volatile GC_word *addr,
+ GC_word old, GC_word new_val)
+@@ -422,6 +467,7 @@
+ : "cr0","memory");
+ return (GC_bool) result;
+ }
++# endif
+ # endif /* !GENERIC_COMPARE_AND_SWAP */
+ inline static void GC_memory_barrier()
+ {
+@@ -598,33 +644,6 @@
+ extern pthread_t GC_mark_lock_holder;
+ # endif
+ # endif /* GC_PTHREADS with linux_threads.c implementation */
+-# if defined(GC_IRIX_THREADS)
+-# include
+- /* This probably should never be included, but I can't test */
+- /* on Irix anymore. */
+-# include
+-
+- extern volatile unsigned int GC_allocate_lock;
+- /* This is not a mutex because mutexes that obey the (optional) */
+- /* POSIX scheduling rules are subject to convoys in high contention */
+- /* applications. This is basically a spin lock. */
+- extern pthread_t GC_lock_holder;
+- extern void GC_lock(void);
+- /* Allocation lock holder. Only set if acquired by client through */
+- /* GC_call_with_alloc_lock. */
+-# define SET_LOCK_HOLDER() GC_lock_holder = pthread_self()
+-# define NO_THREAD (pthread_t)(-1)
+-# define UNSET_LOCK_HOLDER() GC_lock_holder = NO_THREAD
+-# define I_HOLD_LOCK() (pthread_equal(GC_lock_holder, pthread_self()))
+-# define LOCK() { if (GC_test_and_set(&GC_allocate_lock)) GC_lock(); }
+-# define UNLOCK() GC_clear(&GC_allocate_lock);
+- extern VOLATILE GC_bool GC_collecting;
+-# define ENTER_GC() \
+- { \
+- GC_collecting = 1; \
+- }
+-# define EXIT_GC() GC_collecting = 0;
+-# endif /* GC_IRIX_THREADS */
+ # if defined(GC_WIN32_THREADS)
+ # if defined(GC_PTHREADS)
+ # include
+diff -urN old/boehm-gc/include/private/gc_priv.h src/boehm-gc/include/private/gc_priv.h
+--- old/boehm-gc/include/private/gc_priv.h 2005-11-02 01:06:30.000000000 +0100
++++ src/boehm-gc/include/private/gc_priv.h 2006-08-28 19:14:18.130718000 +0200
+@@ -262,17 +262,6 @@
+ /* */
+ /*********************************/
+
+-#ifdef SAVE_CALL_CHAIN
+-
+-/* Fill in the pc and argument information for up to NFRAMES of my */
+-/* callers. Ignore my frame and my callers frame. */
+-struct callinfo;
+-void GC_save_callers GC_PROTO((struct callinfo info[NFRAMES]));
+-
+-void GC_print_callers GC_PROTO((struct callinfo info[NFRAMES]));
+-
+-#endif
+-
+ #ifdef NEED_CALLINFO
+ struct callinfo {
+ word ci_pc; /* Caller, not callee, pc */
+@@ -286,6 +275,16 @@
+ };
+ #endif
+
++#ifdef SAVE_CALL_CHAIN
++
++/* Fill in the pc and argument information for up to NFRAMES of my */
++/* callers. Ignore my frame and my callers frame. */
++void GC_save_callers GC_PROTO((struct callinfo info[NFRAMES]));
++
++void GC_print_callers GC_PROTO((struct callinfo info[NFRAMES]));
++
++#endif
++
+
+ /*********************************/
+ /* */
+diff -urN old/boehm-gc/include/private/pthread_stop_world.h src/boehm-gc/include/private/pthread_stop_world.h
+--- old/boehm-gc/include/private/pthread_stop_world.h 2003-07-28 05:46:07.000000000 +0200
++++ src/boehm-gc/include/private/pthread_stop_world.h 2006-08-28 19:14:18.140718000 +0200
+@@ -2,7 +2,6 @@
+ #define GC_PTHREAD_STOP_WORLD_H
+
+ struct thread_stop_info {
+- int signal;
+ word last_stop_count; /* GC_last_stop_count value when thread */
+ /* last successfully handled a suspend */
+ /* signal. */
+diff -urN old/boehm-gc/include/private/pthread_support.h src/boehm-gc/include/private/pthread_support.h
+--- old/boehm-gc/include/private/pthread_support.h 2004-08-14 01:05:36.000000000 +0200
++++ src/boehm-gc/include/private/pthread_support.h 2006-08-28 19:14:18.140718000 +0200
+@@ -4,7 +4,7 @@
+ # include "private/gc_priv.h"
+
+ # if defined(GC_PTHREADS) && !defined(GC_SOLARIS_THREADS) \
+- && !defined(GC_IRIX_THREADS) && !defined(GC_WIN32_THREADS)
++ && !defined(GC_WIN32_THREADS)
+
+ #if defined(GC_DARWIN_THREADS)
+ # include "private/darwin_stop_world.h"
+@@ -33,6 +33,7 @@
+ # define FINISHED 1 /* Thread has exited. */
+ # define DETACHED 2 /* Thread is intended to be detached. */
+ # define MAIN_THREAD 4 /* True for the original thread only. */
++# define SUSPENDED 8 /* True if thread was suspended externally */
+ short thread_blocked; /* Protected by GC lock. */
+ /* Treated as a boolean value. If set, */
+ /* thread will acquire GC lock before */
+diff -urN old/boehm-gc/mach_dep.c src/boehm-gc/mach_dep.c
+--- old/boehm-gc/mach_dep.c 2005-02-09 22:33:02.000000000 +0100
++++ src/boehm-gc/mach_dep.c 2006-08-28 19:14:18.140718000 +0200
+@@ -27,6 +27,10 @@
+ # endif
+ # endif
+
++#if defined(RS6000) || defined(POWERPC)
++# include
++#endif
++
+ #if defined(__MWERKS__) && !defined(POWERPC)
+
+ asm static void PushMacRegisters()
+@@ -413,6 +417,13 @@
+ /* the stack. */
+ __builtin_unwind_init();
+ # else /* !HAVE_BUILTIN_UNWIND_INIT */
++# if defined(RS6000) || defined(POWERPC)
++ /* FIXME: RS6000 means AIX. */
++ /* This should probably be used in all Posix/non-gcc */
++ /* settings. We defer that change to minimize risk. */
++ ucontext_t ctxt;
++ getcontext(&ctxt);
++# else
+ /* Generic code */
+ /* The idea is due to Parag Patel at HP. */
+ /* We're not sure whether he would like */
+@@ -426,7 +437,7 @@
+ for (; (char *)i < lim; i++) {
+ *i = 0;
+ }
+-# if defined(POWERPC) || defined(MSWIN32) || defined(MSWINCE) \
++# if defined(MSWIN32) || defined(MSWINCE) \
+ || defined(UTS4) || defined(LINUX) || defined(EWS4800)
+ (void) setjmp(regs);
+ # else
+@@ -435,15 +446,16 @@
+ /* SUSV3, setjmp() may or may not save signal mask. */
+ /* _setjmp won't, but is less portable. */
+ # endif
++# endif /* !AIX ... */
+ # endif /* !HAVE_BUILTIN_UNWIND_INIT */
+-# elif defined(PTHREADS) && !defined(MSWIN32) /* !USE_GENERIC_PUSH_REGS */
+- /* We may still need this to save thread contexts. */
+- /* This should probably be used in all Posix/non-gcc */
+- /* settings. We defer that change to minimize risk. */
+- ucontext_t ctxt;
+- getcontext(&ctxt);
+-# else /* Shouldn't be needed */
+- ABORT("Unexpected call to GC_with_callee_saves_pushed");
++# else
++# if defined(PTHREADS) && !defined(MSWIN32) /* !USE_GENERIC_PUSH_REGS */
++ /* We may still need this to save thread contexts. */
++ ucontext_t ctxt;
++ getcontext(&ctxt);
++# else /* Shouldn't be needed */
++ ABORT("Unexpected call to GC_with_callee_saves_pushed");
++# endif
+ # endif
+ # if (defined(SPARC) && !defined(HAVE_BUILTIN_UNWIND_INIT)) \
+ || defined(IA64)
+@@ -480,7 +492,7 @@
+ /* the stack. Return sp. */
+ # ifdef SPARC
+ asm(" .seg \"text\"");
+-# if defined(SVR4) || defined(NETBSD)
++# if defined(SVR4) || defined(NETBSD) || defined(FREEBSD)
+ asm(" .globl GC_save_regs_in_stack");
+ asm("GC_save_regs_in_stack:");
+ asm(" .type GC_save_regs_in_stack,#function");
+diff -urN old/boehm-gc/Makefile.am src/boehm-gc/Makefile.am
+--- old/boehm-gc/Makefile.am 2004-11-05 02:51:50.000000000 +0100
++++ src/boehm-gc/Makefile.am 2006-08-28 19:14:18.100718000 +0200
+@@ -12,33 +12,32 @@
+ noinst_LTLIBRARIES = libgcjgc.la libgcjgc_convenience.la
+
+ if POWERPC_DARWIN
+-asm_libgc_sources = powerpc_darwin_mach_dep.s
++asm_libgcjgc_sources = powerpc_darwin_mach_dep.s
+ else
+-asm_libgc_sources =
++asm_libgcjgc_sources =
+ endif
+
+-GC_SOURCES = allchblk.c alloc.c blacklst.c checksums.c dbg_mlc.c \
+-dyn_load.c finalize.c gc_dlopen.c gcj_mlc.c headers.c aix_irix_threads.c \
++libgcjgc_la_SOURCES = allchblk.c alloc.c blacklst.c checksums.c dbg_mlc.c \
++dyn_load.c finalize.c gc_dlopen.c gcj_mlc.c headers.c \
+ malloc.c mallocx.c mark.c mark_rts.c misc.c new_hblk.c \
+ obj_map.c os_dep.c pcr_interface.c ptr_chck.c real_malloc.c reclaim.c \
+ solaris_pthreads.c solaris_threads.c specific.c stubborn.c typd_mlc.c \
+ backgraph.c win32_threads.c \
+ pthread_support.c pthread_stop_world.c darwin_stop_world.c \
+-$(asm_libgc_sources)
++$(asm_libgcjgc_sources)
++
++libgcjgc_convenience_la_SOURCES = $(libgcjgc_la_SOURCES)
+
+ EXTRA_DIST = alpha_mach_dep.S \
+ mips_sgi_mach_dep.s mips_ultrix_mach_dep.s powerpc_darwin_mach_dep.s \
+ rs6000_mach_dep.s sparc_mach_dep.S sparc_netbsd_mach_dep.s \
+ sparc_sunos4_mach_dep.s ia64_save_regs_in_stack.s
+
+-libgcjgc_la_SOURCES = $(GC_SOURCES)
+-libgcjgc_convenience_la_SOURCES = $(GC_SOURCES)
+-
+ # Include THREADLIBS here to ensure that the correct versions of
+ # linuxthread semaphore functions get linked:
+-libgcjgc_la_LIBADD = @addobjs@ $(THREADLIBS)
++libgcjgc_la_LIBADD = @addobjs@ $(THREADLIBS) $(UNWINDLIBS)
+ libgcjgc_la_DEPENDENCIES = @addobjs@
+-libgcjgc_la_LDFLAGS = -version-info 1:1:0 -rpath $(toolexeclibdir)
++libgcjgc_la_LDFLAGS = -version-info 1:2:0 -rpath $(toolexeclibdir)
+
+ libgcjgc_convenience_la_LIBADD = @addobjs@
+ libgcjgc_convenience_la_DEPENDENCIES = @addobjs@
+@@ -48,7 +47,7 @@
+
+ check_PROGRAMS = gctest
+ gctest_SOURCES = tests/test.c
+-gctest_LDADD = ./libgcjgc.la $(THREADLIBS) $(EXTRA_TEST_LIBS)
++gctest_LDADD = ./libgcjgc.la $(THREADDLLIBS) $(UNWINDLIBS) $(EXTRA_TEST_LIBS)
+ gctest_LDFLAGS = -shared-libgcc
+ TESTS_ENVIRONMENT = LD_LIBRARY_PATH=../../$(MULTIBUILDTOP)gcc
+ TESTS = gctest
+@@ -111,3 +110,8 @@
+ CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host
+
+ MAKEOVERRIDES=
++
++# No install-html support yet
++.PHONY: install-html
++install-html:
++
+diff -urN old/boehm-gc/Makefile.direct src/boehm-gc/Makefile.direct
+--- old/boehm-gc/Makefile.direct 2004-08-14 01:05:36.000000000 +0200
++++ src/boehm-gc/Makefile.direct 2006-08-28 19:14:18.100718000 +0200
+@@ -36,7 +36,7 @@
+ # -DGC_LINUX_THREADS -DPARALLEL_MARK -DTHREAD_LOCAL_ALLOC
+ # To build the parallel collector in a static library on HP/UX,
+ # add to the above:
+-# -DGC_HPUX_THREADS -DPARALLEL_MARK -DTHREAD_LOCAL_ALLOC -D_POSIX_C_SOURCE=199506L
++# -DGC_HPUX_THREADS -DPARALLEL_MARK -DTHREAD_LOCAL_ALLOC -D_POSIX_C_SOURCE=199506L -mt
+ # To build the thread-safe collector on Tru64, add to the above:
+ # -pthread -DGC_OSF1_THREADS
+
+@@ -70,10 +70,11 @@
+ # Also requires -D_REENTRANT or -D_POSIX_C_SOURCE=199506L. See README.hp.
+ # -DGC_LINUX_THREADS enables support for Xavier Leroy's Linux threads.
+ # see README.linux. -D_REENTRANT may also be required.
+-# -DGC_OSF1_THREADS enables support for Tru64 pthreads. Untested.
+-# -DGC_FREEBSD_THREADS enables support for FreeBSD pthreads. Untested.
++# -DGC_OSF1_THREADS enables support for Tru64 pthreads.
++# -DGC_FREEBSD_THREADS enables support for FreeBSD pthreads.
+ # Appeared to run into some underlying thread problems.
+-# -DGC_DARWIN_THREADS enables support for Mac OS X pthreads. Untested.
++# -DGC_DARWIN_THREADS enables support for Mac OS X pthreads.
++# -DGC_AIX_THREADS enables support for IBM AIX threads.
+ # -DGC_DGUX386_THREADS enables support for DB/UX on I386 threads.
+ # See README.DGUX386.
+ # -DGC_WIN32_THREADS enables support for win32 threads. That makes sense
+@@ -233,8 +234,8 @@
+ # -DTHREAD_LOCAL_ALLOC defines GC_local_malloc(), GC_local_malloc_atomic()
+ # and GC_local_gcj_malloc(). Needed for gc_gcj.h interface. These allocate
+ # in a way that usually does not involve acquisition of a global lock.
+-# Currently requires -DGC_LINUX_THREADS, but should be easy to port to
+-# other pthreads environments. Recommended for multiprocessors.
++# Currently works only on platforms such as Linux which use pthread_support.c.
++# Recommended for multiprocessors.
+ # -DUSE_COMPILER_TLS causes thread local allocation to use compiler-supported
+ # "__thread" thread-local variables. This is the default in HP/UX. It
+ # may help performance on recent Linux installations. (It failed for
+@@ -276,6 +277,10 @@
+ # -DPOINTER_SHIFT=n causes the collector to left shift candidate pointers
+ # by the indicated amount before trying to interpret them. Applied
+ # after POINTER_MASK. EXPERIMENTAL. See also the preceding macro.
++# -DDARWIN_DONT_PARSE_STACK Causes the Darwin port to discover thread
++# stack bounds in the same way as other pthread ports, without trying to
++# walk the frames onthe stack. This is recommended only as a fallback
++# for applications that don't support proper stack unwinding.
+ #
+
+ CXXFLAGS= $(CFLAGS)
+@@ -283,9 +288,9 @@
+ RANLIB= ranlib
+
+
+-OBJS= alloc.o reclaim.o allchblk.o misc.o mach_dep.o os_dep.o mark_rts.o headers.o mark.o obj_map.o blacklst.o finalize.o new_hblk.o dbg_mlc.o malloc.o stubborn.o checksums.o solaris_threads.o aix_irix_threads.o pthread_support.o pthread_stop_world.o darwin_stop_world.o typd_mlc.o ptr_chck.o mallocx.o solaris_pthreads.o gcj_mlc.o specific.o gc_dlopen.o backgraph.o win32_threads.o
++OBJS= alloc.o reclaim.o allchblk.o misc.o mach_dep.o os_dep.o mark_rts.o headers.o mark.o obj_map.o blacklst.o finalize.o new_hblk.o dbg_mlc.o malloc.o stubborn.o checksums.o solaris_threads.o pthread_support.o pthread_stop_world.o darwin_stop_world.o typd_mlc.o ptr_chck.o mallocx.o solaris_pthreads.o gcj_mlc.o specific.o gc_dlopen.o backgraph.o win32_threads.o
+
+-CSRCS= reclaim.c allchblk.c misc.c alloc.c mach_dep.c os_dep.c mark_rts.c headers.c mark.c obj_map.c pcr_interface.c blacklst.c finalize.c new_hblk.c real_malloc.c dyn_load.c dbg_mlc.c malloc.c stubborn.c checksums.c solaris_threads.c aix_irix_threads.c pthread_support.c pthread_stop_world.c darwin_stop_world.c typd_mlc.c ptr_chck.c mallocx.c solaris_pthreads.c gcj_mlc.c specific.c gc_dlopen.c backgraph.c win32_threads.c
++CSRCS= reclaim.c allchblk.c misc.c alloc.c mach_dep.c os_dep.c mark_rts.c headers.c mark.c obj_map.c pcr_interface.c blacklst.c finalize.c new_hblk.c real_malloc.c dyn_load.c dbg_mlc.c malloc.c stubborn.c checksums.c solaris_threads.c pthread_support.c pthread_stop_world.c darwin_stop_world.c typd_mlc.c ptr_chck.c mallocx.c solaris_pthreads.c gcj_mlc.c specific.c gc_dlopen.c backgraph.c win32_threads.c
+
+ CORD_SRCS= cord/cordbscs.c cord/cordxtra.c cord/cordprnt.c cord/de.c cord/cordtest.c include/cord.h include/ec.h include/private/cord_pos.h cord/de_win.c cord/de_win.h cord/de_cmds.h cord/de_win.ICO cord/de_win.RC
+
+diff -urN old/boehm-gc/Makefile.in src/boehm-gc/Makefile.in
+--- old/boehm-gc/Makefile.in 2006-05-25 01:46:15.000000000 +0200
++++ src/boehm-gc/Makefile.in 2006-08-28 19:14:18.100718000 +0200
+@@ -1,8 +1,8 @@
+-# Makefile.in generated by automake 1.9.3 from Makefile.am.
++# Makefile.in generated by automake 1.9.6 from Makefile.am.
+ # @configure_input@
+
+ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+-# 2003, 2004 Free Software Foundation, Inc.
++# 2003, 2004, 2005 Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+ # gives unlimited permission to copy and/or distribute it,
+ # with or without modifications, as long as this notice is preserved.
+@@ -14,8 +14,6 @@
+
+ @SET_MAKE@
+
+-SOURCES = $(libgcjgc_la_SOURCES) $(libgcjgc_convenience_la_SOURCES) $(gctest_SOURCES)
+-
+ srcdir = @srcdir@
+ top_srcdir = @top_srcdir@
+ VPATH = @srcdir@
+@@ -65,12 +63,13 @@
+ $(srcdir)/../compile $(srcdir)/../compile $(srcdir)/../compile \
+ $(srcdir)/../compile $(srcdir)/../compile $(srcdir)/../compile \
+ $(srcdir)/../compile $(srcdir)/../compile $(srcdir)/../compile \
+- $(srcdir)/../compile $(srcdir)/../compile $(srcdir)/../compile \
+- $(srcdir)/../ltmain.sh $(srcdir)/../config.guess \
+- $(srcdir)/../config.sub
++ $(srcdir)/../compile $(srcdir)/../ltmain.sh \
++ $(srcdir)/../config.guess $(srcdir)/../config.sub
+ subdir = .
+ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
++ $(top_srcdir)/../config/depstand.m4 \
++ $(top_srcdir)/../config/lead-dot.m4 \
+ $(top_srcdir)/../config/no-executables.m4 \
+ $(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
+ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+@@ -83,24 +82,30 @@
+ LTLIBRARIES = $(noinst_LTLIBRARIES)
+ am__DEPENDENCIES_1 =
+ @POWERPC_DARWIN_TRUE@am__objects_1 = powerpc_darwin_mach_dep.lo
+-am__objects_2 = allchblk.lo alloc.lo blacklst.lo checksums.lo \
++am_libgcjgc_la_OBJECTS = allchblk.lo alloc.lo blacklst.lo checksums.lo \
+ dbg_mlc.lo dyn_load.lo finalize.lo gc_dlopen.lo gcj_mlc.lo \
+- headers.lo aix_irix_threads.lo malloc.lo mallocx.lo mark.lo \
+- mark_rts.lo misc.lo new_hblk.lo obj_map.lo os_dep.lo \
+- pcr_interface.lo ptr_chck.lo real_malloc.lo reclaim.lo \
+- solaris_pthreads.lo solaris_threads.lo specific.lo stubborn.lo \
+- typd_mlc.lo backgraph.lo win32_threads.lo pthread_support.lo \
++ headers.lo malloc.lo mallocx.lo mark.lo mark_rts.lo misc.lo \
++ new_hblk.lo obj_map.lo os_dep.lo pcr_interface.lo ptr_chck.lo \
++ real_malloc.lo reclaim.lo solaris_pthreads.lo \
++ solaris_threads.lo specific.lo stubborn.lo typd_mlc.lo \
++ backgraph.lo win32_threads.lo pthread_support.lo \
+ pthread_stop_world.lo darwin_stop_world.lo $(am__objects_1)
+-am_libgcjgc_la_OBJECTS = $(am__objects_2)
+ libgcjgc_la_OBJECTS = $(am_libgcjgc_la_OBJECTS)
++am__objects_2 = allchblk.lo alloc.lo blacklst.lo checksums.lo \
++ dbg_mlc.lo dyn_load.lo finalize.lo gc_dlopen.lo gcj_mlc.lo \
++ headers.lo malloc.lo mallocx.lo mark.lo mark_rts.lo misc.lo \
++ new_hblk.lo obj_map.lo os_dep.lo pcr_interface.lo ptr_chck.lo \
++ real_malloc.lo reclaim.lo solaris_pthreads.lo \
++ solaris_threads.lo specific.lo stubborn.lo typd_mlc.lo \
++ backgraph.lo win32_threads.lo pthread_support.lo \
++ pthread_stop_world.lo darwin_stop_world.lo $(am__objects_1)
+ am_libgcjgc_convenience_la_OBJECTS = $(am__objects_2)
+ libgcjgc_convenience_la_OBJECTS = \
+ $(am_libgcjgc_convenience_la_OBJECTS)
+ am__dirstamp = $(am__leading_dot)dirstamp
+ am_gctest_OBJECTS = tests/test.$(OBJEXT)
+ gctest_OBJECTS = $(am_gctest_OBJECTS)
+-gctest_DEPENDENCIES = ./libgcjgc.la $(am__DEPENDENCIES_1) \
+- $(am__DEPENDENCIES_1)
++gctest_DEPENDENCIES = ./libgcjgc.la $(am__DEPENDENCIES_1)
+ DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include -I$(top_builddir)/include
+ depcomp =
+ am__depfiles_maybe =
+@@ -252,36 +257,35 @@
+ ACLOCAL_AMFLAGS = -I .. -I ../config
+ SUBDIRS = include
+ noinst_LTLIBRARIES = libgcjgc.la libgcjgc_convenience.la
+-@POWERPC_DARWIN_FALSE@asm_libgc_sources =
+-@POWERPC_DARWIN_TRUE@asm_libgc_sources = powerpc_darwin_mach_dep.s
+-GC_SOURCES = allchblk.c alloc.c blacklst.c checksums.c dbg_mlc.c \
+-dyn_load.c finalize.c gc_dlopen.c gcj_mlc.c headers.c aix_irix_threads.c \
++@POWERPC_DARWIN_FALSE@asm_libgcjgc_sources =
++@POWERPC_DARWIN_TRUE@asm_libgcjgc_sources = powerpc_darwin_mach_dep.s
++libgcjgc_la_SOURCES = allchblk.c alloc.c blacklst.c checksums.c dbg_mlc.c \
++dyn_load.c finalize.c gc_dlopen.c gcj_mlc.c headers.c \
+ malloc.c mallocx.c mark.c mark_rts.c misc.c new_hblk.c \
+ obj_map.c os_dep.c pcr_interface.c ptr_chck.c real_malloc.c reclaim.c \
+ solaris_pthreads.c solaris_threads.c specific.c stubborn.c typd_mlc.c \
+ backgraph.c win32_threads.c \
+ pthread_support.c pthread_stop_world.c darwin_stop_world.c \
+-$(asm_libgc_sources)
++$(asm_libgcjgc_sources)
+
++libgcjgc_convenience_la_SOURCES = $(libgcjgc_la_SOURCES)
+ EXTRA_DIST = alpha_mach_dep.S \
+ mips_sgi_mach_dep.s mips_ultrix_mach_dep.s powerpc_darwin_mach_dep.s \
+ rs6000_mach_dep.s sparc_mach_dep.S sparc_netbsd_mach_dep.s \
+ sparc_sunos4_mach_dep.s ia64_save_regs_in_stack.s
+
+-libgcjgc_la_SOURCES = $(GC_SOURCES)
+-libgcjgc_convenience_la_SOURCES = $(GC_SOURCES)
+
+ # Include THREADLIBS here to ensure that the correct versions of
+ # linuxthread semaphore functions get linked:
+-libgcjgc_la_LIBADD = @addobjs@ $(THREADLIBS)
++libgcjgc_la_LIBADD = @addobjs@ $(THREADLIBS) $(UNWINDLIBS)
+ libgcjgc_la_DEPENDENCIES = @addobjs@
+-libgcjgc_la_LDFLAGS = -version-info 1:1:0 -rpath $(toolexeclibdir)
++libgcjgc_la_LDFLAGS = -version-info 1:2:0 -rpath $(toolexeclibdir)
+ libgcjgc_convenience_la_LIBADD = @addobjs@
+ libgcjgc_convenience_la_DEPENDENCIES = @addobjs@
+ AM_CXXFLAGS = @GC_CFLAGS@
+ AM_CFLAGS = @GC_CFLAGS@
+ gctest_SOURCES = tests/test.c
+-gctest_LDADD = ./libgcjgc.la $(THREADLIBS) $(EXTRA_TEST_LIBS)
++gctest_LDADD = ./libgcjgc.la $(THREADDLLIBS) $(UNWINDLIBS) $(EXTRA_TEST_LIBS)
+ gctest_LDFLAGS = -shared-libgcc
+ TESTS_ENVIRONMENT = LD_LIBRARY_PATH=../../$(MULTIBUILDTOP)gcc
+ TESTS = gctest
+@@ -454,7 +458,13 @@
+ # (which will cause the Makefiles to be regenerated when you run `make');
+ # (2) otherwise, pass the desired values on the `make' command line.
+ $(RECURSIVE_TARGETS):
+- @set fnord $$MAKEFLAGS; amf=$$2; \
++ @failcom='exit 1'; \
++ for f in x $$MAKEFLAGS; do \
++ case $$f in \
++ *=* | --[!k]*);; \
++ *k*) failcom='fail=yes';; \
++ esac; \
++ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+@@ -466,7 +476,7 @@
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+- || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
++ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+@@ -474,7 +484,13 @@
+
+ mostlyclean-recursive clean-recursive distclean-recursive \
+ maintainer-clean-recursive:
+- @set fnord $$MAKEFLAGS; amf=$$2; \
++ @failcom='exit 1'; \
++ for f in x $$MAKEFLAGS; do \
++ case $$f in \
++ *=* | --[!k]*);; \
++ *k*) failcom='fail=yes';; \
++ esac; \
++ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+@@ -495,7 +511,7 @@
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+- || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
++ || eval $$failcom; \
+ done && test -z "$$fail"
+ tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+@@ -746,6 +762,10 @@
+ $(LTCOMPILE) -Wp,-P -x assembler-with-cpp -c $<
+ .S.lo:
+ $(LTCOMPILE) -Wp,-P -x assembler-with-cpp -c $<
++
++# No install-html support yet
++.PHONY: install-html
++install-html:
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+ # Otherwise a system limit (for SysV at least) may be exceeded.
+ .NOEXPORT:
+diff -urN old/boehm-gc/mallocx.c src/boehm-gc/mallocx.c
+--- old/boehm-gc/mallocx.c 2004-08-14 01:05:36.000000000 +0200
++++ src/boehm-gc/mallocx.c 2006-08-28 19:14:18.140718000 +0200
+@@ -172,7 +172,8 @@
+ # endif /* REDIRECT_REALLOC */
+
+
+-/* The same thing, except caller does not hold allocation lock. */
++/* Allocate memory such that only pointers to near the */
++/* beginning of the object are considered. */
+ /* We avoid holding allocation lock while we clear memory. */
+ ptr_t GC_generic_malloc_ignore_off_page(lb, k)
+ register size_t lb;
+diff -urN old/boehm-gc/mark.c src/boehm-gc/mark.c
+--- old/boehm-gc/mark.c 2004-08-14 01:05:36.000000000 +0200
++++ src/boehm-gc/mark.c 2006-08-28 19:14:18.140718000 +0200
+@@ -858,9 +858,9 @@
+ ++top;
+ top -> mse_descr = descr;
+ top -> mse_start = p -> mse_start;
+- GC_ASSERT( top -> mse_descr & GC_DS_TAGS != GC_DS_LENGTH ||
+- top -> mse_descr < GC_greatest_plausible_heap_addr
+- - GC_least_plausible_heap_addr);
++ GC_ASSERT( (top -> mse_descr & GC_DS_TAGS) != GC_DS_LENGTH ||
++ top -> mse_descr < (ptr_t)GC_greatest_plausible_heap_addr
++ - (ptr_t)GC_least_plausible_heap_addr);
+ /* If this is a big object, count it as */
+ /* size/256 + 1 objects. */
+ ++i;
+@@ -1450,8 +1450,8 @@
+ ptr_t bottom;
+ ptr_t top;
+ {
+- word * b = (word *)(((long) bottom + ALIGNMENT-1) & ~(ALIGNMENT-1));
+- word * t = (word *)(((long) top) & ~(ALIGNMENT-1));
++ word * b = (word *)(((word) bottom + ALIGNMENT-1) & ~(ALIGNMENT-1));
++ word * t = (word *)(((word) top) & ~(ALIGNMENT-1));
+ register word *p;
+ register word q;
+ register word *lim;
+diff -urN old/boehm-gc/misc.c src/boehm-gc/misc.c
+--- old/boehm-gc/misc.c 2004-08-21 09:49:17.000000000 +0200
++++ src/boehm-gc/misc.c 2006-08-28 19:17:32.360718000 +0200
+@@ -246,7 +246,7 @@
+ byte_sz = WORDS_TO_BYTES(word_sz);
+ if (GC_all_interior_pointers) {
+ /* We need one extra byte; don't fill in GC_size_map[byte_sz] */
+- byte_sz--;
++ byte_sz -= EXTRA_BYTES;
+ }
+
+ for (j = low_limit; j <= byte_sz; j++) GC_size_map[j] = word_sz;
+@@ -674,7 +674,13 @@
+ # if !defined(THREADS) || defined(GC_PTHREADS) || defined(GC_WIN32_THREADS) \
+ || defined(GC_SOLARIS_THREADS)
+ if (GC_stackbottom == 0) {
+- GC_stackbottom = GC_get_stack_base();
++ # ifdef GC_PTHREADS
++ /* Use thread_stack_base if available, as GC could be initialized from
++ a thread that is not the "main" thread. */
++ GC_stackbottom = GC_get_thread_stack_base();
++ # endif
++ if (GC_stackbottom == 0)
++ GC_stackbottom = GC_get_stack_base();
+ # if (defined(LINUX) || defined(HPUX)) && defined(IA64)
+ GC_register_stackbottom = GC_get_register_stack_base();
+ # endif
+@@ -805,7 +811,10 @@
+
+ void GC_enable_incremental GC_PROTO(())
+ {
+-# if !defined(SMALL_CONFIG)
++# if !defined(SMALL_CONFIG) && !defined(KEEP_BACK_PTRS)
++ /* If we are keeping back pointers, the GC itself dirties all */
++ /* pages on which objects have been marked, making */
++ /* incremental GC pointless. */
+ if (!GC_find_leak) {
+ DCL_LOCK_STATE;
+
+diff -urN old/boehm-gc/os_dep.c src/boehm-gc/os_dep.c
+--- old/boehm-gc/os_dep.c 2005-06-15 23:25:54.000000000 +0200
++++ src/boehm-gc/os_dep.c 2006-08-28 19:17:32.350718000 +0200
+@@ -60,6 +60,10 @@
+ # include
+ # endif
+
++#if defined(LINUX) || defined(LINUX_STACKBOTTOM)
++# include
++#endif
++
+ /* Blatantly OS dependent routines, except for those that are related */
+ /* to dynamic loading. */
+
+@@ -245,30 +249,11 @@
+ // XXXXXXXX-XXXXXXXX r-xp 00000000 30:05 260537 name of mapping...\n
+ // ^^^^^^^^ ^^^^^^^^ ^^^^ ^^
+ // start end prot maj_dev
+-// 0 9 18 32
+-//
+-// For 64 bit ABIs:
+-// 0 17 34 56
+ //
+-// The parser is called with a pointer to the entry and the return value
+-// is either NULL or is advanced to the next entry(the byte after the
+-// trailing '\n'.)
++// Note that since about auguat 2003 kernels, the columns no longer have
++// fixed offsets on 64-bit kernels. Hence we no longer rely on fixed offsets
++// anywhere, which is safer anyway.
+ //
+-#if CPP_WORDSZ == 32
+-# define OFFSET_MAP_START 0
+-# define OFFSET_MAP_END 9
+-# define OFFSET_MAP_PROT 18
+-# define OFFSET_MAP_MAJDEV 32
+-# define ADDR_WIDTH 8
+-#endif
+-
+-#if CPP_WORDSZ == 64
+-# define OFFSET_MAP_START 0
+-# define OFFSET_MAP_END 17
+-# define OFFSET_MAP_PROT 34
+-# define OFFSET_MAP_MAJDEV 56
+-# define ADDR_WIDTH 16
+-#endif
+
+ /*
+ * Assign various fields of the first line in buf_ptr to *start, *end,
+@@ -277,37 +262,46 @@
+ char *GC_parse_map_entry(char *buf_ptr, word *start, word *end,
+ char *prot_buf, unsigned int *maj_dev)
+ {
+- int i;
+- char *tok;
++ char *start_start, *end_start, *prot_start, *maj_dev_start;
++ char *p;
++ char *endp;
+
+ if (buf_ptr == NULL || *buf_ptr == '\0') {
+ return NULL;
+ }
+
+- memcpy(prot_buf, buf_ptr+OFFSET_MAP_PROT, 4);
+- /* do the protections first. */
++ p = buf_ptr;
++ while (isspace(*p)) ++p;
++ start_start = p;
++ GC_ASSERT(isxdigit(*start_start));
++ *start = strtoul(start_start, &endp, 16); p = endp;
++ GC_ASSERT(*p=='-');
++
++ ++p;
++ end_start = p;
++ GC_ASSERT(isxdigit(*end_start));
++ *end = strtoul(end_start, &endp, 16); p = endp;
++ GC_ASSERT(isspace(*p));
++
++ while (isspace(*p)) ++p;
++ prot_start = p;
++ GC_ASSERT(*prot_start == 'r' || *prot_start == '-');
++ memcpy(prot_buf, prot_start, 4);
+ prot_buf[4] = '\0';
+-
+- if (prot_buf[1] == 'w') {/* we can skip all of this if it's not writable. */
+-
+- tok = buf_ptr;
+- buf_ptr[OFFSET_MAP_START+ADDR_WIDTH] = '\0';
+- *start = strtoul(tok, NULL, 16);
+-
+- tok = buf_ptr+OFFSET_MAP_END;
+- buf_ptr[OFFSET_MAP_END+ADDR_WIDTH] = '\0';
+- *end = strtoul(tok, NULL, 16);
+-
+- buf_ptr += OFFSET_MAP_MAJDEV;
+- tok = buf_ptr;
+- while (*buf_ptr != ':') buf_ptr++;
+- *buf_ptr++ = '\0';
+- *maj_dev = strtoul(tok, NULL, 16);
++ if (prot_buf[1] == 'w') {/* we can skip the rest if it's not writable. */
++ /* Skip past protection field to offset field */
++ while (!isspace(*p)) ++p; while (isspace(*p)) ++p;
++ GC_ASSERT(isxdigit(*p));
++ /* Skip past offset field, which we ignore */
++ while (!isspace(*p)) ++p; while (isspace(*p)) ++p;
++ maj_dev_start = p;
++ GC_ASSERT(isxdigit(*maj_dev_start));
++ *maj_dev = strtoul(maj_dev_start, NULL, 16);
+ }
+
+- while (*buf_ptr && *buf_ptr++ != '\n');
++ while (*p && *p++ != '\n');
+
+- return buf_ptr;
++ return p;
+ }
+
+ #endif /* Need to parse /proc/self/maps. */
+@@ -699,7 +693,7 @@
+ # if defined(SUNOS5SIGS) || defined(IRIX5) || defined(OSF1) \
+ || defined(HURD) || defined(NETBSD)
+ static struct sigaction old_segv_act;
+-# if defined(_sigargs) /* !Irix6.x */ || defined(HPUX) \
++# if defined(IRIX5) || defined(HPUX) \
+ || defined(HURD) || defined(NETBSD)
+ static struct sigaction old_bus_act;
+ # endif
+@@ -732,9 +726,11 @@
+ /* and setting a handler at the same time. */
+ (void) sigaction(SIGSEGV, 0, &old_segv_act);
+ (void) sigaction(SIGSEGV, &act, 0);
++ (void) sigaction(SIGBUS, 0, &old_bus_act);
++ (void) sigaction(SIGBUS, &act, 0);
+ # else
+ (void) sigaction(SIGSEGV, &act, &old_segv_act);
+-# if defined(IRIX5) && defined(_sigargs) /* Irix 5.x, not 6.x */ \
++# if defined(IRIX5) \
+ || defined(HPUX) || defined(HURD) || defined(NETBSD)
+ /* Under Irix 5.x or HP/UX, we may get SIGBUS. */
+ /* Pthreads doesn't exist under Irix 5.x, so we */
+@@ -773,7 +769,7 @@
+ # if defined(SUNOS5SIGS) || defined(IRIX5) \
+ || defined(OSF1) || defined(HURD) || defined(NETBSD)
+ (void) sigaction(SIGSEGV, &old_segv_act, 0);
+-# if defined(IRIX5) && defined(_sigargs) /* Irix 5.x, not 6.x */ \
++# if defined(IRIX5) \
+ || defined(HPUX) || defined(HURD) || defined(NETBSD)
+ (void) sigaction(SIGBUS, &old_bus_act, 0);
+ # endif
+@@ -854,13 +850,14 @@
+
+ #include
+ #include
+-#include
+
+ # define STAT_SKIP 27 /* Number of fields preceding startstack */
+ /* field in /proc/self/stat */
+
++#ifdef USE_LIBC_PRIVATES
+ # pragma weak __libc_stack_end
+ extern ptr_t __libc_stack_end;
++#endif
+
+ # ifdef IA64
+ /* Try to read the backing store base from /proc/self/maps. */
+@@ -890,30 +887,33 @@
+ return GC_apply_to_maps(backing_store_base_from_maps);
+ }
+
+-# pragma weak __libc_ia64_register_backing_store_base
+- extern ptr_t __libc_ia64_register_backing_store_base;
++# ifdef USE_LIBC_PRIVATES
++# pragma weak __libc_ia64_register_backing_store_base
++ extern ptr_t __libc_ia64_register_backing_store_base;
++# endif
+
+ ptr_t GC_get_register_stack_base(void)
+ {
+- if (0 != &__libc_ia64_register_backing_store_base
+- && 0 != __libc_ia64_register_backing_store_base) {
+- /* Glibc 2.2.4 has a bug such that for dynamically linked */
+- /* executables __libc_ia64_register_backing_store_base is */
+- /* defined but uninitialized during constructor calls. */
+- /* Hence we check for both nonzero address and value. */
+- return __libc_ia64_register_backing_store_base;
+- } else {
+- word result = backing_store_base_from_proc();
+- if (0 == result) {
++# ifdef USE_LIBC_PRIVATES
++ if (0 != &__libc_ia64_register_backing_store_base
++ && 0 != __libc_ia64_register_backing_store_base) {
++ /* Glibc 2.2.4 has a bug such that for dynamically linked */
++ /* executables __libc_ia64_register_backing_store_base is */
++ /* defined but uninitialized during constructor calls. */
++ /* Hence we check for both nonzero address and value. */
++ return __libc_ia64_register_backing_store_base;
++ }
++# endif
++ word result = backing_store_base_from_proc();
++ if (0 == result) {
+ /* Use dumb heuristics. Works only for default configuration. */
+ result = (word)GC_stackbottom - BACKING_STORE_DISPLACEMENT;
+ result += BACKING_STORE_ALIGNMENT - 1;
+ result &= ~(BACKING_STORE_ALIGNMENT - 1);
+ /* Verify that it's at least readable. If not, we goofed. */
+ GC_noop1(*(word *)result);
+- }
+- return (ptr_t)result;
+ }
++ return (ptr_t)result;
+ }
+ # endif
+
+@@ -936,6 +936,7 @@
+ /* since the correct value of __libc_stack_end never */
+ /* becomes visible to us. The second test works around */
+ /* this. */
++# ifdef USE_LIBC_PRIVATES
+ if (0 != &__libc_stack_end && 0 != __libc_stack_end ) {
+ # ifdef IA64
+ /* Some versions of glibc set the address 16 bytes too */
+@@ -957,6 +958,7 @@
+ # endif
+ # endif
+ }
++# endif
+ f = open("/proc/self/stat", O_RDONLY);
+ if (f < 0 || STAT_READ(f, stat_buf, STAT_BUF_SIZE) < 2 * STAT_SKIP) {
+ ABORT("Couldn't read /proc/self/stat");
+@@ -1179,12 +1181,15 @@
+ /* This used to be set for gcc, to avoid dealing with */
+ /* the structured exception handling issues. But we now have */
+ /* assembly code to do that right. */
++ GC_bool GC_wnt = FALSE;
++ /* This is a Windows NT derivative, i.e. NT, W2K, XP or later. */
+
+ void GC_init_win32()
+ {
+ /* if we're running under win32s, assume that no DLLs will be loaded */
+ DWORD v = GetVersion();
+- GC_no_win32_dlls |= ((v & 0x80000000) && (v & 0xff) <= 3);
++ GC_wnt = !(v & 0x80000000);
++ GC_no_win32_dlls |= ((!GC_wnt) && (v & 0xff) <= 3);
+ }
+
+ /* Return the smallest address a such that VirtualQuery */
+@@ -1508,7 +1513,7 @@
+ # endif
+
+
+-# ifdef RS6000
++# if 0 && defined(RS6000) /* We now use mmap */
+ /* The compiler seems to generate speculative reads one past the end of */
+ /* an allocated object. Hence we need to make sure that the page */
+ /* following the last heap page is also mapped. */
+@@ -2381,7 +2386,7 @@
+ # endif
+ # ifdef FREEBSD
+ # define SIG_OK (sig == SIGBUS)
+-# define CODE_OK (code == BUS_PAGE_FAULT)
++# define CODE_OK TRUE
+ # endif
+ # endif /* SUNOS4 || (FREEBSD && !SUNOS5SIGS) */
+
+@@ -3726,7 +3731,7 @@
+ exception_behavior_t behavior;
+ thread_state_flavor_t flavor;
+
+- thread_state_data_t thread_state;
++ thread_state_t thread_state;
+ mach_msg_type_number_t thread_state_count = THREAD_STATE_MAX;
+
+ for(i=0;i
+ # else
+-# if defined(OPENBSD) || defined(NETBSD)
++# if defined(OPENBSD)
+ # include
+ # else
+-# include
++# if defined(FREEBSD) || defined(NETBSD)
++# include
++# else
++# include
++# endif
+ # endif
+ # endif
+ # endif
+@@ -3985,6 +4000,16 @@
+ #if NARGS == 0 && NFRAMES % 2 == 0 /* No padding */ \
+ && defined(GC_HAVE_BUILTIN_BACKTRACE)
+
++#ifdef REDIRECT_MALLOC
++ /* Deal with possible malloc calls in backtrace by omitting */
++ /* the infinitely recursing backtrace. */
++# ifdef THREADS
++ __thread /* If your compiler doesn't understand this */
++ /* you could use something like pthread_getspecific. */
++# endif
++ GC_in_save_callers = FALSE;
++#endif
++
+ void GC_save_callers (info)
+ struct callinfo info[NFRAMES];
+ {
+@@ -3994,15 +4019,26 @@
+
+ /* We retrieve NFRAMES+1 pc values, but discard the first, since it */
+ /* points to our own frame. */
++# ifdef REDIRECT_MALLOC
++ if (GC_in_save_callers) {
++ info[0].ci_pc = (word)(&GC_save_callers);
++ for (i = 1; i < NFRAMES; ++i) info[i].ci_pc = 0;
++ return;
++ }
++ GC_in_save_callers = TRUE;
++# endif
+ GC_ASSERT(sizeof(struct callinfo) == sizeof(void *));
+ npcs = backtrace((void **)tmp_info, NFRAMES + IGNORE_FRAMES);
+ BCOPY(tmp_info+IGNORE_FRAMES, info, (npcs - IGNORE_FRAMES) * sizeof(void *));
+ for (i = npcs - IGNORE_FRAMES; i < NFRAMES; ++i) info[i].ci_pc = 0;
++# ifdef REDIRECT_MALLOC
++ GC_in_save_callers = FALSE;
++# endif
+ }
+
+ #else /* No builtin backtrace; do it ourselves */
+
+-#if (defined(OPENBSD) || defined(NETBSD)) && defined(SPARC)
++#if (defined(OPENBSD) || defined(NETBSD) || defined(FREEBSD)) && defined(SPARC)
+ # define FR_SAVFP fr_fp
+ # define FR_SAVPC fr_pc
+ #else
+diff -urN old/boehm-gc/powerpc_darwin_mach_dep.s src/boehm-gc/powerpc_darwin_mach_dep.s
+--- old/boehm-gc/powerpc_darwin_mach_dep.s 2005-03-24 01:48:39.000000000 +0100
++++ src/boehm-gc/powerpc_darwin_mach_dep.s 2006-08-28 19:14:18.140718000 +0200
+@@ -12,7 +12,7 @@
+
+ ; GC_push_regs function. Under some optimization levels GCC will clobber
+ ; some of the non-volatile registers before we get a chance to save them
+-; therefore, this can't be inline asm.
++; therefore, this cannot be inline asm.
+
+ .text
+ .align LOG2_GPR_BYTES
+diff -urN old/boehm-gc/pthread_stop_world.c src/boehm-gc/pthread_stop_world.c
+--- old/boehm-gc/pthread_stop_world.c 2005-02-09 22:33:02.000000000 +0100
++++ src/boehm-gc/pthread_stop_world.c 2006-08-28 19:14:18.140718000 +0200
+@@ -1,13 +1,19 @@
+ #include "private/pthread_support.h"
+
+ #if defined(GC_PTHREADS) && !defined(GC_SOLARIS_THREADS) \
+- && !defined(GC_IRIX_THREADS) && !defined(GC_WIN32_THREADS) \
+- && !defined(GC_DARWIN_THREADS) && !defined(GC_AIX_THREADS)
++ && !defined(GC_WIN32_THREADS) && !defined(GC_DARWIN_THREADS)
+
+ #include
+ #include
+ #include
+ #include
++#include
++#ifndef HPUX
++# include
++ /* Doesn't exist on HP/UX 11.11. */
++#endif
++
++void suspend_self();
+
+ #if DEBUG_THREADS
+
+@@ -67,7 +73,22 @@
+
+ static sigset_t suspend_handler_mask;
+
+-word GC_stop_count; /* Incremented at the beginning of GC_stop_world. */
++volatile sig_atomic_t GC_stop_count;
++ /* Incremented at the beginning of GC_stop_world. */
++
++volatile sig_atomic_t GC_world_is_stopped = FALSE;
++ /* FALSE ==> it is safe for threads to restart, i.e. */
++ /* they will see another suspend signal before they */
++ /* are expected to stop (unless they have voluntarily */
++ /* stopped). */
++
++void GC_brief_async_signal_safe_sleep()
++{
++ struct timeval tv;
++ tv.tv_sec = 0;
++ tv.tv_usec = 1000 * TIME_LIMIT / 2;
++ select(0, 0, 0, 0, &tv);
++}
+
+ #ifdef GC_OSF1_THREADS
+ GC_bool GC_retry_signals = TRUE;
+@@ -108,7 +129,14 @@
+
+ void GC_suspend_handler(int sig)
+ {
+- GC_with_callee_saves_pushed(GC_suspend_handler_inner, (ptr_t)(word)sig);
++ GC_thread me = GC_lookup_thread (pthread_self());
++ if (me -> flags & SUSPENDED)
++ suspend_self();
++ else {
++ int old_errno = errno;
++ GC_with_callee_saves_pushed(GC_suspend_handler_inner, (ptr_t)(word)sig);
++ errno = old_errno;
++ }
+ }
+
+ #else
+@@ -116,7 +144,14 @@
+ /* in the signal handler frame. */
+ void GC_suspend_handler(int sig)
+ {
+- GC_suspend_handler_inner((ptr_t)(word)sig);
++ GC_thread me = GC_lookup_thread(pthread_self());
++ if (me -> flags & SUSPENDED)
++ suspend_self();
++ else {
++ int old_errno = errno;
++ GC_suspend_handler_inner((ptr_t)(word)sig);
++ errno = old_errno;
++ }
+ }
+ #endif
+
+@@ -172,16 +207,26 @@
+ /* this thread a SIG_THR_RESTART signal. */
+ /* SIG_THR_RESTART should be masked at this point. Thus there */
+ /* is no race. */
+- do {
+- me->stop_info.signal = 0;
+- sigsuspend(&suspend_handler_mask); /* Wait for signal */
+- } while (me->stop_info.signal != SIG_THR_RESTART);
++ /* We do not continue until we receive a SIG_THR_RESTART, */
++ /* but we do not take that as authoritative. (We may be */
++ /* accidentally restarted by one of the user signals we */
++ /* don't block.) After we receive the signal, we use a */
++ /* primitive and expensive mechanism to wait until it's */
++ /* really safe to proceed. Under normal circumstances, */
++ /* this code should not be executed. */
++ sigsuspend(&suspend_handler_mask); /* Wait for signal */
++ while (GC_world_is_stopped && GC_stop_count == my_stop_count) {
++ GC_brief_async_signal_safe_sleep();
++# if DEBUG_THREADS
++ GC_err_printf0("Sleeping in signal handler");
++# endif
++ }
+ /* If the RESTART signal gets lost, we can still lose. That should be */
+ /* less likely than losing the SUSPEND signal, since we don't do much */
+ /* between the sem_post and sigsuspend. */
+- /* We'd need more handshaking to work around that, since we don't want */
+- /* to accidentally leave a RESTART signal pending, thus causing us to */
+- /* continue prematurely in a future round. */
++ /* We'd need more handshaking to work around that. */
++ /* Simply dropping the sigsuspend call should be safe, but is unlikely */
++ /* to be efficient. */
+
+ #if DEBUG_THREADS
+ GC_printf1("Continuing 0x%lx\n", my_thread);
+@@ -191,20 +236,11 @@
+ void GC_restart_handler(int sig)
+ {
+ pthread_t my_thread = pthread_self();
+- GC_thread me;
+
+ if (sig != SIG_THR_RESTART) ABORT("Bad signal in suspend_handler");
+
+- /* Let the GC_suspend_handler() know that we got a SIG_THR_RESTART. */
+- /* The lookup here is safe, since I'm doing this on behalf */
+- /* of a thread which holds the allocation lock in order */
+- /* to stop the world. Thus concurrent modification of the */
+- /* data structure is impossible. */
+- me = GC_lookup_thread(my_thread);
+- me->stop_info.signal = SIG_THR_RESTART;
+-
+ /*
+- ** Note: even if we didn't do anything useful here,
++ ** Note: even if we don't do anything useful here,
+ ** it would still be necessary to have a signal handler,
+ ** rather than ignoring the signals, otherwise
+ ** the signals will not be delivered at all, and
+@@ -357,6 +393,7 @@
+ /* We should have previously waited for it to become zero. */
+ # endif /* PARALLEL_MARK */
+ ++GC_stop_count;
++ GC_world_is_stopped = TRUE;
+ n_live_threads = GC_suspend_all();
+
+ if (GC_retry_signals) {
+@@ -390,10 +427,10 @@
+ }
+ for (i = 0; i < n_live_threads; i++) {
+ while (0 != (code = sem_wait(&GC_suspend_ack_sem))) {
+- if (errno != EINTR) {
+- GC_err_printf1("Sem_wait returned %ld\n", (unsigned long)code);
+- ABORT("sem_wait for handler failed");
+- }
++ if (errno != EINTR) {
++ GC_err_printf1("Sem_wait returned %ld\n", (unsigned long)code);
++ ABORT("sem_wait for handler failed");
++ }
+ }
+ }
+ # ifdef PARALLEL_MARK
+@@ -405,6 +442,47 @@
+ GC_stopping_thread = 0; /* debugging only */
+ }
+
++void suspend_self() {
++ GC_thread me = GC_lookup_thread(pthread_self());
++ if (me == NULL)
++ ABORT("attempting to suspend unknown thread");
++
++ me -> flags |= SUSPENDED;
++ GC_start_blocking();
++ while (me -> flags & SUSPENDED)
++ GC_brief_async_signal_safe_sleep();
++ GC_end_blocking();
++}
++
++void GC_suspend_thread(pthread_t thread) {
++ if (thread == pthread_self())
++ suspend_self();
++ else {
++ int result;
++ GC_thread t = GC_lookup_thread(thread);
++ if (t == NULL)
++ ABORT("attempting to suspend unknown thread");
++
++ t -> flags |= SUSPENDED;
++ result = pthread_kill (t -> id, SIG_SUSPEND);
++ switch (result) {
++ case ESRCH:
++ case 0:
++ break;
++ default:
++ ABORT("pthread_kill failed");
++ }
++ }
++}
++
++void GC_resume_thread(pthread_t thread) {
++ GC_thread t = GC_lookup_thread(thread);
++ if (t == NULL)
++ ABORT("attempting to resume unknown thread");
++
++ t -> flags &= ~SUSPENDED;
++}
++
+ /* Caller holds allocation lock, and has held it continuously since */
+ /* the world stopped. */
+ void GC_start_world()
+@@ -419,6 +497,7 @@
+ GC_printf0("World starting\n");
+ # endif
+
++ GC_world_is_stopped = FALSE;
+ for (i = 0; i < THREAD_TABLE_SZ; i++) {
+ for (p = GC_threads[i]; p != 0; p = p -> next) {
+ if (p -> id != my_thread) {
+@@ -428,8 +507,7 @@
+ #if DEBUG_THREADS
+ GC_printf1("Sending restart signal to 0x%lx\n", p -> id);
+ #endif
+-
+- result = pthread_kill(p -> id, SIG_THR_RESTART);
++ result = pthread_kill(p -> id, SIG_THR_RESTART);
+ switch(result) {
+ case ESRCH:
+ /* Not really there anymore. Possible? */
+diff -urN old/boehm-gc/pthread_support.c src/boehm-gc/pthread_support.c
+--- old/boehm-gc/pthread_support.c 2006-02-10 02:54:34.000000000 +0100
++++ src/boehm-gc/pthread_support.c 2006-08-28 19:17:32.350718000 +0200
+@@ -2,7 +2,7 @@
+ * Copyright (c) 1994 by Xerox Corporation. All rights reserved.
+ * Copyright (c) 1996 by Silicon Graphics. All rights reserved.
+ * Copyright (c) 1998 by Fergus Henderson. All rights reserved.
+- * Copyright (c) 2000-2001 by Hewlett-Packard Company. All rights reserved.
++ * Copyright (c) 2000-2004 by Hewlett-Packard Company. All rights reserved.
+ *
+ * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
+ * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
+@@ -58,8 +58,7 @@
+ # include "private/pthread_support.h"
+
+ # if defined(GC_PTHREADS) && !defined(GC_SOLARIS_THREADS) \
+- && !defined(GC_IRIX_THREADS) && !defined(GC_WIN32_THREADS) \
+- && !defined(GC_AIX_THREADS)
++ && !defined(GC_WIN32_THREADS)
+
+ # if defined(GC_HPUX_THREADS) && !defined(USE_PTHREAD_SPECIFIC) \
+ && !defined(USE_COMPILER_TLS)
+@@ -76,7 +75,8 @@
+ # endif
+
+ # if (defined(GC_DGUX386_THREADS) || defined(GC_OSF1_THREADS) || \
+- defined(GC_DARWIN_THREADS)) && !defined(USE_PTHREAD_SPECIFIC)
++ defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS)) \
++ && !defined(USE_PTHREAD_SPECIFIC)
+ # define USE_PTHREAD_SPECIFIC
+ # endif
+
+@@ -124,7 +124,7 @@
+ # include
+ #endif /* !GC_DARWIN_THREADS */
+
+-#if defined(GC_DARWIN_THREADS)
++#if defined(GC_DARWIN_THREADS) || defined(GC_FREEBSD_THREADS)
+ # include
+ #endif /* GC_DARWIN_THREADS */
+
+@@ -602,7 +602,9 @@
+ } else {
+ prev -> next = p -> next;
+ }
+- GC_INTERNAL_FREE(p);
++
++ if (p != &first_thread)
++ GC_INTERNAL_FREE(p);
+ }
+
+ /* If a thread has been joined, but we have not yet */
+@@ -847,9 +849,9 @@
+ /* We hold the allocation lock. */
+ void GC_thr_init()
+ {
+-# ifndef GC_DARWIN_THREADS
+- int dummy;
+-# endif
++# ifndef GC_DARWIN_THREADS
++ int dummy;
++# endif
+ GC_thread t;
+
+ if (GC_thr_initialized) return;
+@@ -881,14 +883,15 @@
+ # if defined(GC_HPUX_THREADS)
+ GC_nprocs = pthread_num_processors_np();
+ # endif
+-# if defined(GC_OSF1_THREADS)
++# if defined(GC_OSF1_THREADS) || defined(GC_AIX_THREADS)
+ GC_nprocs = sysconf(_SC_NPROCESSORS_ONLN);
+ if (GC_nprocs <= 0) GC_nprocs = 1;
+ # endif
+-# if defined(GC_FREEBSD_THREADS)
+- GC_nprocs = 1;
++# if defined(GC_IRIX_THREADS)
++ GC_nprocs = sysconf(_SC_NPROC_ONLN);
++ if (GC_nprocs <= 0) GC_nprocs = 1;
+ # endif
+-# if defined(GC_DARWIN_THREADS)
++# if defined(GC_DARWIN_THREADS) || defined(GC_FREEBSD_THREADS)
+ int ncpus = 1;
+ size_t len = sizeof(ncpus);
+ sysctl((int[2]) {CTL_HW, HW_NCPU}, 2, &ncpus, &len, NULL, 0);
+@@ -935,6 +938,8 @@
+ /* Disable true incremental collection, but generational is OK. */
+ GC_time_limit = GC_TIME_UNLIMITED;
+ }
++ /* If we are using a parallel marker, actually start helper threads. */
++ if (GC_parallel) start_mark_threads();
+ # endif
+ }
+
+@@ -951,10 +956,6 @@
+
+ /* GC_init() calls us back, so set flag first. */
+ if (!GC_is_initialized) GC_init();
+- /* If we are using a parallel marker, start the helper threads. */
+-# ifdef PARALLEL_MARK
+- if (GC_parallel) start_mark_threads();
+-# endif
+ /* Initialize thread local free lists if used. */
+ # if defined(THREAD_LOCAL_ALLOC) && !defined(DBG_HDRS_ALL)
+ LOCK();
+@@ -1125,6 +1126,107 @@
+
+ GC_bool GC_in_thread_creation = FALSE;
+
++GC_PTR GC_get_thread_stack_base()
++{
++# ifdef HAVE_PTHREAD_GETATTR_NP
++ pthread_t my_pthread;
++ pthread_attr_t attr;
++ ptr_t stack_addr;
++ size_t stack_size;
++
++ my_pthread = pthread_self();
++ pthread_getattr_np (my_pthread, &attr);
++ pthread_attr_getstack (&attr, (void **) &stack_addr, &stack_size);
++ pthread_attr_destroy (&attr);
++
++# ifdef DEBUG_THREADS
++ GC_printf1("attached thread stack address: 0x%x\n", stack_addr);
++# endif
++
++# ifdef STACK_GROWS_DOWN
++ return stack_addr + stack_size;
++# else
++ return stack_addr - stack_size;
++# endif
++
++# else
++# ifdef DEBUG_THREADS
++ GC_printf1("Can not determine stack base for attached thread");
++# endif
++ return 0;
++# endif
++}
++
++void GC_register_my_thread()
++{
++ GC_thread me;
++ pthread_t my_pthread;
++
++ my_pthread = pthread_self();
++# ifdef DEBUG_THREADS
++ GC_printf1("Attaching thread 0x%lx\n", my_pthread);
++ GC_printf1("pid = %ld\n", (long) getpid());
++# endif
++
++ /* Check to ensure this thread isn't attached already. */
++ LOCK();
++ me = GC_lookup_thread (my_pthread);
++ UNLOCK();
++ if (me != 0)
++ {
++# ifdef DEBUG_THREADS
++ GC_printf1("Attempt to re-attach known thread 0x%lx\n", my_pthread);
++# endif
++ return;
++ }
++
++ LOCK();
++ GC_in_thread_creation = TRUE;
++ me = GC_new_thread(my_pthread);
++ GC_in_thread_creation = FALSE;
++
++ me -> flags |= DETACHED;
++
++#ifdef GC_DARWIN_THREADS
++ me -> stop_info.mach_thread = mach_thread_self();
++#else
++ me -> stack_end = GC_get_thread_stack_base();
++ if (me -> stack_end == 0)
++ GC_abort("Can not determine stack base for attached thread");
++
++# ifdef STACK_GROWS_DOWN
++ me -> stop_info.stack_ptr = me -> stack_end - 0x10;
++# else
++ me -> stop_info.stack_ptr = me -> stack_end + 0x10;
++# endif
++#endif
++
++# ifdef IA64
++ me -> backing_store_end = (ptr_t)
++ (GC_save_regs_in_stack() & ~(GC_page_size - 1));
++ /* This is also < 100% convincing. We should also read this */
++ /* from /proc, but the hook to do so isn't there yet. */
++# endif /* IA64 */
++
++# if defined(THREAD_LOCAL_ALLOC) && !defined(DBG_HDRS_ALL)
++ GC_init_thread_local(me);
++# endif
++ UNLOCK();
++}
++
++void GC_unregister_my_thread()
++{
++ pthread_t my_pthread;
++
++ my_pthread = pthread_self();
++
++# ifdef DEBUG_THREADS
++ GC_printf1("Detaching thread 0x%lx\n", my_pthread);
++# endif
++
++ GC_thread_exit_proc (0);
++}
++
+ void * GC_start_routine(void * arg)
+ {
+ int dummy;
+@@ -1201,37 +1303,8 @@
+ return(result);
+ }
+
+-#ifdef GC_PTHREAD_SYM_VERSION
+-
+-/* Force constr to execute prior to main(). */
+-static void constr (void) __attribute__ ((constructor));
+-
+-static int
+-(*pthread_create_)(pthread_t *new_thread,
+- const pthread_attr_t *attr_in,
+- void * (*thread_execp)(void *), void *arg);
+-
+-static void
+-constr (void)
+-{
+- /* Get a pointer to the real pthread_create. */
+- pthread_create_ = dlvsym (RTLD_NEXT, "pthread_create",
+- GC_PTHREAD_SYM_VERSION);
+-}
+-
+-#define GC_PTHREAD_CREATE_NAME pthread_create
+-#define GC_PTHREAD_REAL_NAME (*pthread_create_)
+-
+-#else
+-
+-#define GC_PTHREAD_CREATE_NAME WRAP_FUNC(pthread_create)
+-#define GC_PTHREAD_REAL_NAME REAL_FUNC(pthread_create)
+-
+-#endif
+-
+-
+ int
+-GC_PTHREAD_CREATE_NAME(pthread_t *new_thread,
++WRAP_FUNC(pthread_create)(pthread_t *new_thread,
+ const pthread_attr_t *attr,
+ void *(*start_routine)(void *), void *arg)
+ {
+@@ -1259,7 +1332,7 @@
+ if (!GC_thr_initialized) GC_thr_init();
+ # ifdef GC_ASSERTIONS
+ {
+- int stack_size;
++ size_t stack_size;
+ if (NULL == attr) {
+ pthread_attr_t my_attr;
+ pthread_attr_init(&my_attr);
+@@ -1267,7 +1340,13 @@
+ } else {
+ pthread_attr_getstacksize(attr, &stack_size);
+ }
+- GC_ASSERT(stack_size >= (8*HBLKSIZE*sizeof(word)));
++# ifdef PARALLEL_MARK
++ GC_ASSERT(stack_size >= (8*HBLKSIZE*sizeof(word)));
++# else
++ /* FreeBSD-5.3/Alpha: default pthread stack is 64K, */
++ /* HBLKSIZE=8192, sizeof(word)=8 */
++ GC_ASSERT(stack_size >= 65536);
++# endif
+ /* Our threads may need to do some work for the GC. */
+ /* Ridiculously small threads won't work, and they */
+ /* probably wouldn't work anyway. */
+@@ -1286,7 +1365,7 @@
+ pthread_self());
+ # endif
+
+- result = GC_PTHREAD_REAL_NAME(new_thread, attr, GC_start_routine, si);
++ result = REAL_FUNC(pthread_create)(new_thread, attr, GC_start_routine, si);
+
+ # ifdef DEBUG_THREADS
+ GC_printf1("Started thread 0x%X\n", *new_thread);
+diff -urN old/boehm-gc/reclaim.c src/boehm-gc/reclaim.c
+--- old/boehm-gc/reclaim.c 2003-07-28 06:18:23.000000000 +0200
++++ src/boehm-gc/reclaim.c 2006-08-28 19:14:18.140718000 +0200
+@@ -888,7 +888,7 @@
+ {
+ struct Print_stats pstats;
+
+- GC_printf0("(kind(0=ptrfree,1=normal,2=unc.,3=stubborn):size_in_bytes, #_marks_set)\n");
++ GC_printf1("(kind(0=ptrfree,1=normal,2=unc.,%lu=stubborn):size_in_bytes, #_marks_set)\n", STUBBORN);
+ pstats.number_of_blocks = 0;
+ pstats.total_bytes = 0;
+ GC_apply_to_all_blocks(GC_print_block_descr, (word)&pstats);
+diff -urN old/boehm-gc/solaris_pthreads.c src/boehm-gc/solaris_pthreads.c
+--- old/boehm-gc/solaris_pthreads.c 2004-08-16 18:32:26.000000000 +0200
++++ src/boehm-gc/solaris_pthreads.c 2006-08-28 19:14:18.140718000 +0200
+@@ -16,7 +16,7 @@
+ * Modified by Peter C. for Solaris Posix Threads.
+ */
+
+-#include "private/gc_priv.h"
++# include "private/gc_priv.h"
+
+ # if defined(GC_SOLARIS_PTHREADS)
+ # include
+diff -urN old/boehm-gc/solaris_threads.c src/boehm-gc/solaris_threads.c
+--- old/boehm-gc/solaris_threads.c 2004-08-16 18:32:26.000000000 +0200
++++ src/boehm-gc/solaris_threads.c 2006-08-28 19:14:18.140718000 +0200
+@@ -16,7 +16,7 @@
+ */
+ /* Boehm, September 14, 1994 4:44 pm PDT */
+
+-#include "private/gc_priv.h"
++# include "private/gc_priv.h"
+
+ # if defined(GC_SOLARIS_THREADS) || defined(GC_SOLARIS_PTHREADS)
+ # include "private/solaris_threads.h"
+@@ -248,8 +248,8 @@
+ for (i = 0; i < max_lwps; i++)
+ last_ids[i] = 0;
+ for (;;) {
+- if (syscall(SYS_ioctl, GC_main_proc_fd, PIOCSTATUS, &status) < 0)
+- ABORT("Main PIOCSTATUS failed");
++ if (syscall(SYS_ioctl, GC_main_proc_fd, PIOCSTATUS, &status) < 0)
++ ABORT("Main PIOCSTATUS failed");
+ if (status.pr_nlwp < 1)
+ ABORT("Invalid number of lwps returned by PIOCSTATUS");
+ if (status.pr_nlwp >= max_lwps) {
+@@ -262,7 +262,7 @@
+ for (i = 0; i < max_lwps; i++)
+ last_ids[i] = 0;
+ continue;
+- }
++ }
+ if (syscall(SYS_ioctl, GC_main_proc_fd, PIOCLWPIDS, GC_current_ids) < 0)
+ ABORT("PIOCLWPIDS failed");
+ changed = FALSE;
+diff -urN old/boehm-gc/tests/test.c src/boehm-gc/tests/test.c
+--- old/boehm-gc/tests/test.c 2004-08-14 01:05:36.000000000 +0200
++++ src/boehm-gc/tests/test.c 2006-08-28 19:14:18.140718000 +0200
+@@ -1367,6 +1367,10 @@
+ max_heap_sz = 11000000;
+ }
+ # endif
++# ifndef ALIGN_DOUBLE
++ /* We end up needing more small object pages. */
++ max_heap_sz += 2000000;
++# endif
+ # ifdef GC_DEBUG
+ max_heap_sz *= 2;
+ # ifdef SAVE_CALL_CHAIN
+diff -urN old/boehm-gc/threadlibs.c src/boehm-gc/threadlibs.c
+--- old/boehm-gc/threadlibs.c 2004-08-14 01:05:36.000000000 +0200
++++ src/boehm-gc/threadlibs.c 2006-08-28 19:14:18.150718000 +0200
+@@ -11,10 +11,17 @@
+ "-Wl,--wrap -Wl,pthread_sigmask -Wl,--wrap -Wl,sleep\n");
+ # endif
+ # if defined(GC_LINUX_THREADS) || defined(GC_IRIX_THREADS) \
+- || defined(GC_FREEBSD_THREADS) || defined(GC_SOLARIS_PTHREADS) \
++ || defined(GC_SOLARIS_PTHREADS) \
+ || defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS)
+ printf("-lpthread\n");
+ # endif
++# if defined(GC_FREEBSD_THREADS)
++# if (__FREEBSD_version >= 500000)
++ printf("-lpthread\n");
++# else
++ printf("-pthread\n");
++# endif
++# endif
+ # if defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS)
+ printf("-lpthread -lrt\n");
+ # endif
+diff -urN old/boehm-gc/version.h src/boehm-gc/version.h
+--- old/boehm-gc/version.h 2004-08-14 01:05:36.000000000 +0200
++++ src/boehm-gc/version.h 2006-08-28 19:14:18.150718000 +0200
+@@ -2,7 +2,7 @@
+ /* Eventually this one may become unnecessary. For now we need */
+ /* it to keep the old-style build process working. */
+ #define GC_TMP_VERSION_MAJOR 6
+-#define GC_TMP_VERSION_MINOR 3
++#define GC_TMP_VERSION_MINOR 6
+ #define GC_TMP_ALPHA_VERSION GC_NOT_ALPHA
+
+ #ifndef GC_NOT_ALPHA
+diff -urN old/boehm-gc/win32_threads.c src/boehm-gc/win32_threads.c
+--- old/boehm-gc/win32_threads.c 2004-08-23 17:07:00.000000000 +0200
++++ src/boehm-gc/win32_threads.c 2006-08-28 19:14:18.150718000 +0200
+@@ -11,6 +11,7 @@
+ # undef pthread_create
+ # undef pthread_sigmask
+ # undef pthread_join
++# undef pthread_detach
+ # undef dlopen
+
+ # define DEBUG_CYGWIN_THREADS 0
+@@ -185,7 +186,7 @@
+ /* Must still be in_use, since nobody else can store our thread_id. */
+ i++) {}
+ if (i > my_max) {
+- WARN("Removing nonexisiting thread %ld\n", (GC_word)thread_id);
++ WARN("Removing nonexistent thread %ld\n", (GC_word)thread_id);
+ } else {
+ GC_delete_gc_thread(thread_table+i);
+ }
+@@ -232,6 +233,9 @@
+ # endif
+ }
+
++/* Defined in misc.c */
++extern CRITICAL_SECTION GC_write_cs;
++
+ void GC_stop_world()
+ {
+ DWORD thread_id = GetCurrentThreadId();
+@@ -240,6 +244,9 @@
+ if (!GC_thr_initialized) ABORT("GC_stop_world() called before GC_thr_init()");
+
+ GC_please_stop = TRUE;
++# ifndef CYGWIN32
++ EnterCriticalSection(&GC_write_cs);
++# endif /* !CYGWIN32 */
+ for (i = 0; i <= GC_get_max_thread_index(); i++)
+ if (thread_table[i].stack_base != 0
+ && thread_table[i].id != thread_id) {
+@@ -270,6 +277,9 @@
+ # endif
+ thread_table[i].suspended = TRUE;
+ }
++# ifndef CYGWIN32
++ LeaveCriticalSection(&GC_write_cs);
++# endif /* !CYGWIN32 */
+ }
+
+ void GC_start_world()
+diff -urN old/gcc/cp/ChangeLog src/gcc/cp/ChangeLog
+--- old/gcc/cp/ChangeLog 2006-08-28 19:12:38.040718000 +0200
++++ src/gcc/cp/ChangeLog 2006-08-28 19:24:44.290718000 +0200
+@@ -146,6 +146,12 @@
+ * method.c (locate_copy): Check for non_reference
+ returning error_mark_node.
+
++2005-12-10 Terry Laurenzo
++
++ PR java/9861
++ * mangle.c (write_bare_function_type): Mangle return type for
++ methods of Java classes
++
+ 2006-07-21 Volker Reichelt
+
+ PR c++/28363
+diff -urN old/gcc/cp/mangle.c src/gcc/cp/mangle.c
+--- old/gcc/cp/mangle.c 2006-08-28 19:12:38.030718000 +0200
++++ src/gcc/cp/mangle.c 2006-08-28 19:14:18.160718000 +0200
+@@ -1858,16 +1858,38 @@
+ is mangled before the parameter types. If non-NULL, DECL is
+ FUNCTION_DECL for the function whose type is being emitted.
+
+- ::= + */
++ If DECL is a member of a Java type, then a literal 'J'
++ is output and the return type is mangled as if INCLUDE_RETURN_TYPE
++ were nonzero.
++
++ ::= [J]+ */
+
+ static void
+ write_bare_function_type (const tree type, const int include_return_type_p,
+ const tree decl)
+ {
++ int java_method_p;
++
+ MANGLE_TRACE_TREE ("bare-function-type", type);
+
++ /* Detect Java methods and emit special encoding. */
++ if (decl != NULL
++ && DECL_FUNCTION_MEMBER_P (decl)
++ && TYPE_FOR_JAVA (DECL_CONTEXT (decl))
++ && !DECL_CONSTRUCTOR_P (decl)
++ && !DECL_DESTRUCTOR_P (decl)
++ && !DECL_CONV_FN_P (decl))
++ {
++ java_method_p = 1;
++ write_char ('J');
++ }
++ else
++ {
++ java_method_p = 0;
++ }
++
+ /* Mangle the return type, if requested. */
+- if (include_return_type_p)
++ if (include_return_type_p || java_method_p)
+ write_type (TREE_TYPE (type));
+
+ /* Now mangle the types of the arguments. */
+diff -urN old/gcc/java/boehm.c src/gcc/java/boehm.c
+--- old/gcc/java/boehm.c 2005-06-25 02:33:05.000000000 +0200
++++ src/gcc/java/boehm.c 2006-08-28 19:14:18.160718000 +0200
+@@ -1,5 +1,5 @@
+ /* Functions related to the Boehm garbage collector.
+- Copyright (C) 2000, 2003, 2004 Free Software Foundation, Inc.
++ Copyright (C) 2000, 2003, 2004, 2006 Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+@@ -40,6 +40,14 @@
+ static void set_bit (unsigned HOST_WIDE_INT *, unsigned HOST_WIDE_INT *,
+ unsigned int);
+
++/* A procedure-based object descriptor. We know that our
++ `kind' is 0, and `env' is likewise 0, so we have a simple
++ computation. From the GC sources:
++ (((((env) << LOG_MAX_MARK_PROCS) | (proc_index)) << DS_TAG_BITS) \
++ | DS_PROC)
++ Here DS_PROC == 2. */
++#define PROCEDURE_OBJECT_DESCRIPTOR 2
++
+ /* Treat two HOST_WIDE_INT's as a contiguous bitmap, with bit 0 being
+ the least significant. This function sets bit N in the bitmap. */
+ static void
+@@ -101,8 +109,7 @@
+
+ /* If this reference slot appears to overlay a slot we think
+ we already covered, then we are doomed. */
+- if (offset <= *last_view_index)
+- abort ();
++ gcc_assert (offset > *last_view_index);
+
+ count = offset * BITS_PER_UNIT / POINTER_SIZE;
+ size_words = size_bytes * BITS_PER_UNIT / POINTER_SIZE;
+@@ -185,7 +192,7 @@
+ /* If the object is all pointers, or if the part with pointers fits
+ in our bitmap, then we are ok. Otherwise we have to allocate it
+ a different way. */
+- if (all_bits_set != -1)
++ if (all_bits_set != -1 || (pointer_after_end && flag_reduced_reflection))
+ {
+ /* In this case the initial part of the object is all reference
+ fields, and the end of the object is all non-reference
+@@ -194,7 +201,12 @@
+ this:
+ value = DS_LENGTH | WORDS_TO_BYTES (last_set_index + 1);
+ DS_LENGTH is 0.
+- WORDS_TO_BYTES shifts by log2(bytes-per-pointer). */
++ WORDS_TO_BYTES shifts by log2(bytes-per-pointer).
++
++ In the case of flag_reduced_reflection and the bitmap would
++ overflow, we tell the gc that the object is all pointers so
++ that we don't have to emit reflection data for run time
++ marking. */
+ count = 0;
+ low = 0;
+ high = 0;
+@@ -216,15 +228,25 @@
+ }
+ else
+ {
+- /* Compute a procedure-based object descriptor. We know that our
+- `kind' is 0, and `env' is likewise 0, so we have a simple
+- computation. From the GC sources:
+- (((((env) << LOG_MAX_MARK_PROCS) | (proc_index)) << DS_TAG_BITS) \
+- | DS_PROC)
+- Here DS_PROC == 2. */
+ procedure_object_descriptor:
+- value = build_int_cst (value_type, 2);
++ value = build_int_cst (value_type, PROCEDURE_OBJECT_DESCRIPTOR);
+ }
+
+ return value;
+ }
++
++/* The fourth (index of 3) element in the vtable is the GC descriptor.
++ A value of 2 indicates that the class uses _Jv_MarkObj. */
++bool
++uses_jv_markobj_p (tree dtable)
++{
++ tree v;
++ /* FIXME: what do we return if !flag_use_boehm_gc ? */
++ gcc_assert (flag_use_boehm_gc);
++ /* FIXME: this is wrong if TARGET_VTABLE_USES_DESCRIPTORS. However,
++ this function is only used with flag_reduced_reflection. No
++ point in asserting unless we hit the bad case. */
++ gcc_assert (!flag_reduced_reflection || TARGET_VTABLE_USES_DESCRIPTORS == 0);
++ v = VEC_index (constructor_elt, CONSTRUCTOR_ELTS (dtable), 3)->value;
++ return (PROCEDURE_OBJECT_DESCRIPTOR == TREE_INT_CST_LOW (v));
++}
+diff -urN old/gcc/java/buffer.c src/gcc/java/buffer.c
+--- old/gcc/java/buffer.c 2005-06-25 02:33:05.000000000 +0200
++++ src/gcc/java/buffer.c 2006-08-28 19:14:18.160718000 +0200
+@@ -37,7 +37,7 @@
+ {
+ if (size < 120)
+ size = 120;
+- bufp->data = xmalloc (size);
++ bufp->data = XNEWVEC (unsigned char, size);
+ bufp->ptr = bufp->data;
+ }
+ else
+diff -urN old/gcc/java/builtins.c src/gcc/java/builtins.c
+--- old/gcc/java/builtins.c 2005-09-18 21:10:15.000000000 +0200
++++ src/gcc/java/builtins.c 2006-08-28 19:17:32.330718000 +0200
+@@ -1,5 +1,5 @@
+ /* Built-in and inline functions for gcj
+- Copyright (C) 2001, 2003, 2004, 2005
++ Copyright (C) 2001, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
+
+ This file is part of GCC.
+@@ -39,6 +39,7 @@
+ static tree max_builtin (tree, tree);
+ static tree min_builtin (tree, tree);
+ static tree abs_builtin (tree, tree);
++static tree convert_real (tree, tree);
+
+ static tree java_build_function_call_expr (tree, tree);
+
+@@ -85,6 +86,10 @@
+ { { "java.lang.Math" }, { "sin" }, NULL, BUILT_IN_SIN },
+ { { "java.lang.Math" }, { "sqrt" }, NULL, BUILT_IN_SQRT },
+ { { "java.lang.Math" }, { "tan" }, NULL, BUILT_IN_TAN },
++ { { "java.lang.Float" }, { "intBitsToFloat" }, convert_real, 0 },
++ { { "java.lang.Double" }, { "longBitsToDouble" }, convert_real, 0 },
++ { { "java.lang.Float" }, { "floatToRawIntBits" }, convert_real, 0 },
++ { { "java.lang.Double" }, { "doubleToRawLongBits" }, convert_real, 0 },
+ { { NULL }, { NULL }, NULL, END_BUILTINS }
+ };
+
+@@ -94,6 +99,9 @@
+ static tree
+ max_builtin (tree method_return_type, tree method_arguments)
+ {
++ /* MAX_EXPR does not handle -0.0 in the Java style. */
++ if (TREE_CODE (method_return_type) == REAL_TYPE)
++ return NULL_TREE;
+ return fold_build2 (MAX_EXPR, method_return_type,
+ TREE_VALUE (method_arguments),
+ TREE_VALUE (TREE_CHAIN (method_arguments)));
+@@ -102,6 +110,9 @@
+ static tree
+ min_builtin (tree method_return_type, tree method_arguments)
+ {
++ /* MIN_EXPR does not handle -0.0 in the Java style. */
++ if (TREE_CODE (method_return_type) == REAL_TYPE)
++ return NULL_TREE;
+ return fold_build2 (MIN_EXPR, method_return_type,
+ TREE_VALUE (method_arguments),
+ TREE_VALUE (TREE_CHAIN (method_arguments)));
+@@ -125,6 +136,13 @@
+ call_expr, arglist, NULL_TREE);
+ }
+
++static tree
++convert_real (tree method_return_type, tree method_arguments)
++{
++ return build1 (VIEW_CONVERT_EXPR, method_return_type,
++ TREE_VALUE (method_arguments));
++}
++
+
+
+ #define BUILTIN_NOTHROW 1
+@@ -194,43 +212,43 @@
+ float_ftype_float_float, "fmodf", BUILTIN_CONST);
+
+ define_builtin (BUILT_IN_ACOS, "__builtin_acos",
+- double_ftype_double, "_ZN4java4lang4Math4acosEd",
++ double_ftype_double, "_ZN4java4lang4Math4acosEJdd",
+ BUILTIN_CONST);
+ define_builtin (BUILT_IN_ASIN, "__builtin_asin",
+- double_ftype_double, "_ZN4java4lang4Math4asinEd",
++ double_ftype_double, "_ZN4java4lang4Math4asinEJdd",
+ BUILTIN_CONST);
+ define_builtin (BUILT_IN_ATAN, "__builtin_atan",
+- double_ftype_double, "_ZN4java4lang4Math4atanEd",
++ double_ftype_double, "_ZN4java4lang4Math4atanEJdd",
+ BUILTIN_CONST);
+ define_builtin (BUILT_IN_ATAN2, "__builtin_atan2",
+- double_ftype_double_double, "_ZN4java4lang4Math5atan2Edd",
++ double_ftype_double_double, "_ZN4java4lang4Math5atan2EJddd",
+ BUILTIN_CONST);
+ define_builtin (BUILT_IN_CEIL, "__builtin_ceil",
+- double_ftype_double, "_ZN4java4lang4Math4ceilEd",
++ double_ftype_double, "_ZN4java4lang4Math4ceilEJdd",
+ BUILTIN_CONST);
+ define_builtin (BUILT_IN_COS, "__builtin_cos",
+- double_ftype_double, "_ZN4java4lang4Math3cosEd",
++ double_ftype_double, "_ZN4java4lang4Math3cosEJdd",
+ BUILTIN_CONST);
+ define_builtin (BUILT_IN_EXP, "__builtin_exp",
+- double_ftype_double, "_ZN4java4lang4Math3expEd",
++ double_ftype_double, "_ZN4java4lang4Math3expEJdd",
+ BUILTIN_CONST);
+ define_builtin (BUILT_IN_FLOOR, "__builtin_floor",
+- double_ftype_double, "_ZN4java4lang4Math5floorEd",
++ double_ftype_double, "_ZN4java4lang4Math5floorEJdd",
+ BUILTIN_CONST);
+ define_builtin (BUILT_IN_LOG, "__builtin_log",
+- double_ftype_double, "_ZN4java4lang4Math3logEd",
++ double_ftype_double, "_ZN4java4lang4Math3logEJdd",
+ BUILTIN_CONST);
+ define_builtin (BUILT_IN_POW, "__builtin_pow",
+- double_ftype_double_double, "_ZN4java4lang4Math3powEdd",
++ double_ftype_double_double, "_ZN4java4lang4Math3powEJddd",
+ BUILTIN_CONST);
+ define_builtin (BUILT_IN_SIN, "__builtin_sin",
+- double_ftype_double, "_ZN4java4lang4Math3sinEd",
++ double_ftype_double, "_ZN4java4lang4Math3sinEJdd",
+ BUILTIN_CONST);
+ define_builtin (BUILT_IN_SQRT, "__builtin_sqrt",
+- double_ftype_double, "_ZN4java4lang4Math4sqrtEd",
++ double_ftype_double, "_ZN4java4lang4Math4sqrtEJdd",
+ BUILTIN_CONST);
+ define_builtin (BUILT_IN_TAN, "__builtin_tan",
+- double_ftype_double, "_ZN4java4lang4Math3tanEd",
++ double_ftype_double, "_ZN4java4lang4Math3tanEJdd",
+ BUILTIN_CONST);
+
+ t = tree_cons (NULL_TREE, boolean_type_node, end_params_node);
+@@ -241,6 +259,10 @@
+ "__builtin_expect",
+ BUILTIN_CONST | BUILTIN_NOTHROW);
+
++ define_builtin (BUILT_IN_SYNCHRONIZE, "__sync_synchronize",
++ build_function_type (void_type_node, void_list_node),
++ "__sync_synchronize", BUILTIN_NOTHROW);
++
+ build_common_builtin_nodes ();
+ }
+
+@@ -265,11 +287,20 @@
+ tree fn;
+
+ if (java_builtins[i].creator != NULL)
+- return (*java_builtins[i].creator) (method_return_type,
+- method_arguments);
++ {
++ tree result
++ = (*java_builtins[i].creator) (method_return_type,
++ method_arguments);
++ return result == NULL_TREE ? call : result;
++ }
++
++ /* Builtin functions emit a direct call which is incompatible
++ with the BC-ABI. */
++ if (flag_indirect_dispatch)
++ return call;
+ fn = built_in_decls[java_builtins[i].builtin_code];
+ if (fn == NULL_TREE)
+- return NULL_TREE;
++ return call;
+ return java_build_function_call_expr (fn, method_arguments);
+ }
+ }
+diff -urN old/gcc/java/ChangeLog src/gcc/java/ChangeLog
+--- old/gcc/java/ChangeLog 2006-05-25 01:41:40.000000000 +0200
++++ src/gcc/java/ChangeLog 2006-08-28 19:24:44.290718000 +0200
+@@ -1,3 +1,131 @@
++2006-08-22 Andrew Haley
++
++ * decl.c (java_add_stmt): Give the statement list a type.
++
++2006-08-16 Jakub Jelinek
++ Bryce McKinlay
++
++ * jvspec.c (lang_specific_driver): Add -s-bc-abi when needed.
++
++2006-08-10 Simon Martin
++
++ PR java/8923
++ * parse.y (build_incdec): Emit an error instead of an ICE if '++'
++ or '--' is used with a constant operand.
++ (java_complete_lhs): When processing a '++' or '--' expression,
++ don't call java_complete_tree but java_complete_lhs, so that a
++ static final variable operand is never replaced by its value. This
++ avoids an ICE later on.
++ (patch_unaryop): Fixed typo in comment.
++
++2006-07-12 Bryce McKinlay
++
++ * builtins.c (check_for_builtin): If a builtin could result in a
++ direct call being generated, don't use it if flag_indirect_dispatch
++ is set.
++
++2006-07-12 Bryce McKinlay
++
++ * gcj.texi (Invocation): Corrections for Invocation API example.
++
++2006-07-04 Andrew Haley
++
++ * class.c (build_fieldref_cache_entry): Set DECL_IGNORED_P on the
++ entry.
++
++2006-06-21 Andrew Haley
++
++ * java-tree.h (update_aliases): Remove
++ * expr.c (expand_iinc): Remove call to update_aliases().
++ (STORE_INTERNAL): Likewise.
++ * decl.c (update_aliases, initialize_local_variable)
++ (maybe_pushlevels): Set DECL_VALUE_EXPR for debugging decls.
++
++2006-06-19 Andrew Haley
++
++ PR java/1305
++ PR java/27908
++ * expr.c (java_modify_addr_for_volatile): New function.
++ (expand_java_field_op): Handle volatile fields.
++ * java-gimplify.c (java_gimplify_component_ref): Call
++ java_modify_addr_for_volatile to give the field_ref the correct
++ volatile type.
++ (java_gimplify_modify_expr): Likewise.
++ * java-tree.h (java_modify_addr_for_volatile): New decl.
++
++2006-06-17 Karl Berry
++
++ * gcj.texi (@dircategory): Use "Software development" instead
++ of "Programming", following the Free Software Directory.
++
++2006-06-16 Andrew Haley
++
++ * class.c (make_class_data): When using flag_indirect_classes,
++ don't initialize the vtable of Class instances.
++
++2006-06-09 Andrew Haley
++
++ PR java/1305
++ PR java/27908
++ * builtins.c (initialize_builtins): Add __sync_synchronize().
++ * class.c (add_field): Mark volatile fields.
++ * java-gimplify.c (java_gimplify_expr): Call new functions to
++ handle self-modifying exprs and COMPONENT_REFs.
++ (java_gimplify_component_ref): New.
++ (java_gimplify_modify_expr): Add handling for volatiles.
++
++2006-06-08 Tom Tromey
++
++ * gcj.texi (libgcj Runtime Properties): Document
++ gnu.gcj.user.realname.
++
++2006-06-08 Andrew Haley
++
++ * expr.c (build_field_ref): Pass NULL_TREE as SPECIAL arg to
++ get_symbol_table_index().
++ (maybe_rewrite_invocation): Set SPECIAL if we need to access a
++ private method.
++ (build_known_method_ref): New arg: special. Pass it to
++ get_symbol_table_index.
++ (get_symbol_table_index): Put SPECIAL in the TREE_PURPOSE field of
++ the method list.
++ (build_invokevirtual): New arg: special. Pass it to
++ get_symbol_table_index.
++ (expand_invoke): New variable: special.
++ Pass it to maybe_rewrite_invocation().
++ Pass it to build_known_method_ref().
++ * class.c (build_symbol_entry): Add new arg: special. Use it to
++ build the symbol table conbstructor.
++ (emit_symbol_table): Extract SPECIAL from the method list and pass
++ it to build_symbol_entry().
++ * parse.y (patch_invoke): Call maybe_rewrite_invocation() and set
++ special accordingly.
++
++2006-06-06 David Daney
++
++ * gcj.texi (libgcj Runtime Properties): Document
++ gnu.gcj.runtime.NameFinder.show_raw and
++ gnu.gcj.runtime.NameFinder.remove_unknown.
++
++2006-06-06 Tom Tromey
++
++ * jcf-dump.c (print_access_flags): Handle varargs, bridge,
++ synthetic, enum, annotation.
++ * jcf.h (ACC_BRIDGE): New macro.
++ (ACC_VARARGS): Likewise.
++ (ACC_SYNTHETIC): Likewise.
++ (ACC_ENUM): Likewise.
++ (ACC_ANNOTATION): Likewise.
++
++2006-05-31 Thomas Fitzsimmons
++
++ * gcj.texi (Extensions): Document the new gcj-dbtool-based
++ classname-to-library resolution mechanism.
++ Declare the old gnu.gcj.runtime.VMClassLoader.library_control
++ mechanism deprecated.
++ (libgcj Runtime Properties): Document
++ gnu.gcj.runtime.VMClassLoader.library_control's new default.
++
+ 2006-05-24 Release Manager
+
+ * GCC 4.1.1 released.
+@@ -11,12 +139,72 @@
+
+ * lang.opt (femit-class-file): Remove VarExists.
+
++2006-05-16 Tom Tromey
++
++ * verify-impl.c (verify_instructions_0) : Special case
++ for Object..
++
+ 2006-05-16 H.J. Lu
+
+ PR driver/26885
+ * Make-lang.in ($(GCJ)$(exeext)): Replace gcc.o with
+ $(GCC_OBJS).
+
++2006-05-10 Andrew Haley
++
++ * class.c (emit_indirect_register_classes): Fix comment.
++
++2006-05-04 Tom Tromey
++
++ * java-tree.h (uses_jv_markobj_p): Declare.
++ * class.c (uses_jv_markobj_p): Removed.
++ * boehm.c (PROCEDURE_OBJECT_DESCRIPTOR): New define.
++ (get_boehm_type_descriptor): Use it.
++ (uses_jv_markobj_p): Moved from class.c. Return bool.
++
++2006-05-04 Tom Tromey
++
++ * java-tree.def (THIS_EXPR): Now a tcc_expression.
++
++2006-05-04 Andrew Haley
++
++ * class.c (make_field_value): Always build_address_of fdecl if
++ there is an initializer.
++
++2006-05-03 Andrew Haley
++
++ PR libgcj/27352
++ * expr.c (maybe_rewrite_invocation): New function.
++ (rewrite_arglist_getclass): Likewise.
++ (rules): New.
++ (expand_invoke): Call maybe_rewrite_invocation.
++ * parse.y (patch_invoke): Likewise.
++ * java-tree.h: (maybe_rewrite_invocation): New function.
++
++2006-04-21 Andrew Haley
++
++ * lang.c (java_init): Handle flag_indirect_classes.
++ * jvgenmain.c: Use "class$$" instead of "class$".
++ * mangle.c (java_mangle_decl): Accept RECORD_TYPEs sw well as
++ DECLs.
++ (mangle_class_field): Special case "class$$" as well as "class$".
++ * constants.c (build_ref_from_constant_pool): If
++ flag_indirect_classes, generate a ref into the heap.
++ * decl.c (constants_field_decl_node,
++ constants_data_field_decl_node): New.
++ * class.c (build_static_class_ref): New.
++ (build_classdollar_field): Factor out from build_class_ref().
++ (make_field_value): Handle static fields in heap.
++ (make_class_data): Make sure we get a static ref to class.
++ Make class initializer const if flag_indirect_classes.
++ (register_class): Build a class_ref for initialization if
++ flag_indirect_classes.
++ (emit_indirect_register_classes): New.
++
++2006-04-08 Kazu Hirata
++
++ * expr.c, gjavah.c: Fix comment typos.
++
+ 2006-04-03 Andrew Haley
+
+ PR java/26858
+@@ -44,6 +232,55 @@
+ * parse.y (java_reorder_fields): Reset superclass field's size as
+ well.
+
++2006-03-28 Tom Tromey
++
++ PR java/26390:
++ * parse.y (find_most_specific_methods_list): Added 'class'
++ argument.
++ (lookup_method_invoke): Updated.
++
++2006-03-15 Tom Tromey
++
++ * jcf-write.c (generate_bytecode_insns): Use qualifying type for
++ non-static method calls.
++
++2006-03-15 David Daney
++
++ * java-tree.h : Moved comment for TYPE_DOT_CLASS adjacent to its
++ declaration.
++
++2006-03-15 David Daney
++
++ * lang.opt (-freduced-reflection): New option.
++ * lang.c (java_post_options): Generate an error if
++ -freduced-reflection used with -fjni or -findirect-dispatch.
++ * java-tree.h (flag_reduced_reflection): Declare new variable.
++ * boehm.c (get_boehm_type_descriptor): Indicate all pointers
++ if bitmap overflows and flag_reduced_reflection set.
++ * class.c (uses_jv_markobj_p): New function.
++ (make_class_data): Moved generation of vtable to before
++ reflection data, generate less reflection data if
++ flag_reduced_reflection set.
++ * gcj.texi: Document -freduced-reflection.
++
++2006-03-15 Tom Tromey
++
++ PR java/26638:
++ * class.c (get_interface_method_index): Don't put into
++ interface table.
++
++2006-03-15 Tom Tromey
++
++ * parse.y (analyze_clinit_body): Ignore empty statements.
++
++2006-03-08 David Daney
++
++ * gcj.texi: Document -static-libgcj option.
++
++2006-02-28 Release Manager
++
++ * GCC 4.1.0 released.
++
+ 2006-02-20 Andrew Haley
+
+ * jcf-parse.c (parse_class_file): Set input_location from
+@@ -55,38 +292,91 @@
+ (make_class_data): pushdecl_top_level TYPE_OTABLE_SYMS_DECL,
+ TYPE_ATABLE_SYMS_DECL, TYPE_ITABLE_SYMS_DECL here.
+
+-2006-02-28 Release Manager
+-
+- * GCC 4.1.0 released.
+-
+ 2006-02-09 Andrew Haley
+
+ PR java/26192
+ * expr.c (expand_invoke): Allow methods in arrays to be resolved
+ in their superclass.
+
++ * typeck.c (build_java_array_type): Generate TYPE_STUB_DECLs for
++ array types.
++
++2006-02-08 Tom Tromey
++
++ PR java/22578:
++ * check-init.c (check_init): Handle VIEW_CONVERT_EXPR.
++ * builtins.c (convert_real): New function.
++ (java_builtins): Handle Float.intBitsToFloat,
++ Float.floatToRawIntBits, Double.longBitsToDouble,
++ Double.doubleToRawLongBits.
++
+ 2006-02-07 Andrew Haley
+
+ * expr.c (expand_invoke): (BC mode.) If we find a method in a
+ class other than the one in which we expected to find it, ignore
+ the result.
+
++ PR java/25535
++ * constants.c (build_constants_constructor): move initializer into
++ first halfword on a 64-bit big-endian machine.
++
++2006-02-04 Tom Tromey
++
++ PR java/25676:
++ * builtins.c (max_builtin): Skip floating point 'max'.
++ (min_builtin): Skip floating point 'min'.
++ (check_for_builtin): Never return NULL_TREE.
++
++2006-02-04 Tom Tromey
++
++ PR java/26097:
++ * expr.c (push_type): Avoid side effect in gcc_assert.
++
++2006-02-04 Roger Sayle
++
++ * decl.c (java_init_decl_processing): Create char_type_node as a
++ regular INTEGER_TYPE node.
++ (push_promoted_type): Preserve TYPE_STRING_FLAG on types.
++ * typeck.c (convert): No longer check for CHAR_TYPEs but instead
++ test for char_type_node and promoted_char_type_node as special
++ instances of INTEGER_TYPE tree codes.
++ (promote_type,build_java_signature): Likewise.
++ * jcf-write.c (adjust_typed_op): Likewise.
++ * mangle.c (mangle_type): Likewise.
++ * parse.y (do_unary_numeric_promotion): No longer handle CHAR_TYPE.
++ * parse.h (JINTEGRAL_TYPE_P): Likewise.
++
++2006-02-04 Andreas Tobler
++
++ * expr.c (java_stack_swap): Revert gcc_assert patch.
++
++2006-02-03 Ben Elliston
++
++ * java-gimplify.c: Use gcc_assert and gcc_unreachable throughout.
++ * typeck.c: Likewise.
++ * verify-impl.c: Likewise.
++ * class.c: Likewise.
++ * decl.c: Likewise.
++ * jcf-parse.c: Likewise.
++ * constants.c: Likewise.
++ * check-init.c: Likewise.
++ * jcf-write.c: Likewise.
++ * verify-glue.c: Likewise.
++ * mangle.c: Likewise.
++ * expr.c: Likewise.
++ * lang.c: Likewise.
++ * boehm.c: Likewise.
++
+ 2006-01-30 Andrew Haley
+
+ PR java/21428
+- * parse.y (source_start_java_method): Mark DECL_ARTIFICIAL("this").
++ * parse.y: (source_start_java_method): Mark DECL_ARTIFICIAL("this").
+
+ 2006-01-21 Joseph S. Myers
+
+ * jv-scan.c (version), jcf-dump.c (version), gjavah.c (version):
+ Update copyright notice dates.
+
+-2006-01-16 Andrew Haley
+-
+- PR java/25535
+- * constants.c (build_constants_constructor): move initializer into
+- first halfword on a 64-bit big-endian machine.
+-
+ 2006-01-06 Tom Tromey
+
+ * gcj.texi (Arrays): Added more documentation for
+@@ -114,6 +404,20 @@
+ * class.c (maybe_layout_super_class): Update current_class before
+ calling do_resolve_class.
+
++2005-12-12 H.J. Lu
++
++ PR java/25330
++ * jcf-write.c (write_classfile): Use PID in temporary class
++ file. Save/restore errno when reporting error.
++
++2005-12-10 Terry Laurenzo
++
++ PR java/9861
++ * mangle.c (mangle_method_decl): Mangle Java methods by prepending 'J'
++ to bare_function_type and including the return type
++ * builtins.c (initialize_builtins) : Change builtin mangled name
++ constants to conform to new mangling scheme
++
+ 2005-12-08 Andrew Haley
+
+ PR libgcj/25265
+@@ -122,6 +426,7 @@
+ * expr.c (build_field_ref): Add in-line check for missing field.
+ * decl.c (java_init_decl_processing): Add soft_nosuchfield_node.
+
++
+ 2005-12-06 Tom Tromey
+
+ PR java/25283:
+@@ -133,7 +438,14 @@
+
+ * parse.y (patch_new_array_init): Don't set length on array.
+
+-2005-11-29 Tom Tromey
++2005-12-02 Richard Guenther
++
++ * java-gimplify.c (java_gimplify_labeled_block_expr): Use
++ buildN instead of build.
++ * class.c (finish_class): Likewise.
++ * expr.c (java_create_object): Likewise.
++
++2005-11-28 Tom Tromey
+
+ PR java/18278:
+ * expr.c (build_jni_stub): Unwrap the return value.
+@@ -144,7 +456,7 @@
+
+ 2005-11-24 Bryce McKinlay
+
+- * gcj.texi (gij options): Add -Xss documentation.
++ * gcj.texi (gij options): Add -Xss documentation.
+
+ 2005-11-08 Wil Mahan
+
+diff -urN old/gcc/java/ChangeLog.tree-ssa src/gcc/java/ChangeLog.tree-ssa
+--- old/gcc/java/ChangeLog.tree-ssa 2004-05-13 08:41:07.000000000 +0200
++++ src/gcc/java/ChangeLog.tree-ssa 2006-08-28 19:17:32.330718000 +0200
+@@ -5,7 +5,7 @@
+
+ (java_gimplify_new_array_init): Set the DECL_CONTEXT of array and
+ tmp to current_function_decl.
+-
++
+ 2004-04-13 Diego Novillo
+
+ * expr.c (build_expr_wfl): Don't check type nodes for
+@@ -32,9 +32,9 @@
+
+ 2004-01-29 Richard Henderson
+
+- PR java/12906
+- * decl.c (maybe_pushlevels): Careful with TREE_CHAIN when
+- registering decls with push_jvm_slot.
++ PR java/12906
++ * decl.c (maybe_pushlevels): Careful with TREE_CHAIN when
++ registering decls with push_jvm_slot.
+
+ 2003-12-10 Diego Novillo
+
+@@ -56,8 +56,8 @@
+
+ 2003-11-31 Richard Henderson
+
+- * jcf-parse.c (java_parse_file): Finalize cgraph after emitting
+- class tables.
++ * jcf-parse.c (java_parse_file): Finalize cgraph after emitting
++ class tables.
+
+ 2003-11-24 Richard Henderson
+
+@@ -132,8 +132,8 @@
+
+ 2003-10-13 Richard Henderson
+
+- * expr.c (build_java_jsr): Don't emit LABEL_EXPR or
+- load_type_state here.
++ * expr.c (build_java_jsr): Don't emit LABEL_EXPR or
++ load_type_state here.
+
+ 2003-10-12 Richard Henderson
+
+@@ -178,18 +178,18 @@
+
+ 2003-10-01 Richard Henderson
+
+- * decl.c (end_java_method): Invoke remove_useless_stmts_and_vars
+- and lower_eh_constructs.
+- * parse.y (source_end_java_method): Likewise.
++ * decl.c (end_java_method): Invoke remove_useless_stmts_and_vars
++ and lower_eh_constructs.
++ * parse.y (source_end_java_method): Likewise.
+
+ 2003-09-24 Jason Merrill