🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.dist
Article #4564

Bug#1154036: wasix-libc: FTBFS with LLVM 23 as default: --target=wasm32-wasi deprecated, fatal with -Werror

#4564
From: Sylvestre Ledru
Date: Sun, 15 Nov 2026 11:30
154 lines
7327 bytes
--1804289383-1794740586=:2282995
Content-Type: text/plain; charset=UTF-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
Content-ID: <20261115120306.2282995@pulau.ecranbleu.org>

Source: wasix-libc
Version: 2025.12.24.1+ds-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.

wasix-libc fails to build in unstable with it, and builds without it:

clang: error: argument '--target=wasm32-wasi' is deprecated, use
--target=wasm32-wasip1 instead [-Werror,-Wdeprecated]

The Makefile sets TARGET_TRIPLE = $(TARGET_ARCH)-wasi (line 45) and
builds with -Werror (line 385). The warning is new in clang 23. Using
wasm32-wasip1 should fix it.

The attached debdiff keeps the wasm32-wasi triple (it is used for the
installation paths) and adds -Wno-error=deprecated. The build then
fails in check-symbols: clang 23 predefines a few more macros
(__wasip1__, __WCHAR_MIN__, __SIG_ATOMIC_MIN__, ...), so the debdiff
also updates expected/wasm32-wasi/predefined-macros.txt. That second
part must only be uploaded once clang 23 is the default. wasix-libc
builds with both.

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-1794740586=:2282995
Content-Type: text/x-diff; charset=UTF-8; name="wasix-libc.debdiff"
Content-Disposition: attachment; filename="wasix-libc.debdiff"
Content-Transfer-Encoding: 8bit
Content-ID: <20261115120306.2282995.1@pulau.ecranbleu.org>

diff --git a/debian/patches/llvm-23-predefined-macros.patch b/debian/patches/llvm-23-predefined-macros.patch
new file mode 100644
index 0000000..020d3fd
--- /dev/null
+++ b/debian/patches/llvm-23-predefined-macros.patch
@@ -0,0 +1,49 @@
+Description: Update the expected predefined macros for clang 23
+ clang 23 defines a few more macros (__wasip1__, __WCHAR_MIN__, ...).
+ This must only be applied once clang 23 is the default.
+Author: Sylvestre Ledru <sylvestre@debian.org>
+Forwarded: not-needed
+Last-Update: 2026-11-15
+---
+Index: wasix-libc-2025.12.24.1+ds/expected/wasm32-wasi/predefined-macros.txt
+===================================================================
+--- wasix-libc-2025.12.24.1+ds.orig/expected/wasm32-wasi/predefined-macros.txt
++++ wasix-libc-2025.12.24.1+ds/expected/wasm32-wasi/predefined-macros.txt
+@@ -5710,6 +5710,7 @@
+ #define __LONG_LONG_MAX__ 9223372036854775807LL
+ #define __LONG_MAX __LONG_MAX__
+ #define __LONG_MAX__ 2147483647L
++#define __MEMORY_SCOPE_CLUSTR 5
+ #define __MEMORY_SCOPE_DEVICE 1
+ #define __MEMORY_SCOPE_SINGLE 4
+ #define __MEMORY_SCOPE_SYSTEM 0
+@@ -5813,6 +5814,8 @@
+ #define __SHRT_MAX__ 32767
+ #define __SID ('S' << 8)
+ #define __SIG_ATOMIC_MAX__ 2147483647L
++#define __SIG_ATOMIC_MIN__ (-__SIG_ATOMIC_MAX__ - 1)
++#define __SIG_ATOMIC_TYPE__ long int
+ #define __SIG_ATOMIC_WIDTH__ 32
+ #define __SIZEOF_DOUBLE__ 8
+ #define __SIZEOF_FLOAT__ 4
+@@ -6530,10 +6533,12 @@
+ #define __WASI_WHENCE_END (UINT8_C(2))
+ #define __WASI_WHENCE_SET (UINT8_C(0))
+ #define __WCHAR_MAX__ 2147483647
++#define __WCHAR_MIN__ (-__WCHAR_MAX__ - 1)
+ #define __WCHAR_TYPE__ int
+ #define __WCHAR_WIDTH__ 32
+ #define __WCLONE 0x80000000
+ #define __WINT_MAX__ 2147483647
++#define __WINT_MIN__ (-__WINT_MAX__ - 1)
+ #define __WINT_TYPE__ int
+ #define __WINT_WIDTH__ 32
+ #define __WNOTHREAD 0x20000000
+@@ -6644,6 +6649,7 @@
+ #define __wasilibc___typedef_suseconds_t_h 
+ #define __wasilibc___typedef_time_t_h 
+ #define __wasilibc___typedef_uid_t_h 
++#define __wasip1__ 1
+ #define __wasix__ 1
+ #define __wasix_api_h 
+ #define __wasm 1
diff --git a/debian/patches/llvm-23-wasi-target.patch b/debian/patches/llvm-23-wasi-target.patch
new file mode 100644
index 0000000..5afc314
--- /dev/null
+++ b/debian/patches/llvm-23-wasi-target.patch
@@ -0,0 +1,21 @@
+Description: Fix the build with clang 23
+ clang 23 warns that --target=wasm32-wasi is deprecated, which is fatal
+ with -Werror.
+Author: Sylvestre Ledru <sylvestre@debian.org>
+Forwarded: no
+Last-Update: 2026-11-15
+---
+Index: wasix-libc-2025.12.24.1+ds/Makefile
+===================================================================
+--- wasix-libc-2025.12.24.1+ds.orig/Makefile
++++ wasix-libc-2025.12.24.1+ds/Makefile
+@@ -377,6 +377,9 @@ LIBC_TOP_HALF_ALL_SOURCES = \
+ CFLAGS = $(EXTRA_CFLAGS)
+ # Set the target.
+ CFLAGS += --target=$(TARGET_TRIPLE)
++# clang 23 deprecates --target=wasm32-wasi in favor of wasm32-wasip1. Keep
++# the triple (it is used for the installation paths), but don't fail on it.
++CFLAGS += -Wno-error=deprecated
+ ASMFLAGS += --target=$(TARGET_TRIPLE)
+ # WebAssembly floating-point match doesn't trap.
+ # TODO: Add -fno-signaling-nans when the compiler supports it.
diff --git a/debian/patches/series b/debian/patches/series
index 553f58c..9addf25 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,3 @@
 0001-Fix-build-errors.patch
+llvm-23-wasi-target.patch
+llvm-23-predefined-macros.patch

--1804289383-1794740586=:2282995--
Technical Details
Message-ID: <NZGAN-c1O3-5@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.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#1154036: wasix-libc: FTBFS with LLVM 23 as default: --target=wasm32-wasi deprecated, fatal with -Werror
Date: Sun, 15 Nov 2026 12:30:01 +0100
Message-ID: <NZGAN-c1O3-5@gated-at.bofh.it>
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Sun Nov 15 11: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>, 1154036@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: a.dog.will.talk@akane.waseda.jp
X-Debian-Pr-Message: report 1154036
X-Debian-Pr-Package: src:wasix-libc
X-Debian-Pr-Keywords: ftbfs patch
X-Debian-Pr-Source: wasix-libc
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="1804289383-1794740586=:2282995"
User-Agent: mail (GNU Mailutils 3.21)
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/2002706
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 154
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Sun, 15 Nov 2026 12:03:06 +0100
X-Original-Message-ID: <20261115110306.931C219CDB1A@pulau.ecranbleu.org>