Bug 2512927 - simple-dns build fails on s390x
Summary: simple-dns build fails on s390x
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: llvm
Version: 45
Hardware: s390x
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Josh Stone
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-08-09 15:35 UTC by Łukasz Patron
Modified: 2026-08-18 06:59 UTC (History)
18 users (show)

Fixed In Version: llvm-22.1.8-26.fc46
Clone Of:
Environment:
Last Closed: 2026-08-18 06:59:24 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github llvm llvm-project pull 207229 0 None Merged [AggressiveInstCombine] Fix crash when folding consecutive loads into a type smaller than the combined load 2026-08-10 23:33:06 UTC

Description Łukasz Patron 2026-08-09 15:35:22 UTC
[root@be93f8fff8c3 simple-dns]# git remote -v
origin	https://github.com/balliegojr/simple-dns (fetch)
origin	https://github.com/balliegojr/simple-dns (push)
[root@be93f8fff8c3 simple-dns]# cargo build --release
   Compiling simple-dns v0.12.0 (/simple-dns/simple-dns)
Type too small for ZExt
  %1097 = zext i128 %1096 to i96
in function _RNvNtNtCs3AZc6le8oaU_10simple_dns3dns5rdata11parse_rdata
rustc-LLVM ERROR: Broken function found, compilation aborted!
error: could not compile `simple-dns` (lib)

Caused by:
  process didn't exit successfully: `rustc --crate-name simple_dns --edition=2021 simple-dns/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=117 --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --cfg 'feature="default"' --cfg 'feature="std"' --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("alloc", "default", "std"))' -C metadata=2e6bbbbb97992d8e -C extra-filename=-07d68c6fb46cf820 --out-dir /simple-dns/target/release/deps -C strip=debuginfo -L dependency=/simple-dns/target/release/deps --extern bitflags=/simple-dns/target/release/deps/libbitflags-3d90d42037c02fb4.rmeta` (exit status: 101)

Same code builds just fine with rust toolchain downloaded with rustup.

Also, this appears to not be a problem on f43?
https://copr.fedorainfracloud.org/coprs/luk1337/test/build/10840400/ it built correctly there.

Reproducible: Always

Steps to Reproduce:
Build simple-dns (https://github.com/balliegojr/simple-dns)
Actual Results:
Fails to build.

Expected Results:
Builds.

Comment 1 Josh Stone 2026-08-10 17:00:21 UTC
> Also, this appears to not be a problem on f43?

F43 used LLVM 21, while 44 and 45 (rawhide) used LLVM 22. Given that the error is also from LLVM, it seems likely that it's an LLVM regression, although sometimes rustc does adjust its part in codegen to adapt to different LLVM versions too.

I'll dig a bit and see if I can get an LLVM-IR reproducer, and possibly reduce it.

Comment 2 Josh Stone 2026-08-10 23:33:06 UTC
Reduced IR below, and opt -O2 creates that bogus "zext i128 %N to i96". I can reproduce this even several LLVM versions back, so it must be some other perturbation that let F43 work in the original build. However, LLVM 23 builds fine!

Cherry-picking llvm#207229 to LLVM 22 fixes the reducer for me, as well as the original IR saved from rustc simple-dns. I'm currently building the llvm package to test this with the full simple-dns build, and if that works I'll post a PR.

---

; ModuleID = '<stdin>'
target datalayout = "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64"
target triple = "s390x-unknown-linux-gnu"

define fastcc void @_RNvNtNtCs1BZm78KmNte_10simple_dns3dns5rdata11parse_rdata(ptr %0, i1 %cond, ptr %1) #0 {
  br i1 %cond, label %3, label %11

3:                                                ; preds = %2
  %4 = getelementptr i8, ptr %1, i64 8
  %5 = load i64, ptr %1, align 8
  %6 = zext i64 %5 to i96
  %7 = shl i96 %6, 64
  %8 = load i64, ptr %4, align 8
  %9 = zext i64 %8 to i96
  %10 = or i96 %7, %9
  br label %11

11:                                               ; preds = %3, %2
  %12 = phi i96 [ %10, %3 ], [ 0, %2 ]
  %13 = zext i96 %12 to i128
  store i128 %13, ptr %0, align 8
  ret void
}

attributes #0 = { "target-cpu"="z15" }

Comment 3 Aoife Moloney 2026-08-17 15:49:51 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 45 development cycle.
Changing version to 45.

Comment 4 Fedora Update System 2026-08-18 05:32:06 UTC
FEDORA-2026-1e6b58476a (llvm-22.1.8-26.fc46) has been submitted as an update to Fedora 46.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-1e6b58476a

Comment 5 Fedora Update System 2026-08-18 06:59:24 UTC
FEDORA-2026-1e6b58476a (llvm-22.1.8-26.fc46) has been pushed to the Fedora 46 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.