public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Yixun Lan" <dlan@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/libjxl/files/, media-libs/libjxl/
Date: Sun, 27 Mar 2022 14:00:22 +0000 (UTC)	[thread overview]
Message-ID: <1648389582.5cdf389fd2bdffd38450020639614522c63c2b82.dlan@gentoo> (raw)

commit:     5cdf389fd2bdffd38450020639614522c63c2b82
Author:     Yixun Lan <dlan <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 27 04:22:30 2022 +0000
Commit:     Yixun Lan <dlan <AT> gentoo <DOT> 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 <dlan <AT> 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() {


             reply	other threads:[~2022-03-27 14:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-27 14:00 Yixun Lan [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-05-14  1:02 [gentoo-commits] repo/gentoo:master commit in: media-libs/libjxl/files/, media-libs/libjxl/ Sam James
2024-10-04 21:40 Andreas Sturmlechner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1648389582.5cdf389fd2bdffd38450020639614522c63c2b82.dlan@gentoo \
    --to=dlan@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox