Bug#949460: openjdk-14 FTCBFS: missing build-depends and wrong tools

2020-01-20 Thread Helmut Grohne
On Tue, Jan 21, 2020 at 05:40:24AM +0100, Helmut Grohne wrote:
> Please consider applying the attached patch.

Uhm. Seems like I forgot something.

Helmut
diff --minimal -Nru openjdk-14-14~32/debian/changelog 
openjdk-14-14~32/debian/changelog
--- openjdk-14-14~32/debian/changelog   2020-01-16 23:31:42.0 +0100
+++ openjdk-14-14~32/debian/changelog   2020-01-20 20:10:45.0 +0100
@@ -1,3 +1,12 @@
+openjdk-14 (14~32-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
++ Missing Build-Depends: zlib1g-dev:native.
++ Use triplet-prefixed objcopy and strip.
+
+ -- Helmut Grohne   Mon, 20 Jan 2020 20:10:45 +0100
+
 openjdk-14 (14~32-1) unstable; urgency=medium
 
   * OpenJDK 14 snapshot, build 32.
diff --minimal -Nru openjdk-14-14~32/debian/control 
openjdk-14-14~32/debian/control
--- openjdk-14-14~32/debian/control 2019-10-18 15:55:10.0 +0200
+++ openjdk-14-14~32/debian/control 2020-01-20 20:09:15.0 +0100
@@ -12,7 +12,7 @@
   openjdk-13-jdk-headless:native | openjdk-14-jdk-headless:native,
   libxtst-dev, libxi-dev, libxt-dev, libxaw7-dev, libxrender-dev, 
libcups2-dev, libasound2-dev, liblcms2-dev, libfreetype6-dev (>= 2.2.1), 
libxinerama-dev, libkrb5-dev, xsltproc, libpcsclite-dev, libxrandr-dev, 
libelf-dev, libfontconfig1-dev, libgtk2.0-0 | libgtk-3-0,
   libffi-dev,
-  zlib1g-dev, libattr1-dev, libpng-dev, libjpeg-dev, libgif-dev, 
+  zlib1g-dev, zlib1g-dev:native, libattr1-dev, libpng-dev, libjpeg-dev, 
libgif-dev,
   libnss3-dev (>= 2:3.17.1),
   openjdk-14-jdk-headless ,
 Build-Depends-Indep: graphviz, pandoc,
diff --minimal -Nru openjdk-14-14~32/debian/rules openjdk-14-14~32/debian/rules
--- openjdk-14-14~32/debian/rules   2020-01-16 22:46:33.0 +0100
+++ openjdk-14-14~32/debian/rules   2020-01-20 20:10:43.0 +0100
@@ -28,6 +28,9 @@
 DEB_HOST_ARCH_CPU  ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_ARCH_CPU)
 DEB_HOST_MULTIARCH ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_MULTIARCH)
 
+OBJCOPY := $(DEB_HOST_GNU_TYPE)-objcopy
+STRIP := $(DEB_HOST_GNU_TYPE)-strip
+
 PATH := $(CURDIR)/bin:$(PATH)
 export PATH
 
@@ -1774,18 +1777,18 @@
id=$$(echo $$i | sed -r 's,debian/[^/]+,$(d_dbg)/usr/lib/debug,'); \
echo strip $$i; \
mkdir -p $$(dirname $$id); \
-   objcopy --only-keep-debug $$i $$id; \
+   $(OBJCOPY) --only-keep-debug $$i $$id; \
chmod 644 $$id; \
-   strip --remove-section=.comment --remove-section=.note \
+   $(STRIP) --remove-section=.comment --remove-section=.note \
  --strip-debug $$i; \
-   objcopy --add-gnu-debuglink $$id $$i; \
+   $(OBJCOPY) --add-gnu-debuglink $$id $$i; \
  else \
d=usr/lib/debug/.build-id/$${b_id:0:2}; \
f=$${b_id:2}.debug; \
mkdir -p $(d_dbg)/$$d; \
-   objcopy --only-keep-debug --compress-debug-sections $$i 
$(d_dbg)/$$d/$$f; \
+   $(OBJCOPY) --only-keep-debug --compress-debug-sections $$i 
$(d_dbg)/$$d/$$f; \
chmod 644 $(d_dbg)/$$d/$$f; \
-   strip --remove-section=.comment --remove-section=.note $$i; \
+   $(STRIP) --remove-section=.comment --remove-section=.note $$i; \
  fi; \
done
 endif


Bug#949460: openjdk-14 FTCBFS: missing build-depends and wrong tools

2020-01-20 Thread Helmut Grohne
Source: openjdk-14
Version: 14~32-1
Tags: patch
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

openjdk-14 fails to cross build from source. The immediate failure is
when linking -lz using the build architecture compiler, because there is
not dependency on zlib1g-dev:native. In this case, it seems that the
build rules are already fully correct and openjdk really needs a build
tool that links -lz. As such it should have a relevant dependency on
zlib1g-dev:native. Once adding it, the build proceeds much further until
it finally fails when debian/rules invokes the build architecture
objcopy and strip. Using triplet-prefixed tools is necessary here. After
doing so, openjdk-14 cross builds successfully. Please consider applying
the attached patch.

At least the dependency issue appears to also affect openjdk-11 and
openjdk-13. Do you prefer fixing it yourself there or should I send
separate patchs?

Helmut