Open david-tf opened 11 months ago
Expected type 'System.Array1' not found in module 'System.Private.CoreLib`
This error means that the build is using a CoreCLR CoreLib, which is not compatible with the NativeAOT one. The build scripts use heuristics to decide which one to build, one of them is whether the subsets supplied are "NativeAOT-related".
So, long story short, it is recommended to build the whole thing: ./build clr.wasmjit+clr.aot+libs
.
Note as well that if you want to target WASM, you'll need to build the WASM-targeting libraries (certain parts of them are architecture-specific) with ./build clr.aot+libs -c [Debug|Release] -a wasm -os [browser|wasi]
.
Edit: also, to get rid of the CoreCLR CoreLib, a git clean
is recommended.
Another edit: also, the error messages are somewhat suspicious due to the inclusion of pointer types - did you build LLVM 15 and not some earlier version?
Thank you, I had built llvm-15.0.6.src.
I made a fresh clone and ran ./build clr.wasmjit+clr.aot+libs,
but i am getting the same errors.
Is the flag -r .
correct for ilc.exe?
It requires some custom configuration for it to be correct. The usual way to get a good baseline command line is to take one of the runtime smoke tests, compile it and then use the resulting response file (I believe the building document has some information about this too).
It seems it is necessary to specify multiple references, I got a little further this way, but still get this error:
ILC: Compiling 1 methods...
ILC: Compiling 56 methods...
ILC: Compiling 18 methods...
ILC: Compiling 39 methods...
ILC: Compiling 41 methods...
ILC: Compiling 94 methods...
ILC: Compiling 107 methods...
ILC: Compiling 153 methods...
ILC: Compiling 213 methods...
ILC: Compiling 328 methods...
ILC: Compiling 485 methods...
Assertion failed: (Args.size() == FTy->getNumParams() || (FTy->isVarArg() && Args.size() > FTy->getNumParams())) && "Calling a function with bad signature!", file F:\llvm-project\llvm-15.0.6.src\lib\IR\Instructions.cpp, line 525
abort() has been called
What are the reproduction steps for the above? It could be a compiler bug.
Hello, I wanted to experiment using ILC onwindows, I followed the instructions in docs/workflow/building/coreclt/nativeaot.md and built llvm, then used:
build.cmd -s clr.tools -arch x64 -os windows
when running ilc.exe on a c# dll, I go get the following (if using a string in main):if only using floats and ints, the above error doesnt occur, but I get the following in the output:
though, the emitted ildump seems correct but incomplete. any hints are greatly appreciated.