Bug#1050401: wasm builds fail with -march= and -mfpu flags set for the host

Matthias Klose doko at ubuntu.com
Thu Aug 24 07:09:28 BST 2023


Package: src:llvm-toolchain-17
Version: 17.0.0~+rc3-1~exp1
Severity: serious
Tags: sid trixie

the wasm builds fail on architectures with -march= and -mfpu flags set for the 
host, like armhf, and probably armel.  This used to work in LLVM 16.

I assume this is an upstream issue (confusing the host and the target), but here 
is one way to work-around it, to remove these flags from the flag settings. 
Another possibility could be to disable the wasm builds on these architectures.

patch for the work around is attached.


[...]
     FAILED: CMakeFiles/cmTC_31967.dir/testCCompiler.c.obj
     "/<<PKGBUILDDIR>>/build-llvm/tools/clang/stage2-bins/bin/clang" 
--target=wasm32-unknown-unknown   -O2 -DNDEBUG -g1 -fstack-protector-strong
  -Wformat -Werror=format-security -Wno-unused-command-line-argument 
-march=armv7-a -mfpu=vfpv3-d16 -Wdate-time -D_FORTIFY_SOURCE=2 -MD -MT CMak
eFiles/cmTC_31967.dir/testCCompiler.c.obj -MF 
CMakeFiles/cmTC_31967.dir/testCCompiler.c.obj.d -o 
CMakeFiles/cmTC_31967.dir/testCCompiler.c.obj
-c 
'/<<PKGBUILDDIR>>/build-wasm/compiler-rt-wasm32/CMakeFiles/CMakeScratch/TryCompile-X7CN7p/testCCompiler.c'
     clang: error: unsupported option '-march=' for target 'wasm32-unknown-unknown'
     clang: error: unsupported option '-mfpu=' for target 'wasm32-unknown-unknown'
     ninja: build stopped: subcommand failed.





   CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
   CMakeLists.txt:9 (project)


-- Configuring incomplete, errors occurred!
make[1]: *** [debian/rules:815: build-wasm/compiler-rt-wasm32] Error 1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arch-cpu-flags.diff
Type: text/x-patch
Size: 1809 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-llvm-team/attachments/20230824/c6213d54/attachment.bin>


More information about the Pkg-llvm-team mailing list