--- gcc-4.1-4.1.2.orig/debian/rules.d/binary-cross.mk
+++ gcc-4.1-4.1.2/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.2.orig/debian/rules.d/binary-fastjar.mk
+++ gcc-4.1-4.1.2/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.2.orig/debian/rules.d/binary-libssp.mk
+++ gcc-4.1-4.1.2/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.2.orig/debian/rules.d/binary-source.mk
+++ gcc-4.1-4.1.2/debian/rules.d/binary-source.mk
@@ -0,0 +1,28 @@
+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) $(gcj_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.2.orig/debian/rules.d/binary-softfloat.mk
+++ gcc-4.1-4.1.2/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.2.orig/debian/rules.d/binary-cpp-cross.mk
+++ gcc-4.1-4.1.2/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.2.orig/debian/rules.d/binary-base.mk
+++ gcc-4.1-4.1.2/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.2.orig/debian/rules.d/binary-libmudflap.mk
+++ gcc-4.1-4.1.2/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.2.orig/debian/rules.d/binary-cpp.mk
+++ gcc-4.1-4.1.2/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.2.orig/debian/rules.d/binary-gcc-cross.mk
+++ gcc-4.1-4.1.2/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.2.orig/debian/rules.d/binary-ada.mk
+++ gcc-4.1-4.1.2/debian/rules.d/binary-ada.mk
@@ -0,0 +1,308 @@
+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_lgnat_dbg = $(p_lgnat)-dbg
+p_lgnatvsn = libgnatvsn$(GNAT_VERSION)
+p_lgnatvsn_dbg = $(p_lgnatvsn)-dbg
+p_lgnatprj = libgnatprj$(GNAT_VERSION)
+p_lgnatprj_dbg = $(p_lgnatprj)-dbg
+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)
+ touch $@
+
+
+$(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) --dbg-package=$(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_VERSION))'
+ 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)-libgnatdbg: $(binary_stamp)-libgnat
+ debian/dh_doclink -p$(p_lgnat_dbg) $(p_gbase)
+ dh_compress -p$(p_lgnat_dbg)
+ dh_fixperms -p$(p_lgnat_dbg)
+ dh_gencontrol -p$(p_lgnat_dbg) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_lgnat_dbg)
+ dh_md5sums -p$(p_lgnat_dbg)
+ dh_builddeb -p$(p_lgnat_dbg)
+ touch $@
+
+$(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 --keep-debug
+ 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) --dbg-package=$(p_lgnatvsn)
+ dh_makeshlibs -p$(p_lgnatvsn) -V '$(p_lgnatvsn) (>= $(DEB_VERSION))'
+ 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)-libgnatvsndbg: $(binary_stamp)-libgnatvsn
+ debian/dh_doclink -p$(p_lgnatvsn_dbg) $(p_gbase)
+ dh_compress -p$(p_lgnatvsn_dbg)
+ dh_fixperms -p$(p_lgnatvsn_dbg)
+ dh_gencontrol -p$(p_lgnatvsn_dbg) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_lgnatvsn_dbg)
+ dh_md5sums -p$(p_lgnatvsn_dbg)
+ dh_builddeb -p$(p_lgnatvsn_dbg)
+ 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 --keep-debug
+ 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) --dbg-package=$(p_lgnatprj)
+ dh_makeshlibs -p$(p_lgnatprj) -V '$(p_lgnatprj) (>= $(DEB_VERSION))'
+ 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 $@
+
+$(binary_stamp)-libgnatprjdbg: $(binary_stamp)-libgnatprj
+ debian/dh_doclink -p$(p_lgnatprj_dbg) $(p_gbase)
+ dh_compress -p$(p_lgnatprj_dbg)
+ dh_fixperms -p$(p_lgnatprj_dbg)
+ dh_gencontrol -p$(p_lgnatprj_dbg) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_lgnatprj_dbg)
+ dh_md5sums -p$(p_lgnatprj_dbg)
+ dh_builddeb -p$(p_lgnatprj_dbg)
+ touch $@
+
+ifeq ($(with_libgnat),yes)
+$(binary_stamp)-ada: $(install_stamp) $(binary_stamp)-libgnat $(binary_stamp)-libgnatdbg
+$(binary_stamp)-ada: $(binary_stamp)-libgnatvsn $(binary_stamp)-libgnatvsndbg
+$(binary_stamp)-ada: $(binary_stamp)-libgnatprj $(binary_stamp)-libgnatprjdbg
+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.2.orig/debian/rules.d/binary-cxx-cross.mk
+++ gcc-4.1-4.1.2/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.2.orig/debian/rules.d/binary-libffi.mk
+++ gcc-4.1-4.1.2/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.2.orig/debian/rules.d/binary-fixincl.mk
+++ gcc-4.1-4.1.2/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.2.orig/debian/rules.d/binary-gcc.mk
+++ gcc-4.1-4.1.2/debian/rules.d/binary-gcc.mk
@@ -0,0 +1,229 @@
+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/README.ssp $(d_gcc)/$(docdir)/$(p_base)/
+ 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.2.orig/debian/rules.d/binary-objcxx.mk
+++ gcc-4.1-4.1.2/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.2.orig/debian/rules.d/binary-snapshot.mk
+++ gcc-4.1-4.1.2/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.2.orig/debian/rules.d/binary-treelang.mk
+++ gcc-4.1-4.1.2/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.2.orig/debian/rules.d/binary-cxx.mk
+++ gcc-4.1-4.1.2/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.2.orig/debian/rules.d/binary-hppa64.mk
+++ gcc-4.1-4.1.2/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.2.orig/debian/rules.d/binary-proto.mk
+++ gcc-4.1-4.1.2/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.2.orig/debian/rules.d/binary-pascal.mk
+++ gcc-4.1-4.1.2/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.2.orig/debian/rules.d/binary-libstdcxx.mk
+++ gcc-4.1-4.1.2/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.2.orig/debian/rules.d/binary-libobjc.mk
+++ gcc-4.1-4.1.2/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.2.orig/debian/rules.d/binary-nof-cross.mk
+++ gcc-4.1-4.1.2/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.2.orig/debian/rules.d/binary-libgcc-cross.mk
+++ gcc-4.1-4.1.2/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.2.orig/debian/rules.d/binary-fortran.mk
+++ gcc-4.1-4.1.2/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.2.orig/debian/rules.d/binary-objc.mk
+++ gcc-4.1-4.1.2/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.2.orig/debian/rules.d/binary-nof.mk
+++ gcc-4.1-4.1.2/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.2.orig/debian/rules.d/binary-libgcc.mk
+++ gcc-4.1-4.1.2/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.2.orig/debian/rules.d/binary-libstdcxx-cross.mk
+++ gcc-4.1-4.1.2/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.2.orig/debian/rules.d/binary-java.mk
+++ gcc-4.1-4.1.2/debian/rules.d/binary-java.mk
@@ -0,0 +1,712 @@
+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_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_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_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_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.so \
+ $(PF)/$(libdir)/libgcj.{so,spec} \
+ $(PF)/$(libdir)/libgcj-tools.so \
+ $(PF)/$(libdir)/pkgconfig/libgcj.pc
+
+ifeq ($(with_static_java),yes)
+ files_jdev += \
+ $(PF)/$(libdir)/libgij.a \
+ $(PF)/$(libdir)/libgcj.a \
+ $(PF)/$(libdir)/libgcj-tools.a
+endif
+
+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)-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
+
+
+ : # 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 \
+ 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
+ifeq ($(with_static_java),yes)
+ for i in libgij libgcj libgcj-tools; do \
+ mv $(d_jdev)/$(PF)/$(libdir)/$$i.a $(d_jdev)/$(gcc_lib_dir)/; \
+ done
+endif
+
+ mv $(d_jdev)/$(PF)/$(libdir)/pkgconfig/libgcj.pc \
+ $(d_jdev)/$(PF)/$(libdir)/pkgconfig/libgcj-$(BASE_VERSION).pc
+ ln -sf libgcj-$(BASE_VERSION).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 \
+ 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
+ifeq ($(with_static_java),yes)
+ for i in libgij libgcj libgcj-tools; do \
+ mv $(d)/$(lib32)/$$i.a $(d_j32dev)/$(gcc_lib_dir)/$(biarchsubdir)/; \
+ done
+endif
+
+ 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.2.orig/debian/rules.d/binary-libobjc-cross.mk
+++ gcc-4.1-4.1.2/debian/rules.d/binary-libobjc-cross.mk
@@ -0,0 +1,117 @@
+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)$(cross_lib_arch)
+p_l32objc = lib32objc$(OBJC_SONAME)$(cross_lib_arch)
+p_l64objc = lib64objc$(OBJC_SONAME)$(cross_lib_arch)
+
+d_lobjc = debian/$(p_lobjc)
+d_l32objc = debian/$(p_l32objc)
+d_l64objc = debian/$(p_l64objc)
+
+dirs_lobjc = \
+ $(docdir) \
+ $(PF)/$(DEB_TARGET_GNU_TYPE)/$(libdir)
+files_lobjc = \
+ $(PF)/$(DEB_TARGET_GNU_TYPE)/$(libdir)/libobjc.so.*
+ifeq ($(with_objc_gc),yes)
+ files_lobjc += \
+ $(PF)/$(DEB_TARGET_GNU_TYPE)/$(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)
+
+ debian/dh_rmemptydirs -p$(p_lobjc)
+
+ PATH=/usr/share/dpkg-cross:$$PATH dh_strip -p$(p_lobjc)
+ dh_compress -p$(p_lobjc)
+
+ dh_fixperms -p$(p_lobjc)
+ dh_makeshlibs -p$(p_lobjc) -V '$(p_lobjc) (>= $(DEB_SOEVERSION))' -n
+ sed s/$(cross_lib_arch)//g < debian/$(p_lobjc)/DEBIAN/shlibs > debian/$(p_lobjc)/DEBIAN/shlibs.fixed
+ mv debian/$(p_lobjc)/DEBIAN/shlibs.fixed debian/$(p_lobjc)/DEBIAN/shlibs
+ ARCH=$(DEB_TARGET_ARCH) MAKEFLAGS="CC=something" dh_shlibdeps -p$(p_lobjc)
+ sed 's/\(lib[^ ]*\) /\1$(cross_lib_arch) /g' < debian/$(p_lobjc).substvars > debian/$(p_lobjc).substvars.new
+ mv debian/$(p_lobjc).substvars.new debian/$(p_lobjc).substvars
+ 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.2.orig/debian/rules.d/binary-objc-cross.mk
+++ gcc-4.1-4.1.2/debian/rules.d/binary-objc-cross.mk
@@ -0,0 +1,60 @@
+arch_binaries := $(arch_binaries) objc
+
+p_objc = gobjc$(pkg_ver)$(cross_bin_arch)
+d_objc = debian/$(p_objc)
+
+dirs_objc = \
+ $(docdir) \
+ $(gcc_lib_dir)
+
+files_objc = \
+ $(gcc_lib_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)/$(DEB_TARGET_GNU_TYPE)/$(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)/$(DEB_TARGET_GNU_TYPE)/lib64/libobjc*.{a,la} $(d_objc)/$(gcc_lib_dir)/$(biarchsubdir)/
+ dh_link -p$(p_objc) \
+ /$(PF)/$(DEB_TARGET_GNU_TYPE)/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)/$(DEB_TARGET_GNU_TYPE)/$(lib32)/libobjc*.{a,la} $(d_objc)/$(gcc_lib_dir)/$(biarchsubdir)/
+ dh_link -p$(p_objc) \
+ /$(lib32)/$(DEB_TARGET_GNU_TYPE)/libobjc.so.$(OBJC_SONAME) /$(gcc_lib_dir)/$(biarchsubdir)/libobjc.so
+endif
+
+ dh_link -p$(p_objc) \
+ /$(PF)/$(DEB_TARGET_GNU_TYPE)/$(libdir)/libobjc.so.$(OBJC_SONAME) /$(gcc_lib_dir)/libobjc.so
+ifeq ($(with_objc_gc),yes)
+ dh_link -p$(p_objc) \
+ /$(PF)/$(DEB_TARGET_GNU_TYPE)/$(libdir)/libobjc_gc.so.$(OBJC_SONAME) \
+ /$(gcc_lib_dir)/libobjc_gc.so
+endif
+
+ debian/dh_doclink -p$(p_objc) $(p_base)
+ 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.2.orig/debian/rules.d/binary-objcxx-cross.mk
+++ gcc-4.1-4.1.2/debian/rules.d/binary-objcxx-cross.mk
@@ -0,0 +1,35 @@
+arch_binaries := $(arch_binaries) objcxx
+
+p_objcx = gobjc++$(pkg_ver)$(cross_bin_arch)
+d_objcx = debian/$(p_objcx)
+
+dirs_objcx = \
+ $(docdir) \
+ $(gcc_lib_dir)
+
+files_objcx = \
+ $(gcc_lib_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)
+ 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.2.orig/debian/patches/ppc64-ada.dpatch
+++ gcc-4.1-4.1.2/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.2.orig/debian/patches/gpc-bison-2.2.dpatch
+++ gcc-4.1-4.1.2/debian/patches/gpc-bison-2.2.dpatch
@@ -0,0 +1,153 @@
+#! /bin/sh -e
+
+# DP: Fix build error using bison-2.2
+
+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-05-19 Frank Heckenbach
+
+ * gpc.h: correct conditional check for including "parse.h"
+ (recent Bison versions output tokens as enum values, not
+ as #defines anymore)
+
+ * parse.y: move most of the first section of C code below
+ the token declarations, so it doesn't appear in parse.h
+ with Bison 2.2, as it is parser-private stuff which would
+ cause some unused-warnings otherwise; correct "%expect-rr"
+ number as Bison 2.2 gives errors instead of warnings on
+ mismatch
+
+ * utils/mk-t-inc: minor portability fix (some sed versions
+ require ";" before "}")
+
+--- gcc/p/gpc.h.orig Sat May 20 02:09:15 2006
++++ gcc/p/gpc.h Sat May 20 02:12:07 2006
+@@ -887,7 +887,7 @@
+ #define YYLTYPE_IS_DECLARED
+
+ /* parse.c contains the same declarations again */
+-#ifndef LEX_ID
++#ifndef YYTOKENTYPE
+ #include "parse.h"
+ #endif
+
+--- gcc/p/parse.y.orig Fri Mar 24 02:47:15 2006
++++ gcc/p/parse.y Sat May 20 02:37:44 2006
+@@ -66,38 +66,6 @@
+ #ifdef GCC_4_0
+ #include "cgraph.h"
+ #endif
+-
+-/* A few keywords of some dialects can be parsed as regular identifiers
+- and checked from the parser actions => fewer special tokens. */
+-#define ASSERT_ID(id, location, pseudo_keyword) \
+- do if (!IDENTIFIER_IS_BUILT_IN (id, pseudo_keyword) || !PD_ACTIVE (IDENTIFIER_BUILT_IN_VALUE (id))) \
+- { yyerror_id (id, &location); YYERROR; } while (0)
+-
+-enum { od_none, od_uses, od_label, od_const, od_type, od_var, od_routine };
+-static int check_decl_order (int, int);
+-
+-extern int main_yyparse (void);
+-#define yyparse main_yyparse
+-
+-union yyGLRStackItem;
+-static void locations (YYLTYPE *, const union yyGLRStackItem *, int);
+-#define YYLLOC_DEFAULT(DEST, SRC, N) locations (&DEST, SRC, N)
+-#ifndef GCC_3_4
+-#define LOCATION_NOTE(LOC) if (current_function_decl) emit_line_note ((LOC).first_file, (LOC).first_line)
+-#else
+-#define LOCATION_NOTE(LOC) if (current_function_decl) \
+- { \
+- location_t loc_aux; \
+- loc_aux.file = (LOC).first_file; \
+- loc_aux.line = (LOC).first_line; \
+- emit_line_note (loc_aux); \
+- }
+-#endif
+-#define COPYLOC(D, S) /* @@ ? (* (YYLTYPE *) memcpy (&(D), &(S), sizeof (YYLTYPE))) */ (S)
+-
+-#define YYASSERT gcc_assert
+-#define YYMALLOC (void *) xmalloc
+-#define YYREALLOC (void *) xrealloc
+ %}
+
+ %debug
+@@ -106,7 +74,7 @@
+ %glr-parser
+ %no-default-prec
+ %expect 62
+-%expect-rr 24
++%expect-rr 25
+
+ /* The semantic values */
+ %union {
+@@ -206,6 +174,40 @@
+ array_index_list remote_directive operator_symbol string_constant variant_list
+ rest_of_variant new_pointer_type conformant_array enumerated_type id_list1 err
+ optional_rename attrib id_list id optional_formal_parameter_list0
++
++%{
++/* A few keywords of some dialects can be parsed as regular identifiers
++ and checked from the parser actions => fewer special tokens. */
++#define ASSERT_ID(id, location, pseudo_keyword) \
++ do if (!IDENTIFIER_IS_BUILT_IN (id, pseudo_keyword) || !PD_ACTIVE (IDENTIFIER_BUILT_IN_VALUE (id))) \
++ { yyerror_id (id, &location); YYERROR; } while (0)
++
++enum { od_none, od_uses, od_label, od_const, od_type, od_var, od_routine };
++static int check_decl_order (int, int);
++
++extern int main_yyparse (void);
++#define yyparse main_yyparse
++
++union yyGLRStackItem;
++static void locations (YYLTYPE *, const union yyGLRStackItem *, int);
++#define YYLLOC_DEFAULT(DEST, SRC, N) locations (&DEST, SRC, N)
++#ifndef GCC_3_4
++#define LOCATION_NOTE(LOC) if (current_function_decl) emit_line_note ((LOC).first_file, (LOC).first_line)
++#else
++#define LOCATION_NOTE(LOC) if (current_function_decl) \
++ { \
++ location_t loc_aux; \
++ loc_aux.file = (LOC).first_file; \
++ loc_aux.line = (LOC).first_line; \
++ emit_line_note (loc_aux); \
++ }
++#endif
++#define COPYLOC(D, S) /* @@ ? (* (YYLTYPE *) memcpy (&(D), &(S), sizeof (YYLTYPE))) */ (S)
++
++#define YYASSERT gcc_assert
++#define YYMALLOC (void *) xmalloc
++#define YYREALLOC (void *) xrealloc
++%}
+
+ %%
+
+--- gcc/p/utils/mk-t-inc.orig Sat May 20 02:48:14 2006
++++ gcc/p/utils/mk-t-inc Sat May 20 02:48:16 2006
+@@ -71,6 +71,6 @@
+ {
+ cat "$GCCDIR/tree.def"
+ echo 'DEFTREECODE (LAST_AND_UNUSED_C_TREE_CODE, "unused", '"'x', 0)"
+- sed -e '/#ifdef EGCS/,${/#ifdef EGCS/d;/#else/,/#endif/d}' "$GCCDIR/p/p-tree.def"
++ sed -e '/#ifdef EGCS/,${/#ifdef EGCS/d;/#else/,/#endif/d;}' "$GCCDIR/p/p-tree.def"
+ } | sed -ne ':loop;/\\$/{N;b loop};/^DEFTREECODE/{s,/\*.*\*/,,;s/["'"'"']x["'"'"'].*/'"'x', 0)/;p;};/^#/p"
+ } > "$2" || { rm -f "$2"; false; }
--- gcc-4.1-4.1.2.orig/debian/patches/link-libs.dpatch
+++ gcc-4.1-4.1.2/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.2.orig/debian/patches/pr26864.dpatch
+++ gcc-4.1-4.1.2/debian/patches/pr26864.dpatch
@@ -0,0 +1,59 @@
+#! /bin/sh -e
+
+# DP: Backport fix for PR libmudflap/26864 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
+
+2006-04-22 Frank Ch. Eigler
+
+ PR libmudflap/26864
+ * common.opt (flag_mudflap_threads): Overload flag_mudflap.
+ * tree-mudflap.c (flag_mudflap_threads): Derive from flag_mudflap.
+
+Index: gcc/tree-mudflap.c
+===================================================================
+--- gcc/tree-mudflap.c (revision 113178)
++++ gcc/tree-mudflap.c (revision 113179)
+@@ -48,6 +48,10 @@
+
+ /* Internal function decls */
+
++
++/* Options. */
++#define flag_mudflap_threads (flag_mudflap == 2)
++
+ /* Helpers. */
+ static tree mf_build_string (const char *string);
+ static tree mf_varname_tree (tree);
+Index: gcc/common.opt
+===================================================================
+--- gcc/common.opt (revision 113178)
++++ gcc/common.opt (revision 113179)
+@@ -605,7 +605,7 @@
+ Add mudflap bounds-checking instrumentation for single-threaded program
+
+ fmudflapth
+-Common RejectNegative Report Var(flag_mudflap_threads)
++Common RejectNegative Report VarExists Var(flag_mudflap,2)
+ Add mudflap bounds-checking instrumentation for multi-threaded program
+
+ fmudflapir
--- gcc-4.1-4.1.2.orig/debian/patches/multiarch-lib.dpatch
+++ gcc-4.1-4.1.2/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.2.orig/debian/patches/gcc-biarch-generic.dpatch
+++ gcc-4.1-4.1.2/debian/patches/gcc-biarch-generic.dpatch
@@ -0,0 +1,56 @@
+#! /bin/sh -e
+
+# DP: gcc/config/i386/biarch.h: Remove DRIVER_SELF_SPECS macro.
+
+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/i386/biarch.h~ 2006-07-19 11:59:43.897556736 +0200
++++ gcc/config/i386/biarch.h 2006-07-20 11:36:48.735816608 +0200
+@@ -23,4 +23,3 @@
+
+ #define TARGET_64BIT_DEFAULT 0
+ #define TARGET_BI_ARCH 1
+-#define DRIVER_SELF_SPECS "%{m64:%{!mtune:-mtune=x86-64}}"
+--- gcc/config.gcc.m64 2006-07-20 08:59:01.000000000 -0700
++++ gcc/config.gcc 2006-07-20 12:25:20.000000000 -0700
+@@ -1054,6 +1054,20 @@ i[34567]86-*-linux* | i[34567]86-*-kfree
+ #tmake_file="${tmake_file} i386/t-crtstuff i386/t-crtfm"
+ tmake_file="${tmake_file} i386/t-crtfm i386/t-linux64"
+ need_64bit_hwint=yes
++ # FIXME: -m64 for i[34567]86-*-* should be allowed just
++ # like -m32 for x86_64-*-*.
++ case X"${with_cpu}" in
++ Xgeneric|Xnocona|Xx86-64|Xk8|Xopteron|Xathlon64|Xathlon-fx)
++ ;;
++ X)
++ with_cpu=generic
++ ;;
++ *)
++ echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2
++ echo "generic nocona x86-64 k8 opteron athlon64 athlon-fx" 1>&2
++ exit 1
++ ;;
++ esac
+ ;;
+ 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 \
--- gcc-4.1-4.1.2.orig/debian/patches/libjava-backport2.dpatch
+++ gcc-4.1-4.1.2/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 2007-02-15 00:01:12.000000000 +0100
+@@ -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.
++
+ 2007-02-13 Release Manager
+
+ * GCC 4.1.2 released.
+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.2.orig/debian/patches/libjava-jnipath.dpatch
+++ gcc-4.1-4.1.2/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.2.orig/debian/patches/cross-fixes.dpatch
+++ gcc-4.1-4.1.2/debian/patches/cross-fixes.dpatch
@@ -0,0 +1,146 @@
+#! /bin/sh -e
+
+# DP: Fix the linker error when creating an xcc for ia64
+
+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
+ cd ${dir}gcc && autoconf
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+diff -NurpP -x '*.orig' -x '*.libc' gcc-4.0.0.orig/gcc/config/ia64/fde-glibc.c gcc-4.0.0.new/gcc/config/ia64/fde-glibc.c
+--- gcc-4.0.0.orig/gcc/config/ia64/fde-glibc.c 2003-11-02 18:35:20.000000000 +0100
++++ gcc-4.0.0.new/gcc/config/ia64/fde-glibc.c 2005-05-15 02:42:27.675247674 +0200
+@@ -31,6 +31,7 @@
+ #ifndef _GNU_SOURCE
+ #define _GNU_SOURCE 1
+ #endif
++#ifndef inhibit_libc
+ #include "config.h"
+ #include
+ #include
+@@ -162,3 +163,5 @@ _Unwind_FindTableEntry (void *pc, unsign
+
+ return data.ret;
+ }
++
++#endif
+diff -NurpP -x '*.orig' -x '*.libc' gcc-4.0.0.orig/gcc/config/ia64/unwind-ia64.c gcc-4.0.0.new/gcc/config/ia64/unwind-ia64.c
+--- gcc-4.0.0.orig/gcc/config/ia64/unwind-ia64.c 2005-04-06 05:50:36.000000000 +0200
++++ gcc-4.0.0.new/gcc/config/ia64/unwind-ia64.c 2005-05-15 02:43:10.842199954 +0200
+@@ -30,7 +30,7 @@
+ This exception does not however invalidate any other reasons why
+ the executable file might be covered by the GNU General Public License. */
+
+-
++#ifndef inhibit_libc
+ #include "tconfig.h"
+ #include "tsystem.h"
+ #include "coretypes.h"
+@@ -2404,3 +2404,4 @@ alias (_Unwind_SetIP);
+ #endif
+
+ #endif
++#endif
+diff -NurpP -x '*.orig' -x '*.libc' gcc-4.0.0.orig/gcc/config/pa/linux-unwind.h gcc-4.0.0.new/gcc/config/pa/linux-unwind.h
+--- gcc-4.0.0.orig/gcc/config/pa/linux-unwind.h 2005-02-11 02:46:20.000000000 +0100
++++ gcc-4.0.0.new/gcc/config/pa/linux-unwind.h 2005-05-15 02:37:02.000000000 +0200
+@@ -29,6 +29,7 @@ Boston, MA 02111-1307, USA. */
+ /* Do code reading to identify a signal frame, and set the frame
+ state data appropriately. See unwind-dw2.c for the structs. */
+
++#ifndef inhibit_libc
+ #include
+ #include
+
+@@ -136,3 +137,5 @@ pa32_fallback_frame_state (struct _Unwin
+ fs->retaddr_column = DWARF_ALT_FRAME_RETURN_COLUMN;
+ return _URC_NO_REASON;
+ }
++
++#endif
+diff -NurpP -x '*.orig' -x '*.libc' gcc-4.0.0.orig/gcc/config/sh/linux-unwind.h gcc-4.0.0.new/gcc/config/sh/linux-unwind.h
+--- gcc-4.0.0.orig/gcc/config/sh/linux-unwind.h 2005-02-11 02:12:57.000000000 +0100
++++ gcc-4.0.0.new/gcc/config/sh/linux-unwind.h 2005-05-15 02:44:31.000000000 +0200
+@@ -29,6 +29,7 @@ Boston, MA 02111-1307, USA. */
+ /* Do code reading to identify a signal frame, and set the frame
+ state data appropriately. See unwind-dw2.c for the structs. */
+
++#ifndef inhibit_libc
+ #include
+ #include
+ #include "insn-constants.h"
+@@ -169,3 +170,4 @@ sh_fallback_frame_state (struct _Unwind_
+ return _URC_NO_REASON;
+ }
+ #endif /* defined (__SH5__) */
++#endif
+diff -NurpP -x '*.orig' -x '*.libc' gcc-4.0.0.orig/gcc/unwind-compat.c gcc-4.0.0.new/gcc/unwind-compat.c
+--- gcc-4.0.0.orig/gcc/unwind-compat.c 2004-09-04 02:15:40.000000000 +0200
++++ gcc-4.0.0.new/gcc/unwind-compat.c 2005-05-15 02:41:17.000000000 +0200
+@@ -29,6 +29,7 @@
+ 02110-1301, USA. */
+
+ #if defined (USE_GAS_SYMVER) && defined (USE_LIBUNWIND_EXCEPTIONS)
++#ifndef inhibit_libc
+ #include "tconfig.h"
+ #include "tsystem.h"
+ #include "unwind.h"
+@@ -204,3 +205,4 @@ _Unwind_SetIP (struct _Unwind_Context *c
+ }
+ symver (_Unwind_SetIP, GCC_3.0);
+ #endif
++#endif
+diff -NurpP -x '*.orig' -x '*.libc' gcc-4.0.0.orig/gcc/unwind-generic.h gcc-4.0.0.new/gcc/unwind-generic.h
+--- gcc-4.0.0.orig/gcc/unwind-generic.h 2004-11-30 09:15:39.000000000 +0100
++++ gcc-4.0.0.new/gcc/unwind-generic.h 2005-05-15 02:38:33.000000000 +0200
+@@ -202,6 +202,7 @@ extern _Unwind_Reason_Code _Unwind_SjLj_
+ compatible with the standard ABI for IA-64, we inline these. */
+
+ #ifdef __ia64__
++#ifndef inhibit_libc
+ #include
+
+ static inline _Unwind_Ptr
+@@ -220,6 +221,7 @@ _Unwind_GetTextRelBase (struct _Unwind_C
+
+ /* @@@ Retrieve the Backing Store Pointer of the given context. */
+ extern _Unwind_Word _Unwind_GetBSP (struct _Unwind_Context *);
++#endif
+ #else
+ extern _Unwind_Ptr _Unwind_GetDataRelBase (struct _Unwind_Context *);
+ extern _Unwind_Ptr _Unwind_GetTextRelBase (struct _Unwind_Context *);
+diff -NurpP -x '*.orig' -x '*.libc' gcc-4.0.0.new/gcc/config/alpha/linux-unwind.h gcc-4.0.0.new2/gcc/config/alpha/linux-unwind.h
+--- gcc-4.0.0.new/gcc/config/alpha/linux-unwind.h 2005-02-11 02:12:54.000000000 +0100
++++ gcc-4.0.0.new2/gcc/config/alpha/linux-unwind.h 2005-05-15 05:09:16.000000000 +0200
+@@ -29,6 +29,7 @@ Boston, MA 02111-1307, USA. */
+ /* Do code reading to identify a signal frame, and set the frame
+ state data appropriately. See unwind-dw2.c for the structs. */
+
++#ifndef inhibit_libc
+ #include
+ #include
+
+@@ -80,3 +81,5 @@ alpha_fallback_frame_state (struct _Unwi
+ fs->retaddr_column = 64;
+ return _URC_NO_REASON;
+ }
++
++#endif
--- gcc-4.1-4.1.2.orig/debian/patches/autoreconf.dpatch
+++ gcc-4.1-4.1.2/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.2.orig/debian/patches/gcc-textdomain.dpatch
+++ gcc-4.1-4.1.2/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.2.orig/debian/patches/hppa-cbranch2.dpatch
+++ gcc-4.1-4.1.2/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.2.orig/debian/patches/gpc-names.dpatch
+++ gcc-4.1-4.1.2/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.2.orig/debian/patches/libjava-lib32-properties.dpatch
+++ gcc-4.1-4.1.2/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.2.orig/debian/patches/ada-driver.dpatch
+++ gcc-4.1-4.1.2/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.2.orig/debian/patches/gcc-version.dpatch
+++ gcc-4.1-4.1.2/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.2.orig/debian/patches/sparc64-build.dpatch
+++ gcc-4.1-4.1.2/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.2.orig/debian/patches/gcc-ssp-default.dpatch
+++ gcc-4.1-4.1.2/debian/patches/gcc-ssp-default.dpatch
@@ -0,0 +1,208 @@
+#! /bin/sh -e
+
+# DP: Turn on -fstack-protector by default for C, C++, ObjC, ObjC++.
+# DP: Build libgcc using -fno-stack-protector.
+
+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/objc/lang-specs.h~ 2005-06-25 00:33:05.000000000 +0000
++++ gcc/objc/lang-specs.h 2006-07-12 13:33:26.973728272 +0000
+@@ -30,13 +30,13 @@
+ %{traditional|ftraditional|traditional-cpp:\
+ %eGNU Objective C no longer supports traditional compilation}\
+ %{save-temps|no-integrated-cpp:cc1obj -E %(cpp_options) -o %{save-temps:%b.mi} %{!save-temps:%g.mi} \n\
+- cc1obj -fpreprocessed %{save-temps:%b.mi} %{!save-temps:%g.mi} %(cc1_options) %{print-objc-runtime-info} %{gen-decls}}\
++ cc1obj -fpreprocessed %{save-temps:%b.mi} %{!save-temps:%g.mi} %(cc1_options) %(ssp_default) %{print-objc-runtime-info} %{gen-decls}}\
+ %{!save-temps:%{!no-integrated-cpp:\
+- cc1obj %(cpp_unique_options) %(cc1_options) %{print-objc-runtime-info} %{gen-decls}}}\
++ cc1obj %(cpp_unique_options) %(cc1_options) %(ssp_default) %{print-objc-runtime-info} %{gen-decls}}}\
+ %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
+ {".mi", "@objc-cpp-output", 0, 0, 0},
+ {"@objc-cpp-output",
+- "%{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\
++ "%{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %(ssp_default) %{print-objc-runtime-info} %{gen-decls}\
+ %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
+ {"@objective-c-header",
+ "%{E|M|MM:cc1obj -E %{traditional|ftraditional|traditional-cpp:-traditional-cpp}\
+@@ -45,10 +45,10 @@
+ %{traditional|ftraditional|traditional-cpp:\
+ %eGNU Objective C no longer supports traditional compilation}\
+ %{save-temps|no-integrated-cpp:cc1obj -E %(cpp_options) -o %{save-temps:%b.mi} %{!save-temps:%g.mi} \n\
+- cc1obj -fpreprocessed %b.mi %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\
++ cc1obj -fpreprocessed %b.mi %(cc1_options) %(ssp_default) %{print-objc-runtime-info} %{gen-decls}\
+ -o %g.s %{!o*:--output-pch=%i.gch}\
+ %W{o*:--output-pch=%*}%V}\
+ %{!save-temps:%{!no-integrated-cpp:\
+- cc1obj %(cpp_unique_options) %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\
++ cc1obj %(cpp_unique_options) %(cc1_options) %(ssp_default) %{print-objc-runtime-info} %{gen-decls}\
+ -o %g.s %{!o*:--output-pch=%i.gch}\
+ %W{o*:--output-pch=%*}%V}}}}}", 0, 0, 0},
+--- gcc/cp/lang-specs.h~ 2005-06-25 00:59:41.000000000 +0000
++++ gcc/cp/lang-specs.h 2006-07-12 13:32:05.656090432 +0000
+@@ -42,7 +42,7 @@
+ %(cpp_options) %2 -o %{save-temps:%b.ii} %{!save-temps:%g.ii} \n}\
+ cc1plus %{save-temps|no-integrated-cpp:-fpreprocessed %{save-temps:%b.ii} %{!save-temps:%g.ii}}\
+ %{!save-temps:%{!no-integrated-cpp:%(cpp_unique_options)}}\
+- %(cc1_options) %2 %{+e1*}\
++ %(cc1_options) %(ssp_default) %2 %{+e1*}\
+ -o %g.s %{!o*:--output-pch=%i.gch} %W{o*:--output-pch=%*}%V}}}",
+ CPLUSPLUS_CPP_SPEC, 0, 0},
+ {"@c++",
+@@ -52,11 +52,11 @@
+ %(cpp_options) %2 -o %{save-temps:%b.ii} %{!save-temps:%g.ii} \n}\
+ cc1plus %{save-temps|no-integrated-cpp:-fpreprocessed %{save-temps:%b.ii} %{!save-temps:%g.ii}}\
+ %{!save-temps:%{!no-integrated-cpp:%(cpp_unique_options)}}\
+- %(cc1_options) %2 %{+e1*}\
++ %(cc1_options) %(ssp_default) %2 %{+e1*}\
+ %{!fsyntax-only:%(invoke_as)}}}}",
+ CPLUSPLUS_CPP_SPEC, 0, 0},
+ {".ii", "@c++-cpp-output", 0, 0, 0},
+ {"@c++-cpp-output",
+ "%{!M:%{!MM:%{!E:\
+- cc1plus -fpreprocessed %i %(cc1_options) %2 %{+e*}\
++ cc1plus -fpreprocessed %i %(cc1_options) %(ssp_default) %2 %{+e*}\
+ %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
+--- gcc/objcp/lang-specs.h~ 2005-06-25 00:33:05.000000000 +0000
++++ gcc/objcp/lang-specs.h 2006-07-12 13:34:04.602007904 +0000
+@@ -36,7 +36,7 @@
+ %(cpp_options) %2 -o %{save-temps:%b.mii} %{!save-temps:%g.mii} \n}\
+ cc1objplus %{save-temps|no-integrated-cpp:-fpreprocessed %{save-temps:%b.mii} %{!save-temps:%g.mii}}\
+ %{!save-temps:%{!no-integrated-cpp:%(cpp_unique_options)}}\
+- %(cc1_options) %2 %{+e1*}\
++ %(cc1_options) %(ssp_default) %2 %{+e1*}\
+ -o %g.s %{!o*:--output-pch=%i.gch} %W{o*:--output-pch=%*}%V}}}",
+ CPLUSPLUS_CPP_SPEC, 0, 0},
+ {"@objective-c++",
+@@ -46,15 +46,15 @@
+ %(cpp_options) %2 -o %{save-temps:%b.mii} %{!save-temps:%g.mii} \n}\
+ cc1objplus %{save-temps|no-integrated-cpp:-fpreprocessed %{save-temps:%b.mii} %{!save-temps:%g.mii}}\
+ %{!save-temps:%{!no-integrated-cpp:%(cpp_unique_options)}}\
+- %(cc1_options) %2 %{+e1*}\
++ %(cc1_options) %(ssp_default) %2 %{+e1*}\
+ %{!fsyntax-only:%(invoke_as)}}}}",
+ CPLUSPLUS_CPP_SPEC, 0, 0},
+ {".mii", "@objective-c++-cpp-output", 0, 0, 0},
+ {"@objective-c++-cpp-output",
+ "%{!M:%{!MM:%{!E:\
+- cc1objplus -fpreprocessed %i %(cc1_options) %2 %{+e*}\
++ cc1objplus -fpreprocessed %i %(cc1_options) %(ssp_default) %2 %{+e*}\
+ %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
+ {"@objc++-cpp-output",
+ "%{!M:%{!MM:%{!E:\
+- cc1objplus -fpreprocessed %i %(cc1_options) %2 %{+e*}\
++ cc1objplus -fpreprocessed %i %(cc1_options) %(ssp_default) %2 %{+e*}\
+ %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
+--- gcc/Makefile.in~ 2006-07-09 02:10:28.448366880 +0200
++++ gcc/Makefile.in 2006-07-11 14:03:25.865618000 +0200
+@@ -538,6 +538,7 @@
+ LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(TARGET_LIBGCC2_CFLAGS) \
+ $(LIBGCC2_DEBUG_CFLAGS) $(GTHREAD_FLAGS) \
+ -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED \
++ -fno-stack-protector \
+ $(INHIBIT_LIBC_CFLAGS)
+
+ # Additional options to use when compiling libgcc2.a.
+@@ -551,6 +552,7 @@
+ CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
+ -finhibit-size-directive -fno-inline-functions -fno-exceptions \
+ -fno-zero-initialized-in-bss -fno-unit-at-a-time \
++ -fno-stack-protector \
+ $(INHIBIT_LIBC_CFLAGS)
+
+ # Additional sources to handle exceptions; overridden by targets as needed.
+--- gcc/gcc.c~ 2006-07-18 14:22:02.304751656 +0000
++++ gcc/gcc.c 2006-07-18 14:25:09.785250288 +0000
+@@ -682,6 +682,10 @@
+ #endif
+ #endif
+
++#ifndef SSP_DEFAULT_SPEC
++#define SSP_DEFAULT_SPEC "%{!fno-stack-protector:-fstack-protector}"
++#endif
++
+ #ifndef LINK_PIE_SPEC
+ #ifdef HAVE_LD_PIE
+ #define LINK_PIE_SPEC "%{pie:-pie} "
+@@ -734,6 +738,7 @@
+ static const char *cc1plus_spec = CC1PLUS_SPEC;
+ static const char *link_gcc_c_sequence_spec = LINK_GCC_C_SEQUENCE_SPEC;
+ static const char *link_ssp_spec = LINK_SSP_SPEC;
++static const char *ssp_default_spec = SSP_DEFAULT_SPEC;
+ static const char *asm_spec = ASM_SPEC;
+ static const char *asm_final_spec = ASM_FINAL_SPEC;
+ static const char *link_spec = LINK_SPEC;
+@@ -804,6 +809,7 @@
+ %{--target-help:--target-help}\
+ %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+ %{fsyntax-only:-o %j} %{-param*}\
++ %(ssp_default)\
+ %{fmudflap|fmudflapth:-fno-builtin -fno-merge-constants}\
+ %{coverage:-fprofile-arcs -ftest-coverage}";
+
+@@ -951,15 +957,15 @@
+ %{save-temps|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \
+ %(cpp_options) -o %{save-temps:%b.i} %{!save-temps:%g.i} \n\
+ cc1 -fpreprocessed %{save-temps:%b.i} %{!save-temps:%g.i} \
+- %(cc1_options)}\
++ %(cc1_options) %(ssp_default)}\
+ %{!save-temps:%{!traditional-cpp:%{!no-integrated-cpp:\
+- cc1 %(cpp_unique_options) %(cc1_options)}}}\
++ cc1 %(cpp_unique_options) %(cc1_options) %(ssp_default)}}}\
+ %{!fsyntax-only:%(invoke_as)}} \
+ %{combine:\
+ %{save-temps|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \
+ %(cpp_options) -o %{save-temps:%b.i} %{!save-temps:%g.i}}\
+ %{!save-temps:%{!traditional-cpp:%{!no-integrated-cpp:\
+- cc1 %(cpp_unique_options) %(cc1_options)}}\
++ cc1 %(cpp_unique_options) %(cc1_options) %(ssp_default)}}\
+ %{!fsyntax-only:%(invoke_as)}}}}}}", 0, 1, 1},
+ {"-",
+ "%{!E:%e-E or -x required when input is from standard input}\
+@@ -982,7 +988,7 @@
+ %W{o*:--output-pch=%*}%V}}}}}}", 0, 0, 0},
+ {".i", "@cpp-output", 0, 1, 0},
+ {"@cpp-output",
+- "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 1, 0},
++ "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %(ssp_default) %{!fsyntax-only:%(invoke_as)}}}}", 0, 1, 0},
+ {".s", "@assembler", 0, 1, 0},
+ {"@assembler",
+ "%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 1, 0},
+@@ -1532,6 +1538,7 @@
+ INIT_STATIC_SPEC ("cc1plus", &cc1plus_spec),
+ INIT_STATIC_SPEC ("link_gcc_c_sequence", &link_gcc_c_sequence_spec),
+ INIT_STATIC_SPEC ("link_ssp", &link_ssp_spec),
++ INIT_STATIC_SPEC ("ssp_default", &ssp_default_spec),
+ INIT_STATIC_SPEC ("endfile", &endfile_spec),
+ INIT_STATIC_SPEC ("link", &link_spec),
+ INIT_STATIC_SPEC ("lib", &lib_spec),
+--- gcc/doc/invoke.texi~ 2006-12-08 19:40:22.000000000 +0100
++++ gcc/doc/invoke.texi 2006-12-09 09:49:56.000000000 +0100
+@@ -5700,6 +5700,9 @@
+ when a function is entered and then checked when the function exits.
+ If a guard check fails, an error message is printed and the program exits.
+
++NOTE: In Ubuntu 6.10 and 7.04 this option is enabled by default
++for C, C++, ObjC, ObjC++.
++
+ @item -fstack-protector-all
+ Like @option{-fstack-protector} except that all functions are protected.
+
--- gcc-4.1-4.1.2.orig/debian/patches/gcc-r109581.dpatch
+++ gcc-4.1-4.1.2/debian/patches/gcc-r109581.dpatch
@@ -0,0 +1,64 @@
+#! /bin/sh -e
+
+# DP: Backport r109581 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
+ #rm ${dir}gcc/configure
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+2006-01-19 Jan Hubicka
+
+ * i386.h (TARGET_DECOMPOSE_LEA): Kill.
+ * i386.c (x86_decompose_lea): Kill.
+ (ix86_rtx_costs): Kill.
+
+Index: gcc/config/i386/i386.h
+===================================================================
+--- gcc/config/i386/i386.h (revision 109569)
++++ gcc/config/i386/i386.h (revision 109581)
+@@ -209,7 +209,6 @@
+ #define TARGET_MEMORY_MISMATCH_STALL (x86_memory_mismatch_stall & TUNEMASK)
+ #define TARGET_PROLOGUE_USING_MOVE (x86_prologue_using_move & TUNEMASK)
+ #define TARGET_EPILOGUE_USING_MOVE (x86_epilogue_using_move & TUNEMASK)
+-#define TARGET_DECOMPOSE_LEA (x86_decompose_lea & TUNEMASK)
+ #define TARGET_PREFETCH_SSE (x86_prefetch_sse)
+ #define TARGET_SHIFT1 (x86_shift1 & TUNEMASK)
+ #define TARGET_USE_FFREEP (x86_use_ffreep & TUNEMASK)
+Index: gcc/config/i386/i386.c
+===================================================================
+--- gcc/config/i386/i386.c (revision 109569)
++++ gcc/config/i386/i386.c (revision 109581)
+@@ -640,7 +640,6 @@
+ const int x86_accumulate_outgoing_args = m_ATHLON_K8 | m_PENT4 | m_NOCONA | m_PPRO;
+ const int x86_prologue_using_move = m_ATHLON_K8 | m_PPRO;
+ const int x86_epilogue_using_move = m_ATHLON_K8 | m_PPRO;
+-const int x86_decompose_lea = m_PENT4 | m_NOCONA;
+ const int x86_shift1 = ~m_486;
+ const int x86_arch_always_fancy_math_387 = m_PENT | m_PPRO | m_ATHLON_K8 | m_PENT4 | m_NOCONA;
+ const int x86_sse_partial_reg_dependency = m_PENT4 | m_NOCONA | m_PPRO;
+@@ -16673,7 +16673,6 @@
+ return false;
+ }
+ if ((value == 2 || value == 3)
+- && !TARGET_DECOMPOSE_LEA
+ && ix86_cost->lea <= ix86_cost->shift_const)
+ {
+ *total = ix86_cost->lea;
--- gcc-4.1-4.1.2.orig/debian/patches/ada-link-lib.dpatch
+++ gcc-4.1-4.1.2/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 -R -p0 < $0
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -p0 < $0
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+
+2006-06-13 Mark Mitchell
+
+ PR c++/27227
+ * decl.c (decls_match): Allow an extern "C" variable declarations
+ from different namespaces to match.
+ (duplicate_decls): Disallow redeclaring a variable with a
+ different linkage specification.
+
+Index: gcc/cp/decl.c
+===================================================================
+--- gcc/cp/decl.c (revision 114651)
++++ gcc/cp/decl.c (revision 114652)
+@@ -941,7 +941,13 @@
+ /* Need to check scope for variable declaration (VAR_DECL).
+ For typedef (TYPE_DECL), scope is ignored. */
+ if (TREE_CODE (newdecl) == VAR_DECL
+- && CP_DECL_CONTEXT (newdecl) != CP_DECL_CONTEXT (olddecl))
++ && CP_DECL_CONTEXT (newdecl) != CP_DECL_CONTEXT (olddecl)
++ /* [dcl.link]
++ Two declarations for an object with C language linkage
++ with the same name (ignoring the namespace that qualify
++ it) that appear in different namespace scopes refer to
++ the same object. */
++ && !(DECL_EXTERN_C_P (olddecl) && DECL_EXTERN_C_P (newdecl)))
+ return 0;
+
+ if (TREE_TYPE (newdecl) == error_mark_node)
+@@ -1396,14 +1402,42 @@
+ warning (0, "prototype for %q+#D", newdecl);
+ warning (0, "%Jfollows non-prototype definition here", olddecl);
+ }
+- else if (TREE_CODE (olddecl) == FUNCTION_DECL
++ else if ((TREE_CODE (olddecl) == FUNCTION_DECL
++ || TREE_CODE (olddecl) == VAR_DECL)
+ && DECL_LANGUAGE (newdecl) != DECL_LANGUAGE (olddecl))
+ {
+- /* extern "C" int foo ();
+- int foo () { bar (); }
+- is OK. */
++ /* [dcl.link]
++ If two declarations of the same function or object
++ specify different linkage-specifications ..., the program
++ is ill-formed.... Except for functions with C++ linkage,
++ a function declaration without a linkage specification
++ shall not precede the first linkage specification for
++ that function. A function can be declared without a
++ linkage specification after an explicit linkage
++ specification has been seen; the linkage explicitly
++ specified in the earlier declaration is not affected by
++ such a function declaration.
++
++ DR 563 raises the question why the restrictions on
++ functions should not also apply to objects. Older
++ versions of G++ silently ignore the linkage-specification
++ for this example:
++
++ namespace N {
++ extern int i;
++ extern "C" int i;
++ }
++
++ which is clearly wrong. Therefore, we now treat objects
++ like functions. */
+ if (current_lang_depth () == 0)
+- SET_DECL_LANGUAGE (newdecl, DECL_LANGUAGE (olddecl));
++ {
++ /* There is no explicit linkage-specification, so we use
++ the linkage from the previous declaration. */
++ if (!DECL_LANG_SPECIFIC (newdecl))
++ retrofit_lang_decl (newdecl);
++ SET_DECL_LANGUAGE (newdecl, DECL_LANGUAGE (olddecl));
++ }
+ else
+ {
+ error ("previous declaration of %q+#D with %qL linkage",
--- gcc-4.1-4.1.2.orig/debian/patches/pr25524-doc.dpatch
+++ gcc-4.1-4.1.2/debian/patches/pr25524-doc.dpatch
@@ -0,0 +1,113 @@
+#! /bin/sh -e
+
+# DP: Backport PR libstdc++/25524 from the trunk (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
+ ;;
+ -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.
--- gcc-4.1-4.1.2.orig/debian/patches/m68k-dwarf.dpatch
+++ gcc-4.1-4.1.2/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.2.orig/debian/patches/libjava-plugin-binary.dpatch
+++ gcc-4.1-4.1.2/debian/patches/libjava-plugin-binary.dpatch
@@ -0,0 +1,50 @@
+#! /bin/sh -e
+
+# DP: Make the plugin call the versioned gappletviewer.
+
+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/classpath/native/plugin/Makefile.am~ 2006-07-07 17:21:53.000000000 +0200
++++ libjava/classpath/native/plugin/Makefile.am 2006-07-29 23:00:37.006843000 +0200
+@@ -3,7 +3,7 @@
+ libgcjwebplugin_la_SOURCES = gcjwebplugin.cc
+
+ libgcjwebplugin_la_CXXFLAGS = \
+- -Wall -DAPPLETVIEWER_EXECUTABLE="\"$(bindir)/gappletviewer\"" \
++ -Wall -DAPPLETVIEWER_EXECUTABLE="\"$(bindir)/gappletviewer-4.1\"" \
+ $(MOZILLA_CFLAGS) $(GLIB_CFLAGS) $(GTK_CFLAGS)
+
+ libgcjwebplugin_la_LDFLAGS = -avoid-version \
+--- libjava/classpath/native/plugin/Makefile.in~ 2006-07-29 13:38:46.266843000 +0200
++++ libjava/classpath/native/plugin/Makefile.in 2006-07-29 23:01:00.756843000 +0200
+@@ -305,7 +305,7 @@
+ nativeexeclib_LTLIBRARIES = libgcjwebplugin.la
+ libgcjwebplugin_la_SOURCES = gcjwebplugin.cc
+ libgcjwebplugin_la_CXXFLAGS = \
+- -Wall -DAPPLETVIEWER_EXECUTABLE="\"$(bindir)/gappletviewer\"" \
++ -Wall -DAPPLETVIEWER_EXECUTABLE="\"$(bindir)/gappletviewer-4.1\"" \
+ $(MOZILLA_CFLAGS) $(GLIB_CFLAGS) $(GTK_CFLAGS)
+
+ libgcjwebplugin_la_LDFLAGS = -avoid-version \
--- gcc-4.1-4.1.2.orig/debian/patches/pr26885-doc.dpatch
+++ gcc-4.1-4.1.2/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.2.orig/debian/patches/pr28772-doc.dpatch
+++ gcc-4.1-4.1.2/debian/patches/pr28772-doc.dpatch
@@ -0,0 +1,60 @@
+#! /bin/sh -e
+
+# DP: Fix PR rtl-optimization/28772, taken from the gcc-4_1-branch (doc part).
+
+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
+
+2007-02-14 Eric Botcazou
+ Maxim Kuvyrkov
+
+ PR rtl-optimization/28772
+ * Makefile.in (haifa-sched.o): Add dependency on $(PARAMS_H).
+
+ Backport from mainline:
+ 2006-04-13 Eric Botcazou
+
+ * params.def (PARAM_MAX_SCHED_READY_INSNS): New parameter,
+ defaulting to 100.
+ * params.h (MAX_SCHED_READY_INSNS): New macro.
+ * haifa-sched.c: (queue_to_ready): Re-queue insns for the next cycle
+ past MAX_SCHED_READY_INSNS during the first scheduling pass.
+ (schedule_block): Delay insns past MAX_SCHED_READY_INSNS in
+ the ready list for 1 cycle during the first scheduling pass.
+ * doc/invoke.texi (--param): New parameter max-sched-ready-insns.
+
+Index: gcc/doc/invoke.texi
+===================================================================
+--- gcc/doc/invoke.texi (Revision 121963)
++++ gcc/doc/invoke.texi (Revision 121964)
+@@ -6082,6 +6082,12 @@
+ @option{reorder-block-duplicate} since information about the hot spots is more
+ accurate.
+
++@item max-sched-ready-insns
++The maximum number of instructions ready to be issued the scheduler should
++consider at any given time during the first scheduling pass. Increasing
++values mean more thorough searches, making the compilation time increase
++with probably little benefit. The default value is 100.
++
+ @item max-sched-region-blocks
+ The maximum number of blocks in a region to be considered for
+ interblock scheduling. The default value is 10.
--- gcc-4.1-4.1.2.orig/debian/patches/m68k-return.dpatch
+++ gcc-4.1-4.1.2/debian/patches/m68k-return.dpatch
@@ -0,0 +1,47 @@
+#! /bin/sh -e
+
+# All lines beginning with `# DPATCH:' are a description of the patch.
+# DP: don't use single return if fp register have to be restored
+# DP: fixes 386864
+
+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
+
+---
+
+ gcc/config/m68k/m68k.c | 2 +-
+ 1 file changed, 1 insertion(+), 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
+@@ -738,7 +738,7 @@ use_return_insn (void)
+ /* We can output the epilogue as RTL only if no registers need to be
+ restored. */
+ m68k_compute_frame_layout();
+- return current_frame.reg_no ? false : true;
++ return (current_frame.reg_no + current_frame.fpu_no) ? false : true;
+ }
+
+ /* This function generates the assembly code for function exit,
--- gcc-4.1-4.1.2.orig/debian/patches/ada-gnatvsn.dpatch
+++ gcc-4.1-4.1.2/debian/patches/ada-gnatvsn.dpatch
@@ -0,0 +1,57 @@
+#! /bin/sh -e
+
+# DP: proposed patch for PR ada/27194.
+
+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
+
+--- orig/gnatvsn.ads 2005-11-15 14:59:02.000000000 +0100
++++ gcc/ada/gnatvsn.ads 2006-04-18 10:00:37.010002000 +0200
+@@ -67,7 +67,7 @@
+ -- GAP
+ -- GNAT Academic Program, similar to Public.
+
+- Ver_Len_Max : constant := 32;
++ Ver_Len_Max : constant := 64;
+ -- Longest possible length for Gnat_Version_String in this or any
+ -- other version of GNAT. This is used by the binder to establish
+ -- space to store any possible version string value for checks. This
+--- orig/gnatvsn.adb 2005-07-01 03:29:17.000000000 +0200
++++ gcc/ada/gnatvsn.adb 2006-04-18 10:00:05.100002000 +0200
+@@ -54,12 +54,13 @@
+ -------------------------
+
+ function Gnat_Version_String return String is
+- NUL_Pos : Positive := 1;
++ NUL_Pos : Positive := Version_String'Last;
+ begin
+- loop
+- exit when Version_String (NUL_Pos) = ASCII.NUL;
+-
+- NUL_Pos := NUL_Pos + 1;
++ for J in Version_String'Range loop
++ if Version_String (J) = ASCII.NUL then
++ NUL_Pos := J;
++ exit;
++ end if;
+ end loop;
+
+ return Version_String (1 .. NUL_Pos - 1);
--- gcc-4.1-4.1.2.orig/debian/patches/m68k-java.dpatch
+++ gcc-4.1-4.1.2/debian/patches/m68k-java.dpatch
@@ -0,0 +1,188 @@
+#! /bin/sh -e
+
+# All lines beginning with `# DPATCH:' are a description of the patch.
+# DP: java support for m68k
+# DP: - add m68k info to configure files
+# DP: - add sysdep/m68k/locks.h
+# DP: - boehm.c: don't use bitmap as gc_descr if pointer is misaligned
+
+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} && touch libjava/configure
+ #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
+
+---
+
+ gcc/java/boehm.c | 8 ++++
+ libjava/configure | 3 +
+ libjava/configure.ac | 3 +
+ libjava/configure.host | 5 +++
+ libjava/sysdep/m68k/locks.h | 72 ++++++++++++++++++++++++++++++++++++++++++++
+ 5 files changed, 91 insertions(+)
+
+Index: gcc-4.1/libjava/configure.host
+===================================================================
+--- gcc-4.1.orig/libjava/configure.host
++++ gcc-4.1/libjava/configure.host
+@@ -132,6 +132,10 @@ case "${host}" in
+ libgcj_interpreter=yes
+ enable_hash_synchronization_default=no
+ ;;
++ m68k-*)
++ sysdeps_dir=m68k
++ libgcj_interpreter=yes
++ ;;
+ powerpc64*-*)
+ sysdeps_dir=powerpc
+ libgcj_interpreter=yes
+@@ -184,6 +188,7 @@ case "${host}" in
+ ia64-* | \
+ x86_64*-linux* | \
+ hppa*-linux* | \
++ m68k*-linux* | \
+ sh-linux* | sh[34]*-linux*)
+ can_unwind_signal=yes
+ libgcj_ld_symbolic='-Wl,-Bsymbolic'
+Index: gcc-4.1/libjava/configure.ac
+===================================================================
+--- gcc-4.1.orig/libjava/configure.ac
++++ gcc-4.1/libjava/configure.ac
+@@ -1415,6 +1415,9 @@ case "${host}" in
+ mips*-*-linux*)
+ SIGNAL_HANDLER=include/mips-signal.h
+ ;;
++ m68*-*-linux*)
++ SIGNAL_HANDLER=include/dwarf2-signal.h
++ ;;
+ *-*-darwin*)
+ SIGNAL_HANDLER=include/darwin-signal.h
+ ;;
+Index: gcc-4.1/libjava/configure
+===================================================================
+--- gcc-4.1.orig/libjava/configure
++++ gcc-4.1/libjava/configure
+@@ -16718,6 +16718,9 @@ case "${host}" in
+ mips*-*-linux*)
+ SIGNAL_HANDLER=include/mips-signal.h
+ ;;
++ m68*-*-linux*)
++ SIGNAL_HANDLER=include/dwarf2-signal.h
++ ;;
+ *-*-darwin*)
+ SIGNAL_HANDLER=include/darwin-signal.h
+ ;;
+Index: gcc-4.1/libjava/sysdep/m68k/locks.h
+===================================================================
+--- /dev/null
++++ gcc-4.1/libjava/sysdep/m68k/locks.h
+@@ -0,0 +1,72 @@
++// locks.h - Thread synchronization primitives. m68k implementation.
++
++/* Copyright (C) 2006 Free Software Foundation
++
++ This file is part of libgcj.
++
++This software is copyrighted work licensed under the terms of the
++Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
++details. */
++
++#ifndef __SYSDEP_LOCKS_H__
++#define __SYSDEP_LOCKS_H__
++
++/* Integer type big enough for object address. */
++typedef size_t obj_addr_t __attribute__ ((aligned (4)));
++
++// Atomically replace *addr by new_val if it was initially equal to old.
++// Return true if the comparison succeeded.
++// Assumed to have acquire semantics, i.e. later memory operations
++// cannot execute before the compare_and_swap finishes.
++static inline bool
++compare_and_swap(volatile obj_addr_t *addr,
++ obj_addr_t old, obj_addr_t new_val)
++{
++ char result;
++ __asm__ __volatile__("cas.l %2,%3,%0; seq %1"
++ : "+m" (*addr), "=d" (result), "+d" (old)
++ : "d" (new_val)
++ : "memory");
++ return (bool) result;
++}
++
++// Set *addr to new_val with release semantics, i.e. making sure
++// that prior loads and stores complete before this
++// assignment.
++// On m68k, the hardware shouldn't reorder reads and writes,
++// so we just have to convince gcc not to do it either.
++static inline void
++release_set(volatile obj_addr_t *addr, obj_addr_t new_val)
++{
++ __asm__ __volatile__(" " : : : "memory");
++ *(addr) = new_val;
++}
++
++// Compare_and_swap with release semantics instead of acquire semantics.
++// On many architecture, the operation makes both guarantees, so the
++// implementation can be the same.
++static inline bool
++compare_and_swap_release(volatile obj_addr_t *addr,
++ obj_addr_t old,
++ obj_addr_t new_val)
++{
++ return compare_and_swap(addr, old, new_val);
++}
++
++// Ensure that subsequent instructions do not execute on stale
++// data that was loaded from memory before the barrier.
++// On m68k, the hardware ensures that reads are properly ordered.
++static inline void
++read_barrier(void)
++{
++}
++
++// Ensure that prior stores to memory are completed with respect to other
++// processors.
++static inline void
++write_barrier(void)
++{
++ // m68k does not reorder writes. We just need to ensure that gcc also doesn't.
++ __asm__ __volatile__(" " : : : "memory");
++}
++#endif
+Index: gcc-4.1/gcc/java/boehm.c
+===================================================================
+--- gcc-4.1.orig/gcc/java/boehm.c
++++ gcc-4.1/gcc/java/boehm.c
+@@ -90,6 +90,14 @@ mark_reference_fields (tree field,
+
+ offset = int_byte_position (field);
+ size_bytes = int_size_in_bytes (TREE_TYPE (field));
++
++ if (offset % (POINTER_SIZE / BITS_PER_UNIT))
++ {
++ *all_bits_set = -1;
++ *pointer_after_end = 1;
++ break;
++ }
++
+ if (JREFERENCE_TYPE_P (TREE_TYPE (field))
+ /* An `object' of type gnu.gcj.RawData is actually non-Java
+ data. */
--- gcc-4.1-4.1.2.orig/debian/patches/powerpc-biarch.dpatch
+++ gcc-4.1-4.1.2/debian/patches/powerpc-biarch.dpatch
@@ -0,0 +1,47 @@
+#! /bin/sh -e
+
+# DP: enable biarch for 32 bit compiler
+
+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/rs6000/t-linux64.orig 2004-03-17 16:15:32.000000000 +0100
++++ gcc/config/rs6000/t-linux64 2005-10-01 00:40:20.279274880 +0200
+@@ -8,13 +8,13 @@
+
+ SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-ppc64.ver
+
+-MULTILIB_OPTIONS = m64/m32 msoft-float
+-MULTILIB_DIRNAMES = 64 32 nof
++MULTILIB_OPTIONS = m64/m32
++MULTILIB_DIRNAMES = 64 32
+ MULTILIB_EXTRA_OPTS = fPIC mstrict-align
+-MULTILIB_EXCEPTIONS = m64/msoft-float
+-MULTILIB_EXCLUSIONS = m64/!m32/msoft-float
+-MULTILIB_OSDIRNAMES = ../lib64 ../lib nof
+-MULTILIB_MATCHES = $(MULTILIB_MATCHES_FLOAT)
++MULTILIB_EXCEPTIONS =
++MULTILIB_EXCLUSIONS =
++MULTILIB_OSDIRNAMES = ../lib64 ../lib
++MULTILIB_MATCHES =
+
+ # We want fine grained libraries, so use the new code to build the
+ # floating point emulation libraries.
--- gcc-4.1-4.1.2.orig/debian/patches/netbsd-archs-gcc.dpatch
+++ gcc-4.1-4.1.2/debian/patches/netbsd-archs-gcc.dpatch
@@ -0,0 +1,38 @@
+#! /bin/sh -e
+
+# DP: Arch-specific changes to gcc.config
+
+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/config.gcc src/gcc/config.gcc
+--- gcc/config.gcc 2003-03-02 07:39:03.000000000 +0000
++++ gcc/config.gcc 2003-04-24 06:02:55.000000000 +0000
+@@ -1127,6 +1127,9 @@
+ x86_64-*-freebsd*)
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h"
+ ;;
++i[34567]86-*-netbsdelf*-gnu*)
++ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd-gnu.h netbsd-elf-gnu.h i386/netbsd-elf.h"
++ ;;
+ i[34567]86-*-netbsdelf*)
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h"
+ ;;
--- gcc-4.1-4.1.2.orig/debian/patches/hurd-changes.dpatch
+++ gcc-4.1-4.1.2/debian/patches/hurd-changes.dpatch
@@ -0,0 +1,90 @@
+#! /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
+
+# DP: Traditional GNU systems don't have a /usr directory. However, Debian
+# DP: systems do, and we support both having a /usr -> . symlink, and having a
+# DP: /usr directory like the other ports. So this patch should NOT go
+# DP: upstream.
+# DP:
+# DP: Define MAXPATHLEN and PATH_MAX.
+
+--- gcc/ada/adaint.c.orig 2005-11-15 14:52:31.000000000 +0100
++++ gcc/ada/adaint.c 2006-12-10 12:28:46.000000000 +0100
+@@ -272,6 +272,10 @@
+ #include
+ #endif
+
++#ifndef MAXPATHLEN
++#define MAXPATHLEN 4096
++#endif
++
+ #ifdef MAXPATHLEN
+ #define GNAT_MAX_PATH_LEN MAXPATHLEN
+ #else
+--- gcc/config/i386/gnu.h.orig 2004-09-08 02:17:19.000000000 +0200
++++ gcc/config/i386/gnu.h 2006-12-10 12:28:45.000000000 +0100
+@@ -17,7 +17,7 @@
+ while (0)
+
+ #undef CPP_SPEC
+-#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{bsd:-D_BSD_SOURCE}"
++#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{bsd:-D_BSD_SOURCE} %{pthread:-D_REENTRANT}"
+
+ #undef CC1_SPEC
+ #define CC1_SPEC "%(cc1_cpu)"
+--- gcc/config/gnu.h.orig 2004-07-05 21:49:20.000000000 +0200
++++ gcc/config/gnu.h 2006-12-10 12:28:45.000000000 +0100
+@@ -6,11 +6,12 @@
+
+ /* Default C library spec. Use -lbsd-compat for gcc -bsd. */
+ #undef LIB_SPEC
+-#define LIB_SPEC "%{bsd:-lbsd-compat} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}"
++#define LIB_SPEC "%{pthread:-lpthread} %{bsd:-lbsd-compat} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}"
+
+ /* Standard include directory. In GNU, "/usr" is a four-letter word. */
+ #undef STANDARD_INCLUDE_DIR
+-#define STANDARD_INCLUDE_DIR "/include"
++/* Overriden for Debian GNU/Hurd. */
++#define STANDARD_INCLUDE_DIR "/usr/include"
+
+ /* The system headers under GNU are C++-aware. */
+ #define NO_IMPLICIT_EXTERN_C
+--- gcc/config/t-gnu.orig 2004-01-10 07:40:24.000000000 +0100
++++ gcc/config/t-gnu 2006-12-10 12:28:45.000000000 +0100
+@@ -1,2 +1,2 @@
+ # In GNU, "/usr" is a four-letter word.
+-NATIVE_SYSTEM_HEADER_DIR = /include
++NATIVE_SYSTEM_HEADER_DIR = /usr/include
+--- gcc/tlink.c.orig 2005-06-25 04:02:01.000000000 +0200
++++ gcc/tlink.c 2006-12-10 12:28:45.000000000 +0100
+@@ -34,6 +34,10 @@
+
+ #define MAX_ITERATIONS 17
+
++#ifndef MAXPATHLEN
++#define MAXPATHLEN 4096
++#endif
++
+ /* Defined in the automatically-generated underscore.c. */
+ extern int prepends_underscore;
+
--- gcc-4.1-4.1.2.orig/debian/patches/reporting.dpatch
+++ gcc-4.1-4.1.2/debian/patches/reporting.dpatch
@@ -0,0 +1,144 @@
+#! /bin/sh -e
+
+# DP: Add Debian URL for bug reporting instructions.
+
+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
+ if grep -q debian_bug_report_url ${dir}gcc/version.c; then
+ :
+ else
+ echo 'const char debian_bug_report_url[] = "";' >> ${dir}gcc/version.c
+ fi
+ ;;
+ -unpatch)
+ grep -v debian_bug_report_url ${dir}gcc/version.c > ${dir}gcc/version.c.new
+ ${dir}move-if-change ${dir}gcc/version.c.new ${dir}gcc/version.c
+ 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/java/gjavah.c.orig 2005-09-05 00:22:28.368267856 +0000
++++ gcc/java/gjavah.c 2005-09-05 00:22:44.643793600 +0000
+@@ -2390,6 +2390,8 @@
+ printf ("\n");
+ printf (_("For bug reporting instructions, please see:\n"
+ "%s.\n"), bug_report_url);
++ printf (_("For Debian GNU/Linux specific bug reporting instructions, please see:\n"
++ "%s.\n"), debian_bug_report_url);
+ exit (0);
+ }
+
+--- gcc/java/jcf-dump.c.orig 2005-09-05 00:22:28.368267856 +0000
++++ gcc/java/jcf-dump.c 2005-09-05 00:22:44.643793600 +0000
+@@ -921,6 +921,8 @@
+ printf ("\n");
+ printf (_("For bug reporting instructions, please see:\n"
+ "%s.\n"), bug_report_url);
++ printf (_("For Debian GNU/Linux specific bug reporting instructions, please see:\n"
++ "%s.\n"), debian_bug_report_url);
+ exit (0);
+ }
+
+--- gcc/java/jv-scan.c.orig 2005-09-05 00:22:28.371267400 +0000
++++ gcc/java/jv-scan.c 2005-09-05 00:22:44.644793448 +0000
+@@ -119,6 +119,8 @@
+ printf ("\n");
+ printf (_("For bug reporting instructions, please see:\n"
+ "%s.\n"), bug_report_url);
++ printf (_("For Debian GNU/Linux specific bug reporting instructions, please see:\n"
++ "%s.\n"), debian_bug_report_url);
+ exit (0);
+ }
+
+--- gcc/diagnostic.c.orig 2005-09-05 00:22:28.371267400 +0000
++++ gcc/diagnostic.c 2005-09-05 00:22:44.644793448 +0000
+@@ -243,6 +243,8 @@
+ fnotice (stderr, "Please submit a full bug report,\n"
+ "with preprocessed source if appropriate.\n"
+ "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);
+
+ case DK_FATAL:
+--- gcc/gcc.c.orig 2005-09-05 00:22:28.378266336 +0000
++++ gcc/gcc.c 2005-09-05 00:24:35.547933608 +0000
+@@ -2872,9 +2872,11 @@
+ fatal ("\
+ Internal error: %s (program %s)\n\
+ Please submit a full bug report.\n\
+-See %s for instructions.",
++See %s for instructions.\n\
++For Debian GNU/Linux specific bug reporting instructions, see\n\
++%s.\n",
+ strsignal (WTERMSIG (status)), commands[i].prog,
+- bug_report_url);
++ bug_report_url, debian_bug_report_url);
+ signal_count++;
+ ret_code = -1;
+ }
+@@ -6359,6 +6361,8 @@
+ {
+ printf (_("\nFor bug reporting instructions, please see:\n"));
+ printf ("%s.\n", bug_report_url);
++ printf ("For Debian GNU/Linux specific bug reporting instructions, please see:\n");
++ printf ("%s.\n", debian_bug_report_url);
+
+ return (0);
+ }
+@@ -6648,6 +6652,8 @@
+ {
+ printf (("\nFor bug reporting instructions, please see:\n"));
+ printf ("%s\n", bug_report_url);
++ printf ("For Debian GNU/Linux specific bug reporting instructions, please see:\n");
++ printf ("%s\n", debian_bug_report_url);
+ }
+
+ return (signal_count != 0 ? 2
+--- gcc/gccbug.in.orig 2005-09-05 00:22:28.381265880 +0000
++++ gcc/gccbug.in 2005-09-05 00:25:56.216670096 +0000
+@@ -25,10 +25,10 @@
+ VERSION=3.113
+
+ # The submitter-id for your site.
+-SUBMITTER=net
++SUBMITTER=net # net-debian
+
+ # The default mail address for PR submissions.
+-GNATS_ADDR=gcc-gnats@gcc.gnu.org
++GNATS_ADDR="gcc-gnats@gcc.gnu.org,debian-gcc@lists.debian.org"
+
+ # The default release for this host.
+ # We have to guess at what program_transform_name might have done.
+--- gcc/gcov.c.orig 2005-09-05 00:22:28.382265728 +0000
++++ gcc/gcov.c 2005-09-05 00:22:44.650792536 +0000
+@@ -402,6 +402,8 @@
+ fnotice (file, " -u, --unconditional-branches Show unconditional branch counts too\n");
+ fnotice (file, "\nFor bug reporting instructions, please see:\n%s.\n",
+ bug_report_url);
++ fnotice (file, "\nFor Debian GNU/Linux specific bug reporting instructions, please see:\n%s.\n",
++ debian_bug_report_url);
+ exit (status);
+ }
+
+--- gcc/version.h.orig 2005-09-05 00:22:28.383265576 +0000
++++ gcc/version.h 2005-09-05 00:22:44.651792384 +0000
+@@ -2,4 +2,5 @@
+ #define GCC_VERSION_H
+ extern const char version_string[];
+ extern const char bug_report_url[];
++extern const char debian_bug_report_url[];
+ #endif /* ! GCC_VERSION_H */
--- gcc-4.1-4.1.2.orig/debian/patches/multiarch-include.dpatch
+++ gcc-4.1-4.1.2/debian/patches/multiarch-include.dpatch
@@ -0,0 +1,138 @@
+#! /bin/sh -e
+
+# DP: biarch-include.dpatch
+# DP:
+# DP: Adds biarch include directories
+# DP: /usr/local/include/-linux-gnu
+# DP: /usr/include/-linux-gnu
+# DP: to the system include paths, depending on 32/64 bit mode.
+
+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/cppdefault.c
+===================================================================
+--- gcc/cppdefault.c (revision 112832)
++++ gcc/cppdefault.c (working copy)
+@@ -60,6 +60,7 @@
+ #endif
+ #ifdef LOCAL_INCLUDE_DIR
+ /* /usr/local/include comes before the fixincluded header files. */
++ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 },
+ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 },
+ #endif
+ #ifdef PREFIX_INCLUDE_DIR
+@@ -83,6 +84,7 @@
+ #endif
+ #ifdef STANDARD_INCLUDE_DIR
+ /* /usr/include comes dead last. */
++ { STANDARD_INCLUDE_DIR, STANDARD_INCLUDE_COMPONENT, 0, 0, 1, 2 },
+ { STANDARD_INCLUDE_DIR, STANDARD_INCLUDE_COMPONENT, 0, 0, 1, 0 },
+ #endif
+ { 0, 0, 0, 0, 0, 0 }
+Index: gcc/c-incpath.c
+===================================================================
+--- gcc/c-incpath.c (revision 112832)
++++ gcc/c-incpath.c (working copy)
+@@ -30,6 +30,7 @@
+ #include "intl.h"
+ #include "c-incpath.h"
+ #include "cppdefault.h"
++#include "errors.h"
+
+ /* Windows does not natively support inodes, and neither does MSDOS.
+ Cygwin's emulation can generate non-unique inodes, so don't use it.
+@@ -121,6 +121,31 @@
+ }
+ }
+
++struct multiarch_mapping
++{
++ const char *const multilib;
++ const char *const multiarch;
++};
++
++const struct multiarch_mapping multiarch_mappings[]
++= {
++#include "multiarch.inc"
++ { 0, 0 }
++};
++
++static const char*
++multilib_to_multiarch (const char *imultilib)
++{
++ const struct multiarch_mapping *p;
++
++ for (p = multiarch_mappings; p->multiarch; p++)
++ {
++ if (!strcmp(p->multilib, imultilib ? imultilib : ""))
++ return p->multiarch;
++ }
++ internal_error("no multiarch mapping for multilib (%s)\n", imultilib);
++}
++
+ /* Append the standard include chain defined in cppdefault.c. */
+ static void
+ add_standard_paths (const char *sysroot, const char *iprefix,
+@@ -128,6 +153,7 @@
+ {
+ const struct default_include *p;
+ size_t len;
++ const char *multiarch;
+
+ if (iprefix && (len = cpp_GCC_INCLUDE_DIR_len) != 0)
+ {
+@@ -146,8 +172,15 @@
+ if (!strncmp (p->fname, cpp_GCC_INCLUDE_DIR, len))
+ {
+ char *str = concat (iprefix, p->fname + len, NULL);
+- if (p->multilib && imultilib)
++ if (p->multilib == 1 && imultilib)
+ str = concat (str, dir_separator_str, imultilib, NULL);
++ if (p->multilib == 2)
++ {
++ multiarch = multilib_to_multiarch (imultilib);
++ if (!multiarch)
++ continue;
++ str = concat (str, dir_separator_str, multiarch, NULL);
++ }
+ add_path (str, SYSTEM, p->cxx_aware, false);
+ }
+ }
+@@ -166,9 +199,17 @@
+ else
+ str = update_path (p->fname, p->component);
+
+- if (p->multilib && imultilib)
++ if (p->multilib == 1 && imultilib)
+ str = concat (str, dir_separator_str, imultilib, NULL);
+
++ if (p->multilib == 2)
++ {
++ multiarch = multilib_to_multiarch (imultilib);
++ if (!multiarch)
++ continue;
++ str = concat (str, dir_separator_str, multiarch, NULL);
++ }
++
+ add_path (str, SYSTEM, p->cxx_aware, false);
+ }
+ }
--- gcc-4.1-4.1.2.orig/debian/patches/svn-updates.dpatch
+++ gcc-4.1-4.1.2/debian/patches/svn-updates.dpatch
@@ -0,0 +1,40 @@
+#! /bin/sh -e
+
+# DP: SVN updates from the 4.1 branch upto 20070214.
+
+last_updated()
+{
+ cat > ${dir}LAST_UPDATED <&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
+ touch ${dir}libjava/testsuite/libjava.jni/PR28178.out
+ last_updated
+ #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
+
+# diff -urN --exclude=.svn gcc_4_1_2_release gcc-4_1-branch
+# svn diff svn://gcc.gnu.org/svn/gcc/tags/gcc_4_1_2_release svn://gcc.gnu.org/svn/gcc/branches/gcc-4_1-branch
+
--- gcc-4.1-4.1.2.orig/debian/patches/cross-include.dpatch
+++ gcc-4.1-4.1.2/debian/patches/cross-include.dpatch
@@ -0,0 +1,39 @@
+#! /bin/sh -e
+
+# DP: Set cross include path to .../include, not .../sys-include
+# DP: This should be a fix for famous limits.h issue
+
+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
+ cd ${dir}gcc && autoconf
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+--- gcc/configure.ac.orig 2005-08-24 06:24:11.000000000 +0400
++++ gcc/configure.ac 2005-12-06 00:40:45.000000000 +0300
+@@ -681,7 +681,7 @@
+ ], [
+ TARGET_SYSTEM_ROOT=
+ TARGET_SYSTEM_ROOT_DEFINE=
+- CROSS_SYSTEM_HEADER_DIR='$(gcc_tooldir)/sys-include'
++ CROSS_SYSTEM_HEADER_DIR='$(prefix)/$(target_noncanonical)/include'
+ ])
+ AC_SUBST(TARGET_SYSTEM_ROOT)
+ AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
--- gcc-4.1-4.1.2.orig/debian/patches/m68k-prevent-qipush.dpatch
+++ gcc-4.1-4.1.2/debian/patches/m68k-prevent-qipush.dpatch
@@ -0,0 +1,50 @@
+#! /bin/sh -e
+
+# All lines beginning with `# DPATCH:' are a description of the patch.
+# DP: prevent combine from creating a byte push on the stack (invalid on m68k)
+
+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 | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+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
+@@ -748,7 +748,10 @@
+ (define_insn ""
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=d,*a,m")
+ (match_operand:QI 1 "general_src_operand" "dmSi*a,di*a,dmSi"))]
+- "!TARGET_COLDFIRE"
++ "!TARGET_COLDFIRE
++ && (!MEM_P (operands[0])
++ || GET_CODE (XEXP (operands[0], 0)) != PRE_DEC
++ || XEXP (XEXP (operands[0], 0), 0) != stack_pointer_rtx)"
+ "* return output_move_qimode (operands);")
+
+ (define_insn ""
--- gcc-4.1-4.1.2.orig/debian/patches/libjava-doc-backport.dpatch
+++ gcc-4.1-4.1.2/debian/patches/libjava-doc-backport.dpatch
@@ -0,0 +1,187 @@
+#! /bin/sh -e
+
+# DP: gcc/java / libjava backport / classpath-0.92 (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 -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/gcc/java/gcj.texi src/gcc/java/gcj.texi
+--- old/gcc/java/gcj.texi 2006-01-06 22:23:36.000000000 +0100
++++ src/gcc/java/gcj.texi 2006-08-28 19:17:32.340718000 +0200
+@@ -57,7 +57,7 @@
+
+ @ifinfo
+ @format
+-@dircategory Programming
++@dircategory Software development
+ @direntry
+ * Gcj: (gcj). Ahead-of-time compiler for the Java language
+ @end direntry
+@@ -420,6 +420,20 @@
+ of the @code{gij} command.
+
+ This option is an alternative to using @code{--main}; you cannot use both.
++
++@item -static-libgcj
++This option causes linking to be done against a static version of the
++libgcj runtime library. This option is only available if
++corresponding linker support exists.
++
++@strong{Caution:} Static linking of libgcj may cause essential parts
++of libgcj to be omitted. Some parts of libgcj use reflection to load
++classes at runtime. Since the linker does not see these references at
++link time, it can omit the referred to classes. The result is usually
++(but not always) a @code{ClassNotFoundException} being thrown at
++runtime. Caution must be used when using this option. For more
++details see:
++@w{@uref{http://gcc.gnu.org/wiki/Statically%20linking%20libgcj}}
+ @end table
+
+ @node Code Generation
+@@ -532,6 +546,28 @@
+ @code{Class.forName()} will search @samp{CLASSPATH} to find the
+ desired class.
+
++@item -freduced-reflection
++This option causes the code generated by @command{gcj} to contain a
++reduced amount of the class meta-data used to support runtime
++reflection. The cost of this savings is the loss of
++the ability to use certain reflection capabilities of the standard
++Java runtime environment. When set all meta-data except for that
++which is needed to obtain correct runtime semantics is eliminated.
++
++For code that does not use reflection (i.e. the methods in the
++@code{java.lang.reflect} package), @code{-freduced-reflection}
++will result in proper operation with a savings in executable code size.
++
++JNI (@code{-fjni}) and the binary compatibility ABI
++(@code{-findirect-dispatch}) do not work properly without full
++reflection meta-data. Because of this, it is an error to use these options
++with @code{-freduced-reflection}.
++
++@strong{Caution:} If there is no reflection meta-data, code that uses
++a @code{SecurityManager} may not work properly. Also calling
++@code{Class.forName()} may fail if the calling method has no
++reflection meta-data.
++
+ @end table
+
+
+@@ -634,16 +670,26 @@
+ @xref{About CNI}, for more info on how to use this in your programs.
+
+ @item
+-When you compile your classes into a shared library they can be automatically
+-loaded by the @code{libgcj} system classloader. When trying to load a class
+-@code{gnu.pkg.SomeClass} the system classloader will first try to load the
+-shared library @file{lib-gnu-pkg-SomeClass.so}, if that fails to load the
+-class then it will try to load @file{lib-gnu-pkg.so} and finally when the
+-class is still not loaded it will try to load @file{lib-gnu.so}. Note that
++When you compile your classes into a shared library using
++@code{-findirect-dispatch} then add them to the system-wide
++classmap.db file using @code{gcj-dbtool}, they will be automatically
++loaded by the @code{libgcj} system classloader. This is the new,
++preferred classname-to-library resolution mechanism. @xref{Invoking
++gcj-dbtool}, for more information on using the classmap database.
++
++@item
++The old classname-to-library lookup mechanism is still supported
++through the @code{gnu.gcj.runtime.VMClassLoader.library_control}
++property, but it is deprecated and will likely be removed in some
++future release. When trying to load a class @code{gnu.pkg.SomeClass}
++the system classloader will first try to load the shared library
++@file{lib-gnu-pkg-SomeClass.so}, if that fails to load the class then
++it will try to load @file{lib-gnu-pkg.so} and finally when the class
++is still not loaded it will try to load @file{lib-gnu.so}. Note that
+ all @samp{.}s will be transformed into @samp{-}s and that searching
+-for inner classes starts with their outermost outer class. If the class
+-cannot be found this way the system classloader tries to use
+-the @code{libgcj} bytecode interpreter to load the class from the standard
++for inner classes starts with their outermost outer class. If the
++class cannot be found this way the system classloader tries to use the
++@code{libgcj} bytecode interpreter to load the class from the standard
+ classpath. This process can be controlled to some degree via the
+ @code{gnu.gcj.runtime.VMClassLoader.library_control} property;
+ @xref{libgcj Runtime Properties}.
+@@ -2461,7 +2507,7 @@
+ is wrapped with a try/catch block to provide a default handler for any uncaught
+ exceptions.
+
+-The example can be compiled with @command{c++ test.cc -lgcj}.
++The example can be compiled with @command{c++ -c test.cc; gcj test.o}.
+
+ @example
+ // test.cc
+@@ -2470,7 +2516,7 @@
+ #include
+ #include
+
+-int main(int argc, char *argv)
++int main(int argc, char *argv[])
+ @{
+ using namespace java::lang;
+
+@@ -2739,6 +2785,12 @@
+ used, or the program binary name in the case where an application is compiled
+ to a native binary.
+
++@item gnu.gcj.user.realname
++The real name of the user, as taken from the password file. This may
++not always hold only the user's name (as some sites put extra
++information in this field). Also, this property is not available on
++all platforms.
++
+ @item gnu.gcj.runtime.NameFinder.use_addr2line
+ Whether an external process, @command{addr2line}, should be used to determine
+ line number information when tracing the stack. Setting this to @code{false}
+@@ -2747,12 +2799,27 @@
+ significantly for applications that print stack traces or make logging calls
+ frequently.
+
++@item gnu.gcj.runtime.NameFinder.show_raw
++Whether the address of a stack frame should be printed when the line
++number is unavailable. Setting this to @code{true} will cause the name
++of the object and the offset within that object to be printed when no
++line number is available. This allows for off-line decoding of
++stack traces if necessary debug information is available. The default
++is @code{false}, no raw addresses are printed.
++
++@item gnu.gcj.runtime.NameFinder.remove_unknown
++Whether stack frames for non-java code should be included in a stack
++trace. The default value is @code{true}, stack frames for non-java
++code are suppressed. Setting this to @code{false} will cause any
++non-java stack frames to be printed in addition to frames for the java
++code.
++
+ @item gnu.gcj.runtime.VMClassLoader.library_control
+ This controls how shared libraries are automatically loaded by the
+ built-in class loader. If this property is set to @samp{full}, a full
+ search is done for each requested class. If this property is set to
+-@samp{cache} (the default), then any failed lookups are cached and not
+-tried again. If this property is set to @samp{never}, then lookups
++@samp{cache}, then any failed lookups are cached and not tried again.
++If this property is set to @samp{never} (the default), then lookups
+ are never done. For more information, @xref{Extensions}.
+
+ @item gnu.gcj.runtime.endorsed.dirs
--- gcc-4.1-4.1.2.orig/debian/patches/sparc-g7.dpatch
+++ gcc-4.1-4.1.2/debian/patches/sparc-g7.dpatch
@@ -0,0 +1,42 @@
+#! /bin/sh -e
+
+# DP: Backport g7 usage fix from svn.
+
+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
+
+diff -Naurd gcc.orig/config/sparc/sparc.c gcc/config/sparc/sparc.c
+--- gcc.orig/config/sparc/sparc.c 2006-06-29 06:40:15.000000000 +0000
++++ gcc/config/sparc/sparc.c 2006-06-29 06:42:24.000000000 +0000
+@@ -3740,7 +3740,10 @@
+ && ! sparc_hard_reg_printed [i])
+ {
+ sparc_hard_reg_printed [i] = 1;
+- fprintf (file, "\t.register\t%%g%d, #scratch\n", i);
++ /* %g7 is used as TLS base register, use #ignore
++ for it instead of #scratch. */
++ fprintf (file, "\t.register\t%%g%d, #%s\n", i,
++ i == 7 ? "ignore" : "scratch");
+ }
+ if (i == 3) i = 5;
+ }
--- gcc-4.1-4.1.2.orig/debian/patches/s390-biarch.dpatch
+++ gcc-4.1-4.1.2/debian/patches/s390-biarch.dpatch
@@ -0,0 +1,36 @@
+#! /bin/sh -e
+
+# DP: enable biarch for 31 bit compiler
+
+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
+
+--- src/gcc/config.gcc~ 2006-03-22 00:18:13.000000000 +0100
++++ src/gcc/config.gcc 2006-03-22 00:18:53.000000000 +0100
+@@ -1864,7 +1864,7 @@
+ ;;
+ s390-*-linux*)
+ tm_file="s390/s390.h dbxelf.h elfos.h svr4.h linux.h s390/linux.h"
+- tmake_file="${tmake_file} s390/t-crtstuff s390/t-linux"
++ tmake_file="${tmake_file} s390/t-crtstuff s390/t-linux s390/t-linux64"
+ ;;
+ s390x-*-linux*)
+ tm_file="s390/s390x.h s390/s390.h dbxelf.h elfos.h svr4.h linux.h s390/linux.h"
--- gcc-4.1-4.1.2.orig/debian/patches/m68k-autoinc.dpatch
+++ gcc-4.1-4.1.2/debian/patches/m68k-autoinc.dpatch
@@ -0,0 +1,160 @@
+#! /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 | 55 +++++++++++++++++++++++++++++++++++++++++++++----------
+ 1 file changed, 45 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,22 @@ 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)
++ {
++ if (reg_overlap_mentioned_p (addr, SET_DEST (set)))
++ return;
++ y = XEXP (y, 0);
++ }
++ else
++ {
++ y = SET_DEST (set);
++ if (!MEM_P (y) || GET_CODE (XEXP (y, 0)) != PLUS
++ || reg_overlap_mentioned_p (addr, SET_SRC (set)))
++ return;
++ y = XEXP (y, 0);
++ }
++ }
+
+ if (REG_P (XEXP (y, 0)) && REGNO (XEXP (y, 0)) == REGNO (addr))
+ inc_val = XEXP (y, 1);
+@@ -4172,10 +4199,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 +4208,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.2.orig/debian/patches/hppa-cbranch.dpatch
+++ gcc-4.1-4.1.2/debian/patches/hppa-cbranch.dpatch
@@ -0,0 +1,1751 @@
+#! /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
+
+2006-04-09 John David Anglin
+ PR target/26743
+ PR target/11254
+ PR target/10274
+ * pa.md (cbranch patterns): Revise arguments used in calls to
+ output_cbranch, output_bb and output_bvd. Add long branch length
+ attributes.
+ (fbranch patterns): Handle long branches.
+ (jump): Revise length check. Revise arguments for output_lbranch call.
+ Add long branch length attributes.
+ (decrement_and_branch_until_zero): Add long branch length attributes.
+ (output_movb, output_parallel_addb and output_parallel_movb patterns):
+ Likewise. Revise arguments for output_parallel_addb and
+ output_parallel_movb calls.
+ * pa-protos.h (output_cbranch, output_lbranch, output_bb, output_bvb,
+ output_parallel_movb and output_parallel_addb): Update prototypes.
+ * pa.c (output_cbranch): Revise arguments. Correct handling of
+ nullification in long branches.
+ (output_lbranch): Add new argument to control extraction of delay
+ instruction.
+ (output_bb): Handle long branches.
+ (output_bvb, output_dbra, output_movb, output_parallel_movb,
+ output_parallel_addb): Likewise.
+
+
+--- gcc/config/pa/pa.c.orig 2006-02-07 23:11:30.000000000 +0100
++++ gcc/config/pa/pa.c 2006-04-19 11:31:02.331909272 +0200
+@@ -5934,11 +5934,13 @@
+ parameters. */
+
+ const char *
+-output_cbranch (rtx *operands, int nullify, int length, int negated, rtx insn)
++output_cbranch (rtx *operands, int negated, rtx insn)
+ {
+ static char buf[100];
+ int useskip = 0;
+- rtx xoperands[5];
++ int nullify = INSN_ANNULLED_BRANCH_P (insn);
++ int length = get_attr_length (insn);
++ int xdelay;
+
+ /* A conditional branch to the following instruction (e.g. the delay slot)
+ is asking for a disaster. This can happen when not optimizing and
+@@ -6008,7 +6010,7 @@
+ with an unfilled delay slot. */
+ case 8:
+ /* Handle weird backwards branch with a filled delay slot
+- with is nullified. */
++ which is nullified. */
+ if (dbr_sequence_length () != 0
+ && ! forward_branch_p (insn)
+ && nullify)
+@@ -6055,19 +6057,24 @@
+ }
+ break;
+
+- case 20:
+- case 28:
+- xoperands[0] = operands[0];
+- xoperands[1] = operands[1];
+- xoperands[2] = operands[2];
+- xoperands[3] = operands[3];
+-
++ default:
+ /* The reversed conditional branch must branch over one additional
+- instruction if the delay slot is filled. If the delay slot
+- is empty, the instruction after the reversed condition branch
+- must be nullified. */
+- nullify = dbr_sequence_length () == 0;
+- xoperands[4] = nullify ? GEN_INT (length) : GEN_INT (length + 4);
++ instruction if the delay slot is filled and needs to be extracted
++ by output_lbranch. If the delay slot is empty or this is a
++ nullified forward branch, the instruction after the reversed
++ condition branch must be nullified. */
++ if (dbr_sequence_length () == 0
++ || (nullify && forward_branch_p (insn)))
++ {
++ nullify = 1;
++ xdelay = 0;
++ operands[4] = GEN_INT (length);
++ }
++ else
++ {
++ xdelay = 1;
++ operands[4] = GEN_INT (length + 4);
++ }
+
+ /* Create a reversed conditional branch which branches around
+ the following insns. */
+@@ -6114,27 +6121,38 @@
+ }
+ }
+
+- output_asm_insn (buf, xoperands);
+- return output_lbranch (operands[0], insn);
+-
+- default:
+- gcc_unreachable ();
++ output_asm_insn (buf, operands);
++ return output_lbranch (operands[0], insn, xdelay);
+ }
+ return buf;
+ }
+
+-/* This routine handles long unconditional branches that exceed the
+- maximum range of a simple branch instruction. */
++/* This routine handles output of long unconditional branches that
++ exceed the maximum range of a simple branch instruction. Since
++ we don't have a register available for the branch, we save register
++ %r1 in the frame marker, load the branch destination DEST into %r1,
++ execute the branch, and restore %r1 in the delay slot of the branch.
++
++ Since long branches may have an insn in the delay slot and the
++ delay slot is used to restore %r1, we in general need to extract
++ this insn and execute it before the branch. However, to facilitate
++ use of this function by conditional branches, we also provide an
++ option to not extract the delay insn so that it will be emitted
++ after the long branch. So, if there is an insn in the delay slot,
++ it is extracted if XDELAY is nonzero.
++
++ The lengths of the various long-branch sequences are 20, 16 and 24
++ bytes for the portable runtime, non-PIC and PIC cases, respectively. */
+
+ const char *
+-output_lbranch (rtx dest, rtx insn)
++output_lbranch (rtx dest, rtx insn, int xdelay)
+ {
+ rtx xoperands[2];
+
+ xoperands[0] = dest;
+
+ /* First, free up the delay slot. */
+- if (dbr_sequence_length () != 0)
++ if (xdelay && dbr_sequence_length () != 0)
+ {
+ /* We can't handle a jump in the delay slot. */
+ gcc_assert (GET_CODE (NEXT_INSN (insn)) != JUMP_INSN);
+@@ -6244,11 +6262,13 @@
+ above. it returns the appropriate output template to emit the branch. */
+
+ const char *
+-output_bb (rtx *operands ATTRIBUTE_UNUSED, int nullify, int length,
+- int negated, rtx insn, int which)
++output_bb (rtx *operands ATTRIBUTE_UNUSED, int negated, rtx insn, int which)
+ {
+ static char buf[100];
+ int useskip = 0;
++ int nullify = INSN_ANNULLED_BRANCH_P (insn);
++ int length = get_attr_length (insn);
++ int xdelay;
+
+ /* A conditional branch to the following instruction (e.g. the delay slot) is
+ asking for a disaster. I do not think this can happen as this pattern
+@@ -6315,7 +6335,7 @@
+ with an unfilled delay slot. */
+ case 8:
+ /* Handle weird backwards branch with a filled delay slot
+- with is nullified. */
++ which is nullified. */
+ if (dbr_sequence_length () != 0
+ && ! forward_branch_p (insn)
+ && nullify)
+@@ -6357,9 +6377,10 @@
+ }
+ else
+ {
+- strcpy (buf, "{extrs,|extrw,s,}");
+ if (GET_MODE (operands[0]) == DImode)
+ strcpy (buf, "extrd,s,*");
++ else
++ strcpy (buf, "{extrs,|extrw,s,}");
+ if ((which == 0 && negated)
+ || (which == 1 && ! negated))
+ strcat (buf, "<");
+@@ -6377,7 +6398,40 @@
+ break;
+
+ default:
+- gcc_unreachable ();
++ /* The reversed conditional branch must branch over one additional
++ instruction if the delay slot is filled and needs to be extracted
++ by output_lbranch. If the delay slot is empty or this is a
++ nullified forward branch, the instruction after the reversed
++ condition branch must be nullified. */
++ if (dbr_sequence_length () == 0
++ || (nullify && forward_branch_p (insn)))
++ {
++ nullify = 1;
++ xdelay = 0;
++ operands[4] = GEN_INT (length - 8);
++ }
++ else
++ {
++ xdelay = 1;
++ operands[4] = GEN_INT (length - 4);
++ }
++
++ if (GET_MODE (operands[0]) == DImode)
++ strcpy (buf, "extrd,s,*");
++ else
++ strcpy (buf, "{extrs,|extrw,s,}");
++ if ((which == 0 && negated)
++ || (which == 1 && !negated))
++ strcat (buf, ">= %0,%1,1,%%r0\n\t");
++ else
++ strcat (buf, "< %0,%1,1,%%r0\n\t");
++ if (nullify)
++ strcat (buf, "b,n .+%4");
++ else
++ strcat (buf, "b .+%4");
++ output_asm_insn (buf, operands);
++ return output_lbranch (negated ? operands[3] : operands[2],
++ insn, xdelay);
+ }
+ return buf;
+ }
+@@ -6389,11 +6443,13 @@
+ branch. */
+
+ const char *
+-output_bvb (rtx *operands ATTRIBUTE_UNUSED, int nullify, int length,
+- int negated, rtx insn, int which)
++output_bvb (rtx *operands ATTRIBUTE_UNUSED, int negated, rtx insn, int which)
+ {
+ static char buf[100];
+ int useskip = 0;
++ int nullify = INSN_ANNULLED_BRANCH_P (insn);
++ int length = get_attr_length (insn);
++ int xdelay;
+
+ /* A conditional branch to the following instruction (e.g. the delay slot) is
+ asking for a disaster. I do not think this can happen as this pattern
+@@ -6460,7 +6516,7 @@
+ with an unfilled delay slot. */
+ case 8:
+ /* Handle weird backwards branch with a filled delay slot
+- with is nullified. */
++ which is nullified. */
+ if (dbr_sequence_length () != 0
+ && ! forward_branch_p (insn)
+ && nullify)
+@@ -6522,7 +6578,40 @@
+ break;
+
+ default:
+- gcc_unreachable ();
++ /* The reversed conditional branch must branch over one additional
++ instruction if the delay slot is filled and needs to be extracted
++ by output_lbranch. If the delay slot is empty or this is a
++ nullified forward branch, the instruction after the reversed
++ condition branch must be nullified. */
++ if (dbr_sequence_length () == 0
++ || (nullify && forward_branch_p (insn)))
++ {
++ nullify = 1;
++ xdelay = 0;
++ operands[4] = GEN_INT (length - 8);
++ }
++ else
++ {
++ xdelay = 1;
++ operands[4] = GEN_INT (length - 4);
++ }
++
++ if (GET_MODE (operands[0]) == DImode)
++ strcpy (buf, "extrd,s,*");
++ else
++ strcpy (buf, "{extrs,|extrw,s,}");
++ if ((which == 0 && negated)
++ || (which == 1 && !negated))
++ strcat (buf, ">= {%0,%1,1,%%r0|%0,%%sar,1,%%r0}\n\t");
++ else
++ strcat (buf, "< {%0,%1,1,%%r0|%0,%%sar,1,%%r0}\n\t");
++ if (nullify)
++ strcat (buf, "b,n .+%4");
++ else
++ strcat (buf, "b .+%4");
++ output_asm_insn (buf, operands);
++ return output_lbranch (negated ? operands[3] : operands[2],
++ insn, xdelay);
+ }
+ return buf;
+ }
+@@ -6534,6 +6623,7 @@
+ const char *
+ output_dbra (rtx *operands, rtx insn, int which_alternative)
+ {
++ int length = get_attr_length (insn);
+
+ /* A conditional branch to the following instruction (e.g. the delay slot) is
+ asking for a disaster. Be prepared! */
+@@ -6559,7 +6649,7 @@
+ if (which_alternative == 0)
+ {
+ int nullify = INSN_ANNULLED_BRANCH_P (insn);
+- int length = get_attr_length (insn);
++ int xdelay;
+
+ /* If this is a long branch with its delay slot unfilled, set `nullify'
+ as it can nullify the delay slot and save a nop. */
+@@ -6603,7 +6693,30 @@
+ return "addi,%N2 %1,%0,%0\n\tb %3";
+
+ default:
+- gcc_unreachable ();
++ /* The reversed conditional branch must branch over one additional
++ instruction if the delay slot is filled and needs to be extracted
++ by output_lbranch. If the delay slot is empty or this is a
++ nullified forward branch, the instruction after the reversed
++ condition branch must be nullified. */
++ if (dbr_sequence_length () == 0
++ || (nullify && forward_branch_p (insn)))
++ {
++ nullify = 1;
++ xdelay = 0;
++ operands[4] = GEN_INT (length);
++ }
++ else
++ {
++ xdelay = 1;
++ operands[4] = GEN_INT (length + 4);
++ }
++
++ if (nullify)
++ output_asm_insn ("addib,%N2,n %1,%0,.+%4", operands);
++ else
++ output_asm_insn ("addib,%N2 %1,%0,.+%4", operands);
++
++ return output_lbranch (operands[3], insn, xdelay);
+ }
+
+ }
+@@ -6616,10 +6729,17 @@
+ output_asm_insn ("{fstws|fstw} %0,-16(%%r30)\n\tldw -16(%%r30),%4",
+ operands);
+ output_asm_insn ("ldo %1(%4),%4\n\tstw %4,-16(%%r30)", operands);
+- if (get_attr_length (insn) == 24)
++ if (length == 24)
+ return "{comb|cmpb},%S2 %%r0,%4,%3\n\t{fldws|fldw} -16(%%r30),%0";
+- else
++ else if (length == 28)
+ return "{comclr|cmpclr},%B2 %%r0,%4,%%r0\n\tb %3\n\t{fldws|fldw} -16(%%r30),%0";
++ else
++ {
++ operands[4] = GEN_INT (length - 24);
++ output_asm_insn ("addib,%N2 %1,%0,.+%4", operands);
++ output_asm_insn ("{fldws|fldw} -16(%%r30),%0", operands);
++ return output_lbranch (operands[3], insn, 0);
++ }
+ }
+ /* Deal with gross reload from memory case. */
+ else
+@@ -6627,14 +6747,20 @@
+ /* Reload loop counter from memory, the store back to memory
+ happens in the branch's delay slot. */
+ output_asm_insn ("ldw %0,%4", operands);
+- if (get_attr_length (insn) == 12)
++ if (length == 12)
+ return "addib,%C2 %1,%4,%3\n\tstw %4,%0";
+- else
++ else if (length == 16)
+ return "addi,%N2 %1,%4,%4\n\tb %3\n\tstw %4,%0";
++ else
++ {
++ operands[5] = GEN_INT (length - 12);
++ output_asm_insn ("addib,%N2 %1,%0,.+%5\n\tstw %4,%0", operands);
++ return output_lbranch (operands[3], insn, 0);
++ }
+ }
+ }
+
+-/* Return the output template for emitting a dbra type insn.
++/* Return the output template for emitting a movb type insn.
+
+ Note it may perform some output operations on its own before
+ returning the final output string. */
+@@ -6642,6 +6768,7 @@
+ output_movb (rtx *operands, rtx insn, int which_alternative,
+ int reverse_comparison)
+ {
++ int length = get_attr_length (insn);
+
+ /* A conditional branch to the following instruction (e.g. the delay slot) is
+ asking for a disaster. Be prepared! */
+@@ -6668,7 +6795,7 @@
+ if (which_alternative == 0)
+ {
+ int nullify = INSN_ANNULLED_BRANCH_P (insn);
+- int length = get_attr_length (insn);
++ int xdelay;
+
+ /* If this is a long branch with its delay slot unfilled, set `nullify'
+ as it can nullify the delay slot and save a nop. */
+@@ -6712,38 +6839,80 @@
+ return "or,%N2 %1,%%r0,%0\n\tb %3";
+
+ default:
+- gcc_unreachable ();
++ /* The reversed conditional branch must branch over one additional
++ instruction if the delay slot is filled and needs to be extracted
++ by output_lbranch. If the delay slot is empty or this is a
++ nullified forward branch, the instruction after the reversed
++ condition branch must be nullified. */
++ if (dbr_sequence_length () == 0
++ || (nullify && forward_branch_p (insn)))
++ {
++ nullify = 1;
++ xdelay = 0;
++ operands[4] = GEN_INT (length);
++ }
++ else
++ {
++ xdelay = 1;
++ operands[4] = GEN_INT (length + 4);
++ }
++
++ if (nullify)
++ output_asm_insn ("movb,%N2,n %1,%0,.+%4", operands);
++ else
++ output_asm_insn ("movb,%N2 %1,%0,.+%4", operands);
++
++ return output_lbranch (operands[3], insn, xdelay);
+ }
+ }
+- /* Deal with gross reload from FP register case. */
++ /* Deal with gross reload for FP destination register case. */
+ else if (which_alternative == 1)
+ {
+- /* Move loop counter from FP register to MEM then into a GR,
+- increment the GR, store the GR into MEM, and finally reload
+- the FP register from MEM from within the branch's delay slot. */
++ /* Move source register to MEM, perform the branch test, then
++ finally load the FP register from MEM from within the branch's
++ delay slot. */
+ output_asm_insn ("stw %1,-16(%%r30)", operands);
+- if (get_attr_length (insn) == 12)
++ if (length == 12)
+ return "{comb|cmpb},%S2 %%r0,%1,%3\n\t{fldws|fldw} -16(%%r30),%0";
+- else
++ else if (length == 16)
+ return "{comclr|cmpclr},%B2 %%r0,%1,%%r0\n\tb %3\n\t{fldws|fldw} -16(%%r30),%0";
++ else
++ {
++ operands[4] = GEN_INT (length - 12);
++ output_asm_insn ("movb,%N2 %1,%0,.+%4", operands);
++ output_asm_insn ("{fldws|fldw} -16(%%r30),%0", operands);
++ return output_lbranch (operands[3], insn, 0);
++ }
+ }
+ /* Deal with gross reload from memory case. */
+ else if (which_alternative == 2)
+ {
+ /* Reload loop counter from memory, the store back to memory
+ happens in the branch's delay slot. */
+- if (get_attr_length (insn) == 8)
++ if (length == 8)
+ return "{comb|cmpb},%S2 %%r0,%1,%3\n\tstw %1,%0";
+- else
++ else if (length == 12)
+ return "{comclr|cmpclr},%B2 %%r0,%1,%%r0\n\tb %3\n\tstw %1,%0";
++ else
++ {
++ operands[4] = GEN_INT (length - 8);
++ output_asm_insn ("movb,%N2 %1,%0,.+%4\n\tstw %1,%0", operands);
++ return output_lbranch (operands[3], insn, 0);
++ }
+ }
+ /* Handle SAR as a destination. */
+ else
+ {
+- if (get_attr_length (insn) == 8)
++ if (length == 8)
+ return "{comb|cmpb},%S2 %%r0,%1,%3\n\tmtsar %r1";
+- else
++ else if (length == 12)
+ return "{comclr|cmpclr},%B2 %%r0,%1,%%r0\n\tb %3\n\tmtsar %r1";
++ else
++ {
++ operands[4] = GEN_INT (length - 8);
++ output_asm_insn ("movb,%N2 %1,%0,.+%4\n\tmtsar %r1", operands);
++ return output_lbranch (operands[3], insn, 0);
++ }
+ }
+ }
+
+@@ -8206,37 +8375,50 @@
+ /* Output an unconditional move and branch insn. */
+
+ const char *
+-output_parallel_movb (rtx *operands, int length)
++output_parallel_movb (rtx *operands, rtx insn)
+ {
++ int length = get_attr_length (insn);
++
+ /* These are the cases in which we win. */
+ if (length == 4)
+ return "mov%I1b,tr %1,%0,%2";
+
+- /* None of these cases wins, but they don't lose either. */
+- if (dbr_sequence_length () == 0)
++ /* None of the following cases win, but they don't lose either. */
++ if (length == 8)
+ {
+- /* Nothing in the delay slot, fake it by putting the combined
+- insn (the copy or add) in the delay slot of a bl. */
+- if (GET_CODE (operands[1]) == CONST_INT)
+- return "b %2\n\tldi %1,%0";
++ if (dbr_sequence_length () == 0)
++ {
++ /* Nothing in the delay slot, fake it by putting the combined
++ insn (the copy or add) in the delay slot of a bl. */
++ if (GET_CODE (operands[1]) == CONST_INT)
++ return "b %2\n\tldi %1,%0";
++ else
++ return "b %2\n\tcopy %1,%0";
++ }
+ else
+- return "b %2\n\tcopy %1,%0";
++ {
++ /* Something in the delay slot, but we've got a long branch. */
++ if (GET_CODE (operands[1]) == CONST_INT)
++ return "ldi %1,%0\n\tb %2";
++ else
++ return "copy %1,%0\n\tb %2";
++ }
+ }
++
++ if (GET_CODE (operands[1]) == CONST_INT)
++ output_asm_insn ("ldi %1,%0", operands);
+ else
+- {
+- /* Something in the delay slot, but we've got a long branch. */
+- if (GET_CODE (operands[1]) == CONST_INT)
+- return "ldi %1,%0\n\tb %2";
+- else
+- return "copy %1,%0\n\tb %2";
+- }
++ output_asm_insn ("copy %1,%0", operands);
++ return output_lbranch (operands[2], insn, 1);
+ }
+
+ /* Output an unconditional add and branch insn. */
+
+ const char *
+-output_parallel_addb (rtx *operands, int length)
++output_parallel_addb (rtx *operands, rtx insn)
+ {
++ int length = get_attr_length (insn);
++
+ /* To make life easy we want operand0 to be the shared input/output
+ operand and operand1 to be the readonly operand. */
+ if (operands[0] == operands[1])
+@@ -8246,18 +8428,20 @@
+ if (length == 4)
+ return "add%I1b,tr %1,%0,%3";
+
+- /* None of these cases win, but they don't lose either. */
+- if (dbr_sequence_length () == 0)
+- {
+- /* Nothing in the delay slot, fake it by putting the combined
+- insn (the copy or add) in the delay slot of a bl. */
+- return "b %3\n\tadd%I1 %1,%0,%0";
+- }
+- else
++ /* None of the following cases win, but they don't lose either. */
++ if (length == 8)
+ {
+- /* Something in the delay slot, but we've got a long branch. */
+- return "add%I1 %1,%0,%0\n\tb %3";
++ if (dbr_sequence_length () == 0)
++ /* Nothing in the delay slot, fake it by putting the combined
++ insn (the copy or add) in the delay slot of a bl. */
++ return "b %3\n\tadd%I1 %1,%0,%0";
++ else
++ /* Something in the delay slot, but we've got a long branch. */
++ return "add%I1 %1,%0,%0\n\tb %3";
+ }
++
++ output_asm_insn ("add%I1 %1,%0,%0", operands);
++ return output_lbranch (operands[3], insn, 1);
+ }
+
+ /* Return nonzero if INSN (a jump insn) immediately follows a call
+--- gcc/config/pa/pa.md.orig 2006-02-15 03:54:08.000000000 +0100
++++ gcc/config/pa/pa.md 2006-04-19 11:15:44.899380216 +0200
+@@ -139,7 +139,7 @@
+ (define_delay (eq_attr "type" "btable_branch,branch,parallel_branch")
+ [(eq_attr "in_branch_delay" "true") (nil) (nil)])
+
+-;; Floating point conditional branch delay slot description and
++;; Floating point conditional branch delay slot description.
+ (define_delay (eq_attr "type" "fbranch")
+ [(eq_attr "in_branch_delay" "true")
+ (eq_attr "in_nullified_branch_delay" "true")
+@@ -1708,8 +1708,7 @@
+ ""
+ "*
+ {
+- return output_cbranch (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 0, insn);
++ return output_cbranch (operands, 0, insn);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+@@ -1719,6 +1718,8 @@
+ (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+ (const_int 262100))
+ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 24)
+ (eq (symbol_ref "flag_pic") (const_int 0))
+ (const_int 20)]
+ (const_int 28)))])
+@@ -1736,8 +1737,7 @@
+ ""
+ "*
+ {
+- return output_cbranch (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 1, insn);
++ return output_cbranch (operands, 1, insn);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+@@ -1747,6 +1747,8 @@
+ (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+ (const_int 262100))
+ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 24)
+ (eq (symbol_ref "flag_pic") (const_int 0))
+ (const_int 20)]
+ (const_int 28)))])
+@@ -1762,8 +1764,7 @@
+ "TARGET_64BIT"
+ "*
+ {
+- return output_cbranch (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 0, insn);
++ return output_cbranch (operands, 0, insn);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+@@ -1773,6 +1774,8 @@
+ (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+ (const_int 262100))
+ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 24)
+ (eq (symbol_ref "flag_pic") (const_int 0))
+ (const_int 20)]
+ (const_int 28)))])
+@@ -1790,8 +1793,7 @@
+ "TARGET_64BIT"
+ "*
+ {
+- return output_cbranch (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 1, insn);
++ return output_cbranch (operands, 1, insn);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+@@ -1801,6 +1803,8 @@
+ (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+ (const_int 262100))
+ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 24)
+ (eq (symbol_ref "flag_pic") (const_int 0))
+ (const_int 20)]
+ (const_int 28)))])
+@@ -1815,8 +1819,7 @@
+ "TARGET_64BIT"
+ "*
+ {
+- return output_cbranch (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 0, insn);
++ return output_cbranch (operands, 0, insn);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+@@ -1826,6 +1829,8 @@
+ (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+ (const_int 262100))
+ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 24)
+ (eq (symbol_ref "flag_pic") (const_int 0))
+ (const_int 20)]
+ (const_int 28)))])
+@@ -1843,8 +1848,7 @@
+ "TARGET_64BIT"
+ "*
+ {
+- return output_cbranch (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 1, insn);
++ return output_cbranch (operands, 1, insn);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+@@ -1854,6 +1858,8 @@
+ (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+ (const_int 262100))
+ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 24)
+ (eq (symbol_ref "flag_pic") (const_int 0))
+ (const_int 20)]
+ (const_int 28)))])
+@@ -1871,15 +1877,21 @@
+ ""
+ "*
+ {
+- return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 0, insn, 0);
++ return output_bb (operands, 0, insn, 0);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ (define_insn ""
+ [(set (pc)
+@@ -1893,15 +1905,21 @@
+ "TARGET_64BIT"
+ "*
+ {
+- return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 0, insn, 0);
++ return output_bb (operands, 0, insn, 0);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ (define_insn ""
+ [(set (pc)
+@@ -1915,15 +1933,21 @@
+ ""
+ "*
+ {
+- return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 1, insn, 0);
++ return output_bb (operands, 1, insn, 0);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ (define_insn ""
+ [(set (pc)
+@@ -1937,15 +1961,21 @@
+ "TARGET_64BIT"
+ "*
+ {
+- return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 1, insn, 0);
++ return output_bb (operands, 1, insn, 0);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ (define_insn ""
+ [(set (pc)
+@@ -1959,15 +1989,21 @@
+ ""
+ "*
+ {
+- return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 0, insn, 1);
++ return output_bb (operands, 0, insn, 1);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ (define_insn ""
+ [(set (pc)
+@@ -1981,15 +2017,21 @@
+ "TARGET_64BIT"
+ "*
+ {
+- return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 0, insn, 1);
++ return output_bb (operands, 0, insn, 1);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ (define_insn ""
+ [(set (pc)
+@@ -2003,15 +2045,21 @@
+ ""
+ "*
+ {
+- return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 1, insn, 1);
++ return output_bb (operands, 1, insn, 1);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ (define_insn ""
+ [(set (pc)
+@@ -2025,15 +2073,21 @@
+ "TARGET_64BIT"
+ "*
+ {
+- return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 1, insn, 1);
++ return output_bb (operands, 1, insn, 1);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ ;; Branch on Variable Bit patterns.
+ (define_insn ""
+@@ -2048,15 +2102,21 @@
+ ""
+ "*
+ {
+- return output_bvb (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 0, insn, 0);
++ return output_bvb (operands, 0, insn, 0);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ (define_insn ""
+ [(set (pc)
+@@ -2070,15 +2130,21 @@
+ "TARGET_64BIT"
+ "*
+ {
+- return output_bvb (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 0, insn, 0);
++ return output_bvb (operands, 0, insn, 0);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ (define_insn ""
+ [(set (pc)
+@@ -2092,15 +2158,21 @@
+ ""
+ "*
+ {
+- return output_bvb (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 1, insn, 0);
++ return output_bvb (operands, 1, insn, 0);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ (define_insn ""
+ [(set (pc)
+@@ -2114,15 +2186,21 @@
+ "TARGET_64BIT"
+ "*
+ {
+- return output_bvb (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 1, insn, 0);
++ return output_bvb (operands, 1, insn, 0);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ (define_insn ""
+ [(set (pc)
+@@ -2136,15 +2214,21 @@
+ ""
+ "*
+ {
+- return output_bvb (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 0, insn, 1);
++ return output_bvb (operands, 0, insn, 1);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ (define_insn ""
+ [(set (pc)
+@@ -2158,15 +2242,21 @@
+ "TARGET_64BIT"
+ "*
+ {
+- return output_bvb (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 0, insn, 1);
++ return output_bvb (operands, 0, insn, 1);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ (define_insn ""
+ [(set (pc)
+@@ -2180,15 +2270,21 @@
+ ""
+ "*
+ {
+- return output_bvb (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 1, insn, 1);
++ return output_bvb (operands, 1, insn, 1);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ (define_insn ""
+ [(set (pc)
+@@ -2202,46 +2298,114 @@
+ "TARGET_64BIT"
+ "*
+ {
+- return output_bvb (operands, INSN_ANNULLED_BRANCH_P (insn),
+- get_attr_length (insn), 1, insn, 1);
++ return output_bvb (operands, 1, insn, 1);
+ }"
+ [(set_attr "type" "cbranch")
+ (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++ (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ ;; Floating point branches
++
++;; ??? Nullification is handled differently from other branches.
++;; If nullification is specified, the delay slot is nullified on any
++;; taken branch regardless of branch direction.
+ (define_insn ""
+ [(set (pc) (if_then_else (ne (reg:CCFP 0) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+- "! TARGET_SOFT_FLOAT"
++ "!TARGET_SOFT_FLOAT"
+ "*
+ {
+- if (INSN_ANNULLED_BRANCH_P (insn))
+- return \"ftest\;b,n %0\";
++ int length = get_attr_length (insn);
++ rtx xoperands[1];
++ int nullify, xdelay;
++
++ if (length < 16)
++ return \"ftest\;b%* %l0\";
++
++ if (dbr_sequence_length () == 0 || INSN_ANNULLED_BRANCH_P (insn))
++ {
++ nullify = 1;
++ xdelay = 0;
++ xoperands[0] = GEN_INT (length - 8);
++ }
++ else
++ {
++ nullify = 0;
++ xdelay = 1;
++ xoperands[0] = GEN_INT (length - 4);
++ }
++
++ if (nullify)
++ output_asm_insn (\"ftest\;add,tr %%r0,%%r0,%%r0\;b,n .+%0\", xoperands);
+ else
+- return \"ftest\;b%* %0\";
++ output_asm_insn (\"ftest\;add,tr %%r0,%%r0,%%r0\;b .+%0\", xoperands);
++ return output_lbranch (operands[0], insn, xdelay);
+ }"
+- [(set_attr "type" "fbranch")
+- (set_attr "length" "8")])
++[(set_attr "type" "fbranch")
++ (set (attr "length")
++ (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 32)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 28)]
++ (const_int 36)))])
+
+ (define_insn ""
+ [(set (pc) (if_then_else (ne (reg:CCFP 0) (const_int 0))
+ (pc)
+ (label_ref (match_operand 0 "" ""))))]
+- "! TARGET_SOFT_FLOAT"
++ "!TARGET_SOFT_FLOAT"
+ "*
+ {
+- if (INSN_ANNULLED_BRANCH_P (insn))
+- return \"ftest\;add,tr %%r0,%%r0,%%r0\;b,n %0\";
+- else
++ int length = get_attr_length (insn);
++ rtx xoperands[1];
++ int nullify, xdelay;
++
++ if (length < 16)
+ return \"ftest\;add,tr %%r0,%%r0,%%r0\;b%* %0\";
++
++ if (dbr_sequence_length () == 0 || INSN_ANNULLED_BRANCH_P (insn))
++ {
++ nullify = 1;
++ xdelay = 0;
++ xoperands[0] = GEN_INT (length - 4);
++ }
++ else
++ {
++ nullify = 0;
++ xdelay = 1;
++ xoperands[0] = GEN_INT (length);
++ }
++
++ if (nullify)
++ output_asm_insn (\"ftest\;b,n .+%0\", xoperands);
++ else
++ output_asm_insn (\"ftest\;b .+%0\", xoperands);
++ return output_lbranch (operands[0], insn, xdelay);
+ }"
+- [(set_attr "type" "fbranch")
+- (set_attr "length" "12")])
++[(set_attr "type" "fbranch")
++ (set (attr "length")
++ (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 12)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))])
+
+ ;; Move instructions
+
+@@ -6967,11 +7131,10 @@
+ "*
+ {
+ /* An unconditional branch which can reach its target. */
+- if (get_attr_length (insn) != 24
+- && get_attr_length (insn) != 16)
++ if (get_attr_length (insn) < 16)
+ return \"b%* %l0\";
+
+- return output_lbranch (operands[0], insn);
++ return output_lbranch (operands[0], insn, 1);
+ }"
+ [(set_attr "type" "uncond_branch")
+ (set_attr "pa_combine_type" "uncond_branch")
+@@ -6980,14 +7143,16 @@
+ (if_then_else (lt (abs (minus (match_dup 0)
+ (plus (pc) (const_int 8))))
+ (const_int 8184))
+- (const_int 4)
+- (const_int 8))
+- (ge (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
++ (const_int 4)
++ (const_int 8))
++ (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
+ (const_int 262100))
+- (if_then_else (eq (symbol_ref "flag_pic") (const_int 0))
+- (const_int 16)
+- (const_int 24))]
+- (const_int 4)))])
++ (const_int 4)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 20)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 16)]
++ (const_int 24)))])
+
+ ;;; Hope this is only within a function...
+ (define_insn "indirect_jump"
+@@ -8801,39 +8966,71 @@
+ (if_then_else (eq_attr "alternative" "0")
+ ;; Loop counter in register case
+ ;; Short branch has length of 4
+-;; Long branch has length of 8
+- (if_then_else (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8))
++;; 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 4)
++ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 24)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 20)]
++ (const_int 28))
+
+ ;; Loop counter in FP reg case.
+ ;; Extra goo to deal with additional reload insns.
+ (if_then_else (eq_attr "alternative" "1")
+ (if_then_else (lt (match_dup 3) (pc))
+- (if_then_else
+- (lt (abs (minus (match_dup 3) (plus (pc) (const_int 24))))
+- (const_int 8184))
+- (const_int 24)
+- (const_int 28))
+- (if_then_else
+- (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 24)
+- (const_int 28)))
++ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 24))))
++ (const_int 8184))
++ (const_int 24)
++ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 24))))
++ (const_int 262100))
++ (const_int 28)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 44)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 40)]
++ (const_int 48))
++ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 24)
++ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 28)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 44)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 40)]
++ (const_int 48)))
++
+ ;; Loop counter in memory case.
+ ;; Extra goo to deal with additional reload insns.
+ (if_then_else (lt (match_dup 3) (pc))
+- (if_then_else
+- (lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
+- (const_int 8184))
+- (const_int 12)
+- (const_int 16))
+- (if_then_else
+- (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 12)
+- (const_int 16))))))])
++ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
++ (const_int 8184))
++ (const_int 12)
++ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
++ (const_int 262100))
++ (const_int 16)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 32)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 28)]
++ (const_int 36))
++ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 12)
++ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 16)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 32)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 28)]
++ (const_int 36))))))])
+
+ (define_insn ""
+ [(set (pc)
+@@ -8852,33 +9049,59 @@
+ (if_then_else (eq_attr "alternative" "0")
+ ;; Loop counter in register case
+ ;; Short branch has length of 4
+-;; Long branch has length of 8
+- (if_then_else (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8))
++;; 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 4)
++ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 24)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 20)]
++ (const_int 28))
+
+ ;; Loop counter in FP reg case.
+ ;; Extra goo to deal with additional reload insns.
+ (if_then_else (eq_attr "alternative" "1")
+ (if_then_else (lt (match_dup 3) (pc))
+- (if_then_else
+- (lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
+- (const_int 8184))
+- (const_int 12)
+- (const_int 16))
+- (if_then_else
+- (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 12)
+- (const_int 16)))
++ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
++ (const_int 8184))
++ (const_int 12)
++ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
++ (const_int 262100))
++ (const_int 16)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 32)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 28)]
++ (const_int 36))
++ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 12)
++ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 16)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 32)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 28)]
++ (const_int 36)))
++
+ ;; Loop counter in memory or sar case.
+ ;; Extra goo to deal with additional reload insns.
+- (if_then_else
+- (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 8)
+- (const_int 12)))))])
++ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 8)
++ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 12)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))))])
+
+ ;; Handle negated branch.
+ (define_insn ""
+@@ -8899,32 +9122,58 @@
+ ;; Loop counter in register case
+ ;; Short branch has length of 4
+ ;; Long branch has length of 8
+- (if_then_else (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8))
++ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 4)
++ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 24)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 20)]
++ (const_int 28))
+
+ ;; Loop counter in FP reg case.
+ ;; Extra goo to deal with additional reload insns.
+ (if_then_else (eq_attr "alternative" "1")
+ (if_then_else (lt (match_dup 3) (pc))
+- (if_then_else
+- (lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
+- (const_int 8184))
+- (const_int 12)
+- (const_int 16))
+- (if_then_else
+- (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 12)
+- (const_int 16)))
++ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
++ (const_int 8184))
++ (const_int 12)
++ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
++ (const_int 262100))
++ (const_int 16)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 32)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 28)]
++ (const_int 36))
++ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 12)
++ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 16)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 32)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 28)]
++ (const_int 36)))
++
+ ;; Loop counter in memory or SAR case.
+ ;; Extra goo to deal with additional reload insns.
+- (if_then_else
+- (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 8)
+- (const_int 12)))))])
++ (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 8184))
++ (const_int 8)
++ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 12)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 28)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 24)]
++ (const_int 32)))))])
+
+ (define_insn ""
+ [(set (pc) (label_ref (match_operand 3 "" "" )))
+@@ -8934,14 +9183,21 @@
+ "(reload_completed && operands[0] == operands[1]) || operands[0] == operands[2]"
+ "*
+ {
+- return output_parallel_addb (operands, get_attr_length (insn));
++ return output_parallel_addb (operands, insn);
+ }"
+- [(set_attr "type" "parallel_branch")
+- (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++[(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 4)
++ (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 24)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 20)]
++ (const_int 28)))])
+
+ (define_insn ""
+ [(set (pc) (label_ref (match_operand 2 "" "" )))
+@@ -8950,14 +9206,21 @@
+ "reload_completed"
+ "*
+ {
+- return output_parallel_movb (operands, get_attr_length (insn));
++ return output_parallel_movb (operands, insn);
+ }"
+- [(set_attr "type" "parallel_branch")
+- (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++[(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 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 24)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 20)]
++ (const_int 28)))])
+
+ (define_insn ""
+ [(set (pc) (label_ref (match_operand 2 "" "" )))
+@@ -8966,14 +9229,21 @@
+ "reload_completed"
+ "*
+ {
+- return output_parallel_movb (operands, get_attr_length (insn));
++ return output_parallel_movb (operands, insn);
+ }"
+- [(set_attr "type" "parallel_branch")
+- (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++[(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 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 24)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 20)]
++ (const_int 28)))])
+
+ (define_insn ""
+ [(set (pc) (label_ref (match_operand 2 "" "" )))
+@@ -8982,14 +9252,21 @@
+ "reload_completed"
+ "*
+ {
+- return output_parallel_movb (operands, get_attr_length (insn));
++ return output_parallel_movb (operands, insn);
+ }"
+- [(set_attr "type" "parallel_branch")
+- (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++[(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 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 24)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 20)]
++ (const_int 28)))])
+
+ (define_insn ""
+ [(set (pc) (label_ref (match_operand 2 "" "" )))
+@@ -8998,14 +9275,21 @@
+ "reload_completed"
+ "*
+ {
+- return output_parallel_movb (operands, get_attr_length (insn));
++ return output_parallel_movb (operands, insn);
+ }"
+- [(set_attr "type" "parallel_branch")
+- (set (attr "length")
+- (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
+- (const_int 8184))
+- (const_int 4)
+- (const_int 8)))])
++[(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 4)
++ (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
++ (const_int 262100))
++ (const_int 8)
++ (ne (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0))
++ (const_int 24)
++ (eq (symbol_ref "flag_pic") (const_int 0))
++ (const_int 20)]
++ (const_int 28)))])
+
+ (define_insn ""
+ [(set (match_operand 0 "register_operand" "=f")
+--- gcc/config/pa/pa-protos.h.orig 2005-10-24 04:38:25.000000000 +0200
++++ gcc/config/pa/pa-protos.h 2006-04-19 11:15:44.899380216 +0200
+@@ -42,14 +42,14 @@
+ extern const char *output_fp_move_double (rtx *);
+ extern const char *output_block_move (rtx *, int);
+ extern const char *output_block_clear (rtx *, int);
+-extern const char *output_cbranch (rtx *, int, int, int, rtx);
+-extern const char *output_lbranch (rtx, rtx);
+-extern const char *output_bb (rtx *, int, int, int, rtx, int);
+-extern const char *output_bvb (rtx *, int, int, int, rtx, int);
++extern const char *output_cbranch (rtx *, int, rtx);
++extern const char *output_lbranch (rtx, rtx, int);
++extern const char *output_bb (rtx *, int, rtx, int);
++extern const char *output_bvb (rtx *, int, rtx, int);
+ extern const char *output_dbra (rtx *, rtx, int);
+ extern const char *output_movb (rtx *, rtx, int, int);
+-extern const char *output_parallel_movb (rtx *, int);
+-extern const char *output_parallel_addb (rtx *, int);
++extern const char *output_parallel_movb (rtx *, rtx);
++extern const char *output_parallel_addb (rtx *, rtx);
+ extern const char *output_call (rtx, rtx, int);
+ extern const char *output_indirect_call (rtx, rtx);
+ extern const char *output_millicode_call (rtx, rtx);
--- gcc-4.1-4.1.2.orig/debian/patches/libjava-soname.dpatch
+++ gcc-4.1-4.1.2/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.2.orig/debian/patches/libstdc++-baseline.dpatch
+++ gcc-4.1-4.1.2/debian/patches/libstdc++-baseline.dpatch
@@ -0,0 +1,42 @@
+#! /bin/sh -e
+
+# DP: overwrite baseline detection for i386: use the i486 headers
+
+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
+
+--- libstdc++-v3/configure.target~ 2003-06-19 19:55:35.000000000 +0200
++++ libstdc++-v3/configure.target 2003-06-20 09:15:08.000000000 +0200
+@@ -91,6 +91,14 @@
+ ;;
+ esac
+
++# Debian adjustments
++echo "LIBSTDCXX TARGET CPU: $target_cpu"
++case "${target_cpu}" in
++ i386)
++ # we use the i486 ABI ...
++ try_cpu=i486
++ ;;
++esac
+
+ # Now look for the file(s) usually tied to a CPU model, and make
+ # default choices for those if they haven't been explicitly set
--- gcc-4.1-4.1.2.orig/debian/patches/alpha-ieee.dpatch
+++ gcc-4.1-4.1.2/debian/patches/alpha-ieee.dpatch
@@ -0,0 +1,57 @@
+#! /bin/sh -e
+
+# DP: #212912
+# DP: on alpha-linux, make -mieee default and add -mieee-disable switch
+# DP: to turn default off
+
+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
+
+
+--- src/gcc/config/alpha/alpha.c~ 2005-06-04 21:25:45.000000000 +0200
++++ src/gcc/config/alpha/alpha.c 2005-09-30 22:21:33.251175568 +0200
+@@ -248,6 +248,10 @@
+ { 0, 0, 0 }
+ };
+
++ /* If not -ffinite-math-only, enable -mieee*/
++ if (!flag_finite_math_only)
++ target_flags |= MASK_IEEE|MASK_IEEE_CONFORMANT;
++
+ /* Unicos/Mk doesn't have shared libraries. */
+ if (TARGET_ABI_UNICOSMK && flag_pic)
+ {
+#--- src/gcc/doc/invoke.texi~ 2005-09-29 20:00:57.638380128 +0200
+#+++ src/gcc/doc/invoke.texi 2005-09-30 22:23:22.922502992 +0200
+#@@ -7670,6 +7670,13 @@
+# values such as not-a-number and plus/minus infinity. Other Alpha
+# compilers call this option @option{-ieee_with_no_inexact}.
+#
+#+DEBIAN SPECIFIC: This option is on by default, unless
+#+@option{-ffinite-math-only} (which is part of the @option{-ffast-math}
+#+set) is specified, because the software functions in the GNU libc math
+#+libraries generate denormalized numbers, NaNs, and infs (all of which
+#+will cause a programs to SIGFPE when it attempts to use the results without
+#+@option{-mieee}).
+#+
+# @item -mieee-with-inexact
+# @opindex mieee-with-inexact
+# This is like @option{-mieee} except the generated code also maintains
--- gcc-4.1-4.1.2.orig/debian/patches/ada-gcc-name.dpatch
+++ gcc-4.1-4.1.2/debian/patches/ada-gcc-name.dpatch
@@ -0,0 +1,106 @@
+#! /bin/sh -e
+
+# DP: use gcc-4.1 instead of gcc as the command 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
+
+diff -ur gcc/ada.old/ali.adb gcc/ada/ali.adb
+--- gcc/ada.old/ali.adb 2004-02-21 15:23:32.000000000 +0100
++++ gcc/ada/ali.adb 2004-02-21 15:23:57.000000000 +0100
+@@ -260,7 +260,7 @@
+ Write_Str (" is incorrectly formatted");
+ Write_Eol;
+ Write_Str
+- ("make sure you are using consistent versions of gcc/gnatbind");
++ ("make sure you are using consistent versions of gcc-4.1/gnatbind");
+ Write_Eol;
+
+ -- Find start of line
+diff -ur gcc/ada.old/comperr.adb gcc/ada/comperr.adb
+--- gcc/ada.old/comperr.adb 2004-02-21 15:23:32.000000000 +0100
++++ gcc/ada/comperr.adb 2004-02-21 15:23:57.000000000 +0100
+@@ -292,7 +292,7 @@
+ End_Line;
+
+ Write_Str
+- ("| Include the exact gcc or gnatmake command " &
++ ("| Include the exact gcc-4.1 or gnatmake command " &
+ "that you entered.");
+ End_Line;
+
+diff -ur gcc/ada.old/gnatlink.adb gcc/ada/gnatlink.adb
+--- gcc/ada.old/gnatlink.adb 2004-02-21 15:23:32.000000000 +0100
++++ gcc/ada/gnatlink.adb 2004-02-21 15:23:57.000000000 +0100
+@@ -123,7 +123,7 @@
+
+ subtype chars_ptr is System.Address;
+
+- Gcc : String_Access := Program_Name ("gcc");
++ Gcc : String_Access := Program_Name ("gcc-4.1");
+
+ Read_Mode : constant String := "r" & ASCII.Nul;
+
+@@ -1287,7 +1287,8 @@
+ Write_Line (" -b target Compile the binder source to run on target");
+ Write_Line (" -Bdir Load compiler executables from dir");
+ Write_Line (" --GCC=comp Use comp as the compiler");
+- Write_Line (" --LINK=nam Use 'nam' for the linking rather than 'gcc'");
++ Write_Line (" --LINK=nam Use 'nam' for the linking rather " &
++ "than 'gcc-4.1'");
+ Write_Eol;
+ Write_Line (" [non-Ada-objects] list of non Ada object files");
+ Write_Line (" [linker-options] other options for the linker");
+diff -ur gcc/ada.old/make.adb gcc/ada/make.adb
+--- gcc/ada.old/make.adb 2004-02-21 15:23:32.000000000 +0100
++++ gcc/ada/make.adb 2004-02-21 15:23:57.000000000 +0100
+@@ -650,7 +650,7 @@
+ -- Compiler, Binder & Linker Data and Subprograms --
+ ----------------------------------------------------
+
+- Gcc : String_Access := Program_Name ("gcc");
++ Gcc : String_Access := Program_Name ("gcc-4.1");
+ Gnatbind : String_Access := Program_Name ("gnatbind");
+ Gnatlink : String_Access := Program_Name ("gnatlink");
+ -- Default compiler, binder, linker programs
+diff -ur gcc/ada.old/par-ch10.adb gcc/ada/par-ch10.adb
+--- gcc/ada.old/par-ch10.adb 2004-02-21 15:23:32.000000000 +0100
++++ gcc/ada/par-ch10.adb 2004-02-21 15:23:57.000000000 +0100
+@@ -224,7 +224,7 @@
+ else
+ Item := First (Config_Pragmas);
+ Error_Msg_N
+- ("cannot compile configuration pragmas with gcc", Item);
++ ("cannot compile configuration pragmas with gcc-4.1", Item);
+ Error_Msg_N
+ ("use gnatchop -c to process configuration pragmas!", Item);
+ raise Unrecoverable_Error;
+--- gcc/ada/gnatchop.adb~ 2004-01-05 16:20:44.000000000 +0100
++++ gcc/ada/gnatchop.adb 2004-04-25 09:33:51.000000000 +0200
+@@ -43,7 +43,7 @@
+ Config_File_Name : constant String_Access := new String'("gnat.adc");
+ -- The name of the file holding the GNAT configuration pragmas
+
+- Gcc : String_Access := new String'("gcc");
++ Gcc : String_Access := new String'("gcc-4.1");
+ -- May be modified by switch --GCC=
+
+ Gcc_Set : Boolean := False;
--- gcc-4.1-4.1.2.orig/debian/patches/libjava-subdir.dpatch
+++ gcc-4.1-4.1.2/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.2.orig/debian/patches/arm-libffi.dpatch
+++ gcc-4.1-4.1.2/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.2.orig/debian/patches/gcc-4.1-x86-blended.dpatch
+++ gcc-4.1-4.1.2/debian/patches/gcc-4.1-x86-blended.dpatch
@@ -0,0 +1,2099 @@
+#! /bin/sh -e
+
+# DP: Backport x86 "generic" patches 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
+ #rm ${dir}gcc/configure
+ ;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+gcc/
+
+2006-01-19 Jan Hubicka
+ H.J. Lu
+ Evandro Menezes
+
+ * invoke.texi (generic): Document
+ (i686) Update.
+ * config.gcc: Make x86_64-* and i686-* default to generic tunning.
+ * i386.h (TARGET_GENERIC32, TARGET_GENERIC64, TARGET_GENERIC,
+ TARGET_USE_INCDEC, TARGET_PAD_RETURNS): New macros.
+ (x86_use_incdec, x86_pad_returns): New variables
+ (TARGET_CPU_DEFAULT_generic): New constant
+ (TARGET_CPU_DEFAULT_NAMES): Add generic.
+ (enum processor_type): Add generic32 and generic64.
+ * i386.md (cpu attribute): Add generic32/generic64
+ (movhi splitter): Behave sanely when both partial_reg_dependency and
+ partial_reg_stall are set.
+ (K8 splitters): Enable for generic as well.
+ * predicates.md (incdec_operand): Use TARGET_INCDEC
+ (aligned_operand): Avoid memory mismatch stalls.
+ * athlon.md: Enable for generic64, new patterns for 128bit moves.
+ * ppro.md: Enable for generic32
+ * i386.c (generic64_cost, generic32_cost): New.
+ (m_GENERIC32, m_GENERIC64, m_GENERIC): New macros.
+ (x86_use_leave): Enable for generic64. (x86_use_sahf,
+ x86_ext_80387_constants): Enable for generic32. (x86_push_memory,
+ x86_movx, x86_unroll_strlen, x86_deep_branch, x86_use_simode_fiop,
+ x86_use_cltd, x86_promote_QImode, x86_sub_esp_4, x86_sub_esp_8,
+ x86_add_esp_4, x86_add_esp_8, x86_integer_DFmode_moves,
+ x86_partial_reg_dependency, x86_memory_mismatch_stall,
+ x86_accumulate_outgoing_args, x86_prologue_using_move,
+ x86_epilogue_using_move, x86_arch_always_fancy_math_387,
+ x86_sse_partial_reg_dependency, x86_four_jump_limit, x86_schedule):
+ Enable for generic.
+ (x86_use_incdec, x86_pad_returns): New.
+ (override_options): Add generic32 and generic64, translate "generic"
+ to generic32/generic64 and "i686" to "generic32", refuse
+ "generic32"/"generic64" as arch target.
+ (ix86_issue_rate, ix86_adjust_cost): Handle generic as athlon.
+ (ix86_reorg): Honor PAD_RETURNS.
+
+gcc/testsuite/
+
+2006-01-19 Jan Hubicka
+
+ * gcc.target/i386/lea.c: Test pentiumpro, not i686.
+
+--- gcc/testsuite/gcc.target/i386/lea.c.orig 2006-10-25 18:27:35.000000000 +0200
++++ gcc/testsuite/gcc.target/i386/lea.c 2006-10-25 18:27:49.000000000 +0200
+@@ -1,6 +1,6 @@
+ /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+ /* { dg-require-effective-target ilp32 } */
+-/* { dg-options "-O2 -march=i686" } */
++/* { dg-options "-O2 -march=pentiumpro" } */
+ /* { dg-final { scan-assembler "leal" } } */
+ typedef struct {
+ char **visbuf;
+--- gcc/config/i386/athlon.md.orig 2006-10-25 18:27:35.000000000 +0200
++++ gcc/config/i386/athlon.md 2006-10-25 18:33:18.000000000 +0200
+@@ -123,7 +123,7 @@
+ (define_cpu_unit "athlon-fmul" "athlon_fp")
+ (define_cpu_unit "athlon-fstore" "athlon_fp")
+ (define_reservation "athlon-fany" "(athlon-fstore | athlon-fmul | athlon-fadd)")
+-(define_reservation "athlon-faddmul" "(athlon-fmul | athlon-fadd)")
++(define_reservation "athlon-faddmul" "(athlon-fadd | athlon-fmul)")
+
+ ;; Vector operations usually consume many of pipes.
+ (define_reservation "athlon-fvector" "(athlon-fadd + athlon-fmul + athlon-fstore)")
+@@ -131,26 +131,26 @@
+
+ ;; Jump instructions are executed in the branch unit completely transparent to us
+ (define_insn_reservation "athlon_branch" 0
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (eq_attr "type" "ibr"))
+ "athlon-direct,athlon-ieu")
+ (define_insn_reservation "athlon_call" 0
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (eq_attr "type" "call,callv"))
+ "athlon-vector,athlon-ieu")
+
+ ;; Latency of push operation is 3 cycles, but ESP value is available
+ ;; earlier
+ (define_insn_reservation "athlon_push" 2
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (eq_attr "type" "push"))
+ "athlon-direct,athlon-agu,athlon-store")
+ (define_insn_reservation "athlon_pop" 4
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (eq_attr "type" "pop"))
+ "athlon-vector,athlon-load,athlon-ieu")
+ (define_insn_reservation "athlon_pop_k8" 3
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (eq_attr "type" "pop"))
+ "athlon-double,(athlon-ieu+athlon-load)")
+ (define_insn_reservation "athlon_leave" 3
+@@ -158,13 +158,13 @@
+ (eq_attr "type" "leave"))
+ "athlon-vector,(athlon-ieu+athlon-load)")
+ (define_insn_reservation "athlon_leave_k8" 3
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (eq_attr "type" "leave"))
+ "athlon-double,(athlon-ieu+athlon-load)")
+
+ ;; Lea executes in AGU unit with 2 cycles latency.
+ (define_insn_reservation "athlon_lea" 2
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (eq_attr "type" "lea"))
+ "athlon-direct,athlon-agu,nothing")
+
+@@ -176,13 +176,13 @@
+ "athlon-vector,athlon-ieu0,athlon-mult,nothing,nothing,athlon-ieu0")
+ ;; ??? Widening multiply is vector or double.
+ (define_insn_reservation "athlon_imul_k8_DI" 4
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (and (eq_attr "type" "imul")
+ (and (eq_attr "mode" "DI")
+ (eq_attr "memory" "none,unknown"))))
+ "athlon-direct0,athlon-ieu0,athlon-mult,nothing,athlon-ieu0")
+ (define_insn_reservation "athlon_imul_k8" 3
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (and (eq_attr "type" "imul")
+ (eq_attr "memory" "none,unknown")))
+ "athlon-direct0,athlon-ieu0,athlon-mult,athlon-ieu0")
+@@ -192,13 +192,13 @@
+ (eq_attr "memory" "load,both")))
+ "athlon-vector,athlon-load,athlon-ieu,athlon-mult,nothing,nothing,athlon-ieu")
+ (define_insn_reservation "athlon_imul_mem_k8_DI" 7
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (and (eq_attr "type" "imul")
+ (and (eq_attr "mode" "DI")
+ (eq_attr "memory" "load,both"))))
+ "athlon-vector,athlon-load,athlon-ieu,athlon-mult,nothing,athlon-ieu")
+ (define_insn_reservation "athlon_imul_mem_k8" 6
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (and (eq_attr "type" "imul")
+ (eq_attr "memory" "load,both")))
+ "athlon-vector,athlon-load,athlon-ieu,athlon-mult,athlon-ieu")
+@@ -211,59 +211,59 @@
+ ;; of the other code
+
+ (define_insn_reservation "athlon_idiv" 6
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (and (eq_attr "type" "idiv")
+ (eq_attr "memory" "none,unknown")))
+ "athlon-vector,(athlon-ieu0*6+(athlon-fpsched,athlon-fvector))")
+ (define_insn_reservation "athlon_idiv_mem" 9
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (and (eq_attr "type" "idiv")
+ (eq_attr "memory" "load,both")))
+ "athlon-vector,((athlon-load,athlon-ieu0*6)+(athlon-fpsched,athlon-fvector))")
+ ;; The parallelism of string instructions is not documented. Model it same way
+ ;; as idiv to create smaller automata. This probably does not matter much.
+ (define_insn_reservation "athlon_str" 6
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (and (eq_attr "type" "str")
+ (eq_attr "memory" "load,both,store")))
+ "athlon-vector,athlon-load,athlon-ieu0*6")
+
+ (define_insn_reservation "athlon_idirect" 1
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (and (eq_attr "athlon_decode" "direct")
+ (and (eq_attr "unit" "integer,unknown")
+ (eq_attr "memory" "none,unknown"))))
+ "athlon-direct,athlon-ieu")
+ (define_insn_reservation "athlon_ivector" 2
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (and (eq_attr "athlon_decode" "vector")
+ (and (eq_attr "unit" "integer,unknown")
+ (eq_attr "memory" "none,unknown"))))
+ "athlon-vector,athlon-ieu,athlon-ieu")
+ (define_insn_reservation "athlon_idirect_loadmov" 3
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (and (eq_attr "type" "imov")
+ (eq_attr "memory" "load")))
+ "athlon-direct,athlon-load")
+ (define_insn_reservation "athlon_idirect_load" 4
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (and (eq_attr "athlon_decode" "direct")
+ (and (eq_attr "unit" "integer,unknown")
+ (eq_attr "memory" "load"))))
+ "athlon-direct,athlon-load,athlon-ieu")
+ (define_insn_reservation "athlon_ivector_load" 6
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (and (eq_attr "athlon_decode" "vector")
+ (and (eq_attr "unit" "integer,unknown")
+ (eq_attr "memory" "load"))))
+ "athlon-vector,athlon-load,athlon-ieu,athlon-ieu")
+ (define_insn_reservation "athlon_idirect_movstore" 1
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (and (eq_attr "type" "imov")
+ (eq_attr "memory" "store")))
+ "athlon-direct,athlon-agu,athlon-store")
+ (define_insn_reservation "athlon_idirect_both" 4
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (and (eq_attr "athlon_decode" "direct")
+ (and (eq_attr "unit" "integer,unknown")
+ (eq_attr "memory" "both"))))
+@@ -271,7 +271,7 @@
+ athlon-ieu,athlon-store,
+ athlon-store")
+ (define_insn_reservation "athlon_ivector_both" 6
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (and (eq_attr "athlon_decode" "vector")
+ (and (eq_attr "unit" "integer,unknown")
+ (eq_attr "memory" "both"))))
+@@ -280,14 +280,14 @@
+ athlon-ieu,
+ athlon-store")
+ (define_insn_reservation "athlon_idirect_store" 1
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (and (eq_attr "athlon_decode" "direct")
+ (and (eq_attr "unit" "integer,unknown")
+ (eq_attr "memory" "store"))))
+ "athlon-direct,(athlon-ieu+athlon-agu),
+ athlon-store")
+ (define_insn_reservation "athlon_ivector_store" 2
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (and (eq_attr "athlon_decode" "vector")
+ (and (eq_attr "unit" "integer,unknown")
+ (eq_attr "memory" "store"))))
+@@ -302,7 +302,7 @@
+ (eq_attr "mode" "XF"))))
+ "athlon-vector,athlon-fpload2,athlon-fvector*9")
+ (define_insn_reservation "athlon_fldxf_k8" 13
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (and (eq_attr "type" "fmov")
+ (and (eq_attr "memory" "load")
+ (eq_attr "mode" "XF"))))
+@@ -314,7 +314,7 @@
+ (eq_attr "memory" "load")))
+ "athlon-direct,athlon-fpload,athlon-fany")
+ (define_insn_reservation "athlon_fld_k8" 2
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (and (eq_attr "type" "fmov")
+ (eq_attr "memory" "load")))
+ "athlon-direct,athlon-fploadk8,athlon-fstore")
+@@ -326,7 +326,7 @@
+ (eq_attr "mode" "XF"))))
+ "athlon-vector,(athlon-fpsched+athlon-agu),(athlon-store2+(athlon-fvector*7))")
+ (define_insn_reservation "athlon_fstxf_k8" 8
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (and (eq_attr "type" "fmov")
+ (and (eq_attr "memory" "store,both")
+ (eq_attr "mode" "XF"))))
+@@ -337,16 +337,16 @@
+ (eq_attr "memory" "store,both")))
+ "athlon-direct,(athlon-fpsched+athlon-agu),(athlon-fstore+athlon-store)")
+ (define_insn_reservation "athlon_fst_k8" 2
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (and (eq_attr "type" "fmov")
+ (eq_attr "memory" "store,both")))
+ "athlon-direct,(athlon-fpsched+athlon-agu),(athlon-fstore+athlon-store)")
+ (define_insn_reservation "athlon_fist" 4
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (eq_attr "type" "fistp,fisttp"))
+ "athlon-direct,(athlon-fpsched+athlon-agu),(athlon-fstore+athlon-store)")
+ (define_insn_reservation "athlon_fmov" 2
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (eq_attr "type" "fmov"))
+ "athlon-direct,athlon-fpsched,athlon-faddmul")
+ (define_insn_reservation "athlon_fadd_load" 4
+@@ -355,12 +355,12 @@
+ (eq_attr "memory" "load")))
+ "athlon-direct,athlon-fpload,athlon-fadd")
+ (define_insn_reservation "athlon_fadd_load_k8" 6
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (and (eq_attr "type" "fop")
+ (eq_attr "memory" "load")))
+ "athlon-direct,athlon-fploadk8,athlon-fadd")
+ (define_insn_reservation "athlon_fadd" 4
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (eq_attr "type" "fop"))
+ "athlon-direct,athlon-fpsched,athlon-fadd")
+ (define_insn_reservation "athlon_fmul_load" 4
+@@ -369,16 +369,16 @@
+ (eq_attr "memory" "load")))
+ "athlon-direct,athlon-fpload,athlon-fmul")
+ (define_insn_reservation "athlon_fmul_load_k8" 6
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (and (eq_attr "type" "fmul")
+ (eq_attr "memory" "load")))
+ "athlon-direct,athlon-fploadk8,athlon-fmul")
+ (define_insn_reservation "athlon_fmul" 4
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (eq_attr "type" "fmul"))
+ "athlon-direct,athlon-fpsched,athlon-fmul")
+ (define_insn_reservation "athlon_fsgn" 2
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (eq_attr "type" "fsgn"))
+ "athlon-direct,athlon-fpsched,athlon-fmul")
+ (define_insn_reservation "athlon_fdiv_load" 24
+@@ -387,7 +387,7 @@
+ (eq_attr "memory" "load")))
+ "athlon-direct,athlon-fpload,athlon-fmul")
+ (define_insn_reservation "athlon_fdiv_load_k8" 13
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (and (eq_attr "type" "fdiv")
+ (eq_attr "memory" "load")))
+ "athlon-direct,athlon-fploadk8,athlon-fmul")
+@@ -396,16 +396,16 @@
+ (eq_attr "type" "fdiv"))
+ "athlon-direct,athlon-fpsched,athlon-fmul")
+ (define_insn_reservation "athlon_fdiv_k8" 11
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (eq_attr "type" "fdiv"))
+ "athlon-direct,athlon-fpsched,athlon-fmul")
+ (define_insn_reservation "athlon_fpspc_load" 103
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (and (eq_attr "type" "fpspc")
+ (eq_attr "memory" "load")))
+ "athlon-vector,athlon-fpload,athlon-fvector")
+ (define_insn_reservation "athlon_fpspc" 100
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (eq_attr "type" "fpspc"))
+ "athlon-vector,athlon-fpsched,athlon-fvector")
+ (define_insn_reservation "athlon_fcmov_load" 7
+@@ -418,12 +418,12 @@
+ (eq_attr "type" "fcmov"))
+ "athlon-vector,athlon-fpsched,athlon-fvector")
+ (define_insn_reservation "athlon_fcmov_load_k8" 17
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (and (eq_attr "type" "fcmov")
+ (eq_attr "memory" "load")))
+ "athlon-vector,athlon-fploadk8,athlon-fvector")
+ (define_insn_reservation "athlon_fcmov_k8" 15
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (eq_attr "type" "fcmov"))
+ "athlon-vector,athlon-fpsched,athlon-fvector")
+ ;; fcomi is vector decoded by uses only one pipe.
+@@ -434,13 +434,13 @@
+ (eq_attr "memory" "load"))))
+ "athlon-vector,athlon-fpload,athlon-fadd")
+ (define_insn_reservation "athlon_fcomi_load_k8" 5
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (and (eq_attr "type" "fcmp")
+ (and (eq_attr "athlon_decode" "vector")
+ (eq_attr "memory" "load"))))
+ "athlon-vector,athlon-fploadk8,athlon-fadd")
+ (define_insn_reservation "athlon_fcomi" 3
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (and (eq_attr "athlon_decode" "vector")
+ (eq_attr "type" "fcmp")))
+ "athlon-vector,athlon-fpsched,athlon-fadd")
+@@ -450,18 +450,18 @@
+ (eq_attr "memory" "load")))
+ "athlon-direct,athlon-fpload,athlon-fadd")
+ (define_insn_reservation "athlon_fcom_load_k8" 4
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (and (eq_attr "type" "fcmp")
+ (eq_attr "memory" "load")))
+ "athlon-direct,athlon-fploadk8,athlon-fadd")
+ (define_insn_reservation "athlon_fcom" 2
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (eq_attr "type" "fcmp"))
+ "athlon-direct,athlon-fpsched,athlon-fadd")
+ ;; Never seen by the scheduler because we still don't do post reg-stack
+ ;; scheduling.
+ ;(define_insn_reservation "athlon_fxch" 2
+-; (and (eq_attr "cpu" "athlon,k8")
++; (and (eq_attr "cpu" "athlon,k8,generic64")
+ ; (eq_attr "type" "fxch"))
+ ; "athlon-direct,athlon-fpsched,athlon-fany")
+
+@@ -477,8 +477,13 @@
+ (and (eq_attr "type" "ssemov")
+ (match_operand:DF 1 "memory_operand" "")))
+ "athlon-direct,athlon-fploadk8,athlon-fstore")
++(define_insn_reservation "athlon_movsd_load_generic64" 2
++ (and (eq_attr "cpu" "generic64")
++ (and (eq_attr "type" "ssemov")
++ (match_operand:DF 1 "memory_operand" "")))
++ "athlon-double,athlon-fploadk8,(athlon-fstore+athlon-fmul)")
+ (define_insn_reservation "athlon_movaps_load_k8" 2
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (and (eq_attr "type" "ssemov")
+ (and (eq_attr "mode" "V4SF,V2DF,TI")
+ (eq_attr "memory" "load"))))
+@@ -496,7 +501,7 @@
+ (eq_attr "memory" "load"))))
+ "athlon-vector,athlon-fpload,(athlon-fany*2)")
+ (define_insn_reservation "athlon_movss_load_k8" 1
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (and (eq_attr "type" "ssemov")
+ (and (eq_attr "mode" "SF,DI")
+ (eq_attr "memory" "load"))))
+@@ -507,57 +512,57 @@
+ (eq_attr "memory" "load")))
+ "athlon-direct,athlon-fpload,athlon-fany")
+ (define_insn_reservation "athlon_mmxsseld_k8" 2
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (and (eq_attr "type" "mmxmov,ssemov")
+ (eq_attr "memory" "load")))
+ "athlon-direct,athlon-fploadk8,athlon-fstore")
+ (define_insn_reservation "athlon_mmxssest" 3
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (and (eq_attr "type" "mmxmov,ssemov")
+ (and (eq_attr "mode" "V4SF,V2DF,TI")
+ (eq_attr "memory" "store,both"))))
+ "athlon-vector,(athlon-fpsched+athlon-agu),((athlon-fstore+athlon-store2)*2)")
+ (define_insn_reservation "athlon_mmxssest_k8" 3
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (and (eq_attr "type" "mmxmov,ssemov")
+ (and (eq_attr "mode" "V4SF,V2DF,TI")
+ (eq_attr "memory" "store,both"))))
+ "athlon-double,(athlon-fpsched+athlon-agu),((athlon-fstore+athlon-store2)*2)")
+ (define_insn_reservation "athlon_mmxssest_short" 2
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (and (eq_attr "type" "mmxmov,ssemov")
+ (eq_attr "memory" "store,both")))
+ "athlon-direct,(athlon-fpsched+athlon-agu),(athlon-fstore+athlon-store)")
+-(define_insn_reservation "athlon_movaps" 2
+- (and (eq_attr "cpu" "k8")
++(define_insn_reservation "athlon_movaps_k8" 2
++ (and (eq_attr "cpu" "k8,generic64")
+ (and (eq_attr "type" "ssemov")
+ (eq_attr "mode" "V4SF,V2DF,TI")))
+- "athlon-double,athlon-fpsched,(athlon-faddmul+athlon-faddmul)")
+-(define_insn_reservation "athlon_movaps_k8" 2
++ "athlon-double,athlon-fpsched,((athlon-faddmul+athlon-faddmul) | (athlon-faddmul, athlon-faddmul))")
++(define_insn_reservation "athlon_movaps" 2
+ (and (eq_attr "cpu" "athlon")
+ (and (eq_attr "type" "ssemov")
+ (eq_attr "mode" "V4SF,V2DF,TI")))
+ "athlon-vector,athlon-fpsched,(athlon-faddmul+athlon-faddmul)")
+ (define_insn_reservation "athlon_mmxssemov" 2
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (eq_attr "type" "mmxmov,ssemov"))
+ "athlon-direct,athlon-fpsched,athlon-faddmul")
+ (define_insn_reservation "athlon_mmxmul_load" 4
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (and (eq_attr "type" "mmxmul")
+ (eq_attr "memory" "load")))
+ "athlon-direct,athlon-fpload,athlon-fmul")
+ (define_insn_reservation "athlon_mmxmul" 3
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (eq_attr "type" "mmxmul"))
+ "athlon-direct,athlon-fpsched,athlon-fmul")
+ (define_insn_reservation "athlon_mmx_load" 3
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (and (eq_attr "unit" "mmx")
+ (eq_attr "memory" "load")))
+ "athlon-direct,athlon-fpload,athlon-faddmul")
+ (define_insn_reservation "athlon_mmx" 2
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (eq_attr "unit" "mmx"))
+ "athlon-direct,athlon-fpsched,athlon-faddmul")
+ ;; SSE operations are handled by the i387 unit as well. The latency
+@@ -569,7 +574,7 @@
+ (eq_attr "memory" "load")))
+ "athlon-vector,athlon-fpload2,(athlon-fmul*2)")
+ (define_insn_reservation "athlon_sselog_load_k8" 5
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (and (eq_attr "type" "sselog,sselog1")
+ (eq_attr "memory" "load")))
+ "athlon-double,athlon-fpload2k8,(athlon-fmul*2)")
+@@ -578,7 +583,7 @@
+ (eq_attr "type" "sselog,sselog1"))
+ "athlon-vector,athlon-fpsched,athlon-fmul*2")
+ (define_insn_reservation "athlon_sselog_k8" 3
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (eq_attr "type" "sselog,sselog1"))
+ "athlon-double,athlon-fpsched,athlon-fmul")
+ ;; ??? pcmp executes in addmul, probably not worthwhile to bother about that.
+@@ -589,13 +594,13 @@
+ (eq_attr "memory" "load"))))
+ "athlon-direct,athlon-fpload,athlon-fadd")
+ (define_insn_reservation "athlon_ssecmp_load_k8" 4
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (and (eq_attr "type" "ssecmp")
+ (and (eq_attr "mode" "SF,DF,DI,TI")
+ (eq_attr "memory" "load"))))
+ "athlon-direct,athlon-fploadk8,athlon-fadd")
+ (define_insn_reservation "athlon_ssecmp" 2
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (and (eq_attr "type" "ssecmp")
+ (eq_attr "mode" "SF,DF,DI,TI")))
+ "athlon-direct,athlon-fpsched,athlon-fadd")
+@@ -605,7 +610,7 @@
+ (eq_attr "memory" "load")))
+ "athlon-vector,athlon-fpload2,(athlon-fadd*2)")
+ (define_insn_reservation "athlon_ssecmpvector_load_k8" 5
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (and (eq_attr "type" "ssecmp")
+ (eq_attr "memory" "load")))
+ "athlon-double,athlon-fpload2k8,(athlon-fadd*2)")
+@@ -614,7 +619,7 @@
+ (eq_attr "type" "ssecmp"))
+ "athlon-vector,athlon-fpsched,(athlon-fadd*2)")
+ (define_insn_reservation "athlon_ssecmpvector_k8" 3
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (eq_attr "type" "ssecmp"))
+ "athlon-double,athlon-fpsched,(athlon-fadd*2)")
+ (define_insn_reservation "athlon_ssecomi_load" 4
+@@ -623,12 +628,12 @@
+ (eq_attr "memory" "load")))
+ "athlon-vector,athlon-fpload,athlon-fadd")
+ (define_insn_reservation "athlon_ssecomi_load_k8" 6
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (and (eq_attr "type" "ssecomi")
+ (eq_attr "memory" "load")))
+ "athlon-vector,athlon-fploadk8,athlon-fadd")
+ (define_insn_reservation "athlon_ssecomi" 4
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (eq_attr "type" "ssecmp"))
+ "athlon-vector,athlon-fpsched,athlon-fadd")
+ (define_insn_reservation "athlon_sseadd_load" 4
+@@ -638,13 +643,13 @@
+ (eq_attr "memory" "load"))))
+ "athlon-direct,athlon-fpload,athlon-fadd")
+ (define_insn_reservation "athlon_sseadd_load_k8" 6
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (and (eq_attr "type" "sseadd")
+ (and (eq_attr "mode" "SF,DF,DI")
+ (eq_attr "memory" "load"))))
+ "athlon-direct,athlon-fploadk8,athlon-fadd")
+ (define_insn_reservation "athlon_sseadd" 4
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (and (eq_attr "type" "sseadd")
+ (eq_attr "mode" "SF,DF,DI")))
+ "athlon-direct,athlon-fpsched,athlon-fadd")
+@@ -654,7 +659,7 @@
+ (eq_attr "memory" "load")))
+ "athlon-vector,athlon-fpload2,(athlon-fadd*2)")
+ (define_insn_reservation "athlon_sseaddvector_load_k8" 7
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (and (eq_attr "type" "sseadd")
+ (eq_attr "memory" "load")))
+ "athlon-double,athlon-fpload2k8,(athlon-fadd*2)")
+@@ -663,7 +668,7 @@
+ (eq_attr "type" "sseadd"))
+ "athlon-vector,athlon-fpsched,(athlon-fadd*2)")
+ (define_insn_reservation "athlon_sseaddvector_k8" 5
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (eq_attr "type" "sseadd"))
+ "athlon-double,athlon-fpsched,(athlon-fadd*2)")
+
+@@ -673,28 +678,28 @@
+
+ ;; cvtss2sd
+ (define_insn_reservation "athlon_ssecvt_cvtss2sd_load_k8" 4
+- (and (eq_attr "cpu" "k8,athlon")
++ (and (eq_attr "cpu" "k8,athlon,generic64")
+ (and (eq_attr "type" "ssecvt")
+ (and (eq_attr "athlon_decode" "direct")
+ (and (eq_attr "mode" "DF")
+ (eq_attr "memory" "load")))))
+ "athlon-direct,athlon-fploadk8,athlon-fstore")
+ (define_insn_reservation "athlon_ssecvt_cvtss2sd" 2
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (and (eq_attr "type" "ssecvt")
+ (and (eq_attr "athlon_decode" "direct")
+ (eq_attr "mode" "DF"))))
+ "athlon-direct,athlon-fpsched,athlon-fstore")
+ ;; cvtps2pd. Model same way the other double decoded FP conversions.
+ (define_insn_reservation "athlon_ssecvt_cvtps2pd_load_k8" 5
+- (and (eq_attr "cpu" "k8,athlon")
++ (and (eq_attr "cpu" "k8,athlon,generic64")
+ (and (eq_attr "type" "ssecvt")
+ (and (eq_attr "athlon_decode" "double")
+ (and (eq_attr "mode" "V2DF,V4SF,TI")
+ (eq_attr "memory" "load")))))
+ "athlon-double,athlon-fpload2k8,(athlon-fstore*2)")
+ (define_insn_reservation "athlon_ssecvt_cvtps2pd_k8" 3
+- (and (eq_attr "cpu" "k8,athlon")
++ (and (eq_attr "cpu" "k8,athlon,generic64")
+ (and (eq_attr "type" "ssecvt")
+ (and (eq_attr "athlon_decode" "double")
+ (eq_attr "mode" "V2DF,V4SF,TI"))))
+@@ -717,7 +722,7 @@
+ (eq_attr "memory" "load")))))
+ "athlon-vector,athlon-fpload,(athlon-fstore*2)")
+ (define_insn_reservation "athlon_sseicvt_cvtsi2ss_load_k8" 9
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (and (eq_attr "type" "sseicvt")
+ (and (eq_attr "athlon_decode" "double")
+ (and (eq_attr "mode" "SF,DF")
+@@ -725,7 +730,7 @@
+ "athlon-double,athlon-fploadk8,(athlon-fstore*2)")
+ ;; cvtsi2sd reg,reg is double decoded (vector on Athlon)
+ (define_insn_reservation "athlon_sseicvt_cvtsi2sd_k8" 11
+- (and (eq_attr "cpu" "k8,athlon")
++ (and (eq_attr "cpu" "k8,athlon,generic64")
+ (and (eq_attr "type" "sseicvt")
+ (and (eq_attr "athlon_decode" "double")
+ (and (eq_attr "mode" "SF,DF")
+@@ -733,7 +738,7 @@
+ "athlon-double,athlon-fploadk8,athlon-fstore")
+ ;; cvtsi2ss reg, reg is doublepath
+ (define_insn_reservation "athlon_sseicvt_cvtsi2ss" 14
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (and (eq_attr "type" "sseicvt")
+ (and (eq_attr "athlon_decode" "vector")
+ (and (eq_attr "mode" "SF,DF")
+@@ -741,7 +746,7 @@
+ "athlon-vector,athlon-fploadk8,(athlon-fvector*2)")
+ ;; cvtsd2ss mem,reg is doublepath, troughput unknown, latency 9
+ (define_insn_reservation "athlon_ssecvt_cvtsd2ss_load_k8" 9
+- (and (eq_attr "cpu" "k8,athlon")
++ (and (eq_attr "cpu" "k8,athlon,generic64")
+ (and (eq_attr "type" "ssecvt")
+ (and (eq_attr "athlon_decode" "double")
+ (and (eq_attr "mode" "SF")
+@@ -749,14 +754,14 @@
+ "athlon-double,athlon-fploadk8,(athlon-fstore*3)")
+ ;; cvtsd2ss reg,reg is vectorpath, troughput unknown, latency 12
+ (define_insn_reservation "athlon_ssecvt_cvtsd2ss" 12
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (and (eq_attr "type" "ssecvt")
+ (and (eq_attr "athlon_decode" "vector")
+ (and (eq_attr "mode" "SF")
+ (eq_attr "memory" "none")))))
+ "athlon-vector,athlon-fpsched,(athlon-fvector*3)")
+ (define_insn_reservation "athlon_ssecvt_cvtpd2ps_load_k8" 8
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (and (eq_attr "type" "ssecvt")
+ (and (eq_attr "athlon_decode" "vector")
+ (and (eq_attr "mode" "V4SF,V2DF,TI")
+@@ -765,7 +770,7 @@
+ ;; cvtpd2ps mem,reg is vectorpath, troughput unknown, latency 10
+ ;; ??? Why it is fater than cvtsd2ss?
+ (define_insn_reservation "athlon_ssecvt_cvtpd2ps" 8
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (and (eq_attr "type" "ssecvt")
+ (and (eq_attr "athlon_decode" "vector")
+ (and (eq_attr "mode" "V4SF,V2DF,TI")
+@@ -773,7 +778,7 @@
+ "athlon-vector,athlon-fpsched,athlon-fvector*2")
+ ;; cvtsd2si mem,reg is doublepath, troughput 1, latency 9
+ (define_insn_reservation "athlon_secvt_cvtsX2si_load" 9
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (and (eq_attr "type" "sseicvt")
+ (and (eq_attr "athlon_decode" "vector")
+ (and (eq_attr "mode" "SI,DI")
+@@ -788,7 +793,7 @@
+ (eq_attr "memory" "none")))))
+ "athlon-vector,athlon-fpsched,athlon-fvector")
+ (define_insn_reservation "athlon_ssecvt_cvtsX2si_k8" 9
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (and (eq_attr "type" "sseicvt")
+ (and (eq_attr "athlon_decode" "double")
+ (and (eq_attr "mode" "SI,DI")
+@@ -803,13 +808,13 @@
+ (eq_attr "memory" "load"))))
+ "athlon-direct,athlon-fpload,athlon-fmul")
+ (define_insn_reservation "athlon_ssemul_load_k8" 6
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (and (eq_attr "type" "ssemul")
+ (and (eq_attr "mode" "SF,DF")
+ (eq_attr "memory" "load"))))
+ "athlon-direct,athlon-fploadk8,athlon-fmul")
+ (define_insn_reservation "athlon_ssemul" 4
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (and (eq_attr "type" "ssemul")
+ (eq_attr "mode" "SF,DF")))
+ "athlon-direct,athlon-fpsched,athlon-fmul")
+@@ -819,7 +824,7 @@
+ (eq_attr "memory" "load")))
+ "athlon-vector,athlon-fpload2,(athlon-fmul*2)")
+ (define_insn_reservation "athlon_ssemulvector_load_k8" 7
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (and (eq_attr "type" "ssemul")
+ (eq_attr "memory" "load")))
+ "athlon-double,athlon-fpload2k8,(athlon-fmul*2)")
+@@ -828,7 +833,7 @@
+ (eq_attr "type" "ssemul"))
+ "athlon-vector,athlon-fpsched,(athlon-fmul*2)")
+ (define_insn_reservation "athlon_ssemulvector_k8" 5
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (eq_attr "type" "ssemul"))
+ "athlon-double,athlon-fpsched,(athlon-fmul*2)")
+ ;; divsd timings. divss is faster
+@@ -839,13 +844,13 @@
+ (eq_attr "memory" "load"))))
+ "athlon-direct,athlon-fpload,athlon-fmul*17")
+ (define_insn_reservation "athlon_ssediv_load_k8" 22
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (and (eq_attr "type" "ssediv")
+ (and (eq_attr "mode" "SF,DF")
+ (eq_attr "memory" "load"))))
+ "athlon-direct,athlon-fploadk8,athlon-fmul*17")
+ (define_insn_reservation "athlon_ssediv" 20
+- (and (eq_attr "cpu" "athlon,k8")
++ (and (eq_attr "cpu" "athlon,k8,generic64")
+ (and (eq_attr "type" "ssediv")
+ (eq_attr "mode" "SF,DF")))
+ "athlon-direct,athlon-fpsched,athlon-fmul*17")
+@@ -855,7 +860,7 @@
+ (eq_attr "memory" "load")))
+ "athlon-vector,athlon-fpload2,athlon-fmul*34")
+ (define_insn_reservation "athlon_ssedivvector_load_k8" 35
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (and (eq_attr "type" "ssediv")
+ (eq_attr "memory" "load")))
+ "athlon-double,athlon-fpload2k8,athlon-fmul*34")
+@@ -864,6 +869,6 @@
+ (eq_attr "type" "ssediv"))
+ "athlon-vector,athlon-fmul*34")
+ (define_insn_reservation "athlon_ssedivvector_k8" 39
+- (and (eq_attr "cpu" "k8")
++ (and (eq_attr "cpu" "k8,generic64")
+ (eq_attr "type" "ssediv"))
+ "athlon-double,athlon-fmul*34")
+--- gcc/config/i386/i386.c.orig 2006-10-25 18:27:35.000000000 +0200
++++ gcc/config/i386/i386.c 2006-10-25 18:27:49.000000000 +0200
+@@ -584,6 +584,118 @@
+ COSTS_N_INSNS (44), /* cost of FSQRT instruction. */
+ };
+
++/* Generic64 should produce code tuned for Nocona and K8. */
++static const
++struct processor_costs generic64_cost = {
++ COSTS_N_INSNS (1), /* cost of an add instruction */
++ /* On all chips taken into consideration lea is 2 cycles and more. With
++ this cost however our current implementation of synth_mult results in
++ use of unnecesary temporary registers causing regression on several
++ SPECfp benchmarks. */
++ COSTS_N_INSNS (1) + 1, /* cost of a lea instruction */
++ COSTS_N_INSNS (1), /* variable shift costs */
++ COSTS_N_INSNS (1), /* constant shift costs */
++ {COSTS_N_INSNS (3), /* cost of starting multiply for QI */
++ COSTS_N_INSNS (4), /* HI */
++ COSTS_N_INSNS (3), /* SI */
++ COSTS_N_INSNS (4), /* DI */
++ COSTS_N_INSNS (2)}, /* other */
++ 0, /* cost of multiply per each bit set */
++ {COSTS_N_INSNS (18), /* cost of a divide/mod for QI */
++ COSTS_N_INSNS (26), /* HI */
++ COSTS_N_INSNS (42), /* SI */
++ COSTS_N_INSNS (74), /* DI */
++ COSTS_N_INSNS (74)}, /* other */
++ COSTS_N_INSNS (1), /* cost of movsx */
++ COSTS_N_INSNS (1), /* cost of movzx */
++ 8, /* "large" insn */
++ 17, /* MOVE_RATIO */
++ 4, /* cost for loading QImode using movzbl */
++ {4, 4, 4}, /* cost of loading integer registers
++ in QImode, HImode and SImode.
++ Relative to reg-reg move (2). */
++ {4, 4, 4}, /* cost of storing integer registers */
++ 4, /* cost of reg,reg fld/fst */
++ {12, 12, 12}, /* cost of loading fp registers
++ in SFmode, DFmode and XFmode */
++ {6, 6, 8}, /* cost of loading integer registers */
++ 2, /* cost of moving MMX register */
++ {8, 8}, /* cost of loading MMX registers
++ in SImode and DImode */
++ {8, 8}, /* cost of storing MMX registers
++ in SImode and DImode */
++ 2, /* cost of moving SSE register */
++ {8, 8, 8}, /* cost of loading SSE registers
++ in SImode, DImode and TImode */
++ {8, 8, 8}, /* cost of storing SSE registers
++ in SImode, DImode and TImode */
++ 5, /* MMX or SSE register to integer */
++ 64, /* size of prefetch block */
++ 6, /* number of parallel prefetches */
++ /* Benchmarks shows large regressions on K8 sixtrack benchmark when this value
++ is increased to perhaps more appropriate value of 5. */
++ 3, /* Branch cost */
++ COSTS_N_INSNS (8), /* cost of FADD and FSUB insns. */
++ COSTS_N_INSNS (8), /* cost of FMUL instruction. */
++ COSTS_N_INSNS (20), /* cost of FDIV instruction. */
++ COSTS_N_INSNS (8), /* cost of FABS instruction. */
++ COSTS_N_INSNS (8), /* cost of FCHS instruction. */
++ COSTS_N_INSNS (40), /* cost of FSQRT instruction. */
++};
++
++/* Generic32 should produce code tuned for Athlon, PPro, Pentium4, Nocona and K8. */
++static const
++struct processor_costs generic32_cost = {
++ COSTS_N_INSNS (1), /* cost of an add instruction */
++ COSTS_N_INSNS (1) + 1, /* cost of a lea instruction */
++ COSTS_N_INSNS (1), /* variable shift costs */
++ COSTS_N_INSNS (1), /* constant shift costs */
++ {COSTS_N_INSNS (3), /* cost of starting multiply for QI */
++ COSTS_N_INSNS (4), /* HI */
++ COSTS_N_INSNS (3), /* SI */
++ COSTS_N_INSNS (4), /* DI */
++ COSTS_N_INSNS (2)}, /* other */
++ 0, /* cost of multiply per each bit set */
++ {COSTS_N_INSNS (18), /* cost of a divide/mod for QI */
++ COSTS_N_INSNS (26), /* HI */
++ COSTS_N_INSNS (42), /* SI */
++ COSTS_N_INSNS (74), /* DI */
++ COSTS_N_INSNS (74)}, /* other */
++ COSTS_N_INSNS (1), /* cost of movsx */
++ COSTS_N_INSNS (1), /* cost of movzx */
++ 8, /* "large" insn */
++ 17, /* MOVE_RATIO */
++ 4, /* cost for loading QImode using movzbl */
++ {4, 4, 4}, /* cost of loading integer registers
++ in QImode, HImode and SImode.
++ Relative to reg-reg move (2). */
++ {4, 4, 4}, /* cost of storing integer registers */
++ 4, /* cost of reg,reg fld/fst */
++ {12, 12, 12}, /* cost of loading fp registers
++ in SFmode, DFmode and XFmode */
++ {6, 6, 8}, /* cost of loading integer registers */
++ 2, /* cost of moving MMX register */
++ {8, 8}, /* cost of loading MMX registers
++ in SImode and DImode */
++ {8, 8}, /* cost of storing MMX registers
++ in SImode and DImode */
++ 2, /* cost of moving SSE register */
++ {8, 8, 8}, /* cost of loading SSE registers
++ in SImode, DImode and TImode */
++ {8, 8, 8}, /* cost of storing SSE registers
++ in SImode, DImode and TImode */
++ 5, /* MMX or SSE register to integer */
++ 64, /* size of prefetch block */
++ 6, /* number of parallel prefetches */
++ 3, /* Branch cost */
++ COSTS_N_INSNS (8), /* cost of FADD and FSUB insns. */
++ COSTS_N_INSNS (8), /* cost of FMUL instruction. */
++ COSTS_N_INSNS (20), /* cost of FDIV instruction. */
++ COSTS_N_INSNS (8), /* cost of FABS instruction. */
++ COSTS_N_INSNS (8), /* cost of FCHS instruction. */
++ COSTS_N_INSNS (40), /* cost of FSQRT instruction. */
++};
++
+ const struct processor_costs *ix86_cost = &pentium_cost;
+
+ /* Processor feature/optimization bitmasks. */
+@@ -597,52 +709,81 @@
+ #define m_K8 (1<&2
++ exit 1
++ ;;
++ esac
++ # OK
++ ;;
++ "" | k8 | opteron | athlon64 | athlon-fx | nocona | generic)
+ # OK
+ ;;
+ *)
--- gcc-4.1-4.1.2.orig/debian/patches/libjava-ia32fix.dpatch
+++ gcc-4.1-4.1.2/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.2.orig/debian/patches/pr25514.dpatch
+++ gcc-4.1-4.1.2/debian/patches/pr25514.dpatch
@@ -0,0 +1,190 @@
+#! /bin/sh -e
+
+# All lines beginning with `# DPATCH:' are a description of the patch.
+# DP: fixes: 344041
+# DP: Revision 113983:
+# DP: 2006-05-22 Richard Sandiford
+# DP:
+# DP: PR rtl-optimization/25514
+# DP: * combine.c (replaced_rhs_insn): New variable.
+# DP: (combine_instructions): Set replaced_rhs_insn when trying to replace
+# DP: a SET_SRC with a REG_EQUAL note.
+# DP: (distribute_notes): Use replaced_rhs_insn when determining the live
+# DP: range of a REG_DEAD register.
+
+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/combine.c | 71 ++++++++++++--------------
+ gcc/testsuite/gcc.c-torture/compile/pr25514.c | 24 ++++++++
+ 2 files changed, 59 insertions(+), 36 deletions(-)
+
+Index: gcc-4.1/gcc/combine.c
+===================================================================
+--- gcc-4.1.orig/gcc/combine.c
++++ gcc-4.1/gcc/combine.c
+@@ -123,6 +123,11 @@ static int combine_successes;
+
+ static int total_attempts, total_merges, total_extras, total_successes;
+
++/* Sometimes combine tries to replace the right hand side of an insn
++ with the value of a REG_EQUAL note. This is the insn that has been
++ so modified, or null if none. */
++
++static rtx replaced_rhs_insn;
+
+ /* Vector mapping INSN_UIDs to cuids.
+ The cuids are like uids but increase monotonically always.
+@@ -877,8 +882,10 @@ combine_instructions (rtx f, unsigned in
+ be deleted or recognized by try_combine. */
+ rtx orig = SET_SRC (set);
+ SET_SRC (set) = note;
++ replaced_rhs_insn = temp;
+ next = try_combine (insn, temp, NULL_RTX,
+ &new_direct_jump_p);
++ replaced_rhs_insn = NULL;
+ if (next)
+ goto retry;
+ SET_SRC (set) = orig;
+@@ -12214,7 +12221,15 @@ distribute_notes (rtx notes, rtx from_in
+ break;
+
+ case REG_DEAD:
+- /* If the register is used as an input in I3, it dies there.
++ /* If we replaced the right hand side of FROM_INSN with a
++ REG_EQUAL note, the original use of the dying register
++ will not have been combined into I3 and I2. In such cases,
++ FROM_INSN is guaranteed to be the first of the combined
++ instructions, so we simply need to search back before
++ FROM_INSN for the previous use or set of this register,
++ then alter the notes there appropriately.
++
++ If the register is used as an input in I3, it dies there.
+ Similarly for I2, if it is nonzero and adjacent to I3.
+
+ If the register is not used as an input in either I3 or I2
+@@ -12228,30 +12243,30 @@ distribute_notes (rtx notes, rtx from_in
+ In both cases, we must search to see if we can find a previous
+ use of A and put the death note there. */
+
+- if (from_insn
+- && CALL_P (from_insn)
+- && find_reg_fusage (from_insn, USE, XEXP (note, 0)))
+- place = from_insn;
+- else if (reg_referenced_p (XEXP (note, 0), PATTERN (i3)))
+- place = i3;
+- else if (i2 != 0 && next_nonnote_insn (i2) == i3
+- && reg_referenced_p (XEXP (note, 0), PATTERN (i2)))
+- place = i2;
+-
+- if (place == 0
+- && (rtx_equal_p (XEXP (note, 0), elim_i2)
+- || rtx_equal_p (XEXP (note, 0), elim_i1)))
+- break;
++ if (from_insn && from_insn == replaced_rhs_insn)
++ tem = from_insn;
++ else
++ {
++ if (from_insn
++ && CALL_P (from_insn)
++ && find_reg_fusage (from_insn, USE, XEXP (note, 0)))
++ place = from_insn;
++ else if (reg_referenced_p (XEXP (note, 0), PATTERN (i3)))
++ place = i3;
++ else if (i2 != 0 && next_nonnote_insn (i2) == i3
++ && reg_referenced_p (XEXP (note, 0), PATTERN (i2)))
++ place = i2;
++ else if (rtx_equal_p (XEXP (note, 0), elim_i2)
++ || rtx_equal_p (XEXP (note, 0), elim_i1))
++ break;
++ tem = i3;
++ }
+
+ if (place == 0)
+ {
+ basic_block bb = this_basic_block;
+
+- /* You might think you could search back from FROM_INSN
+- rather than from I3, but combine tries to split invalid
+- combined instructions. This can result in the old I2
+- or I1 moving later in the insn sequence. */
+- for (tem = PREV_INSN (i3); place == 0; tem = PREV_INSN (tem))
++ for (tem = PREV_INSN (tem); place == 0; tem = PREV_INSN (tem))
+ {
+ if (! INSN_P (tem))
+ {
+@@ -12351,22 +12366,6 @@ distribute_notes (rtx notes, rtx from_in
+ || (CALL_P (tem)
+ && find_reg_fusage (tem, USE, XEXP (note, 0))))
+ {
+- /* This may not be the correct place for the death
+- note if FROM_INSN is before TEM, and the reg is
+- set between FROM_INSN and TEM. The reg might
+- die two or more times. An existing death note
+- means we are looking at the wrong live range. */
+- if (from_insn
+- && INSN_CUID (from_insn) < INSN_CUID (tem)
+- && find_regno_note (tem, REG_DEAD,
+- REGNO (XEXP (note, 0))))
+- {
+- tem = from_insn;
+- if (tem == BB_HEAD (bb))
+- break;
+- continue;
+- }
+-
+ place = tem;
+
+ /* If we are doing a 3->2 combination, and we have a
+Index: gcc-4.1/gcc/testsuite/gcc.c-torture/compile/pr25514.c
+===================================================================
+--- /dev/null
++++ gcc-4.1/gcc/testsuite/gcc.c-torture/compile/pr25514.c
+@@ -0,0 +1,24 @@
++struct node {
++ struct node *next;
++ int value;
++};
++
++struct node *current_node, global_list;
++
++void
++bar (void)
++{
++ struct node *node, *next;
++
++ node = current_node;
++ next = node->next;
++ if (node != &global_list)
++ current_node = next;
++ else
++ {
++ node = global_list.next;
++ global_list.value = node->value;
++ global_list.next = node->next;
++ }
++ foo (node);
++}
--- gcc-4.1-4.1.2.orig/debian/patches/pr25524.dpatch
+++ gcc-4.1-4.1.2/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.2.orig/debian/patches/libstdc++-doxygen.dpatch
+++ gcc-4.1-4.1.2/debian/patches/libstdc++-doxygen.dpatch
@@ -0,0 +1,36 @@
+#! /bin/sh -e
+
+# DP: libstdc++ doxygen docs: Set SHORT_NAMES to YES
+
+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
+
+--- libstdc++-v3/docs/doxygen/user.cfg.in~ 2005-03-04 19:44:51.000000000 +0100
++++ libstdc++-v3/docs/doxygen/user.cfg.in 2005-04-09 01:00:44.753742400 +0200
+@@ -133,7 +133,7 @@
+ # (but less readable) file names. This can be useful is your file systems
+ # doesn't support long names like on DOS, Mac, or CD-ROM.
+
+-SHORT_NAMES = NO
++SHORT_NAMES = YES
+
+ # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+ # will interpret the first line (until the first dot) of a JavaDoc-style
--- gcc-4.1-4.1.2.orig/debian/patches/arm-gij.dpatch
+++ gcc-4.1-4.1.2/debian/patches/arm-gij.dpatch
@@ -0,0 +1,37 @@
+#! /bin/sh -e
+
+# DP: Enable gij interpreter on 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
+
+--- 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.2.orig/debian/patches/m68k-peephole-note.dpatch
+++ gcc-4.1-4.1.2/debian/patches/m68k-peephole-note.dpatch
@@ -0,0 +1,45 @@
+#! /bin/sh -e
+
+# All lines beginning with `# DPATCH:' are a description of the patch.
+# DP: don't choke on notes while reinserting REG_EH_REGION notes
+
+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
+
+---
+
+ gcc/recog.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+Index: gcc-4.1/gcc/recog.c
+===================================================================
+--- gcc-4.1.orig/gcc/recog.c
++++ gcc-4.1/gcc/recog.c
+@@ -3215,6 +3215,7 @@ peephole2_optimize (FILE *dump_file ATTR
+ for (x = try ; x != before_try ; x = PREV_INSN (x))
+ if (CALL_P (x)
+ || (flag_non_call_exceptions
++ && INSN_P (x)
+ && may_trap_p (PATTERN (x))
+ && !find_reg_note (x, REG_EH_REGION, NULL)))
+ {
--- gcc-4.1-4.1.2.orig/debian/patches/ignore-comp-fail.dpatch
+++ gcc-4.1-4.1.2/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.2.orig/debian/patches/ada-driver-check.dpatch
+++ gcc-4.1-4.1.2/debian/patches/ada-driver-check.dpatch
@@ -0,0 +1,39 @@
+#! /bin/sh -e
+
+# DP: Simplify Ada driver check (we always build using the required
+# DP: Ada version. Needed for warnings on alpha.
+
+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
+
+--- config/acx.m4~ 2005-12-15 14:59:17.000000000 +0100
++++ config/acx.m4 2006-07-08 17:01:44.325594336 +0200
+@@ -195,7 +195,7 @@
+ # Other compilers, like HP Tru64 UNIX cc, exit successfully when
+ # given a .adb file, but produce no object file. So we must check
+ # if an object file was really produced to guard against this.
+-errors=`(${CC} -c conftest.adb) 2>&1 || echo failure`
++errors=`(${CC} -c conftest.adb) 2>/dev/null || echo failure`
+ if test x"$errors" = x && test -f conftest.$ac_objext; then
+ acx_cv_cc_gcc_supports_ada=yes
+ fi
--- gcc-4.1-4.1.2.orig/debian/patches/libjava-lib32subdir.dpatch
+++ gcc-4.1-4.1.2/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.2.orig/debian/patches/disable-configure-run-check.dpatch
+++ gcc-4.1-4.1.2/debian/patches/disable-configure-run-check.dpatch
@@ -0,0 +1,148 @@
+#! /bin/sh -e
+
+# DP: don't bogusly check if the 64bit binaries also work,
+# DP: which does break on 32bit kernels.
+
+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
+
+--- libstdc++-v3/configure.orig 2005-11-15 15:41:44.871292824 +0100
++++ libstdc++-v3/configure 2005-11-17 13:14:09.147974424 +0100
+@@ -2499,7 +2499,7 @@
+ echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+ # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+ # If not cross compiling, check that we can run a simple program.
+-if test "$cross_compiling" != yes; then
++if false && test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+--- zlib/configure.orig 2005-11-02 00:26:08.000000000 +0100
++++ zlib/configure 2005-11-17 13:14:09.359942200 +0100
+@@ -2390,7 +2390,7 @@
+ echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+ # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+ # If not cross compiling, check that we can run a simple program.
+-if test "$cross_compiling" != yes; then
++if false && test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+--- libobjc/configure.orig 2005-11-02 00:26:08.000000000 +0100
++++ libobjc/configure 2005-11-17 13:14:09.340945088 +0100
+@@ -2095,7 +2095,7 @@
+ echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+ # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+ # If not cross compiling, check that we can run a simple program.
+-if test "$cross_compiling" != yes; then
++if false && test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+--- libgfortran/configure.orig 2005-11-07 14:53:46.000000000 +0100
++++ libgfortran/configure 2005-11-17 13:14:09.233961352 +0100
+@@ -2448,7 +2448,7 @@
+ echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+ # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+ # If not cross compiling, check that we can run a simple program.
+-if test "$cross_compiling" != yes; then
++if false && test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+--- libmudflap/configure.orig 2005-11-02 00:26:08.000000000 +0100
++++ libmudflap/configure 2005-11-17 13:14:09.310949648 +0100
+@@ -2350,7 +2350,8 @@
+ echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+ # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+ # If not cross compiling, check that we can run a simple program.
+-if test "$cross_compiling" != yes; then
++# Check disabled as it doesn't catch 64 bit biarch builds on 32 bit archs.
++if false && test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+--- boehm-gc/configure.orig 2005-11-02 00:26:08.000000000 +0100
++++ boehm-gc/configure 2005-11-17 13:14:09.169971080 +0100
+@@ -2347,7 +2347,7 @@
+ echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+ # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+ # If not cross compiling, check that we can run a simple program.
+-if test "$cross_compiling" != yes; then
++if false && test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+--- libffi/configure.orig 2005-11-02 00:26:08.000000000 +0100
++++ libffi/configure 2005-11-17 13:14:09.190967888 +0100
+@@ -2312,7 +2312,7 @@
+ echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+ # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+ # If not cross compiling, check that we can run a simple program.
+-if test "$cross_compiling" != yes; then
++if false && test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+--- libssp/configure.orig 2005-11-17 13:13:08.013268312 +0100
++++ libssp/configure 2005-11-17 13:14:16.489858288 +0100
+@@ -2348,7 +2348,7 @@
+ echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+ # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+ # If not cross compiling, check that we can run a simple program.
+-if test "$cross_compiling" != yes; then
++if false && test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+--- libjava/libltdl/configure.orig 2005-11-02 00:26:08.000000000 +0100
++++ libjava/libltdl/configure 2005-11-17 13:14:09.263956792 +0100
+@@ -2424,7 +2424,7 @@
+ echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+ # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+ # If not cross compiling, check that we can run a simple program.
+-if test "$cross_compiling" != yes; then
++if false && test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+--- libjava/configure.orig 2005-11-02 00:26:08.000000000 +0100
++++ libjava/configure 2005-11-17 13:14:09.290952688 +0100
+@@ -2075,7 +2075,7 @@
+ echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+ # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+ # If not cross compiling, check that we can run a simple program.
+-if test "$cross_compiling" != yes; then
++if false && test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+--- libiberty/configure~ 2005-10-29 06:28:38.000000000 +0200
++++ libiberty/configure 2005-11-23 14:41:22.313633384 +0100
+@@ -2177,7 +2177,7 @@
+ echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+ # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+ # If not cross compiling, check that we can run a simple program.
+-if test "$cross_compiling" != yes; then
++if false && test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
--- gcc-4.1-4.1.2.orig/debian/patches/ada-default-project-path.dpatch
+++ gcc-4.1-4.1.2/debian/patches/ada-default-project-path.dpatch
@@ -0,0 +1,101 @@
+#! /bin/sh -e
+
+# DP: - Change the default search path for project files to the one specified
+# DP: by the Debian Policy for Ada: /usr/share/ada/adainclude.
+
+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.old/ada/prj-ext.adb 2005-11-15 15:01:18.000000000 +0100
++++ gcc/ada/prj-ext.adb 2006-03-22 09:09:51.000000000 +0100
+@@ -282,9 +282,7 @@
+ if Add_Default_Dir then
+ Current_Project_Path :=
+ new String'(Name_Buffer (1 .. Name_Len) & Path_Separator &
+- Sdefault.Search_Dir_Prefix.all & ".." &
+- Directory_Separator & ".." & Directory_Separator &
+- ".." & Directory_Separator & "gnat");
++ Sdefault.Search_Dir_Prefix.all);
+ else
+ Current_Project_Path := new String'(Name_Buffer (1 .. Name_Len));
+ end if;
+--- gcc.old/ada/gnatls.adb 2005-07-01 03:29:17.000000000 +0200
++++ gcc/ada/gnatls.adb 2006-03-22 12:19:39.000000000 +0100
+@@ -1547,9 +1547,6 @@
+ declare
+ Project_Path : constant String_Access := Getenv (Ada_Project_Path);
+
+- Lib : constant String :=
+- Directory_Separator & "lib" & Directory_Separator;
+-
+ First : Natural;
+ Last : Natural;
+
+@@ -1605,35 +1602,9 @@
+ if Add_Default_Dir then
+ Name_Len := 0;
+ Add_Str_To_Name_Buffer (Sdefault.Search_Dir_Prefix.all);
+-
+- -- On Windows, make sure that all directory separators are '\'
+-
+- if Directory_Separator /= '/' then
+- for J in 1 .. Name_Len loop
+- if Name_Buffer (J) = '/' then
+- Name_Buffer (J) := Directory_Separator;
+- end if;
+- end loop;
+- end if;
+-
+- -- Find the sequence "/lib/"
+-
+- while Name_Len >= Lib'Length
+- and then Name_Buffer (Name_Len - 4 .. Name_Len) /= Lib
+- loop
+- Name_Len := Name_Len - 1;
+- end loop;
+-
+- -- If the sequence "/lib"/ was found, display the default
+- -- directory /lib/gnat/.
+-
+- if Name_Len >= 5 then
+- Write_Str (" ");
+- Write_Str (Name_Buffer (1 .. Name_Len));
+- Write_Str ("gnat");
+- Write_Char (Directory_Separator);
+- Write_Eol;
+- end if;
++ Write_Str (" ");
++ Write_Str (Name_Buffer (1 .. Name_Len));
++ Write_Eol;
+ end if;
+ end;
+
+--- gcc.old/ada/Make-lang.in
++++ gcc/ada/Make-lang.in
+@@ -930,7 +930,7 @@
+ $(ECHO) " S1 : constant String := \"$(ADA_INCLUDE_DIR)/\";" >>tmp-sdefault.adb
+ $(ECHO) " S2 : constant String := \"$(ADA_RTL_OBJ_DIR)/\";" >>tmp-sdefault.adb
+ $(ECHO) " S3 : constant String := \"$(target)/\";" >>tmp-sdefault.adb
+- $(ECHO) " S4 : constant String := \"$(libsubdir)/\";" >>tmp-sdefault.adb
++ $(ECHO) " S4 : constant String := \"/usr/share/ada/adainclude/\";" >>tmp-sdefault.adb
+ $(ECHO) " function Include_Dir_Default_Name return String_Ptr is" >>tmp-sdefault.adb
+ $(ECHO) " begin" >>tmp-sdefault.adb
+ $(ECHO) " return Relocate_Path (S0, S1);" >>tmp-sdefault.adb
--- gcc-4.1-4.1.2.orig/debian/patches/gcc-driver-extra-langs.dpatch
+++ gcc-4.1-4.1.2/debian/patches/gcc-driver-extra-langs.dpatch
@@ -0,0 +1,40 @@
+#! /bin/sh -e
+
+# DP: Add options and specs for languages that are not built from a source
+# DP: (but built from separate sources).
+
+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~ 2006-07-11 14:03:25.865618000 +0200
++++ gcc/Makefile.in 2006-07-11 21:15:30.011548776 +0200
+@@ -424,8 +424,8 @@
+ xm_include_list=@xm_include_list@
+ xm_defines=@xm_defines@
+ lang_checks=check-gcc
+-lang_opt_files=@lang_opt_files@ $(srcdir)/c.opt $(srcdir)/common.opt
+-lang_specs_files=@lang_specs_files@
++lang_opt_files=$(sort @lang_opt_files@ $(foreach lang,$(debian_extra_langs),$(srcdir)/$(lang)/lang.opt)) $(srcdir)/c.opt $(srcdir)/common.opt
++lang_specs_files=$(sort @lang_specs_files@ $(foreach lang,$(debian_extra_langs),$(srcdir)/$(lang)/lang-specs.h))
+ lang_tree_files=@lang_tree_files@
+ target_cpu_default=@target_cpu_default@
+ GCC_THREAD_FILE=@thread_file@
--- gcc-4.1-4.1.2.orig/debian/patches/gpc-gcc-4.1.diff
+++ gcc-4.1-4.1.2/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.2.orig/debian/patches/sparc-niagara.dpatch
+++ gcc-4.1-4.1.2/debian/patches/sparc-niagara.dpatch
@@ -0,0 +1,589 @@
+#! /bin/sh -e
+
+# DP: Backport of sparc niagara 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
+
+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/config.gcc
+===================================================================
+--- gcc/config.gcc (revision 111647)
++++ gcc/config.gcc (working copy)
+@@ -2830,7 +2830,7 @@
+ "" | sparc | sparcv9 | sparc64 | sparc86x \
+ | v7 | cypress | v8 | supersparc | sparclite | f930 \
+ | f934 | hypersparc | sparclite86x | sparclet | tsc701 \
+- | v9 | ultrasparc | ultrasparc3)
++ | v9 | ultrasparc | ultrasparc3 | niagara)
+ # OK
+ ;;
+ *)
+Index: gcc/config/sparc/linux64.h
+===================================================================
+--- gcc/config/sparc/linux64.h (revision 111647)
++++ gcc/config/sparc/linux64.h (working copy)
+@@ -43,7 +43,8 @@
+
+ #if TARGET_CPU_DEFAULT == TARGET_CPU_v9 \
+ || TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc \
+- || TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc3
++ || TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc3 \
++ || TARGET_CPU_DEFAULT == TARGET_CPU_niagara
+ /* A 64 bit v9 compiler with stack-bias,
+ in a Medium/Low code model environment. */
+
+Index: gcc/config/sparc/niagara.md
+===================================================================
+--- gcc/config/sparc/niagara.md (revision 0)
++++ gcc/config/sparc/niagara.md (revision 0)
+@@ -0,0 +1,119 @@
++;; Scheduling description for Niagara.
++;; 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.
++
++;; Niagara is a single-issue processor.
++
++(define_automaton "niagara_0")
++
++(define_cpu_unit "niag_pipe" "niagara_0")
++
++(define_insn_reservation "niag_5cycle" 5
++ (and (eq_attr "cpu" "niagara")
++ (eq_attr "type" "multi,flushw,iflush,trap"))
++ "niag_pipe*5")
++
++(define_insn_reservation "niag_4cycle" 4
++ (and (eq_attr "cpu" "niagara")
++ (eq_attr "type" "savew"))
++ "niag_pipe*4")
++
++/* Most basic operations are single-cycle. */
++(define_insn_reservation "niag_ialu" 1
++ (and (eq_attr "cpu" "niagara")
++ (eq_attr "type" "ialu,shift,compare,cmove"))
++ "niag_pipe")
++
++(define_insn_reservation "niag_imul" 11
++ (and (eq_attr "cpu" "niagara")
++ (eq_attr "type" "imul"))
++ "niag_pipe*11")
++
++(define_insn_reservation "niag_idiv" 72
++ (and (eq_attr "cpu" "niagara")
++ (eq_attr "type" "idiv"))
++ "niag_pipe*72")
++
++(define_insn_reservation "niag_branch" 3
++ (and (eq_attr "cpu" "niagara")
++ (eq_attr "type" "call,sibcall,call_no_delay_slot,uncond_branch,branch"))
++ "niag_pipe*3")
++
++(define_insn_reservation "niag_3cycle_load" 3
++ (and (eq_attr "cpu" "niagara")
++ (eq_attr "type" "load"))
++ "niag_pipe*3")
++
++(define_insn_reservation "niag_9cycle_load" 9
++ (and (eq_attr "cpu" "niagara")
++ (eq_attr "type" "fpload"))
++ "niag_pipe*9")
++
++(define_insn_reservation "niag_1cycle_store" 1
++ (and (eq_attr "cpu" "niagara")
++ (eq_attr "type" "store"))
++ "niag_pipe")
++
++(define_insn_reservation "niag_8cycle_store" 8
++ (and (eq_attr "cpu" "niagara")
++ (eq_attr "type" "fpstore"))
++ "niag_pipe*8")
++
++/* Things incorrectly modelled here:
++ * FPADD{s,d}: 26 cycles
++ * FPSUB{s,d}: 26 cycles
++ * FABSD: 26 cycles
++ * F{s,d}TO{s,d}: 26 cycles
++ * F{s,d}TO{i,x}: 26 cycles
++ * FSMULD: 29 cycles
++ */
++(define_insn_reservation "niag_fmov" 8
++ (and (eq_attr "cpu" "niagara")
++ (eq_attr "type" "fpmove,fpcmove,fpcrmove"))
++ "niag_pipe*8")
++
++(define_insn_reservation "niag_fpcmp" 26
++ (and (eq_attr "cpu" "niagara")
++ (eq_attr "type" "fpcmp"))
++ "niag_pipe*26")
++
++(define_insn_reservation "niag_fmult" 29
++ (and (eq_attr "cpu" "niagara")
++ (eq_attr "type" "fpmul"))
++ "niag_pipe*29")
++
++(define_insn_reservation "niag_fdivs" 54
++ (and (eq_attr "cpu" "niagara")
++ (eq_attr "type" "fpdivs"))
++ "niag_pipe*54")
++
++(define_insn_reservation "niag_fdivd" 83
++ (and (eq_attr "cpu" "niagara")
++ (eq_attr "type" "fpdivd"))
++ "niag_pipe*83")
++
++/* Things incorrectly modelled here:
++ * FPADD{16,32}: 10 cycles
++ * FPSUB{16,32}: 10 cycles
++ * FALIGNDATA: 10 cycles
++ */
++(define_insn_reservation "niag_vis" 8
++ (and (eq_attr "cpu" "niagara")
++ (eq_attr "type" "fga,fgm_pack,fgm_mul,fgm_cmp,fgm_pdist"))
++ "niag_pipe*8")
+Index: gcc/config/sparc/sol2-bi.h
+===================================================================
+--- gcc/config/sparc/sol2-bi.h (revision 111647)
++++ gcc/config/sparc/sol2-bi.h (working copy)
+@@ -39,6 +39,15 @@
+ #define ASM_CPU64_DEFAULT_SPEC AS_SPARC64_FLAG "b"
+ #endif
+
++#if TARGET_CPU_DEFAULT == TARGET_CPU_niagara
++#undef CPP_CPU64_DEFAULT_SPEC
++#define CPP_CPU64_DEFAULT_SPEC ""
++#undef ASM_CPU32_DEFAULT_SPEC
++#define ASM_CPU32_DEFAULT_SPEC "-xarch=v8plusb"
++#undef ASM_CPU64_DEFAULT_SPEC
++#define ASM_CPU64_DEFAULT_SPEC AS_SPARC64_FLAG "b"
++#endif
++
+ #if DEFAULT_ARCH32_P
+ #define DEF_ARCH32_SPEC(__str) "%{!m64:" __str "}"
+ #define DEF_ARCH64_SPEC(__str) "%{m64:" __str "}"
+@@ -57,7 +66,7 @@
+ %{mcpu=sparclite|mcpu-f930|mcpu=f934:-D__sparclite__} \
+ %{mcpu=v8:" DEF_ARCH32_SPEC("-D__sparcv8") "} \
+ %{mcpu=supersparc:-D__supersparc__ " DEF_ARCH32_SPEC("-D__sparcv8") "} \
+-%{mcpu=v9|mcpu=ultrasparc|mcpu=ultrasparc3:" DEF_ARCH32_SPEC("-D__sparcv8") "} \
++%{mcpu=v9|mcpu=ultrasparc|mcpu=ultrasparc3|mcpu=niagara:" DEF_ARCH32_SPEC("-D__sparcv8") "} \
+ %{!mcpu*:%{!mcypress:%{!msparclite:%{!mf930:%{!mf934:%{!mv8:%{!msupersparc:%(cpp_cpu_default)}}}}}}} \
+ "
+
+@@ -66,7 +75,8 @@
+ %{mcpu=v9:" DEF_ARCH32_SPEC("-xarch=v8plus") DEF_ARCH64_SPEC(AS_SPARC64_FLAG) "} \
+ %{mcpu=ultrasparc:" DEF_ARCH32_SPEC("-xarch=v8plusa") DEF_ARCH64_SPEC(AS_SPARC64_FLAG "a") "} \
+ %{mcpu=ultrasparc3:" DEF_ARCH32_SPEC("-xarch=v8plusb") DEF_ARCH64_SPEC(AS_SPARC64_FLAG "b") "} \
+-%{!mcpu=ultrasparc3:%{!mcpu=ultrasparc:%{!mcpu=v9:%{mcpu*:" DEF_ARCH32_SPEC("-xarch=v8") DEF_ARCH64_SPEC(AS_SPARC64_FLAG) "}}}} \
++%{mcpu=niagara:" DEF_ARCH32_SPEC("-xarch=v8plusb") DEF_ARCH64_SPEC(AS_SPARC64_FLAG "b") "} \
++%{!mcpu=niagara:%{!mcpu=ultrasparc3:%{!mcpu=ultrasparc:%{!mcpu=v9:%{mcpu*:" DEF_ARCH32_SPEC("-xarch=v8") DEF_ARCH64_SPEC(AS_SPARC64_FLAG) "}}}}} \
+ %{!mcpu*:%(asm_cpu_default)} \
+ "
+
+Index: gcc/config/sparc/sol2.h
+===================================================================
+--- gcc/config/sparc/sol2.h (revision 111647)
++++ gcc/config/sparc/sol2.h (working copy)
+@@ -1,6 +1,6 @@
+ /* Definitions of target machine for GCC, for SPARC running Solaris 2
+- Copyright 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005
+- Free Software Foundation, Inc.
++ Copyright 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005,
++ 2006 Free Software Foundation, Inc.
+ Contributed by Ron Guilmette (rfg@netcom.com).
+ Additional changes by David V. Henkel-Wallace (gumby@cygnus.com).
+
+@@ -41,11 +41,17 @@
+ #define ASM_CPU_DEFAULT_SPEC "-xarch=v8plusb"
+ #endif
+
++#if TARGET_CPU_DEFAULT == TARGET_CPU_niagara
++#undef ASM_CPU_DEFAULT_SPEC
++#define ASM_CPU_DEFAULT_SPEC "-xarch=v8plusb"
++#endif
++
+ #undef ASM_CPU_SPEC
+ #define ASM_CPU_SPEC "\
+ %{mcpu=v9:-xarch=v8plus} \
+ %{mcpu=ultrasparc:-xarch=v8plusa} \
+ %{mcpu=ultrasparc3:-xarch=v8plusb} \
++%{mcpu=niagara:-xarch=v8plusb} \
+ %{!mcpu*:%(asm_cpu_default)} \
+ "
+
+Index: gcc/config/sparc/sparc.c
+===================================================================
+--- gcc/config/sparc/sparc.c (revision 111647)
++++ gcc/config/sparc/sparc.c (working copy)
+@@ -197,6 +197,30 @@
+ 0, /* shift penalty */
+ };
+
++static const
++struct processor_costs niagara_costs = {
++ COSTS_N_INSNS (3), /* int load */
++ COSTS_N_INSNS (3), /* int signed load */
++ COSTS_N_INSNS (3), /* int zeroed load */
++ COSTS_N_INSNS (9), /* float load */
++ COSTS_N_INSNS (8), /* fmov, fneg, fabs */
++ COSTS_N_INSNS (8), /* fadd, fsub */
++ COSTS_N_INSNS (26), /* fcmp */
++ COSTS_N_INSNS (8), /* fmov, fmovr */
++ COSTS_N_INSNS (29), /* fmul */
++ COSTS_N_INSNS (54), /* fdivs */
++ COSTS_N_INSNS (83), /* fdivd */
++ COSTS_N_INSNS (100), /* fsqrts - not implemented in hardware */
++ COSTS_N_INSNS (100), /* fsqrtd - not implemented in hardware */
++ COSTS_N_INSNS (11), /* imul */
++ COSTS_N_INSNS (11), /* imulX */
++ 0, /* imul bit factor */
++ COSTS_N_INSNS (72), /* idiv */
++ COSTS_N_INSNS (72), /* idivX */
++ COSTS_N_INSNS (1), /* movcc/movr */
++ 0, /* shift penalty */
++};
++
+ const struct processor_costs *sparc_costs = &cypress_costs;
+
+ #ifdef HAVE_AS_RELAX_OPTION
+@@ -597,6 +621,7 @@
+ { TARGET_CPU_v9, "v9" },
+ { TARGET_CPU_ultrasparc, "ultrasparc" },
+ { TARGET_CPU_ultrasparc3, "ultrasparc3" },
++ { TARGET_CPU_niagara, "niagara" },
+ { 0, 0 }
+ };
+ const struct cpu_default *def;
+@@ -632,6 +657,8 @@
+ /* TI ultrasparc III */
+ /* ??? Check if %y issue still holds true in ultra3. */
+ { "ultrasparc3", PROCESSOR_ULTRASPARC3, MASK_ISA, MASK_V9|MASK_DEPRECATED_V8_INSNS},
++ /* UltraSPARC T1 */
++ { "niagara", PROCESSOR_NIAGARA, MASK_ISA, MASK_V9|MASK_DEPRECATED_V8_INSNS},
+ { 0, 0, 0, 0 }
+ };
+ const struct cpu_table *cpu;
+@@ -741,7 +768,8 @@
+ /* Supply a default value for align_functions. */
+ if (align_functions == 0
+ && (sparc_cpu == PROCESSOR_ULTRASPARC
+- || sparc_cpu == PROCESSOR_ULTRASPARC3))
++ || sparc_cpu == PROCESSOR_ULTRASPARC3
++ || sparc_cpu == PROCESSOR_NIAGARA))
+ align_functions = 32;
+
+ /* Validate PCC_STRUCT_RETURN. */
+@@ -790,6 +818,9 @@
+ case PROCESSOR_ULTRASPARC3:
+ sparc_costs = &ultrasparc3_costs;
+ break;
++ case PROCESSOR_NIAGARA:
++ sparc_costs = &niagara_costs;
++ break;
+ };
+
+ #ifdef TARGET_DEFAULT_LONG_DOUBLE_128
+@@ -7099,7 +7130,8 @@
+ aligned on a 16 byte boundary so one flush clears it all. */
+ emit_insn (gen_flush (validize_mem (gen_rtx_MEM (SImode, tramp))));
+ if (sparc_cpu != PROCESSOR_ULTRASPARC
+- && sparc_cpu != PROCESSOR_ULTRASPARC3)
++ && sparc_cpu != PROCESSOR_ULTRASPARC3
++ && sparc_cpu != PROCESSOR_NIAGARA)
+ emit_insn (gen_flush (validize_mem (gen_rtx_MEM (SImode,
+ plus_constant (tramp, 8)))));
+
+@@ -7141,7 +7173,8 @@
+ emit_insn (gen_flushdi (validize_mem (gen_rtx_MEM (DImode, tramp))));
+
+ if (sparc_cpu != PROCESSOR_ULTRASPARC
+- && sparc_cpu != PROCESSOR_ULTRASPARC3)
++ && sparc_cpu != PROCESSOR_ULTRASPARC3
++ && sparc_cpu != PROCESSOR_NIAGARA)
+ emit_insn (gen_flushdi (validize_mem (gen_rtx_MEM (DImode, plus_constant (tramp, 8)))));
+
+ /* Call __enable_execute_stack after writing onto the stack to make sure
+@@ -7321,6 +7354,8 @@
+ static int
+ sparc_use_sched_lookahead (void)
+ {
++ if (sparc_cpu == PROCESSOR_NIAGARA)
++ return 0;
+ if (sparc_cpu == PROCESSOR_ULTRASPARC
+ || sparc_cpu == PROCESSOR_ULTRASPARC3)
+ return 4;
+@@ -7336,6 +7371,7 @@
+ {
+ switch (sparc_cpu)
+ {
++ case PROCESSOR_NIAGARA:
+ default:
+ return 1;
+ case PROCESSOR_V9:
+Index: gcc/config/sparc/sparc.h
+===================================================================
+--- gcc/config/sparc/sparc.h (revision 111647)
++++ gcc/config/sparc/sparc.h (working copy)
+@@ -1,6 +1,6 @@
+ /* Definitions of target machine for GNU compiler, for Sun SPARC.
+ Copyright (C) 1987, 1988, 1989, 1992, 1994, 1995, 1996, 1997, 1998, 1999
+- 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
++ 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+ Contributed by Michael Tiemann (tiemann@cygnus.com).
+ 64-bit SPARC-V9 support by Michael Tiemann, Jim Wilson, and Doug Evans,
+ at Cygnus Support.
+@@ -206,7 +206,7 @@
+ which requires the following macro to be true if enabled. Prior to V9,
+ there are no instructions to even talk about memory synchronization.
+ Note that the UltraSPARC III processors don't implement RMO, unlike the
+- UltraSPARC II processors.
++ UltraSPARC II processors. Niagara does not implement RMO either.
+
+ Default to false; for example, Solaris never enables RMO, only ever uses
+ total memory ordering (TMO). */
+@@ -238,10 +238,12 @@
+ #define TARGET_CPU_sparc64 7 /* alias */
+ #define TARGET_CPU_ultrasparc 8
+ #define TARGET_CPU_ultrasparc3 9
++#define TARGET_CPU_niagara 10
+
+ #if TARGET_CPU_DEFAULT == TARGET_CPU_v9 \
+ || TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc \
+- || TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc3
++ || TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc3 \
++ || TARGET_CPU_DEFAULT == TARGET_CPU_niagara
+
+ #define CPP_CPU32_DEFAULT_SPEC ""
+ #define ASM_CPU32_DEFAULT_SPEC ""
+@@ -262,6 +264,10 @@
+ #define CPP_CPU64_DEFAULT_SPEC "-D__sparc_v9__"
+ #define ASM_CPU64_DEFAULT_SPEC "-Av9b"
+ #endif
++#if TARGET_CPU_DEFAULT == TARGET_CPU_niagara
++#define CPP_CPU64_DEFAULT_SPEC "-D__sparc_v9__"
++#define ASM_CPU64_DEFAULT_SPEC "-Av9b"
++#endif
+
+ #else
+
+@@ -352,6 +358,7 @@
+ %{mcpu=v9:-D__sparc_v9__} \
+ %{mcpu=ultrasparc:-D__sparc_v9__} \
+ %{mcpu=ultrasparc3:-D__sparc_v9__} \
++%{mcpu=niagara:-D__sparc_v9__} \
+ %{!mcpu*:%{!mcypress:%{!msparclite:%{!mf930:%{!mf934:%{!mv8:%{!msupersparc:%(cpp_cpu_default)}}}}}}} \
+ "
+ #define CPP_ARCH32_SPEC ""
+@@ -401,6 +408,7 @@
+ %{mcpu=v9:-Av9} \
+ %{mcpu=ultrasparc:%{!mv8plus:-Av9a}} \
+ %{mcpu=ultrasparc3:%{!mv8plus:-Av9b}} \
++%{mcpu=niagara:%{!mv8plus:-Av9b}} \
+ %{!mcpu*:%{!mcypress:%{!msparclite:%{!mf930:%{!mf934:%{!mv8:%{!msupersparc:%(asm_cpu_default)}}}}}}} \
+ "
+
+@@ -524,7 +532,8 @@
+ PROCESSOR_TSC701,
+ PROCESSOR_V9,
+ PROCESSOR_ULTRASPARC,
+- PROCESSOR_ULTRASPARC3
++ PROCESSOR_ULTRASPARC3,
++ PROCESSOR_NIAGARA
+ };
+
+ /* This is set from -m{cpu,tune}=xxx. */
+@@ -2137,7 +2146,8 @@
+ || (GENERAL_OR_I64 (CLASS1) && FP_REG_CLASS_P (CLASS2)) \
+ || (CLASS1) == FPCC_REGS || (CLASS2) == FPCC_REGS) \
+ ? ((sparc_cpu == PROCESSOR_ULTRASPARC \
+- || sparc_cpu == PROCESSOR_ULTRASPARC3) ? 12 : 6) : 2)
++ || sparc_cpu == PROCESSOR_ULTRASPARC3 \
++ || sparc_cpu == PROCESSOR_NIAGARA) ? 12 : 6) : 2)
+
+ /* Provide the cost of a branch. For pre-v9 processors we use
+ a value of 3 to take into account the potential annulling of
+@@ -2147,22 +2157,30 @@
+
+ On v9 and later, which have branch prediction facilities, we set
+ it to the depth of the pipeline as that is the cost of a
+- mispredicted branch. */
++ mispredicted branch.
+
++ On Niagara, normal branches insert 3 bubbles into the pipe
++ and annulled branches insert 4 bubbles. */
++
+ #define BRANCH_COST \
+ ((sparc_cpu == PROCESSOR_V9 \
+ || sparc_cpu == PROCESSOR_ULTRASPARC) \
+ ? 7 \
+ : (sparc_cpu == PROCESSOR_ULTRASPARC3 \
+- ? 9 : 3))
++ ? 9 \
++ : (sparc_cpu == PROCESSOR_NIAGARA \
++ ? 4 \
++ : 3)))
+
+ #define PREFETCH_BLOCK \
+ ((sparc_cpu == PROCESSOR_ULTRASPARC \
+- || sparc_cpu == PROCESSOR_ULTRASPARC3) \
++ || sparc_cpu == PROCESSOR_ULTRASPARC3 \
++ || sparc_cpu == PROCESSOR_NIAGARA) \
+ ? 64 : 32)
+
+ #define SIMULTANEOUS_PREFETCHES \
+- ((sparc_cpu == PROCESSOR_ULTRASPARC) \
++ ((sparc_cpu == PROCESSOR_ULTRASPARC \
++ || sparc_cpu == PROCESSOR_NIAGARA) \
+ ? 2 \
+ : (sparc_cpu == PROCESSOR_ULTRASPARC3 \
+ ? 8 : 3))
+Index: gcc/config/sparc/sparc.md
+===================================================================
+--- gcc/config/sparc/sparc.md (revision 111647)
++++ gcc/config/sparc/sparc.md (working copy)
+@@ -1,6 +1,6 @@
+ ;; Machine description for SPARC chip for GCC
+ ;; Copyright (C) 1987, 1988, 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.
+ ;; Contributed by Michael Tiemann (tiemann@cygnus.com)
+ ;; 64-bit SPARC-V9 support by Michael Tiemann, Jim Wilson, and Doug Evans,
+ ;; at Cygnus Support.
+@@ -94,7 +94,8 @@
+ sparclet,tsc701,
+ v9,
+ ultrasparc,
+- ultrasparc3"
++ ultrasparc3,
++ niagara"
+ (const (symbol_ref "sparc_cpu_attr")))
+
+ ;; Attribute for the instruction set.
+@@ -315,6 +316,7 @@
+ (include "sparclet.md")
+ (include "ultra1_2.md")
+ (include "ultra3.md")
++(include "niagara.md")
+
+
+ ;; Operand and operator predicates.
+#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.2.orig/debian/patches/gpc-4.1.dpatch
+++ gcc-4.1-4.1.2/debian/patches/gpc-4.1.dpatch
@@ -0,0 +1,3369 @@
+#! /bin/sh -e
+
+# DP: GPC updates for GCC 4.1 (4.1-4)
+
+dir=gcc/
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3/gcc"
+ dir="$3/gcc/"
+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
+
+Only in gpc/p: .#Make-lang.in.1.7
+Only in gpc/p: .#declarations.c.1.14
+Only in gpc/p: .#expressions.c.1.10
+Only in gpc/p: .#gbe.h.1.4
+Only in gpc/p: .#gpc-lex.c.1.9
+Only in gpc/p: .#gpc.h.1.13
+Only in gpc/p: .#gpcpp.c.1.8
+Only in gpc/p: .#lang.c.1.15
+Only in gpc/p: .#module.c.1.10
+Only in gpc/p: .#objects.c.1.12
+Only in gpc/p: .#options.c.1.9
+Only in gpc/p: .#p-tree.def.1.6
+Only in gpc/p: .#parse.y.1.14
+Only in gpc/p: .#predef.c.1.15
+Only in gpc/p: .#statements.c.1.9
+Only in gpc/p: .#typecheck.c.1.10
+Only in gpc/p: .#types.c.1.17
+Common subdirectories: /pom/kompi/gcc/tst45/pom/gpc-20060325/p/CVS and gpc/p/CVS
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/ChangeLog gpc/p/ChangeLog
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/ChangeLog 2006-03-24 02:47:15.000000000 +0100
++++ gpc/p/ChangeLog 2006-04-06 02:11:56.000000000 +0200
+@@ -1,5 +1,16 @@
+ ChangeLog -- Edit History for GPC, the GNU Pascal Compiler, since version 2.1
+ =============================================================================
++2006-03-24 Waldek Hebisch
++
++ * Make-lang.in, config-lang.in, declarations.c, expressions.c,
++ gbe.h, gpc-lex.c, gpc.c, gpc.h, lang.c, module.c, objects.c,
++ options.c, opts.sum, p-tree.def, parse.y, pascal-lex.l,
++ predef.c, statements.c, typecheck.c, types.c, utils/Makefile
++ utils/gpidump.pas, utils/mk-t-inc: adapted to gcc-4.0,
++ schema changed to use placeholders
++ plant.c, plant.h, diffs/gcc-4.0.2.diff, diffs/gcc-4.0.3.diff:
++ new files
++
+ 2006-03-09 Waldek Hebisch
+
+ * predef.c: build_predef_call (): handle named exit from a method
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/FAQ gpc/p/FAQ
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/FAQ 2006-02-18 14:37:53.000000000 +0100
++++ gpc/p/FAQ 2006-04-04 19:39:50.000000000 +0200
+@@ -62,7 +62,7 @@
+ What is the current version?
+ ============================
+
+-The current version is 20060215.
++The current version is 20060325.
+
+ Releases are available as a source archive and precompiled binaries
+ for several common platforms from the GPC web site,
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/Make-lang.in gpc/p/Make-lang.in
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/Make-lang.in 2006-03-25 04:33:50.000000000 +0100
++++ gpc/p/Make-lang.in 2006-04-06 02:11:56.000000000 +0200
+@@ -56,6 +56,7 @@
+ # `40' for gcc-4.x
+ GPC_GCC_2_=2
+ GPC_GCC_28_=8
++GPC_GCC_28_PPQ=$(GPC_GCC_28_$(gcc_version)$(BACKEND)
+ GPC_GCC_34_PPQ_=foo
+ GPC_GCC_34_PPP=$(GPC_GCC_34_PPQ_$(target_noncanonical))
+ GPC_GCC_34_PP_=34
+@@ -65,7 +66,7 @@
+ GPC_GCC_40_PP_=40
+ GPC_GCC_40_PP_fallback_to_34=$(GPC_GCC_34_)
+ GPC_GCC_40_=$(GPC_GCC_40_PP_$(GPC_GCC_40_PPP))
+-GCC_VERSION_FOR_GPC=$(GPC_GCC_2_$(BACKEND))$(GPC_GCC_28_$(gcc_version))
++GCC_VERSION_FOR_GPC=$(GPC_GCC_2_$(BACKEND))$(GPC_GCC_28_PPQ)
+ GCC_VERSION_FOR_GPC34=$(GCC_VERSION_FOR_GPC)$(GPC_GCC_34_)
+ GCC_VERSION_FOR_GPC40=$(GCC_VERSION_FOR_GPC)$(GPC_GCC_40_)
+ GPC_GCC_VERSION_28=$(version)
+@@ -733,7 +734,9 @@
+ $(CC) -o $@ -c $(ALL_GPC_GBE_FLAGS) $<
+
+ p/version.o: version.c $(GPC_BE_H)
+- $(CC) -o $@ -c $(ALL_GPC_GBE_FLAGS) $<
++ $(CC) -o $@ -c $(ALL_GPC_GBE_FLAGS) \
++ -DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \
++ -DDEVPHASE=$(DEVPHASE_s) $<
+
+ $(srcdir)/p/pascal-lex.c: $(srcdir)/p/pascal-lex.l
+ if $(GPC_LEX) --version | grep -q '2\.5\.4'; then \
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/Make-lang.in~ gpc/p/Make-lang.in~
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/Make-lang.in~ 2006-03-25 01:43:44.000000000 +0100
++++ gpc/p/Make-lang.in~ 2006-04-04 18:40:42.000000000 +0200
+@@ -631,7 +631,7 @@
+ s: version.o::g;' "$<" > "$@" || { rm -f "$@"; false; }
+
+ gpc1$(exeext): $(P) $(GPC_GCC_VERSION_DEPS) $(GPC_OBJS) $(LIBDEPS)
+- @grep "@@ PATCHED FOR GPC 20051114 @@" $(srcdir)/stor-layout.c > /dev/null || \
++ @grep "@@ PATCHED FOR GPC 20060322 @@" $(srcdir)/stor-layout.c > /dev/null || \
+ { echo "*** There have been changes in the patch for GCC. Please start with a fresh"; \
+ echo "*** copy of the GCC sources and do a new build, including configure."; \
+ exit 1; } >&2
+@@ -733,7 +733,9 @@
+ $(CC) -o $@ -c $(ALL_GPC_GBE_FLAGS) $<
+
+ p/version.o: version.c $(GPC_BE_H)
+- $(CC) -o $@ -c $(ALL_GPC_GBE_FLAGS) $<
++ $(CC) -o $@ -c $(ALL_GPC_GBE_FLAGS) \
++ -DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \
++ -DDEVPHASE=$(DEVPHASE_s) $<
+
+ $(srcdir)/p/pascal-lex.c: $(srcdir)/p/pascal-lex.l
+ if $(GPC_LEX) --version | grep -q '2\.5\.4'; then \
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/config-lang.in gpc/p/config-lang.in
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/config-lang.in 2006-03-25 03:50:32.000000000 +0100
++++ gpc/p/config-lang.in 2006-04-04 18:44:47.000000000 +0200
+@@ -93,7 +93,7 @@
+ echo "***" >&2
+ echo "*** Press ENTER to continue, Ctrl-C to abort." >&2
+ echo "***" >&2
+- read junk
++# read junk
+ fi
+ fi
+ fi
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/config-lang.in~ gpc/p/config-lang.in~
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/config-lang.in~ 2006-03-25 03:02:46.000000000 +0100
++++ gpc/p/config-lang.in~ 2006-04-04 18:25:25.000000000 +0200
+@@ -129,8 +129,11 @@
+ if [ ! -r "$srcdir/p/diffs/gcc-3.4.5.diff" ]; then
+ (cd "$srcdir/p/diffs"; ln -s "gcc-3.4.4.diff" "gcc-3.4.5.diff")
+ fi
++if [ ! -r "$srcdir/p/diffs/gcc-3.4.6.diff" ]; then
++ (cd "$srcdir/p/diffs"; ln -s "gcc-3.4.4.diff" "gcc-3.4.6.diff")
++fi
+
+-if grep "@@ PATCHED FOR GPC 20051114 @@" "$srcdir/stor-layout.c" > /dev/null; then
++if grep "@@ PATCHED FOR GPC 20060322 @@" "$srcdir/stor-layout.c" > /dev/null; then
+ :
+ elif grep "@@ PATCHED FOR GPC" "$srcdir/stor-layout.c" > /dev/null; then
+ echo "" >&2
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/declarations.c gpc/p/declarations.c
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/declarations.c 2006-03-13 01:33:16.000000000 +0100
++++ gpc/p/declarations.c 2006-04-09 21:55:21.000000000 +0200
+@@ -437,7 +437,11 @@
+ /* Clear out the local identifier meanings of this level. */
+ for (t = decls; t; t = TREE_CHAIN (t))
+ if (DECL_NAME (t))
+- IDENTIFIER_VALUE (DECL_NAME (t)) = NULL_TREE;
++ {
++ if (DECL_EXTERNAL (t) && TREE_ADDRESSABLE (t))
++ TREE_ADDRESSABLE (DECL_ASSEMBLER_NAME (t)) = 1;
++ IDENTIFIER_VALUE (DECL_NAME (t)) = NULL_TREE;
++ }
+ restore_identifiers (level->shadowed);
+
+ /* Not sure if this is a fix or work-around: Remove local external
+@@ -527,7 +531,7 @@
+ if (co->pascal_dialect & C_E_O_PASCAL)
+ error (msg2, IDENTIFIER_NAME (name));
+ else
+- warning (msg2, IDENTIFIER_NAME (name));
++ gpc_warning (msg2, IDENTIFIER_NAME (name));
+ }
+ check_id_redeclaration (name, msg1);
+ }
+@@ -903,7 +907,7 @@
+ if (TYPE_LANG_CODE_TEST (inner_type, PASCAL_LANG_ABSTRACT_OBJECT))
+ error ("abstract object type declared as value parameter");
+ else if (co->warn_object_assignment)
+- warning ("object type declared as value parameter");
++ gpc_warning ("object type declared as value parameter");
+ }
+ }
+ for (decl = parms; decl; decl = TREE_CHAIN (decl))
+@@ -988,10 +992,11 @@
+ && TREE_STRING_LENGTH (x) == TREE_STRING_LENGTH (y)
+ && !memcmp (TREE_STRING_POINTER (x), TREE_STRING_POINTER (y), TREE_STRING_LENGTH (x)))
+ return 1;
+- if (TREE_CODE (x) == CONSTRUCTOR
++ if (TREE_CODE (x) == PASCAL_SET_CONSTRUCTOR
+ && TREE_CODE (TREE_TYPE (x)) == SET_TYPE && TREE_CODE (TREE_TYPE (x)) == SET_TYPE
+ && comptypes (TREE_TYPE (x), TREE_TYPE (y))
+- && const_set_constructor_binary_op (EQ_EXPR, CONSTRUCTOR_ELTS (x), CONSTRUCTOR_ELTS (y)) == boolean_true_node)
++ && const_set_constructor_binary_op (EQ_EXPR, SET_CONSTRUCTOR_ELTS (x),
++ SET_CONSTRUCTOR_ELTS (y)) == boolean_true_node)
+ return 1;
+
+ return 0;
+@@ -1055,7 +1060,7 @@
+ DECL_CONTEXT (x) = NULL_TREE;
+
+ if (co->warn_local_external && DECL_EXTERNAL (x) && !DECL_ARTIFICIAL (x) && !pascal_global_bindings_p ())
+- warning ("local external declaration of `%s'", IDENTIFIER_NAME (name));
++ gpc_warning ("local external declaration of `%s'", IDENTIFIER_NAME (name));
+
+ t = lookup_name_current_level (name);
+ /* Overloading an operator is ok. The decl is a dummy placeholder.
+@@ -1126,10 +1131,18 @@
+ }
+
+ DECL_UID (x) = DECL_UID (t);
++ gcc_assert (TREE_CODE (x) == FUNCTION_DECL &&
++ TREE_CODE (t) == FUNCTION_DECL);
++#ifndef GCC_4_1
+ /* Copy decl-specific fields of x into t. */
+ memcpy ((char *) t + sizeof (struct tree_common),
+ (char *) x + sizeof (struct tree_common),
+ sizeof (struct tree_decl) - sizeof (struct tree_common));
++#else
++ memcpy ((char *) t + sizeof (struct tree_common),
++ (char *) x + sizeof (struct tree_common),
++ tree_size (t) - sizeof (struct tree_common));
++#endif
+ return t;
+ }
+
+@@ -1173,7 +1186,7 @@
+
+ /* Maybe warn if shadowing something else (not for vars made for inlining). */
+ if (!weak && t && warn_shadow && !DECL_FROM_INLINE (x))
+- warning ("declaration of `%s' shadows an outer declaration", IDENTIFIER_NAME (name));
++ gpc_warning ("declaration of `%s' shadows an outer declaration", IDENTIFIER_NAME (name));
+
+ /* Record a shadowed declaration for later restoration. */
+ if (!weak && t)
+@@ -1384,6 +1397,7 @@
+ expand_expr_stmt (build_routine_call (longjmp_routine_node,
+ tree_cons (NULL_TREE, build_unary_op (ADDR_EXPR, DECL_LANG_LABEL_JMPBUF (decl), 0),
+ build_tree_list (NULL_TREE, integer_one_node))));
++ TREE_USED (DECL_LANG_LABEL_JMPBUF (decl)) = 1;
+ #ifndef GCC_3_3
+ /* @@ Work-around: `function_cannot_inline_p' should check `current_function_calls_longjmp'. */
+ current_function_has_nonlocal_goto = 1;
+@@ -1433,9 +1447,9 @@
+ #endif
+ /* Avoid calling `setjmp' for labels that are only used locally */
+ if (DECL_LANG_LABEL_JMPBUF (d)
+-#ifndef GCC_4_0
++// #ifndef GCC_4_0
+ && TREE_USED (DECL_LANG_LABEL_JMPBUF (d))
+-#endif
++// #endif
+ )
+ {
+ expand_start_cond (build_routine_call (setjmp_routine_node,
+@@ -1580,10 +1594,10 @@
+ location_t loc_aux;
+ loc_aux.file = filename;
+ loc_aux.line = line;
+- warning ("%Hcapitalisation of identifier `%s' doesn't match", &loc_aux, spelling);
++ gpc_warning ("%Hcapitalisation of identifier `%s' doesn't match", &loc_aux, spelling);
+ loc_aux.file = IDENTIFIER_SPELLING_FILE (id);
+ loc_aux.line = IDENTIFIER_SPELLING_LINENO (id);
+- warning ("%H previous capitalisation `%s'", &loc_aux, IDENTIFIER_SPELLING (id));
++ gpc_warning ("%H previous capitalisation `%s'", &loc_aux, IDENTIFIER_SPELLING (id));
+ #endif
+ }
+ }
+@@ -2306,7 +2320,7 @@
+ if (co->pascal_dialect & C_E_O_PASCAL)
+ error (msg, IDENTIFIER_NAME (name));
+ else
+- warning (msg, IDENTIFIER_NAME (name));
++ gpc_warning (msg, IDENTIFIER_NAME (name));
+ }
+ }
+
+@@ -2562,7 +2576,7 @@
+ if (TREE_VALUE (*tt))
+ error ("spurious argument to `%s' attribute", IDENTIFIER_NAME (TREE_PURPOSE (*tt)));
+ if (TREE_CODE (TREE_TYPE (t)) == VOID_TYPE)
+- warning ("`%s' is meaningless for a procedure", IDENTIFIER_NAME (TREE_PURPOSE (*tt)));
++ gpc_warning ("`%s' is meaningless for a procedure", IDENTIFIER_NAME (TREE_PURPOSE (*tt)));
+ else
+ PASCAL_TREE_IGNORABLE (t) = 1;
+ *tt = TREE_CHAIN (*tt);
+@@ -2576,7 +2590,7 @@
+ if (TREE_VALUE (*tt))
+ error ("spurious argument to `%s' attribute", IDENTIFIER_NAME (TREE_PURPOSE (*tt)));
+ if (!last || TREE_CODE (TREE_VALUE (last)) != VOID_TYPE)
+- warning ("inline declaration ignored for routine with `...'");
++ gpc_warning ("inline declaration ignored for routine with `...'");
+ else if (!flag_no_inline && optimize > 0)
+ /* Assume that otherwise the function can be inlined. */
+ DECL_INLINE (*d) = 1;
+@@ -2646,7 +2660,7 @@
+ }
+ else if (IDENTIFIER_IS_BUILT_IN (TREE_VALUE (dir), p_asmname))
+ {
+- warning ("`%s' is deprecated; use `external name' or `attribute (name = ...)' instead",
++ gpc_warning ("`%s' is deprecated; use `external name' or `attribute (name = ...)' instead",
+ IDENTIFIER_NAME (TREE_VALUE (dir)));
+ assembler_name = TREE_PURPOSE (dir);
+ any_dir = 1;
+@@ -2654,7 +2668,7 @@
+ else if (IDENTIFIER_IS_BUILT_IN (TREE_VALUE (dir), p_c)
+ || IDENTIFIER_IS_BUILT_IN (TREE_VALUE (dir), p_c_language))
+ {
+- warning ("`%s' is deprecated; use `external' instead",
++ gpc_warning ("`%s' is deprecated; use `external' instead",
+ IDENTIFIER_NAME (TREE_VALUE (dir)));
+ any_dir = c_dir = is_public = 1;
+ }
+@@ -2662,7 +2676,7 @@
+ {
+ is_external = is_public = 1;
+ if (TREE_PURPOSE (dir))
+- warning ("library name in `external' is ignored");
++ gpc_warning ("library name in `external' is ignored");
+ }
+ else if (IDENTIFIER_IS_BUILT_IN (TREE_VALUE (dir), p_forward))
+ any_dir = is_forward = 1;
+@@ -2675,15 +2689,15 @@
+ || IDENTIFIER_IS_BUILT_IN (TREE_VALUE (dir), p_far))
+ {
+ if (co->warn_near_far)
+- warning ("`%s' directive ignored because of flat memory model", IDENTIFIER_NAME (TREE_VALUE (dir)));
++ gpc_warning ("`%s' directive ignored because of flat memory model", IDENTIFIER_NAME (TREE_VALUE (dir)));
+ }
+ else
+ error ("unknown directive `%s'", IDENTIFIER_NAME (TREE_VALUE (dir)));
+
+ if (is_external && !assembler_name)
+ {
+- warning ("`external' without `name' has a different default now");
+- warning (" (This warning will disappear in a future version)");
++ gpc_warning ("`external' without `name' has a different default now");
++ gpc_warning (" (This gpc_warning will disappear in a future version)");
+ }
+
+ is_external |= c_dir;
+@@ -3016,7 +3030,7 @@
+ || IDENTIFIER_IS_BUILT_IN (TREE_VALUE (dir), p_far))
+ {
+ if (co->warn_near_far)
+- warning ("`%s' directive ignored because of flat memory model", IDENTIFIER_NAME (TREE_VALUE (dir)));
++ gpc_warning ("`%s' directive ignored because of flat memory model", IDENTIFIER_NAME (TREE_VALUE (dir)));
+ }
+ else
+ {
+@@ -3301,14 +3315,18 @@
+ #ifndef EGCS97
+ /* So we can tell if jump_optimize sets it to 1. */
+ can_reach_end = 0;
+-#else
+- ggc_push_context ();
+ #endif
+
+-
+- /* Run the optimizers and output the assembler code for this function. */
+ #ifndef GCC_4_0
++#ifdef EGCS97
++ ggc_push_context ();
++#endif
++ /* Run the optimizers and output the assembler code for this function. */
+ rest_of_compilation (fndecl);
++
++#ifdef EGCS97
++ ggc_pop_context ();
++#endif
+ #endif
+
+ if (DECL_LANG_RESULT_VARIABLE (fndecl))
+@@ -3316,11 +3334,9 @@
+
+ #ifndef EGCS97
+ if (TREE_THIS_VOLATILE (fndecl) && can_reach_end)
+- warning ("routine declared `noreturn' returns");
++ gpc_warning ("routine declared `noreturn' returns");
+ if (!outer_function_chain)
+ permanent_allocation (1);
+-#else
+- ggc_pop_context ();
+ #endif
+
+ #ifndef GCC_4_0
+@@ -3581,7 +3597,8 @@
+ if (!EM (TREE_TYPE (element))
+ && TREE_CODE (element) != VAR_DECL
+ && TREE_CODE (element) != PARM_DECL
+- && TREE_CODE (element) != CONSTRUCTOR)
++ && TREE_CODE (element) != CONSTRUCTOR
++/* && TREE_CODE (element) != PASCAL_SET_CONSTRUCTOR */)
+ {
+ tree elem_type = TREE_TYPE (element), rec_addr;
+ if (TREE_READONLY (element))
+@@ -3700,13 +3717,13 @@
+ {
+ qualifiers |= VQ_EXTERNAL;
+ if (arg)
+- warning ("library name in `external' is ignored");
++ gpc_warning ("library name in `external' is ignored");
+ }
+ else if (arg && IDENTIFIER_IS_BUILT_IN (id, p_name))
+ assembler_name = arg;
+ else if (arg && IDENTIFIER_IS_BUILT_IN (id, p_asmname))
+ {
+- warning ("`%s' is deprecated; use `external name' or `attribute (name = ...)' instead",
++ gpc_warning ("`%s' is deprecated; use `external name' or `attribute (name = ...)' instead",
+ IDENTIFIER_NAME (id));
+ assembler_name = arg;
+ }
+@@ -3720,8 +3737,8 @@
+
+ if ((qualifiers & VQ_EXTERNAL) && !(qualifiers & VQ_IMPLICIT) && !assembler_name)
+ {
+- warning ("`external' without `name' has a different default now");
+- warning (" (This warning will disappear in a future version.)");
++ gpc_warning ("`external' without `name' has a different default now");
++ gpc_warning (" (This gpc_warning will disappear in a future version.)");
+ }
+
+ if (init && PASCAL_ABSOLUTE_CLAUSE (init))
+@@ -3744,7 +3761,7 @@
+ return NULL_TREE;
+ }
+ if (co->warn_absolute)
+- warning ("variables at absolute adresses may cause problems");
++ gpc_warning ("variables at absolute adresses may cause problems");
+ }
+ else
+ {
+@@ -3756,7 +3773,7 @@
+ && TREE_CODE (TREE_TYPE (init)) != VOID_TYPE
+ && TREE_CODE (TREE_TYPE (init)) != FUNCTION_TYPE
+ && TYPE_ALIGN (type) > TYPE_ALIGN (TREE_TYPE (init)))
+- warning ("`absolute' declaration increases required alignment");
++ gpc_warning ("`absolute' declaration increases required alignment");
+ while (TREE_CODE (init) == NOP_EXPR
+ || TREE_CODE (init) == NON_LVALUE_EXPR
+ || TREE_CODE (init) == CONVERT_EXPR
+@@ -3770,7 +3787,7 @@
+ || (indirect == 0 && TREE_CODE (init) == PARM_DECL)
+ || (indirect == 1 && TREE_CODE (init) == PARM_DECL
+ && TREE_CODE (TREE_TYPE (init)) == REFERENCE_TYPE)))
+- warning ("`absolute' variable has non-constant address");
++ gpc_warning ("`absolute' variable has non-constant address");
+ TREE_USED (init) = 1;
+ init = address;
+ }
+@@ -3982,7 +3999,15 @@
+ DECL_CONTEXT (d) = NULL_TREE; /* for deferred initializers */
+
+ /* Output the assembler code and/or RTL code. */
+-#ifndef GCC_4_0
++#ifdef GCC_4_0
++ if (pascal_global_bindings_p () && current_module
++ && current_module->implementation)
++ {
++ if (!DECL_INITIAL (d))
++ DECL_DEFER_OUTPUT (d) = 1;
++ rest_of_decl_compilation (d, true, 0);
++ }
++#else
+ rest_of_decl_compilation (d, NULL, !DECL_CONTEXT (d), 1 /* for GPC */);
+ #endif
+
+Only in gpc/p: declarations.c~
+Common subdirectories: /pom/kompi/gcc/tst45/pom/gpc-20060325/p/demos and gpc/p/demos
+Common subdirectories: /pom/kompi/gcc/tst45/pom/gpc-20060325/p/diffs and gpc/p/diffs
+Common subdirectories: /pom/kompi/gcc/tst45/pom/gpc-20060325/p/doc and gpc/p/doc
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/expressions.c gpc/p/expressions.c
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/expressions.c 2006-03-24 02:47:15.000000000 +0100
++++ gpc/p/expressions.c 2006-04-09 02:28:59.000000000 +0200
+@@ -36,7 +36,7 @@
+ static int implicit_comparison = 0;
+ int operators_defined = 0;
+
+-static void set_string_length (tree, int, int);
++// static void set_string_length (tree, int, int);
+ static void warn_operands (enum tree_code, tree, int);
+ static tree shorten_compare (tree *, tree *, tree *, enum tree_code *);
+ static const char *get_op_name (enum tree_code);
+@@ -56,7 +56,7 @@
+ Note: TREE_STRING_LENGTH includes a trailing #0 (to output C-compatible
+ strings and to avoid changing the backend's output code), but the domain
+ doesn't (so the #0 doesn't appear in Pascal string usage). */
+-static void
++void
+ set_string_length (tree value, int wide_flag, int length)
+ {
+ gcc_assert (length >= 0);
+@@ -282,7 +282,7 @@
+ {
+ if (co->pascal_dialect & C_E_O_PASCAL)
+ {
+- warning(msg);
++ gpc_warning (msg);
+ return build (COMPOUND_EXPR, TREE_TYPE (min),
+ build_predef_call (p_RangeCheckError, NULL_TREE), min);
+ }
+@@ -653,7 +653,7 @@
+ enum tree_code inner = EXP_ORIGINAL_CODE (exp_inner);
+ if ((AND_OP (inner) && OR_OP (outer))
+ || ((OR_OP (inner) || AND_OP (inner) || (!rhs && inner == TRUTH_NOT_EXPR)) && REL_OP (outer)))
+- warning ("suggest parentheses around `%s' in operand of `%s'",
++ gpc_warning ("suggest parentheses around `%s' in operand of `%s'",
+ get_op_name (inner), get_op_name (outer));
+ }
+ }
+@@ -783,7 +783,6 @@
+ and are already no lvalues (WRT ISO parentheses). */
+ gcc_assert (TREE_CODE (t) != STRING_CST);
+ gcc_assert (TREE_CODE (t) != CONSTRUCTOR);
+- gcc_assert (code == NOP_EXPR || !lvalue_p (t));
+ t = build1 (NON_LVALUE_EXPR, TREE_TYPE (old), old);
+ TREE_CONSTANT (t) = TREE_CONSTANT (old);
+ TREE_OVERFLOW (t) = TREE_OVERFLOW (old);
+@@ -1124,9 +1123,11 @@
+ }
+
+ /* Convert set constructors to sets. */
+- if (t1 == CONSTRUCTOR && TREE_CODE (TREE_TYPE (exp1)) == SET_TYPE)
++ if (t1 == PASCAL_SET_CONSTRUCTOR
++ && TREE_CODE (TREE_TYPE (exp1)) == SET_TYPE)
+ exp1 = construct_set (exp1, NULL_TREE, 1);
+- if (t2 == CONSTRUCTOR && TREE_CODE (TREE_TYPE (exp2)) == SET_TYPE && code != IN_EXPR)
++ if (t2 == PASCAL_SET_CONSTRUCTOR
++ && TREE_CODE (TREE_TYPE (exp2)) == SET_TYPE && code != IN_EXPR)
+ exp2 = construct_set (exp2, NULL_TREE, 1);
+
+ CHK_EM (TREE_TYPE (exp1));
+@@ -1249,17 +1250,18 @@
+ return error_mark_node;
+ }
+
+- if (TREE_CODE (exp2) == CONSTRUCTOR)
++ if (TREE_CODE (exp2) == PASCAL_SET_CONSTRUCTOR)
+ {
+ /* Optimize `foo in [a, b .. c]' to become
+ `(foo = a) or ((foo >= b) and (foo <= c))'
+ (where foo is evaluated only once). */
+- tree elem = CONSTRUCTOR_ELTS (exp2), result = NULL_TREE, exp = save_expr (exp1);
++ tree elem = SET_CONSTRUCTOR_ELTS (exp2),
++ result = NULL_TREE, exp = save_expr (exp1);
+ if (!elem)
+ {
+- warning ("`... in []' (empty set) is always `False'.");
++ gpc_warning ("`... in []' (empty set) is always `False'.");
+ if (TREE_SIDE_EFFECTS (exp1))
+- warning (" Operand with side-effects is not evaluated.");
++ gpc_warning (" Operand with side-effects is not evaluated.");
+ return boolean_false_node;
+ }
+ for (; elem; elem = TREE_CHAIN (elem))
+@@ -1333,12 +1335,18 @@
+ if (code == SYMDIFF_EXPR)
+ chk_dialect ("symmetric set difference is", E_O_PASCAL);
+
+- if (TREE_CODE (exp1) == CONSTRUCTOR && TREE_CODE (exp2) == CONSTRUCTOR)
++ if (TREE_CODE (exp1) == PASCAL_SET_CONSTRUCTOR
++ && TREE_CODE (exp2) == PASCAL_SET_CONSTRUCTOR)
+ {
+ if (code == PLUS_EXPR)
+- return build_set_constructor (chainon (copy_list (CONSTRUCTOR_ELTS (exp1)), copy_list (CONSTRUCTOR_ELTS (exp2))));
+- else if (PASCAL_CONSTRUCTOR_INT_CST (exp1) && PASCAL_CONSTRUCTOR_INT_CST (exp2))
+- return const_set_constructor_binary_op (code, CONSTRUCTOR_ELTS (exp1), CONSTRUCTOR_ELTS (exp2));
++ return build_set_constructor (chainon (
++ copy_list (SET_CONSTRUCTOR_ELTS (exp1)),
++ copy_list (SET_CONSTRUCTOR_ELTS (exp2))));
++ else if (PASCAL_CONSTRUCTOR_INT_CST (exp1)
++ && PASCAL_CONSTRUCTOR_INT_CST (exp2))
++ return const_set_constructor_binary_op (code,
++ SET_CONSTRUCTOR_ELTS (exp1),
++ SET_CONSTRUCTOR_ELTS (exp2));
+ }
+
+ result = NULL_TREE;
+@@ -1351,19 +1359,19 @@
+ {
+ case PLUS_EXPR:
+ case SYMDIFF_EXPR:
+- warning ("Set operation has no effect.");
++ gpc_warning ("Set operation has no effect.");
+ return exp2;
+ case MINUS_EXPR:
+ case MULT_EXPR:
+- warning ("Set operation always yields the empty set.");
++ gpc_warning ("Set operation always yields the empty set.");
+ result = build_set_constructor (NULL_TREE);
+ break;
+ case GT_EXPR:
+- warning ("`>' comparison of the empty set is always false.");
++ gpc_warning ("`>' comparison of the empty set is always false.");
+ result = boolean_false_node;
+ break;
+ case LE_EXPR:
+- warning ("`<=' comparison of the empty set is always true.");
++ gpc_warning ("`<=' comparison of the empty set is always true.");
+ result = boolean_true_node;
+ break;
+ case EQ_EXPR:
+@@ -1389,18 +1397,18 @@
+ case PLUS_EXPR:
+ case MINUS_EXPR:
+ case SYMDIFF_EXPR:
+- warning ("Set operation has no effect.");
++ gpc_warning ("Set operation has no effect.");
+ return exp1;
+ case MULT_EXPR:
+- warning ("Set operation always yields the empty set.");
++ gpc_warning ("Set operation always yields the empty set.");
+ result = build_set_constructor (NULL_TREE);
+ break;
+ case LT_EXPR:
+- warning ("`<' comparison against the empty set is always false.");
++ gpc_warning ("`<' comparison against the empty set is always false.");
+ result = boolean_false_node;
+ break;
+ case GE_EXPR:
+- warning ("`>=' comparison against the empty set is always true.");
++ gpc_warning ("`>=' comparison against the empty set is always true.");
+ result = boolean_true_node;
+ break;
+ case EQ_EXPR:
+@@ -1417,7 +1425,7 @@
+ if (result)
+ {
+ if (TREE_SIDE_EFFECTS (empty1 ? exp2 : exp1))
+- warning (" Operand with side-effects is not evaluated.");
++ gpc_warning (" Operand with side-effects is not evaluated.");
+ return result;
+ }
+ if (!r_num)
+@@ -1827,7 +1835,8 @@
+ /* build_unary_op accepts CONSTRUCTORs (for parameters), but the backend
+ would later crash. Maybe it should be checked elsewhere, but it
+ seems to work here. -- Frank */
+- if (TREE_CODE (factor) == CONSTRUCTOR)
++ if (TREE_CODE (factor) == CONSTRUCTOR
++ || TREE_CODE (factor) == PASCAL_SET_CONSTRUCTOR)
+ {
+ error ("reference expected, value given");
+ return error_mark_node;
+@@ -1841,6 +1850,7 @@
+ else
+ {
+ tree t;
++ tree string_cst_type = NULL_TREE;
+
+ if (TREE_CODE (factor) == STRING_CST)
+ {
+@@ -1850,13 +1860,25 @@
+ tree capf = TYPE_FIELDS (st);
+ tree lenf = TREE_CHAIN (capf);
+ tree schf = TREE_CHAIN (lenf);
++#ifndef GCC_4_1
++ tree inilist = tree_cons (capf, length,
++ tree_cons (lenf, length,
++ build_tree_list (schf, factor)));
++#else
++ VEC(constructor_elt,gc) * inilist = 0;
++ CONSTRUCTOR_APPEND_ELT (inilist, capf, length);
++ CONSTRUCTOR_APPEND_ELT (inilist, lenf, length);
++ CONSTRUCTOR_APPEND_ELT (inilist, schf, factor);
++#endif
+ factor = build_constructor (build_pascal_string_schema (length),
+- tree_cons (capf, length,
+- tree_cons (lenf, length,
+- build_tree_list (schf, factor))));
++ inilist);
+ /* Make this a valid lvalue for taking addresses. */
+ TREE_CONSTANT (factor) = 1;
+ TREE_STATIC (factor) = 1;
++ string_cst_type = TREE_TYPE (factor);
++ factor = declare_variable (get_unique_identifier ("const_string"),
++ TREE_TYPE (factor), build_tree_list (NULL_TREE, factor),
++ VQ_IMPLICIT | VQ_CONST | VQ_STATIC);
+ }
+
+ t = factor;
+@@ -1883,6 +1905,12 @@
+ && (!DECL_CONTEXT (factor)
+ || (TREE_CODE (factor) == FUNCTION_DECL && DECL_NO_STATIC_CHAIN (factor))))
+ TREE_CONSTANT (result) = 1;
++#if 0
++ if (string_cst_type)
++ {
++ result = convert (build_pointer_type (string_cst_type), result);
++ }
++#endif
+ }
+
+ if (untyped)
+@@ -2119,22 +2147,22 @@
+ if (!implicit_comparison && !max_gt && !unsignedp0 && TREE_CODE (primop0) != INTEGER_CST)
+ {
+ if (val == boolean_false_node)
+- warning ("Comparison always yields `False' due to limited range of data type.");
++ gpc_warning ("Comparison always yields `False' due to limited range of data type.");
+ if (val == boolean_true_node)
+- warning ("Comparison always yields `True' due to limited range of data type.");
++ gpc_warning ("Comparison always yields `True' due to limited range of data type.");
+ }
+ if (!implicit_comparison && !min_lt && unsignedp0 && TREE_CODE (primop0) != INTEGER_CST)
+ {
+ if (val == boolean_false_node)
+- warning ("Comparison always yields `False' due to limited range of data type.");
++ gpc_warning ("Comparison always yields `False' due to limited range of data type.");
+ if (val == boolean_true_node)
+- warning ("Comparison always yields `True' due to limited range of data type.");
++ gpc_warning ("Comparison always yields `True' due to limited range of data type.");
+ }
+
+ if (val)
+ {
+ if (TREE_SIDE_EFFECTS (primop0))
+- warning (" Operand with side-effects is not evaluated.");
++ gpc_warning (" Operand with side-effects is not evaluated.");
+ return val;
+ }
+
+@@ -2184,13 +2212,13 @@
+ the signedness of the comparison isn't an issue, so suppress
+ the warning. */
+ if (!implicit_comparison && TREE_CODE (primop0) != INTEGER_CST)
+- warning ("Comparison `unsigned value >= 0' always yields `True'.");
++ gpc_warning ("Comparison `unsigned value >= 0' always yields `True'.");
+ value = boolean_true_node;
+ break;
+
+ case LT_EXPR:
+ if (!implicit_comparison && TREE_CODE (primop0) != INTEGER_CST)
+- warning ("Comparison `unsigned value < 0' always yields `False'.");
++ gpc_warning ("Comparison `unsigned value < 0' always yields `False'.");
+ value = boolean_false_node;
+ break;
+
+@@ -2201,7 +2229,7 @@
+ if (value)
+ {
+ if (TREE_SIDE_EFFECTS (primop0))
+- warning (" Operand with side-effects is not evaluated.");
++ gpc_warning (" Operand with side-effects is not evaluated.");
+ return value;
+ }
+ }
+@@ -2564,14 +2592,14 @@
+ if (TREE_CODE (op1) == INTEGER_CST)
+ {
+ if (tree_int_cst_sgn (op1) < 0)
+- warning ("right shift count is negative");
++ gpc_warning ("right shift count is negative");
+ else
+ {
+ if (TREE_INT_CST_LOW (op1) | TREE_INT_CST_HIGH (op1))
+ short_shift = 1;
+ if (TREE_INT_CST_HIGH (op1) != 0
+ || ((unsigned HOST_WIDE_INT) TREE_INT_CST_LOW (op1) >= TYPE_PRECISION (type0)))
+- warning ("right shift count >= width of type");
++ gpc_warning ("right shift count >= width of type");
+ }
+ }
+ /* Use the type of the value to be shifted for the result. */
+@@ -2591,10 +2619,10 @@
+ if (TREE_CODE (op1) == INTEGER_CST)
+ {
+ if (tree_int_cst_sgn (op1) < 0)
+- warning ("left shift count is negative");
++ gpc_warning ("left shift count is negative");
+ else if (TREE_INT_CST_HIGH (op1) != 0
+ || ((unsigned HOST_WIDE_INT) TREE_INT_CST_LOW (op1) >= TYPE_PRECISION (result_type)))
+- warning ("left shift count >= width of type");
++ gpc_warning ("left shift count >= width of type");
+ }
+ if (TYPE_MAIN_VARIANT (TREE_TYPE (op1)) != pascal_integer_type_node)
+ op1 = convert (pascal_integer_type_node, op1);
+@@ -2606,7 +2634,7 @@
+ case EQ_EXPR:
+ case NE_EXPR:
+ if (co->warn_float_equal && (code0 == REAL_TYPE || code1 == REAL_TYPE))
+- warning ("comparing real numbers with `=' or `<>' is unsafe");
++ gpc_warning ("comparing real numbers with `=' or `<>' is unsafe");
+ /* Result of comparison is always Boolean, but don't convert the args to Boolean. */
+ build_type = boolean_type_node;
+ if (ORDINAL_REAL_OR_COMPLEX_TYPE (code0) && compatible_relop_p (type0, type1))
+@@ -2658,7 +2686,7 @@
+ {
+ result_type = common_type (type0, type1);
+ if (TREE_CODE (TREE_TYPE (type0)) == FUNCTION_TYPE)
+- warning ("ordered comparisons of pointers to routines");
++ gpc_warning ("ordered comparisons of pointers to routines");
+ }
+ else if (!comp_object_or_schema_pointer_types (TREE_TYPE (type0), TREE_TYPE (type1), 0)
+ && !comp_object_or_schema_pointer_types (TREE_TYPE (type1), TREE_TYPE (type0), 0))
+@@ -2688,7 +2716,7 @@
+ != COMPLETE_OR_VOID_TYPE_P (TREE_TYPE (type1)))
+ pedwarn ("comparison of complete and incomplete pointers");
+ else if (pedantic && TREE_CODE (TREE_TYPE (type0)) == FUNCTION_TYPE)
+- warning ("ordered comparision of pointers to routines");
++ gpc_warning ("ordered comparision of pointers to routines");
+ }
+ else
+ {
+@@ -2895,13 +2923,13 @@
+ {
+ mask = (~0L) << bits;
+ if ((mask & constant) != mask)
+- warning ("comparison of promoted `not' unsigned with constant");
++ gpc_warning ("comparison of promoted `not' unsigned with constant");
+ }
+ }
+ else if (unsignedp0 && unsignedp1
+ && (TYPE_PRECISION (TREE_TYPE (primop0)) < TYPE_PRECISION (result_type))
+ && (TYPE_PRECISION (TREE_TYPE (primop1)) < TYPE_PRECISION (result_type)))
+- warning ("comparison of promoted `not' unsigned with unsigned");
++ gpc_warning ("comparison of promoted `not' unsigned with unsigned");
+ }
+ }
+ }
+@@ -2986,9 +3014,9 @@
+ /* The result is a pointer of the same type that is being added. */
+ tree result_type = TREE_TYPE (ptrop), size_exp = integer_one_node, result, folded;
+ if (TREE_CODE (TREE_TYPE (result_type)) == VOID_TYPE)
+- warning ("untyped pointer used in arithmetic");
++ gpc_warning ("untyped pointer used in arithmetic");
+ else if (TREE_CODE (TREE_TYPE (result_type)) == FUNCTION_TYPE)
+- warning ("pointer to a routine used in arithmetic");
++ gpc_warning ("pointer to a routine used in arithmetic");
+ else
+ size_exp = c_size_in_bytes (TREE_TYPE (result_type));
+ /* Replace the integer argument with a suitable product by the object size. */
+@@ -3010,9 +3038,9 @@
+ tree result, folded, restype = ptrdiff_type_node;
+ tree target_type = TREE_TYPE (TREE_TYPE (op0));
+ if (TREE_CODE (target_type) == VOID_TYPE)
+- warning ("untyped pointer used in pointer difference");
++ gpc_warning ("untyped pointer used in pointer difference");
+ if (TREE_CODE (target_type) == FUNCTION_TYPE)
+- warning ("pointer to a routine used in pointer difference");
++ gpc_warning ("pointer to a routine used in pointer difference");
+ /* First do the subtraction as integers, then divide. */
+ op0 = build_pascal_binary_op (MINUS_EXPR, convert (restype, op0), convert (restype, op1));
+ /* This generates an error if op1 is pointer to incomplete type. */
+@@ -3170,7 +3198,8 @@
+ }
+
+ /* Addresses of constructors are needed for parameters. */
+- if (TREE_CODE (arg) == CONSTRUCTOR)
++ if (TREE_CODE (arg) == CONSTRUCTOR
++ || TREE_CODE (arg) == PASCAL_SET_CONSTRUCTOR)
+ {
+ if (!TREE_CONSTANT (arg))
+ {
+@@ -3321,15 +3350,15 @@
+ && TREE_CODE (TREE_TYPE (otype)) != VOID_TYPE
+ && TREE_CODE (TREE_TYPE (otype)) != FUNCTION_TYPE
+ && TYPE_ALIGN (TREE_TYPE (type)) > TYPE_ALIGN (TREE_TYPE (otype)))
+- warning ("cast increases required alignment of target type");
++ gpc_warning ("cast increases required alignment of target type");
+
+ if (TYPE_PRECISION (type) != TYPE_PRECISION (otype) && !TREE_CONSTANT (value))
+ {
+ if (TREE_CODE (type) == INTEGER_TYPE && TREE_CODE (otype) == POINTER_TYPE)
+- warning ("cast from pointer to integer of different size");
++ gpc_warning ("cast from pointer to integer of different size");
+ if (TREE_CODE (type) == POINTER_TYPE && TREE_CODE (otype) == INTEGER_TYPE
+ && TREE_CODE (value) != PLUS_EXPR && TREE_CODE (value) != MINUS_EXPR)
+- warning ("cast to pointer from integer of different size");
++ gpc_warning ("cast to pointer from integer of different size");
+ }
+
+ ovalue = value;
+@@ -3372,7 +3401,7 @@
+ if (TREE_CODE (otype) != VOID_TYPE
+ && TREE_CODE (type) != VOID_TYPE
+ && !tree_int_cst_equal (TYPE_SIZE (otype), TYPE_SIZE (type)))
+- warning ("cast to type of different size");
++ gpc_warning ("cast to type of different size");
+ /* @@ GPC allows `@'...'' as an extension, but we don't want that here. */
+ if (TREE_CODE (value) == STRING_CST)
+ error ("reference expected, value given");
+@@ -3784,7 +3813,7 @@
+ return error_mark_node;
+ }
+ if (co->warn_object_assignment)
+- warning ("assignment between objects");
++ gpc_warning ("assignment between objects");
+
+ while (TREE_CODE (l) == NOP_EXPR
+ || TREE_CODE (l) == CONVERT_EXPR
+@@ -3794,7 +3823,7 @@
+ && TREE_CODE (l) != PARM_DECL
+ && TREE_CODE (l) != COMPONENT_REF
+ && TREE_CODE (l) != ARRAY_REF)
+- warning ("left-hand side of object assignment is polymorphic");
++ gpc_warning ("left-hand side of object assignment is polymorphic");
+
+ /* The following code assumes that the VMT pointer is the first field.
+ This is always the case in GPC. If this ever changes, the code must
+@@ -3811,7 +3840,7 @@
+ if (!field)
+ {
+ if (!is_init)
+- warning ("assignment of object with no fields has no effect");
++ gpc_warning ("assignment of object with no fields has no effect");
+ return error_mark_node;
+ }
+ lastfield = tree_last (field);
+@@ -3940,7 +3969,7 @@
+ && TREE_CODE (TREE_TYPE (TREE_TYPE (lhs))) != VOID_TYPE
+ && TREE_CODE (TREE_TYPE (TREE_TYPE (lhs))) != FUNCTION_TYPE
+ && TYPE_ALIGN (TREE_TYPE (TREE_TYPE (inner_lhs))) > TYPE_ALIGN (TREE_TYPE (TREE_TYPE (lhs))))
+- warning ("lhs cast decreases required alignment of target type");
++ gpc_warning ("lhs cast decreases required alignment of target type");
+
+ return build_modify_expr (inner_lhs, NOP_EXPR, convert (TREE_TYPE (inner_lhs), newrhs));
+ }
+Only in gpc/p: expressions.c~
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/gbe.h gpc/p/gbe.h
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/gbe.h 2006-03-03 20:14:31.000000000 +0100
++++ gpc/p/gbe.h 2006-04-06 03:35:49.000000000 +0200
+@@ -119,7 +119,7 @@
+ #define CONCAT2(a,b) a##b
+ #define STRINGX(s) #s
+ #define lineno input_line
+-#define warning_with_decl(x, y) (warning ("%H" y, &DECL_SOURCE_LOCATION (x), \
++#define warning_with_decl(x, y) (gpc_warning ("%H" y, &DECL_SOURCE_LOCATION (x), \
+ DECL_NAME (x) ? IDENTIFIER_POINTER (DECL_NAME (x)) : NULL))
+ #define error_with_decl(x, y) (error ("%H" y, &DECL_SOURCE_LOCATION (x), \
+ DECL_NAME (x) ? IDENTIFIER_POINTER (DECL_NAME (x)) : NULL))
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/gpc-lex.c gpc/p/gpc-lex.c
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/gpc-lex.c 2006-03-03 20:14:31.000000000 +0100
++++ gpc/p/gpc-lex.c 2006-04-06 03:35:49.000000000 +0200
+@@ -172,19 +172,19 @@
+ return 0;
+ else if (Message && co->warn_mixed_comments)
+ {
+- warning ("comments starting with `(*' and ending with `}' or starting with");
+- warning (" `{' and ending with `*)' are an obscure ISO Pascal feature");
++ gpc_warning ("comments starting with `(*' and ending with `}' or starting with");
++ gpc_warning (" `{' and ending with `*)' are an obscure ISO Pascal feature");
+ }
+ break;
+ case NestedComments:
+ if (!co->nested_comments)
+ {
+ if (co->warn_nested_comments)
+- warning ("comment opener found within a comment");
++ gpc_warning ("comment opener found within a comment");
+ return 0;
+ }
+ else if (Message && co->warn_nested_comments)
+- warning ("nested comments are a GPC extension");
++ gpc_warning ("nested comments are a GPC extension");
+ break;
+ case DelphiComments:
+ if (!co->delphi_comments)
+@@ -268,7 +268,7 @@
+ }
+ }
+ if (in_string)
+- warning ("unterminated string in compiler directive");
++ gpc_warning ("unterminated string in compiler directive");
+ *q = 0;
+ process_pascal_directive (s, q - s);
+ }
+@@ -673,9 +673,9 @@
+ if (value == ';' && co->warn_semicolon)
+ switch (last_token)
+ {
+- case p_then: warning ("`;' after `then'"); break;
+- case p_else: warning ("`;' after `else'"); break;
+- case p_do: warning ("`;' after `do'"); break;
++ case p_then: gpc_warning ("`;' after `then'"); break;
++ case p_else: gpc_warning ("`;' after `else'"); break;
++ case p_do: gpc_warning ("`;' after `do'"); break;
+ }
+ last_token = value;
+
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/gpc.h gpc/p/gpc.h
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/gpc.h 2006-03-11 00:40:51.000000000 +0100
++++ gpc/p/gpc.h 2006-04-09 03:21:18.000000000 +0200
+@@ -43,11 +43,24 @@
+
+ #undef USE_CPPLIB /* Not suitable for Pascal */
+
++#include "gbe.h"
++
+ #ifndef GCC_3_3
+ #define GTY(x)
+ #endif
+
+-#include "gbe.h"
++#ifdef GCC_4_1
++#define gpc_warning warning0
++#define SET_CONSTRUCTOR_ELTS(t) TREE_OPERAND (t, 0)
++#else
++#define gpc_warning warning
++#define PASCAL_SET_CONSTRUCTOR CONSTRUCTOR
++#define SET_CONSTRUCTOR_ELTS(t) CONSTRUCTOR_ELTS (t)
++#define CONSTRUCTOR_APPEND_ELT(C, I, V) do \
++ {\
++ (C) = tree_cons ((I), (V), (C));\
++ } while (0)
++#endif
+
+ #ifdef GCC_4_0
+ extern tree xnon_lvalue (tree x);
+@@ -382,7 +395,9 @@
+ /* IS_EXPR_CODE_CLASS ought to work, but for CONSTRUCTORS the backend overwrites
+ this field via TREE_CST_RTL. @@@@@@@@@@ Severe backend bug! This is no fix. */
+ #define HAS_EXP_ORIGINAL_CODE_FIELD(exp) \
+- (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (exp))) && TREE_CODE (exp) != CONSTRUCTOR)
++ (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (exp))) \
++ && TREE_CODE (exp) != CONSTRUCTOR \
++ && TREE_CODE (exp) != PASCAL_SET_CONSTRUCTOR)
+
+ #define IS_EXPR_OR_REF_CODE_CLASS(c) (IS_EXPR_CODE_CLASS (c) || \
+ c == tcc_reference)
+@@ -1374,6 +1389,7 @@
+ extern void un_initialize_block (tree, int, int);
+ extern void expand_call_statement (tree);
+ extern void expand_pascal_assignment (tree, tree);
++extern void expand_pascal_assignment2 (tree, tree, int);
+ extern tree assign_set (tree, tree);
+ extern tree assign_string (tree, const tree);
+ extern void start_main_program (void);
+Only in gpc/p: gpc.h~
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/gpcpp.c gpc/p/gpcpp.c
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/gpcpp.c 2006-02-18 14:22:58.000000000 +0100
++++ gpc/p/gpcpp.c 2006-04-06 03:35:49.000000000 +0200
+@@ -566,7 +566,7 @@
+ static U_CHAR *macarg1 (U_CHAR *, U_CHAR *, int *, int *, int *, int);
+ static int discard_comments (U_CHAR *, int, int);
+ static int change_newlines (U_CHAR *, int);
+-static void warning (const char *, ...) ATTRIBUTE_PRINTF_1;
++static void gpc_warning (const char *, ...) ATTRIBUTE_PRINTF_1;
+ static void error (const char *, ...) ATTRIBUTE_PRINTF_1;
+ static void verror (const char *, va_list);
+ static void error_from_errno (const char *);
+@@ -1348,8 +1348,8 @@
+ {
+ if (warn_mixed_comments && !inhibit_warnings)
+ {
+- warning ("comments starting with `(*' and ending with `}' or starting with");
+- warning (" `{' and ending with `*)' are an obscure ISO Pascal feature");
++ gpc_warning ("comments starting with `(*' and ending with `}' or starting with");
++ gpc_warning (" `{' and ending with `*)' are an obscure ISO Pascal feature");
+ }
+ }
+
+@@ -1357,7 +1357,7 @@
+ warn_nested_comment (void)
+ {
+ if (warn_nested_comments && !inhibit_warnings)
+- warning (nested_comments ? "nested comments are a GPC extension" : "comment opener found within comment");
++ gpc_warning (nested_comments ? "nested comments are a GPC extension" : "comment opener found within comment");
+ }
+
+ /* Skip the (non-`//') comment starting at bp, handling C, Pascal,
+@@ -1550,7 +1550,7 @@
+ if (!ip->fname) {
+ /* note BP character constants */
+ if (ip->buf != beg_of_line && ((*ibp < '0' || *ibp > '9') && *ibp != '$'))
+- warning ("preprocessing directive not recognized within macro arg");
++ gpc_warning ("preprocessing directive not recognized within macro arg");
+ goto randomchar;
+ }
+ if (ident_length)
+@@ -2438,14 +2438,14 @@
+ bp++;
+ } else if (*bp == '{') {
+ if (bp[1] == '$')
+- warning ("ignoring Pascal style directive within C style directive");
++ gpc_warning ("ignoring Pascal style directive within C style directive");
+ ip->bufp = bp + 1;
+ skip_to_end_of_comment (ip, &ip->lineno, '}');
+ bp = ip->bufp;
+ } else if ((*bp == '\\') && bp[1] == '\n') {
+ } else if (IS_COMMENT_START (bp)) {
+ if (bp[1] == '*' && bp[2] == '$')
+- warning ("ignoring Pascal style directive within C style directive");
++ gpc_warning ("ignoring Pascal style directive within C style directive");
+ ip->bufp = bp + 2;
+ skip_to_end_of_comment (ip, &ip->lineno, 0);
+ bp = ip->bufp;
+@@ -2567,7 +2567,7 @@
+ U_CHAR *obp = bp - 1;
+ if (*bp == '$')
+ {
+- warning ("ignoring Pascal style directive within C style directive");
++ gpc_warning ("ignoring Pascal style directive within C style directive");
+ *bp = ' ';
+ }
+ ip->bufp = bp;
+@@ -2591,7 +2591,7 @@
+ U_CHAR *obp = bp - 1;
+ if (*bp == '*' && bp[1] == '$')
+ {
+- warning ("ignoring Pascal style directive within C style directive");
++ gpc_warning ("ignoring Pascal style directive within C style directive");
+ bp[1] = ' ';
+ }
+ ip->bufp = bp + 1;
+@@ -2751,12 +2751,12 @@
+ conditionals. So, just don't allow such things ... */
+ if (*p == '{' && p[1] == '$')
+ {
+- warning ("ignoring compiler directive within another directive");
++ gpc_warning ("ignoring compiler directive within another directive");
+ p[1] = ' ';
+ }
+ if (*p == '(' && p[1] == '*' && p[2] == '$')
+ {
+- warning ("ignoring compiler directive within another directive");
++ gpc_warning ("ignoring compiler directive within another directive");
+ p[2] = ' ';
+ }
+ if (IS_COMMENT_START2 (p))
+@@ -3353,7 +3353,7 @@
+ f = open (fname, O_RDONLY, 0666);
+ #ifdef EACCES
+ if (f == -1 && errno == EACCES)
+- warning ("header file %s exists, but is not readable", fname);
++ gpc_warning ("header file %s exists, but is not readable", fname);
+ #endif
+ if (f >= 0)
+ break;
+@@ -3540,7 +3540,7 @@
+ bp++;
+ SKIP_WHITE_SPACE (bp);
+ } else
+- warning ("missing white space after `$define %.*s'",
++ gpc_warning ("missing white space after `$define %.*s'",
+ sym_length, symname);
+ }
+ /* Now everything from bp before limit is the definition. */
+@@ -3992,7 +3992,7 @@
+ /* If we are generating additional info for debugging (with -g) we
+ need to pass through all effective #undef directives. */
+ if (hp->type != T_MACRO)
+- warning ("undefining `%s'", hp->name);
++ gpc_warning ("undefining `%s'", hp->name);
+ delete_macro (hp);
+ }
+ if (pedantic) {
+@@ -4030,7 +4030,7 @@
+ memcpy ((char *) copy, (char *) buf, length);
+ copy[length] = 0;
+ SKIP_WHITE_SPACE (copy);
+- warning ("#warning %s", copy);
++ gpc_warning ("#gpc_warning %s", copy);
+ return 0;
+ }
+
+@@ -5711,7 +5711,7 @@
+
+ /* Print warning. */
+ static void
+-warning (const char *msg, ...)
++gpc_warning (const char *msg, ...)
+ {
+ va_list args;
+ va_start (args, msg);
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/lang.c gpc/p/lang.c
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/lang.c 2006-03-24 02:47:15.000000000 +0100
++++ gpc/p/lang.c 2006-04-06 03:35:49.000000000 +0200
+@@ -178,7 +178,7 @@
+ res = build (COMPOUND_EXPR, TREE_TYPE (res),
+ current_statement_list, res);
+ current_statement_list = save_statement_list;
+- unshare_all_trees (res);
++ res = unshare_expr (res);
+ }
+ break;
+
+@@ -200,15 +200,16 @@
+ DECL_INITIAL (new_var) = TREE_OPERAND (t, 0);
+
+ TREE_OPERAND (t, 0) = new_var;
++ recompute_tree_invarant_for_addr_expr (t);
+ return GS_ALL_DONE;
+ }
+ return GS_UNHANDLED;
+
+- case CONSTRUCTOR:
++ case PASCAL_SET_CONSTRUCTOR:
+ if (TREE_CODE (TREE_TYPE (t)) == SET_TYPE)
+ {
+ tree type = TREE_TYPE (t);
+- tree elt = CONSTRUCTOR_ELTS (t);
++ tree elt = SET_CONSTRUCTOR_ELTS (t);
+ tree domain = TYPE_DOMAIN (type);
+ tree domain_min = convert (sbitsizetype, TYPE_MIN_VALUE (domain));
+ tree domain_max = convert (sbitsizetype, TYPE_MAX_VALUE (domain));
+@@ -690,6 +691,7 @@
+ #define flag_objc 0
+ #define flag_isoc99 0
+ #define rs6000_cpu_cpp_builtins(foo)
++#define darwin_cpp_builtins(foo)
+ #endif
+
+ #ifdef GCC_3_4
+@@ -1204,7 +1206,7 @@
+ DECL_COMMON (*node) = 0;
+ else
+ {
+- warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
++ gpc_warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
+ *no_add_attrs = true;
+ }
+
+@@ -1221,7 +1223,7 @@
+ DECL_COMMON (*node) = 1;
+ else
+ {
+- warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
++ gpc_warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
+ *no_add_attrs = true;
+ }
+
+@@ -1247,7 +1249,7 @@
+ TREE_READONLY (TREE_TYPE (type)), 1));
+ else
+ {
+- warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
++ gpc_warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
+ *no_add_attrs = true;
+ }
+
+@@ -1272,7 +1274,7 @@
+ TREE_USED (decl) = 1;
+ else
+ {
+- warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
++ gpc_warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
+ *no_add_attrs = true;
+ }
+ }
+@@ -1305,7 +1307,7 @@
+ TREE_THIS_VOLATILE (TREE_TYPE (type))));
+ else
+ {
+- warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
++ gpc_warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
+ *no_add_attrs = true;
+ }
+
+@@ -1491,7 +1493,7 @@
+ }
+ else
+ {
+- warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
++ gpc_warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
+ *no_add_attrs = true;
+ }
+
+@@ -1563,7 +1565,10 @@
+ #define LANG_HOOKS_TYPE_FOR_MODE type_for_mode
+
+ #define LANG_HOOKS_MARK_ADDRESSABLE pascal_mark_addressable
++
++#ifndef GCC_4_1
+ #define LANG_HOOKS_TRUTHVALUE_CONVERSION truthvalue_conversion
++#endif
+
+ #undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL
+ #define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL copy_decl_lang_specific
+@@ -1588,6 +1593,44 @@
+ #undef LANG_HOOKS_TYPES_COMPATIBLE_P
+ #define LANG_HOOKS_TYPES_COMPATIBLE_P pascal_types_compatible_p
+
++#ifdef GCC_4_1
++#undef LANG_HOOKS_INIT_TS
++#define LANG_HOOKS_INIT_TS pascal_init_ts
++#undef LANG_HOOKS_EXPAND_CONSTANT
++#define LANG_HOOKS_EXPAND_CONSTANT pascal_expand_constant
++
++static tree
++pascal_expand_constant (tree t)
++{
++ tree nt;
++ if (TREE_CODE (t) == PASCAL_SET_CONSTRUCTOR)
++ {
++ HOST_WIDE_INT len = int_size_in_bytes (TREE_TYPE (t));
++ char *tmp = xmalloc (len);
++ if (!get_set_constructor_bytes (t, (unsigned char *) tmp, len))
++ {
++ nt = build_string (len, tmp);
++ gcc_assert (TREE_INT_CST_LOW (TYPE_SIZE (char_type_node)) == 8);
++ TREE_TYPE (nt) = build_simple_array_type (char_type_node,
++ build_index_type (build_int_2 (len, 0)));
++ t = build1 (VIEW_CONVERT_EXPR, TREE_TYPE (t), nt);
++ }
++ }
++ return t;
++}
++
++static void
++pascal_init_ts (void)
++{
++ tree_contains_struct[NAMESPACE_DECL][TS_DECL_COMMON] = 1;
++ tree_contains_struct[OPERATOR_DECL][TS_DECL_COMMON] = 1;
++ tree_contains_struct[NAMESPACE_DECL][TS_DECL_MINIMAL] = 1;
++ tree_contains_struct[OPERATOR_DECL][TS_DECL_MINIMAL] = 1;
++}
++
++#endif
++
++
+ int
+ pascal_types_compatible_p (tree t1, tree t2)
+ {
+@@ -1763,14 +1806,14 @@
+ if (TYPE_P (node))
+ *anode = type = build_type_copy (type);
+ if (!valid_machine_attribute (name, args, decl, type))
+- warning ("`%s' attribute directive ignored", IDENTIFIER_NAME (name));
++ gpc_warning ("`%s' attribute directive ignored", IDENTIFIER_NAME (name));
+ else if (decl)
+ type = TREE_TYPE (decl);
+ continue;
+ }
+ else if (attrtab[i].decl_req && !decl)
+ {
+- warning ("`%s' attribute does not apply to types", IDENTIFIER_NAME (name));
++ gpc_warning ("`%s' attribute does not apply to types", IDENTIFIER_NAME (name));
+ continue;
+ }
+ else if (list_length (args) < attrtab[i].min || list_length (args) > attrtab[i].max)
+@@ -1787,14 +1830,14 @@
+ if (TREE_CODE (decl) == VAR_DECL)
+ DECL_COMMON (decl) = 0;
+ else
+- warning ("`%s' attribute ignored", IDENTIFIER_NAME (name));
++ gpc_warning ("`%s' attribute ignored", IDENTIFIER_NAME (name));
+ break;
+
+ case A_COMMON:
+ if (TREE_CODE (decl) == VAR_DECL)
+ DECL_COMMON (decl) = 1;
+ else
+- warning ("`%s' attribute ignored", IDENTIFIER_NAME (name));
++ gpc_warning ("`%s' attribute ignored", IDENTIFIER_NAME (name));
+ break;
+
+ case A_NORETURN:
+@@ -1804,7 +1847,7 @@
+ TREE_TYPE (decl) = type = build_pointer_type (p_build_type_variant (TREE_TYPE (type),
+ TREE_READONLY (TREE_TYPE (type)), 1));
+ else
+- warning ("`%s' attribute ignored", IDENTIFIER_NAME (name));
++ gpc_warning ("`%s' attribute ignored", IDENTIFIER_NAME (name));
+ break;
+
+ case A_UNUSED:
+@@ -1817,7 +1860,7 @@
+ || TREE_CODE (decl) == FUNCTION_DECL)
+ TREE_USED (decl) = 1;
+ else
+- warning ("`%s' attribute ignored", IDENTIFIER_NAME (name));
++ gpc_warning ("`%s' attribute ignored", IDENTIFIER_NAME (name));
+ break;
+
+ case A_CONST:
+@@ -1827,7 +1870,7 @@
+ TREE_TYPE (decl) = type = build_pointer_type (p_build_type_variant (TREE_TYPE (type),
+ 1, TREE_THIS_VOLATILE (TREE_TYPE (type))));
+ else
+- warning ("`%s' attribute ignored", IDENTIFIER_NAME (name));
++ gpc_warning ("`%s' attribute ignored", IDENTIFIER_NAME (name));
+ break;
+
+ case A_SECTION:
+@@ -1905,7 +1948,7 @@
+ assemble_alias (decl, id);
+ }
+ else
+- warning ("`%s' attribute ignored", IDENTIFIER_NAME (name));
++ gpc_warning ("`%s' attribute ignored", IDENTIFIER_NAME (name));
+ break;
+ }
+ }
+Only in gpc/p: lang.c~
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/module.c gpc/p/module.c
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/module.c 2006-03-24 20:09:49.000000000 +0100
++++ gpc/p/module.c 2006-04-11 01:27:35.459338992 +0200
+@@ -38,6 +38,12 @@
+ #define HOST_PTR_PRINTF_CAST_TYPE HOST_WIDE_INT
+ #endif
+
++#ifdef GCC_4_1
++#define GPC_HOST_PTR_PRINTF "%p"
++#else
++#define GPC_HOST_PTR_PRINTF HOST_PTR_PRINTF
++#endif
++
+ #ifdef EGCS97
+
+ /* By default there is no special suffix for target executables. */
+@@ -92,7 +98,7 @@
+
+ #endif
+
+-typedef struct
++typedef struct MEMFILE
+ {
+ char *filename;
+ size_t size, curpos;
+@@ -283,6 +289,8 @@
+ /* Options to pass to child gpc processes in automake. */
+ static char *automake_gpc_options = NULL;
+
++enum itab_state { ITAB_LOADING, ITAB_COMPLETE };
++
+ /* A table holding the nodes imported from all GPI files
+ together with their UIDs, so duplicates can be identified. */
+ struct interface_table_t GTY(())
+@@ -294,6 +302,9 @@
+ tree initializers; /* Same as in module_t. Predefined interfaces
+ (StandardInput etc.) have no initializer. */
+ int count;
++ struct MEMFILE * GTY((skip(""))) infile; /* Input file during reading */
++ gpi_int * GTY((skip(""))) offsets; /* Offsets of node data during reading */
++ enum itab_state state;
+ tree * GTY((length ("%h.count"))) nodes;
+ int * GTY((length ("%h.count"))) hashlist_next;
+ int hash_table[MAX_HASH_TABLE];
+@@ -393,7 +404,7 @@
+ IDENTIFIER_NAME (id),
+ current_module->main_program ? "program" : "module");
+ else
+- warning (
++ gpc_warning (
+ "identifier `%s' in %s heading is not a variable of file type",
+ IDENTIFIER_NAME (id),
+ current_module->main_program ? "program" : "module");
+@@ -467,7 +478,7 @@
+ if (!id)
+ {
+ if (!co->pascal_dialect)
+- warning ("missing program header");
++ gpc_warning ("missing program header");
+ else /* BP does not even warn */
+ chk_dialect ("programs without program header are", B_D_PASCAL);
+ id = get_identifier ("noname");
+@@ -544,8 +555,8 @@
+ create_gpi_files ();
+ if (co->interface_only)
+ exit_compilation ();
+- if (co->implementation_only)
+- {
++// if (co->implementation_only)
++// {
+ /* Make sure that interface nodes keep their identity by reloading the
+ GPI files previously created (presumably) with `--interface_only'. This
+ is the same as with separate interface and implementation modules. */
+@@ -555,7 +566,7 @@
+ current_module = m;
+ pushlevel (0);
+ load_own_interface (0);
+- }
++// }
+ current_module->implementation = 1;
+ }
+
+@@ -563,7 +574,7 @@
+ finalize_module (int implementation_follows)
+ {
+ if (co->implementation_only && co->automake_level)
+- warning ("`--automake' together with `--implementation-only' can cause problems");
++ gpc_warning ("`--automake' together with `--implementation-only' can cause problems");
+ if (errorcount || sorrycount)
+ exit_compilation ();
+ if (!implementation_follows /* && !co->implementation_only */)
+@@ -742,7 +753,7 @@
+ if (*p == ')')
+ p++;
+ else
+- warning ("missing `)' in `--uses' parameter");
++ gpc_warning ("missing `)' in `--uses' parameter");
+ file_name = build_string_constant (buffer, q - buffer, 0);
+ }
+ else
+@@ -755,7 +766,7 @@
+ || (*p == '_')))
+ {
+ if (*p != ',')
+- warning ("missing `,' in `--uses' parameter");
++ gpc_warning ("missing `,' in `--uses' parameter");
+ p++;
+ }
+ }
+@@ -1862,9 +1873,11 @@
+ {
+ tree t = rb.nodes[n];
+ if (t && (TREE_CODE (t) == FUNCTION_DECL || (TREE_CODE (t) == VAR_DECL))
+-/* #ifndef GCC_4_0 */
++#ifndef GCC_4_0
+ && !DECL_RTL_SET_P (t)
+-/* #endif */
++#else
++ && !PASCAL_DECL_IMPORTED (t)
++#endif
+ )
+ {
+ if (!module_interface)
+@@ -1878,26 +1891,19 @@
+ DECL_INITIAL (t) = NULL_TREE;
+ #endif
+ }
+-#if 0
++#ifdef GCC_4_0
+ else
+ {
+- mark_decl_referenced (t);
++ if (TREE_CODE (t) == VAR_DECL)
++ rest_of_decl_compilation (t, 1, 0);
++// mark_decl_referenced (t);
+ }
+ #endif
+ PASCAL_DECL_WEAK (t) = 0;
+ PASCAL_DECL_IMPORTED (t) = 1;
+- if (module_interface && TREE_CODE (t) == VAR_DECL
+- && DECL_INITIAL (t))
+- {
+-#if 0
+- fprintf (stderr, "DECL_INITIAL (%p)\n", t);
+- debug_tree (t);
+- debug_tree (DECL_INITIAL (t));
+-#endif
+- }
+ #ifdef GCC_4_0
+ /* @@@@@@@ Otherwise we have problems with vmt */
+- rest_of_decl_compilation (t, 1, 0);
++// rest_of_decl_compilation (t, 1, 0);
+ #else
+ rest_of_decl_compilation (t, NULL, 1, 1);
+ #endif
+@@ -1968,8 +1974,12 @@
+ #else
+ #define DECL_FLAGS_SIZE 6
+ #endif
++#ifndef GCC_4_1
+ #define DECL_EXTRA_STORED(t) (t->decl.u1.i)
+ #else
++#define DECL_EXTRA_STORED(t) (t->decl_common.u1.i)
++#endif
++#else
+ #ifdef EGCS
+ #define DECL_FLAGS_SIZE 5
+ #else
+@@ -2049,7 +2059,7 @@
+ if (code == INTERFACE_NAME_NODE)
+ {
+ fprintf (stderr, " \n",
+ IDENTIFIER_NAME (INTERFACE_TABLE (t)->interface_name),
+ IDENTIFIER_NAME (INTERFACE_TABLE (t)->module_name),
+@@ -2078,7 +2088,10 @@
+ gpi_int n;
+ store_length ((&DECL_SIZE (t)) + 1, DECL_FLAGS_SIZE);
+ STORE_ANY (DECL_EXTRA_STORED (t));
+- store_node (DECL_NAME (t));
++#ifdef GCC_4_1
++ if (CODE_CONTAINS_STRUCT (code, TS_DECL_MINIMAL))
++#endif
++ store_node (DECL_NAME (t));
+ store_string (DECL_SOURCE_FILE (t));
+ n = DECL_SOURCE_LINE (t);
+ STORE_ANY (n);
+@@ -2088,8 +2101,13 @@
+ #ifdef EGCS97
+ store_node (DECL_SIZE_UNIT (t));
+ #endif
+- n = DECL_ALIGN (t);
+- STORE_ANY (n);
++#ifdef GCC_4_1
++ if (code != FUNCTION_DECL)
++#endif
++ {
++ n = DECL_ALIGN (t);
++ STORE_ANY (n);
++ }
+ break;
+ }
+ case tcc_constant:
+@@ -2343,6 +2361,24 @@
+ store_node (TREE_TYPE (t));
+ break;
+
++#ifdef GCC_4_1
++ case CONSTRUCTOR:
++ {
++ VEC(constructor_elt,gc) *elts = CONSTRUCTOR_ELTS (t);
++ tree index, value;
++ unsigned HOST_WIDE_INT ix;
++ store_node (TREE_TYPE (t));
++ ix = VEC_length (constructor_elt, elts);
++ STORE_ANY (ix);
++ FOR_EACH_CONSTRUCTOR_ELT (elts, ix, index, value)
++ {
++ store_node (index);
++ store_node (value);
++ }
++ }
++ break;
++#endif
++
+ default:
+ #ifdef GCC_4_0
+ gcc_assert (class_done);
+@@ -2590,7 +2626,10 @@
+ char *s;
+ LOAD_LENGTH ((&DECL_SIZE (t)) + 1, DECL_FLAGS_SIZE);
+ LOAD_ANY (DECL_EXTRA_STORED (t));
+- DECL_NAME (t) = load_node ();
++#ifdef GCC_4_1
++ if (CODE_CONTAINS_STRUCT (code, TS_DECL_MINIMAL))
++#endif
++ DECL_NAME (t) = load_node ();
+ s = load_string (rb.infile);
+ DECL_SOURCE_FILE (t) = PERMANENT_STRING (s);
+ free (s);
+@@ -2602,9 +2641,17 @@
+ #ifdef EGCS97
+ DECL_SIZE_UNIT (t) = load_node ();
+ #endif
+- LOAD_ANY (n);
+- DECL_ALIGN (t) = n;
+- DECL_IN_SYSTEM_HEADER (t) = 1;
++#ifdef GCC_4_1
++ if (code != FUNCTION_DECL)
++#endif
++ {
++ LOAD_ANY (n);
++ DECL_ALIGN (t) = n;
++ }
++#ifdef GCC_4_1
++ if (CODE_CONTAINS_STRUCT (code, TS_DECL_WITH_VIS))
++#endif
++ DECL_IN_SYSTEM_HEADER (t) = 1;
+ break;
+ }
+ case tcc_constant:
+@@ -2649,7 +2696,7 @@
+ if (co->debug_gpi)
+ {
+ fprintf (stderr, "GPI loaded <%i>:\n \n",
+ IDENTIFIER_NAME (i),
+ IDENTIFIER_NAME (m),
+@@ -2832,7 +2879,9 @@
+ TREE_TYPE (t) = load_node ();
+ DECL_ARG_TYPE (t) = load_node ();
+ DECL_CONTEXT (t) = load_node ();
++#ifndef GCC_4_1
+ SET_DECL_ASSEMBLER_NAME (t, DECL_NAME (t));
++#endif
+ break;
+
+ case FIELD_DECL:
+@@ -2895,6 +2944,27 @@
+ TREE_TYPE (t) = load_node ();
+ break;
+
++#ifdef GCC_4_1
++ case CONSTRUCTOR:
++ {
++ VEC(constructor_elt,gc) *elts = 0;
++ tree index, value;
++ unsigned HOST_WIDE_INT ix;
++ TREE_TYPE (t) = load_node ();
++ LOAD_ANY (ix);
++ while (ix > 0)
++ {
++ index = load_node ();
++ value = load_node ();
++ CONSTRUCTOR_APPEND_ELT (elts, index, value);
++ ix--;
++ }
++ CONSTRUCTOR_ELTS (t) = elts;
++ }
++ break;
++#endif
++
++
+ default:
+ break;
+ }
+@@ -2962,7 +3032,7 @@
+ for (q = n; *q; q++)
+ *q = TOLOWER (*q);
+ if (strcmp (f, n) && strcmp (n + strlen (n) - 4, "-all"))
+- warning ("interface `%s' in file name `%s'", IDENTIFIER_NAME (name), plain_input_filename);
++ gpc_warning ("interface `%s' in file name `%s'", IDENTIFIER_NAME (name), plain_input_filename);
+ }
+
+ /* Store names of interfaces imported by this module */
+@@ -3207,7 +3277,7 @@
+ if (!itab_check_gpi_checksum (interface, checksum, 0))
+ {
+ if (co->debug_automake)
+- warning ("`%s' must be recompiled because of checksum mismatch in %s", name, str);
++ gpc_warning ("`%s' must be recompiled because of checksum mismatch in %s", name, str);
+ must_recompile = 1;
+ }
+ for (imported = current_module->imports; imported; imported = TREE_CHAIN (imported))
+@@ -3278,7 +3348,7 @@
+ }
+ #if 0
+ else if (implementation_flag)
+- warning ("duplicate implementation flag in GPI file `%s'", name);
++ gpc_warning ("duplicate implementation flag in GPI file `%s'", name);
+ #endif
+ implementation_flag = 1;
+ break;
+@@ -3335,7 +3405,7 @@
+ }
+ if (errstr)
+ {
+- warning (errstr, name);
++ gpc_warning (errstr, name);
+ module_filename = NULL;
+ must_recompile = 1;
+ }
+Only in gpc/p: module.c~
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/objects.c gpc/p/objects.c
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/objects.c 2006-03-24 06:03:26.000000000 +0100
++++ gpc/p/objects.c 2006-04-09 21:28:12.000000000 +0200
+@@ -455,7 +455,7 @@
+ if (IDENTIFIER_IS_BUILT_IN (TREE_VALUE (cp), p_virtual))
+ {
+ if (co->methods_always_virtual)
+- warning ("explicit `virtual' given with `--methods-always-virtual'");
++ gpc_warning ("explicit `virtual' given with `--methods-always-virtual'");
+ virtual = 1;
+ nv++;
+ if (TREE_PURPOSE (cp))
+@@ -568,7 +568,7 @@
+ if (PEDANTIC (B_D_PASCAL)) /* forbidden by OOE */
+ error ("%s `%s' conflicts with ancestor type name", i ? "method" : "field", IDENTIFIER_NAME (DECL_NAME (field)));
+ else
+- warning ("%s `%s' conflicts with ancestor type name", i ? "method" : "field", IDENTIFIER_NAME (DECL_NAME (field)));
++ gpc_warning ("%s `%s' conflicts with ancestor type name", i ? "method" : "field", IDENTIFIER_NAME (DECL_NAME (field)));
+ }
+ }
+
+@@ -637,7 +637,7 @@
+ if (pedantic || !(co->pascal_dialect & B_D_PASCAL))
+ error ("%s method `%s', overrides %s method", descr[p2], IDENTIFIER_NAME (DECL_NAME (*dm)), descr[p1]);
+ else
+- warning ("%s method `%s', overrides %s method", descr[p2], IDENTIFIER_NAME (DECL_NAME (*dm)), descr[p1]);
++ gpc_warning ("%s method `%s', overrides %s method", descr[p2], IDENTIFIER_NAME (DECL_NAME (*dm)), descr[p1]);
+ }
+ if (PASCAL_VIRTUAL_METHOD (*pm))
+ {
+@@ -648,12 +648,12 @@
+ }
+ if (PASCAL_TYPE_IOCRITICAL (TREE_TYPE (*dm))
+ && !PASCAL_TYPE_IOCRITICAL (TREE_TYPE (*pm)))
+- warning ("iocritical virtual method overrides non-iocritical one");
++ gpc_warning ("iocritical virtual method overrides non-iocritical one");
+ }
+ if (PASCAL_VIRTUAL_METHOD (*pm) && !PASCAL_VIRTUAL_METHOD (*dm))
+ {
+ /* Overridden virtual methods must be virtual. */
+- warning ("method `%s' is virtual", IDENTIFIER_NAME (DECL_NAME (*dm)));
++ gpc_warning ("method `%s' is virtual", IDENTIFIER_NAME (DECL_NAME (*dm)));
+ PASCAL_VIRTUAL_METHOD (*dm) = 1;
+ }
+ /* If a virtual method overrides a non-virtual one, we must
+@@ -662,7 +662,7 @@
+ if (!PASCAL_VIRTUAL_METHOD (*pm) && PASCAL_VIRTUAL_METHOD (*dm))
+ {
+ if (PEDANTIC (B_D_PASCAL) || co->pascal_dialect == 0)
+- warning ("virtual method overrides non-virtual one");
++ gpc_warning ("virtual method overrides non-virtual one");
+ *pm = TREE_CHAIN (*pm);
+ continue;
+ }
+@@ -782,8 +782,8 @@
+ TYPE_LANG_CODE (type) = PASCAL_LANG_ABSTRACT_OBJECT;
+ if (co->warn_implicit_abstract)
+ {
+- warning ("object type `%s' is implicitly abstract because", object_name);
+- warning (" it contains abstract method `%s'", IDENTIFIER_NAME (DECL_NAME (field)));
++ gpc_warning ("object type `%s' is implicitly abstract because", object_name);
++ gpc_warning (" it contains abstract method `%s'", IDENTIFIER_NAME (DECL_NAME (field)));
+ }
+ }
+ method = convert (ptr_type_node, integer_zero_node);
+@@ -800,12 +800,12 @@
+ /* Set `Size' and `NegatedSize' to 0 for abstract objects */
+ TREE_VALUE (vmt_entry) = TREE_VALUE (TREE_CHAIN (vmt_entry)) = size_zero_node;
+ if (co->warn_inherited_abstract && parent && TYPE_LANG_CODE (parent) != PASCAL_LANG_ABSTRACT_OBJECT)
+- warning ("abstract object type `%s' inherits from non-abstract type `%s'",
++ gpc_warning ("abstract object type `%s' inherits from non-abstract type `%s'",
+ object_name, IDENTIFIER_NAME (DECL_NAME (TYPE_NAME (parent))));
+ }
+ else if (has_virtual_method && !has_constructor && !is_class
+ /* && (co->pascal_dialect & B_D_PASCAL) */)
+- warning ("object type has virtual method, but no constructor");
++ gpc_warning ("object type has virtual method, but no constructor");
+
+ /* Now create a global var declaration (also for abstract types,
+ for `is', `as' and explicit parent type access via VMT).
+@@ -816,13 +816,14 @@
+ build_tree_list (NULL_TREE, vmt_entry), VQ_IMPLICIT | VQ_CONST |
+ (current_module->implementation ? VQ_STATIC : 0));
+
+-#ifdef GCC_4_0
++#if 0 /* def GCC_4_0 */
+ if (current_module->implementation || !(co->interface_only))
+ {
+ mark_decl_referenced (TYPE_LANG_VMT_VAR (type));
+ make_decl_rtl (TYPE_LANG_VMT_VAR (type));
+ }
+ #endif
++
+ /* Attach VMT_TYPE to the implicit VMT field of the object.
+ (Until here it still has the inherited type or ^void type.)
+ We also need this for abstract types because their methods
+@@ -977,16 +978,16 @@
+ {
+ if (op == p_is)
+ {
+- warning ("`is' always yields `True' if the right operand");
+- warning (" is the declared type of the left operand.");
++ gpc_warning ("`is' always yields `True' if the right operand");
++ gpc_warning (" is the declared type of the left operand.");
+ if (TREE_SIDE_EFFECTS (left))
+- warning (" Operand with side-effects is not evaluated.");
++ gpc_warning (" Operand with side-effects is not evaluated.");
+ return boolean_true_node;
+ }
+ else
+ {
+- warning ("`as' has no effect if the right operand is");
+- warning (" the declared type of the left operand");
++ gpc_warning ("`as' has no effect if the right operand is");
++ gpc_warning (" the declared type of the left operand");
+ return oleft;
+ }
+ }
+@@ -999,10 +1000,10 @@
+ {
+ if (op == p_is)
+ {
+- warning ("`is' always yields `False' if the left operand is not");
+- warning (" polymorphic and the right operand is not its type");
++ gpc_warning ("`is' always yields `False' if the left operand is not");
++ gpc_warning (" polymorphic and the right operand is not its type");
+ if (TREE_SIDE_EFFECTS (left))
+- warning (" Operand with side-effects is not evaluated.");
++ gpc_warning (" Operand with side-effects is not evaluated.");
+ return boolean_false_node;
+ }
+ else
+Only in gpc/p: objects.c~
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/options.c gpc/p/options.c
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/options.c 2006-03-03 20:14:31.000000000 +0100
++++ gpc/p/options.c 2006-04-06 06:58:40.000000000 +0200
+@@ -308,7 +308,7 @@
+ }
+ else if (OPT ("-fdisable-debug-info"))
+ {
+- warning ("`--disable-debug-info' is a temporary work-around; it may disappear in the future");
++ gpc_warning ("`--disable-debug-info' is a temporary work-around; it may disappear in the future");
+ if (write_symbols == SDB_DEBUG) /* Not all debug formats like to be reset */
+ write_symbols = NO_DEBUG;
+ debug_info_level = DINFO_LEVEL_NONE;
+@@ -454,7 +454,7 @@
+ {
+ int limit = strtoint (arg, strlen (arg));
+ if (limit <= 0)
+- warning ("invalid specified set limit %s.", arg);
++ gpc_warning ("invalid specified set limit %s.", arg);
+ else
+ co->set_limit = limit;
+ }
+@@ -682,7 +682,7 @@
+ name[--length] = 0;
+ if (length == 0)
+ {
+- warning ("empty Pascal compiler directive");
++ gpc_warning ("empty Pascal compiler directive");
+ return 1;
+ }
+ if (length == 2 && (name[1] == '+' || name[1] == '-'))
+@@ -700,12 +700,12 @@
+ else
+ long_name = short_option->inverted_long_name;
+ if (long_name[1] == '#')
+- warning ("directive `{$%s}' not yet implemented", name);
++ gpc_warning ("directive `{$%s}' not yet implemented", name);
+ else if (long_name[1] == '!')
+ {
+ /* BP-style directive. In BP mode, ignore it for compatibility. */
+ if (pedantic || !(co->pascal_dialect & U_B_D_PASCAL))
+- warning ("ignoring BP directive `{$%s}' which is unnecessary in GPC", name);
++ gpc_warning ("ignoring BP directive `{$%s}' which is unnecessary in GPC", name);
+ }
+ else if (!pascal_decode_option (1, &long_name))
+ error ("internal problem: unknown short option expansion `%s'", long_name);
+@@ -808,7 +808,7 @@
+ case 'o':
+ case 's':
+ if (pedantic || !(co->pascal_dialect & U_B_D_PASCAL))
+- warning ("ignoring BP directive `{$%s}' which is unnecessary in GPC", name);
++ gpc_warning ("ignoring BP directive `{$%s}' which is unnecessary in GPC", name);
+ return 1;
+ /* One-letter directive already handled by the preprocessor */
+ case 'i':
+@@ -929,7 +929,7 @@
+ }
+ return 1;
+ }
+- warning ("unknown compiler directive `%s'", name);
++ gpc_warning ("unknown compiler directive `%s'", name);
+ return 1;
+ }
+
+@@ -1026,14 +1026,14 @@
+ if (error_flag)
+ error ("%s", buf);
+ else
+- warning ("%s", buf);
++ gpc_warning ("%s", buf);
+ *p = ' ';
+ buf = p; /* including the leading space */
+ }
+ if (error_flag)
+ error ("%s", buf);
+ else
+- warning ("%s", buf);
++ gpc_warning ("%s", buf);
+ }
+
+ void
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/p-tree.def gpc/p/p-tree.def
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/p-tree.def 2006-03-03 20:14:31.000000000 +0100
++++ gpc/p/p-tree.def 2006-04-06 06:58:40.000000000 +0200
+@@ -36,6 +36,9 @@
+ DEFTREECODE (RANGE_CHECK_EXPR, "range_check_expr", tcc_expression, 3)
+ DEFTREECODE (IO_RANGE_CHECK_EXPR, "io_range_check_expr", tcc_expression, 3)
+ DEFTREECODE (IN_EXPR, "in_expr", tcc_binary, 2)
++#ifdef GCC_4_1
++DEFTREECODE (PASCAL_SET_CONSTRUCTOR, "pascal_set_constructor", tcc_expression, 1)
++#endif
+ #else
+ #ifdef EGCS
+ DEFTREECODE (OPERATOR_DECL, "operator_decl", 'd', 0)
+Only in gpc/p: p-version.h~
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/parse.c gpc/p/parse.c
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/parse.c 2006-03-24 02:52:27.000000000 +0100
++++ gpc/p/parse.c 2006-04-06 05:37:44.000000000 +0200
+@@ -5214,7 +5214,7 @@
+
+ case 60:
+ #line 378 "parse.y"
+- { warning ("missing semicolon"); yyerrok; ;}
++ { gpc_warning ("missing semicolon"); yyerrok; ;}
+ break;
+
+ case 61:
+@@ -5284,7 +5284,7 @@
+
+ case 81:
+ #line 436 "parse.y"
+- { warning ("missing semicolon"); yyerrok; ;}
++ { gpc_warning ("missing semicolon"); yyerrok; ;}
+ break;
+
+ case 82:
+@@ -5419,7 +5419,7 @@
+
+ case 120:
+ #line 548 "parse.y"
+- { warning ("missing comma"); yyerrok; ;}
++ { gpc_warning ("missing comma"); yyerrok; ;}
+ break;
+
+ case 121:
+@@ -5731,7 +5731,7 @@
+ tree t = build_pascal_pointer_type (make_node (LANG_TYPE));
+ PASCAL_TYPE_CLASS (t) = 1;
+ build_type_decl ((((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval.ttype), t, NULL_TREE);
+- warning("ignored parent in Delphi forward class declaration");
++ gpc_warning ("ignored parent in Delphi forward class declaration");
+ ;}
+ break;
+
+@@ -6710,7 +6710,7 @@
+ #line 1528 "parse.y"
+ {
+ if (!(((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.itype) && extra_warnings)
+- warning ("empty statement after `else'");
++ gpc_warning ("empty statement after `else'");
+ expand_end_cond ();
+ ;}
+ break;
+@@ -6849,7 +6849,7 @@
+ #line 1608 "parse.y"
+ {
+ if (!(((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.itype) && extra_warnings)
+- warning ("empty statement after `then'");
++ gpc_warning ("empty statement after `then'");
+ ;}
+ break;
+
+@@ -7988,7 +7988,7 @@
+
+ case 795:
+ #line 2396 "parse.y"
+- { warning ("missing `.' at the end of program/unit/module"); ;}
++ { gpc_warning ("missing `.' at the end of program/unit/module"); ;}
+ break;
+
+ case 796:
+@@ -9544,7 +9544,7 @@
+ #if YYDEBUG != 0
+ yydebug = value;
+ #else
+- warning ("YYDEBUG not defined.");
++ gpc_warning ("YYDEBUG not defined.");
+ #endif
+ }
+
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/parse.y gpc/p/parse.y
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/parse.y 2006-03-24 02:47:15.000000000 +0100
++++ gpc/p/parse.y 2006-04-06 03:35:49.000000000 +0200
+@@ -375,7 +375,7 @@
+ | error
+ { error ("module specifications need an export part"); }
+ | export_part_list error export_part
+- { warning ("missing semicolon"); yyerrok; }
++ { gpc_warning ("missing semicolon"); yyerrok; }
+ | export_part_list ';' error
+ { error ("extra semicolon"); }
+ ;
+@@ -433,7 +433,7 @@
+ import_specification
+ | import_specification_list ';' import_specification
+ | import_specification_list error import_specification
+- { warning ("missing semicolon"); yyerrok; }
++ { gpc_warning ("missing semicolon"); yyerrok; }
+ ;
+
+ import_specification:
+@@ -545,7 +545,7 @@
+ uses_specification
+ | uses_list ',' uses_specification
+ | uses_list error uses_specification
+- { warning ("missing comma"); yyerrok; }
++ { gpc_warning ("missing comma"); yyerrok; }
+ ;
+
+ uses_specification:
+@@ -786,7 +786,7 @@
+ tree t = build_pascal_pointer_type (make_node (LANG_TYPE));
+ PASCAL_TYPE_CLASS (t) = 1;
+ build_type_decl ($1, t, NULL_TREE);
+- warning("ignored parent in Delphi forward class declaration");
++ gpc_warning ("ignored parent in Delphi forward class declaration");
+ }
+ | new_identifier enable_lce equals p_class LEX_RANGE p_end
+ {
+@@ -1527,7 +1527,7 @@
+ pushlevel optional_statement poplevel
+ {
+ if (!$5 && extra_warnings)
+- warning ("empty statement after `else'");
++ gpc_warning ("empty statement after `else'");
+ expand_end_cond ();
+ }
+ | p_case expression p_of
+@@ -1607,7 +1607,7 @@
+ pushlevel optional_statement poplevel
+ {
+ if (!$6 && extra_warnings)
+- warning ("empty statement after `then'");
++ gpc_warning ("empty statement after `then'");
+ }
+ ;
+
+@@ -2393,7 +2393,7 @@
+ dot_or_error:
+ '.'
+ | error
+- { warning ("missing `.' at the end of program/unit/module"); }
++ { gpc_warning ("missing `.' at the end of program/unit/module"); }
+ ;
+
+ null:
+@@ -2487,7 +2487,7 @@
+ #if YYDEBUG != 0
+ yydebug = value;
+ #else
+- warning ("YYDEBUG not defined.");
++ gpc_warning ("YYDEBUG not defined.");
+ #endif
+ }
+
+Only in gpc/p: parse.y~
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/plant.c gpc/p/plant.c
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/plant.c 2006-03-24 00:51:09.000000000 +0100
++++ gpc/p/plant.c 2006-04-08 05:42:12.000000000 +0200
+@@ -285,7 +285,9 @@
+ current_function_decl = DECL_CONTEXT (the_fun);
+ cfun = NULL;
+
+- if (!DECL_CONTEXT (the_fun) || PASCAL_METHOD (the_fun))
++ if (!DECL_CONTEXT (the_fun)
++ || TREE_CODE (DECL_CONTEXT (the_fun)) != FUNCTION_DECL
++ /* PASCAL_METHOD (the_fun) */)
+ {
+ // current_function_decl = NULL_TREE;
+ current_function_decl = the_fun;
+Only in gpc/p: plant.c~
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/predef.c gpc/p/predef.c
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/predef.c 2006-03-24 02:47:15.000000000 +0100
++++ gpc/p/predef.c 2006-04-07 02:01:03.000000000 +0200
+@@ -1185,7 +1185,15 @@
+ case 't': if (TYPE_MAIN_VARIANT (type) != gpc_type_TimeStamp) errstr = "argument %d to `%s' must be of type `TimeStamp'"; break;
+ case 'a': if (TYPE_MAIN_VARIANT (type) != gpc_type_BindingType) errstr = "argument %d to `%s' must be of type `BindingType'"; break;
+ case 'x': break; /* Untyped parameter */
+- case '#': if (TREE_CONSTANT (val) && (TREE_CODE (val) != CONSTRUCTOR || type == empty_set_type_node)) { error ("`%s' applied to a constant", r_name); return error_mark_node; } break; /* expression or type allowed */
++ case '#': if (TREE_CONSTANT (val)
++ && ((TREE_CODE (val) != CONSTRUCTOR
++ && TREE_CODE (val) != PASCAL_SET_CONSTRUCTOR)
++ || type == empty_set_type_node))
++ {
++ error ("`%s' applied to a constant", r_name);
++ return error_mark_node;
++ }
++ break; /* expression or type allowed */
+ default: gcc_unreachable ();
+ }
+ if (ISUPPER ((unsigned char) argtype))
+@@ -1552,11 +1560,12 @@
+ return NULL_TREE;
+
+ case p_Card:
+- if (TREE_CODE (val) == CONSTRUCTOR && PASCAL_CONSTRUCTOR_INT_CST (val))
++ if (TREE_CODE (val) == PASCAL_SET_CONSTRUCTOR
++ && PASCAL_CONSTRUCTOR_INT_CST (val))
+ {
+ tree e;
+ retval = integer_zero_node;
+- for (e = CONSTRUCTOR_ELTS (val); e; e = TREE_CHAIN (e))
++ for (e = SET_CONSTRUCTOR_ELTS (val); e; e = TREE_CHAIN (e))
+ {
+ tree l = TREE_PURPOSE (e), u = TREE_VALUE (e);
+ gcc_assert (TREE_CODE (l) == INTEGER_CST && TREE_CODE (u) == INTEGER_CST);
+@@ -1568,7 +1577,8 @@
+ gcc_assert (TREE_CODE (retval) == INTEGER_CST);
+ break;
+ }
+- if (TREE_CODE (val) == CONSTRUCTOR && TREE_CODE (TREE_TYPE (val)) == SET_TYPE)
++ if (TREE_CODE (val) == PASCAL_SET_CONSTRUCTOR
++ && TREE_CODE (TREE_TYPE (val)) == SET_TYPE)
+ {
+ val = construct_set (val, NULL_TREE, 1);
+ CHK_EM (val);
+@@ -1590,7 +1600,7 @@
+ if (co->pascal_dialect & C_E_O_PASCAL)
+ error ("argument to `%s' must be of real type", r_name);
+ else
+- warning ("`%s' applied to integers has no effect", r_name);
++ gpc_warning ("`%s' applied to integers has no effect", r_name);
+ retval = val;
+ }
+ else
+@@ -1667,7 +1677,7 @@
+ {
+ tree arg;
+ if (argcount == 1)
+- warning ("`%s' with only one argument has no effect", r_name);
++ gpc_warning ("`%s' with only one argument has no effect", r_name);
+ for (arg = apar; arg; arg = TREE_CHAIN (arg))
+ if (!is_string_compatible_type (TREE_VALUE (arg), 1))
+ errstr = "arguments to `%s' must be strings or chars";
+@@ -1706,7 +1716,7 @@
+ case p_Ord:
+ if (code == INTEGER_TYPE)
+ {
+- warning ("`%s' applied to integers has no effect", r_name);
++ gpc_warning ("`%s' applied to integers has no effect", r_name);
+ retval = val;
+ }
+ else
+@@ -1739,9 +1749,9 @@
+ else if (pedantic && !contains_auto_initialized_part (type, r_num == p_Finalize))
+ {
+ if (r_num == p_Finalize)
+- warning ("variable does not need any finalization");
++ gpc_warning ("variable does not need any finalization");
+ else
+- warning ("variable does not need any initialization");
++ gpc_warning ("variable does not need any initialization");
+ }
+ init_any (val, r_num == p_Finalize, 0);
+ retval = error_mark_node; /* nothing to expand anymore -- init_any does it already */
+@@ -1823,9 +1833,12 @@
+
+ /* (val = nil) ? 0 : strlen|Length (val) */
+ if (TYPE_MAIN_VARIANT (type) == cstring_type_node)
+- strlength = build (COND_EXPR, integer_type_node,
+- build_pascal_binary_op (EQ_EXPR, val, null_pointer_node), integer_zero_node,
+- build_routine_call (strlen_routine_node, build_tree_list (NULL_TREE, val)));
++ strlength = build (COND_EXPR, pascal_integer_type_node,
++ build_pascal_binary_op (EQ_EXPR, val, null_pointer_node),
++ convert (pascal_integer_type_node, integer_zero_node),
++ convert (pascal_integer_type_node,
++ build_routine_call (strlen_routine_node,
++ build_tree_list (NULL_TREE, val))));
+ else
+ strlength = PASCAL_STRING_LENGTH (val);
+ retval = make_new_variable ("cstring2string", build_pascal_string_schema (save_expr (strlength)));
+@@ -1860,7 +1873,7 @@
+ case p_Conjugate:
+ if (INT_REAL (code))
+ {
+- warning ("`%s' applied to real numbers has no effect", r_name);
++ gpc_warning ("`%s' applied to real numbers has no effect", r_name);
+ retval = val;
+ }
+ else if (r_num == p_Re)
+@@ -1872,9 +1885,9 @@
+ case p_Im:
+ if (INT_REAL (code))
+ {
+- warning ("`%s' applied to real numbers always yields 0.", r_name);
++ gpc_warning ("`%s' applied to real numbers always yields 0.", r_name);
+ if (TREE_SIDE_EFFECTS (val))
+- warning (" Argument with side-effects is not evaluated.");
++ gpc_warning (" Argument with side-effects is not evaluated.");
+ retval = real_zero_node;
+ }
+ else
+@@ -1923,7 +1936,8 @@
+ }
+
+ case p_Assigned:
+- retval = build (NE_EXPR, boolean_type_node, val, integer_zero_node);
++ retval = build (NE_EXPR, boolean_type_node, val,
++ convert (TREE_TYPE (val), integer_zero_node));
+ break;
+
+ case p_GetMem:
+@@ -1956,7 +1970,7 @@
+ CHK_EM (ptype);
+
+ if (TREE_CODE (ptype) == VOID_TYPE && !(co->pascal_dialect & B_D_PASCAL))
+- warning ("argument to `%s' should not be an untyped pointer", r_name);
++ gpc_warning ("argument to `%s' should not be an untyped pointer", r_name);
+ if (PASCAL_TYPE_ANYFILE (ptype))
+ error ("`AnyFile' pointers cannot be allocated with `%s'", r_name);
+
+@@ -2064,8 +2078,12 @@
+ int save_warn_object_assignment = co->warn_object_assignment;
+ co->warn_object_assignment = 0;
+ #endif
++
++
+ expand_expr_stmt (build_modify_expr (res_deref, NOP_EXPR,
+ build_pascal_initializer (TREE_TYPE (type), init, "type in `New'", 0)));
++
++
+ #if 0
+ co->warn_object_assignment = save_warn_object_assignment;
+ #endif
+@@ -2125,7 +2143,8 @@
+ argcount = 1;
+ TREE_CHAIN (apar) = NULL_TREE;
+ }
+- expand_start_cond (build (NE_EXPR, boolean_type_node, val, integer_zero_node), 0);
++ expand_start_cond (build (NE_EXPR, boolean_type_node, val,
++ convert (TREE_TYPE (val), integer_zero_node)), 0);
+ init_any (build_indirect_ref (val, NULL), 1, 1);
+ if (co->pascal_dialect & C_E_O_PASCAL)
+ {
+@@ -2140,12 +2159,12 @@
+ if (co->pascal_dialect & C_E_O_PASCAL)
+ error ("standard Pascal forbids `%s (nil)'", r_name);
+ else
+- warning ("`%s (nil)' has no effect", r_name);
++ gpc_warning ("`%s (nil)' has no effect", r_name);
+ }
+ if (argcount > 1)
+ {
+ if (PEDANTIC (GNU_PASCAL))
+- warning (r_num == p_Dispose
++ gpc_warning (r_num == p_Dispose
+ ? "tag fields ignored in `%s'"
+ : "second parameter ignored in `%s'", r_name);
+ /* @@ Perhaps we should do a run-time check ? */
+@@ -2222,7 +2241,7 @@
+ case p_Int:
+ if (code == INTEGER_TYPE)
+ {
+- warning ("`%s' applied to integers has no effect", r_name);
++ gpc_warning ("`%s' applied to integers has no effect", r_name);
+ retval = val;
+ }
+ break;
+@@ -2230,9 +2249,9 @@
+ case p_Frac:
+ if (code == INTEGER_TYPE)
+ {
+- warning ("`%s' applied to integers always yields 0.", r_name);
++ gpc_warning ("`%s' applied to integers always yields 0.", r_name);
+ if (TREE_SIDE_EFFECTS (val))
+- warning (" Argument with side-effects is not evaluated.");
++ gpc_warning (" Argument with side-effects is not evaluated.");
+ retval = integer_zero_node;
+ }
+ break;
+@@ -2294,7 +2313,7 @@
+ }
+ else if (co->pascal_dialect & U_B_D_M_PASCAL)
+ {
+- warning ("unspecified buffer size for untyped file defaults to 128 in `%s'", r_name);
++ gpc_warning ("unspecified buffer size for untyped file defaults to 128 in `%s'", r_name);
+ buffer_size = build_int_2 (128, 0);
+ }
+ else
+@@ -2544,7 +2563,7 @@
+ errstr = "left argument of `pow' is 0 while right argument is <= 0";
+ if (!pedantic && (co->pascal_dialect & C_E_O_PASCAL))
+ {
+- warning (errstr);
++ gpc_warning (errstr);
+ errstr = NULL;
+ }
+ }
+@@ -2653,11 +2672,11 @@
+ if (r_num == p_LT) /* s < '' is impossible */
+ {
+ if (invert_result)
+- warning ("`>=' comparison against the empty string is always `True'.");
++ gpc_warning ("`>=' comparison against the empty string is always `True'.");
+ else
+- warning ("`<' comparison against the empty string is always `False'.");
++ gpc_warning ("`<' comparison against the empty string is always `False'.");
+ if (TREE_SIDE_EFFECTS (val))
+- warning (" Operand with side-effects is not evaluated.");
++ gpc_warning (" Operand with side-effects is not evaluated.");
+ return invert_result ? boolean_true_node : boolean_false_node;
+ }
+ comp_empty = val;
+@@ -2996,7 +3015,7 @@
+ get_standard_input (void)
+ {
+ if (co->warn_implicit_io)
+- warning ("implicit use of `Input'");
++ gpc_warning ("implicit use of `Input'");
+ if (!current_module->input_available)
+ {
+ current_module->input_available = 1;
+@@ -3009,7 +3028,7 @@
+ get_standard_output (void)
+ {
+ if (co->warn_implicit_io)
+- warning ("implicit use of `Output'");
++ gpc_warning ("implicit use of `Output'");
+ if (!current_module->output_available)
+ {
+ current_module->output_available = 1;
+Common subdirectories: /pom/kompi/gcc/tst45/pom/gpc-20060325/p/rts and gpc/p/rts
+Common subdirectories: /pom/kompi/gcc/tst45/pom/gpc-20060325/p/script and gpc/p/script
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/statements.c gpc/p/statements.c
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/statements.c 2006-03-24 03:47:15.000000000 +0100
++++ gpc/p/statements.c 2006-04-07 19:28:45.000000000 +0200
+@@ -73,7 +73,7 @@
+ if (PEDANTIC (GNU_PASCAL))
+ {
+ if (co->pascal_dialect & B_D_M_PASCAL)
+- warning ("GPC and Borland Pascal have different `asm' syntax");
++ gpc_warning ("GPC and Borland Pascal have different `asm' syntax");
+ else
+ chk_dialect ("`asm' is", B_D_M_PASCAL);
+ }
+@@ -203,7 +203,7 @@
+ else if (TREE_CODE (t) == VAR_DECL && PASCAL_FOR_LOOP_COUNTER (t))
+ {
+ if (co->pascal_dialect & B_D_M_PASCAL)
+- warning ("%s of `for' loop counter", description);
++ gpc_warning ("%s of `for' loop counter", description);
+ else
+ {
+ error ("%s of `for' loop counter", description);
+@@ -245,11 +245,11 @@
+ return 0;
+ }
+ else
+- warning ("%s: typed const misused as initialized variable", description);
++ gpc_warning ("%s: typed const misused as initialized variable", description);
+ if (!informed)
+ {
+- warning (" (Better use ISO 10206 Extended Pascal initialized");
+- warning (" types and variables: `var foo: integer value 7'.)");
++ gpc_warning (" (Better use ISO 10206 Extended Pascal initialized");
++ gpc_warning (" types and variables: `var foo: integer value 7'.)");
+ informed = 1;
+ }
+ }
+@@ -284,7 +284,7 @@
+ {
+ tree valtype = TREE_TYPE (TREE_TYPE (current_function_decl));
+ if (TREE_THIS_VOLATILE (current_function_decl))
+- warning ("routine declared `noreturn' returns");
++ gpc_warning ("routine declared `noreturn' returns");
+ /* This must be done before returning, otherwise it would jump over it. */
+ cleanup_routine ();
+ if (!retval)
+@@ -396,9 +396,9 @@
+ if (const_lt (chi, hi))
+ nlo = fold (build (PLUS_EXPR, TREE_TYPE (chi), (ehi = chi), convert (TREE_TYPE (chi), integer_one_node)));
+ if (tree_int_cst_equal (elo, ehi))
+- warning ("duplicate `case' element %ld", (long) TREE_INT_CST_LOW (elo));
++ gpc_warning ("duplicate `case' element %ld", (long) TREE_INT_CST_LOW (elo));
+ else
+- warning ("duplicate `case' range %ld .. %ld", (long) TREE_INT_CST_LOW (elo), (long) TREE_INT_CST_LOW (ehi));
++ gpc_warning ("duplicate `case' range %ld .. %ld", (long) TREE_INT_CST_LOW (elo), (long) TREE_INT_CST_LOW (ehi));
+ if (!nlo && !nhi)
+ lo = hi = NULL_TREE;
+ else
+@@ -591,7 +591,8 @@
+ CHK_EM (counter);
+
+ /* Make a set out of a set constructor */
+- if (TREE_CODE (expr) == CONSTRUCTOR && TREE_CODE (TREE_TYPE (expr)) == SET_TYPE)
++ if (TREE_CODE (expr) == PASCAL_SET_CONSTRUCTOR
++ && TREE_CODE (TREE_TYPE (expr)) == SET_TYPE)
+ expr = construct_set (expr, NULL_TREE, 0);
+ if (TREE_CODE (TREE_TYPE (expr)) != SET_TYPE)
+ {
+@@ -600,7 +601,7 @@
+ }
+ else if (TREE_TYPE (expr) == empty_set_type_node)
+ {
+- warning ("`for ... in []' (empty set) has no effect");
++ gpc_warning ("`for ... in []' (empty set) has no effect");
+ /* Be as silent as possible to give the optimizer a chance to remove the whole loop. */
+ empty_set = 1;
+ }
+@@ -916,7 +917,7 @@
+ || TREE_READONLY (t)
+ || TYPE_READONLY (TREE_TYPE (t))
+ || (TREE_CODE (t) == VAR_DECL && PASCAL_DECL_TYPED_CONST (t)))
+- warning ("constant file variables are pointless");
++ gpc_warning ("constant file variables are pointless");
+
+ /* Always pass the internal name to the RTS, not only for external files. */
+ if (TREE_CODE (thing) == VAR_DECL)
+@@ -929,7 +930,7 @@
+ fname = build_string_constant (temp, strlen (temp), 0);
+
+ if (pedantic && PASCAL_TYPE_PACKED (type))
+- warning ("`packed' has no effect on the external file format");
++ gpc_warning ("`packed' has no effect on the external file format");
+
+ /* Pass the size of the file buffer. */
+ file_size = (TREE_CODE (component_type) == VOID_TYPE) ? size_one_node : size_in_bytes (component_type);
+@@ -1053,10 +1054,16 @@
+ {
+ if (!TREE_VALUE (decl))
+ expand_expr_stmt (TREE_PURPOSE (decl));
+- else if (!TREE_PURPOSE (decl))
+- init_any (TREE_VALUE (decl), the_end, 1);
+ else
++ {
++ init_any (TREE_VALUE (decl), the_end, 1);
++ if (TREE_PURPOSE (decl))
++ expand_pascal_assignment2 (TREE_VALUE (decl),
++ TREE_PURPOSE (decl), 1);
++#if 0
+ expand_expr_stmt (build_modify_expr (TREE_VALUE (decl), INIT_EXPR, TREE_PURPOSE (decl)));
++#endif
++ }
+ }
+ for (decl = names; decl; decl = TREE_CHAIN (decl))
+ {
+@@ -1146,10 +1153,10 @@
+ }
+
+ void
+-expand_pascal_assignment (tree target, tree source)
++expand_pascal_assignment2 (tree target, tree source, int is_init)
+ {
+ tree stmt, schema_source, schema_target;
+- int allow_restricted_target = 0, allow_restricted_source = 0;
++ int allow_restricted_target = is_init, allow_restricted_source = is_init;
+ if (EM (TREE_TYPE (source)) || EM (TREE_TYPE (target)))
+ return;
+
+@@ -1206,7 +1213,7 @@
+ allow_restricted_target = 1;
+ }
+
+- if (!mark_lvalue (target, "assignment", 1))
++ if (!mark_lvalue (target, is_init? "initialization" : "assignment", !is_init))
+ return;
+
+ schema_source = undo_schema_dereference (source);
+@@ -1250,7 +1257,9 @@
+ tree schema_check = check_discriminants (schema_target, schema_source);
+ if (!EM (schema_check))
+ {
+- if (!lvalue_or_else (schema_target, "assignment") || !mark_lvalue (schema_target, "assignment", 1))
++ if (!lvalue_or_else (schema_target, "assignment")
++ || !mark_lvalue (schema_target, is_init ? "initialization"
++ : "assignment", is_init))
+ return;
+ stmt = build (MODIFY_EXPR, TREE_TYPE (schema_target),
+ schema_target, schema_source);
+@@ -1259,12 +1268,19 @@
+ stmt = build (COMPOUND_EXPR, TREE_TYPE (stmt), schema_check, stmt);
+ }
+ else
+- stmt = build_modify_expr (target, NOP_EXPR, source);
++ stmt = build_modify_expr (target,
++ is_init ? INIT_EXPR : NOP_EXPR, source);
+ }
+ if (stmt && !EM (stmt))
+ expand_expr_stmt (stmt);
+ }
+
++void
++expand_pascal_assignment (tree target, tree source)
++{
++ expand_pascal_assignment2 (target, source, 0);
++}
++
+ tree
+ assign_set (tree target, tree source)
+ {
+@@ -1273,7 +1289,8 @@
+ return error_mark_node;
+ /* @@ Test new constructor code without this.
+ Construct a set directly to the set variable. */
+- if (TREE_CODE (source) == CONSTRUCTOR && TREE_CODE (TREE_TYPE (source)) == SET_TYPE)
++ if (TREE_CODE (source) == PASCAL_SET_CONSTRUCTOR
++ && TREE_CODE (TREE_TYPE (source)) == SET_TYPE)
+ {
+ source = construct_set (source, target, 0);
+ if (!source)
+@@ -1310,7 +1327,7 @@
+ Each string may be either a fixed or variable length string.
+ @@@ No sophisticated checks are made for capacity violations. */
+ tree
+-assign_string (tree target, tree source)
++assign_string2 (tree target, tree source, int is_init)
+ {
+ tree length = NULL_TREE;
+ tree t_type = base_type (TREE_TYPE (target));
+@@ -1334,7 +1351,7 @@
+ if (TREE_CODE (t_type) == CHAR_TYPE)
+ {
+ if (pedantic || !(co->pascal_dialect & E_O_PASCAL))
+- warning ("assignment of string value to char variable");
++ gpc_warning ("assignment of string value to char variable");
+ expr1 = PASCAL_STRING_VALUE (source);
+ expr1 = build_modify_expr (target, NOP_EXPR, build_array_ref (expr1,
+ TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (expr1)))));
+@@ -1431,6 +1448,12 @@
+ return expr;
+ }
+
++tree
++assign_string (tree target, tree source)
++{
++ return assign_string2 (target, source, 0);
++}
++
+ /* Main program, module initializers/finalizers. */
+
+ static void
+Only in gpc/p: statements.c~
+Common subdirectories: /pom/kompi/gcc/tst45/pom/gpc-20060325/p/test and gpc/p/test
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/typecheck.c gpc/p/typecheck.c
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/typecheck.c 2006-03-24 03:47:15.000000000 +0100
++++ gpc/p/typecheck.c 2006-04-09 03:31:39.000000000 +0200
+@@ -28,6 +28,9 @@
+
+ #include "gpc.h"
+
++extern void
++set_string_length (tree value, int wide_flag, int length);
++
+ static int compatible_assignment_p (tree, tree);
+ static int check_simple_pascal_initializer (tree, tree);
+ static tree decl_constant_value (tree);
+@@ -47,7 +50,11 @@
+ static void really_start_incremental_init (tree);
+ static void push_init_level (void);
+ static tree build_bitfields_type (tree, int);
++#ifndef GCC_4_1
+ static tree do_build_constructor_rev (tree, tree);
++#else
++static tree do_build_constructor_rev (tree, VEC(constructor_elt,gc) *);
++#endif
+ static tree fill_one_record (tree *, tree, tree, tree *, HOST_WIDE_INT, HOST_WIDE_INT *);
+ static tree fake_packed_array_constructor (void);
+ static tree pop_init_level (void);
+@@ -569,6 +576,7 @@
+ && TREE_CONSTANT (DECL_INITIAL (decl))
+ /* Check for cases where this is sub-optimal, even though valid. */
+ && TREE_CODE (DECL_INITIAL (decl)) != CONSTRUCTOR
++ && TREE_CODE (DECL_INITIAL (decl)) != PASCAL_SET_CONSTRUCTOR
+ && DECL_MODE (decl) != BLKmode)
+ return DECL_INITIAL (decl);
+ return decl;
+@@ -645,7 +653,8 @@
+ return build (COMPOUND_EXPR, TREE_TYPE (op1), TREE_OPERAND (exp, 0), op1);
+ }
+
+- if (!lvalue_p (exp) && !(TREE_CODE (exp) == CONSTRUCTOR && TREE_STATIC (exp))
++ if (!lvalue_p (exp)
++ && !(TREE_CODE (exp) == CONSTRUCTOR && TREE_STATIC (exp))
+ && !((TREE_CODE (exp) == NOP_EXPR
+ #ifdef EGCS97
+ || TREE_CODE (exp) == VIEW_CONVERT_EXPR
+@@ -921,7 +930,7 @@
+ }
+ else
+ {
+- if (TREE_CODE (val) == CONSTRUCTOR)
++ if (TREE_CODE (val) == PASCAL_SET_CONSTRUCTOR)
+ /* Convert the set constructor to the corresponding set type */
+ #if 0
+ val = construct_set (val, type, 2);
+@@ -929,7 +938,7 @@
+ /* fjf880.pas */
+ {
+ tree temp = make_new_variable ("set_parameter", partype);
+- if (!CONSTRUCTOR_ELTS (val))
++ if (!SET_CONSTRUCTOR_ELTS (val))
+ {
+ construct_set (val, temp, 0);
+ val = temp;
+@@ -1058,6 +1067,7 @@
+ && ((TYPE_READONLY (TREE_TYPE (type))
+ && (TREE_CODE (val) == STRING_CST
+ || TREE_CODE (val) == CONSTRUCTOR
++ || TREE_CODE (val) == PASCAL_SET_CONSTRUCTOR
+ || !lvalue_p (val)
+ || ((PASCAL_TYPE_STRING (TREE_TYPE (type)) || TREE_CODE (TREE_TYPE (type)) == VOID_TYPE)
+ && (TREE_CODE (TREE_TYPE (val)) == CHAR_TYPE
+@@ -1076,7 +1086,8 @@
+ TYPE_READONLY (TREE_TYPE (type)),
+ TYPE_VOLATILE (TREE_TYPE (type))));
+ }
+- else if (TREE_CODE (val) == CONSTRUCTOR && TREE_CODE (TREE_TYPE (val)) == SET_TYPE)
++ else if (TREE_CODE (val) == PASCAL_SET_CONSTRUCTOR
++ && TREE_CODE (TREE_TYPE (val)) == SET_TYPE)
+ val = construct_set (val, NULL_TREE, 0);
+ else if (TREE_CODE (val) == FUNCTION_DECL)
+ val = build_routine_call (val, NULL_TREE);
+@@ -1927,8 +1938,11 @@
+ if (integer_zerop (capacity))
+ TREE_VALUE (init) = empty_string_node;
+ else if (TREE_CODE (TREE_VALUE (init)) == STRING_CST)
++ {
+ TREE_VALUE (init) = build_string_constant (TREE_STRING_POINTER (TREE_VALUE (init)),
+ TREE_INT_CST_LOW (capacity), PASCAL_CST_FRESH (TREE_VALUE (init)));
++ set_string_length (TREE_VALUE (init), 0, TREE_INT_CST_LOW (capacity) + 1);
++ }
+ else
+ {
+ /* We can't get here with char constants! */
+@@ -1938,6 +1952,10 @@
+ }
+ string_length = capacity;
+ }
++ else if (TREE_CODE (TREE_VALUE (init)) == STRING_CST)
++ {
++ set_string_length (TREE_VALUE (init), 0, TREE_INT_CST_LOW (capacity) + 1);
++ }
+ else if (TREE_CODE (TREE_TYPE (TREE_VALUE (init))) == CHAR_TYPE)
+ /* convert char to string: [1: char-value; 2 .. Capacity + 1: Chr (0)] */
+ TREE_VALUE (init) = tree_cons (build_tree_list (integer_one_node, NULL_TREE), TREE_VALUE (init),
+@@ -2021,17 +2039,51 @@
+ return 0;
+ }
+ /* Pointers to strings used as CStrings. */
++#if 1
++ if (TREE_CODE (TREE_VALUE (init)) == ADDR_EXPR)
++ {
++ tree s = TREE_OPERAND (TREE_VALUE (init), 0);
++ if (TREE_CODE (s) == VAR_DECL && TREE_READONLY (s)
++ && DECL_INITIAL (s)
++ && TREE_CODE (DECL_INITIAL (s)) == CONSTRUCTOR
++ && PASCAL_TYPE_DISCRIMINATED_STRING (
++ TREE_TYPE (DECL_INITIAL (s))))
++ {
++ int constant = TREE_CONSTANT (TREE_VALUE (init));
++#ifndef GCC_4_1
++ tree t = CONSTRUCTOR_ELTS (DECL_INITIAL (s));
++ TREE_VALUE (init) = build1 (ADDR_EXPR, cstring_type_node,
++ TREE_VALUE (TREE_CHAIN (TREE_CHAIN (t))));
++#else
++ VEC(constructor_elt,gc) *elts = CONSTRUCTOR_ELTS (
++ DECL_INITIAL (s));
++ TREE_VALUE (init) = build1 (ADDR_EXPR, cstring_type_node,
++ VEC_index (constructor_elt, elts, 2)->value);
++#endif
++ TREE_CONSTANT (TREE_VALUE (init)) = constant;
++ return 0;
++ }
++ }
++#else
+ if (TREE_CODE (TREE_VALUE (init)) == ADDR_EXPR
+ && TREE_CODE (TREE_OPERAND (TREE_VALUE (init), 0)) == CONSTRUCTOR
+ && PASCAL_TYPE_DISCRIMINATED_STRING (TREE_TYPE (TREE_OPERAND (TREE_VALUE (init), 0))))
+ {
+ int constant = TREE_CONSTANT (TREE_VALUE (init));
++#ifndef GCC_4_1
+ tree t = CONSTRUCTOR_ELTS (TREE_OPERAND (TREE_VALUE (init), 0));
+ TREE_VALUE (init) = build1 (ADDR_EXPR, cstring_type_node,
+ TREE_VALUE (TREE_CHAIN (TREE_CHAIN (t))));
++#else
++ VEC(constructor_elt,gc) *elts = CONSTRUCTOR_ELTS (
++ TREE_OPERAND (TREE_VALUE (init), 0));
++ TREE_VALUE (init) = build1 (ADDR_EXPR, cstring_type_node,
++ VEC_index (constructor_elt, elts, 2)->value);
++#endif
+ TREE_CONSTANT (TREE_VALUE (init)) = constant;
+ return 0;
+ }
++#endif
+ }
+
+ /* Procedural variables. (Pointers to routines should cause no problems.) */
+@@ -2049,14 +2101,14 @@
+ }
+
+ /* Sets. */
+- if (TREE_CODE (TREE_VALUE (init)) == CONSTRUCTOR
++ if (TREE_CODE (TREE_VALUE (init)) == PASCAL_SET_CONSTRUCTOR
+ && TREE_CODE (TREE_TYPE (TREE_VALUE (init))) == SET_TYPE
+ && TREE_CODE (type) == SET_TYPE
+ && TREE_TYPE (TREE_VALUE (init)) == empty_set_type_node)
+ {
+ /* The type of the set constructor was not known to the parser.
+ Specify it now, but check it first. */
+- tree elements = CONSTRUCTOR_ELTS (TREE_VALUE (init));
++ tree elements = SET_CONSTRUCTOR_ELTS (TREE_VALUE (init));
+ if (elements && !comptypes (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_PURPOSE (elements))),
+ TYPE_MAIN_VARIANT (TREE_TYPE (type))))
+ return 1;
+@@ -2784,6 +2836,9 @@
+ break;
+
+ case CONSTRUCTOR:
++#ifdef GCC_4_1
++ case PASCAL_SET_CONSTRUCTOR:
++#endif
+ TREE_ADDRESSABLE (x) = 1;
+ return 1;
+
+@@ -2932,10 +2987,13 @@
+ so the usual warnings are not appropriate. */
+ if (TREE_CODE (ttr) != FUNCTION_TYPE && TREE_CODE (ttl) != FUNCTION_TYPE)
+ {
++#if 0
+ if (!TYPE_READONLY (ttl) && TYPE_READONLY (ttr))
+ assignment_error_or_warning ("%s discards `const' from pointer target type",
+ errtype, fundecl, parmnum, 0);
+- else if (!TYPE_VOLATILE (ttl) && TYPE_VOLATILE (ttr))
++ else
++#endif
++ if (!TYPE_VOLATILE (ttl) && TYPE_VOLATILE (ttr))
+ assignment_error_or_warning ("%s discards `volatile' from pointer target type",
+ errtype, fundecl, parmnum, 0);
+ else if (TREE_CODE (ttl) == INTEGER_TYPE && TREE_CODE (ttr) == INTEGER_TYPE)
+@@ -3090,7 +3148,7 @@
+ }
+ else
+ {
+- warning (msg, opname);
++ gpc_warning (msg, opname);
+ if (name)
+ warning_with_decl (fundecl, " routine declaration");
+ }
+@@ -3516,7 +3574,11 @@
+ /* If we are saving up the elements rather than allocating them,
+ this is the list of elements so far (in reverse order,
+ most recent first). */
++#ifndef GCC_4_1
+ static tree constructor_elements;
++#else
++static VEC(constructor_elt,gc) *constructor_elements;
++#endif
+
+ /* 1 if so far this constructor's elements are all compile-time constants. */
+ static int constructor_constant;
+@@ -3550,7 +3612,11 @@
+ tree max_index;
+ tree unfilled_index;
+ tree unfilled_fields;
++#ifndef GCC_4_1
+ tree elements;
++#else
++ VEC(constructor_elt,gc) *elements;
++#endif
+ int offset;
+ tree pending_elts;
+ int depth;
+@@ -3762,7 +3828,11 @@
+ return NULL_TREE; /* avoid further error messages */
+ gcc_assert (TREE_CODE (init) == TREE_LIST);
+
++#ifndef GCC_4_1
+ constructor_elements = NULL_TREE;
++#else
++ constructor_elements = NULL;
++#endif
+ constructor_stack = 0;
+ spelling_base = 0;
+ spelling_size = 0;
+@@ -3881,7 +3951,11 @@
+ constructor_constant = 1;
+ constructor_simple = 1;
+ constructor_depth = SPELLING_DEPTH ();
++#ifndef GCC_4_1
+ constructor_elements = NULL_TREE;
++#else
++ constructor_elements = NULL;
++#endif
+ constructor_pending_elts = NULL_TREE;
+
+ /* Don't die if an entire brace-pair level is superfluous in the containing level. */
+@@ -3963,10 +4037,19 @@
+ return type;
+ }
+
++#ifndef GCC_4_1
+ static tree
+ do_build_constructor_rev (tree type, tree el)
++#else
++static tree
++do_build_constructor_rev (tree type, VEC(constructor_elt,gc) *el)
++#endif
+ {
++#ifndef GCC_4_1
+ tree constructor = build_constructor (type, nreverse (el));
++#else
++ tree constructor = build_constructor (type, el);
++#endif
+ if (constructor_constant)
+ {
+ TREE_CONSTANT (constructor) = 1;
+@@ -3982,7 +4065,11 @@
+ static tree
+ fill_one_record (tree *pel, tree min, tree ptype, tree *fields, HOST_WIDE_INT maxnr, HOST_WIDE_INT *pnr)
+ {
++#ifndef GCC_4_1
+ tree prl = NULL_TREE;
++#else
++ VEC(constructor_elt,gc) * prl = NULL;
++#endif
+ tree el = *pel;
+ HOST_WIDE_INT oanr = 0;
+ int first = 1;
+@@ -4003,7 +4090,8 @@
+ }
+ if (anr != oanr)
+ break;
+- prl = tree_cons (fields[nr], TREE_VALUE (el), prl);
++
++ CONSTRUCTOR_APPEND_ELT (prl, fields[nr], TREE_VALUE (el));
+ el = TREE_CHAIN (el);
+ *pel = el;
+ }
+@@ -4013,11 +4101,35 @@
+ static tree
+ fake_packed_array_constructor (void)
+ {
+- tree rtype = NULL_TREE, rfields = NULL_TREE, rl = NULL_TREE;
+- tree type = constructor_type, el = nreverse (constructor_elements);
+- tree tsize = pascal_array_type_nelts (type), orig_el = el;
++ tree rtype = NULL_TREE, rfields = NULL_TREE;
++ tree type = constructor_type;
++#ifndef GCC_4_1
++ tree rl = NULL_TREE;
++ tree el = nreverse (constructor_elements);
++#else
++ VEC(constructor_elt,gc) * rl = NULL;
++ tree el = NULL_TREE;
++#endif
++ tree tsize = pascal_array_type_nelts (type), orig_el;
+ HOST_WIDE_INT size = TREE_INT_CST_LOW (tsize), asize = size / BITS_PER_UNIT;
+ int psize = size % BITS_PER_UNIT;
++
++#ifdef GCC_4_1
++ {
++ VEC(constructor_elt,gc) *elts = constructor_elements;
++ unsigned HOST_WIDE_INT ix;
++ ix = VEC_length (constructor_elt, elts);
++ while (ix > 0)
++ {
++ ix--;
++ el = tree_cons (VEC_index (constructor_elt, elts, ix)->index,
++ VEC_index (constructor_elt, elts, ix)->value, el);
++ }
++ }
++#endif
++
++ orig_el = el;
++
+ if (size <= 0 || TREE_INT_CST_HIGH (tsize))
+ {
+ error ("array too large");
+@@ -4027,7 +4139,12 @@
+ {
+ tree ptype = build_bitfields_type (TREE_TYPE (type), BITS_PER_UNIT);
+ tree fields[BITS_PER_UNIT];
+- tree atype, arfield, al = NULL_TREE, t;
++ tree atype, arfield, t;
++#ifndef GCC_4_1
++ tree al = NULL_TREE;
++#else
++ VEC(constructor_elt,gc) * al = NULL;
++#endif
+ int i;
+ for (i = 0, t = TYPE_FIELDS (ptype); i < BITS_PER_UNIT; i++, t = TREE_CHAIN (t))
+ fields[i] = t;
+@@ -4040,10 +4157,12 @@
+ tree br = fill_one_record (&el, TYPE_MIN_VALUE (TYPE_DOMAIN (type)), ptype, fields, asize, &anr);
+ if (!br)
+ break;
+- al = tree_cons (build_int_2 (anr, 0), br, al);
++
++ CONSTRUCTOR_APPEND_ELT (al, build_int_2 (anr, 0), br);
+ }
+ if (al)
+- rl = build_tree_list (arfield, do_build_constructor_rev (atype, al));
++ CONSTRUCTOR_APPEND_ELT (rl, arfield,
++ do_build_constructor_rev (atype, al));
+ }
+ if (psize)
+ {
+@@ -4063,7 +4182,7 @@
+ HOST_WIDE_INT anr;
+ tree pr1 = fill_one_record (&el, TYPE_MIN_VALUE (TYPE_DOMAIN (type)), ptype1, fields1, asize + 1, &anr);
+ if (pr1)
+- rl = tree_cons (prfield, pr1, rl);
++ CONSTRUCTOR_APPEND_ELT (rl, prfield, pr1);
+ }
+ }
+ gcc_assert (!el);
+@@ -4116,8 +4235,12 @@
+ {
+ /* A scalar initializer -- just return the element, after
+ verifying there is just one. */
++#ifndef GCC_4_1
+ gcc_assert (constructor_elements && !TREE_CHAIN (constructor_elements));
+ constructor = TREE_VALUE (constructor_elements);
++#else
++ gcc_unreachable ();
++#endif
+ }
+ else
+ {
+@@ -4139,7 +4262,12 @@
+ && count_bits (TREE_TYPE (constructor_type), NULL))
+ constructor = fake_packed_array_constructor ();
+ else
++#ifndef GCC_4_1
+ constructor = build_constructor (constructor_type, nreverse (constructor_elements));
++#else
++ constructor = build_constructor (constructor_type,
++ constructor_elements);
++#endif
+ if (constructor_constant)
+ {
+ TREE_CONSTANT (constructor) = 1;
+@@ -4379,8 +4507,10 @@
+ {
+ /* Otherwise, output this element to constructor_elements. */
+ if (!duplicate)
+- constructor_elements = tree_cons (field,
+- digest_init (type, value, require_constant_value), constructor_elements);
++ {
++ value = digest_init (type, value, require_constant_value);
++ CONSTRUCTOR_APPEND_ELT (constructor_elements, field, value);
++ }
+
+ /* Advance the variable that indicates sequential elements output. */
+ if (TREE_CODE (constructor_type) == ARRAY_TYPE)
+Only in gpc/p: typecheck.c~
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/types.c gpc/p/types.c
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/types.c 2006-03-24 03:47:15.000000000 +0100
++++ gpc/p/types.c 2006-04-06 05:35:47.000000000 +0200
+@@ -82,7 +82,7 @@
+ if (TYPE_LANG_CODE_TEST (type, PASCAL_LANG_ABSTRACT_OBJECT))
+ error ("abstract object type declared as function result type");
+ else if (co->warn_object_assignment)
+- warning ("object type declared as function result type");
++ gpc_warning ("object type declared as function result type");
+ }
+ if (!SCALAR_TYPE (TREE_CODE (type)))
+ chk_dialect ("structured function result types are", NOT_CLASSIC_PASCAL);
+@@ -281,7 +281,7 @@
+ && TREE_CODE (upper) == INTEGER_CST
+ && tree_int_cst_lt (upper, lower))
+ {
+- warning ("set constructor range is empty");
++ gpc_warning ("set constructor range is empty");
+ *pres = TREE_CHAIN (m);
+ continue;
+ }
+@@ -307,8 +307,8 @@
+ /* A single element/range with side-effects should be safe. */
+ if (side_effects && TREE_CHAIN (elements))
+ {
+- warning ("expressions with side-effects in set constructors are");
+- warning (" problematic since evaluation is implementation-dependent");
++ gpc_warning ("expressions with side-effects in set constructors are");
++ gpc_warning (" problematic since evaluation is implementation-dependent");
+ }
+ /* Sort and merge constant constructor elements */
+ if (is_intcst && n)
+@@ -338,9 +338,9 @@
+ i = j;
+ }
+ }
+- t = make_node (CONSTRUCTOR);
++ t = make_node (PASCAL_SET_CONSTRUCTOR);
+ TREE_TYPE (t) = empty_set_type_node; /* real type not yet known */
+- CONSTRUCTOR_ELTS (t) = elements;
++ SET_CONSTRUCTOR_ELTS (t) = elements;
+ TREE_CONSTANT (t) = TREE_STATIC (t) = is_constant;
+ #ifdef GCC_4_0
+ TREE_INVARIANT (t) = is_constant;
+@@ -355,10 +355,10 @@
+ limited_set (tree lo)
+ {
+ tree hi = fold (build_pascal_binary_op (PLUS_EXPR, lo, size_int (co->set_limit - 1)));
+- warning ("constructing limited integer set `%li .. %li';",
++ gpc_warning ("constructing limited integer set `%li .. %li';",
+ (long int) TREE_INT_CST_LOW (lo),
+ (long int) TREE_INT_CST_LOW (hi));
+- warning (" use `--setlimit=NUMBER' to change the size limit at compile time.");
++ gpc_warning (" use `--setlimit=NUMBER' to change the size limit at compile time.");
+ return hi;
+ }
+
+@@ -384,7 +384,7 @@
+ tree elements, elem, set_low, set_high, setsize, this_set_type;
+ tree nelem;
+ CHK_EM (constructor);
+- elements = CONSTRUCTOR_ELTS (constructor);
++ elements = SET_CONSTRUCTOR_ELTS (constructor);
+ if (!elements && (arg_type == 0 || (arg_type == 1 && !target_or_type)))
+ {
+ if (arg_type == 0 && target_or_type)
+@@ -511,7 +511,7 @@
+ nelem = tree_cons (lo2, hi2, nelem);
+ }
+ nelem = nreverse (nelem);
+- CONSTRUCTOR_ELTS (constructor) = nelem;
++ SET_CONSTRUCTOR_ELTS (constructor) = nelem;
+ return constructor;
+ }
+
+@@ -1485,6 +1485,7 @@
+ are handled differently above, anyway.) */
+ TYPE_PRECISION (type) = ((TREE_INT_CST_LOW (bits) + BITS_PER_UNIT - 1)
+ / BITS_PER_UNIT) * BITS_PER_UNIT;
++ TYPE_ALIGN (type) = 0;
+ layout_type (type);
+ }
+ }
+@@ -1800,7 +1801,7 @@
+ if (TREE_CODE (l) != INTEGER_CST || TREE_CODE (h) != INTEGER_CST || const_lt (h, l))
+ {
+ if (co->warn_dynamic_arrays)
+- warning ("dynamic array");
++ gpc_warning ("dynamic array");
+ if (current_function_decl) /* @@ otherwise do it in module constructor */
+ expand_expr_stmt (build (COND_EXPR, pascal_integer_type_node,
+ build_implicit_pascal_binary_op (LT_EXPR, hi, lo),
+@@ -1819,7 +1820,7 @@
+ enum tree_code code = TREE_CODE (expr);
+ if (code == VAR_DECL && !PASCAL_INITIALIZED (expr) && !PASCAL_VALUE_ASSIGNED (expr)
+ && !PASCAL_TREE_DISCRIMINANT (expr) && DECL_CONTEXT (expr) == current_function_decl)
+- warning ("`%s' might be used uninitialized in type definition", IDENTIFIER_NAME (DECL_NAME (expr)));
++ gpc_warning ("`%s' might be used uninitialized in type definition", IDENTIFIER_NAME (DECL_NAME (expr)));
+ else if (IS_EXPR_OR_REF_CODE_CLASS (TREE_CODE_CLASS (code)))
+ {
+ int i, l = NUMBER_OF_OPERANDS (code);
+@@ -2658,6 +2659,7 @@
+ }
+ else if (TREE_CODE (arg1) == INTEGER_CST && TREE_CODE (arg0) == CONSTRUCTOR)
+ {
++#ifndef GCC_4_1
+ tree elts = CONSTRUCTOR_ELTS (arg0);
+ arg1 = range_check (TYPE_DOMAIN (TREE_TYPE (arg0)), arg1);
+ CHK_EM (arg1);
+@@ -2667,6 +2669,17 @@
+ return TREE_VALUE (elts);
+ elts = TREE_CHAIN (elts);
+ }
++#else
++ VEC(constructor_elt,gc) *elts = CONSTRUCTOR_ELTS (arg0);
++ tree index, value;
++ unsigned HOST_WIDE_INT ix;
++ arg1 = range_check (TYPE_DOMAIN (TREE_TYPE (arg0)), arg1);
++ FOR_EACH_CONSTRUCTOR_ELT (elts, ix, index, value)
++ {
++ if (tree_int_cst_equal (arg1, index))
++ return value;
++ }
++#endif
+ }
+ return t;
+ }
+@@ -2953,7 +2966,7 @@
+ int need_new_variant;
+
+ if (bindable && !PASCAL_TYPE_FILE (type))
+- warning ("GPC supports `bindable' only for files");
++ gpc_warning ("GPC supports `bindable' only for files");
+
+ CHK_EM (type);
+
+Common subdirectories: /pom/kompi/gcc/tst45/pom/gpc-20060325/p/units and gpc/p/units
+Common subdirectories: /pom/kompi/gcc/tst45/pom/gpc-20060325/p/utils and gpc/p/utils
+Common subdirectories: /pom/kompi/gcc/tst45/pom/gpc-20060325/p/test/CVS and gpc/p/test/CVS
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/test/README gpc/p/test/README
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/test/README 2006-02-18 14:37:53.000000000 +0100
++++ gpc/p/test/README 2006-04-04 19:39:50.000000000 +0200
+@@ -4,7 +4,7 @@
+ Note: This file is the `README' file of the `test' directory in the GPC
+ source distribution, _and_ the file `BUGS' in GPC binary distributions.
+
+-GPC 2.1, 20060215
++GPC 2.1, 20060325
+
+ 1 The GPC Test Suite
+ ********************
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/test/c_gpc.pas gpc/p/test/c_gpc.pas
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/test/c_gpc.pas 2006-02-18 14:23:00.000000000 +0100
++++ gpc/p/test/c_gpc.pas 2006-04-06 05:35:48.000000000 +0200
+@@ -33,14 +33,14 @@
+ { External declarations we use from the C code }
+
+ var
+- CVariable: Integer; external name 'c_variable';
++ CVariable: CInteger; external name 'c_variable';
+
+ procedure CRoutine; external name 'c_routine';
+
+ { Pascal code }
+
+ var
+- PascalProgramVariable: Integer = 17; attribute (name = 'pascal_program_variable');
++ PascalProgramVariable: CInteger = 17; attribute (name = 'pascal_program_variable');
+
+ procedure PascalProgramRoutine; attribute (name = 'pascal_program_routine');
+ begin
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/test/chief40.pas gpc/p/test/chief40.pas
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/test/chief40.pas 2002-09-23 09:39:12.000000000 +0200
++++ gpc/p/test/chief40.pas 2006-04-06 05:35:48.000000000 +0200
+@@ -4,12 +4,15 @@
+ a : LongInt;
+ b : Byte;
+
++const
++ MaxCInt = High (CInteger);
++
+ begin
+- a := 2 * MaxInt;
++ a := 2 * MaxCInt;
+ b := 10;
+ a := 2 * a + b;
+- if (a = 4 * MaxInt + 10) and (a > MaxInt) then
++ if (a = 4 * MaxCInt + 10) and (a > MaxCInt) then
+ WriteLn ('OK')
+ else
+- WriteLn ('failed ', a, ' ', 4 * MaxInt + 10, ' ', a > MaxInt)
++ WriteLn ('failed ', a, ' ', 4 * MaxCInt + 10, ' ', a > MaxCInt)
+ end.
+Only in gpc/p/test: fjf1102.pas
+Only in gpc/p/test: fjf1103.pas
+Only in gpc/p/test: fjf1104.pas
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/test/fjf186.pas gpc/p/test/fjf186.pas
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/test/fjf186.pas 2005-01-19 15:23:19.000000000 +0100
++++ gpc/p/test/fjf186.pas 2006-04-06 06:24:30.000000000 +0200
+@@ -2,7 +2,7 @@
+ var
+ f:text;
+ s:string(100);
+- n:string(20)=ParamStr (1); { Idea how to solve this: let init_any() }
++ n:string(520)=ParamStr (1); { Idea how to solve this: let init_any() }
+ begin { generate code to do the initialization }
+ if n = '' then
+ begin
+Only in gpc/p/test: fjf186.pas~
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/test/fjf327.pas gpc/p/test/fjf327.pas
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/test/fjf327.pas 2005-02-23 07:09:05.000000000 +0100
++++ gpc/p/test/fjf327.pas 2006-04-06 05:35:48.000000000 +0200
+@@ -1,10 +1,10 @@
+ program fjf327;
+
+ var
+- a : Cardinal = High (Cardinal) - 2;
++ a : CCardinal = High (CCardinal) - 2;
+ c : LongInt;
+
+ begin
+ c := - a;
+- if c = 2 - LongInt (High (Cardinal)) then writeln ('OK') else writeln ('failed ', c)
++ if c = 2 - LongInt (High (CCardinal)) then writeln ('OK') else writeln ('failed ', c)
+ end.
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/test/fjf526a.pas gpc/p/test/fjf526a.pas
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/test/fjf526a.pas 2005-01-05 01:56:39.000000000 +0100
++++ gpc/p/test/fjf526a.pas 2006-04-06 05:35:48.000000000 +0200
+@@ -5,7 +5,7 @@
+ a, b: LongInt;
+
+ begin
+- b := 1 shl BitSizeOf (Integer) + 1;
++ b := 1 shl BitSizeOf (CInteger) + 1;
+ Rewrite (f, 1);
+ BlockWrite (f, a, SizeOf (a));
+ Reset (f, 1);
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/test/fjf526b.pas gpc/p/test/fjf526b.pas
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/test/fjf526b.pas 2005-01-05 01:56:47.000000000 +0100
++++ gpc/p/test/fjf526b.pas 2006-04-06 05:35:48.000000000 +0200
+@@ -5,7 +5,7 @@
+ a, b: LongInt;
+
+ begin
+- b := 1 shl BitSizeOf (Integer) + 1;
++ b := 1 shl BitSizeOf (CInteger) + 1;
+ Rewrite (f, 1);
+ BlockWrite (f, a, b and $ffffffff);
+ WriteLn ('OK')
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/test/gpc_c_p.pas gpc/p/test/gpc_c_p.pas
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/test/gpc_c_p.pas 2006-02-18 14:23:04.000000000 +0100
++++ gpc/p/test/gpc_c_p.pas 2006-04-06 05:35:48.000000000 +0200
+@@ -42,14 +42,14 @@
+ { External declarations we use from the C code }
+
+ var
+- CVariable: Integer; external name 'c_variable';
++ CVariable: CInteger; external name 'c_variable';
+
+ procedure CRoutine; external name 'c_routine';
+
+ { Pascal code }
+
+ var
+- PascalProgramVariable: Integer = 17; attribute (name = 'pascal_program_variable');
++ PascalProgramVariable: CInteger = 17; attribute (name = 'pascal_program_variable');
+
+ procedure PascalProgramRoutine; attribute (name = 'pascal_program_routine');
+ begin
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/test/gpc_c_u.pas gpc/p/test/gpc_c_u.pas
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/test/gpc_c_u.pas 2006-02-18 14:23:04.000000000 +0100
++++ gpc/p/test/gpc_c_u.pas 2006-04-06 05:35:48.000000000 +0200
+@@ -30,7 +30,7 @@
+ interface
+
+ var
+- PascalUnitVariable: Integer = 42; attribute (name = 'pascal_unit_variable');
++ PascalUnitVariable: CInteger = 42; attribute (name = 'pascal_unit_variable');
+
+ procedure PascalUnitRoutine; attribute (name = 'pascal_unit_routine');
+
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/test/shl.pas gpc/p/test/shl.pas
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/test/shl.pas 2002-09-23 09:39:12.000000000 +0200
++++ gpc/p/test/shl.pas 2006-04-06 05:35:48.000000000 +0200
+@@ -1,14 +1,14 @@
+ program ShlTest;
+
+ var
+- a: Integer = 1;
++ a: CInteger = 1;
+ i: LongestInt;
+
+ begin
+
+- i := 1 shl (BitSizeOf (Integer) + 3);
++ i := 1 shl (BitSizeOf (CInteger) + 3);
+ if i <= 0 then begin WriteLn ('failed a1'); Halt end;
+- if i shr (BitSizeOf (Integer) + 3) <> 1 then begin WriteLn ('failed a2'); Halt end;
++ if i shr (BitSizeOf (CInteger) + 3) <> 1 then begin WriteLn ('failed a2'); Halt end;
+
+ i := 1 shl (BitSizeOf (MedInt) - 2);
+ if i <= 0 then begin WriteLn ('failed a3'); Halt end;
+@@ -18,9 +18,9 @@
+ if i <= 0 then begin WriteLn ('failed a5'); Halt end;
+ if i <> $10000000000 then begin WriteLn ('failed a6'); Halt end;
+
+- i := a shl (BitSizeOf (Integer) + 3);
++ i := a shl (BitSizeOf (CInteger) + 3);
+ if i <= 0 then begin WriteLn ('failed b1'); Halt end;
+- if i shr (BitSizeOf (Integer) + 3) <> 1 then begin WriteLn ('failed b2'); Halt end;
++ if i shr (BitSizeOf (CInteger) + 3) <> 1 then begin WriteLn ('failed b2'); Halt end;
+
+ i := a shl (BitSizeOf (MedInt) - 2);
+ if i <= 0 then begin WriteLn ('failed b3'); Halt end;
+Common subdirectories: /pom/kompi/gcc/tst45/pom/gpc-20060325/p/test/todo and gpc/p/test/todo
+Only in /pom/kompi/gcc/tst45/pom/gpc-20060325/p/utils/: .#gpidump.pas.1.10
+Only in /pom/kompi/gcc/tst45/pom/gpc-20060325/p/utils/: .#gpidump.pas.1.8
+Only in /pom/kompi/gcc/tst45/pom/gpc-20060325/p/utils/: .#mk-t-inc.1.3
+Common subdirectories: /pom/kompi/gcc/tst45/pom/gpc-20060325/p/utils/CVS and gpc/p/utils/CVS
+diff -u /pom/kompi/gcc/tst45/pom/gpc-20060325/p/utils/gpidump.pas gpc/p/utils/gpidump.pas
+--- /pom/kompi/gcc/tst45/pom/gpc-20060325/p/utils/gpidump.pas 2006-03-24 03:47:16.000000000 +0100
++++ gpc/p/utils/gpidump.pas 2006-04-10 03:51:11.000000000 +0200
+@@ -902,6 +902,9 @@
+ {$ifdef EGCS97}
+ Ref ('size_unit');
+ {$endif}
++{$ifdef GCC_4_1}
++ if TreeCode <> FUNCTION_DECL then
++{$endif}
+ Write (', align ', Number (GetNumber (Pos1), 0))
+ end;
+ 'c': Ref ('type');
+@@ -1166,6 +1169,18 @@
+ OPERATOR_DECL: ;
+ PLACEHOLDER_EXPR: Ref ('type');
+ NON_LVALUE_EXPR: if IsPackedAccess then Ref ('packed_info');
++{$ifdef GCC_4_1}
++ CONSTRUCTOR: begin
++ var j, k : GPIInt;
++ Ref ('type');
++ k := GetNumber (Pos1);
++ for j := 1 to k do begin
++ Ref('index');
++ Ref('value')
++ end;
++ end;
++
++{$endif}
+ else if not ClassDone
+ {$ifndef GCC_4_0} or (TreeCode = RTL_EXPR) {$endif}
+ then Error ('unknown tree code')
+@@ -1232,7 +1247,7 @@
+ GPI_CHUNK_VERSION: begin
+ WriteLn;
+ DumpChars (' ', 0, ChunkLength - 1);
+- if (ChunkLength = 0) or not IsSuffix (GCC_VERSION, Buf^.Chars[0 .. ChunkLength - 1]) then
++ if (ChunkLength = 0) { or not IsSuffix (GCC_VERSION, Buf^.Chars[0 .. ChunkLength - 1]) } then
+ begin
+ WriteLn;
+ Error ('backend version in GPI file does not match (rebuild GPIDump for your compiler version)')
+Only in gpc/p/utils/: gpidump.pas~
--- gcc-4.1-4.1.2.orig/debian/patches/kbsd-gnu.dpatch
+++ gcc-4.1-4.1.2/debian/patches/kbsd-gnu.dpatch
@@ -0,0 +1,133 @@
+#! /bin/sh -e
+
+# DP: GNU/k*BSD support
+# Author: Robert Millan
+# Status: Not yet submitted
+
+
+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.
+
+diff -Nur gcc-4.0.2.old/gcc/config/i386/kfreebsd-gnu.h gcc-4.0.2/gcc/config/i386/kfreebsd-gnu.h
+--- gcc-4.0.2.old/gcc/config/i386/kfreebsd-gnu.h 2004-06-24 04:56:23.000000000 +0200
++++ gcc-4.0.2/gcc/config/i386/kfreebsd-gnu.h 2002-02-22 18:06:42.369039552 +0100
+@@ -1,5 +1,5 @@
+-/* Definitions for Intel 386 running kFreeBSD-based GNU systems with ELF format
+- Copyright (C) 2004
++/* Definitions for Intel 386 (and AMD x86-64) running kFreeBSD-based GNU systems with ELF format
++ Copyright (C) 2004, 2006
+ Free Software Foundation, Inc.
+ Contributed by Robert Millan.
+
+@@ -22,5 +22,11 @@
+
+ #undef LINK_EMULATION
+ #define LINK_EMULATION "elf_i386_fbsd"
++
++#ifdef LINK_EMULATION64
++#undef LINK_EMULATION64
++#define LINK_EMULATION64 "elf_x86_64_fbsd"
++#endif
++
+ #undef REG_NAME
+ #define REG_NAME(reg) sc_ ## reg
+diff -Nur gcc-4.0.2.old/gcc/config/i386/linux64.h gcc-4.0.2/gcc/config/i386/linux64.h
+--- gcc-4.0.2.old/gcc/config/i386/linux64.h 2004-11-27 23:29:34.000000000 +0100
++++ gcc-4.0.2/gcc/config/i386/linux64.h 2002-02-22 18:07:41.220092832 +0100
+@@ -1,5 +1,5 @@
+ /* Definitions for AMD x86-64 running Linux-based GNU systems with ELF format.
+- Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
++ Copyright (C) 2001, 2002, 2004, 2006 Free Software Foundation, Inc.
+ Contributed by Jan Hubicka , based on linux.h.
+
+ This file is part of GCC.
+@@ -54,14 +54,27 @@
+ When the -shared link option is used a final link is not being
+ done. */
+
++/* These macros may be overridden in i386/k*bsd-gnu.h. */
++#define LINK_EMULATION "elf_i386"
++#define LINK_EMULATION64 "elf_x86_64"
++#define DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
++
++#undef SUBTARGET_EXTRA_SPECS
++#define SUBTARGET_EXTRA_SPECS \
++ { "link_emulation", LINK_EMULATION },\
++ { "link_emulation64", LINK_EMULATION64 },\
++ { "dynamic_linker", DYNAMIC_LINKER },\
++ { "dynamic_linker64", DYNAMIC_LINKER64 }
++
+ #undef LINK_SPEC
+-#define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} \
++#define LINK_SPEC "%{!m32:-m %(link_emulation64)} %{m32:-m %(link_emulation)} \
+ %{shared:-shared} \
+ %{!shared: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+- %{m32:%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
+- %{!m32:%{!dynamic-linker:-dynamic-linker /lib64/ld-linux-x86-64.so.2}}} \
++ %{m32:%{!dynamic-linker:-dynamic-linker %(dynamic_linker)}} \
++ %{!m32:%{!dynamic-linker:-dynamic-linker %(dynamic_linker64)}}} \
+ %{static:-static}}"
+
+ #define MULTILIB_DEFAULTS { "m64" }
+diff -Nur gcc-4.0.2.old/gcc/config/kfreebsd-gnu.h gcc-4.0.2/gcc/config/kfreebsd-gnu.h
+--- gcc-4.0.2.old/gcc/config/kfreebsd-gnu.h 2004-06-24 04:56:23.000000000 +0200
++++ gcc-4.0.2/gcc/config/kfreebsd-gnu.h 2002-02-22 18:01:48.768673592 +0100
+@@ -34,3 +34,8 @@
+
+ #undef DYNAMIC_LINKER
+ #define DYNAMIC_LINKER "/lib/ld.so.1"
++
++#ifdef DYNAMIC_LINKER64
++#undef DYNAMIC_LINKER64
++#define DYNAMIC_LINKER64 "/lib/ld-kfreebsd-x86-64.so.1"
++#endif
+diff -Nur gcc-4.0.2.old/gcc/config/knetbsd-gnu.h gcc-4.0.2/gcc/config/knetbsd-gnu.h
+--- gcc-4.0.2.old/gcc/config/knetbsd-gnu.h 2004-06-24 04:56:23.000000000 +0200
++++ gcc-4.0.2/gcc/config/knetbsd-gnu.h 2002-02-22 18:02:05.581117712 +0100
+@@ -34,3 +34,8 @@
+
+ #undef DYNAMIC_LINKER
+ #define DYNAMIC_LINKER "/lib/ld.so.1"
++
++#ifdef DYNAMIC_LINKER64
++#undef DYNAMIC_LINKER64
++#define DYNAMIC_LINKER64 "/lib/ld-knetbsd-x86-64.so.1"
++#endif
+diff -Nur gcc-4.0.2.old/gcc/config.gcc gcc-4.0.2/gcc/config.gcc
+--- gcc-4.0.2.old/gcc/config.gcc 2005-08-09 12:57:04.000000000 +0200
++++ gcc-4.0.2/gcc/config.gcc 2002-02-22 18:04:37.990947896 +0100
+@@ -1012,8 +1012,8 @@
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h \
+ i386/x86-64.h i386/linux64.h"
+ case ${target} in
+- x86_64-*-kfreebsd*-gnu) tm_file="${tm_file} kfreebsd-gnu.h" ;;
+- x86_64-*-knetbsd*-gnu) tm_file="${tm_file} knetbsd-gnu.h" ;;
++ x86_64-*-kfreebsd*-gnu) tm_file="${tm_file} kfreebsd-gnu.h i386/kfreebsd-gnu.h" ;;
++ x86_64-*-knetbsd*-gnu) tm_file="${tm_file} knetbsd-gnu.h i386/knetbsd-gnu.h" ;;
+ esac
+ tmake_file="${tmake_file} i386/t-linux64"
+ ;;
+
--- gcc-4.1-4.1.2.orig/debian/patches/netbsd-dynlinker.dpatch
+++ gcc-4.1-4.1.2/debian/patches/netbsd-dynlinker.dpatch
@@ -0,0 +1,47 @@
+#! /bin/sh -e
+
+# JB: Dynamic linker patches for netbsd.
+
+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 -ur src.orig/gcc/config/i386/netbsd-elf.h src/gcc/config/i386/netbsd-elf.h
+--- src.orig/gcc/config/i386/netbsd-elf.h 2002-03-01 23:38:15.000000000 +0000
++++ src/gcc/config/i386/netbsd-elf.h 2003-01-21 19:44:46.000000000 +0000
+@@ -35,7 +35,7 @@
+ %{!e*:-e __start}}} \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+- %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}} \
++ %{!dynamic-linker:-dynamic-linker /lib/ld.elf_so}} \
+ %{static:-static}}"
+
+ /* Names to predefine in the preprocessor for this target machine. */
+diff -ur src.orig/gcc/config/netbsd-elf.h src/gcc/config/netbsd-elf.h
+--- src.orig/gcc/config/netbsd-elf.h 2002-01-22 04:23:02.000000000 +0000
++++ src/gcc/config/netbsd-elf.h 2003-01-21 19:44:27.000000000 +0000
+@@ -72,5 +72,5 @@
+ %{!e*:-e __start}}} \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+- %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}} \
++ %{!dynamic-linker:-dynamic-linker /lib/ld.elf_so}} \
+ %{static:-static}}"
--- gcc-4.1-4.1.2.orig/debian/patches/svn-doc-updates.dpatch
+++ gcc-4.1-4.1.2/debian/patches/svn-doc-updates.dpatch
@@ -0,0 +1,40 @@
+#! /bin/sh -e
+
+# DP: SVN updates from the 4.1 branch upto 20070214.
+
+last_updated()
+{
+ cat > ${dir}LAST_UPDATED <&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
+ touch ${dir}libjava/testsuite/libjava.jni/PR28178.out
+ last_updated
+ #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
+
+# diff -urN --exclude=.svn gcc_4_1_2_release gcc-4_1-branch
+# svn diff svn://gcc.gnu.org/svn/gcc/tags/gcc_4_1_2_release svn://gcc.gnu.org/svn/gcc/branches/gcc-4_1-branch
+
--- gcc-4.1-4.1.2.orig/debian/patches/mips-libjava-interp.dpatch
+++ gcc-4.1-4.1.2/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.2.orig/debian/patches/kbsd-gnu-java.dpatch
+++ gcc-4.1-4.1.2/debian/patches/kbsd-gnu-java.dpatch
@@ -0,0 +1,336 @@
+#! /bin/sh -e
+
+# Description: java support for GNU/k*BSD
+# Author: Robert Millan, Petr Salinger
+
+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 -p2 < $0
+ ;;
+ -unpatch)
+ patch $pdir -f --no-backup-if-mismatch -R -p2 < $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.
+
+diff -ur gcj-4.1-4.1.0/src/boehm-gc/configure gcj-4.1-4.1.0/src/boehm-gc/configure
+--- gcj-4.1-4.1.0/src/boehm-gc/configure 2006-02-28 09:39:11.000000000 +0100
++++ gcj-4.1-4.1.0/src/boehm-gc/configure 2006-05-12 08:34:57.000000000 +0200
+@@ -5434,6 +5423,32 @@
+
+ THREADLIBS="-lpthread -lrt"
+ ;;
++ *-*-kfreebsd*-gnu)
++ cat >>confdefs.h <<\_ACEOF
++#define GC_FREEBSD_THREADS 1
++_ACEOF
++
++ INCLUDES="$INCLUDES -pthread"
++ THREADDLLIBS=-pthread
++ cat >>confdefs.h <<\_ACEOF
++#define _REENTRANT 1
++_ACEOF
++
++ 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 USE_COMPILER_TLS 1
++_ACEOF
++
++ ;;
+ *-*-freebsd*)
+ { echo "$as_me:$LINENO: WARNING: \"FreeBSD does not yet fully support threads with Boehm GC.\"" >&5
+ echo "$as_me: WARNING: \"FreeBSD does not yet fully support threads with Boehm GC.\"" >&2;}
+diff -ur gcj-4.1-4.1.0/src/boehm-gc/configure.ac gcj-4.1-4.1.0/src/boehm-gc/configure.ac
+--- gcj-4.1-4.1.0/src/boehm-gc/configure.ac 2006-02-07 02:05:55.000000000 +0100
++++ gcj-4.1-4.1.0/src/boehm-gc/configure.ac 2006-05-12 08:35:43.000000000 +0200
+@@ -150,6 +150,17 @@
+ AC_DEFINE(THREAD_LOCAL_ALLOC,1)
+ THREADLIBS="-lpthread -lrt"
+ ;;
++ *-*-kfreebsd*-gnu)
++ AC_DEFINE(GC_FREEBSD_THREADS)
++ INCLUDES="$INCLUDES -pthread"
++ THREADDLLIBS=-pthread
++ AC_DEFINE(_REENTRANT)
++ if test "${enable_parallel_mark}" = yes; then
++ AC_DEFINE(PARALLEL_MARK)
++ fi
++ AC_DEFINE(THREAD_LOCAL_ALLOC)
++ AC_DEFINE(USE_COMPILER_TLS, 1,[use tls for boehm])
++ ;;
+ *-*-freebsd*)
+ AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.")
+ AC_DEFINE(GC_FREEBSD_THREADS,1,[support FreeBSD threads])
+diff -ur gcj-4.1-4.1.0/src/boehm-gc/dyn_load.c gcj-4.1-4.1.0/src/boehm-gc/dyn_load.c
+--- gcj-4.1-4.1.0/src/boehm-gc/dyn_load.c 2005-02-26 16:40:07.000000000 +0100
++++ gcj-4.1-4.1.0/src/boehm-gc/dyn_load.c 2006-05-12 08:33:17.000000000 +0200
+@@ -26,7 +26,7 @@
+ * None of this is safe with dlclose and incremental collection.
+ * But then not much of anything is safe in the presence of dlclose.
+ */
+-#if defined(__linux__) && !defined(_GNU_SOURCE)
++#if (defined(__linux__) || defined(__GLIBC__)) && !defined(_GNU_SOURCE)
+ /* Can't test LINUX, since this must be define before other includes */
+ # define _GNU_SOURCE
+ #endif
+@@ -373,7 +373,7 @@
+ /* For glibc 2.2.4+. Unfortunately, it doesn't work for older */
+ /* versions. Thanks to Jakub Jelinek for most of the code. */
+
+-# if defined(LINUX) /* Are others OK here, too? */ \
++# if (defined(LINUX) || defined (__GLIBC__)) /* Are others OK here, too? */ \
+ && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
+ || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
+
+diff -ur gcj-4.1-4.1.0/src/boehm-gc/include/gc.h gcj-4.1-4.1.0/src/boehm-gc/include/gc.h
+--- gcj-4.1-4.1.0/src/boehm-gc/include/gc.h 2005-01-02 04:35:57.000000000 +0100
++++ gcj-4.1-4.1.0/src/boehm-gc/include/gc.h 2006-05-12 08:33:17.000000000 +0200
+@@ -497,7 +497,7 @@
+ # define GC_RETURN_ADDR (GC_word)__return_address
+ #endif
+
+-#ifdef __linux__
++#if defined(__linux__) || defined(__GLIBC__)
+ # include
+ # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
+ && !defined(__ia64__)
+diff -ur gcj-4.1-4.1.0/src/boehm-gc/include/gc_config.h.in gcj-4.1-4.1.0/src/boehm-gc/include/gc_config.h.in
+--- gcj-4.1-4.1.0/src/boehm-gc/include/gc_config.h.in 2006-02-07 02:05:55.000000000 +0100
++++ gcj-4.1-4.1.0/src/boehm-gc/include/gc_config.h.in 2006-05-12 08:35:50.000000000 +0200
+@@ -148,6 +148,9 @@
+ /* define GC_local_malloc() & GC_local_malloc_atomic() */
+ #undef THREAD_LOCAL_ALLOC
+
++/* use tls for boehm */
++#undef USE_COMPILER_TLS
++
+ /* use MMAP instead of sbrk to get new memory */
+ #undef USE_MMAP
+
+diff -ur gcj-4.1-4.1.0/src/boehm-gc/include/private/gcconfig.h gcj-4.1-4.1.0/src/boehm-gc/include/private/gcconfig.h
+--- gcj-4.1-4.1.0/src/boehm-gc/include/private/gcconfig.h 2005-09-06 16:22:01.000000000 +0200
++++ gcj-4.1-4.1.0/src/boehm-gc/include/private/gcconfig.h 2006-05-12 08:34:42.000000000 +0200
+@@ -55,7 +55,7 @@
+ # endif
+
+ /* And one for FreeBSD: */
+-# if defined(__FreeBSD__) && !defined(FREEBSD)
++# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ # define FREEBSD
+ # endif
+
+@@ -334,6 +334,10 @@
+ # define I386
+ # define mach_type_known
+ # endif
++# if defined(FREEBSD) && defined(__x86_64__)
++# define X86_64
++# define mach_type_known
++# endif
+ # if defined(__NetBSD__) && (defined(i386) || defined(__i386__))
+ # define I386
+ # define mach_type_known
+@@ -1223,8 +1223,15 @@
+ # ifndef GC_FREEBSD_THREADS
+ # define MPROTECT_VDB
+ # endif
+-# define SIG_SUSPEND SIGUSR1
+-# define SIG_THR_RESTART SIGUSR2
++# ifdef __GLIBC__
++# define SIG_SUSPEND (32+6)
++# define SIG_THR_RESTART (32+5)
++ extern int _end[];
++# define DATAEND (_end)
++# else
++# define SIG_SUSPEND SIGUSR1
++# define SIG_THR_RESTART SIGUSR2
++# endif
+ # define FREEBSD_STACKBOTTOM
+ # ifdef __ELF__
+ # define DYNAMIC_LOADING
+@@ -1923,6 +1930,28 @@
+ # define PREFETCH_FOR_WRITE(x) __builtin_prefetch((x), 1)
+ # endif
+ # endif
++# ifdef FREEBSD
++# define OS_TYPE "FREEBSD"
++# ifndef GC_FREEBSD_THREADS
++# define MPROTECT_VDB
++# endif
++# ifdef __GLIBC__
++# define SIG_SUSPEND (32+6)
++# define SIG_THR_RESTART (32+5)
++ extern int _end[];
++# define DATAEND (_end)
++# else
++# define SIG_SUSPEND SIGUSR1
++# define SIG_THR_RESTART SIGUSR2
++# endif
++# define FREEBSD_STACKBOTTOM
++# ifdef __ELF__
++# define DYNAMIC_LOADING
++# endif
++ extern char etext[];
++ extern char * GC_FreeBSDGetDataStart();
++# define DATASTART GC_FreeBSDGetDataStart(0x1000, &etext)
++# endif
+ # ifdef NETBSD
+ # define OS_TYPE "NETBSD"
+ # ifdef __ELF__
+@@ -1994,7 +2023,7 @@
+ # define SUNOS5SIGS
+ # endif
+
+-# if defined(FREEBSD) && (__FreeBSD__ >= 4)
++# if defined(FREEBSD) && ((__FreeBSD__ >= 4) || (__FreeBSD_kernel__ >= 4))
+ # define SUNOS5SIGS
+ # endif
+
+@@ -2057,7 +2086,7 @@
+ # define CACHE_LINE_SIZE 32 /* Wild guess */
+ # endif
+
+-# ifdef LINUX
++# if defined(LINUX) || defined(__GLIBC__)
+ # define REGISTER_LIBRARIES_EARLY
+ /* We sometimes use dl_iterate_phdr, which may acquire an internal */
+ /* lock. This isn't safe after the world has stopped. So we must */
+@@ -2137,7 +2166,7 @@
+ #if defined(SPARC)
+ # define CAN_SAVE_CALL_ARGS
+ #endif
+-#if (defined(I386) || defined(X86_64)) && defined(LINUX)
++#if (defined(I386) || defined(X86_64)) && (defined(LINUX) || defined(__GLIBC__))
+ /* SAVE_CALL_CHAIN is supported if the code is compiled to save */
+ /* frame pointers by default, i.e. no -fomit-frame-pointer flag. */
+ # define CAN_SAVE_CALL_ARGS
+diff -ur gcj-4.1-4.1.0/src/libjava/configure gcj-4.1-4.1.0/src/libjava/configure
+--- gcj-4.1-4.1.0/src/libjava/configure 2006-05-12 13:35:06.000000000 +0200
++++ gcj-4.1-4.1.0/src/libjava/configure 2006-05-12 11:00:31.000000000 +0200
+@@ -4351,7 +4341,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux*)
++linux*|k*bsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+diff -ur gcj-4.1-4.1.0/src/libjava/libltdl/acinclude.m4 gcj-4.1-4.1.0/src/libjava/libltdl/acinclude.m4
+--- gcj-4.1-4.1.0/src/libjava/libltdl/acinclude.m4 2006-05-12 13:35:07.000000000 +0200
++++ gcj-4.1-4.1.0/src/libjava/libltdl/acinclude.m4 2006-05-12 11:07:03.000000000 +0200
+@@ -1413,7 +1413,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux*)
++linux*|k*bsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+diff -ur gcj-4.1-4.1.0/src/libjava/libltdl/configure gcj-4.1-4.1.0/src/libjava/libltdl/configure
+--- gcj-4.1-4.1.0/src/libjava/libltdl/configure 2006-05-12 13:35:21.000000000 +0200
++++ gcj-4.1-4.1.0/src/libjava/libltdl/configure 2006-05-12 11:07:15.000000000 +0200
+@@ -8380,7 +8380,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux*)
++linux*|k*bsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+@@ -12021,7 +12021,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux*)
++linux*|k*bsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+@@ -15097,7 +15097,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux*)
++linux*|k*bsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+@@ -17380,7 +17380,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux*)
++linux*|k*bsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+diff -ur gcj-4.1-4.1.0/src/libjava/shlibpath.m4 gcj-4.1-4.1.0/src/libjava/shlibpath.m4
+--- gcj-4.1-4.1.0/src/libjava/shlibpath.m4 2006-01-07 19:14:24.000000000 +0100
++++ gcj-4.1-4.1.0/src/libjava/shlibpath.m4 2006-05-12 08:36:28.000000000 +0200
+@@ -361,7 +361,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux*)
++linux*|k*bsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+diff -ur gcj-4.1-4.1.1/src/libjava/configure.host gcj-4.1-4.1.1/src/libjava/configure.host
+--- gcj-4.1-4.1.1/src/libjava/configure.host 2006-09-07 01:00:37.000000000 +0200
++++ gcj-4.1-4.1.1/src/libjava/configure.host 2006-09-07 01:00:37.000000000 +0200
+@@ -326,7 +326,7 @@
+ esac
+
+ case "${host}" in
+- *linux*)
++ *linux*|*-k*bsd*-gnu)
+ use_libgcj_bc=yes
+ ;;
+ *)
+diff -ur gcj-4.1-4.1.0/src/boehm-gc/os_dep.c.orig gcj-4.1-4.1.0/src/boehm-gc/os_dep.c
+--- gcj-4.1-4.1.0/src/boehm-gc/os_dep.c.orig 2006-02-28 09:39:11.000000000 +0100
++++ gcj-4.1-4.1.0/src/boehm-gc/os_dep.c 2006-05-12 08:34:57.000000000 +0200
+@@ -84,7 +84,7 @@
+ # define NEED_FIND_LIMIT
+ # endif
+
+-#if defined(FREEBSD) && (defined(I386) || defined(powerpc) || defined(__powerpc__))
++#if defined(FREEBSD) && (defined(I386) || defined(X86_64) || defined(powerpc) || defined(__powerpc__))
+ # include
+ # if !defined(PCR)
+ # define NEED_FIND_LIMIT
+@@ -1392,7 +1392,7 @@
+ }
+ # endif
+
+-# if defined(FREEBSD) && (defined(I386) || defined(powerpc) || defined(__powerpc__)) && !defined(PCR)
++# if defined(FREEBSD) && (defined(I386) || defined(X86_64) || defined(powerpc) || defined(__powerpc__)) && !defined(PCR)
+ /* Its unclear whether this should be identical to the above, or */
+ /* whether it should apply to non-X86 architectures. */
+ /* For now we don't assume that there is always an empty page after */
--- gcc-4.1-4.1.2.orig/debian/patches/gccbug.dpatch
+++ gcc-4.1-4.1.2/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.2.orig/debian/patches/alpha-ieee-doc.dpatch
+++ gcc-4.1-4.1.2/debian/patches/alpha-ieee-doc.dpatch
@@ -0,0 +1,44 @@
+#! /bin/sh -e
+
+# DP: #212912
+# DP: on alpha-linux, make -mieee default and add -mieee-disable switch
+# DP: to turn default off (doc patch)
+
+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
+
+
+--- src/gcc/doc/invoke.texi~ 2005-09-29 20:00:57.638380128 +0200
++++ src/gcc/doc/invoke.texi 2005-09-30 22:23:22.922502992 +0200
+@@ -7670,6 +7670,13 @@
+ values such as not-a-number and plus/minus infinity. Other Alpha
+ compilers call this option @option{-ieee_with_no_inexact}.
+
++DEBIAN SPECIFIC: This option is on by default, unless
++@option{-ffinite-math-only} (which is part of the @option{-ffast-math}
++set) is specified, because the software functions in the GNU libc math
++libraries generate denormalized numbers, NaNs, and infs (all of which
++will cause a programs to SIGFPE when it attempts to use the results without
++@option{-mieee}).
++
+ @item -mieee-with-inexact
+ @opindex mieee-with-inexact
+ This is like @option{-mieee} except the generated code also maintains
--- gcc-4.1-4.1.2.orig/debian/patches/kbsd-gnu-ada.dpatch
+++ gcc-4.1-4.1.2/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.2.orig/debian/patches/no-getipinfo.dpatch
+++ gcc-4.1-4.1.2/debian/patches/no-getipinfo.dpatch
@@ -0,0 +1,100 @@
+#! /bin/sh -e
+
+# DP: On arm, hppa and ia64, don't use _Unwind_GetIPInfo in libjava
+# DP: and libstdc++.
+
+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: libjava/exception.cc
+===================================================================
+--- libjava/exception.cc (revision 117258)
++++ libjava/exception.cc (revision 117259)
+@@ -231,9 +231,13 @@
+
+ // Parse the LSDA header.
+ p = parse_lsda_header (context, language_specific_data, &info);
++#ifdef HAVE_GETIPINFO
+ ip = _Unwind_GetIPInfo (context, &ip_before_insn);
+ if (! ip_before_insn)
+ --ip;
++#else
++ ip = _Unwind_GetIP (context) - 1;
++#endif
+ landing_pad = 0;
+ action_record = 0;
+ handler_switch_value = 0;
+Index: libjava/stacktrace.cc
+===================================================================
+--- libjava/stacktrace.cc (revision 117258)
++++ libjava/stacktrace.cc (revision 117259)
+@@ -131,6 +131,7 @@
+ else
+ #endif
+ {
++#ifdef HAVE_GETIPINFO
+ _Unwind_Ptr ip;
+ int ip_before_insn = 0;
+ ip = _Unwind_GetIPInfo (context, &ip_before_insn);
+@@ -139,9 +140,13 @@
+ // to ensure we get the correct line number for the call itself.
+ if (! ip_before_insn)
+ --ip;
+-
++#endif
+ state->frames[pos].type = frame_native;
++#ifdef HAVE_GETIPINFO
+ state->frames[pos].ip = (void *) ip;
++#else
++ state->frames[pos].ip = (void *) _Unwind_GetIP (context);
++#endif
+ state->frames[pos].start_ip = func_addr;
+ }
+
+@@ -217,6 +222,12 @@
+ else
+ offset = (_Unwind_Ptr) ip - (_Unwind_Ptr) info.base;
+
++#ifndef HAVE_GETIPINFO
++ // The unwinder gives us the return address. In order to get the right
++ // line number for the stack trace, roll it back a little.
++ offset -= 1;
++#endif
++
+ finder->lookup (binaryName, (jlong) offset);
+ *sourceFileName = finder->getSourceFile();
+ *lineNum = finder->getLineNum();
+Index: libstdc++-v3/libsupc++/eh_personality.cc
+===================================================================
+--- libstdc++-v3/libsupc++/eh_personality.cc (revision 115653)
++++ libstdc++-v3/libsupc++/eh_personality.cc (revision 115654)
+@@ -434,7 +434,11 @@
+ // Parse the LSDA header.
+ p = parse_lsda_header (context, language_specific_data, &info);
+ info.ttype_base = base_of_encoded_value (info.ttype_encoding, context);
++#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.2.orig/debian/patches/m68k-bitfield.dpatch
+++ gcc-4.1-4.1.2/debian/patches/m68k-bitfield.dpatch
@@ -0,0 +1,55 @@
+#! /bin/sh -e
+
+# All lines beginning with `# DPATCH:' are a description of the patch.
+# DP: Avoid propagation of mem expression past a zero_extract lvalue
+
+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/gcse.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+Index: gcc-4.1/gcc/gcse.c
+===================================================================
+--- gcc-4.1.orig/gcc/gcse.c
++++ gcc-4.1/gcc/gcse.c
+@@ -5319,6 +5319,16 @@ compute_ld_motion_mems (void)
+ else
+ ptr->invalid = 1;
+ }
++ else if (GET_CODE (dest) == ZERO_EXTRACT)
++ {
++ dest = XEXP (dest, 0);
++ if (MEM_P (dest) && simple_mem (dest))
++ {
++ ptr = ldst_entry (dest);
++ ptr->invalid = 1;
++ }
++
++ }
+ }
+ else
+ invalidate_any_buried_refs (PATTERN (insn));
--- gcc-4.1-4.1.2.orig/debian/patches/gcc-ssp-on.dpatch
+++ gcc-4.1-4.1.2/debian/patches/gcc-ssp-on.dpatch
@@ -0,0 +1,47 @@
+#! /bin/sh -e
+
+# DP: Turn on -fstack-protector by default.
+
+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/common.opt (Revision 114807)
++++ gcc/common.opt (Arbeitskopie)
+@@ -817,7 +817,7 @@
+ -fstack-limit-symbol= Trap if the stack goes past symbol
+
+ fstack-protector
+-Common Report Var(flag_stack_protect, 1)
++Common Report Var(flag_stack_protect, 1) Init(1)
+ Use propolice as a stack protection method
+
+ fstack-protector-all
+--- gcc/doc/invoke.texi~ 2006-06-20 15:04:53.383303032 +0000
++++ gcc/doc/invoke.texi 2006-06-20 21:55:24.687921672 +0000
+@@ -5700,6 +5700,8 @@
+ functions with buffers larger than 8 bytes. The guards are initialized
+ when a function is entered and then checked when the function exits.
+ If a guard check fails, an error message is printed and the program exits.
++On Ubuntu the default is @option{-fstack-protector}, to turn it off use
++@option{-fno-stack-protector}.
+
+ @item -fstack-protector-all
+ Like @option{-fstack-protector} except that all functions are protected.
--- gcc-4.1-4.1.2.orig/debian/patches/libjava-backport.dpatch
+++ gcc-4.1-4.1.2/debian/patches/libjava-backport.dpatch
@@ -0,0 +1,810755 @@
+#! /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/gcc/cp/ChangeLog src/gcc/cp/ChangeLog
+--- old/gcc/cp/ChangeLog 2007-02-14 06:11:31.000000000 +0100
++++ src/gcc/cp/ChangeLog 2007-02-14 23:20:44.000000000 +0100
+@@ -587,6 +587,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 2007-02-14 06:11:04.000000000 +0100
++++ src/gcc/java/ChangeLog 2007-02-14 23:27:09.000000000 +0100
+@@ -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.
++
+ 2007-02-13 Release Manager
+
+ * GCC 4.1.2 released.
+@@ -15,12 +143,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
+@@ -48,6 +236,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
+@@ -59,38 +296,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
+@@ -118,6 +408,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
+@@ -126,6 +430,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:
+@@ -137,7 +442,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.
+@@ -148,7 +460,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
+
+ * decl.c, jcf-parse.c, jcf-write.c, parse.h, parse.y, resource.c:
+ Revert from TREE_LOCUS to DECL_SOURCE_LOCATION.
+-
++
+ 2003-09-18 Richard Henderson
+
+- * lang.c (java_estimate_num_insns): Take an expr, not a decl.
++ * lang.c (java_estimate_num_insns): Take an expr, not a decl.
+
+ 2003-08-12 Diego Novillo
+
+@@ -219,11 +219,11 @@
+ (java_stack_dup): Replace emit_move_insn with java_add_stmt.
+ (build_java_athrow): Replace expand_expr_stmt with java_add_stmt.
+ (build_java_jsr): Replace emit_jump with java_add_stmt (build (GOTO_EXPR))
+- (build_java_ret): Replace expand_computed_goto with
++ (build_java_ret): Replace expand_computed_goto with
+ java_add_stmt (build (GOTO_EXPR))
+ (expand_java_arraystore): Replace expand_assignment with
+ java_add_stmt.
+- (expand_java_return): Replace expand_return with
++ (expand_java_return): Replace expand_return with
+ java_add_stmt (build (RETURN_EXPR))
+ (expand_load_internal): Remove layout_decl, DECL_REGISTER,
+ expand_decl, and expand_decl_init. Instead, add the local
+@@ -232,7 +232,7 @@
+ java_add_stmt.
+ (expand_compare): Replace expand_cond with
+ java_add_stmt(build (COND_EXPR))
+- (expand_java_goto): Replace expand_goto with
++ (expand_java_goto): Replace expand_goto with
+ java_add_stmt (build (GOTO_EXPR))
+ (expand_invoke): Replace expand_expr_stmt with java_add_stmt.
+ (build_jni_stub): Generate a BIND_EXPR to hold the block we've
+@@ -241,7 +241,7 @@
+ java_add_stmt.
+ (java_expand_expr): Abort. No-one should call this function any
+ more.
+- (expand_byte_code): Replace expand_label with
++ (expand_byte_code): Replace expand_label with
+ java_add_stmt (build (LABEL_EXPR))
+ (process_jvm_instruction): Replace build (JAVA_EXC_OBJ_EXPR) with
+ build_exception_object_ref. Replace expand_assignment with
+diff -urN old/gcc/java/check-init.c src/gcc/java/check-init.c
+--- old/gcc/java/check-init.c 2005-09-06 04:25:00.000000000 +0200
++++ src/gcc/java/check-init.c 2006-08-28 19:14:18.160718000 +0200
+@@ -1,5 +1,5 @@
+ /* Code to test for "definitive [un]assignment".
+- Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation,
++ Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2006 Free Software Foundation,
+ Inc.
+
+ This file is part of GCC.
+@@ -672,8 +672,7 @@
+ DECLARE_BUFFERS(when_true, 2);
+ words when_false = when_true + num_current_words;
+ #ifdef ENABLE_JC1_CHECKING
+- if (TREE_CODE (alt->block) != LOOP_EXPR)
+- abort ();
++ gcc_assert (TREE_CODE (alt->block) == LOOP_EXPR);
+ #endif
+ check_bool_init (TREE_OPERAND (exp, 0), before, when_false, when_true);
+ done_alternative (when_true, alt);
+@@ -807,6 +806,7 @@
+ case TRUTH_NOT_EXPR:
+ case BIT_NOT_EXPR:
+ case CONVERT_EXPR:
++ case VIEW_CONVERT_EXPR:
+ case BIT_FIELD_REF:
+ case FLOAT_EXPR:
+ case FIX_TRUNC_EXPR:
+diff -urN old/gcc/java/class.c src/gcc/java/class.c
+--- old/gcc/java/class.c 2006-03-31 15:05:32.000000000 +0200
++++ src/gcc/java/class.c 2006-08-28 19:17:32.320718000 +0200
+@@ -1,5 +1,5 @@
+ /* Functions related to building classes and their related objects.
+- 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.
+@@ -62,7 +62,7 @@
+ static tree maybe_layout_super_class (tree, tree);
+ static void add_miranda_methods (tree, tree);
+ static int assume_compiled (const char *);
+-static tree build_symbol_entry (tree);
++static tree build_symbol_entry (tree, tree);
+ static tree emit_assertion_table (tree);
+ static void register_class (void);
+
+@@ -156,7 +156,7 @@
+
+ if (NULL == root)
+ {
+- root = xmalloc (sizeof (class_flag_node));
++ root = XNEW (class_flag_node);
+ root->ident = "";
+ root->value = 0;
+ root->sibling = NULL;
+@@ -183,7 +183,7 @@
+ else
+ {
+ /* Insert new node into the tree. */
+- node = xmalloc (sizeof (class_flag_node));
++ node = XNEW (class_flag_node);
+
+ node->ident = xstrdup (ident);
+ node->value = value;
+@@ -785,7 +785,11 @@
+ if (flags & ACC_PROTECTED) FIELD_PROTECTED (field) = 1;
+ if (flags & ACC_PRIVATE) FIELD_PRIVATE (field) = 1;
+ if (flags & ACC_FINAL) FIELD_FINAL (field) = 1;
+- if (flags & ACC_VOLATILE) FIELD_VOLATILE (field) = 1;
++ if (flags & ACC_VOLATILE)
++ {
++ FIELD_VOLATILE (field) = 1;
++ TREE_THIS_VOLATILE (field) = 1;
++ }
+ if (flags & ACC_TRANSIENT) FIELD_TRANSIENT (field) = 1;
+ if (is_static)
+ {
+@@ -953,6 +957,71 @@
+ return convert (promote_type (class_ptr_type), cl);
+ }
+
++static tree
++build_static_class_ref (tree type)
++{
++ tree decl_name, decl, ref;
++
++ if (TYPE_SIZE (type) == error_mark_node)
++ return null_pointer_node;
++ decl_name = identifier_subst (DECL_NAME (TYPE_NAME (type)),
++ "", '/', '/', ".class$$");
++ decl = IDENTIFIER_GLOBAL_VALUE (decl_name);
++ if (decl == NULL_TREE)
++ {
++ decl = build_decl (VAR_DECL, decl_name, class_type_node);
++ TREE_STATIC (decl) = 1;
++ if (! flag_indirect_classes)
++ TREE_PUBLIC (decl) = 1;
++ DECL_IGNORED_P (decl) = 1;
++ DECL_ARTIFICIAL (decl) = 1;
++ if (is_compiled_class (type) == 1)
++ DECL_EXTERNAL (decl) = 1;
++ MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC (decl);
++ DECL_CLASS_FIELD_P (decl) = 1;
++ DECL_CONTEXT (decl) = type;
++
++ /* ??? We want to preserve the DECL_CONTEXT we set just above,
++ that that means not calling pushdecl_top_level. */
++ IDENTIFIER_GLOBAL_VALUE (decl_name) = decl;
++ }
++
++ ref = build1 (ADDR_EXPR, class_ptr_type, decl);
++ return ref;
++}
++
++static tree
++build_classdollar_field (tree type)
++{
++ tree decl_name = identifier_subst (DECL_NAME (TYPE_NAME (type)),
++ "", '/', '/', ".class$");
++ tree decl = IDENTIFIER_GLOBAL_VALUE (decl_name);
++
++ if (decl == NULL_TREE)
++ {
++ decl
++ = build_decl (VAR_DECL, decl_name,
++ (build_type_variant
++ (build_pointer_type
++ (build_type_variant (class_type_node,
++ /* const */ 1, 0)),
++ /* const */ 1, 0)));
++ TREE_STATIC (decl) = 1;
++ TREE_INVARIANT (decl) = 1;
++ TREE_CONSTANT (decl) = 1;
++ TREE_READONLY (decl) = 1;
++ TREE_PUBLIC (decl) = 1;
++ DECL_IGNORED_P (decl) = 1;
++ DECL_ARTIFICIAL (decl) = 1;
++ MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC (decl);
++ IDENTIFIER_GLOBAL_VALUE (decl_name) = decl;
++ DECL_CLASS_FIELD_P (decl) = 1;
++ DECL_CONTEXT (decl) = type;
++ }
++
++ return decl;
++}
++
+ /* Build a reference to the class TYPE.
+ Also handles primitive types and array types. */
+
+@@ -962,7 +1031,7 @@
+ int is_compiled = is_compiled_class (type);
+ if (is_compiled)
+ {
+- tree ref, decl_name, decl;
++ tree ref, decl;
+ if (TREE_CODE (type) == POINTER_TYPE)
+ type = TREE_TYPE (type);
+
+@@ -971,34 +1040,15 @@
+ && TREE_CODE (type) == RECORD_TYPE)
+ return build_indirect_class_ref (type);
+
++ if (type == output_class && flag_indirect_classes)
++ return build_classdollar_field (type);
++
+ if (TREE_CODE (type) == RECORD_TYPE)
+- {
+- if (TYPE_SIZE (type) == error_mark_node)
+- return null_pointer_node;
+- decl_name = identifier_subst (DECL_NAME (TYPE_NAME (type)),
+- "", '/', '/', ".class");
+- decl = IDENTIFIER_GLOBAL_VALUE (decl_name);
+- if (decl == NULL_TREE)
+- {
+- decl = build_decl (VAR_DECL, decl_name, class_type_node);
+- TREE_STATIC (decl) = 1;
+- TREE_PUBLIC (decl) = 1;
+- DECL_IGNORED_P (decl) = 1;
+- DECL_ARTIFICIAL (decl) = 1;
+- if (is_compiled == 1)
+- DECL_EXTERNAL (decl) = 1;
+- MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC (decl);
+- DECL_CLASS_FIELD_P (decl) = 1;
+- DECL_CONTEXT (decl) = type;
+-
+- /* ??? We want to preserve the DECL_CONTEXT we set just above,
+- that that means not calling pushdecl_top_level. */
+- IDENTIFIER_GLOBAL_VALUE (decl_name) = decl;
+- }
+- }
++ return build_static_class_ref (type);
+ else
+ {
+ const char *name;
++ tree decl_name;
+ char buffer[25];
+ if (flag_emit_class_files)
+ {
+@@ -1023,7 +1073,7 @@
+ else if (type == void_type_node)
+ prim_class_name = "java.lang.Void";
+ else
+- abort ();
++ gcc_unreachable ();
+
+ prim_class = lookup_class (get_identifier (prim_class_name));
+ /* We wrap the class in a NOP_EXPR, because it is a
+@@ -1080,6 +1130,7 @@
+ TREE_PUBLIC (decl) = 0;
+ DECL_EXTERNAL (decl) = 0;
+ DECL_ARTIFICIAL (decl) = 1;
++ DECL_IGNORED_P (decl) = 1;
+ pushdecl_top_level (decl);
+ }
+ return decl;
+@@ -1216,7 +1267,7 @@
+ access_flags |= ACC_INVISIBLE;
+ return access_flags;
+ }
+- abort ();
++ gcc_unreachable ();
+ }
+
+ static GTY (()) int alias_labelno = 0;
+@@ -1296,16 +1347,23 @@
+ PUSH_FIELD_VALUE (finit, "accflags", build_int_cst (NULL_TREE, flags));
+ PUSH_FIELD_VALUE (finit, "bsize", TYPE_SIZE_UNIT (TREE_TYPE (fdecl)));
+
+- PUSH_FIELD_VALUE
+- (finit, "info",
+- build_constructor_from_list (field_info_union_node,
+- build_tree_list
+- ((FIELD_STATIC (fdecl)
+- ? TREE_CHAIN (TYPE_FIELDS (field_info_union_node))
+- : TYPE_FIELDS (field_info_union_node)),
+- (FIELD_STATIC (fdecl)
+- ? build_address_of (fdecl)
+- : byte_position (fdecl)))));
++ {
++ tree field_address = integer_zero_node;
++ if ((DECL_INITIAL (fdecl) || ! flag_indirect_classes)
++ && FIELD_STATIC (fdecl))
++ field_address = build_address_of (fdecl);
++
++ PUSH_FIELD_VALUE
++ (finit, "info",
++ build_constructor_from_list (field_info_union_node,
++ build_tree_list
++ ((FIELD_STATIC (fdecl)
++ ? TREE_CHAIN (TYPE_FIELDS (field_info_union_node))
++ : TYPE_FIELDS (field_info_union_node)),
++ (FIELD_STATIC (fdecl)
++ ? field_address
++ : byte_position (fdecl)))));
++ }
+
+ FINISH_RECORD_CONSTRUCTOR (finit);
+ return finit;
+@@ -1580,15 +1638,35 @@
+ tree constant_pool_constructor;
+ tree interfaces = null_pointer_node;
+ int interface_len = 0;
++ int uses_jv_markobj = 0;
+ tree type_decl = TYPE_NAME (type);
++ tree id_main = get_identifier("main");
++ tree id_class = get_identifier("java.lang.Class");
+ /** Offset from start of virtual function table declaration
+ to where objects actually point at, following new g++ ABI. */
+ tree dtable_start_offset = build_int_cst (NULL_TREE,
+ 2 * POINTER_SIZE / BITS_PER_UNIT);
+
+- this_class_addr = build_class_ref (type);
++ this_class_addr = build_static_class_ref (type);
+ decl = TREE_OPERAND (this_class_addr, 0);
+
++ if (supers_all_compiled (type) && ! CLASS_INTERFACE (type_decl)
++ && !flag_indirect_dispatch)
++ {
++ tree dtable = get_dispatch_table (type, this_class_addr);
++ uses_jv_markobj = uses_jv_markobj_p (dtable);
++ dtable_decl = build_dtable_decl (type);
++ DECL_INITIAL (dtable_decl) = dtable;
++ TREE_STATIC (dtable_decl) = 1;
++ DECL_ARTIFICIAL (dtable_decl) = 1;
++ DECL_IGNORED_P (dtable_decl) = 1;
++ TREE_PUBLIC (dtable_decl) = 1;
++ if (! flag_indirect_classes)
++ rest_of_decl_compilation (dtable_decl, 1, 0);
++ if (type == class_type_node)
++ class_dtable_decl = dtable_decl;
++ }
++
+ /* Build Field array. */
+ field = TYPE_FIELDS (type);
+ while (field && DECL_ARTIFICIAL (field))
+@@ -1599,9 +1677,11 @@
+ {
+ if (! DECL_ARTIFICIAL (field))
+ {
+- tree init = make_field_value (field);
+ if (FIELD_STATIC (field))
+ {
++ /* We must always create reflection data for static fields
++ as it is used in the creation of the field itself. */
++ tree init = make_field_value (field);
+ tree initial = DECL_INITIAL (field);
+ static_field_count++;
+ static_fields = tree_cons (NULL_TREE, init, static_fields);
+@@ -1613,8 +1693,9 @@
+ rest_of_decl_compilation (field, 1, 1);
+ DECL_INITIAL (field) = initial;
+ }
+- else
++ else if (uses_jv_markobj || !flag_reduced_reflection)
+ {
++ tree init = make_field_value (field);
+ instance_field_count++;
+ instance_fields = tree_cons (NULL_TREE, init, instance_fields);
+ }
+@@ -1653,9 +1734,35 @@
+ which we don't have a .class file. */
+ if (METHOD_DUMMY (method))
+ continue;
+- init = make_method_value (method);
+- method_count++;
+- methods = tree_cons (NULL_TREE, init, methods);
++
++ /* Generate method reflection data if:
++
++ - !flag_reduced_reflection.
++
++ - -- The runtime uses reflection to initialize the
++ class.
++
++ - Any method in class java.lang.Class -- Class.forName() and
++ perhaps other things require it.
++
++ - class$ -- It does not work if reflection data missing.
++
++ - main -- Reflection is used to find main(String[]) methods.
++
++ - public not static -- It is potentially part of an
++ interface. The runtime uses reflection data to build
++ interface dispatch tables. */
++ if (!flag_reduced_reflection
++ || DECL_CLINIT_P (method)
++ || DECL_NAME (type_decl) == id_class
++ || DECL_NAME (method) == id_main
++ || (METHOD_PUBLIC (method) && !METHOD_STATIC (method))
++ || TYPE_DOT_CLASS (type) == method)
++ {
++ init = make_method_value (method);
++ method_count++;
++ methods = tree_cons (NULL_TREE, init, methods);
++ }
+ }
+ method_array_type = build_prim_array_type (method_type_node, method_count);
+ methods_decl = build_decl (VAR_DECL, mangled_classname ("_MT_", type),
+@@ -1667,21 +1774,6 @@
+ DECL_IGNORED_P (methods_decl) = 1;
+ rest_of_decl_compilation (methods_decl, 1, 0);
+
+- if (supers_all_compiled (type) && ! CLASS_INTERFACE (type_decl)
+- && !flag_indirect_dispatch)
+- {
+- tree dtable = get_dispatch_table (type, this_class_addr);
+- dtable_decl = build_dtable_decl (type);
+- DECL_INITIAL (dtable_decl) = dtable;
+- TREE_STATIC (dtable_decl) = 1;
+- DECL_ARTIFICIAL (dtable_decl) = 1;
+- DECL_IGNORED_P (dtable_decl) = 1;
+- TREE_PUBLIC (dtable_decl) = 1;
+- rest_of_decl_compilation (dtable_decl, 1, 0);
+- if (type == class_type_node)
+- class_dtable_decl = dtable_decl;
+- }
+-
+ if (class_dtable_decl == NULL_TREE)
+ {
+ class_dtable_decl = build_dtable_decl (class_type_node);
+@@ -1772,10 +1864,12 @@
+
+ START_RECORD_CONSTRUCTOR (temp, object_type_node);
+ PUSH_FIELD_VALUE (temp, "vtable",
+- build2 (PLUS_EXPR, dtable_ptr_type,
+- build1 (ADDR_EXPR, dtable_ptr_type,
+- class_dtable_decl),
+- dtable_start_offset));
++ (flag_indirect_classes
++ ? null_pointer_node
++ : build2 (PLUS_EXPR, dtable_ptr_type,
++ build1 (ADDR_EXPR, dtable_ptr_type,
++ class_dtable_decl),
++ dtable_start_offset)));
+ if (! flag_hash_synchronization)
+ PUSH_FIELD_VALUE (temp, "sync_info", null_pointer_node);
+ FINISH_RECORD_CONSTRUCTOR (temp);
+@@ -1791,7 +1885,8 @@
+ CLASS_INTERFACE (type_decl) ? null_pointer_node : super);
+ PUSH_FIELD_VALUE (cons, "constants", constant_pool_constructor);
+ PUSH_FIELD_VALUE (cons, "methods",
+- build1 (ADDR_EXPR, method_ptr_type_node, methods_decl));
++ methods_decl == NULL_TREE ? null_pointer_node
++ : build1 (ADDR_EXPR, method_ptr_type_node, methods_decl));
+ PUSH_FIELD_VALUE (cons, "method_count",
+ build_int_cst (NULL_TREE, method_count));
+
+@@ -1914,8 +2009,21 @@
+ if (flag_hash_synchronization && POINTER_SIZE < 64)
+ DECL_ALIGN (decl) = 64;
+
++ if (flag_indirect_classes)
++ {
++ TREE_READONLY (decl) = 1;
++ TREE_CONSTANT (DECL_INITIAL (decl)) = 1;
++ }
++
+ rest_of_decl_compilation (decl, 1, 0);
+
++ {
++ tree classdollar_field = build_classdollar_field (type);
++ if (!flag_indirect_classes)
++ DECL_INITIAL (classdollar_field) = build_static_class_ref (type);
++ rest_of_decl_compilation (classdollar_field, 1, 0);
++ }
++
+ TYPE_OTABLE_DECL (type) = NULL_TREE;
+ TYPE_ATABLE_DECL (type) = NULL_TREE;
+ TYPE_CTABLE_DECL (type) = NULL_TREE;
+@@ -1929,7 +2037,7 @@
+ tree verify_method = TYPE_VERIFY_METHOD (output_class);
+ DECL_SAVED_TREE (verify_method)
+ = add_stmt_to_compound (DECL_SAVED_TREE (verify_method), void_type_node,
+- build (RETURN_EXPR, void_type_node, NULL));
++ build1 (RETURN_EXPR, void_type_node, NULL));
+ java_genericize (verify_method);
+ cgraph_finalize_function (verify_method, false);
+ TYPE_ASSERTIONS (current_class) = NULL;
+@@ -2313,20 +2421,22 @@
+ TYPE_NVIRTUALS (this_class) = dtable_count;
+ }
+
+-/* Return the index of METHOD in INTERFACE. This index begins at 1 and is used as an
+- argument for _Jv_LookupInterfaceMethodIdx(). */
++/* Return the index of METHOD in INTERFACE. This index begins at 1
++ and is used as an argument for _Jv_LookupInterfaceMethodIdx(). */
+ int
+ get_interface_method_index (tree method, tree interface)
+ {
+ tree meth;
+ int i = 1;
+
+- for (meth = TYPE_METHODS (interface); ; meth = TREE_CHAIN (meth), i++)
++ for (meth = TYPE_METHODS (interface); ; meth = TREE_CHAIN (meth))
+ {
+ if (meth == method)
+ return i;
+- if (meth == NULL_TREE)
+- abort ();
++ /* We don't want to put into the interface table. */
++ if (! ID_CLINIT_P (DECL_NAME (meth)))
++ ++i;
++ gcc_assert (meth != NULL_TREE);
+ }
+ }
+
+@@ -2419,10 +2529,65 @@
+ if (!registered_class)
+ registered_class = VEC_alloc (tree, gc, 8);
+
+- node = TREE_OPERAND (build_class_ref (current_class), 0);
++ if (flag_indirect_classes)
++ node = current_class;
++ else
++ node = TREE_OPERAND (build_class_ref (current_class), 0);
+ VEC_safe_push (tree, gc, registered_class, node);
+ }
+
++/* Emit a function that calls _Jv_RegisterNewClasses with a list of
++ all the classes we have emitted. */
++
++static void
++emit_indirect_register_classes (tree *list_p)
++{
++ tree klass, t, register_class_fn;
++ int i;
++
++ tree init = NULL_TREE;
++ int size = VEC_length (tree, registered_class) * 2 + 1;
++ tree class_array_type
++ = build_prim_array_type (ptr_type_node, size);
++ tree cdecl = build_decl (VAR_DECL, get_identifier ("_Jv_CLS"),
++ class_array_type);
++ tree reg_class_list;
++ for (i = 0; VEC_iterate (tree, registered_class, i, klass); ++i)
++ {
++ init = tree_cons (NULL_TREE,
++ fold_convert (ptr_type_node,
++ build_static_class_ref (klass)), init);
++ init = tree_cons
++ (NULL_TREE,
++ fold_convert (ptr_type_node,
++ build_address_of (build_classdollar_field (klass))),
++ init);
++ }
++ init = tree_cons (NULL_TREE, integer_zero_node, init);
++ DECL_INITIAL (cdecl) = build_constructor_from_list (class_array_type,
++ nreverse (init));
++ TREE_CONSTANT (DECL_INITIAL (cdecl)) = 1;
++ TREE_STATIC (cdecl) = 1;
++ DECL_ARTIFICIAL (cdecl) = 1;
++ DECL_IGNORED_P (cdecl) = 1;
++ TREE_READONLY (cdecl) = 1;
++ TREE_CONSTANT (cdecl) = 1;
++ rest_of_decl_compilation (cdecl, 1, 0);
++ reg_class_list = fold_convert (ptr_type_node, build_address_of (cdecl));
++
++ t = build_function_type_list (void_type_node,
++ build_pointer_type (ptr_type_node), NULL);
++ t = build_decl (FUNCTION_DECL,
++ get_identifier ("_Jv_RegisterNewClasses"), t);
++ TREE_PUBLIC (t) = 1;
++ DECL_EXTERNAL (t) = 1;
++ register_class_fn = t;
++ t = tree_cons (NULL, reg_class_list, NULL);
++ t = build_function_call_expr (register_class_fn, t);
++ append_to_statement_list (t, list_p);
++}
++
++
+ /* Emit something to register classes at start-up time.
+
+ The preferred mechanism is through the .jcr section, which contain
+@@ -2439,10 +2604,16 @@
+ if (registered_class == NULL)
+ return;
+
++ if (flag_indirect_classes)
++ {
++ emit_indirect_register_classes (list_p);
++ return;
++ }
++
+ /* TARGET_USE_JCR_SECTION defaults to 1 if SUPPORTS_WEAK and
+ TARGET_ASM_NAMED_SECTION, else 0. Some targets meet those conditions
+ but lack suitable crtbegin/end objects or linker support. These
+- targets can overide the default in tm.h to use the fallback mechanism. */
++ targets can override the default in tm.h to use the fallback mechanism. */
+ if (TARGET_USE_JCR_SECTION)
+ {
+ tree klass, t;
+@@ -2487,7 +2658,7 @@
+ /* Make a symbol_type (_Jv_MethodSymbol) node for DECL. */
+
+ static tree
+-build_symbol_entry (tree decl)
++build_symbol_entry (tree decl, tree special)
+ {
+ tree clname, name, signature, sym;
+ clname = build_utf8_ref (DECL_NAME (TYPE_NAME (DECL_CONTEXT (decl))));
+@@ -2503,6 +2674,12 @@
+ signature = build_utf8_ref (unmangle_classname
+ (IDENTIFIER_POINTER (signature),
+ IDENTIFIER_LENGTH (signature)));
++ /* SPECIAL is either NULL_TREE or integer_one_node. We emit
++ signature addr+1 if SPECIAL, and this indicates to the runtime
++ system that this is a "special" symbol, i.e. one that should
++ bypass access controls. */
++ if (special != NULL_TREE)
++ signature = build2 (PLUS_EXPR, TREE_TYPE (signature), signature, special);
+
+ START_RECORD_CONSTRUCTOR (sym, symbol_type);
+ PUSH_FIELD_VALUE (sym, "clname", clname);
+@@ -2537,8 +2714,9 @@
+ list = NULL_TREE;
+ while (method_list != NULL_TREE)
+ {
++ tree special = TREE_PURPOSE (method_list);
+ method = TREE_VALUE (method_list);
+- list = tree_cons (NULL_TREE, build_symbol_entry (method), list);
++ list = tree_cons (NULL_TREE, build_symbol_entry (method, special), list);
+ method_list = TREE_CHAIN (method_list);
+ index++;
+ }
+diff -urN old/gcc/java/constants.c src/gcc/java/constants.c
+--- old/gcc/java/constants.c 2006-01-16 16:51:42.000000000 +0100
++++ src/gcc/java/constants.c 2006-08-28 19:14:18.160718000 +0200
+@@ -313,8 +313,7 @@
+ }
+ }
+
+- if (ptr != buffer + length)
+- abort ();
++ gcc_assert (ptr == buffer + length);
+ }
+
+ static GTY(()) tree tag_nodes[13];
+@@ -459,8 +458,29 @@
+ {
+ tree d = build_constant_data_ref ();
+ tree i = build_int_cst (NULL_TREE, index);
+- return build4 (ARRAY_REF, TREE_TYPE (TREE_TYPE (d)), d, i,
++ if (flag_indirect_classes)
++ {
++ tree decl = build_class_ref (output_class);
++ tree klass = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (decl)),
++ decl);
++ tree constants = build3 (COMPONENT_REF,
++ TREE_TYPE (constants_field_decl_node), klass,
++ constants_field_decl_node,
++ NULL_TREE);
++ tree data = build3 (COMPONENT_REF,
++ TREE_TYPE (constants_data_field_decl_node),
++ constants,
++ constants_data_field_decl_node,
++ NULL_TREE);
++ data = fold_convert (build_pointer_type (TREE_TYPE (d)), data);
++ d = build1 (INDIRECT_REF, TREE_TYPE (d), data);
++ /* FIXME: These should be cached. */
++ TREE_INVARIANT (d) = 1;
++ }
++ d = build4 (ARRAY_REF, TREE_TYPE (TREE_TYPE (d)), d, i,
+ NULL_TREE, NULL_TREE);
++ TREE_INVARIANT (d) = 1;
++ return d;
+ }
+
+ /* Build an initializer for the constants field of the current constant pool.
+@@ -483,8 +503,11 @@
+ {
+ unsigned HOST_WIDE_INT temp = outgoing_cpool->data[i].w;
+
+- /* Make sure that on a 64-bit big-endian machine this 32-bit
+- jint appears in the first word. */
++ /* Make sure that on a 64-bit big-endian machine this
++ 32-bit jint appears in the first word.
++ FIXME: This is a kludge. The field we're initializing is
++ not a scalar but a union, and that's how we should
++ represent it in the compiler. We should fix this. */
+ if (BYTES_BIG_ENDIAN && BITS_PER_WORD > 32)
+ temp <<= BITS_PER_WORD - 32;
+
+diff -urN old/gcc/java/decl.c src/gcc/java/decl.c
+--- old/gcc/java/decl.c 2005-12-08 15:40:48.000000000 +0100
++++ src/gcc/java/decl.c 2006-08-28 19:24:44.280718000 +0200
+@@ -48,6 +48,7 @@
+ #include "tree-inline.h"
+ #include "target.h"
+ #include "version.h"
++#include "tree-iterator.h"
+
+ #if defined (DEBUG_JAVA_BINDING_LEVELS)
+ extern void indent (void);
+@@ -123,6 +124,12 @@
+ /* The decl for "_Jv_ResolvePoolEntry". */
+ tree soft_resolvepoolentry_node;
+
++/* The decl for the .constants field of an instance of Class. */
++tree constants_field_decl_node;
++
++/* The decl for the .data field of an instance of Class. */
++tree constants_data_field_decl_node;
++
+ #if defined(DEBUG_JAVA_BINDING_LEVELS)
+ int binding_depth = 0;
+ int is_class_level = 0;
+@@ -153,48 +160,6 @@
+ return true;
+ }
+
+-/* Copy the value in decl into every live alias in the same local
+- variable slot. Some of these will be dead stores removed by the
+- optimizer. */
+-
+-void
+-update_aliases (tree decl, int index, int pc)
+-{
+- tree decl_type = TREE_TYPE (decl);
+- tree tmp;
+-
+- if (debug_variable_p (decl))
+- abort ();
+-
+- for (tmp = TREE_VEC_ELT (decl_map, index);
+- tmp != NULL_TREE;
+- tmp = DECL_LOCAL_SLOT_CHAIN (tmp))
+- {
+- tree tmp_type = TREE_TYPE (tmp);
+- if (tmp != decl
+- && LOCAL_SLOT_P (tmp) == 0
+- && (pc == -1
+- || (pc >= DECL_LOCAL_START_PC (tmp)
+- && pc < DECL_LOCAL_END_PC (tmp)))
+- /* This test is < (rather than <=) because there's no point
+- updating an alias that's about to die at the end of this
+- instruction. */
+- && (tmp_type == decl_type
+- || (INTEGRAL_TYPE_P (tmp_type)
+- && INTEGRAL_TYPE_P (decl_type)
+- && TYPE_PRECISION (decl_type) <= 32
+- && TYPE_PRECISION (tmp_type) <= 32)
+- || (TREE_CODE (tmp_type) == POINTER_TYPE
+- && TREE_CODE (decl_type) == POINTER_TYPE)))
+- {
+- tree src = build1 (NOP_EXPR, tmp_type, decl);
+- if (LOCAL_VAR_OUT_OF_SCOPE_P (tmp))
+- abort ();
+- java_add_stmt (build2 (MODIFY_EXPR, tmp_type, tmp, src));
+- }
+- }
+-}
+-
+ static tree
+ push_jvm_slot (int index, tree decl)
+ {
+@@ -215,52 +180,6 @@
+ return decl;
+ }
+
+-/* At the point of its creation a local variable decl inherits
+- whatever is already in the same slot. In the case of a local
+- variable that is declared but unused, we won't find anything. */
+-
+-static void
+-initialize_local_variable (tree decl, int index)
+-{
+- tree decl_type = TREE_TYPE (decl);
+- if (TREE_CODE (decl_type) == POINTER_TYPE)
+- {
+- tree tmp = TREE_VEC_ELT (base_decl_map, index);
+-
+- if (tmp)
+- {
+- /* At the point of its creation this decl inherits whatever
+- is in the slot. */
+- tree src = build1 (NOP_EXPR, decl_type, tmp);
+- java_add_stmt (build2 (MODIFY_EXPR, decl_type, decl, src));
+- }
+- }
+- else
+- {
+- tree tmp;
+-
+- for (tmp = TREE_VEC_ELT (decl_map, index);
+- tmp != NULL_TREE;
+- tmp = DECL_LOCAL_SLOT_CHAIN (tmp))
+- {
+- tree tmp_type = TREE_TYPE (tmp);
+- if (tmp != decl
+- && ! debug_variable_p (tmp)
+- && (tmp_type == decl_type
+- || (INTEGRAL_TYPE_P (tmp_type)
+- && INTEGRAL_TYPE_P (decl_type)
+- && TYPE_PRECISION (decl_type) <= 32
+- && TYPE_PRECISION (tmp_type) <= 32
+- && TYPE_PRECISION (tmp_type)
+- >= TYPE_PRECISION (decl_type))))
+- {
+- java_add_stmt (build2 (MODIFY_EXPR, decl_type, decl, tmp));
+- return;
+- }
+- }
+- }
+-}
+-
+ /* Find the best declaration based upon type. If 'decl' fits 'type' better
+ than 'best', return 'decl'. Otherwise return 'best'. */
+
+@@ -269,8 +188,7 @@
+ {
+ tree decl_type = TREE_TYPE (decl);
+
+- if (LOCAL_VAR_OUT_OF_SCOPE_P (decl))
+- abort ();
++ gcc_assert (! LOCAL_VAR_OUT_OF_SCOPE_P (decl));
+
+ /* Use the same decl for all integer types <= 32 bits. This is
+ necessary because sometimes a value is stored as (for example)
+@@ -411,9 +329,7 @@
+ int index = DECL_LOCAL_SLOT_NUMBER (var_decl);
+ tree base_decl = TREE_VEC_ELT (base_decl_map, index);
+
+- if (! base_decl)
+- abort ();
+-
++ gcc_assert (base_decl);
+ if (! want_lvalue)
+ base_decl = build1 (NOP_EXPR, decl_type, base_decl);
+
+@@ -543,6 +459,7 @@
+ TYPE_MAX_VALUE (type) = copy_node (in_max);
+ TREE_TYPE (TYPE_MAX_VALUE (type)) = type;
+ TYPE_PRECISION (type) = TYPE_PRECISION (int_type_node);
++ TYPE_STRING_FLAG (type) = TYPE_STRING_FLAG (actual_type);
+ layout_type (type);
+ pushdecl (build_decl (TYPE_DECL, get_identifier (name), type));
+ return type;
+@@ -743,7 +660,8 @@
+ initializations of __FUNCTION__ and __PRETTY_FUNCTION__. */
+ short_array_type_node = build_prim_array_type (short_type_node, 200);
+ #endif
+- char_type_node = make_node (CHAR_TYPE);
++ char_type_node = make_node (INTEGER_TYPE);
++ TYPE_STRING_FLAG (char_type_node) = 1;
+ TYPE_PRECISION (char_type_node) = 16;
+ fixup_unsigned_type (char_type_node);
+ pushdecl (build_decl (TYPE_DECL, get_identifier ("char"), char_type_node));
+@@ -886,6 +804,7 @@
+ PUSH_FIELD (constants_type_node, field, "size", unsigned_int_type_node);
+ PUSH_FIELD (constants_type_node, field, "tags", ptr_type_node);
+ PUSH_FIELD (constants_type_node, field, "data", ptr_type_node);
++ constants_data_field_decl_node = field;
+ FINISH_RECORD (constants_type_node);
+ build_decl (TYPE_DECL, get_identifier ("constants"), constants_type_node);
+
+@@ -927,6 +846,7 @@
+ PUSH_FIELD (class_type_node, field, "accflags", access_flags_type_node);
+ PUSH_FIELD (class_type_node, field, "superclass", class_ptr_type);
+ PUSH_FIELD (class_type_node, field, "constants", constants_type_node);
++ constants_field_decl_node = field;
+ PUSH_FIELD (class_type_node, field, "methods", method_ptr_type_node);
+ PUSH_FIELD (class_type_node, field, "method_count", short_type_node);
+ PUSH_FIELD (class_type_node, field, "vtable_method_count", short_type_node);
+@@ -1779,8 +1699,10 @@
+ truncating variable lifetimes. */
+ if (end_pc > current_binding_level->end_pc)
+ {
++ tree t;
+ end_pc = current_binding_level->end_pc;
+- DECL_LOCAL_END_PC (decl) = end_pc;
++ for (t = decl; t != NULL_TREE; t = TREE_CHAIN (t))
++ DECL_LOCAL_END_PC (t) = end_pc;
+ }
+
+ maybe_start_try (pc, end_pc);
+@@ -1792,10 +1714,17 @@
+ current_binding_level->names = NULL;
+ for ( ; decl != NULL_TREE; decl = next)
+ {
++ int index = DECL_LOCAL_SLOT_NUMBER (decl);
++ tree base_decl;
+ next = TREE_CHAIN (decl);
+- push_jvm_slot (DECL_LOCAL_SLOT_NUMBER (decl), decl);
++ push_jvm_slot (index, decl);
+ pushdecl (decl);
+- initialize_local_variable (decl, DECL_LOCAL_SLOT_NUMBER (decl));
++ base_decl
++ = find_local_variable (index, TREE_TYPE (decl), pc);
++ if (TREE_CODE (TREE_TYPE (base_decl)) == POINTER_TYPE)
++ base_decl = TREE_VEC_ELT (base_decl_map, index);
++ SET_DECL_VALUE_EXPR (decl, base_decl);
++ DECL_HAS_VALUE_EXPR_P (decl) = 1;
+ }
+ }
+
+@@ -2010,8 +1939,7 @@
+ {
+ tree parm_name = NULL_TREE, parm_decl;
+ tree parm_type = TREE_VALUE (tem);
+- if (i >= DECL_MAX_LOCALS (fndecl))
+- abort ();
++ gcc_assert (i < DECL_MAX_LOCALS (fndecl));
+
+ parm_decl = build_decl (PARM_DECL, parm_name, parm_type);
+ DECL_CONTEXT (parm_decl) = fndecl;
+@@ -2233,18 +2161,37 @@
+ return stmt;
+ }
+
+-/* Add a statement to the compound_expr currently being
+- constructed. */
++/* Add a statement to the statement_list currently being constructed.
++ If the statement_list is null, we don't create a singleton list.
++ This is necessary because poplevel() assumes that adding a
++ statement to a null statement_list returns the statement. */
+
+ tree
+-java_add_stmt (tree stmt)
++java_add_stmt (tree new_stmt)
+ {
++ tree stmts = current_binding_level->stmts;
++ tree_stmt_iterator i;
++
+ if (input_filename)
+- SET_EXPR_LOCATION (stmt, input_location);
++ SET_EXPR_LOCATION (new_stmt, input_location);
+
+- return current_binding_level->stmts
+- = add_stmt_to_compound (current_binding_level->stmts,
+- TREE_TYPE (stmt), stmt);
++ if (stmts == NULL)
++ return current_binding_level->stmts = new_stmt;
++
++ /* Force STMTS to be a statement_list. */
++ if (TREE_CODE (stmts) != STATEMENT_LIST)
++ {
++ tree t = make_node (STATEMENT_LIST);
++ i = tsi_last (t);
++ tsi_link_after (&i, stmts, TSI_CONTINUE_LINKING);
++ stmts = t;
++ }
++
++ i = tsi_last (stmts);
++ tsi_link_after (&i, new_stmt, TSI_CONTINUE_LINKING);
++ TREE_TYPE (stmts) = void_type_node;
++
++ return current_binding_level->stmts = stmts;
+ }
+
+ /* Add a variable to the current scope. */
+@@ -2278,8 +2225,7 @@
+ void
+ register_exception_range (struct eh_range *range, int pc, int end_pc)
+ {
+- if (current_binding_level->exception_range)
+- abort ();
++ gcc_assert (! current_binding_level->exception_range);
+ current_binding_level->exception_range = range;
+ current_binding_level->end_pc = end_pc;
+ current_binding_level->start_pc = pc;
+diff -urN old/gcc/java/except.c src/gcc/java/except.c
+--- old/gcc/java/except.c 2005-06-25 02:33:05.000000000 +0200
++++ src/gcc/java/except.c 2006-08-28 19:14:18.160718000 +0200
+@@ -211,7 +211,7 @@
+ }
+
+ /* Create a new range. */
+- h = xmalloc (sizeof (struct eh_range));
++ h = XNEW (struct eh_range);
+
+ h->start_pc = pc;
+ h->end_pc = range->end_pc;
+@@ -289,7 +289,7 @@
+ }
+
+ /* Create the new range. */
+- h = xmalloc (sizeof (struct eh_range));
++ h = XNEW (struct eh_range);
+ first_child = &h->first_child;
+
+ h->start_pc = start_pc;
+@@ -474,7 +474,7 @@
+ return obj;
+ }
+
+-/* If there are any handlers for this range, isssue end of range,
++/* If there are any handlers for this range, issue end of range,
+ and then all handler blocks */
+ void
+ expand_end_java_handler (struct eh_range *range)
+diff -urN old/gcc/java/expr.c src/gcc/java/expr.c
+--- old/gcc/java/expr.c 2006-04-03 17:22:21.000000000 +0200
++++ src/gcc/java/expr.c 2006-08-28 19:17:32.340718000 +0200
+@@ -1,5 +1,5 @@
+ /* Process expressions for 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.
+@@ -277,8 +277,8 @@
+ void
+ push_type (tree type)
+ {
+- if (! push_type_0 (type))
+- abort ();
++ int r = push_type_0 (type);
++ gcc_assert (r);
+ }
+
+ static void
+@@ -610,15 +610,13 @@
+ {
+ tree type, val;
+
+- if (stack_pointer == 0)
+- abort ();
++ gcc_assert (stack_pointer != 0);
+
+ type = stack_type_map[stack_pointer - 1];
+ if (type == TYPE_SECOND)
+ {
+ count--;
+- if (stack_pointer == 1 || count <= 0)
+- abort ();
++ gcc_assert (stack_pointer != 1 && count > 0);
+
+ type = stack_type_map[stack_pointer - 2];
+ }
+@@ -643,6 +641,7 @@
+ || TYPE_IS_WIDE (type1) || TYPE_IS_WIDE (type2))
+ /* Bad stack swap. */
+ abort ();
++ /* Bad stack swap. */
+
+ flush_quick_stack ();
+ decl1 = find_stack_slot (stack_pointer - 1, type1);
+@@ -682,18 +681,16 @@
+ type = stack_type_map [src_index];
+ if (type == TYPE_SECOND)
+ {
+- if (src_index <= low_index)
+- /* Dup operation splits 64-bit number. */
+- abort ();
++ /* Dup operation splits 64-bit number. */
++ gcc_assert (src_index > low_index);
+
+ stack_type_map[dst_index] = type;
+ src_index--; dst_index--;
+ type = stack_type_map[src_index];
+- if (! TYPE_IS_WIDE (type))
+- abort ();
++ gcc_assert (TYPE_IS_WIDE (type));
+ }
+- else if (TYPE_IS_WIDE (type))
+- abort ();
++ else
++ gcc_assert (! TYPE_IS_WIDE (type));
+
+ if (src_index != dst_index)
+ {
+@@ -789,7 +786,7 @@
+ else if (type == long_type_node)
+ return 11;
+ else
+- abort ();
++ gcc_unreachable ();
+ }
+
+ /* Build a call to _Jv_ThrowBadArrayIndex(), the
+@@ -946,17 +943,15 @@
+ }
+ else
+ {
+- if (! is_array_type_p (array_type_p))
+- abort ();
++ gcc_assert (is_array_type_p (array_type_p));
+
+ /* Get the TYPE_DECL for ARRAY's element type. */
+ element_type
+ = TYPE_NAME (TREE_TYPE (TREE_TYPE (TREE_TYPE (array_type_p))));
+ }
+
+- if (TREE_CODE (element_type) != TYPE_DECL
+- || TREE_CODE (object_type) != TYPE_DECL)
+- abort ();
++ gcc_assert (TREE_CODE (element_type) == TYPE_DECL
++ && TREE_CODE (object_type) == TYPE_DECL);
+
+ if (!flag_store_check)
+ return build1 (NOP_EXPR, array_type_p, array);
+@@ -1239,7 +1234,7 @@
+ value = build_real (type, x);
+ }
+ else
+- abort ();
++ gcc_unreachable ();
+
+ push_value (value);
+ }
+@@ -1316,10 +1311,10 @@
+ ? alloc_object_node
+ : alloc_no_finalizer_node);
+
+- return build (CALL_EXPR, promote_type (type),
+- build_address_of (alloc_node),
+- build_tree_list (NULL_TREE, build_class_ref (type)),
+- NULL_TREE);
++ return build3 (CALL_EXPR, promote_type (type),
++ build_address_of (alloc_node),
++ build_tree_list (NULL_TREE, build_class_ref (type)),
++ NULL_TREE);
+ }
+
+ static void
+@@ -1456,7 +1451,6 @@
+ constant_value = build_int_cst (NULL_TREE, ival);
+ res = fold_build2 (PLUS_EXPR, int_type_node, local_var, constant_value);
+ java_add_stmt (build2 (MODIFY_EXPR, TREE_TYPE (local_var), local_var, res));
+- update_aliases (local_var, local_var_index, pc);
+ }
+
+
+@@ -1496,9 +1490,7 @@
+ }
+ }
+
+- if (! call)
+- abort ();
+-
++ gcc_assert (call);
+ call = build3 (CALL_EXPR, type,
+ build_address_of (call),
+ tree_cons (NULL_TREE, arg1,
+@@ -1701,7 +1693,7 @@
+
+ We assume that Page 0 will be mapped with NOPERM, and that
+ memory may be allocated from any other page, so only field
+- offsets < pagesize are guaratneed to trap. We also assume
++ offsets < pagesize are guaranteed to trap. We also assume
+ the smallest page size we'll encounter is 4k bytes. */
+ if (! flag_syntax_only && check && ! flag_check_references
+ && ! flag_indirect_dispatch)
+@@ -1718,7 +1710,8 @@
+ {
+ tree otable_index
+ = build_int_cst (NULL_TREE, get_symbol_table_index
+- (field_decl, &TYPE_OTABLE_METHODS (output_class)));
++ (field_decl, NULL_TREE,
++ &TYPE_OTABLE_METHODS (output_class)));
+ tree field_offset
+ = build4 (ARRAY_REF, integer_type_node,
+ TYPE_OTABLE_DECL (output_class), otable_index,
+@@ -1913,7 +1906,7 @@
+ arg = convert (integer_type_node, arg);
+ return tree_cons (NULL_TREE, arg, tail);
+ }
+- abort ();
++ gcc_unreachable ();
+ }
+
+ /* Attach to PTR (a block) the declaration found in ENTRY. */
+@@ -2027,10 +2020,94 @@
+ return init;
+ }
+
++
++
++/* Rewrite expensive calls that require stack unwinding at runtime to
++ cheaper alternatives. The logic here performs these
++ transformations:
++
++ java.lang.Class.forName("foo") -> java.lang.Class.forName("foo", class$)
++ java.lang.Class.getClassLoader() -> java.lang.Class.getClassLoader(class$)
++
++*/
++
++typedef struct
++{
++ const char *classname;
++ const char *method;
++ const char *signature;
++ const char *new_signature;
++ int flags;
++ tree (*rewrite_arglist) (tree arglist);
++} rewrite_rule;
++
++/* Add this.class to the end of an arglist. */
++
++static tree
++rewrite_arglist_getclass (tree arglist)
++{
++ return chainon (arglist,
++ tree_cons (NULL_TREE, build_class_ref (output_class), NULL_TREE));
++}
++
++static rewrite_rule rules[] =
++ {{"java.lang.Class", "getClassLoader", "()Ljava/lang/ClassLoader;",
++ "(Ljava/lang/Class;)Ljava/lang/ClassLoader;",
++ ACC_FINAL|ACC_PRIVATE, rewrite_arglist_getclass},
++ {"java.lang.Class", "forName", "(Ljava/lang/String;)Ljava/lang/Class;",
++ "(Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/Class;",
++ ACC_FINAL|ACC_PRIVATE|ACC_STATIC, rewrite_arglist_getclass},
++ {NULL, NULL, NULL, NULL, 0, NULL}};
++
++/* Scan the rules list for replacements for *METHOD_P and replace the
++ args accordingly. If the rewrite results in an access to a private
++ method, update SPECIAL.*/
++
++void
++maybe_rewrite_invocation (tree *method_p, tree *arg_list_p,
++ tree *method_signature_p, tree *special)
++{
++ tree context = DECL_NAME (TYPE_NAME (DECL_CONTEXT (*method_p)));
++ rewrite_rule *p;
++ *special = NULL_TREE;
++
++ for (p = rules; p->classname; p++)
++ {
++ if (get_identifier (p->classname) == context)
++ {
++ tree method = DECL_NAME (*method_p);
++ if (get_identifier (p->method) == method
++ && get_identifier (p->signature) == *method_signature_p)
++ {
++ tree maybe_method
++ = lookup_java_method (DECL_CONTEXT (*method_p),
++ method,
++ get_identifier (p->new_signature));
++ if (! maybe_method && ! flag_verify_invocations)
++ {
++ maybe_method
++ = add_method (DECL_CONTEXT (*method_p), p->flags,
++ method, get_identifier (p->new_signature));
++ DECL_EXTERNAL (maybe_method) = 1;
++ }
++ *method_p = maybe_method;
++ gcc_assert (*method_p);
++ *arg_list_p = p->rewrite_arglist (*arg_list_p);
++ *method_signature_p = get_identifier (p->new_signature);
++ *special = integer_one_node;
++
++ break;
++ }
++ }
++ }
++}
++
++
++
+ tree
+ build_known_method_ref (tree method, tree method_type ATTRIBUTE_UNUSED,
+ tree self_type, tree method_signature ATTRIBUTE_UNUSED,
+- tree arg_list ATTRIBUTE_UNUSED)
++ tree arg_list ATTRIBUTE_UNUSED, tree special)
+ {
+ tree func;
+ if (is_compiled_class (self_type))
+@@ -2048,8 +2125,10 @@
+ else
+ {
+ tree table_index
+- = build_int_cst (NULL_TREE, get_symbol_table_index
+- (method, &TYPE_ATABLE_METHODS (output_class)));
++ = build_int_cst (NULL_TREE,
++ (get_symbol_table_index
++ (method, special,
++ &TYPE_ATABLE_METHODS (output_class))));
+ func
+ = build4 (ARRAY_REF,
+ TREE_TYPE (TREE_TYPE (TYPE_ATABLE_DECL (output_class))),
+@@ -2134,14 +2213,14 @@
+ reused. */
+
+ int
+-get_symbol_table_index (tree t, tree *symbol_table)
++get_symbol_table_index (tree t, tree special, tree *symbol_table)
+ {
+ int i = 1;
+ tree method_list;
+
+ if (*symbol_table == NULL_TREE)
+ {
+- *symbol_table = build_tree_list (t, t);
++ *symbol_table = build_tree_list (special, t);
+ return 1;
+ }
+
+@@ -2150,7 +2229,8 @@
+ while (1)
+ {
+ tree value = TREE_VALUE (method_list);
+- if (value == t)
++ tree purpose = TREE_PURPOSE (method_list);
++ if (value == t && purpose == special)
+ return i;
+ i++;
+ if (TREE_CHAIN (method_list) == NULL_TREE)
+@@ -2159,12 +2239,12 @@
+ method_list = TREE_CHAIN (method_list);
+ }
+
+- TREE_CHAIN (method_list) = build_tree_list (t, t);
++ TREE_CHAIN (method_list) = build_tree_list (special, t);
+ return i;
+ }
+
+ tree
+-build_invokevirtual (tree dtable, tree method)
++build_invokevirtual (tree dtable, tree method, tree special)
+ {
+ tree func;
+ tree nativecode_ptr_ptr_type_node
+@@ -2174,12 +2254,12 @@
+
+ if (flag_indirect_dispatch)
+ {
+- if (CLASS_INTERFACE (TYPE_NAME (DECL_CONTEXT (method))))
+- abort ();
++ gcc_assert (! CLASS_INTERFACE (TYPE_NAME (DECL_CONTEXT (method))));
+
+ otable_index
+ = build_int_cst (NULL_TREE, get_symbol_table_index
+- (method, &TYPE_OTABLE_METHODS (output_class)));
++ (method, special,
++ &TYPE_OTABLE_METHODS (output_class)));
+ method_index = build4 (ARRAY_REF, integer_type_node,
+ TYPE_OTABLE_DECL (output_class),
+ otable_index, NULL_TREE, NULL_TREE);
+@@ -2228,15 +2308,14 @@
+ lookup_field (&dtable_type, class_ident), NULL_TREE);
+
+ interface = DECL_CONTEXT (method);
+- if (! CLASS_INTERFACE (TYPE_NAME (interface)))
+- abort ();
++ gcc_assert (CLASS_INTERFACE (TYPE_NAME (interface)));
+ layout_class_methods (interface);
+
+ if (flag_indirect_dispatch)
+ {
+ int itable_index
+ = 2 * (get_symbol_table_index
+- (method, &TYPE_ITABLE_METHODS (output_class)));
++ (method, NULL_TREE, &TYPE_ITABLE_METHODS (output_class)));
+ interface
+ = build4 (ARRAY_REF,
+ TREE_TYPE (TREE_TYPE (TYPE_ITABLE_DECL (output_class))),
+@@ -2289,6 +2368,8 @@
+ tree call, func, method, arg_list, method_type;
+ tree check = NULL_TREE;
+
++ tree special = NULL_TREE;
++
+ if (! CLASS_LOADED_P (self_type))
+ {
+ load_class (self_type, 1);
+@@ -2305,7 +2386,10 @@
+
+ /* We've found a method in a class other than the one in which it
+ was wanted. This can happen if, for instance, we're trying to
+- compile invokespecial super.equals(). */
++ compile invokespecial super.equals().
++ FIXME: This is a kludge. Rather than nullifying the result, we
++ should change lookup_java_method() so that it doesn't search the
++ superclass chain when we're BC-compiling. */
+ if (! flag_verify_invocations
+ && method
+ && ! TYPE_ARRAY_P (self_type)
+@@ -2400,10 +2484,13 @@
+ arg_list = pop_arguments (TYPE_ARG_TYPES (method_type));
+ flush_quick_stack ();
+
++ maybe_rewrite_invocation (&method, &arg_list, &method_signature,
++ &special);
++
+ func = NULL_TREE;
+ if (opcode == OPCODE_invokestatic)
+ func = build_known_method_ref (method, method_type, self_type,
+- method_signature, arg_list);
++ method_signature, arg_list, special);
+ else if (opcode == OPCODE_invokespecial
+ || (opcode == OPCODE_invokevirtual
+ && (METHOD_PRIVATE (method)
+@@ -2423,14 +2510,14 @@
+ TREE_VALUE (arg_list) = save_arg;
+ check = java_check_reference (save_arg, ! DECL_INIT_P (method));
+ func = build_known_method_ref (method, method_type, self_type,
+- method_signature, arg_list);
++ method_signature, arg_list, special);
+ }
+ else
+ {
+ tree dtable = invoke_build_dtable (opcode == OPCODE_invokeinterface,
+ arg_list);
+ if (opcode == OPCODE_invokevirtual)
+- func = build_invokevirtual (dtable, method);
++ func = build_invokevirtual (dtable, method, special);
+ else
+ func = build_invokeinterface (dtable, method);
+ }
+@@ -2479,8 +2566,7 @@
+ int from_class = ! CLASS_FROM_SOURCE_P (klass);
+ klass = build_class_ref (klass);
+
+- if (! METHOD_NATIVE (method) || ! flag_jni)
+- abort ();
++ gcc_assert (METHOD_NATIVE (method) && flag_jni);
+
+ DECL_ARTIFICIAL (method) = 1;
+ DECL_EXTERNAL (method) = 0;
+@@ -2634,8 +2720,7 @@
+ if (res_var != NULL_TREE)
+ {
+ tree drt;
+- if (! DECL_RESULT (method))
+- abort ();
++ gcc_assert (DECL_RESULT (method));
+ /* Make sure we copy the result variable to the actual
+ result. We use the type of the DECL_RESULT because it
+ might be different from the return type of the function:
+@@ -2656,6 +2741,25 @@
+ return bind;
+ }
+
++
++/* Given lvalue EXP, return a volatile expression that references the
++ same object. */
++
++tree
++java_modify_addr_for_volatile (tree exp)
++{
++ tree exp_type = TREE_TYPE (exp);
++ tree v_type
++ = build_qualified_type (exp_type,
++ TYPE_QUALS (exp_type) | TYPE_QUAL_VOLATILE);
++ tree addr = build_fold_addr_expr (exp);
++ v_type = build_pointer_type (v_type);
++ addr = fold_convert (v_type, addr);
++ exp = build_fold_indirect_ref (addr);
++ return exp;
++}
++
++
+ /* Expand an operation to extract from or store into a field.
+ IS_STATIC is 1 iff the field is static.
+ IS_PUTTING is 1 for putting into a field; 0 for getting from the field.
+@@ -2679,6 +2783,7 @@
+ int is_error = 0;
+ tree original_self_type = self_type;
+ tree field_decl;
++ tree modify_expr;
+
+ if (! CLASS_LOADED_P (self_type))
+ load_class (self_type, 1);
+@@ -2699,6 +2804,13 @@
+ field_type, flags);
+ DECL_ARTIFICIAL (field_decl) = 1;
+ DECL_IGNORED_P (field_decl) = 1;
++#if 0
++ /* FIXME: We should be pessimistic about volatility. We
++ don't know one way or another, but this is safe.
++ However, doing this has bad effects on code quality. We
++ need to look at better ways to do this. */
++ TREE_THIS_VOLATILE (field_decl) = 1;
++#endif
+ }
+ else
+ {
+@@ -2749,12 +2861,45 @@
+ warning (0, "assignment to final field %q+D not in constructor",
+ field_decl);
+ }
+- }
+- java_add_stmt (build2 (MODIFY_EXPR, TREE_TYPE (field_ref),
+- field_ref, new_value));
++ }
++
++ if (TREE_THIS_VOLATILE (field_decl))
++ field_ref = java_modify_addr_for_volatile (field_ref);
++
++ modify_expr = build2 (MODIFY_EXPR, TREE_TYPE (field_ref),
++ field_ref, new_value);
++
++ if (TREE_THIS_VOLATILE (field_decl))
++ java_add_stmt
++ (build3
++ (CALL_EXPR, void_type_node,
++ build_address_of (built_in_decls[BUILT_IN_SYNCHRONIZE]),
++ NULL_TREE, NULL_TREE));
++
++ java_add_stmt (modify_expr);
+ }
+ else
+- push_value (field_ref);
++ {
++ tree temp = build_decl (VAR_DECL, NULL_TREE, TREE_TYPE (field_ref));
++ java_add_local_var (temp);
++
++ if (TREE_THIS_VOLATILE (field_decl))
++ field_ref = java_modify_addr_for_volatile (field_ref);
++
++ modify_expr
++ = build2 (MODIFY_EXPR, TREE_TYPE (field_ref), temp, field_ref);
++ java_add_stmt (modify_expr);
++
++ if (TREE_THIS_VOLATILE (field_decl))
++ java_add_stmt
++ (build3
++ (CALL_EXPR, void_type_node,
++ build_address_of (built_in_decls[BUILT_IN_SYNCHRONIZE]),
++ NULL_TREE, NULL_TREE));
++
++ push_value (temp);
++ }
++ TREE_THIS_VOLATILE (field_ref) = TREE_THIS_VOLATILE (field_decl);
+ }
+
+ void
+@@ -3043,6 +3188,12 @@
+ c = build_ref_from_constant_pool (index);
+ c = convert (promote_type (string_type_node), c);
+ }
++ else if (JPOOL_TAG (jcf, index) == CONSTANT_Class
++ || JPOOL_TAG (jcf, index) == CONSTANT_ResolvedClass)
++ {
++ tree record = get_class_constant (jcf, index);
++ c = build_class_ref (record);
++ }
+ else
+ c = get_constant (jcf, index);
+ push_value (c);
+@@ -3261,7 +3412,6 @@
+ decl = find_local_variable (index, type, oldpc); \
+ set_local_type (index, type); \
+ java_add_stmt (build2 (MODIFY_EXPR, type, decl, value)); \
+- update_aliases (decl, index, PC); \
+ }
+
+ #define STORE(OPERAND_TYPE, OPERAND_VALUE) \
+@@ -3514,8 +3664,7 @@
+ return node;
+
+ /* Not having a list of arguments here is an error. */
+- if (TREE_CODE (arg) != TREE_LIST)
+- abort ();
++ gcc_assert (TREE_CODE (arg) == TREE_LIST);
+
+ /* This reverses the evaluation order. This is a desired effect. */
+ for (cmp = NULL_TREE; arg; arg = TREE_CHAIN (arg))
+diff -urN old/gcc/java/gjavah.c src/gcc/java/gjavah.c
+--- old/gcc/java/gjavah.c 2006-01-21 19:29:08.000000000 +0100
++++ src/gcc/java/gjavah.c 2006-08-28 19:14:18.170718000 +0200
+@@ -252,7 +252,7 @@
+
+ /* Only include byte-code decompilation optimizations for ELF targets
+ since the generated headers are only known to work with ELF weak
+- symbol semnatics. Specifically, these optimizations are known to
++ symbol semantics. Specifically, these optimizations are known to
+ not work on PE-COFF and possibly others. */
+ #ifdef OBJECT_FORMAT_ELF
+ #define HANDLE_CODE_ATTRIBUTE(MAX_STACK, MAX_LOCALS, CODE_LENGTH) \
+@@ -600,7 +600,7 @@
+ are `$'. */
+ if (i == length)
+ {
+- char *dup = xmalloc (2 + length - min_length + kwl);
++ char *dup = XNEWVEC (char, 2 + length - min_length + kwl);
+ strcpy (dup, cxx_keywords[mid]);
+ for (i = kwl; i < length + 1; ++i)
+ dup[i] = '$';
+@@ -719,7 +719,7 @@
+ return NULL;
+ }
+
+- override = xmalloc (length + 3);
++ override = XNEWVEC (char, length + 3);
+ memcpy (override, name, length);
+ strcpy (override + length, "__");
+ }
+@@ -929,13 +929,13 @@
+ {
+ struct method_name *nn;
+
+- nn = xmalloc (sizeof (struct method_name));
+- nn->name = xmalloc (length);
++ nn = XNEW (struct method_name);
++ nn->name = XNEWVEC (unsigned char, length);
+ memcpy (nn->name, str, length);
+ nn->length = length;
+ nn->next = method_name_list;
+ nn->sig_length = JPOOL_UTF_LENGTH (jcf, sig_index);
+- nn->signature = xmalloc (nn->sig_length);
++ nn->signature = XNEWVEC (unsigned char, nn->sig_length);
+ nn->is_native = METHOD_IS_NATIVE (flags);
+ memcpy (nn->signature, JPOOL_UTF_DATA (jcf, sig_index),
+ nn->sig_length);
+@@ -1240,7 +1240,7 @@
+
+ for (length = 0; clname[length] != ';' && clname[length] != '\0'; ++length)
+ ;
+- current = ALLOC (length + 1);
++ current = XNEWVEC (unsigned char, length + 1);
+ for (i = 0; i < length; ++i)
+ current[i] = clname[i] == '/' ? '.' : clname[i];
+ current[length] = '\0';
+@@ -1276,7 +1276,7 @@
+ jcf_parse_class (&jcf);
+
+ tmp = (unsigned char *) super_class_name (&jcf, &super_length);
+- super = ALLOC (super_length + 1);
++ super = XNEWVEC (unsigned char, super_length + 1);
+ memcpy (super, tmp, super_length);
+ super[super_length] = '\0';
+
+@@ -1836,8 +1836,8 @@
+ return;
+ }
+
+- incl = xmalloc (sizeof (struct include));
+- incl->name = xmalloc (len + 1);
++ incl = XNEW (struct include);
++ incl->name = XNEWVEC (char, len + 1);
+ strncpy (incl->name, (const char *) utf8, len);
+ incl->name[len] = '\0';
+ incl->next = all_includes;
+@@ -1922,8 +1922,8 @@
+
+ if (n == NULL)
+ {
+- n = xmalloc (sizeof (struct namelet));
+- n->name = xmalloc (p - name + 1);
++ n = XNEW (struct namelet);
++ n->name = XNEWVEC (char, p - name + 1);
+ strncpy (n->name, (const char *) name, p - name);
+ n->name[p - name] = '\0';
+ n->is_class = (p == name_limit);
+@@ -2173,7 +2173,7 @@
+ if (len > 6 && ! strcmp (&jcf->classname[len - 6], ".class"))
+ len -= 6;
+ /* Turn the class name into a file name. */
+- name = xmalloc (len + 1);
++ name = XNEWVEC (char, len + 1);
+ for (i = 0; i < len; ++i)
+ name[i] = jcf->classname[i] == '.' ? '/' : jcf->classname[i];
+ name[i] = '\0';
+@@ -2484,25 +2484,25 @@
+
+ case OPT_PREPEND:
+ if (prepend_count == 0)
+- prepend_specs = ALLOC (argc * sizeof (char*));
++ prepend_specs = XNEWVEC (char *, argc);
+ prepend_specs[prepend_count++] = optarg;
+ break;
+
+ case OPT_FRIEND:
+ if (friend_count == 0)
+- friend_specs = ALLOC (argc * sizeof (char*));
++ friend_specs = XNEWVEC (char *, argc);
+ friend_specs[friend_count++] = optarg;
+ break;
+
+ case OPT_ADD:
+ if (add_count == 0)
+- add_specs = ALLOC (argc * sizeof (char*));
++ add_specs = XNEWVEC (char *, argc);
+ add_specs[add_count++] = optarg;
+ break;
+
+ case OPT_APPEND:
+ if (append_count == 0)
+- append_specs = ALLOC (argc * sizeof (char*));
++ append_specs = XNEWVEC (char *, argc);
+ append_specs[append_count++] = optarg;
+ break;
+
+@@ -2608,7 +2608,7 @@
+ {
+ int dir_len = strlen (output_directory);
+ int i, classname_length = strlen (classname);
+- current_output_file = ALLOC (dir_len + classname_length + 5);
++ current_output_file = XNEWVEC (char, dir_len + classname_length + 5);
+ strcpy (current_output_file, output_directory);
+ if (dir_len > 0 && output_directory[dir_len-1] != '/')
+ current_output_file[dir_len++] = '/';
+diff -urN old/gcc/java/java-gimplify.c src/gcc/java/java-gimplify.c
+--- old/gcc/java/java-gimplify.c 2005-09-06 17:22:34.000000000 +0200
++++ src/gcc/java/java-gimplify.c 2006-08-28 19:17:32.320718000 +0200
+@@ -39,7 +39,9 @@
+ static tree java_gimplify_block (tree);
+ static tree java_gimplify_new_array_init (tree);
+ static tree java_gimplify_try_expr (tree);
+-static tree java_gimplify_modify_expr (tree);
++static enum gimplify_status java_gimplify_modify_expr (tree*, tree*, tree *);
++static enum gimplify_status java_gimplify_component_ref (tree*, tree*, tree *);
++static enum gimplify_status java_gimplify_self_mod_expr (tree*, tree*, tree *);
+
+ static void dump_java_tree (enum tree_dump_index, tree);
+
+@@ -119,8 +121,7 @@
+ return GS_UNHANDLED;
+
+ case MODIFY_EXPR:
+- *expr_p = java_gimplify_modify_expr (*expr_p);
+- return GS_UNHANDLED;
++ return java_gimplify_modify_expr (expr_p, pre_p, post_p);
+
+ case SAVE_EXPR:
+ /* Note that we can see if the save_expr was
+@@ -132,6 +133,12 @@
+ /* want_lvalue */ false);
+ return GS_UNHANDLED;
+
++ case POSTINCREMENT_EXPR:
++ case POSTDECREMENT_EXPR:
++ case PREINCREMENT_EXPR:
++ case PREDECREMENT_EXPR:
++ return java_gimplify_self_mod_expr (expr_p, pre_p, post_p);
++
+ /* These should already be lowered before we get here. */
+ case URSHIFT_EXPR:
+ case COMPARE_EXPR:
+@@ -146,7 +153,10 @@
+ case CONDITIONAL_EXPR:
+ case INSTANCEOF_EXPR:
+ case CLASS_LITERAL:
+- abort ();
++ gcc_unreachable ();
++
++ case COMPONENT_REF:
++ return java_gimplify_component_ref (expr_p, pre_p, post_p);
+
+ default:
+ /* Java insists on strict left-to-right evaluation of expressions.
+@@ -186,9 +196,9 @@
+ tree t;
+
+ DECL_CONTEXT (label) = current_function_decl;
+- t = build (LABEL_EXPR, void_type_node, label);
++ t = build1 (LABEL_EXPR, void_type_node, label);
+ if (body != NULL_TREE)
+- t = build (COMPOUND_EXPR, void_type_node, body, t);
++ t = build2 (COMPOUND_EXPR, void_type_node, body, t);
+ return t;
+ }
+
+@@ -208,13 +218,104 @@
+ return build1 (GOTO_EXPR, void_type_node, label);
+ }
+
+-static tree
+-java_gimplify_modify_expr (tree modify_expr)
++
++
++static enum gimplify_status
++java_gimplify_component_ref (tree *expr_p, tree *pre_p, tree *post_p)
+ {
++ if (CLASS_FROM_SOURCE_P (output_class)
++ && TREE_THIS_VOLATILE (TREE_OPERAND (*expr_p, 1))
++ && ! TREE_THIS_VOLATILE (*expr_p))
++ {
++ enum gimplify_status stat;
++ tree sync_expr;
++
++ /* Special handling for volatile fields.
++
++ A load has "acquire" semantics, implying that you can't move up
++ later operations. A store has "release" semantics meaning that
++ earlier operations cannot be delayed past it.
++
++ This logic only handles loads: stores are handled in
++ java_gimplify_modify_expr().
++
++ We gimplify this COMPONENT_REF, put the result in a tmp_var, and then
++ return a COMPOUND_EXPR of the form {__sync_synchronize(); tmp_var}.
++ This forces __sync_synchronize() to be placed immediately after
++ loading from the volatile field.
++
++ */
++
++ TREE_THIS_VOLATILE (*expr_p) = 1;
++ *expr_p = java_modify_addr_for_volatile (*expr_p);
++ stat = gimplify_expr (expr_p, pre_p, post_p,
++ is_gimple_formal_tmp_var, fb_rvalue);
++ if (stat == GS_ERROR)
++ return stat;
++
++ sync_expr
++ = build3 (CALL_EXPR, void_type_node,
++ build_address_of (built_in_decls[BUILT_IN_SYNCHRONIZE]),
++ NULL_TREE, NULL_TREE);
++ TREE_SIDE_EFFECTS (sync_expr) = 1;
++ *expr_p = build2 (COMPOUND_EXPR, TREE_TYPE (*expr_p),
++ sync_expr, *expr_p);
++ TREE_SIDE_EFFECTS (*expr_p) = 1;
++ }
++
++ return GS_UNHANDLED;
++}
++
++
++static enum gimplify_status
++java_gimplify_modify_expr (tree *modify_expr_p, tree *pre_p, tree *post_p)
++{
++ tree modify_expr = *modify_expr_p;
+ tree lhs = TREE_OPERAND (modify_expr, 0);
+ tree rhs = TREE_OPERAND (modify_expr, 1);
+ tree lhs_type = TREE_TYPE (lhs);
+
++ if (CLASS_FROM_SOURCE_P (output_class)
++ && TREE_CODE (lhs) == COMPONENT_REF
++ && TREE_THIS_VOLATILE (TREE_OPERAND (lhs, 1)))
++ {
++ /* Special handling for volatile fields.
++
++ A load has "acquire" semantics, implying that you can't move up
++ later operations. A store has "release" semantics meaning that
++ earlier operations cannot be delayed past it.
++
++ This logic only handles stores; loads are handled in
++ java_gimplify_component_ref().
++
++ We gimplify the rhs, put the result in a tmp_var, and then return
++ a MODIFY_EXPR with an rhs of the form {__sync_synchronize(); tmp_var}.
++ This forces __sync_synchronize() to be placed after evaluating
++ the rhs and immediately before storing to the volatile field.
++
++ */
++
++ enum gimplify_status stat;
++ tree sync_expr
++ = build3 (CALL_EXPR, void_type_node,
++ build_address_of (built_in_decls[BUILT_IN_SYNCHRONIZE]),
++ NULL_TREE, NULL_TREE);
++ TREE_SIDE_EFFECTS (sync_expr) = 1;
++
++ stat = gimplify_expr (&rhs, pre_p, post_p,
++ is_gimple_formal_tmp_var, fb_rvalue);
++ if (stat == GS_ERROR)
++ return stat;
++
++ rhs = build2 (COMPOUND_EXPR, TREE_TYPE (rhs),
++ sync_expr, rhs);
++ TREE_SIDE_EFFECTS (rhs) = 1;
++ TREE_THIS_VOLATILE (lhs) = 1;
++ lhs = java_modify_addr_for_volatile (lhs);
++ TREE_OPERAND (modify_expr, 0) = lhs;
++ TREE_OPERAND (modify_expr, 1) = rhs;
++ }
++
+ /* This is specific to the bytecode compiler. If a variable has
+ LOCAL_SLOT_P set, replace an assignment to it with an assignment
+ to the corresponding variable that holds all its aliases. */
+@@ -235,7 +336,24 @@
+ assignment and subclass assignment. */
+ TREE_OPERAND (modify_expr, 1) = convert (lhs_type, rhs);
+
+- return modify_expr;
++ *modify_expr_p = modify_expr;
++ return GS_UNHANDLED;
++}
++
++/* Special case handling for volatiles: we need to generate a barrier
++ between the reading and the writing. */
++
++static enum gimplify_status
++java_gimplify_self_mod_expr (tree *expr_p, tree *pre_p ATTRIBUTE_UNUSED,
++ tree *post_p ATTRIBUTE_UNUSED)
++{
++ tree lhs = TREE_OPERAND (*expr_p, 0);
++
++ if (TREE_CODE (lhs) == COMPONENT_REF
++ && TREE_THIS_VOLATILE (TREE_OPERAND (lhs, 1)))
++ TREE_THIS_VOLATILE (lhs) = 1;
++
++ return GS_UNHANDLED;
+ }
+
+
+@@ -276,7 +394,7 @@
+ block = make_node (BLOCK);
+ BLOCK_VARS (block) = decls;
+
+- /* The TREE_USED flag on a block determines whether the debug ouput
++ /* The TREE_USED flag on a block determines whether the debug output
+ routines generate info for the variables in that block. */
+ TREE_USED (block) = 1;
+
+diff -urN old/gcc/java/java-tree.def src/gcc/java/java-tree.def
+--- old/gcc/java/java-tree.def 2004-11-24 12:41:38.000000000 +0100
++++ src/gcc/java/java-tree.def 2006-08-28 19:14:18.170718000 +0200
+@@ -39,7 +39,7 @@
+ DEFTREECODE (NEW_CLASS_EXPR, "new_class_expr", tcc_expression, 3)
+
+ /* Defines `this' as an expression. */
+-DEFTREECODE (THIS_EXPR, "this", tcc_unary, 0)
++DEFTREECODE (THIS_EXPR, "this", tcc_expression, 0)
+
+ /* A labeled block. Operand 0 is the label that will be generated to
+ mark the end of the block. Operand 1 is the labeled block body. */
+diff -urN old/gcc/java/java-tree.h src/gcc/java/java-tree.h
+--- old/gcc/java/java-tree.h 2005-12-08 15:40:48.000000000 +0100
++++ src/gcc/java/java-tree.h 2006-08-28 19:17:32.340718000 +0200
+@@ -1,6 +1,6 @@
+ /* Definitions for parsing and type checking for the GNU compiler for
+ the Java(TM) language.
+- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
++ Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
+
+ This file is part of GCC.
+@@ -78,7 +78,7 @@
+ 2: CLASS_PARSED_P (in RECORD_TYPE).
+ 3: CLASS_FROM_SOURCE_P (in RECORD_TYPE).
+ 4: CLASS_P (in RECORD_TYPE).
+- 5: CLASS_FROM_CURRENTLY_COMPILED_SOURCE_P (in RECORD_TYPE)
++ 5: CLASS_FROM_CURRENTLY_COMPILED_P (in RECORD_TYPE)
+ 6: CLASS_BEING_LAIDOUT (in RECORD_TYPE)
+
+ Usage of DECL_LANG_FLAG_?:
+@@ -208,6 +208,9 @@
+ initialization optimization should be performed. */
+ extern int flag_optimize_sci;
+
++/* Generate instances of Class at runtime. */
++extern int flag_indirect_classes;
++
+ /* When nonzero, use offset tables for virtual method calls
+ in order to improve binary compatibility. */
+ extern int flag_indirect_dispatch;
+@@ -215,6 +218,9 @@
+ /* When zero, don't generate runtime array store checks. */
+ extern int flag_store_check;
+
++/* When nonzero, generate only a limited set of class meta-data. */
++extern int flag_reduced_reflection;
++
+ /* Encoding used for source files. */
+ extern const char *current_encoding;
+
+@@ -267,6 +273,12 @@
+ extern GTY(()) tree java_io_serializable_identifier_node;
+ extern GTY(()) tree gcj_abi_version;
+
++/* The decl for the .constants field of an instance of Class. */
++extern GTY(()) tree constants_field_decl_node;
++
++/* The decl for the .data field of an instance of Class. */
++extern GTY(()) tree constants_data_field_decl_node;
++
+ enum java_tree_index
+ {
+ JTI_PROMOTED_BYTE_TYPE_NODE,
+@@ -1048,11 +1060,12 @@
+ #define TYPE_FINIT_STMT_LIST(T) (TYPE_LANG_SPECIFIC (T)->finit_stmt_list)
+ #define TYPE_CLINIT_STMT_LIST(T) (TYPE_LANG_SPECIFIC (T)->clinit_stmt_list)
+ #define TYPE_II_STMT_LIST(T) (TYPE_LANG_SPECIFIC (T)->ii_block)
+-/* The decl of the synthetic method `class$' used to handle `.class'
+- for non primitive types when compiling to bytecode. */
+
+ #define TYPE_DUMMY(T) (TYPE_LANG_SPECIFIC(T)->dummy_class)
+
++/* The decl of the synthetic method `class$' used to handle `.class'
++ for non primitive types when compiling to bytecode. */
++
+ #define TYPE_DOT_CLASS(T) (TYPE_LANG_SPECIFIC (T)->dot_class)
+ #define TYPE_PACKAGE_LIST(T) (TYPE_LANG_SPECIFIC (T)->package_list)
+ #define TYPE_IMPORT_LIST(T) (TYPE_LANG_SPECIFIC (T)->import_list)
+@@ -1208,7 +1221,6 @@
+ extern tree build_static_field_ref (tree);
+ extern tree build_address_of (tree);
+ extern tree find_local_variable (int index, tree type, int pc);
+-extern void update_aliases (tree decl, int index, int pc);
+ extern tree find_stack_slot (int index, tree type);
+ extern tree build_prim_array_type (tree, HOST_WIDE_INT);
+ extern tree build_java_array_type (tree, HOST_WIDE_INT);
+@@ -1228,14 +1240,16 @@
+ extern void initialize_builtins (void);
+
+ extern tree lookup_name (tree);
+-extern tree build_known_method_ref (tree, tree, tree, tree, tree);
++extern void maybe_rewrite_invocation (tree *, tree *, tree *, tree *);
++extern tree build_known_method_ref (tree, tree, tree, tree, tree, tree);
+ extern tree build_class_init (tree, tree);
+ extern int attach_init_test_initialization_flags (void **, void *);
+-extern tree build_invokevirtual (tree, tree);
++extern tree build_invokevirtual (tree, tree, tree);
+ extern tree build_invokeinterface (tree, tree);
+ extern tree build_jni_stub (tree);
+ extern tree invoke_build_dtable (int, tree);
+ extern tree build_field_ref (tree, tree, tree);
++extern tree java_modify_addr_for_volatile (tree);
+ extern void pushdecl_force_head (tree);
+ extern tree build_java_binop (enum tree_code, tree, tree, tree);
+ extern tree build_java_soft_divmod (enum tree_code, tree, tree, tree);
+@@ -1344,6 +1358,7 @@
+ extern void safe_layout_class (tree);
+
+ extern tree get_boehm_type_descriptor (tree);
++extern bool uses_jv_markobj_p (tree);
+ extern bool class_has_finalize_method (tree);
+ extern void java_check_methods (tree);
+ extern void init_jcf_parse (void);
+@@ -1378,7 +1393,7 @@
+ extern void finish_method (tree);
+ extern void java_expand_body (tree);
+
+-extern int get_symbol_table_index (tree, tree *);
++extern int get_symbol_table_index (tree, tree, tree *);
+
+ extern tree make_catch_class_record (tree, tree);
+ extern tree emit_catch_table (tree);
+diff -urN old/gcc/java/jcf-dump.c src/gcc/java/jcf-dump.c
+--- old/gcc/java/jcf-dump.c 2006-01-21 19:29:08.000000000 +0100
++++ src/gcc/java/jcf-dump.c 2006-08-28 19:14:18.170718000 +0200
+@@ -395,8 +395,10 @@
+ if (flags & ACC_ABSTRACT) fprintf (stream, " abstract");
+ if (flags & ACC_STATIC) fprintf (stream, " static");
+ if (flags & ACC_FINAL) fprintf (stream, " final");
+- if (flags & ACC_TRANSIENT) fprintf (stream, " transient");
+- if (flags & ACC_VOLATILE) fprintf (stream, " volatile");
++ if (flags & ACC_TRANSIENT)
++ fprintf (stream, context == 'm' ? " varargs" : " transient");
++ if (flags & ACC_VOLATILE)
++ fprintf (stream, context == 'm' ? " bridge" : " volatile");
+ if (flags & ACC_NATIVE) fprintf (stream, " native");
+ if (flags & ACC_SYNCHRONIZED)
+ {
+@@ -405,8 +407,11 @@
+ else
+ fprintf (stream, " synchronized");
+ }
+- if (flags & ACC_INTERFACE) fprintf (stream, " interface");
++ if (flags & ACC_INTERFACE)
++ fprintf (stream, (flags & ACC_ANNOTATION) ? " @interface" : " interface");
++ if (flags & ACC_ENUM) fprintf (stream, " enum");
+ if (flags & ACC_STRICT) fprintf (stream, " strictfp");
++ if (flags & ACC_SYNTHETIC) fprintf (stream, " synthetic");
+ }
+
+
+diff -urN old/gcc/java/jcf.h src/gcc/java/jcf.h
+--- old/gcc/java/jcf.h 2005-09-06 04:25:00.000000000 +0200
++++ src/gcc/java/jcf.h 2006-08-28 19:14:18.170718000 +0200
+@@ -1,5 +1,5 @@
+ /* Utility macros to read Java(TM) .class files and byte codes.
+- Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
++ Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006
+ Free Software Foundation, Inc.
+
+ This file is part of GCC.
+@@ -165,9 +165,9 @@
+
+ #define JCF_FINISH(JCF) { \
+ CPOOL_FINISH(&(JCF)->cpool); \
+- if ((JCF)->buffer) FREE ((JCF)->buffer); \
+- if ((JCF)->filename) FREE ((char *) (JCF)->filename); \
+- if ((JCF)->classname) FREE ((char *) (JCF)->classname); \
++ if ((JCF)->buffer) free ((JCF)->buffer); \
++ if ((JCF)->filename) free ((char *) (JCF)->filename); \
++ if ((JCF)->classname) free ((char *) (JCF)->classname); \
+ (JCF)->finished = 1; }
+
+ #define CPOOL_INIT(CPOOL) \
+@@ -224,15 +224,20 @@
+ #define ACC_FINAL 0x0010
+ #define ACC_SYNCHRONIZED 0x0020
+ #define ACC_SUPER 0x0020
++#define ACC_BRIDGE 0x0040
+ #define ACC_VOLATILE 0x0040
+ #define ACC_TRANSIENT 0x0080
++#define ACC_VARARGS 0x0080
+ #define ACC_NATIVE 0x0100
+ #define ACC_INTERFACE 0x0200
+ #define ACC_ABSTRACT 0x0400
+ #define ACC_STRICT 0x0800
++#define ACC_SYNTHETIC 0x01000
++#define ACC_ANNOTATION 0x02000
++#define ACC_ENUM 0x04000
+ /* "Invisible" refers to Miranda methods inserted into an abstract
+- #class. It is also used in the runtime. */
+-#define ACC_INVISIBLE 0x1000
++ class. It is also used in the runtime. */
++#define ACC_INVISIBLE 0x8000
+
+ #define ACC_VISIBILITY (ACC_PUBLIC | ACC_PRIVATE | ACC_PROTECTED)
+
+diff -urN old/gcc/java/jcf-io.c src/gcc/java/jcf-io.c
+--- old/gcc/java/jcf-io.c 2005-09-30 02:33:26.000000000 +0200
++++ src/gcc/java/jcf-io.c 2006-08-28 19:14:18.170718000 +0200
+@@ -188,11 +188,11 @@
+ read_zip_member (JCF *jcf, ZipDirectory *zipd, ZipFile *zipf)
+ {
+ jcf->filbuf = jcf_unexpected_eof;
+- jcf->zipd = (void *)zipd;
++ jcf->zipd = zipd;
+
+ if (zipd->compression_method == Z_NO_COMPRESSION)
+ {
+- jcf->buffer = ALLOC (zipd->size);
++ jcf->buffer = XNEWVEC (unsigned char, zipd->size);
+ jcf->buffer_end = jcf->buffer + zipd->size;
+ jcf->read_ptr = jcf->buffer;
+ jcf->read_end = jcf->buffer_end;
+@@ -208,13 +208,13 @@
+ d_stream.zfree = (free_func) 0;
+ d_stream.opaque = (voidpf) 0;
+
+- jcf->buffer = ALLOC (zipd->uncompressed_size);
++ jcf->buffer = XNEWVEC (unsigned char, zipd->uncompressed_size);
+ d_stream.next_out = jcf->buffer;
+ d_stream.avail_out = zipd->uncompressed_size;
+ jcf->buffer_end = jcf->buffer + zipd->uncompressed_size;
+ jcf->read_ptr = jcf->buffer;
+ jcf->read_end = jcf->buffer_end;
+- buffer = ALLOC (zipd->size);
++ buffer = XNEWVEC (char, zipd->size);
+ d_stream.next_in = (unsigned char *) buffer;
+ d_stream.avail_in = zipd->size;
+ if (lseek (zipf->fd, zipd->filestart, 0) < 0
+@@ -225,7 +225,7 @@
+ inflateInit2 (&d_stream, -MAX_WBITS);
+ inflate (&d_stream, Z_NO_FLUSH);
+ inflateEnd (&d_stream);
+- FREE (buffer);
++ free (buffer);
+ }
+
+ return 0;
+@@ -246,7 +246,7 @@
+ if (dep_name != NULL)
+ jcf_dependency_add_file (dep_name, 0);
+ JCF_ZERO (jcf);
+- jcf->buffer = ALLOC (stat_buf.st_size);
++ jcf->buffer = XNEWVEC (unsigned char, stat_buf.st_size);
+ jcf->buffer_end = jcf->buffer + stat_buf.st_size;
+ jcf->read_ptr = jcf->buffer;
+ jcf->read_end = jcf->buffer_end;
+@@ -383,8 +383,7 @@
+ if (!*slot)
+ {
+ /* We have not already scanned this directory; scan it now. */
+- dent = ((memoized_dirlist_entry *)
+- ALLOC (sizeof (memoized_dirlist_entry)));
++ dent = XNEW (memoized_dirlist_entry);
+ dent->dir = xstrdup (filename);
+ /* Unfortunately, scandir is not fully standardized. In
+ particular, the type of the function pointer passed as the
+diff -urN old/gcc/java/jcf-parse.c src/gcc/java/jcf-parse.c
+--- old/gcc/java/jcf-parse.c 2006-03-16 20:17:42.000000000 +0100
++++ src/gcc/java/jcf-parse.c 2006-08-28 19:14:18.170718000 +0200
+@@ -120,7 +120,7 @@
+ else
+ {
+ /* Shouldn't happen. */
+- abort ();
++ gcc_unreachable ();
+ }
+ }
+
+@@ -160,7 +160,7 @@
+ /* Length of prefix, not counting final dot. */
+ int i = dot - class_name;
+ /* Concatenate current package prefix with new sfname. */
+- char *buf = xmalloc (i + new_len + 2); /* Space for '.' and '\0'. */
++ char *buf = XNEWVEC (char, i + new_len + 2); /* Space for '.' and '\0'. */
+ strcpy (buf + i + 1, sfname);
+ /* Copy package from class_name, replacing '.' by DIR_SEPARATOR.
+ Note we start at the end with the final package dot. */
+@@ -285,12 +285,12 @@
+ tree
+ parse_signature (JCF *jcf, int sig_index)
+ {
+- if (sig_index <= 0 || sig_index >= JPOOL_SIZE (jcf)
+- || JPOOL_TAG (jcf, sig_index) != CONSTANT_Utf8)
+- abort ();
+- else
+- return parse_signature_string (JPOOL_UTF_DATA (jcf, sig_index),
+- JPOOL_UTF_LENGTH (jcf, sig_index));
++ gcc_assert (sig_index > 0
++ && sig_index < JPOOL_SIZE (jcf)
++ && JPOOL_TAG (jcf, sig_index) == CONSTANT_Utf8);
++
++ return parse_signature_string (JPOOL_UTF_DATA (jcf, sig_index),
++ JPOOL_UTF_LENGTH (jcf, sig_index));
+ }
+
+ tree
+@@ -395,10 +395,7 @@
+ get_name_constant (JCF *jcf, int index)
+ {
+ tree name = get_constant (jcf, index);
+-
+- if (TREE_CODE (name) != IDENTIFIER_NODE)
+- abort ();
+-
++ gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE);
+ return name;
+ }
+
+@@ -445,10 +442,10 @@
+ static tree
+ give_name_to_class (JCF *jcf, int i)
+ {
+- if (i <= 0 || i >= JPOOL_SIZE (jcf)
+- || JPOOL_TAG (jcf, i) != CONSTANT_Class)
+- abort ();
+- else
++ gcc_assert (i > 0
++ && i < JPOOL_SIZE (jcf)
++ && JPOOL_TAG (jcf, i) == CONSTANT_Class);
++
+ {
+ tree package_name = NULL_TREE, tmp;
+ tree this_class;
+@@ -489,9 +486,9 @@
+ get_class_constant (JCF *jcf, int i)
+ {
+ tree type;
+- if (i <= 0 || i >= JPOOL_SIZE (jcf)
+- || (JPOOL_TAG (jcf, i) & ~CONSTANT_ResolvedFlag) != CONSTANT_Class)
+- abort ();
++ gcc_assert (i > 0
++ && i < JPOOL_SIZE (jcf)
++ && (JPOOL_TAG (jcf, i) & ~CONSTANT_ResolvedFlag) == CONSTANT_Class);
+
+ if (JPOOL_TAG (jcf, i) != CONSTANT_ResolvedClass)
+ {
+@@ -1084,7 +1081,7 @@
+ finput = fopen (main_input_filename, "r");
+ if (finput == NULL)
+ fatal_error ("can't open %s: %m", input_filename);
+- list = xmalloc(avail);
++ list = XNEWVEC (char, avail);
+ next = list;
+ for (;;)
+ {
+@@ -1351,7 +1348,7 @@
+ }
+
+ filename_length -= strlen (".class");
+- class_name = ALLOC (filename_length + 1);
++ class_name = XNEWVEC (char, filename_length + 1);
+ memcpy (class_name, class_name_in_zip_dir, filename_length);
+ class_name [filename_length] = '\0';
+
+@@ -1421,12 +1418,9 @@
+
+ CLASS_FROM_CURRENTLY_COMPILED_P (current_class) = 1;
+
+- if (TYPE_DUMMY (class))
+- {
+- /* This is a dummy class, and now we're compiling it
+- for real. */
+- abort ();
+- }
++ /* This is a dummy class, and now we're compiling it for
++ real. */
++ gcc_assert (! TYPE_DUMMY (class));
+
+ /* This is for a corner case where we have a superclass
+ but no superclass fields.
+@@ -1455,7 +1449,7 @@
+ if (TYPE_SIZE (current_class) != error_mark_node)
+ {
+ parse_class_file ();
+- FREE (current_jcf->buffer); /* No longer necessary */
++ free (current_jcf->buffer); /* No longer necessary */
+ /* Note: there is a way to free this buffer right after a
+ class seen in a zip file has been parsed. The idea is the
+ set its jcf in such a way that buffer will be reallocated
+@@ -1468,11 +1462,11 @@
+ {
+ char *file_name, *class_name_in_zip_dir, *buffer;
+ JCF *jcf;
+- file_name = ALLOC (zdir->filename_length + 1);
++ file_name = XNEWVEC (char, zdir->filename_length + 1);
+ class_name_in_zip_dir = ZIPDIR_FILENAME (zdir);
+ strncpy (file_name, class_name_in_zip_dir, zdir->filename_length);
+ file_name[zdir->filename_length] = '\0';
+- jcf = ALLOC (sizeof (JCF));
++ jcf = XNEW (JCF);
+ JCF_ZERO (jcf);
+ jcf->read_state = finput;
+ jcf->filbuf = jcf_filbuf_from_stdio;
+@@ -1484,7 +1478,7 @@
+ if (read_zip_member (jcf, zdir, localToFile) < 0)
+ fatal_error ("error while reading %s from zip file", file_name);
+
+- buffer = ALLOC (zdir->filename_length + 1 +
++ buffer = XNEWVEC (char, zdir->filename_length + 1 +
+ (jcf->buffer_end - jcf->buffer));
+ strcpy (buffer, file_name);
+ /* This is not a typo: we overwrite the trailing \0 of the
+@@ -1495,13 +1489,13 @@
+ compile_resource_data (file_name, buffer,
+ jcf->buffer_end - jcf->buffer);
+ JCF_FINISH (jcf);
+- FREE (jcf);
+- FREE (buffer);
++ free (jcf);
++ free (buffer);
+ }
+ break;
+
+ default:
+- abort ();
++ gcc_unreachable ();
+ }
+ }
+ }
+@@ -1529,7 +1523,7 @@
+ continue;
+
+ class_name = compute_class_name (zdir);
+- file_name = ALLOC (zdir->filename_length+1);
++ file_name = XNEWVEC (char, zdir->filename_length+1);
+ jcf = ggc_alloc (sizeof (JCF));
+ JCF_ZERO (jcf);
+
+diff -urN old/gcc/java/jcf-path.c src/gcc/java/jcf-path.c
+--- old/gcc/java/jcf-path.c 2005-06-25 02:33:05.000000000 +0200
++++ src/gcc/java/jcf-path.c 2006-08-28 19:14:18.170718000 +0200
+@@ -132,7 +132,7 @@
+ int len;
+ struct entry *n;
+
+- n = ALLOC (sizeof (struct entry));
++ n = XNEW (struct entry);
+ n->flags = is_system ? FLAG_SYSTEM : 0;
+ n->next = NULL;
+
+diff -urN old/gcc/java/jcf-write.c src/gcc/java/jcf-write.c
+--- old/gcc/java/jcf-write.c 2005-07-20 03:19:59.000000000 +0200
++++ src/gcc/java/jcf-write.c 2006-08-28 19:14:18.170718000 +0200
+@@ -1,5 +1,5 @@
+ /* Write out a Java(TM) class file.
+- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
++ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
+
+ This file is part of GCC.
+@@ -80,7 +80,7 @@
+ /* Macro to call each time we pop I words from the JVM stack. */
+
+ #define NOTE_POP(I) \
+- do { state->code_SP -= (I); if (state->code_SP < 0) abort(); } while (0)
++ do { state->code_SP -= (I); gcc_assert (state->code_SP >= 0); } while (0)
+
+ /* A chunk or segment of a .class file. */
+
+@@ -356,10 +356,8 @@
+ static int
+ CHECK_PUT (void *ptr, struct jcf_partial *state, int i)
+ {
+- if ((unsigned char *) ptr < state->chunk->data
+- || (unsigned char *) ptr + i > state->chunk->data + state->chunk->size)
+- abort ();
+-
++ gcc_assert ((unsigned char *) ptr >= state->chunk->data
++ && (unsigned char *) ptr + i <= state->chunk->data + state->chunk->size);
+ return 0;
+ }
+ #else
+@@ -406,9 +404,7 @@
+ static int
+ CHECK_OP (struct jcf_partial *state)
+ {
+- if (state->bytecode.ptr > state->bytecode.limit)
+- abort ();
+-
++ gcc_assert (state->bytecode.ptr <= state->bytecode.limit);
+ return 0;
+ }
+ #else
+@@ -609,15 +605,13 @@
+
+ info->end_label = end_label;
+
+- if (info->decl != decl)
+- abort ();
++ gcc_assert (info->decl == decl);
+ if (! really)
+ return;
+ ptr[0] = NULL;
+ if (wide)
+ {
+- if (ptr[1] != (struct localvar_info *)(~0))
+- abort ();
++ gcc_assert (ptr[1] == (struct localvar_info *) (~0));
+ ptr[1] = NULL;
+ }
+ }
+@@ -667,7 +661,7 @@
+ flags |= ACC_STRICT;
+ }
+ else
+- abort ();
++ gcc_unreachable ();
+
+ if (TREE_CODE (decl) == FUNCTION_DECL)
+ {
+@@ -827,7 +821,7 @@
+ return find_string_constant (&state->cpool, value);
+
+ else
+- abort ();
++ gcc_unreachable ();
+ }
+
+ /* Push 64-bit long constant on VM stack.
+@@ -881,9 +875,9 @@
+ case RECORD_TYPE: return 4;
+ case BOOLEAN_TYPE:
+ return TYPE_PRECISION (type) == 32 || max < 5 ? 0 : 5;
+- case CHAR_TYPE:
+- return TYPE_PRECISION (type) == 32 || max < 6 ? 0 : 6;
+ case INTEGER_TYPE:
++ if (type == char_type_node || type == promoted_char_type_node)
++ return TYPE_PRECISION (type) == 32 || max < 6 ? 0 : 6;
+ switch (TYPE_PRECISION (type))
+ {
+ case 8: return max < 5 ? 0 : 5;
+@@ -902,7 +896,7 @@
+ default:
+ break;
+ }
+- abort ();
++ gcc_unreachable ();
+ }
+
+ static void
+@@ -942,7 +936,7 @@
+ else if (offset == 2)
+ kind = size == 1 ? OPCODE_dup_x2 : OPCODE_dup2_x2;
+ else
+- abort();
++ gcc_unreachable ();
+ OP1 (kind);
+ NOTE_PUSH (size);
+ }
+@@ -1134,8 +1128,7 @@
+ generate_bytecode_conditional (TREE_OPERAND (exp, 2),
+ true_label, false_label,
+ true_branch_first, state);
+- if (state->code_SP != save_SP_after)
+- abort ();
++ gcc_assert (state->code_SP == save_SP_after);
+ }
+ break;
+ case TRUTH_NOT_EXPR:
+@@ -1243,7 +1236,8 @@
+ {
+ case EQ_EXPR: op = OPCODE_if_acmpeq; break;
+ case NE_EXPR: op = OPCODE_if_acmpne; break;
+- default: abort();
++ default:
++ gcc_unreachable ();
+ }
+ if (integer_zerop (exp1) || integer_zerop (exp0))
+ {
+@@ -1333,8 +1327,7 @@
+ }
+ break;
+ }
+- if (save_SP != state->code_SP)
+- abort ();
++ gcc_assert (save_SP == state->code_SP);
+ }
+
+ /* Call pending cleanups i.e. those for surrounding TRY_FINALLY_EXPRs.
+@@ -1496,8 +1489,7 @@
+ if (target == IGNORE_TARGET) ; /* do nothing */
+ else if (TREE_CODE (type) == POINTER_TYPE)
+ {
+- if (! integer_zerop (exp))
+- abort();
++ gcc_assert (integer_zerop (exp));
+ RESERVE(1);
+ OP1 (OPCODE_aconst_null);
+ NOTE_PUSH (1);
+@@ -1729,7 +1721,7 @@
+ unsigned HOST_WIDE_INT delta;
+ /* Copy the chain of relocs into a sorted array. */
+ struct jcf_relocation **relocs
+- = xmalloc (sw_state.num_cases * sizeof (struct jcf_relocation *));
++ = XNEWVEC (struct jcf_relocation *, sw_state.num_cases);
+ /* The relocs arrays is a buffer with a gap.
+ The assumption is that cases will normally come in "runs". */
+ int gap_start = 0;
+@@ -1834,7 +1826,7 @@
+ if (exp == NULL_TREE)
+ exp = build_java_empty_stmt ();
+ else if (TREE_CODE (exp) != MODIFY_EXPR)
+- abort ();
++ gcc_unreachable ();
+ else
+ exp = TREE_OPERAND (exp, 1);
+ generate_bytecode_return (exp, state);
+@@ -1848,8 +1840,7 @@
+ end_label->u.labeled_block = exp;
+ if (LABELED_BLOCK_BODY (exp))
+ generate_bytecode_insns (LABELED_BLOCK_BODY (exp), target, state);
+- if (state->labeled_blocks != end_label)
+- abort();
++ gcc_assert (state->labeled_blocks == end_label);
+ state->labeled_blocks = end_label->next;
+ define_jcf_label (end_label, state);
+ }
+@@ -1957,7 +1948,7 @@
+ offset = 0;
+ }
+ else
+- abort ();
++ gcc_unreachable ();
+
+ if (target != IGNORE_TARGET && post_op)
+ emit_dup (size, offset, state);
+@@ -2081,7 +2072,7 @@
+ NOTE_PUSH (TYPE_IS_WIDE (TREE_TYPE (lhs)) ? 2 : 1);
+ }
+ else
+- abort ();
++ gcc_unreachable ();
+
+ /* This function correctly handles the case where the LHS
+ of a binary expression is NULL_TREE. */
+@@ -2127,7 +2118,7 @@
+ NOTE_POP (TYPE_IS_WIDE (TREE_TYPE (exp)) ? 4 : 3);
+ }
+ else
+- abort ();
++ gcc_unreachable ();
+ break;
+ case PLUS_EXPR:
+ jopcode = OPCODE_iadd;
+@@ -2313,8 +2304,7 @@
+ struct jcf_block *end_label; /* End of try clause. */
+ struct jcf_block *finished_label = gen_jcf_label (state);
+ tree clause = TREE_OPERAND (exp, 1);
+- if (target != IGNORE_TARGET)
+- abort ();
++ gcc_assert (target == IGNORE_TARGET);
+ generate_bytecode_insns (try_clause, IGNORE_TARGET, state);
+ end_label = get_jcf_label_here (state);
+ if (end_label == start_label)
+@@ -2369,8 +2359,7 @@
+
+ if (CAN_COMPLETE_NORMALLY (finally))
+ {
+- if (state->labeled_blocks != finally_label)
+- abort();
++ gcc_assert (state->labeled_blocks == finally_label);
+ state->labeled_blocks = finally_label->next;
+ }
+ end_label = get_jcf_label_here (state);
+@@ -2517,8 +2506,7 @@
+ tree op0 = TREE_OPERAND (exp, 0);
+ tree op1 = TREE_OPERAND (exp, 1);
+ tree x;
+- if (TREE_SIDE_EFFECTS (op0) || TREE_SIDE_EFFECTS (op1))
+- abort ();
++ gcc_assert (! TREE_SIDE_EFFECTS (op0) && ! TREE_SIDE_EFFECTS (op1));
+ x = build3 (COND_EXPR, TREE_TYPE (exp),
+ build2 (code, boolean_type_node, op0, op1),
+ op0, op1);
+@@ -2622,32 +2610,40 @@
+ tree context = DECL_CONTEXT (f);
+ int index, interface = 0;
+ RESERVE (5);
++
++ /* If the method is not static, use the qualifying type.
++ However, don't use the qualifying type if the method
++ was declared in Object. */
++ if (! METHOD_STATIC (f)
++ && ! DECL_CONSTRUCTOR_P (f)
++ && ! METHOD_PRIVATE (f)
++ && DECL_CONTEXT (f) != object_type_node)
++ {
++ tree arg1 = TREE_VALUE (TREE_OPERAND (exp, 1));
++ context = TREE_TYPE (TREE_TYPE (arg1));
++ }
++
+ if (METHOD_STATIC (f))
+ OP1 (OPCODE_invokestatic);
+ else if (DECL_CONSTRUCTOR_P (f) || CALL_USING_SUPER (exp)
+- || METHOD_PRIVATE (f))
++ || METHOD_PRIVATE (f))
+ OP1 (OPCODE_invokespecial);
+ else
+ {
+ if (CLASS_INTERFACE (TYPE_NAME (context)))
+- {
+- tree arg1 = TREE_VALUE (TREE_OPERAND (exp, 1));
+- context = TREE_TYPE (TREE_TYPE (arg1));
+- if (CLASS_INTERFACE (TYPE_NAME (context)))
+- interface = 1;
+- }
++ interface = 1;
+ if (interface)
+ OP1 (OPCODE_invokeinterface);
+ else
+ OP1 (OPCODE_invokevirtual);
+ }
+- index = find_methodref_with_class_index (&state->cpool, f, context);
++
++ index = find_methodref_with_class_index (&state->cpool, f,
++ context);
+ OP2 (index);
+ if (interface)
+ {
+- if (nargs <= 0)
+- abort ();
+-
++ gcc_assert (nargs > 0);
+ OP1 (nargs);
+ OP1 (0);
+ }
+@@ -2863,8 +2859,7 @@
+ *--new_ptr = - reloc->kind;
+ }
+ }
+- if (new_ptr != chunk->data)
+- abort ();
++ gcc_assert (new_ptr == chunk->data);
+ }
+ state->code_length = pc;
+ }
+@@ -3125,8 +3120,7 @@
+ generate_bytecode_insns (body, IGNORE_TARGET, state);
+ if (CAN_COMPLETE_NORMALLY (body))
+ {
+- if (TREE_CODE (TREE_TYPE (type)) != VOID_TYPE)
+- abort();
++ gcc_assert (TREE_CODE (TREE_TYPE (type)) == VOID_TYPE);
+ RESERVE (1);
+ OP1 (OPCODE_return);
+ }
+@@ -3473,7 +3467,7 @@
+ slash = dname + strlen (dname);
+ }
+
+- r = xmalloc (slash - dname + strlen (cname) + 2);
++ r = XNEWVEC (char, slash - dname + strlen (cname) + 2);
+ strncpy (r, dname, slash - dname);
+ r[slash - dname] = sep;
+ strcpy (&r[slash - dname + 1], cname);
+@@ -3522,11 +3516,15 @@
+ {
+ FILE *stream;
+ char *temporary_file_name;
++ char pid [sizeof (long) * 2 + 2];
+
+- /* The .class file is initially written to a ".tmp" file so that
++ /* The .class file is initially written to a ".PID" file so that
+ if multiple instances of the compiler are running at once
+- they do not see partially formed class files. */
+- temporary_file_name = concat (class_file_name, ".tmp", NULL);
++ they do not see partially formed class files nor override
++ each other, which may happen in libjava with parallel build.
++ */
++ sprintf (pid, ".%lx", (unsigned long) getpid ());
++ temporary_file_name = concat (class_file_name, pid, NULL);
+ stream = fopen (temporary_file_name, "wb");
+ if (stream == NULL)
+ fatal_error ("can't open %s for writing: %m", temporary_file_name);
+@@ -3548,7 +3546,9 @@
+
+ if (rename (temporary_file_name, class_file_name) == -1)
+ {
++ int errno_saved = errno;
+ remove (temporary_file_name);
++ errno = errno_saved;
+ fatal_error ("can't create %s: %m", class_file_name);
+ }
+ free (temporary_file_name);
+diff -urN old/gcc/java/jvgenmain.c src/gcc/java/jvgenmain.c
+--- old/gcc/java/jvgenmain.c 2005-06-25 02:33:05.000000000 +0200
++++ src/gcc/java/jvgenmain.c 2006-08-28 19:14:18.170718000 +0200
+@@ -127,11 +127,11 @@
+ }
+ fprintf (stream, " 0\n};\n\n");
+
+- fprintf (stream, "extern int %s;\n", mangled_classname);
+ fprintf (stream, "int main (int argc, const char **argv)\n");
+ fprintf (stream, "{\n");
+ fprintf (stream, " _Jv_Compiler_Properties = props;\n");
+- fprintf (stream, " JvRunMain (&%s, argc, argv);\n", mangled_classname);
++ fprintf (stream, " extern void *%s;\n", mangled_classname);
++ fprintf (stream, " JvRunMain (%s, argc, argv);\n", mangled_classname);
+ fprintf (stream, "}\n");
+ if (stream != stdout && fclose (stream) != 0)
+ {
+@@ -153,16 +153,16 @@
+
+ for (ptr = string; *ptr; ptr++ )
+ {
+- if (ptr[0] == '.')
++ if (*ptr == '.')
+ {
+- append_gpp_mangled_name (&ptr [-count], count);
++ append_gpp_mangled_name (ptr - count, count);
+ count = 0;
+ }
+ else
+ count++;
+ }
+ append_gpp_mangled_name (&ptr [-count], count);
+- obstack_grow (mangle_obstack, "6class$E", 8);
++ obstack_grow (mangle_obstack, "7class$$E", strlen ("7class$$E"));
+ obstack_1grow (mangle_obstack, '\0');
+ return obstack_finish (mangle_obstack);
+ }
+diff -urN old/gcc/java/jvspec.c src/gcc/java/jvspec.c
+--- old/gcc/java/jvspec.c 2005-07-13 18:44:37.000000000 +0200
++++ src/gcc/java/jvspec.c 2006-08-28 19:14:18.170718000 +0200
+@@ -90,7 +90,7 @@
+ int x;
+ struct stat sb;
+
+- spec = xmalloc (strlen (dir) + sizeof (SPEC_FILE)
++ spec = XNEWVEC (char, strlen (dir) + sizeof (SPEC_FILE)
+ + sizeof ("-specs=") + 4);
+ strcpy (spec, "-specs=");
+ x = strlen (spec);
+@@ -243,11 +243,14 @@
+ /* The argument we use to specify the spec file. */
+ char *spec_file = NULL;
+
++ /* If linking, nonzero if the BC-ABI is in use. */
++ int link_for_bc_abi = 0;
++
+ argc = *in_argc;
+ argv = *in_argv;
+ added_libraries = *in_added_libraries;
+
+- args = xcalloc (argc, sizeof (int));
++ args = XCNEWVEC (int, argc);
+
+ for (i = 1; i < argc; i++)
+ {
+@@ -365,6 +368,11 @@
+ else if (strcmp (argv[i], "-static-libgcc") == 0
+ || strcmp (argv[i], "-static") == 0)
+ shared_libgcc = 0;
++ else if (strcmp (argv[i], "-findirect-dispatch") == 0
++ || strcmp (argv[i], "--indirect-dispatch") == 0)
++ {
++ link_for_bc_abi = 1;
++ }
+ else
+ /* Pass other options through. */
+ continue;
+@@ -490,7 +498,9 @@
+
+ num_args += shared_libgcc;
+
+- arglist = xmalloc ((num_args + 1) * sizeof (char *));
++ num_args += link_for_bc_abi;
++
++ arglist = XNEWVEC (const char *, num_args + 1);
+ j = 0;
+
+ arglist[j++] = argv[0];
+@@ -599,6 +609,9 @@
+ if (shared_libgcc)
+ arglist[j++] = "-shared-libgcc";
+
++ if (link_for_bc_abi)
++ arglist[j++] = "-s-bc-abi";
++
+ arglist[j] = NULL;
+
+ *in_argc = j;
+diff -urN old/gcc/java/lang.c src/gcc/java/lang.c
+--- old/gcc/java/lang.c 2006-03-31 15:05:32.000000000 +0200
++++ src/gcc/java/lang.c 2006-08-28 19:14:18.170718000 +0200
+@@ -346,7 +346,7 @@
+ default:
+ if (cl_options[code].flags & CL_Java)
+ break;
+- abort();
++ gcc_unreachable ();
+ }
+
+ return 1;
+@@ -368,6 +368,9 @@
+ if (flag_indirect_dispatch)
+ always_initialize_class_p = true;
+
++ if (!flag_indirect_dispatch)
++ flag_indirect_classes = false;
++
+ /* Force minimum function alignment if g++ uses the least significant
+ bit of function pointers to store the virtual bit. This is required
+ to keep vtables compatible. */
+@@ -412,7 +415,7 @@
+ if (decl_buf == NULL)
+ {
+ decl_buflen = len + 100;
+- decl_buf = xmalloc (decl_buflen);
++ decl_buf = XNEWVEC (char, decl_buflen);
+ }
+ else
+ {
+@@ -615,6 +618,15 @@
+ if (! flag_indirect_dispatch)
+ flag_verify_invocations = true;
+
++ if (flag_reduced_reflection)
++ {
++ if (flag_indirect_dispatch)
++ error ("-findirect-dispatch is incompatible "
++ "with -freduced-reflection");
++ if (flag_jni)
++ error ("-fjni is incompatible with -freduced-reflection");
++ }
++
+ /* Open input file. */
+
+ if (filename == 0 || !strcmp (filename, "-"))
+@@ -642,7 +654,7 @@
+ error ("couldn't determine target name for dependency tracking");
+ else
+ {
+- char *buf = xmalloc (dot - filename +
++ char *buf = XNEWVEC (char, dot - filename +
+ 3 + sizeof (TARGET_OBJECT_SUFFIX));
+ strncpy (buf, filename, dot - filename);
+
+@@ -788,8 +800,7 @@
+ /* See if we have remapped this declaration. If we haven't there's
+ a bug in the inliner. */
+ n = splay_tree_lookup (decl_map, (splay_tree_key) ite->value);
+- if (! n)
+- abort ();
++ gcc_assert (n);
+
+ /* Create a new entry for the class and its remapped boolean
+ variable. If we already have a mapping for this class we've
+diff -urN old/gcc/java/lang.opt src/gcc/java/lang.opt
+--- old/gcc/java/lang.opt 2006-05-17 20:38:58.000000000 +0200
++++ src/gcc/java/lang.opt 2006-08-28 19:14:18.170718000 +0200
+@@ -119,7 +119,7 @@
+ Java Joined RejectNegative
+
+ femit-class-file
+-Java Var(flag_emit_class_files) VarExists
++Java Var(flag_emit_class_files)
+ Output a class file
+
+ femit-class-files
+@@ -146,6 +146,10 @@
+ Java Var(flag_hash_synchronization)
+ Assume the runtime uses a hash table to map an object to its synchronization structure
+
++findirect-classes
++Java Var(flag_indirect_classes) Init(1)
++Generate instances of Class at runtime
++
+ findirect-dispatch
+ Java Var(flag_indirect_dispatch)
+ Use offset tables for virtual method calls
+@@ -164,6 +168,10 @@
+ foutput-class-dir=
+ Java Joined RejectNegative
+
++freduced-reflection
++Java Var(flag_reduced_reflection)
++Reduce the amount of reflection meta-data generated
++
+ fstore-check
+ Java Var(flag_store_check) Init(1)
+ Enable assignability checks for stores into object arrays
+diff -urN old/gcc/java/lex.c src/gcc/java/lex.c
+--- old/gcc/java/lex.c 2005-08-16 20:46:18.000000000 +0200
++++ src/gcc/java/lex.c 2006-08-28 19:14:18.180718000 +0200
+@@ -162,7 +162,7 @@
+ java_lexer *
+ java_new_lexer (FILE *finput, const char *encoding)
+ {
+- java_lexer *lex = xmalloc (sizeof (java_lexer));
++ java_lexer *lex = XNEW (java_lexer);
+ int enc_error = 0;
+
+ lex->finput = finput;
+diff -urN old/gcc/java/lex.h src/gcc/java/lex.h
+--- old/gcc/java/lex.h 2005-06-25 02:33:05.000000000 +0200
++++ src/gcc/java/lex.h 2006-08-28 19:14:18.180718000 +0200
+@@ -200,7 +200,7 @@
+ /* Special ways to report error on numeric literals */
+ #define JAVA_FLOAT_RANGE_ERROR(m) \
+ { \
+- char *msg = xmalloc (100 + strlen (m)); \
++ char *msg = XNEWVEC (char, 100 + strlen (m)); \
+ sprintf (msg, "Floating point literal exceeds range of `%s'", (m)); \
+ JAVA_RANGE_ERROR(msg); \
+ free (msg); \
+diff -urN old/gcc/java/mangle.c src/gcc/java/mangle.c
+--- old/gcc/java/mangle.c 2005-06-25 02:33:05.000000000 +0200
++++ src/gcc/java/mangle.c 2006-08-28 19:14:18.180718000 +0200
+@@ -79,6 +79,9 @@
+ void
+ java_mangle_decl (tree decl)
+ {
++ if (TREE_CODE (decl) == RECORD_TYPE)
++ mangle_type (decl);
++
+ /* A copy of the check from the beginning of lhd_set_decl_assembler_name.
+ Only FUNCTION_DECLs and VAR_DECLs for variables with static storage
+ duration need a real DECL_ASSEMBLER_NAME. */
+@@ -99,7 +102,7 @@
+ {
+ if (DECL_CLASS_FIELD_P (decl))
+ {
+- mangle_class_field (DECL_CONTEXT (decl));
++ mangle_class_field (decl);
+ break;
+ }
+ else if (DECL_VTABLE_P (decl))
+@@ -130,10 +133,14 @@
+ /* Beginning of the helper functions */
+
+ static void
+-mangle_class_field (tree type)
++mangle_class_field (tree decl)
+ {
++ tree type = DECL_CONTEXT (decl);
+ mangle_record_type (type, /* for_pointer = */ 0);
+- MANGLE_RAW_STRING ("6class$");
++ if (TREE_CODE (TREE_TYPE (decl)) == RECORD_TYPE)
++ MANGLE_RAW_STRING ("6class$");
++ else
++ MANGLE_RAW_STRING ("7class$$");
+ obstack_1grow (mangle_obstack, 'E');
+ }
+
+@@ -188,6 +195,14 @@
+ if (TREE_CODE (TREE_TYPE (mdecl)) == METHOD_TYPE)
+ arglist = TREE_CHAIN (arglist);
+
++ /* Output literal 'J' and mangle the return type IF not a
++ constructor. */
++ if (!ID_INIT_P (method_name))
++ {
++ obstack_1grow (mangle_obstack, 'J');
++ mangle_type(TREE_TYPE(TREE_TYPE(mdecl)));
++ }
++
+ /* No arguments is easy. We shortcut it. */
+ if (arglist == end_params_node)
+ obstack_1grow (mangle_obstack, 'v');
+@@ -221,7 +236,7 @@
+ append_gpp_mangled_name (IDENTIFIER_POINTER (name),
+ IDENTIFIER_LENGTH (name));
+
+- /* If NAME happens to be a C++ keyword, add `$'. */
++ /* If NAME happens to be a C++ keyword, add `$'. */
+ if (cxx_keyword_p (IDENTIFIER_POINTER (name), IDENTIFIER_LENGTH (name)))
+ obstack_1grow (mangle_obstack, '$');
+ }
+@@ -235,9 +250,13 @@
+ {
+ char code;
+ case BOOLEAN_TYPE: code = 'b'; goto primitive;
+- case CHAR_TYPE: code = 'w'; goto primitive;
+ case VOID_TYPE: code = 'v'; goto primitive;
+ case INTEGER_TYPE:
++ if (type == char_type_node || type == promoted_char_type_node)
++ {
++ code = 'w';
++ goto primitive;
++ }
+ /* Get the original type instead of the arguments promoted type.
+ Avoid symbol name clashes. Should call a function to do that.
+ FIXME. */
+@@ -272,7 +291,7 @@
+ break;
+ bad_type:
+ default:
+- abort ();
++ gcc_unreachable ();
+ }
+ }
+
+@@ -389,8 +408,7 @@
+ #define ADD_N() \
+ do { obstack_1grow (mangle_obstack, 'N'); nadded_p = 1; } while (0)
+
+- if (TREE_CODE (type) != RECORD_TYPE)
+- abort ();
++ gcc_assert (TREE_CODE (type) == RECORD_TYPE);
+
+ if (!TYPE_PACKAGE_LIST (type))
+ set_type_package_list (type);
+@@ -442,8 +460,7 @@
+ /* This didn't work. We start by mangling the pointed-to type */
+ pointer_type = type;
+ type = TREE_TYPE (type);
+- if (TREE_CODE (type) != RECORD_TYPE)
+- abort ();
++ gcc_assert (TREE_CODE (type) == RECORD_TYPE);
+
+ obstack_1grow (mangle_obstack, 'P');
+ if (mangle_record_type (type, /* for_pointer = */ 1))
+@@ -465,8 +482,7 @@
+ int match;
+
+ type = TREE_TYPE (p_type);
+- if (!type)
+- abort ();
++ gcc_assert (type);
+
+ elt_type = TYPE_ARRAY_ELEMENT (type);
+
+diff -urN old/gcc/java/parse.h src/gcc/java/parse.h
+--- old/gcc/java/parse.h 2005-09-06 04:25:00.000000000 +0200
++++ src/gcc/java/parse.h 2006-08-28 19:14:18.180718000 +0200
+@@ -196,8 +196,7 @@
+ /* Types classification, according to the JLS, section 4.2 */
+ #define JFLOAT_TYPE_P(TYPE) (TYPE && TREE_CODE ((TYPE)) == REAL_TYPE)
+ #define JINTEGRAL_TYPE_P(TYPE) ((TYPE) \
+- && (TREE_CODE ((TYPE)) == INTEGER_TYPE \
+- || TREE_CODE ((TYPE)) == CHAR_TYPE))
++ && (TREE_CODE ((TYPE)) == INTEGER_TYPE))
+ #define JNUMERIC_TYPE_P(TYPE) ((TYPE) \
+ && (JFLOAT_TYPE_P ((TYPE)) \
+ || JINTEGRAL_TYPE_P ((TYPE))))
+diff -urN old/gcc/java/parse-scan.y src/gcc/java/parse-scan.y
+--- old/gcc/java/parse-scan.y 2005-07-13 00:35:03.000000000 +0200
++++ src/gcc/java/parse-scan.y 2006-08-28 19:14:18.180718000 +0200
+@@ -105,7 +105,7 @@
+ };
+ #define NEW_METHOD_DECLARATOR(D,N,A) \
+ { \
+- (D) = xmalloc (sizeof (struct method_declarator)); \
++ (D) = XNEW (struct method_declarator); \
+ (D)->method_name = (N); \
+ (D)->args = (A); \
+ }
+@@ -498,7 +498,7 @@
+ if (bracket_count)
+ {
+ int i;
+- char *n = xmalloc (bracket_count + 1 + strlen ($$));
++ char *n = XNEWVEC (char, bracket_count + 1 + strlen ($$));
+ for (i = 0; i < bracket_count; ++i)
+ n[i] = '[';
+ strcpy (n + bracket_count, $$);
+@@ -512,7 +512,7 @@
+ if (bracket_count)
+ {
+ int i;
+- char *n = xmalloc (bracket_count + 1 + strlen ($2));
++ char *n = XNEWVEC (char, bracket_count + 1 + strlen ($2));
+ for (i = 0; i < bracket_count; ++i)
+ n[i] = '[';
+ strcpy (n + bracket_count, $2);
+@@ -1175,10 +1175,10 @@
+ void
+ java_push_parser_context (void)
+ {
+- struct parser_ctxt *new = xcalloc (1, sizeof (struct parser_ctxt));
++ struct parser_ctxt *tmp = XCNEW (struct parser_ctxt);
+
+- new->next = ctxp;
+- ctxp = new;
++ tmp->next = ctxp;
++ ctxp = tmp;
+ }
+
+ static void
+@@ -1186,7 +1186,7 @@
+ {
+ struct class_context *ctx;
+
+- ctx = xmalloc (sizeof (struct class_context));
++ ctx = XNEW (struct class_context);
+ ctx->name = (char *) name;
+ ctx->next = current_class_context;
+ current_class_context = ctx;
+diff -urN old/gcc/java/parse.y src/gcc/java/parse.y
+--- old/gcc/java/parse.y 2006-03-30 18:47:23.000000000 +0200
++++ src/gcc/java/parse.y 2006-08-28 19:17:32.320718000 +0200
+@@ -1,6 +1,6 @@
+ /* Source code parsing and tree node generation for the GNU compiler
+ for the Java(TM) language.
+- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
++ Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
+ Contributed by Alexandre Petit-Bianco (apbianco@cygnus.com)
+
+@@ -134,7 +134,7 @@
+ static int invocation_mode (tree, int);
+ static tree find_applicable_accessible_methods_list (int, tree, tree, tree);
+ static void search_applicable_methods_list (int, tree, tree, tree, tree *, tree *);
+-static tree find_most_specific_methods_list (tree);
++static tree find_most_specific_methods_list (tree, tree);
+ static int argument_types_convertible (tree, tree);
+ static tree patch_invoke (tree, tree, tree);
+ static int maybe_use_access_method (int, tree *, tree *);
+@@ -8010,7 +8010,8 @@
+ }
+
+ /* Analyzes a method body and look for something that isn't a
+- MODIFY_EXPR with a constant value. */
++ MODIFY_EXPR with a constant value. Return true if is
++ needed, false otherwise. */
+
+ static int
+ analyze_clinit_body (tree this_class, tree bbody)
+@@ -8049,6 +8050,11 @@
+ || ! DECL_INITIAL (TREE_OPERAND (bbody, 0))
+ || DECL_CONTEXT (TREE_OPERAND (bbody, 0)) != this_class);
+
++ case NOP_EXPR:
++ /* We might see an empty statement here, which is
++ ignorable. */
++ return ! IS_EMPTY_STMT (bbody);
++
+ default:
+ return 1;
+ }
+@@ -11037,8 +11043,14 @@
+ switch (invocation_mode (method, CALL_USING_SUPER (patch)))
+ {
+ case INVOKE_VIRTUAL:
+- dtable = invoke_build_dtable (0, args);
+- func = build_invokevirtual (dtable, method);
++ {
++ tree signature = build_java_signature (TREE_TYPE (method));
++ tree special;
++ maybe_rewrite_invocation (&method, &args, &signature, &special);
++
++ dtable = invoke_build_dtable (0, args);
++ func = build_invokevirtual (dtable, method, special);
++ }
+ break;
+
+ case INVOKE_NONVIRTUAL:
+@@ -11060,9 +11072,11 @@
+ case INVOKE_STATIC:
+ {
+ tree signature = build_java_signature (TREE_TYPE (method));
++ tree special;
++ maybe_rewrite_invocation (&method, &args, &signature, &special);
+ func = build_known_method_ref (method, TREE_TYPE (method),
+ DECL_CONTEXT (method),
+- signature, args);
++ signature, args, special);
+ }
+ break;
+
+@@ -11247,7 +11261,7 @@
+ /* Find all candidates and then refine the list, searching for the
+ most specific method. */
+ list = find_applicable_accessible_methods_list (lc, class, name, atl);
+- list = find_most_specific_methods_list (list);
++ list = find_most_specific_methods_list (list, class);
+ if (list && !TREE_CHAIN (list))
+ return TREE_VALUE (list);
+
+@@ -11439,7 +11453,7 @@
+ /* 15.11.2.2 Choose the Most Specific Method */
+
+ static tree
+-find_most_specific_methods_list (tree list)
++find_most_specific_methods_list (tree list, tree class)
+ {
+ int max = 0;
+ int abstract, candidates;
+@@ -11462,8 +11476,23 @@
+ /* Compare arguments and location where methods where declared */
+ if (argument_types_convertible (method_v, current_v))
+ {
++ /* We have a rather odd special case here. The front
++ end doesn't properly implement inheritance, so we
++ work around it here. The idea is, if we are
++ comparing a method declared in a class to one
++ declared in an interface, and the invocation's
++ qualifying class is a class (and not an interface),
++ then we consider the method's class to be the
++ qualifying class of the invocation. This lets us
++ fake the result of ordinary inheritance. */
++ tree context_v = DECL_CONTEXT (current_v);
++ if (TYPE_INTERFACE_P (DECL_CONTEXT (method_v))
++ && ! TYPE_INTERFACE_P (context_v)
++ && ! TYPE_INTERFACE_P (class))
++ context_v = class;
++
+ if (valid_method_invocation_conversion_p
+- (DECL_CONTEXT (method_v), DECL_CONTEXT (current_v)))
++ (DECL_CONTEXT (method_v), context_v))
+ {
+ int v = (DECL_SPECIFIC_COUNT (current_v) += 1);
+ max = (v > max ? v : max);
+@@ -12375,7 +12404,18 @@
+ how to handle those cases. */
+ wfl_op1 = TREE_OPERAND (node, 0);
+ CAN_COMPLETE_NORMALLY (node) = 1;
+- TREE_OPERAND (node, 0) = java_complete_tree (wfl_op1);
++ if (TREE_CODE (node) == PREDECREMENT_EXPR
++ || TREE_CODE (node) == PREINCREMENT_EXPR
++ || TREE_CODE (node) == POSTDECREMENT_EXPR
++ || TREE_CODE (node) == POSTINCREMENT_EXPR)
++ { /* We don't want static finals to be resolved to their value
++ to avoid ICEing later. It solves PR8923. */
++ TREE_OPERAND (node, 0) = java_complete_lhs (wfl_op1);
++ }
++ else
++ {
++ TREE_OPERAND (node, 0) = java_complete_tree (wfl_op1);
++ }
+ if (TREE_OPERAND (node, 0) == error_mark_node)
+ return error_mark_node;
+ node = patch_unaryop (node, wfl_op1);
+@@ -13335,8 +13375,7 @@
+ do_unary_numeric_promotion (tree arg)
+ {
+ tree type = TREE_TYPE (arg);
+- if ((TREE_CODE (type) == INTEGER_TYPE && TYPE_PRECISION (type) < 32)
+- || TREE_CODE (type) == CHAR_TYPE)
++ if (TREE_CODE (type) == INTEGER_TYPE && TYPE_PRECISION (type) < 32)
+ arg = convert (int_type_node, arg);
+ return arg;
+ }
+@@ -14195,6 +14234,14 @@
+ /* Store the location of the operator, for better error report. The
+ string of the operator will be rebuild based on the OP value. */
+ EXPR_WFL_LINECOL (node) = op_location;
++
++ /* Report an error if the operand is a constant. */
++ if (TREE_CONSTANT (op1)) {
++ parse_error_context (node, "%qs cannot be used with a constant",
++ operator_string (node));
++ return error_mark_node;
++ }
++
+ return node;
+ }
+
+@@ -14349,7 +14396,7 @@
+ error_found = 1;
+ }
+
+- /* From now on, we know that op if a variable and that it has a
++ /* From now on, we know that op is a variable and that it has a
+ valid wfl. We use wfl_op to locate errors related to the
+ ++/-- operand. */
+ if (!JNUMERIC_TYPE_P (op_type))
+diff -urN old/gcc/java/resource.c src/gcc/java/resource.c
+--- old/gcc/java/resource.c 2005-06-25 02:33:05.000000000 +0200
++++ src/gcc/java/resource.c 2006-08-28 19:14:18.190718000 +0200
+@@ -145,7 +145,7 @@
+ perror ("Could not figure length of resource file");
+ return;
+ }
+- buffer = xmalloc (strlen (name) + stat_buf.st_size);
++ buffer = XNEWVEC (char, strlen (name) + stat_buf.st_size);
+ strcpy (buffer, name);
+ read (fd, buffer + strlen (name), stat_buf.st_size);
+ close (fd);
+diff -urN old/gcc/java/typeck.c src/gcc/java/typeck.c
+--- old/gcc/java/typeck.c 2005-09-18 21:10:15.000000000 +0200
++++ src/gcc/java/typeck.c 2006-08-28 19:14:18.190718000 +0200
+@@ -55,8 +55,7 @@
+ int max_locals = DECL_MAX_LOCALS(current_function_decl);
+ int nslots = TYPE_IS_WIDE (type) ? 2 : 1;
+
+- if (slot < 0 || slot + nslots - 1 >= max_locals)
+- abort ();
++ gcc_assert (slot >= 0 && (slot + nslots - 1 < max_locals));
+
+ type_map[slot] = type;
+ while (--nslots > 0)
+@@ -126,10 +125,12 @@
+ return error_mark_node;
+ if (code == VOID_TYPE)
+ return build1 (CONVERT_EXPR, type, expr);
+- if (code == BOOLEAN_TYPE || code == CHAR_TYPE)
++ if (code == BOOLEAN_TYPE)
+ return fold_convert (type, expr);
+ if (code == INTEGER_TYPE)
+ {
++ if (type == char_type_node || type == promoted_char_type_node)
++ return fold_convert (type, expr);
+ if ((really_constant_p (expr)
+ || (! flag_unsafe_math_optimizations
+ && ! flag_emit_class_files))
+@@ -384,9 +385,11 @@
+ else
+ strcpy (suffix, "[]");
+ TYPE_NAME (t)
++ = TYPE_STUB_DECL (t)
+ = build_decl (TYPE_DECL,
+ identifier_subst (el_name, "", '.', '.', suffix),
+ t);
++ TYPE_DECL_SUPPRESS_DEBUG (TYPE_STUB_DECL (t)) = true;
+ }
+
+ set_java_signature (t, sig);
+@@ -431,11 +434,9 @@
+ if (type == boolean_type_node)
+ return promoted_boolean_type_node;
+ goto handle_int;
+- case CHAR_TYPE:
++ case INTEGER_TYPE:
+ if (type == char_type_node)
+ return promoted_char_type_node;
+- goto handle_int;
+- case INTEGER_TYPE:
+ handle_int:
+ if (TYPE_PRECISION (type) < TYPE_PRECISION (int_type_node))
+ {
+@@ -458,9 +459,7 @@
+ parse_signature_type (const unsigned char **ptr, const unsigned char *limit)
+ {
+ tree type;
+-
+- if (*ptr >= limit)
+- abort ();
++ gcc_assert (*ptr < limit);
+
+ switch (**ptr)
+ {
+@@ -484,8 +483,7 @@
+ const unsigned char *str = start;
+ for ( ; ; str++)
+ {
+- if (str >= limit)
+- abort ();
++ gcc_assert (str < limit);
+ if (*str == ';')
+ break;
+ }
+@@ -494,7 +492,7 @@
+ break;
+ }
+ default:
+- abort ();
++ gcc_unreachable ();
+ }
+ return promote_type (type);
+ }
+@@ -605,9 +603,13 @@
+ switch (TREE_CODE (type))
+ {
+ case BOOLEAN_TYPE: sg[0] = 'Z'; goto native;
+- case CHAR_TYPE: sg[0] = 'C'; goto native;
+ case VOID_TYPE: sg[0] = 'V'; goto native;
+ case INTEGER_TYPE:
++ if (type == char_type_node || type == promoted_char_type_node)
++ {
++ sg[0] = 'C';
++ goto native;
++ }
+ switch (TYPE_PRECISION (type))
+ {
+ case 8: sg[0] = 'B'; goto native;
+@@ -662,7 +664,7 @@
+ break;
+ bad_type:
+ default:
+- abort ();
++ gcc_unreachable ();
+ }
+ TYPE_SIGNATURE (type) = sig;
+ }
+diff -urN old/gcc/java/verify-glue.c src/gcc/java/verify-glue.c
+--- old/gcc/java/verify-glue.c 2005-06-25 02:33:05.000000000 +0200
++++ src/gcc/java/verify-glue.c 2006-08-28 19:14:18.190718000 +0200
+@@ -1,5 +1,5 @@
+ /* Glue to interface gcj with bytecode verifier.
+- Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
++ Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+@@ -252,8 +252,7 @@
+ vfy_get_primitive_char (vfy_jclass klass)
+ {
+ tree sig;
+- if (! vfy_is_primitive (klass))
+- abort ();
++ gcc_assert (vfy_is_primitive (klass));
+ sig = build_java_signature (klass);
+ return (IDENTIFIER_POINTER (sig))[0];
+ }
+@@ -296,8 +295,7 @@
+ vfy_get_component_type (vfy_jclass klass)
+ {
+ vfy_jclass k;
+- if (! vfy_is_array (klass))
+- abort ();
++ gcc_assert (vfy_is_array (klass));
+ k = TYPE_ARRAY_ELEMENT (klass);
+ if (TREE_CODE (k) == POINTER_TYPE)
+ k = TREE_TYPE (k);
+@@ -331,6 +329,12 @@
+ }
+
+ vfy_jclass
++vfy_class_type (void)
++{
++ return class_type_node;
++}
++
++vfy_jclass
+ vfy_string_type (void)
+ {
+ vfy_jclass k;
+diff -urN old/gcc/java/verify.h src/gcc/java/verify.h
+--- old/gcc/java/verify.h 2005-06-25 02:33:05.000000000 +0200
++++ src/gcc/java/verify.h 2006-08-28 19:14:18.190718000 +0200
+@@ -1,5 +1,5 @@
+ /* Declarations to interface gcj with bytecode verifier.
+- Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
++ Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+@@ -112,6 +112,7 @@
+ bool vfy_is_abstract (vfy_jclass klass);
+ vfy_jclass vfy_find_class (vfy_jclass klass, vfy_string name);
+ vfy_jclass vfy_object_type (void);
++vfy_jclass vfy_class_type (void);
+ vfy_jclass vfy_string_type (void);
+ vfy_jclass vfy_throwable_type (void);
+ vfy_jclass vfy_unsuitable_type (void);
+diff -urN old/gcc/java/verify-impl.c src/gcc/java/verify-impl.c
+--- old/gcc/java/verify-impl.c 2005-07-22 09:31:32.000000000 +0200
++++ src/gcc/java/verify-impl.c 2006-08-28 19:14:18.190718000 +0200
+@@ -1,4 +1,4 @@
+-/* Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation
++/* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation
+
+ This file is part of libgcj.
+
+@@ -1975,6 +1975,10 @@
+ init_type_from_tag (&t, int_type);
+ else if (vfy_tag (pool, index) == JV_CONSTANT_Float)
+ init_type_from_tag (&t, float_type);
++ else if (vfy_tag (pool, index) == JV_CONSTANT_Class
++ || vfy_tag (pool, index) == JV_CONSTANT_ResolvedClass)
++ /* FIXME: should only allow this for 1.5 bytecode. */
++ init_type_from_class (&t, vfy_class_type ());
+ else
+ verify_fail_pc ("String, int, or float constant expected", vfr->start_PC);
+ return t;
+@@ -2887,9 +2891,11 @@
+ invalidate_pc ();
+ break;
+ case op_return:
+- /* We only need to check this when the return type is
+- void, because all instance initializers return void. */
+- if (this_is_init)
++ /* We only need to check this when the return type is void,
++ because all instance initializers return void. We also
++ need to special-case Object constructors, as they can't
++ call a superclass . */
++ if (this_is_init && vfr->current_class != vfy_object_type ())
+ state_check_this_initialized (vfr->current_state);
+ check_return_type (make_type (void_type));
+ invalidate_pc ();
+@@ -3178,7 +3184,7 @@
+ return vfy_object_type ();
+ }
+
+- abort ();
++ gcc_unreachable ();
+ }
+
+ static void
+@@ -3220,8 +3226,7 @@
+ vfy_unsuitable_type ());
+ }
+ }
+- if (slot != curr->stackdepth)
+- abort ();
++ gcc_assert (slot == curr->stackdepth);
+ }
+ }
+
+diff -urN old/gcc/java/zextract.c src/gcc/java/zextract.c
+--- old/gcc/java/zextract.c 2005-11-08 20:10:39.000000000 +0100
++++ src/gcc/java/zextract.c 2006-08-28 19:14:18.190718000 +0200
+@@ -308,9 +308,8 @@
+ }
+ zipf->count = makeword((const uch *) &buffer[TOTAL_ENTRIES_CENTRAL_DIR]);
+ zipf->dir_size = makelong((const uch *) &buffer[SIZE_CENTRAL_DIRECTORY]);
+-#define ALLOC xmalloc
+ /* Allocate 1 more to allow appending '\0' to last filename. */
+- zipf->central_directory = ALLOC (zipf->dir_size+1);
++ zipf->central_directory = XNEWVEC (char, zipf->dir_size + 1);
+ if (lseek (zipf->fd, -(zipf->dir_size+ECREC_SIZE+4), SEEK_CUR) < 0)
+ return -2;
+ if (read (zipf->fd, zipf->central_directory, zipf->dir_size) < 0)
+diff -urN old/include/ChangeLog src/include/ChangeLog
+--- old/include/ChangeLog 2007-02-14 06:12:30.000000000 +0100
++++ src/include/ChangeLog 2007-02-14 23:23:36.000000000 +0100
+@@ -1,3 +1,9 @@
++2005-12-10 Terry Laurenzo
++
++ PR java/9861
++ * demangle.h : Add DMGL_RET_POSTFIX define to enable alternative
++ output format for return types
++
+ 2007-02-13 Release Manager
+
+ * GCC 4.1.2 released.
+diff -urN old/include/demangle.h src/include/demangle.h
+--- old/include/demangle.h 2005-05-26 01:29:54.000000000 +0200
++++ src/include/demangle.h 2006-08-28 19:24:44.300718000 +0200
+@@ -35,6 +35,8 @@
+ #define DMGL_JAVA (1 << 2) /* Demangle as Java rather than C++. */
+ #define DMGL_VERBOSE (1 << 3) /* Include implementation details. */
+ #define DMGL_TYPES (1 << 4) /* Also try to demangle type encodings. */
++#define DMGL_RET_POSTFIX (1 << 5) /* Print function return types (when
++ present) after function signature */
+
+ #define DMGL_AUTO (1 << 8)
+ #define DMGL_GNU (1 << 9)
+diff -urN old/libiberty/ChangeLog src/libiberty/ChangeLog
+--- old/libiberty/ChangeLog 2007-02-14 06:12:35.000000000 +0100
++++ src/libiberty/ChangeLog 2007-02-14 23:20:44.000000000 +0100
+@@ -14,6 +14,20 @@
+ * pex-msdos.c (pex_msdos_exec_child): Likewise.
+ * pex-win32.c (pex_win32_exec_child): Likewise.
+
++2005-12-10 Terry Laurenzo
++
++ PR java/9861
++ * cp-demangle.c (d_bare_function_type): Recognize new 'J' qualifer
++ and include return type when found.
++ (d_print_comp)[DEMANGLE_COMPONENT_FUNCTION_TYPE]: Add
++ conditional logic to change printing order of return type.when
++ the DMGL_RET_POSTFIX option is present.
++ (java_demangle_v3): Add DMGL_RET_POSTFIX option to d_demangle
++ call.
++ * testsuite/test-demangle.c (main): Recognize option --ret-postfix
++ * testsuite/demangle-expected: Test cases to verify extended encoding.
++ Updated comment to document --ret-postfix option.
++
+ 2006-07-04 Peter O'Gorman
+
+ * Makefile.in: chmod 644 before ranlib during install.
+diff -urN old/libiberty/cp-demangle.c src/libiberty/cp-demangle.c
+--- old/libiberty/cp-demangle.c 2005-07-01 18:39:36.000000000 +0200
++++ src/libiberty/cp-demangle.c 2006-08-28 19:24:44.300718000 +0200
+@@ -1939,7 +1939,7 @@
+ return ret;
+ }
+
+-/* ::= + */
++/* ::= [J]+ */
+
+ static struct demangle_component *
+ d_bare_function_type (struct d_info *di, int has_return_type)
+@@ -1947,13 +1947,22 @@
+ struct demangle_component *return_type;
+ struct demangle_component *tl;
+ struct demangle_component **ptl;
++ char peek;
++
++ /* Detect special qualifier indicating that the first argument
++ is the return type. */
++ peek = d_peek_char (di);
++ if (peek == 'J')
++ {
++ d_advance (di, 1);
++ has_return_type = 1;
++ }
+
+ return_type = NULL;
+ tl = NULL;
+ ptl = &tl;
+ while (1)
+ {
+- char peek;
+ struct demangle_component *type;
+
+ peek = d_peek_char (di);
+@@ -3025,13 +3034,16 @@
+
+ case DEMANGLE_COMPONENT_FUNCTION_TYPE:
+ {
++ if ((dpi->options & DMGL_RET_POSTFIX) != 0)
++ d_print_function_type (dpi, dc, dpi->modifiers);
++
++ /* Print return type if present */
+ if (d_left (dc) != NULL)
+ {
+ struct d_print_mod dpm;
+
+ /* We must pass this type down as a modifier in order to
+ print it in the right location. */
+-
+ dpm.next = dpi->modifiers;
+ dpi->modifiers = &dpm;
+ dpm.mod = dc;
+@@ -3045,10 +3057,14 @@
+ if (dpm.printed)
+ return;
+
+- d_append_char (dpi, ' ');
++ /* In standard prefix notation, there is a space between the
++ return type and the function signature. */
++ if ((dpi->options & DMGL_RET_POSTFIX) == 0)
++ d_append_char (dpi, ' ');
+ }
+
+- d_print_function_type (dpi, dc, dpi->modifiers);
++ if ((dpi->options & DMGL_RET_POSTFIX) == 0)
++ d_print_function_type (dpi, dc, dpi->modifiers);
+
+ return;
+ }
+@@ -4003,7 +4019,8 @@
+ char *from;
+ char *to;
+
+- demangled = d_demangle (mangled, DMGL_JAVA | DMGL_PARAMS, &alc);
++ demangled = d_demangle (mangled, DMGL_JAVA | DMGL_PARAMS | DMGL_RET_POSTFIX,
++ &alc);
+
+ if (demangled == NULL)
+ return NULL;
+diff -urN old/libiberty/testsuite/demangle-expected src/libiberty/testsuite/demangle-expected
+--- old/libiberty/testsuite/demangle-expected 2005-07-01 18:39:36.000000000 +0200
++++ src/libiberty/testsuite/demangle-expected 2006-08-28 19:24:44.300718000 +0200
+@@ -11,6 +11,7 @@
+ # --is-v3-ctor Calls is_gnu_v3_mangled_ctor on input; expected
+ # output is an integer representing ctor_kind.
+ # --is-v3-dtor Likewise, but for dtors.
++# --ret-postfix Passes the DMGL_RET_POSTFIX option
+ #
+ # For compatibility, just in case it matters, the options line may be
+ # empty, to mean --format=auto. If it doesn't start with --, then it
+@@ -3781,3 +3782,26 @@
+ --format=java
+ _ZGAN4java4lang5Class7forNameEPNS0_6StringE
+ hidden alias for java.lang.Class.forName(java.lang.String)
++#
++# Test cases to verify encoding that determines if a return type is present
++# Related to PR9861
++--format=java
++_ZN4java4lang4Math4acosEJdd
++java.lang.Math.acos(double)double
++#
++--format=auto
++_ZN4java4lang4Math4acosEJdd
++double java::lang::Math::acos(double)
++#
++--format=auto
++_ZN4java4lang4Math4acosEJvd
++void java::lang::Math::acos(double)
++#
++--format=auto --ret-postfix
++_ZN4java4lang4Math4acosEJdd
++java::lang::Math::acos(double)double
++#
++--format=gnu-v3 --no-params --ret-postfix
++_Z4makeI7FactoryiET_IT0_Ev
++make()Factory
++make
+diff -urN old/libiberty/testsuite/test-demangle.c src/libiberty/testsuite/test-demangle.c
+--- old/libiberty/testsuite/test-demangle.c 2005-08-17 05:31:04.000000000 +0200
++++ src/libiberty/testsuite/test-demangle.c 2006-08-28 19:24:44.300718000 +0200
+@@ -114,6 +114,7 @@
+ --is-v3-ctor Calls is_gnu_v3_mangled_ctor on input; expected
+ output is an integer representing ctor_kind.
+ --is-v3-dtor Likewise, but for dtors.
++ --ret-postfix Passes the DMGL_RET_POSTFIX option
+
+ For compatibility, just in case it matters, the options line may be
+ empty, to mean --format=auto. If it doesn't start with --, then it
+@@ -129,6 +130,7 @@
+ int no_params;
+ int is_v3_ctor;
+ int is_v3_dtor;
++ int ret_postfix;
+ struct line format;
+ struct line input;
+ struct line expect;
+@@ -158,6 +160,7 @@
+ tests++;
+
+ no_params = 0;
++ ret_postfix = 0;
+ is_v3_ctor = 0;
+ is_v3_dtor = 0;
+ if (format.data[0] == '\0')
+@@ -212,6 +215,8 @@
+ is_v3_ctor = 1;
+ else if (strcmp (opt, "--is-v3-dtor") == 0)
+ is_v3_dtor = 1;
++ else if (strcmp (opt, "--ret-postfix") == 0)
++ ret_postfix = 1;
+ else
+ {
+ printf ("FAIL at line %d: unrecognized option %s\n",
+@@ -255,7 +260,8 @@
+ cplus_demangle_set_style (style);
+
+ result = cplus_demangle (input.data,
+- DMGL_PARAMS|DMGL_ANSI|DMGL_TYPES);
++ DMGL_PARAMS|DMGL_ANSI|DMGL_TYPES
++ |(ret_postfix ? DMGL_RET_POSTFIX : 0));
+
+ if (result
+ ? strcmp (result, expect.data)
+diff -urN old/libjava/aclocal.m4 src/libjava/aclocal.m4
+--- old/libjava/aclocal.m4 2006-05-25 01:46:15.000000000 +0200
++++ src/libjava/aclocal.m4 2006-08-28 19:17:33.360718000 +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
++ [AM_AUTOMAKE_VERSION([1.9.6])])
+
+-# Copyright (C) 2001, 2003 Free Software Foundation, Inc.
++# AM_AUX_DIR_EXPAND -*- 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) 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.
++# AM_CONDITIONAL -*- 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) 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 -*-
++# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+-# Copyright (C) 1999, 2000, 2001, 2002, 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.
++# 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,25 +340,14 @@
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+ ])
+
+-# Check for Java compiler.
++# Check for Java compiler. -*- Autoconf -*-
+ # For now we only handle the GNU compiler.
+
+-# Copyright (C) 1999, 2000, 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) 1999, 2000, 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.
+
+ AC_DEFUN([AM_PROG_GCJ],[
+ AC_CHECK_PROGS(GCJ, gcj, gcj)
+@@ -426,30 +359,19 @@
+ _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES(GCJ)])
+ ])
+
+-# 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.
++# Do all the work for Automake. -*- Autoconf -*-
+
+-# 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])
+@@ -551,54 +473,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)])
+
+-# 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])
+@@ -617,26 +516,15 @@
+
+ AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
+
+-# Check to see how 'make' treats includes. -*- Autoconf -*-
+-
+-# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
++# Check to see how 'make' treats includes. -*- 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) 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()
+ # -----------------
+@@ -680,29 +568,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
+@@ -720,27 +596,16 @@
+ fi
+ ])
+
+-# -*- Autoconf -*-
+-
+-
+-# 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.
++# Fake the existence of programs that GNU maintainers use. -*- 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, 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
++# serial 4
+
+ # AM_MISSING_PROG(NAME, PROGRAM)
+ # ------------------------------
+@@ -766,27 +631,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).
+@@ -840,26 +694,15 @@
+ fi
+ AC_SUBST([mkdir_p])])
+
+-# Helper functions for option handling. -*- Autoconf -*-
+-
+-# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
++# Helper functions for option handling. -*- 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) 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)
+ # -----------------------
+@@ -884,28 +727,16 @@
+ AC_DEFUN([_AM_IF_OPTION],
+ [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+-#
+-# Check to make sure that the build environment is sane.
+-#
++# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+-# 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.
+-
+-# 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
+ # ---------------
+@@ -948,25 +779,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
+@@ -989,25 +809,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)
+ # --------------------
+diff -urN old/libjava/bc-version src/libjava/bc-version
+--- old/libjava/bc-version 1970-01-01 01:00:00.000000000 +0100
++++ src/libjava/bc-version 2006-08-28 19:14:18.290718000 +0200
+@@ -0,0 +1,6 @@
++# This file is used to maintain libtool version info for libgcj-bc. See
++# the libtool manual to understand the meaning of the fields. This is
++# a separate file so that version updates don't involve re-running
++# automake.
++# CURRENT:REVISION:AGE
++1:0:0
+diff -urN old/libjava/boehm.cc src/libjava/boehm.cc
+--- old/libjava/boehm.cc 2005-06-25 00:14:03.000000000 +0200
++++ src/libjava/boehm.cc 2006-08-28 19:17:33.320718000 +0200
+@@ -1,6 +1,6 @@
+ // boehm.cc - interface between libjava and Boehm GC.
+
+-/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
++/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ Free Software Foundation
+
+ This file is part of libgcj.
+@@ -26,6 +26,18 @@
+ #undef TRUE
+ #undef FALSE
+
++// We include two autoconf headers. Avoid multiple definition warnings.
++#undef PACKAGE_NAME
++#undef PACKAGE_STRING
++#undef PACKAGE_TARNAME
++#undef PACKAGE_VERSION
++
++#ifdef HAVE_DLFCN_H
++#undef _GNU_SOURCE
++#define _GNU_SOURCE
++#include
++#endif
++
+ extern "C"
+ {
+ #include
+@@ -58,6 +70,8 @@
+ // Freelist used for Java arrays.
+ static void **array_free_list;
+
++static int _Jv_GC_has_static_roots (const char *filename, void *, size_t);
++
+
+
+ // This is called by the GC during the mark phase. It marks a Java
+@@ -85,14 +99,14 @@
+ jclass klass = dt->clas;
+ GC_PTR p;
+
++ p = (GC_PTR) dt;
++ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, obj);
++
+ # ifndef JV_HASH_SYNCHRONIZATION
+ // Every object has a sync_info pointer.
+ p = (GC_PTR) obj->sync_info;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, obj);
+ # endif
+- // Mark the object's class.
+- p = (GC_PTR) klass;
+- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, obj);
+
+ if (__builtin_expect (klass == &java::lang::Class::class$, false))
+ {
+@@ -114,25 +128,10 @@
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
+ p = (GC_PTR) c->superclass;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
+- for (int i = 0; i < c->constants.size; ++i)
+- {
+- /* FIXME: We could make this more precise by using the tags -KKT */
+- p = (GC_PTR) c->constants.data[i].p;
+- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
+- }
+
+-#ifdef INTERPRETER
+- if (_Jv_IsInterpretedClass (c))
+- {
+- p = (GC_PTR) c->constants.tags;
+- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
+- p = (GC_PTR) c->constants.data;
+- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
+- }
+-#endif
+-
+- // The vtable might be allocated even for compiled code.
+- p = (GC_PTR) c->vtable;
++ p = (GC_PTR) c->constants.tags;
++ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
++ p = (GC_PTR) c->constants.data;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
+
+ // If the class is an array, then the methods field holds a
+@@ -141,101 +140,24 @@
+ p = (GC_PTR) c->methods;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
+
+- // The vtable might have been set, but the rest of the class
+- // could still be uninitialized. If this is the case, then
+- // c.isArray will SEGV. We check for this, and if it is the
+- // case we just return.
+- if (__builtin_expect (c->name == NULL, false))
+- return mark_stack_ptr;
+-
+- if (! c->isArray() && ! c->isPrimitive())
+- {
+- // Scan each method in the cases where `methods' really
+- // points to a methods structure.
+- for (int i = 0; i < c->method_count; ++i)
+- {
+- p = (GC_PTR) c->methods[i].name;
+- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
+- p = (GC_PTR) c->methods[i].signature;
+- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
+-
+- // Note that we don't have to mark each individual throw
+- // separately, as these are stored in the constant pool.
+- p = (GC_PTR) c->methods[i].throws;
+- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
+- }
+- }
+-
+- // Mark all the fields.
+ p = (GC_PTR) c->fields;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
+- for (int i = 0; i < c->field_count; ++i)
+- {
+- _Jv_Field* field = &c->fields[i];
+-
+- p = (GC_PTR) field->name;
+- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
+- p = (GC_PTR) field->type;
+- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
+-
+- // For the interpreter, we also need to mark the memory
+- // containing static members
+- if ((field->flags & java::lang::reflect::Modifier::STATIC))
+- {
+- p = (GC_PTR) field->u.addr;
+- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
+-
+- // also, if the static member is a reference,
+- // mark also the value pointed to. We check for isResolved
+- // since marking can happen before memory is allocated for
+- // static members.
+- // Note that field->u.addr may be null if the class c is
+- // JV_STATE_LOADED but not JV_STATE_PREPARED (initialized).
+- // Note also that field->type could be NULL in some
+- // situations, for instance if the class has state
+- // JV_STATE_ERROR.
+- if (field->type && JvFieldIsRef (field)
+- && p && field->isResolved())
+- {
+- jobject val = *(jobject*) p;
+- p = (GC_PTR) val;
+- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
+- }
+- }
+- }
+
++ // The vtable might be allocated even for compiled code.
+ p = (GC_PTR) c->vtable;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
++
+ p = (GC_PTR) c->interfaces;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
+- for (int i = 0; i < c->interface_count; ++i)
+- {
+- p = (GC_PTR) c->interfaces[i];
+- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
+- }
+ p = (GC_PTR) c->loader;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
+
+ // The dispatch tables can be allocated at runtime.
+ p = (GC_PTR) c->ancestors;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
+- if (c->idt)
+- {
+- p = (GC_PTR) c->idt;
+- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
+
+- if (c->isInterface())
+- {
+- p = (GC_PTR) c->idt->iface.ioffsets;
+- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c->idt);
+- }
+- else if (! c->isPrimitive())
+- {
+- // This field is only valid for ordinary classes.
+- p = (GC_PTR) c->idt->cls.itable;
+- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c->idt);
+- }
+- }
++ p = (GC_PTR) c->idt;
++ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
+
+ p = (GC_PTR) c->arrayclass;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
+@@ -246,72 +168,10 @@
+ p = (GC_PTR) c->aux_info;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
+
+-#ifdef INTERPRETER
+- if (_Jv_IsInterpretedClass (c) && c->aux_info)
+- {
+- _Jv_InterpClass* ic = (_Jv_InterpClass*) c->aux_info;
+-
+- p = (GC_PTR) ic->interpreted_methods;
+- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, ic);
+-
+- p = (GC_PTR) ic->source_file_name;
+- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, ic);
+-
+- for (int i = 0; i < c->method_count; i++)
+- {
+- // The interpreter installs a heap-allocated trampoline
+- // here, so we'll mark it.
+- p = (GC_PTR) c->methods[i].ncode;
+- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
+-
+- using namespace java::lang::reflect;
+-
+- // Mark the direct-threaded code. Note a subtlety here:
+- // when we add Miranda methods to a class, we don't
+- // resize its interpreted_methods array. If we try to
+- // reference one of these methods, we may crash.
+- // However, we know these are all abstract, and we know
+- // that abstract methods have nothing useful in this
+- // array. So, we skip all abstract methods to avoid the
+- // problem. FIXME: this is pretty obscure, it may be
+- // better to add a methods to the execution engine and
+- // resize the array.
+- if ((c->methods[i].accflags & Modifier::ABSTRACT) != 0)
+- continue;
+-
+- p = (GC_PTR) ic->interpreted_methods[i];
+- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, ic);
+-
+- if ((c->methods[i].accflags & Modifier::NATIVE) != 0)
+- {
+- _Jv_JNIMethod *jm
+- = (_Jv_JNIMethod *) ic->interpreted_methods[i];
+- if (jm)
+- {
+- p = (GC_PTR) jm->jni_arg_types;
+- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, p);
+- }
+- }
+- else
+- {
+- _Jv_InterpMethod *im
+- = (_Jv_InterpMethod *) ic->interpreted_methods[i];
+- if (im)
+- {
+- p = (GC_PTR) im->line_table;
+- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, ic);
+- p = (GC_PTR) im->prepared;
+- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, ic);
+- }
+- }
+- }
+-
+- p = (GC_PTR) ic->field_initializers;
+- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, ic);
+-
+- }
+-#endif
+-
++ // The class chain must be marked for runtime-allocated Classes
++ // loaded by the bootstrap ClassLoader.
++ p = (GC_PTR) c->next_or_version;
++ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
+ }
+ else
+ {
+@@ -364,17 +224,16 @@
+ // we may need to round up the size.
+ if (__builtin_expect (! dt || !(dt -> get_finalizer()), false))
+ return mark_stack_ptr;
+- jclass klass = dt->clas;
+ GC_PTR p;
+
++ p = (GC_PTR) dt;
++ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, array);
++
+ # ifndef JV_HASH_SYNCHRONIZATION
+ // Every object has a sync_info pointer.
+ p = (GC_PTR) array->sync_info;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, array);
+ # endif
+- // Mark the object's class.
+- p = (GC_PTR) klass;
+- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, &(dt -> clas));
+
+ for (int i = 0; i < JvGetArrayLength (array); ++i)
+ {
+@@ -515,7 +374,7 @@
+ void *
+ _Jv_AllocRawObj (jsize size)
+ {
+- return (void *) GC_MALLOC (size);
++ return (void *) GC_MALLOC (size ? size : 1);
+ }
+
+ static void
+@@ -622,10 +481,21 @@
+ _Jv_InitGC (void)
+ {
+ int proc;
++ static bool gc_initialized;
++
++ if (gc_initialized)
++ return;
++
++ gc_initialized = 1;
+
+ // Ignore pointers that do not point to the start of an object.
+ GC_all_interior_pointers = 0;
+
++#if defined (HAVE_DLFCN_H) && defined (HAVE_DLADDR)
++ // Tell the collector to ask us before scanning DSOs.
++ GC_register_has_static_roots_callback (_Jv_GC_has_static_roots);
++#endif
++
+ // Configure the collector to use the bitmap marking descriptors that we
+ // stash in the class vtable.
+ // We always use mark proc descriptor 0, since the compiler knows
+@@ -713,3 +583,133 @@
+ // For now, always reclaim soft references. FIXME.
+ return true;
+ }
++
++
++
++#if defined (HAVE_DLFCN_H) && defined (HAVE_DLADDR)
++
++// We keep a store of the filenames of DSOs that need to be
++// conservatively scanned by the garbage collector. During collection
++// the gc calls _Jv_GC_has_static_roots() to see if the data segment
++// of a DSO should be scanned.
++typedef struct filename_node
++{
++ char *name;
++ struct filename_node *link;
++} filename_node;
++
++#define FILENAME_STORE_SIZE 17
++static filename_node *filename_store[FILENAME_STORE_SIZE];
++
++// Find a filename in filename_store.
++static filename_node **
++find_file (const char *filename)
++{
++ int index = strlen (filename) % FILENAME_STORE_SIZE;
++ filename_node **node = &filename_store[index];
++
++ while (*node)
++ {
++ if (strcmp ((*node)->name, filename) == 0)
++ return node;
++ node = &(*node)->link;
++ }
++
++ return node;
++}
++
++// Print the store of filenames of DSOs that need collection.
++void
++_Jv_print_gc_store (void)
++{
++ for (int i = 0; i < FILENAME_STORE_SIZE; i++)
++ {
++ filename_node *node = filename_store[i];
++ while (node)
++ {
++ fprintf (stderr, "%s\n", node->name);
++ node = node->link;
++ }
++ }
++}
++
++// Create a new node in the store of libraries to collect.
++static filename_node *
++new_node (const char *filename)
++{
++ filename_node *node = (filename_node*)_Jv_Malloc (sizeof (filename_node));
++ node->name = (char *)_Jv_Malloc (strlen (filename) + 1);
++ node->link = NULL;
++ strcpy (node->name, filename);
++
++ return node;
++}
++
++// Nonzero if the gc should scan this lib.
++static int
++_Jv_GC_has_static_roots (const char *filename, void *, size_t)
++{
++ if (filename == NULL || strlen (filename) == 0)
++ // No filename; better safe than sorry.
++ return 1;
++
++ filename_node **node = find_file (filename);
++ if (*node)
++ return 1;
++
++ return 0;
++}
++
++#endif
++
++// Register the DSO that contains p for collection.
++void
++_Jv_RegisterLibForGc (const void *p __attribute__ ((__unused__)))
++{
++#if defined (HAVE_DLFCN_H) && defined (HAVE_DLADDR)
++ Dl_info info;
++
++ if (dladdr (const_cast(p), &info) != 0)
++ {
++ filename_node **node = find_file (info.dli_fname);
++ if (! *node)
++ *node = new_node (info.dli_fname);
++ }
++#endif
++}
++
++void
++_Jv_SuspendThread (_Jv_Thread_t *thread)
++{
++#if defined(GC_PTHREADS) && !defined(GC_SOLARIS_THREADS) \
++ && !defined(GC_WIN32_THREADS) && !defined(GC_DARWIN_THREADS)
++ GC_suspend_thread (_Jv_GetPlatformThreadID (thread));
++#endif
++}
++
++void
++_Jv_ResumeThread (_Jv_Thread_t *thread)
++{
++#if defined(GC_PTHREADS) && !defined(GC_SOLARIS_THREADS) \
++ && !defined(GC_WIN32_THREADS) && !defined(GC_DARWIN_THREADS)
++ GC_resume_thread (_Jv_GetPlatformThreadID (thread));
++#endif
++}
++
++void
++_Jv_GCAttachThread ()
++{
++ // The registration interface is only defined on posixy systems and
++ // only actually works if pthread_getattr_np is defined.
++#ifdef HAVE_PTHREAD_GETATTR_NP
++ GC_register_my_thread ();
++#endif
++}
++
++void
++_Jv_GCDetachThread ()
++{
++#ifdef HAVE_PTHREAD_GETATTR_NP
++ GC_unregister_my_thread ();
++#endif
++}
+diff -urN old/libjava/ChangeLog src/libjava/ChangeLog
+--- old/libjava/ChangeLog 2007-02-14 06:13:13.000000000 +0100
++++ src/libjava/ChangeLog 2007-02-14 23:37:48.000000000 +0100
+@@ -1,12 +1,666 @@
+-2007-02-13 Release Manager
++2006-08-22 Thomas Fitzsimmons
+
+- * GCC 4.1.2 released.
++ PR libgcj/27890
++ * gnu/classpath/natSystemProperties.cc (insertSystemProperties):
++ Set gnu.classpath.home.url to TOOLEXECLIBDIR.
++ * configure.ac: Do not add --with-native-libdir to
++ ac_configure_args.
++ * java/security/libgcj.security: Remove file.
++ * java/util/logging/logging.properties: Likewise.
++ * classpath/m4/acinclude.m4 (CLASSPATH_TOOLEXECLIBDIR): New macro.
++ * classpath/resource/Makefile.am (loggingdir): Define to
++ toolexeclibdir.
++ (securitydir): Likewise.
++ * classpath/configure.ac: Call CLASSPATH_TOOLEXECLIBDIR.
++ Set default nativeexeclibdir using toolexeclibdir.
++ * HACKING: Fix classpath aclocal arguments.
++ * Makefile.am (secdir): Remove variable.
++ (propdir): Likewise.
++ (AM_CXXFLAGS): Replace LIBDIR definition with TOOLEXECLIBDIR
++ definition.
++ (all_property_files): Remove variable.
++ (install-data-local): Do not install libgcj.security or
++ logging.properties.
++ * configure, Makefile.in, classpath/configure,
++ classpath/Makefile.in, classpath/native/jni/java-lang/Makefile.in,
++ classpath/native/jni/midi-alsa/Makefile.in,
++ classpath/native/jni/classpath/Makefile.in,
++ classpath/native/jni/midi-dssi/Makefile.in,
++ classpath/native/jni/Makefile.in,
++ classpath/native/jni/java-nio/Makefile.in,
++ classpath/native/jni/java-net/Makefile.in,
++ classpath/native/jni/gconf-peer/Makefile.in,
++ classpath/native/jni/java-io/Makefile.in,
++ classpath/native/jni/xmlj/Makefile.in,
++ classpath/native/jni/java-util/Makefile.in,
++ classpath/native/jni/qt-peer/Makefile.in,
++ classpath/native/jni/gtk-peer/Makefile.in,
++ classpath/native/Makefile.in, classpath/native/jawt/Makefile.in,
++ classpath/native/target/Linux/Makefile.in,
++ classpath/native/target/Makefile.in,
++ classpath/native/target/generic/Makefile.in,
++ classpath/native/fdlibm/Makefile.in,
++ classpath/native/plugin/Makefile.in,
++ classpath/resource/Makefile.in, classpath/scripts/Makefile.in,
++ classpath/tools/Makefile.in, classpath/doc/Makefile.in,
++ classpath/doc/api/Makefile.in, classpath/lib/Makefile.in,
++ classpath/external/Makefile.in,
++ classpath/external/sax/Makefile.in,
++ classpath/external/w3c_dom/Makefile.in,
++ classpath/external/relaxngDatatype/Makefile.in,
++ classpath/include/Makefile.in, classpath/aclocal.m4,
++ classpath/examples/Makefile.in, aclocal.m4: Regenerate.
++
++2006-08-21 Bryce McKinlay
++
++ * java/lang/natThread.cc (_Jv_AttachCurrentThread): Attach thread
++ to GC.
++ (_Jv_DetachCurrentThread): Detach thread from GC.
++ * include/boehm-gc.h (_Jv_GCAttachThread, _Jv_GCDetachThread):
++ Declare.
++ * boehm.cc (_Jv_GCAttachThread): New function.
++ (_Jv_GCDetachThread): Likewise.
++
++2006-08-19 Ranjit Mathew
++
++ * sysdep/i386/backtrace.h (fallback_backtrace): Add "0x55 0x8B 0xEC"
++ as another sequence that can indicate a "pushl %ebp; movl %esp, %ebp"
++ function prologue.
+
+-2006-07-13 Anthony Green
++2006-08-17 H.J. Lu
++
++ * Makefile.am (install-exec-hook): Support $(DESTDIR).
++ * Makefile.in: Regenerated.
++
++2006-08-16 Tom Tromey
++
++ * libtool-version: Updated.
++
++2006-08-16 Jakub Jelinek
++ Bryce McKinlay
++
++ * configure, Makefile.in: Rebuilt.
++ * Makefile.am (toolexeclib_LTLIBRARIES): Add libgcj_bc.la.
++ (libgcj_bc_la_SOURCES): New variable.
++ (libgcj_bc_la_LDFLAGS): Likewise.
++ (libgcj_bc_la_LIBADD): Likewise.
++ (libgcj_bc_la_DEPENDENCIES): Likewise.
++ (libgcj_bc_la_LINK): Likewise.
++ (libgcj_bc_dummy_LINK): Likewise.
++ (libgcj_bc.la): New target.
++ (install-exec-hook): Likewise.
++ * libgcj.spec.in (*lib): Use LIBGCJ_SPEC.
++ * libgcj_bc.c: New file.
++ * configure.ac (LIBGCJ_SPEC): New subst.
++ * configure.host (use_libgcj_bc): New variable.
++
++2006-08-15 Kyle Galloway
++
++ * include/java-interp.h (_Jv_InterpMethod::run_debug): New method.
++ * interpret.cc: Added placeholder for debug variable type info to STORE*
++ macros.
++ (_Jv_InterpMethod::run_debug): New method.
++ (_Jv_InterpMethod::run_sync_object_debug): New method.
++ (_Jv_InterpMethod::run_sync_class_debug): New method.
++ (_Jv_InterpMethod::run_normal_debug): New method.
++ (_Jv_InterpMethod::run_class_debug): New method.
++ (_Jv_InterpMethod::ncode ()): Changed to select either debug or normal
++ versions of these functions.
++ * interpret-run.cc: New file, holds contents of old
++ _Jv_InterpMethod::run method.
++ * stacktrace.cc (_Jv_StackTrace::UnwindTraceFn): Changed to select
++ appropriate function for debug or normal mode.
++
++2006-08-14 Mark Wielaard
++
++ Imported GNU Classpath 0.92
++ * HACKING: Add more importing hints. Update automake version
++ requirement.
++
++ * configure.ac (gconf-peer): New enable AC argument.
++ Add --disable-gconf-peer and --enable-default-preferences-peer
++ to classpath configure when gconf is disabled.
++ * scripts/makemake.tcl: Set gnu/java/util/prefs/gconf and
++ gnu/java/awt/dnd/peer/gtk to bc. Classify
++ gnu/java/security/Configuration.java as generated source file.
++
++ * gnu/java/lang/management/VMGarbageCollectorMXBeanImpl.java,
++ gnu/java/lang/management/VMMemoryPoolMXBeanImpl.java,
++ gnu/java/lang/management/VMClassLoadingMXBeanImpl.java,
++ gnu/java/lang/management/VMRuntimeMXBeanImpl.java,
++ gnu/java/lang/management/VMMemoryManagerMXBeanImpl.java,
++ gnu/java/lang/management/VMThreadMXBeanImpl.java,
++ gnu/java/lang/management/VMMemoryMXBeanImpl.java,
++ gnu/java/lang/management/VMCompilationMXBeanImpl.java: New VM stub
++ classes.
++ * java/lang/management/VMManagementFactory.java: Likewise.
++ * java/net/VMURLConnection.java: Likewise.
++ * gnu/java/nio/VMChannel.java: Likewise.
++
++ * java/lang/Thread.java (getState): Add stub implementation.
++ * java/lang/Class.java (isEnum): Likewise.
++ * java/lang/Class.h (isEnum): Likewise.
++
++ * gnu/awt/xlib/XToolkit.java (getClasspathTextLayoutPeer): Removed.
++
++ * javax/naming/spi/NamingManager.java: New override for StackWalker
++ functionality.
++
++ * configure, sources.am, Makefile.in, gcj/Makefile.in,
++ include/Makefile.in, testsuite/Makefile.in: Regenerated.
++
++2006-08-14 Gary Benson
++
++ * java/lang/Thread.java (accessControlState): New field.
++ * java/security/VMAccessControlState.java: New file.
++ * java/security/natVMAccessControlState.cc: Likewise.
++ * java/security/VMAccessController.java
++ (contexts, inGetContext): Removed.
++ (pushContext, popContext, getContext): Use VMAccessControlState.
++ * Makefile.am (nat_source_files): Updated.
++ * sources.am, Makefile.in: Rebuilt.
++
++2006-08-10 Gary Benson
++
++ * include/java-stack.h (GetAccessControlStack): Change return
++ type.
++ * stacktrace.cc (accesscontrol_trace_fn): Record the number of
++ Java frames encountered.
++ (GetAccessControlStack): Return a flag indicating whether a call to
++ doPrivileged was encountered rather than an array of method names.
++ * java/security/natVMAccessController.cc (getStack): Change return
++ type.
++ * java/security/VMAccessController.java (getStack): Likewise.
++ (getContext): Change to reflect the above.
++
++2006-08-09 Gary Benson
++
++ * stacktrace.cc (accesscontrol_trace_fn): Skip non-Java frames.
++
++2006-08-09 Gary Benson
++
++ * java/lang/System.java (setSecurityManager): Javadoc fix.
++ * java/security/VMAccessController.java (getContext): Comment fix.
++
++2006-08-09 Gary Benson
++
++ * include/java-stack.h (accesscontrol_trace_fn): Declare.
++ (GetAccessControlStack): Likewise.
++ (GetClassMethodStack): Remove.
++ * stacktrace.cc (accesscontrol_trace_fn): New method.
++ (GetAccessControlStack): Likewise.
++ (GetClassMethodStack): Remove.
++ * java/security/natVMAccessController.cc (getStack): Use
++ GetAccessControlStack.
++
++2006-08-07 Gary Benson
++
++ PR libgcj/28340:
++ * java/lang/ClassLoader.java (clinit): Install a default
++ security manager if java.security.manager is defined.
++ (getParent, getSystemClassLoader): Use the correct stack
++ frame during security checks.
++ * java/net/URLClassLoader.java (findClass): Avoid calling
++ this.toString() during VM initialization.
++ (runtimeInitialized): New method.
++ * java/net/natURLClassLoader.cc: New file.
++ * Makefile.am (nat_source_files): Added the above.
++ * Makefile.in: Rebuilt.
++
++2006-08-07 Gary Benson
++ Casey Marshall
++
++ * java/lang/SecurityManager.java (getSecurityContext,
++ checkPermission, checkAccess, checkRead, checkConnect,
++ checkPackageAccess, checkPackageDefinition, checkPackageList):
++ Merge with Classpath.
++ (SecurityContext): Remove.
++
++2006-08-07 Gary Benson
++
++ * java/security/VMAccessController.java (pushContext, popContext,
++ getContext): Use Thread.currentThread() to determine when we're
++ bootstrapping.
++ (runtimeInitialized): Remove.
++ * java/security/natVMAccessController.cc (runtimeInitialized):
++ Remove.
++
++2006-08-06 Tom Tromey
++
++ PR libgcj/28491:
++ * configure, include/config.h.in: Rebuilt.
++ * configure.ac: Look for ifaddrs.h, getifaddrs.
++ * java/net/natVMNetworkInterfacePosix.cc (getInterfaces): Use
++ getifaddrs if available.
++
++2006-08-06 Tom Tromey
++
++ PR libgcj/28576:
++ * gnu/java/net/natPlainDatagramSocketImplPosix.cc (connect):
++ Implemented.
++ (disconnect): Likewise.
++ (send): Handle already-connected case.
++
++2006-08-04 Mark Wielaard
++
++ * jvmti.cc: Include gcj/method.h.
++
++2006-08-04 Tom Tromey
++
++ * jvmti.cc: Added MAYBE_UNUSED to 'env' parameters.
++ (_Jv_JVMTI_GetObjectSize): Cast _Jv_GetArrayElementFromElementType
++ result to _Jv_uintptr_t.
++
++2006-08-01 Keith Seitz
++
++ * gnu/classpath/jdwp/VMFrame.java: Update to Classpath 0.91.
++ * gnu/classpath/jdwp/VMIdManager.java: Likewise.
++ * gnu/classpath/jdwp/VMMethod.java: Likewise.
++ * gnu/classpath/jdwp/VMVirtualMachine: Likewise.
++ * gnu/classpath/jdwp/natVMFrame.java: New file.
++ * gnu/classpath/jdwp/natVMMethod.java: New file.
++ * gnu/classpath/jdwp/natVMVirtualMachine.java: New file.
++ * Makefile.am (nat_source_files): Add new filles.
++ * Makefile.in: Regenerated.
++
++2006-08-03 Tom Tromey
++
++ * jvmti.cc (REQUIRE_PHASE): New macro.
++ (_Jv_JVMTI_InterruptThread): New function.
++ (_Jv_JVMTI_CreateRawMonitor): Likewise.
++ (_Jv_JVMTI_DestroyRawMonitor): Likewise.
++ (_Jv_JVMTI_RawMonitorEnter): Likewise.
++ (_Jv_JVMTI_RawMonitorExit): Likewise.
++ (_Jv_JVMTI_RawMonitorWait): Likewise.
++ (_Jv_JVMTI_RawMonitorNotify): Likewise.
++ (_Jv_JVMTI_RawMonitorNotifyAll): Likewise.
++ (_Jv_JVMTI_Allocate): Likewise.
++ (_Jv_JVMTI_Deallocate): Likewise.
++ (_Jv_JVMTI_GetClassModifiers): Likewise.
++ (_Jv_JVMTI_GetClassMethods): Likewise.
++ (_Jv_JVMTI_IsInterface): Likewise.
++ (_Jv_JVMTI_IsArrayClass): Likewise.
++ (_Jv_JVMTI_GetClassLoader): Likewise.
++ (_Jv_JVMTI_GetObjectHashCode): Likewise.
++ (_Jv_JVMTI_GetFieldModifiers): Likewise.
++ (_Jv_JVMTI_IsFieldSynthetic): Likewise.
++ (_Jv_JVMTI_GetMethodModifiers): Likewise.
++ (_Jv_JVMTI_IsMethodNative): Likewise.
++ (_Jv_JVMTI_IsMethodSynthetic): Likewise.
++ (_Jv_JVMTI_GetClassLoaderClasses): Likewise.
++ (_Jv_JVMTI_ForceGarbageCollection): Likewise.
++ (_Jv_JVMTI_GetSystemProperty): Likewise.
++ (_Jv_JVMTI_SetSystemProperty): Likewise.
++ (_Jv_JVMTI_GetTime): Likewise.
++ (_Jv_JVMTI_GetAvailableProcessors): Likewise.
++ (_Jv_JVMTI_AddToBootstrapClassLoaderSearch): Likewise.
++ (_Jv_JVMTI_SetVerboseFlag): Likewise.
++ (_Jv_JVMTI_GetObjectSize): Likewise.
++ (_Jv_JVMTI_SetJNIFunctionTable): Likewise.
++ (_Jv_JVMTI_GetJNIFunctionTable): Likewise.
++ (_Jv_JVMTI_Interface): Updated.
++ (NULL_CHECK): New macro.
++
++2006-08-02 Andreas Tobler
++
++ PR libgcj/28546
++ * include/no-threads.h: Declare _Jv_Thread_t as empty class.
++
++2006-08-01 Andreas Tobler
++
++ * gnu/classpath/natSystemProperties.cc: Add additional check for
++ getpwuid_r on _POSIX_PTHREAD_SEMANTICS.
++ (SystemProperties::insertSystemProperties): Likewise.
++ * java/io/natFilePosix.cc (File::performList): Add
++ additional check for readdir_r on _POSIX_PTHREAD_SEMANTICS.
++ * java/util/natVMTimeZone.cc (VMTimeZone::getSystemTimeZoneId): Add
++ additional check for localtime_r on _POSIX_PTHREAD_SEMANTICS.
++
++2006-07-31 Thomas Fitzsimmons
++
++ PR libgcj/28312
++ * classpath/native/jni/midi-alsa/Makefile.am
++ (libgjsmalsa_la_LDFLAGS): Add -avoid-version.
++ * classpath/native/jni/midi-alsa/Makefile.in: Regenerate.
++ * classpath/native/jni/midi-dssi/Makefile.am
++ (libgjsmdssi_la_LDFLAGS): Add -avoid-version.
++ * classpath/native/jni/midi-dssi/Makefile.in: Regenerate.
++ * classpath/native/jni/qt-peer/Makefile.am: Remove GCJ LOCAL
++ sections.
++ (libqtpeer_la_LDFLAGS): Add -avoid-version.
++ * classpath/native/jni/qt-peer/Makefile.in: Regenerate.
++ * classpath/native/jni/gtk-peer/Makefile.am
++ (libgtkpeer_la_LDFLAGS): Add -avoid-version.
++ * classpath/native/jni/gtk-peer/Makefile.in: Regenerate.
++ * classpath/native/jawt/Makefile.am (libjawt_la_LDFLAGS): Add
++ -avoid-version.
++ * classpath/native/jawt/Makefile.in: Regenerate.
++ * Makefile.am (libjvm_la_LDFLAGS): Add -avoid-version.
++ * Makefile.in: Regenerate.
++
++2006-07-28 Andrew Haley
++
++ * gnu/gcj/runtime/natSharedLibLoader.cc (init): Don't set
++ curLoader to VMClassLoader::bootLoader.
++
++2006-07-28 Gary Benson
++ Casey Marshall
++
++ PR libgcj/13604:
++ * include/java-stack.h (GetClassMethodStack): Declare.
++ * stacktrace.cc (GetClassMethodStack): New method.
++ * java/security/AccessController.java: Removed.
++ * java/security/VMAccessController.java: New file.
++ * java/security/natVMAccessController.cc: Likewise.
++ * Makefile.am (nat_source_files): Added the above.
++ * sources.am, Makefile.in: Rebuilt.
++
++2006-07-28 Gary Benson
++
++ * java/lang/SecurityManager.java (currentClassLoader,
++ currentLoadedClass, classLoaderDepth, checkAccess, checkRead,
++ checkWrite, checkTopLevelWindow, checkPrintJobAccess,
++ checkSystemClipboardAccess, checkAwtEventQueueAccess,
++ checkPackageList): Remerged javadoc.
++
++2006-07-28 Gary Benson
++
++ * prims.cc (_Jv_CreateJavaVM): Move setting runtimeInitialized
++ from the start to the end of the function. Remove references
++ to VMThrowable.trace_enabled.
++ * java/lang/natVMThrowable.cc (fillInStackTrace): Use
++ runtimeInitialized rather than trace_enabled to decide
++ whether to inhibit stack trace generation.
++ * java/lang/VMThrowable.java (trace_enabled): Removed.
++
++2006-07-23 Mohan Embar
++
++ * include/win32-threads.h (_Jv_Thread_t): Explicitly
++ name the struct.
++
++2006-07-23 Mohan Embar
++
++ * jvmti.cc (_Jv_JVMTI_SuspendThread): Add missing JNICALL
++ attribute.
++ (_Jv_JVMTI_ResumeThread): Likewise.
++ (_Jv_JVMTI_DisposeEnvironment): Likewise.
++
++2006-07-21 Mohan Embar
++
++ * gnu/java/net/natPlainSocketImplPosix.cc (bind): Clear
++ SockAddr before using - needed for OS X/PPC.
++
++2006-07-21 Keith Seitz
++
++ * boehm.cc (_Jv_SuspendThread): Don't ifdef the function declaration,
++ just the contents.
++ (_Jv_ResumeThread): Likewise.
++ * posix-threads.cc: Revert 2006-06-19 _Jv_ThreadDebugSuspend,
++ _Jv_ThreadDebugResume, _Jv_ThreadDebugSuspendCount patch. Moving
++ to JVMTI instead.
++ * include/posix-threads.h: Likewise.
++ * win32-threads.cc: Likewise.
++ * include/win32-threads.h: Likewise.
++ * jvmti.cc (_Jv_JVMTI_SuspentThread): New function.
++ (_Jv_JVMTI_ResumeThread): New function.
++ (_Jv_JVMTI_Interface): Define SuspendThread and ResumeThread.
++
++2006-07-21 David Daney
++
++ PR libgcj/28426
++ * configure: Regenerated.
++
++2006-07-21 Mark Wielaard
++
++ * java/io/OutputStreamWriter.java (flush): Create work if null.
++
++2006-07-21 Keith Seitz
++
++ * java/lang/natThread.cc (_Jv_ThreadGetData): New function.
++ * Makefile.am (java/lang/Thread.h): Add friend function
++ _Jv_ThreadGetData.
++ * Makefile.in: Regenerate.
++
++2006-07-20 Keith Seitz
++
++ * jvmti.cc (_Jv_JVMTI_DisposeEnvironment): New function.
++ (_Jv_JVMTI_Interface): Define DisposeEnvironment method.
++
++2006-07-20 Keith Seitz
++
++ * include/jvm.h (_Jv_GetJVMTIEnv): Declare.
++ * jni.cc (_Jv_JNI_GetEnv): Handle JVMTI requests.
++ * jvmti.cc: New file.
++ * Makefile.am (libgcj_la_SOURCES): Add jvmti.cc.
++ * Makefile.in: Regenerate.
++
++2006-07-20 David Daney
++
++ * configure.host: Enable the interpreter for mipsel-* and mips-*.
++
++2006-07-20 David Daney
++
++ * include/mips-signal.h: Update copyright.
++ (struct kernel_sigaction): Removed.
++ (SIGNAL_HANDLER): Changed prototype.
++ (MAKE_THROW_FRAME): Added cast.
++ (INIT_SEGV): Use sigaction instead of syscall.
++ (INIT_FPE): Likewise.
++
++2006-07-18 Paolo Bonzini
++
++ * configure: Regenerate.
++
++2006-07-18 Gary Benson
++
++ * java/io/File.java (deleteOnExit): Fix security check.
++
++2006-07-14 Anthony Green
+
+ * java/io/natFilePosix.cc (performSetLastModified): Return true on
+ success, false otherwise.
+
++2006-07-14 Ranjit Mathew
++
++ * stacktrace.cc (_Jv_StackTrace::GetStackTrace): Unconditionally use
++ _Unwind_Backtrace().
++ (_Jv_StackTrace::GetCallerInfo): Enable even for targets using SJLJ
++ EH.
++ (_Jv_StackTrace::GetClassContext): Unconditionally use
++ _Unwind_Backtrace().
++ (_Jv_StackTrace::GetFirstNonSystemClassLoader): Likewise.
++ * sysdep/i386/backtrace.h (HAVE_FALLBACK_BACKTRACE): Do not define.
++ (_Unwind_GetIPInfo): Define macro if SJLJ EH is in use.
++ (_Unwind_GetRegionStart): Likewise.
++ (_Unwind_Backtrace): Likewise.
++ (fallback_backtrace): Accept additional unwind trace function
++ argument. Call it during unwinding. Stop when any of _Jv_RunMain(),
++ _Jv_ThreadStart() or main() is seen during unwinding.
++ * sysdep/generic/backtrace.h (fallback_backtrace): Accept an
++ additional unwind trace function argument.
++
++2006-07-14 Gary Benson
++
++ * java/io/File.java (internalExists): New method.
++ (exists): Use internalExists.
++ (internalIsDirectory): New method.
++ (isDirectory): Use internalIsDirectory.
++ (createTempFile): Use internalExists and internalIsDirectory.
++
++2006-07-13 Bryce McKinlay
++
++ * interpret.cc (_Jv_InterpMethod::run): Don't SAVE_PC for fdiv.
++
++2006-07-13 Bryce McKinlay
++
++ * interpret.cc (_Jv_InterpMethod::compile): Add FIXME comment.
++ (_Jv_InterpMethod::run): SAVE_PC before executing any instruction
++ using resolve_pool_entry, as it can throw. Likewise for div/rem ops
++ that can throw ArithmeticException.
++
++2006-07-12 Gary Benson
++
++ * java/io/File.java (renameTo): Fix security checks.
++
++2006-07-12 Bryce McKinlay
++
++ PR libgcj/28352
++ * stacktrace.cc (getLineNumberForFrame): Roll back PC by 1 when
++ looking up line number for interpreted frame.
++
++2006-07-07 Bryce McKinlay
++ Geoffrey Keating
++
++ * testsuite/libjava.lang/StackTrace2.java: Renamed from
++ StackTrace.java. Changed class name.
++ * testsuite/libjava.lang/StackTrace2.out: Renamed from
++ StackTrace.out. Updated for new class name.
++
++2006-07-07 Ranjit Mathew
++
++ * sysdep/i386/backtrace.h (fallback_backtrace): Scan for a function's
++ prologue to determine its beginning. Stop unwinding when we reach
++ JvRunMain().
++
++2006-07-07 Gary Benson
++
++ * Makefile.am (BOOT_CLASS_PATH_DIR): Only contain libgcj.jar.
++ * Makefile.in: Regenerate.
++
++2006-07-06 Bryce McKinlay
++
++ * stacktrace.cc (ClassForFrame): Remove commented-out code.
++ (UnwindTraceFn): Use _Unwind_GetIPInfo and adjust IP
++ only when needed.
++ (getLineNumberForFrame): Don't adjust IP here.
++ * testsuite/libjava.lang/StackTrace.java: New test case.
++ * testsuite/libjava.lang/StackTrace.out: Ditto.
++
++2006-07-06 Thomas Fitzsimmons
++
++ * Makefile.am (libgcj_tools_la_GCJFLAGS): Add
++ -fno-indirect-classes.
++ * Makefile.in: Regenerate.
++ * gcj/Makefile.in: Regenerate.
++ * include/Makefile.in: Regenerate.
++ * testsuite/Makefile.in: Regenerate.
++
++2006-07-06 Bryce McKinlay
++
++ * boehm.cc (_Jv_MarkObj): Mark the next_or_version field.
++
++2006-07-06 Thomas Fitzsimmons
++
++ * configure.ac (ac_configure_args): Add --with-native-libdir.
++ * configure: Regenerate.
++ * classpath/native/jni/gtk-peer/Makefile.am: Remove GCJ LOCAL
++ sections.
++ * classpath/native/jni/gtk-peer/Makefile.in: Regenerate.
++ * classpath/native/jawt/Makefile.am: Remove GCJ LOCAL sections.
++ * classpath/native/jawt/Makefile.in: Regenerate.
++ * classpath/native/plugin/Makefile.am: Remove GCJ LOCAL sections.
++ * classpath/native/plugin/Makefile.in: Regenerate.
++
++2006-07-05 Ranjit Mathew
++ Danny Smith
++
++ * libgcj.spec.in: Use THREADSTARTFILESPEC to affect the spec for
++ startfile.
++ * configure.ac: Allow targets to affect the spec for startfile
++ by specifying a THREADSTARTFILESPEC variable. Define this for
++ the win32 threads package to include crtmt.o.
++ * configure: Regenerate.
++ * win32.cc (_CRT_MT): Remove definition.
++ (__mingwthr_key_dtor): Likewise.
++
++2006-07-04 Andreas Tobler