[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#827787: marked as done (gcc-6: improve gcj cross build)



Your message dated Thu, 07 Feb 2019 03:13:19 +0000
with message-id <E1gra7r-000G9u-7I@fasolo.debian.org>
and subject line Bug#920171: Removed package(s) from unstable
has caused the Debian Bug report #827787,
regarding gcc-6: improve gcj cross build
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
827787: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=827787
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: src:gcc-6
Version: 6.1.1-7

This patch produce gre/jdk/libgcj17 from cross build,
and it also install libgcj.spec also.
The above makes cross gcj works better.

Please review this patch.
I am not fully confident about it.

-- 
YunQiang Su
diff --git a/debian/control.m4 b/debian/control.m4
index 3010377..608b54c 100644
--- a/debian/control.m4
+++ b/debian/control.m4
@@ -20,6 +20,7 @@ define(`MAINTAINER', `Debian GCC Maintainers <debian-gcc@lists.debian.org>')
 
 define(`depifenabled', `ifelse(index(enabled_languages, `$1'), -1, `', `$2')')
 define(`ifenabled', `ifelse(index(enabled_languages, `$1'), -1, `dnl', `$2')')
+define(`ifenabled_newline', `ifelse(index(enabled_languages, `$1'), -1, `', `$2')')
 
 ifdef(`TARGET',`ifdef(`CROSS_ARCH',`',`undefine(`MULTIARCH')')')
 define(`CROSS_ARCH', ifdef(`CROSS_ARCH', CROSS_ARCH, `all'))
@@ -4045,9 +4046,7 @@ Description: GCJ byte code and native compiler for Java(TM)
  Java(tm) source and bytecode files. The compiler can also generate class
  files.
  .
-ifdef(`TARGET',`'dnl
-,` Install the gcj`'PV`'TS-jdk package for a more complete SDK environment.
-')`'dnl
+ Install the gcj`'PV`'TS-jdk package for a more complete SDK environment.
 ')`'dnl gcj
 
 ifenabled(`libgcj',`
@@ -4064,7 +4063,6 @@ Description: Java runtime library (common files)
  This package contains files shared by Classpath and libgcj libraries.
 ')`'dnl libgcjcommon
 
-
 Package: gcj`'PV-jdk`'TS
 Section: java
 Architecture: any
@@ -4085,12 +4083,15 @@ Description: GCJ and Classpath development tools for Java(TM)
  The package contains as well a collection of wrapper scripts and symlinks.
  It is meant to provide a Java-SDK-like interface to the GCJ tool set.
 
+ifdef(`TARGET',`',`
 Package: gcj`'PV-jre-headless`'TS
 Priority: ifdef(`TARGET',`extra',`PRI(optional)')
 Section: java
 Architecture: any
-Depends: BASEDEP, gcj`'PV-jre-lib`'TS (>= ${gcj:SoftVersion}), libdep(gcj`'LIBGCJ_EXT,,>=,${gcj:Version}), ${dep:prctl}, ${shlibs:Depends}, ${misc:Depends}
-Suggests: fastjar, gcj`'PV-jdk`'TS (= ${gcj:Version}), libdep(gcj`'LIBGCJ_EXT-awt,,>=,${gcj:Version})
+Depends: BASEDEP, gcj`'PV-jre-lib (>= ${gcj:SoftVersion}), libdep(gcj`'LIBGCJ_EXT,,>=,${gcj:Version}), ${dep:prctl}, ${shlibs:Depends}, ${misc:Depends}
+Suggests: fastjar, gcj`'PV-jdk`'TS (= ${gcj:Version}), `'ifenabled_newline(`libgcjawt',dnl
+ libdep(gcj`'LIBGCJ_EXT-awt,,>=,${gcj:Version})`'dnl
+)
 Provides: java5-runtime-headless, java2-runtime-headless, java1-runtime-headless, java-runtime-headless
 BUILT_USING`'dnl
 Description: Java runtime environment using GIJ/Classpath (headless version)
@@ -4102,12 +4103,15 @@ Description: Java runtime environment using GIJ/Classpath (headless version)
  The package contains as well a collection of wrapper scripts and symlinks.
  It is meant to provide a Java-RTE-like interface to the GIJ/GCJ tool set,
  limited to the headless tools and libraries.
+')`'dnl TARGET
 
 Package: gcj`'PV-jre`'TS
 Section: java
 Architecture: any
 Priority: ifdef(`TARGET',`extra',`PRI(optional)')
-Depends: BASEDEP, gcj`'PV-jre-headless`'TS (= ${gcj:Version}), libdep(gcj`'LIBGCJ_EXT-awt,,>=,${gcj:Version}), ${shlibs:Depends}, ${misc:Depends}
+Depends: BASEDEP, ${shlibs:Depends}, ${misc:Depends}, ifdef(`TARGET',`',gcj`'PV-jre-headless`'TS (= ${gcj:Version})`,') `'ifenabled_newline(`libgcjawt',dnl
+ libdep(gcj`'LIBGCJ_EXT-awt,,>=,${gcj:Version})`'dnl
+)
 Provides: java5-runtime, java2-runtime, java1-runtime, java-runtime
 BUILT_USING`'dnl
 Description: Java runtime environment using GIJ/Classpath
@@ -4127,8 +4131,10 @@ ifdef(`MULTIARCH', `Pre-Depends: ${misc:Pre-Depends}
 Multi-Arch: same
 ')`'dnl
 Depends: SOFTBASEDEP, libgcj-common (>= 1:4.1.1-21), ${shlibs:Depends}, ${misc:Depends}
-Recommends: gcj`'PV-jre-lib`'TS (>= ${gcj:SoftVersion})
-Suggests: libdbgdep(gcj`'GCJ_SO-dbg,), libdep(gcj`'LIBGCJ_EXT-awt,,=,${gcj:Version})
+Recommends: gcj`'PV-jre-lib (>= ${gcj:SoftVersion})
+Suggests: libdbgdep(gcj`'GCJ_SO-dbg,), `'ifenabled_newline(`libgcjawt',dnl
+ libdep(gcj`'LIBGCJ_EXT-awt,,=,${gcj:Version})`'dnl
+)
 BUILT_USING`'dnl
 Description: Java runtime library for use with gcj
  This is the runtime that goes along with the gcj front end to
@@ -4138,7 +4144,8 @@ Description: Java runtime library for use with gcj
  To show file names and line numbers in stack traces, the packages
  libgcj`'GCJ_SO-dbg and binutils are required.
 
-Package: gcj`'PV-jre-lib`'TS
+ifdef(`TARGET',`',`
+Package: gcj`'PV-jre-lib
 Section: java
 Architecture: all
 Priority: PRI(optional)
@@ -4146,6 +4153,7 @@ Depends: SOFTBASEDEP, libdep(gcj`'LIBGCJ_EXT,,>=,${gcj:SoftVersion}), ${misc:Dep
 BUILT_USING`'dnl
 Description: Java runtime library for use with gcj (jar files)
  This is the jar file that goes along with the gcj front end to gcc.
+')`'dnl TARGET
 
 ifenabled(`gcjbc',`
 Package: libgcj-bc
@@ -4164,6 +4172,7 @@ Description: Link time only library for use with gcj
  libgcj.so changes.
 ')`'dnl gcjbc
 
+ifenabled(`libgcjawt',`
 Package: libgcj`'LIBGCJ_EXT-awt`'LS
 Section: libs
 Architecture: any
@@ -4208,6 +4217,7 @@ Description: AWT QT peer runtime library for use with libgcj
  This is the runtime library holding the QT based AWT peer
  implementation for libgcj.
 ')`'dnl qtpeer
+')`'dnl libgcjawt
 ')`'dnl libgcj
 
 ifenabled(`libgcjdev',`
@@ -4217,7 +4227,9 @@ Architecture: any
 ifdef(`MULTIARCH', `Multi-Arch: same
 ')`'dnl
 Priority: PRI(optional)
-Depends: BASEDEP, libdep(gcj`'LIBGCJ_EXT-awt,,=,${gcj:Version}), libgcj-bc`'LS, ${pkg:gcjgtk}, ${pkg:gcjqt}, zlib1g-dev, ${shlibs:Depends}, ${misc:Depends}
+Depends: BASEDEP, libgcj-bc`'LS, ${pkg:gcjgtk}, ${pkg:gcjqt}, zlib1g-dev, ${shlibs:Depends}, ${misc:Depends}, `'ifenabled_newline(`libgcjawt',dnl
+ libdep(gcj`'LIBGCJ_EXT-awt,,=,${gcj:Version})`'dnl
+)
 Suggests: libgcj-doc
 BUILT_USING`'dnl
 Description: Java development headers for use with gcj
diff --git a/debian/patches/libjava-multiarch.diff b/debian/patches/libjava-multiarch.diff
index b18c2dc..40cfbac 100644
--- a/debian/patches/libjava-multiarch.diff
+++ b/debian/patches/libjava-multiarch.diff
@@ -4,18 +4,23 @@ Index: b/src/libjava/configure.ac
 ===================================================================
 --- a/src/libjava/configure.ac
 +++ b/src/libjava/configure.ac
-@@ -1535,6 +1535,10 @@ case ${version_specific_libs} in
+@@ -1535,6 +1535,15 @@ case ${version_specific_libs} in
        .) toolexeclibdir=$toolexecmainlibdir ;; # Avoid trailing /.
        *) toolexeclibdir=$toolexecmainlibdir/$multi_os_directory ;;
      esac
 +    multiarch=`$CC -print-multiarch`
-+    if test -n "$multiarch"; then
-+        toolexeclibdir=$toolexecmainlibdir/$multiarch
++    if test -n "$with_cross_host" &&
++       test x"$with_cross_host" != x"no"; then
++         :
++    else
++      if test -n "$multiarch";then
++         toolexeclibdir=$toolexecmainlibdir/$multiarch
++      fi
 +    fi
      ;;
  esac
  AC_SUBST(toolexecdir)
-@@ -1552,6 +1556,10 @@ AC_DEFINE_UNQUOTED(GCJVERSION, "$GCJVERS
+@@ -1552,6 +1561,10 @@ AC_DEFINE_UNQUOTED(GCJVERSION, "$GCJVERS
  # libraries are found.
  gcjsubdir=gcj-$gcjversion-$libgcj_soversion
  dbexecdir='$(toolexeclibdir)/'$gcjsubdir
@@ -56,13 +61,18 @@ Index: b/src/libjava/classpath/m4/acinclude.m4
 ===================================================================
 --- a/src/libjava/classpath/m4/acinclude.m4
 +++ b/src/libjava/classpath/m4/acinclude.m4
-@@ -276,6 +276,10 @@ AC_DEFUN([CLASSPATH_TOOLEXECLIBDIR],
+@@ -276,6 +276,15 @@ AC_DEFUN([CLASSPATH_TOOLEXECLIBDIR],
        esac
        ;;
    esac
 +  multiarch=`$CC -print-multiarch`
-+  if test -n "$multiarch"; then
-+    toolexeclibdir=${libdir}/${multiarch}
++  if test -n "$with_cross_host" &&
++     test x"$with_cross_host" != x"no"; then
++       :
++  else
++    if test -n "$multiarch";then
++       toolexeclibdir=$toolexecmainlibdir/$multiarch
++    fi
 +  fi
    AC_SUBST(toolexecdir)
    AC_SUBST(toolexecmainlibdir)
diff --git a/debian/rules.conf b/debian/rules.conf
index e51adcb..c3b78a3 100644
--- a/debian/rules.conf
+++ b/debian/rules.conf
@@ -925,9 +925,9 @@ ifeq ($(with_ada),yes)
 endif
 ifeq ($(with_java),yes)
   languages += java
-  addons += gcj
+  addons += gcj libgcj libgcjdev 
   ifneq ($(DEB_CROSS),yes)
-    addons += libgcj libgcjdev gcjdoc gcjsrc
+    addons += libgcjawt gcjdoc gcjsrc
   endif
 endif
 
diff --git a/debian/rules.d/binary-java.mk b/debian/rules.d/binary-java.mk
index b223b77..a2ef4d9 100644
--- a/debian/rules.d/binary-java.mk
+++ b/debian/rules.d/binary-java.mk
@@ -10,7 +10,9 @@ endif
 ifeq ($(with_libgcj),yes)
   ifeq ($(with_java),yes)
     arch_binaries  := $(arch_binaries) java gcjjre
-    indep_binaries  := $(indep_binaries) libgcjjar
+    ifneq ($(DEB_CROSS),yes)
+      indep_binaries  := $(indep_binaries) libgcjjar
+    endif
   endif
 
   ifeq ($(with_javadev),yes)
@@ -49,9 +51,11 @@ p_jar	= gcj$(pkg_ver)-jre-lib$(cross_bin_arch)
 p_jsrc	= gcj$(pkg_ver)-source
 p_jlib	= libgcj$(PKG_LIBGCJ_EXT)$(cross_lib_arch)
 p_jdbg	= libgcj$(PKG_GCJ_EXT)-dbg$(cross_lib_arch)
-p_jlibx	= libgcj$(PKG_LIBGCJ_EXT)-awt$(cross_lib_arch)
-p_jgtk	= libgcj$(PKG_GCJ_EXT)-awt-gtk$(cross_lib_arch)
-p_jqt	= libgcj$(PKG_GCJ_EXT)-awt-qt$(cross_lib_arch)
+ifeq ($(with_libgcjawt),yes)
+  p_jlibx	= libgcj$(PKG_LIBGCJ_EXT)-awt$(cross_lib_arch)
+  p_jgtk	= libgcj$(PKG_GCJ_EXT)-awt-gtk$(cross_lib_arch)
+  p_jqt	= libgcj$(PKG_GCJ_EXT)-awt-qt$(cross_lib_arch)
+endif
 p_jdev	= libgcj$(PKG_GCJ_EXT)-dev$(cross_lib_arch)
 p_jdoc	= libgcj-doc
 
@@ -63,16 +67,18 @@ d_jar	= debian/$(p_jar)
 d_jsrc	= debian/$(p_jsrc)
 d_jlib	= debian/$(p_jlib)
 d_jdbg	= debian/$(p_jdbg)
-d_jlibx	= debian/$(p_jlibx)
-d_jgtk	= debian/$(p_jgtk)
-d_jqt	= debian/$(p_jqt)
+ifeq ($(with_libgcjawt),yes)
+  d_jlibx	= debian/$(p_jlibx)
+  d_jgtk	= debian/$(p_jgtk)
+  d_jqt	= debian/$(p_jqt)
+endif
 d_jdev	= debian/$(p_jdev)
 d_jdoc	= debian/$(p_jdoc)
 d_jre	= debian/$(p_jre)
 
 GCJ_BASE_VERSION = $(BASE_VERSION)
 
-gcj_vlibdir	= $(PF)/$(libdir)/gcj-$(BASE_VERSION)-$(GCJ_SONAME)
+gcj_vlibdir	= $(PF)/lib/$(DEB_TARGET_MULTIARCH)/gcj-$(BASE_VERSION)-$(GCJ_SONAME)
 
 jre_tools = java keytool orbd rmid rmiregistry tnameserv
 jdk_tools = appletviewer jar jarsigner javac javadoc javah native2ascii rmic serialver
@@ -87,12 +93,8 @@ files_gcj = \
 	$(PF)/bin/$(cmd_prefix)gcj$(pkg_ver) \
 	$(gcc_lexec_dir)/{ecj1,jc1,jvgenmain}
 
-# FIXME: this really should be included, or else the cross compiler
-# can only be used to build libjava itself.
-ifneq (,$(filter $(build_type), build-native cross-build-native))
-  files_gcj += \
-	$(PF)/$(libdir)/libgcj.spec
-endif
+files_gcj += \
+	$(usr_lib)/libgcj.spec
 
 ifneq ($(GFDL_INVARIANT_FREE),yes)
   files_gcj += \
@@ -107,7 +109,8 @@ dirs_jdk = \
 	$(gcc_lexec_dir) \
 	$(jvm_dir)/bin
 
-files_jdk = \
+ifneq ($(DEB_CROSS),yes)
+  files_jdk = \
 	$(PF)/bin/{gappletviewer,gjdoc,gc-analyze,gjar,gjarsigner,gcjh,gjavah,gnative2ascii,grmic,gserialver,jv-convert,jcf-dump}$(pkg_ver) \
 	$(PF)/share/man/man1/{gappletviewer,gjdoc,gjar,gjarsigner,gcjh,gjavah,gnative2ascii,gserialver}$(pkg_ver).1 \
 	$(gcc_lib_dir)/include/{jni.h,jni_md.h,jvmpi.h} \
@@ -123,6 +126,13 @@ ifneq ($(GFDL_INVARIANT_FREE),yes)
 	$(PF)/share/info/gcj* \
 	$(PF)/share/man/man1/{gc-analyze,grmic,jv-convert,jcf-dump}$(pkg_ver).1
 endif
+else
+  files_jdk = \
+	$(usr_lib)/lib{gij,gcj,gcj-tools}.so \
+	$(jvm_dir)/include \
+	$(jvm_dir)/bin/{appletviewer,jar,jarsigner,javadoc,javah,native2ascii,rmic,serialver} \
+	$(PF)/lib/jvm-exports
+endif
 
 dirs_jrehl = \
 	$(docdir)/$(p_jbase) \
@@ -154,21 +164,38 @@ dirs_jre = \
 files_jre = \
 	$(jvm_dir)/jre/lib/$(java_cpu)/libjawt.so
 
-dirs_jlib = \
+ifeq ($(with_libgcjawt),yes)
+  dirs_jlib = \
 	$(docdir)/$(p_jbase) \
 	$(gcj_vlibdir) \
-	$(PF)/$(libdir) \
+	$(usr_lib) \
 	$(jvm_dir)/jre/lib
 
-files_jlib = \
-	$(PF)/$(libdir)/libgij.so.* \
-	$(PF)/$(libdir)/libgcj-tools.so.* \
-	$(PF)/$(libdir)/libgcj.so.* \
+  files_jlib = \
+	$(usr_lib)/libgij.so.* \
+	$(usr_lib)/libgcj-tools.so.* \
+	$(usr_lib)/libgcj.so.* \
 	$(gcj_vlibdir)/libjvm.so \
-	$(gcj_vlibdir)/libjavamath.so \
 	$(jvm_dir)/jre/lib/security
 
 #	$(gcj_vlibdir)/libgconfpeer.so
+else
+  dirs_jlib = \
+	$(docdir)/$(p_jbase) \
+	$(gcj_vlibdir) \
+	$(PFL)/lib \
+	$(jvm_dir)/jre/lib
+
+  files_jlib = \
+	$(PFL)/lib/libgij.so.* \
+	$(PFL)/lib/libgcj-tools.so.* \
+	$(PFL)/lib/libgcj.so.* \
+	$(gcj_vlibdir)/libjvm.so \
+	$(jvm_dir)/jre/lib/security
+
+#	$(gcj_vlibdir)/libgconfpeer.so
+
+endif
 
 ifeq ($(with_java_alsa),yes)
   files_jlib += \
@@ -183,7 +210,7 @@ files_jar = \
 	$(PF)/share/java/libgcj-tools-$(BASE_VERSION).jar
 
 dirs_jlibx = \
-	$(PF)/$(libdir) \
+	$(usr_lib) \
 	$(gcj_vlibdir) \
 	$(PF)/share/java
 
@@ -201,16 +228,20 @@ dirs_jdev = \
 	$(jvm_dir)/include
 
 files_jdev = \
-	$(PF)/include/c++/$(BASE_VERSION)/{org,gcj,java,javax} \
-	$(PF)/include/c++/$(BASE_VERSION)/gnu/{awt,classpath,gcj,java,javax} \
-	$(PF)/$(libdir)/pkgconfig/libgcj-$(BASE_VERSION).pc \
+	$(PFL)/include/c++/$(BASE_VERSION)/{org,gcj,java,javax} \
+	$(PFL)/include/c++/$(BASE_VERSION)/gnu/{awt,classpath,gcj,java,javax} \
+	$(usr_lib)/pkgconfig/libgcj-$(BASE_VERSION).pc
+
+ifeq ($(with_libgcjawt),yes)
+  files_jdev += \
 	$(gcj_vlibdir)/lib*peer.so
+endif
 
 ifeq ($(with_static_java),yes)
   files_jdev += \
-	$(PF)/$(libdir)/libgij.a \
-	$(PF)/$(libdir)/libgcj.a \
-	$(PF)/$(libdir)/libgcj-tools.a
+	$(usr_lib)/libgij.a \
+	$(usr_lib)/libgcj.a \
+	$(usr_lib)/libgcj-tools.a
 endif
 
 ifeq (,$(p_l64gcc))
@@ -283,9 +314,7 @@ ifeq ($(DEB_CROSS),yes)
 		$(d)/$(gcc_lib_dir)/ecj1
 endif
 	$(dh_compat2) dh_movefiles -p$(p_gcj)  $(files_gcj)
-ifneq (,$(filter $(build_type), build-native cross-build-native))
-	mv $(d_gcj)/$(PF)/$(libdir)/libgcj.spec $(d_gcj)/$(gcc_lib_dir)/
-endif
+	mv $(d_gcj)/$(usr_lib)/libgcj.spec $(d_gcj)/$(gcc_lib_dir)/
 
 ifneq (,$(filter $(DEB_HOST_ARCH), arm armel))
 	ln -sf ../../ecj1 $(d_gcj)/$(gcc_lexec_dir)/ecj1
@@ -300,9 +329,11 @@ ifneq ($(DEB_CROSS),yes)
 endif
 
 ifeq ($(GFDL_INVARIANT_FREE),yes)
+  ifneq ($(DEB_CROSS),yes)
 	mkdir -p $(d_gcj)/usr/share/lintian/overrides
 	echo '$(p_gcj) binary: binary-without-manpage' \
 	  >> $(d_gcj)/usr/share/lintian/overrides/$(p_gcj)
+  endif
 endif
 
 	debian/dh_doclink -p$(p_gcj) $(p_jbase)
@@ -416,12 +447,12 @@ $(binary_stamp)-java: $(install_stamp)
 	dh_testroot
 	mv $(install_stamp) $(install_stamp)-tmp
 
-	dh_installdirs -p$(p_jrehl)   $(dirs_jrehl)
 	dh_installdirs -p$(p_jlib)  $(dirs_jlib)
+	$(dh_compat2) dh_movefiles -p$(p_jlib)  $(files_jlib)
+ifeq ($(with_libgcjawt),yes)
+	dh_installdirs -p$(p_jrehl)   $(dirs_jrehl)
 	dh_installdirs -p$(p_jlibx) $(dirs_jlibx)
-
 	$(dh_compat2) dh_movefiles -p$(p_jrehl)   $(files_jrehl)
-	$(dh_compat2) dh_movefiles -p$(p_jlib)  $(files_jlib)
 	$(dh_compat2) dh_movefiles -p$(p_jlibx) $(files_jlibx)
 #ifneq (,$(findstring gtk, $(java_awt_peers)))
 #	$(dh_compat2) dh_movefiles -p$(p_jgtk) $(files_jgtk)
@@ -447,6 +478,7 @@ ifneq ($(GFDL_INVARIANT_FREE),yes)
 	  $(PF)/share/man/man1/gij$(pkg_ver).1 $(jvm_dir)/man/man1/java.1 \
 	  $(PF)/share/man/man1/grmic$(pkg_ver).1 $(jvm_dir)/man/man1/rmiregistry.1
 endif
+endif
 
 ifneq ($(DEB_TARGET_ARCH_CPU),$(java_cpu))
 	ln -sf $(java_cpu) $(d_jlib)/$(jvm_dir)/jre/lib/$(DEB_TARGET_ARCH_CPU)
@@ -461,6 +493,10 @@ endif
 	  /etc/java/security/classpath.security \
 	  /$(jvm_dir)/jre/lib/security/java.security
 
+	ln -s ../libgcj.so.$(GCJ_SONAME) \
+		$(d_jlib)/$(gcj_vlibdir)/libgcj_bc.so.1
+
+ifeq ($(with_libgcjawt),yes)
 	dh_link -p$(p_jlibx) \
 	  $(foreach i, jawt, $(gcj_vlibdir)/lib$(i).so $(jvm_dir)/lib/lib$(i).so)
 
@@ -470,9 +506,6 @@ ifeq ($(DEB_HOST_ARCH),hppa)
 	install -m755 debian/gij-hppa $(d_jrehl)/$(PF)/bin/gij$(pkg_ver)
 endif
 
-	ln -s ../libgcj.so.$(GCJ_SONAME) \
-		$(d_jlib)/$(gcj_vlibdir)/libgcj_bc.so.1
-
 	: # provide .jinfo file
 	( \
 	  echo 'name=$(jvm_name_short)'; \
@@ -493,7 +526,10 @@ ifneq (,$(findstring gcj,$(p_jbase)))
 		$(d_jrehl)/usr/share/doc/$(p_jbase)/
 endif
 	debian/dh_doclink -p$(p_jrehl) $(p_jbase)
+endif
 	debian/dh_doclink -p$(p_jlib)  $(p_jbase)
+
+ifeq ($(with_libgcjawt),yes)
 	debian/dh_doclink -p$(p_jlibx) $(p_jbase)
 
 #ifneq (,$(findstring gtk, $(java_awt_peers)))
@@ -502,6 +538,7 @@ endif
 #ifneq (,$(findstring qt, $(java_awt_peers)))
 #	debian/dh_doclink -p$(p_jqt) $(p_jbase)
 #endif
+endif
 
 ifeq ($(with_separate_libgcj),yes)
   ifeq ($(PKGSOURCE),gcj-$(BASE_VERSION))
@@ -510,16 +547,18 @@ ifeq ($(with_separate_libgcj),yes)
     endif
   endif
 endif
-	debian/dh_rmemptydirs -p$(p_jrehl)
 	debian/dh_rmemptydirs -p$(p_jlib)
+ifeq ($(with_libgcjawt),yes)
+	debian/dh_rmemptydirs -p$(p_jrehl)
 	debian/dh_rmemptydirs -p$(p_jlibx)
-
 	mkdir -p $(d_jrehl)/var/lib/gcj$(pkg_ver)
+endif
 
 	dh_makeshlibs $(ldconfig_arg) -p$(p_jlib) -V '$(p_jlib) (>= $(DEB_GCJ_SOVERSION))'
 	echo "libgcj_bc 1 libgcj-bc (>= 4.2.2-1)" >> debian/$(p_jlib)/DEBIAN/shlibs
 	cat debian/$(p_jlib)/DEBIAN/shlibs >> debian/shlibs.local
 
+ifeq ($(with_libgcjawt),yes)
 	dh_makeshlibs $(ldconfig_arg) -p$(p_jlibx) -V '$(p_jlibx) (>= $(DEB_GCJ_SOVERSION))'
 
 #ifneq (,$(findstring gtk, $(java_awt_peers)))
@@ -528,36 +567,66 @@ endif
 #ifneq (,$(findstring qt, $(java_awt_peers)))
 #	dh_makeshlibs $(ldconfig_arg) -p$(p_jqt) -V '$(p_jqt) (>= $(DEB_GCJ_SOVERSION))'
 #endif
-
+endif
+ifeq ($(with_libgcjawt),yes)
+	dh_strip -X/bin/ --dbg-package=$(p_jdbg) \
+		-p$(p_jrehl) -p$(p_jlib) \
+		-p$(p_jlibx) $(peer_pkgs)
+else
 	dh_strip -X/bin/ --dbg-package=$(p_jdbg) \
-		-p$(p_jrehl) -p$(p_jlib) -p$(p_jlibx) $(peer_pkgs)
+		-p$(p_jlib)
+endif
+
 	rm -f $(d_jdbg)/$(gcc_lib_dir)/libgcj_bc.so
 
+ifneq ($(DEB_CROSS),yes)
 	mkdir -p $(d_jlib)/usr/share/lintian/overrides
 	cp -p debian/$(p_jlib).overrides \
 		$(d_jlib)/usr/share/lintian/overrides/$(p_jlib)
+  ifeq ($(with_libgcjawt),yes)
 	mkdir -p $(d_jlibx)/usr/share/lintian/overrides
 	cp -p debian/$(p_jlibx).overrides \
 		$(d_jlibx)/usr/share/lintian/overrides/$(p_jlibx)
 	mkdir -p $(d_jrehl)/usr/share/lintian/overrides
 	cp -p debian/$(p_jrehl).overrides \
 		$(d_jrehl)/usr/share/lintian/overrides/$(p_jrehl)
+  endif
+endif
 
 # 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
 ifeq ($(with_separate_libgcj)-$(with_standalone_gcj),yes-no)
-	dh_shlibdeps \
+  ifeq ($(with_libgcjawt),yes)
+	$(cross_shlibdeps) dh_shlibdeps \
+		-L$(p_jlib) \
+		$(call shlibdirs_to_search,$(subst stdc++$(CXX_SONAME),gcc$(GCC_SONAME),$(p_l)),$(2)):$(d_lib)/$(usr_lib):$(d_jlib)/$(usr_lib) \
+		-p$(p_jrehl) -p$(p_jlib) \
+		-p$(p_jlibx) $(peer_pkgs)
+  else
+	$(cross_shlibdeps) dh_shlibdeps \
 		-L$(p_jlib) \
-		-l$(d_lib)/$(PF)/$(libdir):$(d_jlib)/$(PF)/$(libdir) \
-		-p$(p_jrehl) -p$(p_jlib) -p$(p_jlibx) $(peer_pkgs)
+		$(call shlibdirs_to_search,$(subst stdc++$(CXX_SONAME),gcc$(GCC_SONAME),$(p_l)),$(2)):$(d_lib)/$(usr_lib):$(d_jlib)/$(usr_lib) \
+		-p$(p_jlib)
+  endif
+
 else
-	dh_shlibdeps \
+  ifeq ($(with_libgcjawt),yes)
+	$(cross_shlibdeps) 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_jrehl) -p$(p_jlib) -p$(p_jlibx) $(peer_pkgs)
+		$(call shlibdirs_to_search,$(subst stdc++$(CXX_SONAME),gcc$(GCC_SONAME),$(p_l)),$(2)):$(d)/$(usr_lib):$(d_lib)/$(usr_lib):$(d_jlib)/$(usr_lib):$(d_lgcc)/lib \
+		-p$(p_jrehl) -p$(p_jlib) \
+		-p$(p_jlibx) $(peer_pkgs)
+  else
+	$(cross_shlibdeps) dh_shlibdeps \
+		-L$(p_lgcc) \
+		-L$(p_jlib) \
+		$(call shlibdirs_to_search,$(subst stdc++$(CXX_SONAME),gcc$(GCC_SONAME),$(p_l)),$(2)):$(d)/$(usr_lib):$(d_lib)/$(usr_lib):$(d_jlib)/$(usr_lib):$(d_lgcc)/$(usr_lib) \
+		-p$(p_jlib)
+  endif
+
 endif
 	-[ -d $(d_l64gcc).saved ] && mv $(d_l64gcc).saved $(d_l64gcc)
 	sed -e 's/$(p_jlib)[^,]*//' -e 's/, *,/,/' debian/$(p_jlib).substvars \
@@ -565,8 +634,11 @@ endif
 	    && mv -f debian/$(p_jlib).substvars.tmp debian/$(p_jlib).substvars
 	rm -f debian/shlibs.local
 
-	echo $(p_jrehl) $(p_jlib) $(p_jlibx) $(subst -p,,$(peer_pkgs)) >> debian/arch_binaries
-
+ifeq ($(with_libgcjawt),yes)
+	echo $(p_jrehl) >> debian/arch_binaries
+	echo $(p_jlibx) $(subst -p,,$(peer_pkgs)) >> debian/arch_binaries
+endif
+	echo $(p_jlib) >> debian/arch_binaries
 	trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
 
 # ----------------------------------------------------------------------
@@ -578,34 +650,36 @@ $(binary_stamp)-gcjjdk: $(build_html_stamp) $(install_stamp)
 	rm -rf $(d_jdk)
 	dh_installdirs -p$(p_jdk)  $(dirs_jdk)
 
+#ifneq ($(DEB_CROSS),yes)
 #	mkdir -p $(d_jdk)/usr/share/lintian/overrides
 #	cp -p debian/$(p_jdk).overrides \
 #		$(d_jdk)/usr/share/lintian/overrides/$(p_jdk)
+#endif
 	cp -p $(srcdir)/gcc/java/ChangeLog \
 		$(d_jdk)/usr/share/doc/$(p_jbase)/changelog.gcj
 	cp -p $(srcdir)/libjava/ChangeLog \
 		$(d_jdk)/usr/share/doc/$(p_jbase)/changelog.libjava
 
 ifeq ($(with_standalone_gcj),yes)
-	rm -f $(d)/$(PF)/$(libdir)/libgcc_s.so
+	rm -f $(d)/$(usr_lib)/libgcc_s.so
 	ln -sf /$(libdir)/libgcc_s.so.$(GCC_SONAME) $(d)/$(gcc_lib_dir)/libgcc_s.so
 endif
 	$(dh_compat2) dh_movefiles -p$(p_jdk)  $(files_jdk)
 
 	for i in libgij libgcj libgcj-tools; do \
 	  dh_link -p$(p_jdk) \
-	    /$(PF)/$(libdir)/$$i.so.$(GCJ_SONAME) /$(gcc_lib_dir)/$$i.so \
-	    /$(PF)/$(libdir)/$$i.so.$(GCJ_SONAME) /$(jvm_dir)/lib/$$i.so; \
-	  rm -f $(d_jdk)/$(PF)/$(libdir)/$$i.{la,so}; \
+	    /$(usr_lib)/$$i.so.$(GCJ_SONAME) /$(gcc_lib_dir)/$$i.so \
+	    /$(usr_lib)/$$i.so.$(GCJ_SONAME) /$(jvm_dir)/lib/$$i.so; \
+	  rm -f $(d_jdk)/$(usr_lib)/$$i.{la,so}; \
 	done
 
 	install -m755 debian/jdb.sh $(d_jdk)/$(jvm_dir)/bin/jdb
 
-	install -m 755 $(d)/$(PF)/$(libdir)/libgcj_bc.so.1 \
+	install -m 755 $(d)/$(usr_lib)/libgcj_bc.so.1 \
 		$(d_jdk)/$(gcc_lib_dir)/libgcj_bc.so
 	$(CC_FOR_TARGET) $(LDFLAGS_FOR_TARGET) -shared -fpic -xc /dev/null \
 		-o build/libgcj.so -Wl,-soname,libgcj.so.$(GCJ_SONAME) -nostdlib
-	$(CC_FOR_TARGET) $(LDFLAGS_FOR_TARGET) -shared -fpic \
+	$(CC_FOR_TARGET) -B/$(usr_lib) -I/$(usr_lib)/../include $(LDFLAGS_FOR_TARGET) -shared -fpic \
 		$(srcdir)/libjava/libgcj_bc.c \
 		-o $(d_jdk)/$(gcc_lib_dir)/libgcj_bc.so \
 		-Wl,-soname,libgcj_bc.so.1 $(builddir)/libgcj.so -shared-libgcc 
@@ -639,7 +713,9 @@ endif
 	debian/dh_rmemptydirs -p$(p_jdk)
 
 	dh_strip -p$(p_jdk)
-	dh_shlibdeps -p$(p_jdk) -l$(d_lib)/$(PF)/$(libdir):$(d_jlib)/$(PF)/lib -Xecj1
+	$(cross_shlibdeps) dh_shlibdeps \
+		$(call shlibdirs_to_search,$(subst stdc++$(CXX_SONAME),gcc$(GCC_SONAME),$(p_l)),$(2)):$(d_lib)/$(usr_lib):$(d_jlib)/$(PFL)/lib  \
+		-p$(p_jdk) -Xecj1
 	echo $(p_jdk) >> debian/arch_binaries
 
 	trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
@@ -656,32 +732,34 @@ $(binary_stamp)-libgcjdev: $(build_html_stamp) $(install_stamp) $(binary_stamp)-
 
 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)/; \
+	  mv $(d_jdev)/$(usr_lib)/$$i.a $(d_jdev)/$(gcc_lib_dir)/; \
 	done
 endif
 
 	ln -sf libgcj-$(BASE_VERSION).pc \
-		$(d_jdev)/$(PF)/$(libdir)/pkgconfig/libgcj$(PKG_GCJ_EXT).pc
+		$(d_jdev)/$(usr_lib)/pkgconfig/libgcj$(PKG_GCJ_EXT).pc
 	sed -i -e 's,-[IL][^ ]* *,,' \
-		$(d_jdev)/$(PF)/$(libdir)/pkgconfig/libgcj-$(BASE_VERSION).pc
+		$(d_jdev)/$(usr_lib)/pkgconfig/libgcj-$(BASE_VERSION).pc
 
 	debian/dh_doclink -p$(p_jdev) $(p_jbase)
 
 	debian/dh_rmemptydirs -p$(p_jdev)
 
+#ifneq ($(DEB_CROSS),yes)
 #	mkdir -p $(d_jdev)/usr/share/lintian/overrides
 #	cp -p debian/libgcj$(PKG_GCJ_EXT)-dev.overrides \
 #		$(d_jdev)/usr/share/lintian/overrides/$(p_jdev)
+#endif
 
 	DH_COMPAT=5 dh_strip -p$(p_jdev) --dbg-package=$(p_jdbg)
 ifeq ($(with_separate_libgcj)-$(with_standalone_gcj),yes-no)
-	dh_shlibdeps \
-		-l$(d_lib)/$(PF)/$(libdir):$(d_jlib)/$(PF)/$(libdir) \
+	$(cross_shlibdeps) dh_shlibdeps \
+		$(call shlibdirs_to_search,$(subst stdc++$(CXX_SONAME),gcc$(GCC_SONAME),$(p_l)),$(2)):$(d_lib)/$(usr_lib):$(d_jlib)/$(usr_lib) \
 		-p$(p_jdev)
 else
-	dh_shlibdeps \
+	$(cross_shlibdeps) dh_shlibdeps \
 		-L$(p_lgcc) \
-		-l:$(d)/$(PF)/$(libdir):$(d_lib)/$(PF)/$(libdir):$(d_jlib)/$(PF)/$(libdir):$(d_lgcc)/lib \
+		$(call shlibdirs_to_search,$(subst stdc++$(CXX_SONAME),gcc$(GCC_SONAME),$(p_l)),$(2)):$(d)/$(usr_lib):$(d_lib)/$(usr_lib):$(d_jlib)/$(usr_lib):$(d_lgcc)/lib \
 		-p$(p_jdev)
 endif
 	echo $(p_jdev) >> debian/arch_binaries
diff --git a/debian/rules.defs b/debian/rules.defs
index dd5e368..087370f 100644
--- a/debian/rules.defs
+++ b/debian/rules.defs
@@ -796,6 +796,7 @@ ifeq ($(with_java)-$(with_separate_libgcj),yes-yes)
     with_java := built from separate source
     with_gcj := built from separate source
     with_libgcj := buit from separate source
+    with_libgcjawt := buit from separate source
   endif
 endif
 
@@ -815,6 +816,7 @@ ifeq ($(with_java),yes)
   java_priority = 10$(subst .,,$(BASE_VERSION))0
 
   with_libgcj := yes
+  with_libgcjawt := yes
   with_libgcjbc := no
 
   ifneq (,$(findstring gcj-4,$(PKGSOURCE)))
@@ -851,9 +853,10 @@ ifeq ($(with_java),yes)
     with_java_alsa := no
   endif
 
-  # Just build the cross compiler to be able to cross build a native build.
+  # Don't build awt when cross, as the need some packages like gtk
   ifeq ($(DEB_CROSS),yes)
-    with_libgcj :=
+    with_libgcjawt := no
+    with_java_alsa := no
   endif
 
   enabled_languages += java
diff --git a/debian/rules2 b/debian/rules2
index abe987b..e282502 100644
--- a/debian/rules2
+++ b/debian/rules2
@@ -96,7 +96,7 @@ ifneq (,$(filter $(build_type),cross-build-native cross-build-cross))
 	GDC_FOR_TARGET=$(DEB_TARGET_GNU_TYPE)-gdc-$(BASE_VERSION)
 endif
 
-ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_TARGET_GNU_TYPE))
+ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
   CC_FOR_TARGET = $(builddir)/gcc/xgcc -B$(builddir)/gcc/
 else
   CC_FOR_TARGET = $(DEB_TARGET_GNU_TYPE)-gcc
@@ -358,13 +358,17 @@ ifeq ($(with_java),yes)
   ifeq ($(with_java_maintainer_mode),yes)
     CONFARGS += --enable-java-maintainer-mode
   endif
-  ifeq ($(with_java_biarch_awt),yes)
-    CONFARGS += --enable-java-awt=$(subst $(SPACE),$(COMMA),$(foreach p,$(java_awt_peers),$(p)-default))
-  else
-    CONFARGS += --enable-java-awt=$(subst $(SPACE),$(COMMA),$(foreach p,$(java_awt_peers),$(p)))
-  endif
-  ifneq (,$(findstring gtk,$(java_awt_peers)))
-    CONFARGS += --enable-gtk-cairo
+  ifeq ($(with_libgcj),yes)
+    ifeq ($(with_libgcjawt),yes)
+      ifeq ($(with_java_biarch_awt),yes)
+        CONFARGS += --enable-java-awt=$(subst $(SPACE),$(COMMA),$(foreach p,$(java_awt_peers),$(p)-default))
+      else
+        CONFARGS += --enable-java-awt=$(subst $(SPACE),$(COMMA),$(foreach p,$(java_awt_peers),$(p)))
+      endif
+      ifneq (,$(findstring gtk,$(java_awt_peers)))
+        CONFARGS += --enable-gtk-cairo
+      endif
+    endif
   endif
   jvm_ext = -$(DEB_TARGET_ARCH)$(if $(filter yes,$(DEB_CROSS)),-cross)
   jvm_dir = /usr/lib/jvm/$(jvm_name_short)$(jvm_ext)
@@ -378,9 +382,6 @@ ifeq ($(with_java),yes)
   else
     CONFARGS += --with-ecj-jar=$(ecj_jar)
   endif
-  ifneq ($(with_libgcj),yes)
-    CONFARGS += --disable-libgcj
-  endif
 endif
 
 ifeq ($(with_gcj),yes)

--- End Message ---
--- Begin Message ---
Version: 6.5.0-2+rm

Dear submitter,

as the package gcc-6 has just been removed from the Debian archive
unstable we hereby close the associated bug reports.  We are sorry
that we couldn't deal with your issue properly.

For details on the removal, please see https://bugs.debian.org/920171

The version of this package that was in Debian prior to this removal
can still be found using http://snapshot.debian.org/.

This message was generated automatically; if you believe that there is
a problem with it please contact the archive administrators by mailing
ftpmaster@ftp-master.debian.org.

Debian distribution maintenance software
pp.
Scott Kitterman (the ftpmaster behind the curtain)

--- End Message ---

Reply to: