Article View: linux.debian.bugs.dist
Article #4577Bug#1154047: smlsharp: FTBFS with LLVM 23 as default: TargetLoweringObjectFile API change
From: Sylvestre Ledru
Date: Sun, 15 Nov 2026 12:30
Date: Sun, 15 Nov 2026 12:30
96 lines
4789 bytes
4789 bytes
--1804289383-1794740571=:2282552
Content-Type: text/plain; charset=UTF-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
Content-ID: <20261115120251.2282552@pulau.ecranbleu.org>
Source: smlsharp
Version: 4.1.0-1.1
Severity: important
Tags: ftbfs patch
User: pkg-llvm-team@lists.alioth.debian.org
Usertags: llvm-23-default
Control: affects -1 + src:llvm-defaults
Control: block 1154024 by -1
Hello,
We are going to switch the default LLVM version to 23 (transition bug
#1154024). llvm-defaults 0.75~exp1, in experimental, already points to
23.
smlsharp fails to build in unstable with it, and builds without it:
src/llvm/main/smlsharp_gc.cpp:149:18: error: no matching function for
call to 'llvm::TargetLoweringObjectFile::getSectionForConstant(const
llvm::DataLayout&, llvm::SectionKind, std::nullptr_t, llvm::Align&) const'
In LLVM 23, TargetLoweringObjectFile::getSectionForConstant takes an
additional const Function *F argument (after the alignment), the call
in src/llvm/main/smlsharp_gc.cpp:148 needs it. #1123477 was the same
kind of port for LLVM 21.
The attached debdiff adds it for LLVM >= 23. smlsharp builds with it.
To reproduce, with sbuild:
sbuild -d unstable \
--extra-repository='deb http://deb.debian.org/debian experimental main' \
--build-dep-resolver=aptitude \
--add-depends='clang (>= 1:23~), llvm-dev (>= 1:23~), libclang-dev (>= 1:23~)' \
<package>
The --add-depends forces the llvm-defaults packages from experimental
(the default apt resolver won't pick them, aptitude does), everything
else comes from unstable.
The severity will be raised to serious once llvm-defaults 23 is in
unstable.
Cheers,
Sylvestre
--1804289383-1794740571=:2282552
Content-Type: text/x-diff; charset=UTF-8; name="smlsharp.debdiff"
Content-Disposition: attachment; filename="smlsharp.debdiff"
Content-Transfer-Encoding: 8bit
Content-ID: <20261115120251.2282552.1@pulau.ecranbleu.org>
diff --git a/debian/patches/llvm-23.patch b/debian/patches/llvm-23.patch
new file mode 100644
index 0000000..c8e076d
--- /dev/null
+++ b/debian/patches/llvm-23.patch
@@ -0,0 +1,23 @@
+Description: Fix the build with LLVM 23
+ TargetLoweringObjectFile::getSectionForConstant takes an additional
+ "const Function *" argument since LLVM 23.
+Author: Sylvestre Ledru <sylvestre@debian.org>
+Forwarded: no
+Last-Update: 2026-11-15
+---
+Index: smlsharp-4.1.0/src/llvm/main/smlsharp_gc.cpp
+===================================================================
+--- smlsharp-4.1.0.orig/src/llvm/main/smlsharp_gc.cpp
++++ smlsharp-4.1.0/src/llvm/main/smlsharp_gc.cpp
+@@ -147,7 +147,11 @@ SMLSharpGCPrinter::finishAssembly(Module
+ #endif
+ (ap.getObjFileLowering().getSectionForConstant
+ (ap.getDataLayout(), SectionKind::getReadOnly(),
++#if LLVM_VERSION_MAJOR >= 23
++ nullptr, align, nullptr));
++#else
+ nullptr, align));
++#endif
+ EmitAlignPtrSize(ap);
+ #if LLVM_VERSION_MAJOR <= 10
+ ap.OutStreamer->EmitLabel(sml_ftab);
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..57a9af7
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+llvm-23.patch
--1804289383-1794740571=:2282552--
Technical Details
Message-ID:
<NZHwS-c2jJ-13@gated-at.bofh.it>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news-ams.pugleaf.net!srl.newsdeef.eu!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomodShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news-ams.pugleaf.net!srl.newsdeef.eu!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod From: Sylvestre Ledru <sylvestre@debian.org> Newsgroups: linux.debian.bugs.dist Subject: Bug#1154047: smlsharp: FTBFS with LLVM 23 as default: TargetLoweringObjectFile API change Date: Sun, 15 Nov 2026 13:30:02 +0100 Message-ID: <NZHwS-c2jJ-13@gated-at.bofh.it> X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org Sun Nov 15 12:21:09 2026 Old-Return-Path: <debbugs@buxtehude.debian.org> X-Spam-Flag: NO X-Spam-Score: -1.9 Reply-To: Sylvestre Ledru <sylvestre@debian.org>, 1154047@bugs.debian.org Resent-To: debian-bugs-dist@lists.debian.org Resent-Cc: iwamatsu@debian.org X-Debian-Pr-Message: report 1154047 X-Debian-Pr-Package: src:smlsharp X-Debian-Pr-Keywords: ftbfs patch X-Debian-Pr-Source: smlsharp MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="1804289383-1794740571=:2282552" User-Agent: mail (GNU Mailutils 3.21) X-Debian-Message: from BTS X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/2002723 List-ID: <debian-bugs-dist.lists.debian.org> List-URL: <https://lists.debian.org/debian-bugs-dist/> Approved: robomod@news.nic.it Lines: 96 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Date: Sun, 15 Nov 2026 12:02:51 +0100 X-Original-Message-ID: <20261115110251.51A5F19CDB11@pulau.ecranbleu.org>