#1139588 llvm-toolchain-20: FTBFS with CMake 4: ADD_LIBRARY called with SHARED option but the target platform does not support dynamic linking #1139588
- Package:
- src:llvm-toolchain-20
- Source:
- src:llvm-toolchain-20
- Submitter:
- Date:
- 2026-08-18 16:39:03 UTC
- Severity:
- normal
- Tags:
Dear maintainer, During a test rebuild for CMake 4, llvm-toolchain-19 failed to rebuild. Log Summary: ------------------------------------------------------------------------------- [...] [2834/2855] cd /build/reproducible-path/llvm-toolchain-19-19.1.7/libclc/build && /usr/bin/cmake -E create_symlink tahiti-amdgcn-mesa-mesa3d.bc gfx1152-amdgcn-mesa-mesa3d.bc [2835/2855] cd /build/reproducible-path/llvm-toolchain-19-19.1.7/libclc/build && /usr/bin/cmake -E create_symlink tahiti-amdgcn-mesa-mesa3d.bc gfx1200-amdgcn-mesa-mesa3d.bc [2836/2855] cd /build/reproducible-path/llvm-toolchain-19-19.1.7/libclc/build && /usr/bin/cmake -E create_symlink tahiti-amdgcn-mesa-mesa3d.bc gfx1101-amdgcn-mesa-mesa3d.bc [2837/2855] cd /build/reproducible-path/llvm-toolchain-19-19.1.7/libclc/build && /usr/bin/cmake -E create_symlink tahiti-amdgcn-mesa-mesa3d.bc gfx1151-amdgcn-mesa-mesa3d.bc [2838/2855] cd /build/reproducible-path/llvm-toolchain-19-19.1.7/libclc/build && /usr/bin/cmake -E create_symlink tahiti-amdgcn-mesa-mesa3d.bc gfx1201-amdgcn-mesa-mesa3d.bc [2839/2855] cd /build/reproducible-path/llvm-toolchain-19-19.1.7/libclc/build && /build/reproducible-path/llvm-toolchain-19-19.1.7/libclc/build/prepare_builtins -o nvptx--.bc builtins.opt.nvptx--.bc [2840/2855] cd /build/reproducible-path/llvm-toolchain-19-19.1.7/libclc/build && /usr/bin/cmake -E create_symlink cedar-r600--.bc palm-r600--.bc [2841/2855] cd /build/reproducible-path/llvm-toolchain-19-19.1.7/libclc/build && /build/reproducible-path/llvm-toolchain-19-19.1.7/libclc/build/prepare_builtins -o nvptx64--.bc builtins.opt.nvptx64--.bc [2842/2855] cd /build/reproducible-path/llvm-toolchain-19-19.1.7/libclc/build && /usr/bin/cmake -E create_symlink cedar-r600--.bc sumo-r600--.bc [2843/2855] cd /build/reproducible-path/llvm-toolchain-19-19.1.7/libclc/build && /usr/bin/cmake -E create_symlink cedar-r600--.bc redwood-r600--.bc [2844/2855] cd /build/reproducible-path/llvm-toolchain-19-19.1.7/libclc/build && /usr/bin/cmake -E create_symlink cedar-r600--.bc sumo2-r600--.bc [2845/2855] cd /build/reproducible-path/llvm-toolchain-19-19.1.7/libclc/build && /usr/bin/cmake -E create_symlink cedar-r600--.bc juniper-r600--.bc [2846/2855] cd /build/reproducible-path/llvm-toolchain-19-19.1.7/libclc/build && /usr/bin/cmake -E create_symlink cypress-r600--.bc hemlock-r600--.bc [2847/2855] cd /build/reproducible-path/llvm-toolchain-19-19.1.7/libclc/build && /build/reproducible-path/llvm-toolchain-19-19.1.7/libclc/build/prepare_builtins -o nvptx64--nvidiacl.bc builtins.opt.nvptx64--nvidiacl.bc [2848/2855] cd /build/reproducible-path/llvm-toolchain-19-19.1.7/libclc/build && /usr/bin/cmake -E create_symlink barts-r600--.bc turks-r600--.bc [2849/2855] cd /build/reproducible-path/llvm-toolchain-19-19.1.7/libclc/build && /usr/bin/cmake -E create_symlink barts-r600--.bc caicos-r600--.bc [2850/2855] cd /build/reproducible-path/llvm-toolchain-19-19.1.7/libclc/build && /usr/bin/cmake -E create_symlink cayman-r600--.bc aruba-r600--.bc [2851/2855] cd /build/reproducible-path/llvm-toolchain-19-19.1.7/libclc/build && /build/reproducible-path/llvm-toolchain-19-19.1.7/libclc/build/prepare_builtins -o nvptx--nvidiacl.bc builtins.opt.nvptx--nvidiacl.bc [2852/2855] cd /build/reproducible-path/llvm-toolchain-19-19.1.7/libclc/build && /usr/bin/llvm-spirv-19 --spirv-max-version=1.1 -o spirv64-mesa3d-.spv builtins.link.spirv64-mesa3d-.bc [2853/2855] cd /build/reproducible-path/llvm-toolchain-19-19.1.7/libclc/build && /usr/bin/llvm-spirv-19 --spirv-max-version=1.1 -o spirv-mesa3d-.spv builtins.link.spirv-mesa3d-.bc [2854/2855] cd /build/reproducible-path/llvm-toolchain-19-19.1.7/libclc/build && /build/reproducible-path/llvm-toolchain-19-19.1.7/build-llvm/tools/clang/stage2-bins/bin/opt -O3 -o builtins.opt.amdgcn--amdhsa.bc builtins.link.amdgcn--amdhsa.bc [2855/2855] cd /build/reproducible-path/llvm-toolchain-19-19.1.7/libclc/build && /build/reproducible-path/llvm-toolchain-19-19.1.7/libclc/build/prepare_builtins -o amdgcn--amdhsa.bc builtins.opt.amdgcn--amdhsa.bc Command being timed: "ninja -j 5 -v" User time (seconds): 1433.95 System time (seconds): 164.61 Percent of CPU this job got: 489% Elapsed (wall clock) time (h:mm:ss or m:ss): 5:26.24 Average shared text size (kbytes): 0 Average unshared data size (kbytes): 0 Average stack size (kbytes): 0 Average total size (kbytes): 0 Maximum resident set size (kbytes): 551460 Average resident set size (kbytes): 0 Major (requiring I/O) page faults: 552 Minor (reclaiming a frame) page faults: 24253758 Voluntary context switches: 26680 Involuntary context switches: 8779 Swaps: 0 File system inputs: 14584 File system outputs: 916960 Socket messages sent: 0 Socket messages received: 0 Signals delivered: 0 Page size (bytes): 4096 Exit status: 0 touch stamps/debian-libclc-build Building compiler-rt for wasm32 Using cmake: cmake mkdir -p "build-wasm/compiler-rt-wasm32" cmake -B "build-wasm/compiler-rt-wasm32" -S compiler-rt/lib/builtins/ \ -G Ninja \ \ -DCMAKE_SYSTEM_NAME=Generic \ -DCMAKE_C_COMPILER_TARGET=wasm32-unknown-unknown \ -DCMAKE_CXX_COMPILER_TARGET=wasm32-unknown-unknown \ -DCMAKE_ASM_COMPILER_TARGET=wasm32-unknown-unknown \ -DCMAKE_C_COMPILER=/build/reproducible-path/llvm-toolchain-19-19.1.7/build-llvm/tools/clang/stage2-bins/bin/clang \ -DCMAKE_CXX_COMPILER=/build/reproducible-path/llvm-toolchain-19-19.1.7/build-llvm/tools/clang/stage2-bins/bin/clang++ \ -DCMAKE_C_FLAGS="-O2 -DNDEBUG -g1 -Werror=implicit-function-declaration -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -Wno-unused-command-line-argument -Wdate-time -D_FORTIFY_SOURCE=2" \ -DCMAKE_CXX_FLAGS="-O2 -DNDEBUG -g1 -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -Wno-unused-command-line-argument -Wdate-time -D_FORTIFY_SOURCE=2" \ -DCMAKE_SHARED_LINKER_FLAGS="-Wl,-z,relro -Wl,--build-id -L/build/reproducible-path/llvm-toolchain-19-19.1.7/build-llvm/tools/clang/stage2-bins/lib" \ -DCMAKE_MODULE_LINKER_FLAGS="-Wl,-z,relro -Wl,--build-id -L/build/reproducible-path/llvm-toolchain-19-19.1.7/build-llvm/tools/clang/stage2-bins/lib" \ -DCMAKE_EXE_LINKER_FLAGS="-Wl,-z,relro -Wl,--build-id -L/build/reproducible-path/llvm-toolchain-19-19.1.7/build-llvm/tools/clang/stage2-bins/lib" \ -DCMAKE_INSTALL_PREFIX=/usr/lib/llvm-19/lib/clang/19 \ -DCMAKE_INSTALL_DATADIR=lib \ -DCMAKE_INSTALL_INCLUDEDIR=include \ -DLLVM_CMAKE_DIR=/build/reproducible-path/llvm-toolchain-19-19.1.7/build-llvm/tools/clang/stage2-bins/bin/../ \ -DCOMPILER_RT_STANDALONE_BUILD=ON \ -DCOMPILER_RT_BAREMETAL_BUILD=ON \ -DCOMPILER_RT_INCLUDE_TESTS=OFF \ -DCOMPILER_RT_USE_LIBCXX=OFF \ -DCOMPILER_RT_USE_BUILTINS_LIBRARY=ON \ -DCOMPILER_RT_DEFAULT_TARGET_TRIPLE=wasm32-unknown-unknown \ -DCOMPILER_RT_OS_DIR=wasi -- The C compiler identification is Clang 19.1.7 -- The ASM compiler identification is Clang with GNU-like command-line -- Found assembler: /build/reproducible-path/llvm-toolchain-19-19.1.7/build-llvm/tools/clang/stage2-bins/bin/clang -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /build/reproducible-path/llvm-toolchain-19-19.1.7/build-llvm/tools/clang/stage2-bins/bin/clang - skipped -- Detecting C compile features -- Detecting C compile features - done -- Looking for unwind.h -- Looking for unwind.h - found -- Looking for rpc/xdr.h -- Looking for rpc/xdr.h - not found -- Could NOT find FFI (missing: FFI_LIBRARIES HAVE_FFI_CALL) -- Looking for histedit.h -- Looking for histedit.h - not found -- Could NOT find LibEdit (missing: LibEdit_INCLUDE_DIRS LibEdit_LIBRARIES) -- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR) -- Could NOT find zstd (missing: zstd_LIBRARY zstd_INCLUDE_DIR) -- Found LibXml2: /usr/lib/aarch64-linux-gnu/libxml2.so (found version "2.14.5") -- Found CURL: /usr/lib/aarch64-linux-gnu/libcurl.so (found version "8.16.0-rc2") CMake Error at /build/reproducible-path/llvm-toolchain-19-19.1.7/build-llvm/tools/clang/stage2-bins/lib/cmake/llvm/LLVMExports.cmake:1473 (add_library): ADD_LIBRARY called with SHARED option but the target platform does not support dynamic linking. Call Stack (most recent call first): /build/reproducible-path/llvm-toolchain-19-19.1.7/build-llvm/tools/clang/stage2-bins/lib/cmake/llvm/LLVMConfig.cmake:371 (include) /build/reproducible-path/llvm-toolchain-19-19.1.7/compiler-rt/cmake/Modules/CompilerRTUtils.cmake:312 (find_package) CMakeLists.txt:29 (load_llvm_config) ------------------------------------------------------------------------------- The above is just how the build ends and not necessarily the most relevant part. If required, the full build log is available here (for the next 30 days): https://debusine.debian.net/artifact/2406252/ The most likely cause of build failures is the removed backwards compatibility for CMake versions earlier than 3.5. You can find additional information in my debian-devel announcement: https://lists.debian.org/debian-devel/2025/04/msg00310.html About the archive rebuild: The build was made on debusine.debian.net, using sbuild. You can find the build task here: https://debusine.debian.net/work-request/153971/ If this is really a bug in one of the build-depends, please use reassign and affects, so that this is still visible in the BTS web page for this package. Thanks, Timo
I have downgraded the bug to non-RC severity temporarily and reverted CMake in unstable to version 3.31.6. I plan to re-upgrade in about a month's time. I realize that despite my April announcement, the upload to unstable came rather surprising, and I don't want to cause unnecessary pain. Also, the build log URL has an unfortunate mistake. The correct URL should include the workspace, i.e., https://debusine.debian.net/debian/developers/artifact/XXXX CMake 4 will also be available in experimental again, so it can be used to verify that the bug is fixed. Cheers Timo
I haven't seen any upstream support for cmake 4.x, not even in the trunk (llvm-toolchain-snapshot). So if you upgrade to cmake 4.x, all LLVM package stay unbuildable for some unseen time. What do you suggest?
Hi,
* Matthias Klose <doko@debian.org> [2025-10-25 19:25]:
The actual bug is that LLVM {17,18,19} try to build shared libraries for
WebAssembly, which does not support them. CMP0164 [1] turned this into a
fatal error, and CMake 4 implicitly activates this policy in export
files [2], which is why this became a FTBFS.
I'm going to ask CMake upstream for advice, but ultimately this is
something that LLVM upstream needs to fix. Frankly, I would find it
surprising if they have not addressed this already, and I would further
assume that such a fix can be backported to the older releases.
If that is not possible for some reason, I might be convinced to
introduce a cmake-3 legacy package as hotfix. This cannot be a permanent
solution, though, and I'd rather avoid that maintenance burden
altogether.
Cheers
Timo
[1] https://cmake.org/cmake/help/latest/policy/CMP0164.html
[2] https://gitlab.kitware.com/cmake/cmake/-/commit/10f8c6a2742500ddc708091f194d218a37543129
Hello again, On Sat, 22 Nov 2025 00:12:13 +0100 Timo =?utf-8?Q?R=C3=B6hling?= I've looked into this a bit further and found an upstream issue [1]. In the pull request trying to fix it, upstream notes that you need to enable shared libraries explicitly (which is what Debian does), so this actually needs to be fixed by whoever builds for the wasm32 target [2]. My first instinct was to look at the build-wasm/compiler-rt-%" targets in debian/rules, but I could not determine where the shared library build is actually activated. Hopefully, someone with a better grasp of the codebase can pick it up from here. Cheers Timo [1] https://github.com/llvm/llvm-project/issues/118048 [2] https://github.com/llvm/llvm-project/pull/118262#issuecomment-2561578536 and the follow-up comment
control: clone -1 -2 control: reassign -2 src:llvm-toolchain-20 control: retitle -2 llvm-toolchain-20: FTBFS with CMake 4: ADD_LIBRARY called with SHARED option but the target platform does not support dynamic linking It also affects llvm-toolchain-20 (currently only in experimental). Cloning the bug.
Closing bugs reported against llvm-toolchain-20 now that it got removed from the archive.----- Message transféré de Debian Bug Tracking System <owner@bugs.debian.org> ----- From: Debian Bug Tracking System <owner@bugs.debian.org> To: Sylvestre Ledru <sylvestre@debian.org> Reply-To: 1116216@bugs.debian.org X-Mailer: MIME-tools 5.510 (Entity 5.510) Date: Tue, 14 Jul 2026 09:33:02 +0000 Subject: Bug#1116216 closed by Debian FTP Masters <ftpmaster@ftp-master.debian.org> (Bug#1116216: Removed package(s) from experimental) Message-ID: <handler.1116216.D1116216.17840214462041426.notifdone@bugs.debian.org> This is an automatic notification regarding your Bug report which was filed against the ftp.debian.org package: #1116216: RM: llvm-toolchain-20/experimental -- ROM; Won't be in unstable It has been closed by Debian FTP Masters <ftpmaster@ftp-master.debian.org>. Their explanation is attached below along with your original report. If this explanation is unsatisfactory and you have not received a better one in a separate message then please contact Debian FTP Masters <ftpmaster@ftp-master.debian.org> by replying to this email.------------------- Reason ------------------- ROM; Won't be in unstable ---------------------------------------------- Note that the package(s) have simply been removed from the tag database and may (or may not) still be in the pool; this is not a bug. The package(s) will be physically removed automatically when no suite references them (and in the case of source, when no binary references it). Please also remember that the changes have been done on the master archive and will not propagate to any mirrors until the next dinstall run at the earliest. Packages are usually not removed from testing by hand. Testing tracks unstable and will automatically remove packages which were removed from unstable when removing them from testing causes no dependency problems. The release team can force a removal from testing if it is really needed, please contact them if this should be the case. Bugs which have been reported against this package are not automatically removed from the Bug Tracking System. Please check all open bugs and close them or re-assign them to another package if the removed package was superseded by another one. The version of this package that was in Debian prior to this removal can still be found using https://snapshot.debian.org/. Thank you for reporting the bug, which will now be closed. If you have further comments please address them to 1116216@bugs.debian.org. The full log for this bug can be viewed at https://bugs.debian.org/1116216 This message was generated automatically; if you believe that there is a problem with it please contact the archive administrators by mailing ftpmaster@ftp-master.debian.org. Debian distribution maintenance software pp. Thorsten Alteholz (the ftpmaster behind the curtain) From: Sylvestre Ledru <sylvestre@debian.org> To: Debian Bug Tracking System <submit@bugs.debian.org> X-Mailer: reportbug 13.2.0 X-Spam-Status: No, score=-31.0 required=4.0 tests=BAYES_00, BODY_INCLUDES_CONTROL_AFFECTS,BODY_INCLUDES_PACKAGE,FROMDEVELOPER, HAS_PACKAGE,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE,SPF_NONE,XMAILER_REPORTBUG autolearn=ham autolearn_force=no version=4.0.1-bugs.debian.org_2005_01_02 Date: Wed, 24 Sep 2025 13:16:18 +0200 Subject: RM: llvm-toolchain-20/experimental -- ROM; Won't be in unstable Message-ID: <175871257897.3751907.3638191059166209781.reportbug@burias.ecranbleu.org> Package: ftp.debian.org Severity: normal X-Debbugs-Cc: llvm-toolchain-20@packages.debian.org Control: affects -1 + src:llvm-toolchain-20 User: ftp.debian.org@packages.debian.org Usertags: remove Hello, Please remove llvm-toolchain-20 from experimental To make our life easier, i won't be uploading in unstable. We have now 21 and 19 if needed. thanks Sylvestre----- Fin du message transféré -----