dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.27k stars 4.73k forks source link

[wasm] Can no longer build on main using stable debian #106036

Open kg opened 3 months ago

kg commented 3 months ago

When I do ./build.sh --os browser -c Release /p:WasmNativeStrip=false

I get lots of C++ errors, seemingly when compiling mono llvmjit (I'm not sure why this is even building, since we don't use it in mono-wasm). I've nuked artifacts and emsdk, and have installed clang 19's official packages. I also tried removing my OS's default clang packages (14) but that made everything more broken. Did we accidentally become Ubuntu-only again? I'm not sure how to make it not use clang 14.

  /usr/bin/clang++-14 -DCOMPILER_SUPPORTS_W_RESERVED_IDENTIFIER -DHAVE_CONFIG_H -DLLVM_API_VERSION=1900 -DMONO_DLL_EXPORT -D_GNU_SOURCE -D_REENTRANT -D_THREAD_SAFE -I/home/kate/Projects/dotnet-runtime-wasm/artifacts/obj -I/home/kate/Projects/dotnet-runtime-wasm/src/native -I/home/kate/Projects/dotnet-runtime-wasm/artifacts/obj/mono/browser.wasm.Release/cross/mono/mini -I/home/kate/Projects/dotnet-runtime-wasm/artifacts/obj/mono/browser.wasm.Release/cross/mono/mini/../.. -I/home/kate/Projects/dotnet-runtime-wasm/src/mono/mono/mini/../.. -I/home/kate/Projects/dotnet-runtime-wasm/src/mono/mono/mini/.. -I/home/kate/Projects/dotnet-runtime-wasm/src/mono/mono/mini/../eventpipe -I/home/kate/Projects/dotnet-runtime-wasm/artifacts/obj/mono/browser.wasm.Release/cross/mono/mini/eventpipe -I/home/kate/Projects/dotnet-runtime-wasm/src/native/public/. -I/home/kate/Projects/dotnet-runtime-wasm/artifacts/obj/mono/browser.wasm.Release/cross/mono/eglib -I/home/kate/Projects/dotnet-runtime-wasm/src/mono/mono/eglib -I/home/kate/Projects/dotnet-runtime-wasm/artifacts/obj/mono/browser.wasm.Release/cross/_deps/fetchzlibng-build -I/home/kate/Projects/dotnet-runtime-wasm/src/native/external/zlib-ng -isystem /home/kate/Projects/dotnet-runtime-wasm/artifacts/obj/mono/browser.wasm.Release/llvm/x64/include -I/home/kate/Projects/dotnet-runtime-wasm/artifacts/obj/mono/browser.wasm.Release/llvm//x64/include/c++/v1 -L/home/kate/Projects/dotnet-runtime-wasm/artifacts/obj/mono/browser.wasm.Release/llvm//x64/lib -stdlib=libc++ -Wl,--build-id=sha1 -fno-strict-aliasing -fwrapv -Wall -Wunused -Wmissing-declarations -Wpointer-arith -Wno-cast-qual -Wwrite-strings -Wno-switch -Wno-switch-enum -Wno-unused-value -Wno-attributes -Wno-format-zero-length -Wno-unused-function -Qunused-arguments -Wno-tautological-compare -Wno-parentheses-equality -Wno-self-assign -Wno-return-stack-address -Wno-constant-logical-operand -Wno-zero-length-array -Wno-asm-operand-widths -Werror=return-type -I/home/kate/Projects/dotnet-runtime-wasm/artifacts/obj/mono/browser.wasm.Release/llvm//x64/include -isystem /home/kate/Projects/dotnet-runtime-wasm/artifacts/obj/mono/browser.wasm.Release/llvm//x64/include/c++/v1 -std=c++17 -nostdinc++ -nostdlib++ -fno-exceptions -fno-rtti -D__STDC_CONSTANT_MACROS -D__STD_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fexceptions -fno-rtti -O3 -DNDEBUG -fPIC   -g -fPIC -fvisibility=hidden -Os -ffp-contract=off -MD -MT mono/mini/CMakeFiles/monosgen-objects.dir/mini-llvm-cpp.cpp.o -MF mono/mini/CMakeFiles/monosgen-objects.dir/mini-llvm-cpp.cpp.o.d -o mono/mini/CMakeFiles/monosgen-objects.dir/mini-llvm-cpp.cpp.o -c /home/kate/Projects/dotnet-runtime-wasm/src/mono/mono/mini/mini-llvm-cpp.cpp
  In file included from /home/kate/Projects/dotnet-runtime-wasm/src/mono/mono/mini/mini-llvm-cpp.cpp:26:
  In file included from /home/kate/Projects/dotnet-runtime-wasm/artifacts/obj/mono/browser.wasm.Release/llvm//x64/include/c++/v1/stdint.h:106:
  /home/kate/Projects/dotnet-runtime-wasm/artifacts/obj/mono/browser.wasm.Release/llvm//x64/include/c++/v1/__config:48:8: warning: "Libc++ only supports Clang 16 and later" [-W#warnings]
  #      warning "Libc++ only supports Clang 16 and later"
         ^
  In file included from /home/kate/Projects/dotnet-runtime-wasm/src/mono/mono/mini/mini-llvm-cpp.cpp:51:
  In file included from /home/kate/Projects/dotnet-runtime-wasm/artifacts/obj/mono/browser.wasm.Release/llvm//x64/include/llvm/Support/raw_ostream.h:16:
  In file included from /home/kate/Projects/dotnet-runtime-wasm/artifacts/obj/mono/browser.wasm.Release/llvm//x64/include/llvm/ADT/SmallVector.h:18:
  In file included from /home/kate/Projects/dotnet-runtime-wasm/artifacts/obj/mono/browser.wasm.Release/llvm//x64/include/llvm/Support/type_traits.h:17:
  In file included from /home/kate/Projects/dotnet-runtime-wasm/artifacts/obj/mono/browser.wasm.Release/llvm//x64/include/c++/v1/type_traits:421:
  /home/kate/Projects/dotnet-runtime-wasm/artifacts/obj/mono/browser.wasm.Release/llvm//x64/include/c++/v1/__fwd/functional.h:18:1: error: expected identifier or '{'
  _LIBCPP_BEGIN_NAMESPACE_STD
  ^
  /home/kate/Projects/dotnet-runtime-wasm/artifacts/obj/mono/browser.wasm.Release/llvm//x64/include/c++/v1/__config:853:81: note: expanded from macro '_LIBCPP_BEGIN_NAMESPACE_STD'
                                        namespace _LIBCPP_TYPE_VISIBILITY_DEFAULT std {                      
kg commented 3 months ago

Solutions You Will Never Regret Later On(tm):

sudo ln -s /usr/bin/clang++-19 /usr/bin/clang++-14
sudo ln -s /usr/bin/clang-19 /usr/bin/clang-14
jkurdek commented 2 months ago

Got same issue on ubuntu when trying to build with aot llvm. ./build.sh mono+libs+clr.hosts -c debug /p:KeepNativeSymbols=true /p:MonoEnableLlvm=true /p:MonoLLVMUseCxx11Abi=true