From patchwork Wed Jun 17 20:19:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 1311488 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=ika/clUV; 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 49nGdh2Wv2z9sRW for ; Thu, 18 Jun 2020 06:20:08 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 094A38790F; Wed, 17 Jun 2020 20:20:06 +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 KLMxB0JTPFyv; Wed, 17 Jun 2020 20:20:03 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id A208387921; Wed, 17 Jun 2020 20:20:03 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id E237E1BF41B for ; Wed, 17 Jun 2020 20:20:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id DD8AB87DDD for ; Wed, 17 Jun 2020 20:20: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 nylt2jGrTlmz for ; Wed, 17 Jun 2020 20:20:01 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pj1-f65.google.com (mail-pj1-f65.google.com [209.85.216.65]) by whitealder.osuosl.org (Postfix) with ESMTPS id 0BD1C87DD6 for ; Wed, 17 Jun 2020 20:20:01 +0000 (UTC) Received: by mail-pj1-f65.google.com with SMTP id b7so2628629pju.0 for ; Wed, 17 Jun 2020 13:20:01 -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=0817do1UAuuqGQyrDUCEAnZnwcv3pwqDL1KLapSHQk4=; b=ika/clUVuqL6Sn7F60r4WBG66ddLqX6k7L5Nor+gsJcQB18PQdf2zdJw+xYOWHcefl BSpT80G/he+c8ECuYwnAhiLa+R20fsyUszXpqw+l5+1Rk3NiUPL2K3RAPbwTdacc8uQ1 aiCWlNq/85dvxTJ58EXz8Kky4sPWNHxGlqfg4zICwUb8ltKVTwGFfDgx4sgKsKBOTjYA HocltR5bBtE7WHGBiCfXmXCW7nrhIKqAWSvXObSW3chzJ9oRtIAX3o+ymB9p78SKZVub YZJqeA9+zKYKjB6cK+y+gbzjm+79v8Tk9sZK+Zyfd5eow5wtBTgtFN0zWBKgDMoK7IIl FkPw== 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=0817do1UAuuqGQyrDUCEAnZnwcv3pwqDL1KLapSHQk4=; b=BeS+uc5T7uOCV6X/BPoAz7GSDMbP3/cQ1uR/2lmRnYGR01aQo6cULwfANpVr6w1yaF Q8jmHzc6mDLf2PsplnrQKsyKX646I8Datdn/P0qAhdpXYNzSVIZRtH5jJVPLQZ9a71vh LTjCo/TQ4VsDY/Ta6nfJ1EYSjTG86yzW90ZrZP3LlHz4dR4blHpMygPAsobuy/vhKAHM 6ICdo+2K9xCScY3RusWz7Yoxe5PqaZG535vcjPg+w7+LR2Y7a9lCSOhACev9Mvcq7jBk zWTi6F4GlfZBx8oW0CgPVU56k35uUN8vkFqN7vZepF4HX958ceXl03Gky48yrGclFbZL FwvQ== X-Gm-Message-State: AOAM533mFBQuwUP07nF7vpq8BkfGIOyXYPhpQ+aU+N4RQB9NhLkhMOdv /jTGIaxkniZ5eLJSAxKMgb74Xe64 X-Google-Smtp-Source: ABdhPJw/5lyIg/vO/iB4BLYpUb3qSew2UOKY9h6ymOCxFKqjLFQkfp7+BVdBfCI7GAMhumhvg0mNkQ== X-Received: by 2002:a17:90a:f414:: with SMTP id ch20mr698068pjb.97.1592425200292; Wed, 17 Jun 2020 13:20:00 -0700 (PDT) Received: from localhost.localdomain ([47.149.8.172]) by smtp.gmail.com with ESMTPSA id m14sm606377pgt.6.2020.06.17.13.19.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 13:19:59 -0700 (PDT) From: aduskett@gmail.com To: buildroot@buildroot.org Date: Wed, 17 Jun 2020 13:19:58 -0700 Message-Id: <20200617201958.2368005-1-aduskett@gmail.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/1] package/openjdk: fix building against gcc10 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: Tudor Holton , Adam Duskett Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Adam Duskett GCC10 set's the -fno-common flag by default which causes OpenJDK to fail when compiling. Because there is no easy way to create a patch from the OpenJDK mercurial repository, this patch was created by hand from the three commits listed in the provided patch itself. Signed-off-by: Adam Duskett --- package/openjdk/0001-fix-gcc-10-support.patch | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 package/openjdk/0001-fix-gcc-10-support.patch diff --git a/package/openjdk/0001-fix-gcc-10-support.patch b/package/openjdk/0001-fix-gcc-10-support.patch new file mode 100644 index 0000000000..5364c47252 --- /dev/null +++ b/package/openjdk/0001-fix-gcc-10-support.patch @@ -0,0 +1,119 @@ +From 58911e9de888aece29f491995a8b8a31f7d6b424 Mon Sep 17 00:00:00 2001 +From: Patrick Zhang +Date: Wed, 05 Feb 2020 17:14:15 -0700 +Subject: [PATCH] fix gcc 10 support + +This patch fixes the "multiple definition" link errors with GCC10 due to +GCC10 setting -fno-common by default. + +This is a combination of the following upstream commits: + - https://hg.openjdk.java.net/jdk/jdk/rev/8e6fa89397ca + - https://hg.openjdk.java.net/jdk/jdk/rev/6925fca95959 + - https://hg.openjdk.java.net/jdk/jdk/rev/9e54ea7d9cd9 + +Signed-off-by: Patrick Zhang +Signed-off-by: Adam Duskett +--- + src/java.base/unix/native/libjava/childproc.c | 1 + + src/java.base/unix/native/libjava/childproc.h | 2 +- + .../share/native/libj2gss/NativeFunc.c | 3 +++ + .../share/native/libj2gss/NativeFunc.h | 2 +- + src/jdk.sctp/unix/native/libsctp/Sctp.h | 12 ++++++------ + src/jdk.sctp/unix/native/libsctp/SctpNet.c | 7 +++++++ + 6 files changed, 19 insertions(+), 8 deletions(-) + +diff --git a/src/java.base/unix/native/libjava/childproc.c b/src/java.base/unix/native/libjava/childproc.c +index 811aaeac5..16480bfbf 100644 +--- a/src/java.base/unix/native/libjava/childproc.c ++++ b/src/java.base/unix/native/libjava/childproc.c +@@ -34,6 +34,7 @@ + + #include "childproc.h" + ++const char * const *parentPathv; + + ssize_t + restartableWrite(int fd, const void *buf, size_t count) +diff --git a/src/java.base/unix/native/libjava/childproc.h b/src/java.base/unix/native/libjava/childproc.h +index 091150930..d57e44b6e 100644 +--- a/src/java.base/unix/native/libjava/childproc.h ++++ b/src/java.base/unix/native/libjava/childproc.h +@@ -126,7 +126,7 @@ typedef struct _SpawnInfo { + * The cached and split version of the JDK's effective PATH. + * (We don't support putenv("PATH=...") in native code) + */ +-const char * const *parentPathv; ++extern const char * const *parentPathv; + + ssize_t restartableWrite(int fd, const void *buf, size_t count); + int restartableDup2(int fd_from, int fd_to); +diff --git a/src/java.security.jgss/share/native/libj2gss/NativeFunc.c b/src/java.security.jgss/share/native/libj2gss/NativeFunc.c +index da7bc0445..5941f7b5a 100644 +--- a/src/java.security.jgss/share/native/libj2gss/NativeFunc.c ++++ b/src/java.security.jgss/share/native/libj2gss/NativeFunc.c +@@ -27,6 +27,9 @@ + #include + #include "NativeFunc.h" + ++/* global GSS function table */ ++GSS_FUNCTION_TABLE_PTR ftab; ++ + /* standard GSS method names (ordering is from mapfile) */ + static const char RELEASE_NAME[] = "gss_release_name"; + static const char IMPORT_NAME[] = "gss_import_name"; +diff --git a/src/java.security.jgss/share/native/libj2gss/NativeFunc.h b/src/java.security.jgss/share/native/libj2gss/NativeFunc.h +index 82914387c..e4a4981a3 100644 +--- a/src/java.security.jgss/share/native/libj2gss/NativeFunc.h ++++ b/src/java.security.jgss/share/native/libj2gss/NativeFunc.h +@@ -277,6 +277,6 @@ typedef struct GSS_FUNCTION_TABLE { + typedef GSS_FUNCTION_TABLE *GSS_FUNCTION_TABLE_PTR; + + /* global GSS function table */ +-GSS_FUNCTION_TABLE_PTR ftab; ++extern GSS_FUNCTION_TABLE_PTR ftab; + + #endif +diff --git a/src/jdk.sctp/unix/native/libsctp/Sctp.h b/src/jdk.sctp/unix/native/libsctp/Sctp.h +index cc1367f78..46b07db0a 100644 +--- a/src/jdk.sctp/unix/native/libsctp/Sctp.h ++++ b/src/jdk.sctp/unix/native/libsctp/Sctp.h +@@ -322,12 +322,12 @@ typedef int sctp_peeloff_func(int sock, sctp_assoc_t id); + + #endif /* __linux__ */ + +-sctp_getladdrs_func* nio_sctp_getladdrs; +-sctp_freeladdrs_func* nio_sctp_freeladdrs; +-sctp_getpaddrs_func* nio_sctp_getpaddrs; +-sctp_freepaddrs_func* nio_sctp_freepaddrs; +-sctp_bindx_func* nio_sctp_bindx; +-sctp_peeloff_func* nio_sctp_peeloff; ++extern sctp_getladdrs_func* nio_sctp_getladdrs; ++extern sctp_freeladdrs_func* nio_sctp_freeladdrs; ++extern sctp_getpaddrs_func* nio_sctp_getpaddrs; ++extern sctp_freepaddrs_func* nio_sctp_freepaddrs; ++extern sctp_bindx_func* nio_sctp_bindx; ++extern sctp_peeloff_func* nio_sctp_peeloff; + + jboolean loadSocketExtensionFuncs(JNIEnv* env); + +diff --git a/src/jdk.sctp/unix/native/libsctp/SctpNet.c b/src/jdk.sctp/unix/native/libsctp/SctpNet.c +index d40c15aa3..ab9b6e093 100644 +--- a/src/jdk.sctp/unix/native/libsctp/SctpNet.c ++++ b/src/jdk.sctp/unix/native/libsctp/SctpNet.c +@@ -43,6 +43,13 @@ static jmethodID isaCtrID = 0; + static const char* nativeSctpLib = "libsctp.so.1"; + static jboolean funcsLoaded = JNI_FALSE; + ++sctp_getladdrs_func* nio_sctp_getladdrs; ++sctp_freeladdrs_func* nio_sctp_freeladdrs; ++sctp_getpaddrs_func* nio_sctp_getpaddrs; ++sctp_freepaddrs_func* nio_sctp_freepaddrs; ++sctp_bindx_func* nio_sctp_bindx; ++sctp_peeloff_func* nio_sctp_peeloff; ++ + JNIEXPORT jint JNICALL DEF_JNI_OnLoad + (JavaVM *vm, void *reserved) { + return JNI_VERSION_1_2; +-- +2.26.2 +