From patchwork Wed Jun 17 21:55:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 1311628 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.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.a=rsa-sha256 header.s=20161025 header.b=gy8nq3nk; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49nJll3Gmdz9sRf for ; Thu, 18 Jun 2020 07:55:31 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 76B2A87A64; Wed, 17 Jun 2020 21:55:28 +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 q_0BCcBdkfpJ; Wed, 17 Jun 2020 21:55:26 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8C64D84B1C; Wed, 17 Jun 2020 21:55:26 +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 548511BF324 for ; Wed, 17 Jun 2020 21:55:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 4F47020035 for ; Wed, 17 Jun 2020 21:55:25 +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 ARPuKtHDQkao for ; Wed, 17 Jun 2020 21:55:23 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by silver.osuosl.org (Postfix) with ESMTPS id 67F7F203FA for ; Wed, 17 Jun 2020 21:55:23 +0000 (UTC) Received: by mail-pg1-f195.google.com with SMTP id l24so1937024pgb.5 for ; Wed, 17 Jun 2020 14:55:23 -0700 (PDT) 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=KhDNf+NuP2C2Xd5+2QsDK9oFTcjcXhCorzgWS7uat/A=; b=gy8nq3nk1iuB8kFvUzFRn7MsCFt0jACaJaNUcbhF7JnR9p/hLwAZMd7oeeFyJ5l4fL FDi5oUYtCPluRs3Gu+uBQiukmtV9pVLOj77N4KgI+f6POZgJ1jPIwExkbvRhtOJoWHVg DBAbWgNIhJtMVSCdjoL9xOAMSV54vA9EZNsMeWEckMiV1pMk5sED05f8sYie6TbM7DHq OILJVTV+PC9qM44LGTfS42+lofL0mtwCbsozl49BDpv7ucKlJ8HKzjw/iGdNAdJN4Nli a51hgZJ4sy1LsuWjHHylkDGrSbBH6bwn4U7ERw22btmnnGRlTKYUc4hsK1XMO9lAqKA5 ltMQ== 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=KhDNf+NuP2C2Xd5+2QsDK9oFTcjcXhCorzgWS7uat/A=; b=AmQxJcRtIddypjBwMLl88Q2+URV/8Op+Qbz7fRYnH2XGLdySpGpmgRFfnsICsv5jVq 2xCW1fKCZdgLPqTT5wO5oZ+mWkqa5tseYv3wZsKEDWet2yV3IiKJHsxd9k4Ez9wIMNw7 gOGSyIfcyxjyTqS41Od2SmE7DzP1xLrQKddhgZpt0MndPBIT/JzoWwhb2cDmpoFrfqCx CRQW/PaE7ykMROSxfIhZ3PXhLDPLy7CTpa/7LQ9CE5o4+AkOfJ29232MtviFQf2pYT3I UQz3CyVgo6IGyC/SZ50rqCPLb+vhj0u3BF5MMRP85R6LxHKWaZOBuKv4evauXd8pHw36 W0ew== X-Gm-Message-State: AOAM532qxQpMXp1xPXiXP4AEWsi415YOLSodepMJWIU4ZuGY96hLAA7P FJ8SjiSm4eRj+AlWYRLHq5cOqPcT X-Google-Smtp-Source: ABdhPJz9xeaEAuzbgzpUWSpYSJG6U/Wh4EBfYzNdmYPpis5RonwettIyJPD78yGEc2jIearHsJqNSw== X-Received: by 2002:a63:7409:: with SMTP id p9mr757979pgc.6.1592430922549; Wed, 17 Jun 2020 14:55:22 -0700 (PDT) Received: from localhost.localdomain ([47.149.8.172]) by smtp.gmail.com with ESMTPSA id c9sm766880pfp.100.2020.06.17.14.55.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 14:55:22 -0700 (PDT) From: aduskett@gmail.com To: buildroot@buildroot.org Date: Wed, 17 Jun 2020 14:55:20 -0700 Message-Id: <20200617215520.3600744-1-aduskett@gmail.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] package/openjdk-bin: install to host/usr/lib/jvm 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: Matt Weber , Tudor Holton , Adam Duskett Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Adam Duskett Buildroot currently installs openjdk-bin to $(HOST_DIR)/ instead of the more traditional (for java installations) $(HOST_DIR)/usr/lib/jvm. As described in https://bugs.busybox.net/show_bug.cgi?id=13001 "Openjdk-bin provides it's own libfreetype.so and places it into $(HOST_DIR)/lib/. This library causes build failures with the host-xapp_mkfontscale package due to the overwritten libfreetype.so. mkfontscale.o: In function `doDirectory': mkfontscale.c:(.text+0x1a80): undefined reference to `FT_Get_BDF_Property' collect2: error: ld returned 1 exit status Reproducing the error is done by repeating the following steps. make host-freetype make host-openjdk-bin make host-xapp_mkfontscale" There are two options for fixing this problem: 1) Add host-freetype and host-lksctp-tools as dependencies to host-openjdk-bin and then remove the provided libfreetype.so and libsctp.so libraries in a post_extract_hook. 2) Change the installation directory from $(HOST_DIR)/ to $(HOST_DIR)/usr/lib/jvm just like the target OpenJDK package and copy the entire source directories contents to the above location. The second option provides the following advantages: - The directory structure is consistent with how we handle the target OpenJDK. - The HOST_OPENJDK_BIN_INSTALL_CMDS step is simplified. - Packages such as Maven require directories of which we are currently not copying. These missing directories cause programs such as Maven to crash when running with an error such as "Can't read cryptographic policy directory: unlimited." Because the second option is both simple, easier to implement, is low-impact, and fixes the problems described above wholly, it is the best to implement. To implement the above changes, we must also modify the following files in the same patch to match the host's new directory paths: - openjdk.mk - openjdk-jni-test.mk - openjdk-hello-world.mk Tested with: ./support/testing/run-tests -o out -d dl tests.package.test_openjdk.TestOpenJdk Fixes: https://bugs.busybox.net/show_bug.cgi?id=13001 Signed-off-by: Adam Duskett --- package/openjdk-bin/openjdk-bin.mk | 8 +++----- package/openjdk/openjdk.mk | 2 +- .../package/openjdk-hello-world/openjdk-hello-world.mk | 2 +- .../openjdk/package/openjdk-jni-test/openjdk-jni-test.mk | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/package/openjdk-bin/openjdk-bin.mk b/package/openjdk-bin/openjdk-bin.mk index f4a8979e0b..f67f3b7ee5 100644 --- a/package/openjdk-bin/openjdk-bin.mk +++ b/package/openjdk-bin/openjdk-bin.mk @@ -26,11 +26,9 @@ HOST_OPENJDK_BIN_LICENSE_FILES = legal/java.prefs/LICENSE legal/java.prefs/ASSEM # Because unpack200 is a deprecated tool, removing it to fix this # issue is safe. define HOST_OPENJDK_BIN_INSTALL_CMDS - mkdir -p $(HOST_DIR)/bin - cp -dpfr $(@D)/bin/* $(HOST_DIR)/bin/ - mkdir -p $(HOST_DIR)/lib - cp -dpfr $(@D)/lib/* $(HOST_DIR)/lib/ - $(RM) -f $(HOST_DIR)/bin/unpack200 + mkdir -p $(HOST_DIR)/usr/lib/jvm + cp -dpfr $(@D)/* $(HOST_DIR)/usr/lib/jvm/ + $(RM) -f $(HOST_DIR)/usr/lib/jvm/bin/unpack200 endef $(eval $(host-generic-package)) diff --git a/package/openjdk/openjdk.mk b/package/openjdk/openjdk.mk index 22c9a777b5..baefdf59bb 100644 --- a/package/openjdk/openjdk.mk +++ b/package/openjdk/openjdk.mk @@ -94,7 +94,7 @@ OPENJDK_CONF_OPTS = \ --enable-openjdk-only \ --enable-unlimited-crypto \ --openjdk-target=$(GNU_TARGET_NAME) \ - --with-boot-jdk=$(HOST_DIR) \ + --with-boot-jdk=$(HOST_DIR)/usr/lib/jvm \ --with-stdc++lib=dynamic \ --with-debug-level=release \ --with-devkit=$(HOST_DIR) \ 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 index 998117b8e2..6157c4dd9c 100644 --- 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 @@ -8,7 +8,7 @@ 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 + $(HOST_DIR)/usr/lib/jvm/bin/javac $(@D)/HelloWorld.java endef define OPENJDK_HELLO_WORLD_INSTALL_TARGET_CMDS diff --git a/support/testing/tests/package/br2-external/openjdk/package/openjdk-jni-test/openjdk-jni-test.mk b/support/testing/tests/package/br2-external/openjdk/package/openjdk-jni-test/openjdk-jni-test.mk index f279e5cd70..51ae44cabd 100644 --- a/support/testing/tests/package/br2-external/openjdk/package/openjdk-jni-test/openjdk-jni-test.mk +++ b/support/testing/tests/package/br2-external/openjdk/package/openjdk-jni-test/openjdk-jni-test.mk @@ -10,7 +10,7 @@ JNI_INCLUDE_PATH = $(BUILD_DIR)/openjdk-$(OPENJDK_VERSION)/build/linux-aarch64-s define OPENJDK_JNI_TEST_BUILD_CMDS # Compile Java classes and generate native headers - $(HOST_DIR)/bin/javac -d $(@D) -h $(@D) \ + $(HOST_DIR)/usr/lib/jvm/bin/javac -d $(@D) -h $(@D) \ $(OPENJDK_JNI_TEST_PKGDIR)/JniTest.java \ $(OPENJDK_JNI_TEST_PKGDIR)/JniWrapper.java \ $(OPENJDK_JNI_TEST_PKGDIR)/JniHelper.java