Skip to contentSkip to conversation

Fix some issues of openjdk-8/openjre-8 headful build

PATCH Applied [email protected] 2 participants 7 messages Apr 23, 2017 – Apr 28, 2017

lore
Share & tools
lore
#0 lore raw

cover Fix some issues of openjdk-8/openjre-8 headful build

From: Ming Liu <[email protected]>

This patch series fix some issues, so the openjdk-8/openjre-8 now can build with X11 system (headful).

Ming Liu (5):
openjdk-8-cross.inc: change a dependency alsa-lib-native to alsa-lib openjdk-8-cross.inc: fix wrong sysroot path openjdk-8-cross.inc: tweak PACKAGECONFIG default value openjdk-8/openjre-8: merge some redundant code openjdk-8-cross.inc: fix a libpng build issue

 recipes-core/openjdk/openjdk-8-cross.inc           | 32 +++++++++++++++++++---
 recipes-core/openjdk/openjdk-8_102b14.bb           | 14 ----------
 recipes-core/openjdk/openjre-8_102b14.bb           | 14 ----------
 .../openjdk8-fix-libpng-neon-build.patch           | 29 ++++++++++++++++++++
 4 files changed, 57 insertions(+), 32 deletions(-)
 create mode 100644 recipes-core/openjdk/patches-openjdk-8/openjdk8-fix-libpng-neon-build.patch
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/5 openjdk-8-cross.inc: change a dependency alsa-lib-native to alsa-lib

From: Ming Liu <[email protected]>

For cross compiling, it should DEPENDS on alsa-lib instead of alsa-lib-native.

---
 recipes-core/openjdk/openjdk-8-cross.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-core/openjdk/openjdk-8-cross.inc +1 -1
index 47fe35d..b328395 100644
@@ -18,7 +18,7 @@ PRIVATE_LIBS = "\
 PACKAGECONFIG ??= "repack"
 PACKAGECONFIG[x11] = "--with-x,,libx11 xproto libxt libxext libxrender"
 PACKAGECONFIG[cups] = "--with-cups,,cups"
-PACKAGECONFIG[alsa] = "--with-alsa,,alsa-lib-native"
+PACKAGECONFIG[alsa] = "--with-alsa,,alsa-lib"
 
 PACKAGECONFIG[jce] = "--enable-unlimited-crypto,,"
 
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/5 openjdk-8-cross.inc: fix wrong sysroot path

In reply to [email protected]

From: Ming Liu <[email protected]>

The '--with-sys-root' should be set to ${STAGING_DIR_HOST} but not ${STAGING_DIR}.

---
 recipes-core/openjdk/openjdk-8-cross.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-core/openjdk/openjdk-8-cross.inc +1 -1
index b328395..11e98b5 100644
@@ -42,7 +42,7 @@ SRC_URI_append = "\
 EXTRA_OECONF_append = "\
     --with-jobs=${@java_get_parallel_make(d)} \
     \
-    --with-sys-root=${STAGING_DIR} \
+    --with-sys-root=${STAGING_DIR_HOST} \
     --with-tools-dir=${STAGING_DIR_NATIVE} \
     --with-boot-jdk=${STAGING_LIBDIR_NATIVE}/jvm/openjdk-8-native \
     --with-cacerts-file=${STAGING_LIBDIR_NATIVE}/jvm/openjdk-8-native/jre/lib/security/cacerts \
Signature · 1 line
2.7.4
#3 lore raw

PATCH 3/5 openjdk-8-cross.inc: tweak PACKAGECONFIG default value

In reply to [email protected]

From: Ming Liu <[email protected]>

When x11, alsa is being set in DISTRO_FEATURES, the users might expect openjdk build with the related options as well. For instance, they might be confused when the openjdk is still built as headless but x11 is actually enabled from system aspect.

With this patch, the end users still can choose build openjdk without these options by overriding PACKAGECONFIG.

Two small fixes are also needed to let openjdk build with x11:
- Add libxtst to DEPENDS.
- Pass ac_x_includes and ac_x_libraries to configure command.

---
 recipes-core/openjdk/openjdk-8-cross.inc | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
recipes-core/openjdk/openjdk-8-cross.inc +11 -2
index 11e98b5..3973fcf 100644
@@ -15,8 +15,12 @@ PRIVATE_LIBS = "\
     libsctp.so libsplashscreen.so libsunec.so libunpack.so libverify.so libzip.so \
 "
 
-PACKAGECONFIG ??= "repack"
-PACKAGECONFIG[x11] = "--with-x,,libx11 xproto libxt libxext libxrender"
+PACKAGECONFIG ??= " \
+    repack \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 cups', '', d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)} \
+"
+PACKAGECONFIG[x11] = "--with-x,,libx11 xproto libxt libxext libxrender libxtst"
 PACKAGECONFIG[cups] = "--with-cups,,cups"
 PACKAGECONFIG[alsa] = "--with-alsa,,alsa-lib"
 
@@ -31,6 +35,11 @@ PACKAGECONFIG[shark] = "--with-jvm-variants=zeroshark,,llvm3.5,"
 
 PACKAGECONFIG[repack] = ",,,"
 
+CACHED_CONFIGUREVARS = " \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'ac_x_includes=${STAGING_INCDIR}', '', d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'ac_x_libraries=${STAGING_LIBDIR}', '', d)} \
+"
+
 require openjdk-8-common.inc
 
 JAVA_HOME[unexport] = "1"
Signature · 1 line
2.7.4
#4 lore raw

PATCH 4/5 openjdk-8/openjre-8: merge some redundant code

In reply to [email protected]

From: Ming Liu <[email protected]>

A identical PATCHES_URI_append is being set both in openjdk-8 and openjre-8, merge them into openjdk-8-cross.inc.

---
 recipes-core/openjdk/openjdk-8-cross.inc | 14 ++++++++++++++
 recipes-core/openjdk/openjdk-8_102b14.bb | 14 --------------
 recipes-core/openjdk/openjre-8_102b14.bb | 14 --------------
 3 files changed, 14 insertions(+), 28 deletions(-)
recipes-core/openjdk/openjdk-8-cross.inc +14 -0
index 3973fcf..247438f 100644
@@ -1,6 +1,20 @@
 JDK_HOME = "${libdir_jvm}/openjdk-8"
 JRE_HOME = "${libdir_jvm}/openjre-8"
 
+# some patches extracted from http://cr.openjdk.java.net/~rkennke/shark-build-hotspot/webrev.01/hotspot.patch
+# reported via http://mail.openjdk.java.net/pipermail/build-dev/2015-January/013972.html
+# by Roman Kennke (rkennke at redhat.com)
+PATCHES_URI_append = "\
+    file://openjdk8-restrict-to-staging-dir.patch;apply=no \
+    file://openjdk8-fix-shark-build.patch;apply=no \
+    file://openjdk8-fix-shark-stdc++11.patch;apply=no \
+    file://openjdk8-fix-assembler-flag-handling-in-makefile.patch;apply=no \
+    file://openjdk8-fix-adlc-flags.patch;apply=no \
+    file://openjdk8-silence-d_fortify_source-warning.patch;apply=no \
+    file://openjdk8-fix-zero-mode-crash.patch;apply=no \
+    file://openjdk8-add-missing-linker-flags.patch;apply=no \
+"
+
 DEPENDS = "\
     openjdk-8-native zip-native ant-native libxslt \
     jpeg libpng krb5 libffi fontconfig freetype \
recipes-core/openjdk/openjdk-8_102b14.bb +0 -14
index 210c897..efed329 100644
@@ -1,20 +1,6 @@
 require openjdk-8-release-102b14.inc
 require openjdk-8-cross.inc
 
-# some patches extracted from http://cr.openjdk.java.net/~rkennke/shark-build-hotspot/webrev.01/hotspot.patch
-# reported via http://mail.openjdk.java.net/pipermail/build-dev/2015-January/013972.html
-# by Roman Kennke (rkennke at redhat.com)
-PATCHES_URI_append = "\
-    file://openjdk8-restrict-to-staging-dir.patch;apply=no \
-    file://openjdk8-fix-shark-build.patch;apply=no \
-    file://openjdk8-fix-shark-stdc++11.patch;apply=no \
-    file://openjdk8-fix-assembler-flag-handling-in-makefile.patch;apply=no \
-    file://openjdk8-fix-adlc-flags.patch;apply=no \
-    file://openjdk8-silence-d_fortify_source-warning.patch;apply=no \
-    file://openjdk8-fix-zero-mode-crash.patch;apply=no \
-    file://openjdk8-add-missing-linker-flags.patch;apply=no \
-"
-
 do_install() {
     rm -rf ${D}${JDK_HOME}
     mkdir -p ${D}${JDK_HOME}
recipes-core/openjdk/openjre-8_102b14.bb +0 -14
index 88160e1..f47c62c 100644
@@ -1,20 +1,6 @@
 require openjdk-8-release-102b14.inc
 require openjdk-8-cross.inc
 
-# some patches extracted from http://cr.openjdk.java.net/~rkennke/shark-build-hotspot/webrev.01/hotspot.patch
-# reported via http://mail.openjdk.java.net/pipermail/build-dev/2015-January/013972.html
-# by Roman Kennke (rkennke at redhat.com)
-PATCHES_URI_append = "\
-    file://openjdk8-restrict-to-staging-dir.patch;apply=no \
-    file://openjdk8-fix-shark-build.patch;apply=no \
-    file://openjdk8-fix-shark-stdc++11.patch;apply=no \
-    file://openjdk8-fix-assembler-flag-handling-in-makefile.patch;apply=no \
-    file://openjdk8-fix-adlc-flags.patch;apply=no \
-    file://openjdk8-silence-d_fortify_source-warning.patch;apply=no \
-    file://openjdk8-fix-zero-mode-crash.patch;apply=no \
-    file://openjdk8-add-missing-linker-flags.patch;apply=no \
-"
-
 do_install() {
     rm -rf ${D}${JRE_HOME}
     mkdir -p ${D}${JRE_HOME}
Signature · 1 line
2.7.4
#5 lore raw

PATCH 5/5 openjdk-8-cross.inc: fix a libpng build issue

In reply to [email protected]

From: Ming Liu <[email protected]>

JDK/JRE fails to build for ARM NEON machines, due to a undefined symbol
in libpng, as follows:
| build/jdk/objs/libsplashscreen/pngrutil.o: In function `png_init_filter_functions':
| jdk/src/share/native/sun/awt/libpng/pngrutil.c:4002: undefined reference to `png_init_filter_functions_neon'

This is a known issue already fixed in openjdk upstream, back-port the fix.

---
 recipes-core/openjdk/openjdk-8-cross.inc           |  1 +
 .../openjdk8-fix-libpng-neon-build.patch           | 29 ++++++++++++++++++++++
 2 files changed, 30 insertions(+)
 create mode 100644 recipes-core/openjdk/patches-openjdk-8/openjdk8-fix-libpng-neon-build.patch
recipes-core/openjdk/openjdk-8-cross.inc +1 -0
index 247438f..ad3a44d 100644
@@ -13,6 +13,7 @@ PATCHES_URI_append = "\
     file://openjdk8-silence-d_fortify_source-warning.patch;apply=no \
     file://openjdk8-fix-zero-mode-crash.patch;apply=no \
     file://openjdk8-add-missing-linker-flags.patch;apply=no \
+    file://openjdk8-fix-libpng-neon-build.patch;apply=no \
 "
 
 DEPENDS = "\
recipes-core/openjdk/patches-openjdk-8/openjdk8-fix-libpng-neon-build.patch new file +29 -0
new file mode 100644
index 0000000..dd6d8e3
@@ -0,0 +1,29 @@
+# HG changeset patch
+# User enevill
+# Date 1430816900 0
+#      Tue May 05 09:08:20 2015 +0000
+# Node ID 88d2b7d7285281d41bcff45af0dd983b0f72811e
+# Parent  51f5501a54a62aceed6342e7ea3a9a3c67f3885d
+8078245: AARCH64: JDK fails to build due to undefined symbol in libpng
+Summary: Add -DPNG_ARM_NEON_OPT=0 to LIBSPLASHSCREEN_CFLAGS flags
+Reviewed-by: dholmes, ihse, erikj
+
+Upstream-Status: Backport
+
+Signed-off-by: Ming Liu <[email protected]>
+---
+ jdk/make/lib/Awt2dLibraries.gmk |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git jdk/make/lib/Awt2dLibraries.gmk jdk/make/lib/Awt2dLibraries.gmk
+--- jdk/make/lib/Awt2dLibraries.gmk
++++ jdk/make/lib/Awt2dLibraries.gmk
+@@ -1205,7 +1205,7 @@ ifndef BUILD_HEADLESS_ONLY
+     LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/macosx/native/sun/awt/splashscreen
+   endif
+
+-  LIBSPLASHSCREEN_CFLAGS := -DSPLASHSCREEN -DPNG_NO_MMX_CODE \
++  LIBSPLASHSCREEN_CFLAGS := -DSPLASHSCREEN -DPNG_NO_MMX_CODE -DPNG_ARM_NEON_OPT=0 \
+       $(foreach dir, $(LIBSPLASHSCREEN_DIRS), -I$(dir))
+
+   ifeq ($(OPENJDK_TARGET_OS), macosx)
Signature · 1 line
2.7.4
#6 lore raw
In reply to [email protected]

Hi,

Quoted 12 lines · On Sun, Apr 23, 2017 at 08:54:51AM +0200, [email protected] wrote:

From: Ming Liu <[email protected]>

This patch series fix some issues, so the openjdk-8/openjre-8 now can build with X11 system (headful).

Ming Liu (5):
openjdk-8-cross.inc: change a dependency alsa-lib-native to alsa-lib openjdk-8-cross.inc: fix wrong sysroot path openjdk-8-cross.inc: tweak PACKAGECONFIG default value openjdk-8/openjre-8: merge some redundant code openjdk-8-cross.inc: fix a libpng build issue

Quoted 7 lines
 recipes-core/openjdk/openjdk-8-cross.inc           | 32 +++++++++++++++++++---
 recipes-core/openjdk/openjdk-8_102b14.bb           | 14 ----------
 recipes-core/openjdk/openjre-8_102b14.bb           | 14 ----------
 .../openjdk8-fix-libpng-neon-build.patch           | 29 ++++++++++++++++++++
 4 files changed, 57 insertions(+), 32 deletions(-)
 create mode 100644 recipes-core/openjdk/patches-openjdk-8/openjdk8-fix-libpng-neon-build.patch

Pushed to master-next. Thanks a lot !

Best Regards,
Maxin