From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id BD84415808B for ; Sun, 27 Mar 2022 14:00:28 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E8C6FE0916; Sun, 27 Mar 2022 14:00:27 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 pigeon.gentoo.org (Postfix) with ESMTPS id 6AB34E0916 for ; Sun, 27 Mar 2022 14:00:25 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (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 smtp.gentoo.org (Postfix) with ESMTPS id 75EDB3432E8 for ; Sun, 27 Mar 2022 14:00:24 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CD198177 for ; Sun, 27 Mar 2022 14:00:22 +0000 (UTC) From: "Yixun Lan" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Yixun Lan" Message-ID: <1648389582.5cdf389fd2bdffd38450020639614522c63c2b82.dlan@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/libjxl/files/, media-libs/libjxl/ X-VCS-Repository: repo/gentoo X-VCS-Files: media-libs/libjxl/files/libjxl-0.7.0-pthread.patch media-libs/libjxl/libjxl-0.7.0_pre20220311.ebuild X-VCS-Directories: media-libs/libjxl/files/ media-libs/libjxl/ X-VCS-Committer: dlan X-VCS-Committer-Name: Yixun Lan X-VCS-Revision: 5cdf389fd2bdffd38450020639614522c63c2b82 X-VCS-Branch: master Date: Sun, 27 Mar 2022 14:00:22 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 0db4ea10-0c3f-4b98-8726-839f6cb5727c X-Archives-Hash: 76b9616a35c6cbd74ef634fb2bf78e20 commit: 5cdf389fd2bdffd38450020639614522c63c2b82 Author: Yixun Lan gentoo org> AuthorDate: Sun Mar 27 04:22:30 2022 +0000 Commit: Yixun Lan gentoo org> CommitDate: Sun Mar 27 13:59:42 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5cdf389f media-libs/libjxl: use -pthread to fix missing atomic issue Due to there is no 1, 2byte atomic instruction in 64bit RISC-V hardware, the software layer have to emulate relavant function in atomic library Let's explicitly pass -pthread here to work around pthread builtin since glibc version 2.34 as the "-pthread" option will pull in libatomic for machines like RISC-V Closes: https://bugs.gentoo.org/836125 Upstream: https://github.com/libjxl/libjxl/issues/1283 Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Yixun Lan gentoo.org> media-libs/libjxl/files/libjxl-0.7.0-pthread.patch | 40 ++++++++++++++++++++++ media-libs/libjxl/libjxl-0.7.0_pre20220311.ebuild | 2 ++ 2 files changed, 42 insertions(+) diff --git a/media-libs/libjxl/files/libjxl-0.7.0-pthread.patch b/media-libs/libjxl/files/libjxl-0.7.0-pthread.patch new file mode 100644 index 000000000000..ea64e5805479 --- /dev/null +++ b/media-libs/libjxl/files/libjxl-0.7.0-pthread.patch @@ -0,0 +1,40 @@ + +Due to there is no 1, 2byte atomic instruction in 64bit RISC-V hardware, +the software layer have to emulate relavant function in atomic library + +Let's explicitly pass -pthread here to work around pthread builtin since glibc version 2.34 +as the "-pthread" option will pull in libatomic for machines like RISC-V + +the command of "gcc dumpspecs | grep pthread" will show accordingly in RISC-V: +pthread:--push-state --as-needed -latomic --pop-state + +https://bugs.gentoo.org/836125 +https://github.com/libjxl/libjxl/issues/1283 + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4df740b..59c7f03 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -190,6 +190,9 @@ endif() # JPEGXL_STATIC + # Threads + set(THREADS_PREFER_PTHREAD_FLAG YES) + find_package(Threads REQUIRED) ++if(CMAKE_USE_PTHREADS_INIT) ++ target_link_libraries(Threads::Threads INTERFACE -pthread) ++endif() + + if(JPEGXL_STATIC) + if (MINGW) +diff --git a/tools/conformance/CMakeLists.txt b/tools/conformance/CMakeLists.txt +index bd25b1c..d125dc5 100644 +--- a/tools/conformance/CMakeLists.txt ++++ b/tools/conformance/CMakeLists.txt +@@ -4,7 +4,7 @@ + # license that can be found in the LICENSE file. + + add_executable(djxl_conformance djxl_conformance.cc) +-target_link_libraries(djxl_conformance jxl_dec) ++target_link_libraries(djxl_conformance jxl_dec -pthread) + + if(BUILD_TESTING AND CMAKE_EXECUTABLE_SUFFIX STREQUAL "") + # Script to validate the tooling. diff --git a/media-libs/libjxl/libjxl-0.7.0_pre20220311.ebuild b/media-libs/libjxl/libjxl-0.7.0_pre20220311.ebuild index 1afe0678670a..f16373af5651 100644 --- a/media-libs/libjxl/libjxl-0.7.0_pre20220311.ebuild +++ b/media-libs/libjxl/libjxl-0.7.0_pre20220311.ebuild @@ -30,6 +30,8 @@ DEPEND="app-arch/brotli:=[${MULTILIB_USEDEP}] RDEPEND="${DEPEND}" +PATCHES=( "${FILESDIR}/${PN}-0.7.0-pthread.patch" ) + S="${WORKDIR}/libjxl-libjxl-3f8e77f" multilib_src_configure() {