From patchwork Wed May 26 18:24:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Perez de Castro X-Patchwork-Id: 1484209 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.136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=igalia.com header.i=@igalia.com header.a=rsa-sha256 header.s=20170329 header.b=YUWpGV+m; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Fqzr72tTFz9s1l for ; Thu, 27 May 2021 04:24:39 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 5B17E60794; Wed, 26 May 2021 18:24:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8-wvUgxNqjII; Wed, 26 May 2021 18:24:36 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 85E7360703; Wed, 26 May 2021 18:24:35 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 790B51BF276 for ; Wed, 26 May 2021 18:24:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 6818D401EB for ; Wed, 26 May 2021 18:24:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp2.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=igalia.com Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zoQlCs5Six-A for ; Wed, 26 May 2021 18:24:33 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from fanzine.igalia.com (fanzine.igalia.com [178.60.130.6]) by smtp2.osuosl.org (Postfix) with ESMTPS id DBFB9400CF for ; Wed, 26 May 2021 18:24:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=cFOEsHKVYrqMNlrdJrr5p2jVfXBFSpXVW5j38qQJmA8=; b=YUWpGV+mtX1mPbbOmqZWu6Cx1Z6myNiyL4A3hWfmTZ6bbRUolOjmwDpC5YMSyl5se9ZxMwTEgGZ0bU97S1DVhKqxj+xjRhobt54LTeuewM1GTXksLIZTTZ8DQMTz/Zv7sz+dPrYXeEFGRhYZcp1ye7WsDuI/QXgrenTRLgEQ+JaWr5ub7ZhRQaAzBISzhwVlgYzTyBBSd/e9pQuIe4c9gSuqsdQAAd3mCj9IRT2dXOeMFolGfDLTJ2d3/NjuNTt4JUqM8/ClqYz9HPLsOsQdkGtdONhigv5/ir/jh0zgo8hIidpdWhavl5p8vxYKQIDvHNJDaIBFXQf0vpB92NMtnQ==; Received: from 91-153-34-142.elisa-laajakaista.fi ([91.153.34.142] helo=kodama) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1llyCi-0007tc-Bn; Wed, 26 May 2021 20:24:28 +0200 Received: from localhost (kodama [local]) by kodama (OpenSMTPD) with ESMTPA id 6c5e0dc6; Wed, 26 May 2021 18:24:16 +0000 (UTC) From: Adrian Perez de Castro To: buildroot@buildroot.org Date: Wed, 26 May 2021 21:24:16 +0300 Message-Id: <20210526182416.2798443-1-aperez@igalia.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210518190515.357554-3-aperez@igalia.com> References: <20210518190515.357554-3-aperez@igalia.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/1] package/webkitgtk: allow building with musl and uclibc 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: Adrian Perez de Castro Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" WebKitGTK 2.32.1 includes fixes for building with the Musl libc, which also makes it possible to use uClibc as well, therefore arrange dependencies to allow selecting the package any of the C libraries is in use. This is done by making the dependencies be more granular, basically following what the wpewebkit package does. In order to make make it build against uClibc a small patch that has been submitted to the upstream's Bugzilla is needed. Signed-off-by: Adrian Perez de Castro --- ...0001-Support-building-against-uClibc.patch | 76 +++++++++++++++++++ package/webkitgtk/Config.in | 10 ++- 2 files changed, 83 insertions(+), 3 deletions(-) create mode 100644 package/webkitgtk/0001-Support-building-against-uClibc.patch diff --git a/package/webkitgtk/0001-Support-building-against-uClibc.patch b/package/webkitgtk/0001-Support-building-against-uClibc.patch new file mode 100644 index 0000000000..cbed551d2d --- /dev/null +++ b/package/webkitgtk/0001-Support-building-against-uClibc.patch @@ -0,0 +1,76 @@ +From 624d3b6a99778443e35fb260bef50a3969df9215 Mon Sep 17 00:00:00 2001 +From: Adrian Perez de Castro +Date: Wed, 26 May 2021 01:24:59 +0300 +Subject: [PATCH] Support building against uClibc + https://bugs.webkit.org/show_bug.cgi?id=226244 + +Reviewed by NOBODY (OOPS!). + +Source/JavaScriptCore: + +* assembler/MacroAssemblerARM64.cpp: +(getauxval): Provide a fallback implementation of getauxval() for +systems which do not provide , like those using uClibc +as their C library. + +Source/WTF: + +* wtf/PlatformRegisters.h: Use the header instead of +, which is enough to gain access to the type definitions +for CPU registers and is available on every libc. On the other hand, +uClibc does not have , so this fixes the build in that +case. + +Signed-off-by: Adrian Perez de Castro +[Upstream status: https://bugs.webkit.org/show_bug.cgi?id=226244] +--- + .../assembler/MacroAssemblerARM64.cpp | 18 ++++++++++++++++++ + Source/WTF/wtf/PlatformRegisters.h | 2 +- + 2 files changed, 19 insertions(+), 1 deletion(-) + +diff --git a/Source/JavaScriptCore/assembler/MacroAssemblerARM64.cpp b/Source/JavaScriptCore/assembler/MacroAssemblerARM64.cpp +index 9e5c5147ea0..d20e632d825 100644 +--- a/Source/JavaScriptCore/assembler/MacroAssemblerARM64.cpp ++++ b/Source/JavaScriptCore/assembler/MacroAssemblerARM64.cpp +@@ -34,7 +34,25 @@ + + #if OS(LINUX) + #include ++#if __has_include() + #include ++#else ++#include ++// Provide an implementation for C libraries which do not ship one. ++static unsigned long getauxval(unsigned long type) ++{ ++ char** env = environ; ++ while (*env++) { /* no-op */ } ++ ++ for (auto* auxv = reinterpret_cast(env); *auxv != AT_NULL; auxv += 2) { ++ if (*auxv == type) ++ return auxv[1]; ++ } ++ ++ errno = ENOENT; ++ return 0; ++} ++#endif + #endif + + namespace JSC { +diff --git a/Source/WTF/wtf/PlatformRegisters.h b/Source/WTF/wtf/PlatformRegisters.h +index d26ef985169..e7f15b7eb62 100644 +--- a/Source/WTF/wtf/PlatformRegisters.h ++++ b/Source/WTF/wtf/PlatformRegisters.h +@@ -35,7 +35,7 @@ + #elif OS(WINDOWS) + #include + #else +-#include ++#include + #endif + + namespace WTF { +-- +2.31.1 + diff --git a/package/webkitgtk/Config.in b/package/webkitgtk/Config.in index a05161d052..425bf81e4e 100644 --- a/package/webkitgtk/Config.in +++ b/package/webkitgtk/Config.in @@ -12,20 +12,24 @@ config BR2_PACKAGE_WEBKITGTK_ARCH_SUPPORTS depends on BR2_TOOLCHAIN_HAS_SYNC_4 depends on BR2_PACKAGE_LIBGPG_ERROR_ARCH_SUPPORTS # libgcrypt -comment "webkitgtk needs libgtk3 and a glibc toolchain w/ C++, gcc >= 7, host gcc >= 4.9" +comment "webkitgtk needs libgtk3 and a toolchain w/ C++, wchar, threads, dynamic library, gcc >= 7, host gcc >= 4.9" depends on BR2_PACKAGE_WEBKITGTK_ARCH_SUPPORTS + depends on !BR2_BINFMT_FLAT depends on !BR2_PACKAGE_LIBGTK3 || !BR2_INSTALL_LIBSTDCPP || \ - !BR2_TOOLCHAIN_USES_GLIBC || \ + !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS || \ !BR2_TOOLCHAIN_GCC_AT_LEAST_7 || \ !BR2_HOST_GCC_AT_LEAST_4_9 depends on BR2_USE_MMU config BR2_PACKAGE_WEBKITGTK bool "webkitgtk" + depends on !BR2_STATIC_LIBS # wayland + depends on !BR2_BINFMT_FLAT # icu depends on BR2_HOST_GCC_AT_LEAST_4_9 # icu depends on BR2_INSTALL_LIBSTDCPP + depends on BR2_TOOLCHAIN_HAS_THREADS # wayland, icu, libsoup depends on BR2_TOOLCHAIN_GCC_AT_LEAST_7 - depends on BR2_TOOLCHAIN_USES_GLIBC + depends on BR2_USE_WCHAR # icu, libsoup depends on BR2_PACKAGE_LIBGTK3 depends on BR2_PACKAGE_WEBKITGTK_ARCH_SUPPORTS select BR2_PACKAGE_CAIRO