From patchwork Mon Feb 11 19:10:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 1040100 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Mg0T44VQ"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43ywP55g2Wz9sCh for ; Tue, 12 Feb 2019 06:11:05 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id C92D186816; Mon, 11 Feb 2019 19:11:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YEnsrNkpdMJJ; Mon, 11 Feb 2019 19:10:57 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 3513D86399; Mon, 11 Feb 2019 19:10:57 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 144121BF348 for ; Mon, 11 Feb 2019 19:10:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 0F90722718 for ; Mon, 11 Feb 2019 19:10:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E8cm-Xyc33Yk for ; Mon, 11 Feb 2019 19:10:55 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-it1-f195.google.com (mail-it1-f195.google.com [209.85.166.195]) by silver.osuosl.org (Postfix) with ESMTPS id EC39F207A1 for ; Mon, 11 Feb 2019 19:10:54 +0000 (UTC) Received: by mail-it1-f195.google.com with SMTP id g85so964576ita.3 for ; Mon, 11 Feb 2019 11:10:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PFyBtih0RYcSZWUo2FUo91RdnGzAZU3JkM4O8OEHXYA=; b=Mg0T44VQ+49g9q+VQpOYB+aVxYaC3LjnZI6dAyx2MWooeuFkbcZjElLGh+yoB2kYki nSbigrP7H/6JFGQE2+J5d5pOoODuojhkc8zM52awexjSeX/yPpWrVRwvFoULWToAUS8l J7CkjBMLQdDOgodE+Rji5QknXlizbN3K4OW902ECF2O/GJo9ipg+832LwiEClg3EwZNQ FoMd24Z42OYunVxGFSEUhdhLFxcaZrsWzkd5NrbDq7czKTstXWiLIQ3r3SQICzE8FSy/ u2MW6VeHzEI0W7bNLazItFdGovh5fuPANxuGcnncVedkSBE9j/Uyg59EfE/xX9eXMKI7 pdQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PFyBtih0RYcSZWUo2FUo91RdnGzAZU3JkM4O8OEHXYA=; b=KsR0R6Z5evqn8VthKAQwvt4IpdRTpbpLNRZsh1fup+5NIOu7OVqzKxFB2a+6jBA8Ym +cIxqGUtejcyiTvscnhWHKfKi82P+nBIvfrJbXfDHOJvIUXTznjVfSs/cBVLj+mDQVlq AmfzqTah4sPBOGsPiZmLTy0KFDGKhXXh8KIG0G1SDFftpWS7lm0+rQfJ7aQTaRxbo4M7 GsCUDRHMquQYbgq/KhMRatIwnKCJjsvyejRsvB/sir/i6VA7jdRCh+2I0EU9Zvxkagim fPEYdiRc57b7uYJ/7SXMUlZ64aXpKILxoCtK4edvBU4elIjOj+dc55gzCzan6eMMshcE mH9A== X-Gm-Message-State: AHQUAuZcQYjOK1jxfOvAvZTwQL75UhEddFMren4eUxErQyvdw7m43erd 0fR7WUB6AFvh63oH4C9CyySYbNmv X-Google-Smtp-Source: AHgI3IZr1hMXnQSjXPp3MoYgLQA+rmCMmlQrwcKUAghNEOqH5L6WyQD6Rj8OwqCgyqm2+r23laD7pQ== X-Received: by 2002:a24:b711:: with SMTP id h17mr574202itf.120.1549912253875; Mon, 11 Feb 2019 11:10:53 -0800 (PST) Received: from localhost.localdomain (68-188-149-81.dhcp.aldl.mi.charter.com. [68.188.149.81]) by smtp.gmail.com with ESMTPSA id s26sm4786821ioe.86.2019.02.11.11.10.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Feb 2019 11:10:53 -0800 (PST) From: aduskett@gmail.com To: buildroot@buildroot.org Date: Mon, 11 Feb 2019 14:10:49 -0500 Message-Id: <20190211191051.62970-1-aduskett@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v7 1/3] openjdk: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Adam Duskett Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Adam Duskett OpenJDK is a free and open-source implementation of the Java Platform. This package provides the option to build a client or a server JVM interpreter. The default option is the server option, as that is what the majority of users use. This JVM interpreter loads more slowly, putting more effort into JIT compilations to yield higher performance. Unlike most autotools packages, OpenJDK is exceptionally different and has many quirks, some of which are below: - X11, alsa, and cups are required to build Java, even if it's a headless build. See http://hg.openjdk.java.net/jdk10/jdk10/raw-file/tip/common/doc/building.html#external-library-requirements for more information. - host-zip is needed for the zip executable. - There is no autogen.sh file, instead, a user must call "./configure autogen." - OpenJDK ignores some variables unless passed via the environment. These variables are: PATH, LD, CC, CXX, and CPP. - OpenJDK defaults ld to the ld binary but passes -Xlinker and -z as arguments during the linking process, which causes linking failures. To fix this issue, ld is set to gcc. - If ccache is enabled, Buildroot sets CC, CXX, and CPP to the ccache binary, which causes the configuration error: "Please use --enable-ccache instead of providing a wrapped compiler." This error is why CC, CPP, and CXX are explicitly set to point to their actual binaries. - Make -jn is unsupported. Instead, one must use the "--with-jobs=" configure option, and use $(MAKE1). - Even when cross-compiling, OpenJDK builds several host-tools using the host's gcc. In the case of zlib, if a host doesn't have the zlib development package installed, OpenJDK compilation stops because zlib.h won't exist on the host system. Because zlib is used to compile both native tools and cross-compiled tools, patching make/autoconf/lib-bundled.m4 to call PKG_CHECK_MODULES for zlib results in the host gcc trying to use cross-compiled libraries for compiling native tools, which results in linking failures. Using --with-zlib=bundled allows OpenJDK to compile correctly. Signed-off-by: Adam Duskett --- Changes v1 -> v2: - Fixed the patch name. Changes v2 -> v3: - Changed the install location of the libraries and binaries to $(TARGET_DIR)/bin and $(TARGET_DIR)/lib. - Changed -with-boot-jdk location to $(HOST_DIR)/openjdk - Added a more in-depth commit message explaining some of the my reasoning for some of the quirks in the package files. Changes v3 -> v4: - Changed GPLv2+ -> GPL-2.0+ (Thomas) - Added BR2_PACKAGE_HOST_OPENJDK_BIN_ARCH_SUPPORTS to Config.in - Removed first person wordage. (Thomas) Changes v4 -> v5: - Add jpeg, giflib, libpng, and zlib as dependencies. (Thomas) - Remove dependencies that aren't necessary. (Thomas) - Add better comments in the openjdk.mk file. (Matthew) - Change --with-boot-jdk location to just $(HOST_DIR) - Use newer Oracle provided cpu port for aarch64. - Update version to 11.0.2+9 Changes v5 -> v6: - Added comment about zlib in the commit message. - Added LCMS2 as a dependency. - Added more comments in Config.in - Added host-zip as a dependency in openjdk.mk. - Drop zlib as a dependency (See above comment.) - Changed --with-zlib=system to --with-zlib=bundled (See above comment.) - Cleaned up grammar in openjdk.mk. - Removed uneeded conf_opts in openjdk.mk. - Reverted previous change of --with-cpu-port=aarch64 to --with-cpu-port=arm64. This change breaks compiling, with missing calls to NativePltCall. Changes v6 -> v7: - Removed AArch64 support in favor of a separate patch. OpenJDK works on AArch64 without the option; it just isn't as fast. This change makes the patch set follow section 21.5.1 of the Buildroot manual: "The patch itself should do only one change, but do it completely." - Fix typos (Thomas) - Clean up spacing in oppenjdk.mk (Thomas) - Add more explanations to the commit message (Thomas) - Clean up grammar in the openjdk.mk comments. - Clean up grammar in the commit message. - Reword many of the comments in the openjdk.mk file to better explain why the reasoning behind the logic. - Remove --prefix from configure options. This option is used only if "make install" is called. - Removed --with-extra-path=$(HOST_DIR)/bin:$(HOST_DIR)/sbin, as this is also not needed. - Change cp -rf to cp -dpfr for the OPENJDK_INSTALL_TARGET_CMDS step. DEVELOPERS | 1 + package/Config.in | 1 + package/openjdk/Config.in | 56 +++++++++++++++++ package/openjdk/openjdk.hash | 3 + package/openjdk/openjdk.mk | 114 +++++++++++++++++++++++++++++++++++ 5 files changed, 175 insertions(+) create mode 100644 package/openjdk/Config.in create mode 100644 package/openjdk/openjdk.hash create mode 100644 package/openjdk/openjdk.mk diff --git a/DEVELOPERS b/DEVELOPERS index 89a8e2d2a2..a36c359561 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -50,6 +50,7 @@ F: package/libselinux/ F: package/libsemanage/ F: package/libsepol/ F: package/nginx-naxsi/ +F: package/openjdk/ F: package/openjdk-bin/ F: package/policycoreutils/ F: package/python-flask-sqlalchemy/ diff --git a/package/Config.in b/package/Config.in index 29862c478c..4bd946d65e 100644 --- a/package/Config.in +++ b/package/Config.in @@ -668,6 +668,7 @@ menu "Mono libraries/modules" endmenu endif source "package/nodejs/Config.in" + source "package/openjdk/Config.in" source "package/perl/Config.in" if BR2_PACKAGE_PERL menu "Perl libraries/modules" diff --git a/package/openjdk/Config.in b/package/openjdk/Config.in new file mode 100644 index 0000000000..4dd55764b7 --- /dev/null +++ b/package/openjdk/Config.in @@ -0,0 +1,56 @@ +config BR2_PACKAGE_HOST_OPENJDK_BIN_ARCH_SUPPORTS + bool + default y if BR2_HOSTARCH = "x86_64" + +config BR2_PACKAGE_OPENJDK + bool "OpenJDK" + depends on !BR2_SOFT_FLOAT + depends on !BR2_STATIC_LIBS # Glibc + depends on BR2_INSTALL_LIBSTDCPP # cups + depends on BR2_TOOLCHAIN_HAS_THREADS # alsa-lib, cups, libusb + depends on BR2_TOOLCHAIN_USES_GLIBC + depends on BR2_USE_MMU # cups + depends on BR2_PACKAGE_XORG7 + select BR2_PACKAGE_ALSA_LIB + select BR2_PACKAGE_CUPS + select BR2_PACKAGE_FONTCONFIG + select BR2_PACKAGE_GIFLIB + select BR2_PACKAGE_JPEG + select BR2_PACKAGE_LCMS2 + select BR2_PACKAGE_LIBPNG + select BR2_PACKAGE_LIBUSB + select BR2_PACKAGE_XLIB_LIBXRENDER + select BR2_PACKAGE_XLIB_LIBXT + select BR2_PACKAGE_XLIB_LIBXTST + help + OpenJDK is a free and open-source implementation of the + Java Platform. + + http://openjdk.java.net/ + +if BR2_PACKAGE_OPENJDK + +menu "JVM Variants" + +config BR2_PACKAGE_OPENJDK_JVM_VARIANT_CLIENT + bool "client" + help + Quick loading, but slower run-time performance. + +config BR2_PACKAGE_OPENJDK_JVM_VARIANT_SERVER + bool "server" + default y + help + Slower loading, but faster run-time performance. + +endmenu +endif + +comment "OpenJDK needs X11, glibc, and a toolchain w/ wchar, dynamic library, threads, C++" + depends on BR2_USE_MMU + depends on BR2_PACKAGE_XORG7 + depends on BR2_STATIC_LIBS || !BR2_INSTALL_LIBSTDCPP || \ + !BR2_TOOLCHAIN_HAS_THREADS || !BR2_TOOLCHAIN_USES_GLIBC + +comment "OpenJDK does not support soft floats" + depends on BR2_SOFT_FLOAT diff --git a/package/openjdk/openjdk.hash b/package/openjdk/openjdk.hash new file mode 100644 index 0000000000..8b14609066 --- /dev/null +++ b/package/openjdk/openjdk.hash @@ -0,0 +1,3 @@ +# Locally computed +sha256 6c69a2c1b5177659d4263545cf83e0fbcd697669b0107481372be3648af7b89b openjdk-jdk-11.0.2+9.tar.gz +sha256 4b9abebc4338048a7c2dc184e9f800deb349366bdf28eb23c2677a77b4c87726 LICENSE diff --git a/package/openjdk/openjdk.mk b/package/openjdk/openjdk.mk new file mode 100644 index 0000000000..5a486dd200 --- /dev/null +++ b/package/openjdk/openjdk.mk @@ -0,0 +1,114 @@ +################################################################################ +# +# openjdk +# +################################################################################ + +OPENJDK_VERSION_MAJOR = 11.0.2 +OPENJDK_VERSION_MINOR = 9 +OPENJDK_VERSION = jdk-$(OPENJDK_VERSION_MAJOR)+$(OPENJDK_VERSION_MINOR) +OPENJDK_SITE = $(call github,AdoptOpenJDK,openjdk-jdk11u,$(OPENJDK_VERSION)) +OPENJDK_LICENSE = GPL-2.0+ with exception +OPENJDK_LICENSE_FILES = LICENSE + +# OpenJDK requires Alsa, cups, and X11 even for a headless build. +# host-zip is needed for the zip executable. +OPENJDK_DEPENDENCIES = \ + host-openjdk-bin \ + host-pkgconf \ + host-zip \ + alsa-lib \ + cups \ + fontconfig \ + giflib \ + jpeg \ + lcms2 \ + libpng \ + libusb \ + xlib_libXrender \ + xlib_libXt \ + xlib_libXtst + +# JVM variants +ifeq ($(BR2_PACKAGE_OPENJDK_JVM_VARIANT_CLIENT),y) +OPENJDK_JVM_VARIANTS += client +endif + +ifeq ($(BR2_PACKAGE_OPENJDK_JVM_VARIANT_SERVER),y) +OPENJDK_JVM_VARIANTS += server +endif +OPENJDK_JVM_VARIANT_LIST = $(subst $(space),$(comma),$(OPENJDK_JVM_VARIANTS)) + +# OpenJDK ignores some variables unless passed via the environment. +# These variables are PATH, LD, CC, CXX, and CPP. +# OpenJDK defaults ld to the ld binary but passes -Xlinker and -z as +# arguments during the linking process, which causes compilation failures. +# To fix this issue, LD is set to point to gcc. +# If ccache is enabled, Buildroot sets CC, CXX, and CPP to the ccache binary, +# which causes the configuration error: +# "Please use --enable-ccache instead of providing a wrapped compiler." +# This error is why CC, CPP, and CXX are explicitly set to point to their +# actual binaries. +OPENJDK_CONF_ENV = \ + PATH=$(BR_PATH) \ + CC=$(TARGET_CC) \ + CPP=$(TARGET_CPP) \ + CXX=$(TARGET_CXX) \ + LD=$(TARGET_CC) + +OPENJDK_CONF_OPTS = \ + --disable-full-docs \ + --disable-hotspot-gtest \ + --disable-manpages \ + --disable-warnings-as-errors \ + --enable-headless-only \ + --enable-openjdk-only \ + --enable-unlimited-crypto \ + --openjdk-target=$(GNU_TARGET_NAME) \ + --with-boot-jdk=$(HOST_DIR) \ + --with-debug-level=release \ + --with-devkit=$(HOST_DIR) \ + --with-extra-cflags="$(TARGET_CFLAGS)" \ + --with-extra-cxxflags="$(TARGET_CXXFLAGS)" \ + --with-giflib=system \ + --with-jobs=$(PARALLEL_JOBS) \ + --with-jvm-variants=$(OPENJDK_JVM_VARIANT_LIST) \ + --with-lcms=system \ + --with-libjpeg=system \ + --with-libpng=system \ + --with-native-debug-symbols=none \ + --without-version-pre \ + --with-sysroot=$(STAGING_DIR) \ + --with-vendor-name="AdoptOpenJDK" \ + --with-vendor-url="https://adoptopenjdk.net/" \ + --with-vendor-version-string="AdoptOpenJDK" \ + --with-version-build="$(OPENJDK_VERSION_MAJOR)" \ + --with-version-string="$(OPENJDK_VERSION_MAJOR)" \ + --with-zlib=bundled + +ifeq ($(BR2_CCACHE),y) +OPENJDK_CONF_OPTS += \ + --enable-ccache \ + --with-ccache-dir=$(BR2_CCACHE_DIR) +endif + +# Autogen and configure are performed in a single step. +define OPENJDK_CONFIGURE_CMDS + chmod +x $(@D)/configure + cd $(@D); $(OPENJDK_CONF_ENV) ./configure autogen $(OPENJDK_CONF_OPTS) +endef + +# Make -jn is unsupported. Instead, set the "--with-jobs=" configure option, +# and use $(MAKE1). +define OPENJDK_BUILD_CMDS + $(MAKE1) -C $(@D) legacy-jre-image +endef + +# Calling make install always builds and installs the JDK instead of the JRE, +# which makes manual installation necessary. +define OPENJDK_INSTALL_TARGET_CMDS + cp -dpfr $(@D)/build/linux-*-release/images/jre/bin/* $(TARGET_DIR)/usr/bin/ + cp -dpfr $(@D)/build/linux-*-release/images/jre/lib/* $(TARGET_DIR)/usr/lib/ +endef + +$(eval $(generic-package)) From patchwork Mon Feb 11 19:10:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 1040101 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="C2U0J4WV"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43ywP94l3dz9sML for ; Tue, 12 Feb 2019 06:11:09 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 03E3D863D9; Mon, 11 Feb 2019 19:11:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JaW+HO9sWdnR; Mon, 11 Feb 2019 19:11:01 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id E78F88673C; Mon, 11 Feb 2019 19:10:58 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id BF6971BF348 for ; Mon, 11 Feb 2019 19:10:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id BD21322718 for ; Mon, 11 Feb 2019 19:10:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UKXh5cUqLMZu for ; Mon, 11 Feb 2019 19:10:56 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-it1-f196.google.com (mail-it1-f196.google.com [209.85.166.196]) by silver.osuosl.org (Postfix) with ESMTPS id 410F8207A1 for ; Mon, 11 Feb 2019 19:10:56 +0000 (UTC) Received: by mail-it1-f196.google.com with SMTP id z20so977070itc.3 for ; Mon, 11 Feb 2019 11:10:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5Tkfnv4A9/ULWMDhhb56X1ZW5TL7kxJnU4cmLSxh3fo=; b=C2U0J4WVCDONAfOp7+OPOamjlPkkdZT6JW8QL9cGcHi2hHVL+hbubmviGhWXjFn5Dn W4A8Lod29kv069pu3J3ERvtVQe++DlTTNS/6gGWlbIamI1LwMI4SDuP2iMupVwZo3Yor 4xLM8ZE0XsIZTKJElMrOUCsENCy3geWeRTlxDGEl9pGnIEjPMQzetYEKgsavCYAhGi3v VFuDeb5qQgq/Lenp9G19P12iUgZkX3+7TtcNk+aVF35qkRA/ZU+J5cndTx+GlPtXewMH Wa7VKnyjG2lkIKv7Bp0BnWvAKCqV51pWrz96c8r4ZEKQr/stC2Byg7kY7IkTRCHCw+X3 p4jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5Tkfnv4A9/ULWMDhhb56X1ZW5TL7kxJnU4cmLSxh3fo=; b=oNHPX7h2pHmbyKlHW3b6+3JhrNCnMO3lmZBll0dio0TMzqBFKgWdrXONm2tBqWzTBK lM7H4PYOOFNLdczWRbARZhXiy/opdd+AyjRqLt4SuMaxBBjyRnhANJeNu6ZhJZXN1NpR pbejaU75cKqcUAm01q3Om4qHZSm11kuyTqlEEG2azNJaPTeY7wF3EcJbBuW6kq080Lvz FAUJ6YJwYtJSrrXlPpsZH/vyu4Xv6DpKNZfUbfaTwkGk2kFetezichL9xpO2gILqGTJH LM5ADEEhaucH85RK3qjHfSCYw5oxEFYCD9EO3g86wUTcRlP16GdJ0skW9DSm10AHy5xA AOKA== X-Gm-Message-State: AHQUAuZMhMdd4PLHTzln3cz01XlHf2odfh1piF9cLXcc4pWJDMvkDrQF rSjRoqbSgeL984AVfZCwQBpfGF3E X-Google-Smtp-Source: AHgI3IY1Z/LRzmW6pOro+7fmavHqoU8YxcVvA4SK1Fny82uxTiM8RpEZV9iBt/2s/v3S7E325jFCSQ== X-Received: by 2002:a24:70e:: with SMTP id f14mr591602itf.67.1549912255354; Mon, 11 Feb 2019 11:10:55 -0800 (PST) Received: from localhost.localdomain (68-188-149-81.dhcp.aldl.mi.charter.com. [68.188.149.81]) by smtp.gmail.com with ESMTPSA id s26sm4786821ioe.86.2019.02.11.11.10.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Feb 2019 11:10:54 -0800 (PST) From: aduskett@gmail.com To: buildroot@buildroot.org Date: Mon, 11 Feb 2019 14:10:50 -0500 Message-Id: <20190211191051.62970-2-aduskett@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211191051.62970-1-aduskett@gmail.com> References: <20190211191051.62970-1-aduskett@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v7 2/3] package/openjdk: package/openjdk: Add AArch64 support X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Adam Duskett Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Adam Duskett OpenJDK has CPU ports for the AArch64 and ARM architectures. Add support for AArch64 as the first. Signed-off-by: Adam Duskett --- package/openjdk/openjdk.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/package/openjdk/openjdk.mk b/package/openjdk/openjdk.mk index 5a486dd200..a2602ffd12 100644 --- a/package/openjdk/openjdk.mk +++ b/package/openjdk/openjdk.mk @@ -86,6 +86,11 @@ OPENJDK_CONF_OPTS = \ --with-version-string="$(OPENJDK_VERSION_MAJOR)" \ --with-zlib=bundled +# If building for AArch64, use the provided CPU port. +ifeq ($(BR2_aarch64),y) +OPENJDK_CONF_OPTS += --with-cpu-port=aarch64 --with-abi-profile=aarch64 +endif + ifeq ($(BR2_CCACHE),y) OPENJDK_CONF_OPTS += \ --enable-ccache \ From patchwork Mon Feb 11 19:10:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 1040102 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ColOhuVl"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43ywPB1frvz9sMl for ; Tue, 12 Feb 2019 06:11:09 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 2ADE52E7DA; Mon, 11 Feb 2019 19:11:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PZ7gJZ2dv7jT; Mon, 11 Feb 2019 19:11:01 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 6ED9F2E10C; Mon, 11 Feb 2019 19:11:00 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 9F8951BF348 for ; Mon, 11 Feb 2019 19:10:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 9D09485DE6 for ; Mon, 11 Feb 2019 19:10:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SJO08n4yRQ_k for ; Mon, 11 Feb 2019 19:10:57 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-it1-f193.google.com (mail-it1-f193.google.com [209.85.166.193]) by fraxinus.osuosl.org (Postfix) with ESMTPS id A2F7885B09 for ; Mon, 11 Feb 2019 19:10:57 +0000 (UTC) Received: by mail-it1-f193.google.com with SMTP id x124so790833itd.1 for ; Mon, 11 Feb 2019 11:10:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FJDKNJlMK5X8y8KAUooUWoKMPajpWrxvHkT7LHWW02c=; b=ColOhuVl1ZusEELSxtNU6PtYF4WAgGU6if6n9EHMzRkpFVzVOgSzJQda9+PE9Yt4U6 gUlLgNf4cqdLut9+PpBMHn31v+BIDy3LPseftsaVnnY5nSUMBsetzXp6/HxJGPoO6iSE XBgx+pQaKBpGIx8vj66WlEW6g1DmDmnU81gZCNGvxI1+RDIF4x+a+6E8gp2FU5Sdx32p q1WssfF4RGvnQPiC4oBx68YM1M7sFdupH2EEimnf1GnYc6fjB4AjHCCIzN4/fAm2Jwx/ SfI0YYDxeI74vgK7x0t4+CbNv7v+cRnuAsCgAgUUJXTyT/8QBhsRaLqxWNUZploT47DC OAHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FJDKNJlMK5X8y8KAUooUWoKMPajpWrxvHkT7LHWW02c=; b=iBkGE/qRzTmTu/Zm3DoMjEBkxbo0vtavFLenAOu6r//RNyeslZQ2Sem3r84ynaCBGF MNzJVHzepptfdTHDCqUnaPSAsHyAj6mNT6KkzAFHla+LvQ0OJWMqs9E9Wsh2Oc8MWRf8 U6y73udaxGBBuvan7AFBCNJV6ytFyMIdvtEm7BeVB+mtNpLjuVb1RPZbOmSYJdSPfPVw Hnz6pizxYlG6QtsO5XEpjqxR8g8kuC9cUYX4dfMARU1P6a4DPqzbJtystQFGxZ0RlwrY 1JNj6onUs7Id7rWrWY0RjTIumEFT9P5h435ymmrn4vtWrBLOHZ9uUGFuodAbWYM16Bsz wjoQ== X-Gm-Message-State: AHQUAuYDh/dtR33udaADZJ+d43gHRzTfH4WjZBxIISOOrIxm2tJ7hZ93 ecFZwDyTZL436VaYj5L7mpFSAOQp X-Google-Smtp-Source: AHgI3IbvnGbrfgLxSVVwoXNR+j4yq6d+UogSH07QRLf1Cy+duuK4AFU7VV9fz+6t9HhWt94huZchCQ== X-Received: by 2002:a5d:968a:: with SMTP id m10mr10693466ion.134.1549912256640; Mon, 11 Feb 2019 11:10:56 -0800 (PST) Received: from localhost.localdomain (68-188-149-81.dhcp.aldl.mi.charter.com. [68.188.149.81]) by smtp.gmail.com with ESMTPSA id s26sm4786821ioe.86.2019.02.11.11.10.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Feb 2019 11:10:56 -0800 (PST) From: aduskett@gmail.com To: buildroot@buildroot.org Date: Mon, 11 Feb 2019 14:10:51 -0500 Message-Id: <20190211191051.62970-3-aduskett@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211191051.62970-1-aduskett@gmail.com> References: <20190211191051.62970-1-aduskett@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v7 3/3] openjdk-hello-world: new test X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Daniel J . Leach" , Adam Duskett Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Daniel J. Leach This test is a simple "Hello, World" integration test of the OpenJDK package. It compiles the Java app on the host, then runs it on an emulated AARCH64 target and verifies "Hello, World" is printed. Signed-off-by: Daniel J. Leach Signed-off-by: Adam Duskett --- Changes v1 -> v3: - Added this patch to the series. Changes v3 -> v5: - None Changes v5 -> v6: - Updated .gitlab-ci.yml entry. - Fixed From: and SOB line. Changes v6 -> v7: - None .gitlab-ci.yml | 1 + DEVELOPERS | 1 + .../package/br2-external/openjdk/Config.in | 1 + .../br2-external/openjdk/external.desc | 1 + .../package/br2-external/openjdk/external.mk | 1 + .../package/openjdk-hello-world/Config.in | 26 ++++++++++++ .../openjdk-hello-world/HelloWorld.java | 7 ++++ .../openjdk-hello-world.mk | 18 ++++++++ support/testing/tests/package/test_openjdk.py | 42 +++++++++++++++++++ 9 files changed, 98 insertions(+) create mode 100644 support/testing/tests/package/br2-external/openjdk/Config.in create mode 100644 support/testing/tests/package/br2-external/openjdk/external.desc create mode 100644 support/testing/tests/package/br2-external/openjdk/external.mk create mode 100644 support/testing/tests/package/br2-external/openjdk/package/openjdk-hello-world/Config.in create mode 100644 support/testing/tests/package/br2-external/openjdk/package/openjdk-hello-world/HelloWorld.java create mode 100644 support/testing/tests/package/br2-external/openjdk/package/openjdk-hello-world/openjdk-hello-world.mk create mode 100644 support/testing/tests/package/test_openjdk.py diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2f0ebaa25c..b055d08634 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -328,6 +328,7 @@ tests.package.test_ipython.TestIPythonPy2: { extends: .runtime_test } tests.package.test_ipython.TestIPythonPy3: { extends: .runtime_test } tests.package.test_lua.TestLua: { extends: .runtime_test } tests.package.test_lua.TestLuajit: { extends: .runtime_test } +tests.package.test_openjdk.TestOpenJdk: { extends: .runtime_test } tests.package.test_perl.TestPerl: { extends: .runtime_test } tests.package.test_perl_class_load.TestPerlClassLoad: { extends: .runtime_test } tests.package.test_perl_dbd_mysql.TestPerlDBDmysql: { extends: .runtime_test } diff --git a/DEVELOPERS b/DEVELOPERS index a36c359561..eb88f75d92 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1478,6 +1478,7 @@ F: package/valijson/ F: package/wpa_supplicant/ F: package/wireless_tools/ F: package/xen/ +F: support/testing/tests/package/br2-external/openjdk/ N: Mauro Condarelli F: package/mc/ diff --git a/support/testing/tests/package/br2-external/openjdk/Config.in b/support/testing/tests/package/br2-external/openjdk/Config.in new file mode 100644 index 0000000000..00c7fd4799 --- /dev/null +++ b/support/testing/tests/package/br2-external/openjdk/Config.in @@ -0,0 +1 @@ +source "$BR2_EXTERNAL_OPENJDK_PATH/package/openjdk-hello-world/Config.in" diff --git a/support/testing/tests/package/br2-external/openjdk/external.desc b/support/testing/tests/package/br2-external/openjdk/external.desc new file mode 100644 index 0000000000..f28ba5060c --- /dev/null +++ b/support/testing/tests/package/br2-external/openjdk/external.desc @@ -0,0 +1 @@ +name: OPENJDK diff --git a/support/testing/tests/package/br2-external/openjdk/external.mk b/support/testing/tests/package/br2-external/openjdk/external.mk new file mode 100644 index 0000000000..54c24e8c64 --- /dev/null +++ b/support/testing/tests/package/br2-external/openjdk/external.mk @@ -0,0 +1 @@ +include $(sort $(wildcard $(BR2_EXTERNAL_OPENJDK_PATH)/package/*/*.mk)) diff --git a/support/testing/tests/package/br2-external/openjdk/package/openjdk-hello-world/Config.in b/support/testing/tests/package/br2-external/openjdk/package/openjdk-hello-world/Config.in new file mode 100644 index 0000000000..4f9022fb92 --- /dev/null +++ b/support/testing/tests/package/br2-external/openjdk/package/openjdk-hello-world/Config.in @@ -0,0 +1,26 @@ +config BR2_PACKAGE_OPENJDK_HELLO_WORLD + bool "openjdk hello world" + depends on BR2_PACKAGE_HOST_OPENJDK_BIN_ARCH_SUPPORTS + depends on BR2_TOOLCHAIN_USES_GLIBC + depends on BR2_PACKAGE_XORG7 + depends on BR2_USE_WCHAR # gtk2 -> glib2 + depends on BR2_TOOLCHAIN_HAS_THREADS # gtk2 -> glib2 + depends on BR2_USE_MMU # gtk2 -> glib2 + depends on BR2_INSTALL_LIBSTDCPP # gtk2, cups + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # C++11 + depends on BR2_TOOLCHAIN_HAS_SYNC_4 # gtk2 -> pango -> harfbuzz + depends on !BR2_STATIC_LIBS + select BR2_PACKAGE_OPENJDK + help + Simple class for testing openjdk + +comment "OpenJDK-hello-world needs a glibc toolchain w/ wchar, dynamic library, threads, C++, gcc >= 4.9" + depends on BR2_USE_MMU + depends on BR2_TOOLCHAIN_HAS_SYNC_4 + depends on BR2_PACKAGE_XORG7 + depends on !BR2_USE_WCHAR || \ + BR2_STATIC_LIBS || \ + !BR2_INSTALL_LIBSTDCPP || \ + !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 || \ + !BR2_TOOLCHAIN_HAS_THREADS || \ + !BR2_TOOLCHAIN_USES_GLIBC diff --git a/support/testing/tests/package/br2-external/openjdk/package/openjdk-hello-world/HelloWorld.java b/support/testing/tests/package/br2-external/openjdk/package/openjdk-hello-world/HelloWorld.java new file mode 100644 index 0000000000..37489e44c3 --- /dev/null +++ b/support/testing/tests/package/br2-external/openjdk/package/openjdk-hello-world/HelloWorld.java @@ -0,0 +1,7 @@ +public class HelloWorld +{ + public static void main(String[] args) + { + System.out.println("Hello, World"); + } +} diff --git a/support/testing/tests/package/br2-external/openjdk/package/openjdk-hello-world/openjdk-hello-world.mk b/support/testing/tests/package/br2-external/openjdk/package/openjdk-hello-world/openjdk-hello-world.mk new file mode 100644 index 0000000000..998117b8e2 --- /dev/null +++ b/support/testing/tests/package/br2-external/openjdk/package/openjdk-hello-world/openjdk-hello-world.mk @@ -0,0 +1,18 @@ +################################################################################ +# +# openjdk hello world +# +################################################################################ + +OPENJDK_HELLO_WORLD_DEPENDENCIES = openjdk + +define OPENJDK_HELLO_WORLD_BUILD_CMDS + $(INSTALL) -D $(OPENJDK_HELLO_WORLD_PKGDIR)/HelloWorld.java $(@D)/HelloWorld.java + $(HOST_DIR)/bin/javac $(@D)/HelloWorld.java +endef + +define OPENJDK_HELLO_WORLD_INSTALL_TARGET_CMDS + $(INSTALL) -D -m 755 $(@D)/HelloWorld.class $(TARGET_DIR)/usr/bin/HelloWorld.class +endef + +$(eval $(generic-package)) diff --git a/support/testing/tests/package/test_openjdk.py b/support/testing/tests/package/test_openjdk.py new file mode 100644 index 0000000000..ed8a1f1be4 --- /dev/null +++ b/support/testing/tests/package/test_openjdk.py @@ -0,0 +1,42 @@ +import os + +import infra.basetest + + +class TestOpenJdk(infra.basetest.BRTest): + br2_external = [infra.filepath("tests/package/br2-external/openjdk")] + config = \ + """ + BR2_aarch64=y + BR2_TOOLCHAIN_EXTERNAL=y + BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0" + BR2_LINUX_KERNEL=y + BR2_LINUX_KERNEL_CUSTOM_VERSION=y + BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.16.7" + BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y + BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/aarch64-virt/linux.config" + BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y + BR2_TARGET_ROOTFS_CPIO=y + BR2_TARGET_ROOTFS_CPIO_GZIP=y + BR2_PACKAGE_XORG7=y + BR2_PACKAGE_OPENJDK=y + BR2_PACKAGE_OPENJDK_HELLO_WORLD=y + """ + + def login(self): + img = os.path.join(self.builddir, "images", "rootfs.cpio.gz") + kern = os.path.join(self.builddir, "images", "Image") + self.emulator.boot(arch="aarch64", + kernel=kern, + kernel_cmdline=["console=ttyAMA0"], + options=["-M", "virt", "-cpu", "cortex-a57", "-m", "512M", "-initrd", img]) + self.emulator.login() + + def test_run(self): + self.login() + + cmd = "java -cp /usr/bin HelloWorld" + output, exit_code = self.emulator.run(cmd) + print(output) + self.assertEqual(exit_code, 0) + self.assertEqual(output, ["Hello, World"])