public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/jpegxl] rawhide: Fix build on RISC-V
Date: Wed, 25 Nov 2026 11:40:01 GMT	[thread overview]
Message-ID: <179560680178.1.10103015182880595822.rpms-jpegxl-ba469e4fcd51@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/jpegxl
Branch : rawhide
Commit : ba469e4fcd518642b7c18877163cfe69d98fa503
Author : Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
Date   : 2026-11-17T10:53:15+01:00
Stats  : +62/-0 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/jpegxl/c/ba469e4fcd518642b7c18877163cfe69d98fa503?branch=rawhide

Log:
Fix build on RISC-V

---
diff --git a/0001-cmake-Do-not-use-mrelax-all-with-clang-on-RISCV64-38.patch b/0001-cmake-Do-not-use-mrelax-all-with-clang-on-RISCV64-38.patch
new file mode 100644
index 0000000..12e0430
--- /dev/null
+++ b/0001-cmake-Do-not-use-mrelax-all-with-clang-on-RISCV64-38.patch
@@ -0,0 +1,58 @@
+From 192294e15e1d27660d887bc3b9b5ead8e5aa6a93 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 8 Aug 2025 06:42:42 -0700
+Subject: [PATCH] cmake: Do not use -mrelax-all with clang on RISCV64 (#3826)
+
+This option causes clang 19+ to crash on riscv64
+
+For RISC-V -mrelax-all causes the assembler stage to convert
+all conditional branches into
+
+  bcc reg, reg, tmplabel
+  jmp target
+tmplabel:
+
+Unconditional jmp can reach targets a lot further than a conditional branch.
+Unfortunately, jmp also has a limited range so sometimes needs to be
+converted to an indirect jump which requires a scratch register.
+We do all branch relaxation early for RISC-V during the compilation
+stage so we can allocate the scratch register.
+
+If the assembler also does branch relaxation it will increase the size
+of the function and may cause unconditional jmps to go out of range.
+If this happens, linking will fail.
+
+Co-authored-by: Eugene Kliuchnikov <eustas@google.com>
+---
+ AUTHORS        | 1 +
+ CMakeLists.txt | 2 +-
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/AUTHORS b/AUTHORS
+index 7407cc24..4a86560c 100644
+--- a/AUTHORS
++++ b/AUTHORS
+@@ -73,6 +73,7 @@ Jonathan Brown (Jonnyawsom3) <jonathanbr30@gmail.com>
+ Joshua Root <jmr@macports.org>
+ Kai Hollberg <Schweinepriester@users.noreply.github.com>
+ Kerry Su <me@sshockwave.net>
++Khem Raj <raj.khem@gmail.com>
+ Kleis Auke Wolthuizen <github@kleisauke.nl>
+ L. E. Segovia
+ ledoge
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 7027dbb2..af103dc9 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -365,7 +365,7 @@ else ()
+ 
+   # Machine flags.
+   add_compile_options(-funwind-tables)
+-  if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
++  if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT CMAKE_SYSTEM_PROCESSOR MATCHES "riscv")
+     add_compile_options("SHELL:-Xclang -mrelax-all")
+   endif()
+   if (CXX_CONSTRUCTOR_ALIASES_SUPPORTED)
+-- 
+2.55.0
+

diff --git a/jpegxl.spec b/jpegxl.spec
index fefac43..ae3756d 100644
--- a/jpegxl.spec
+++ b/jpegxl.spec
@@ -36,6 +36,10 @@ Source0:        https://github.com/libjxl/libjxl/archive/v%{version}/%{name}-%{v
 Source1:        third_party-%{version}.tar.gz
 Source2:        testdata-%{version}.tar.gz
 
+# -mrelax-all generates branches that RISC-V linker relaxation then breaks,
+# making every binary die at startup (SIGILL on hardware, SIGSEGV on qemu).
+Patch:          0001-cmake-Do-not-use-mrelax-all-with-clang-on-RISCV64-38.patch
+
 BuildRequires:  asciidoc
 BuildRequires:  cmake
 BuildRequires:  doxygen

                 reply	other threads:[~2026-11-25 11:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=179560680178.1.10103015182880595822.rpms-jpegxl-ba469e4fcd51@fedoraproject.org \
    --to=mjuszkiewicz@redhat.com \
    --cc=git-commits@fedoraproject.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