-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NativeAOT-LLVM: Question: Platform and arch #260
Comments
Adding that I can try with but it looks for a RID of
if this is the right way to go then I can investigate where this RID is coming from. I know there is a |
Is the logic in this file LLVM-specific or Wasm-specific? I think that LLVM backend on e.g. Linux arm64 should (eventually) generate the code in the same shape as RyuJIT. |
I think platform for wasm should stay as wasm. |
This one is wasm (emscripten specific), We also had
Of these 4 they are in NativeAOT as: So I guess we are going to want some files that are general LLVM and work across architectures, and some that only work for a specific architecture. |
Edited as |
We have dealt with the low-level codegen differences by selecting the right support methods for them at app compile time or runtime. For example SupportsRelativePointers: https://github.com/dotnet/runtimelab/blob/feature/NativeAOT/src/coreclr/src/nativeaot/System.Private.CoreLib/src/Internal/Runtime/Augments/RuntimeAugments.cs#L1155 and https://github.com/dotnet/runtimelab/blob/feature/NativeAOT/src/coreclr/src/tools/Common/TypeSystem/IL/CoreRTILProvider.cs#L95 This allowed us to build one corelib per platform. The number of potential combinations of codegen variants and platforms would grow really fast otherwise. |
Thanks, moving on a bit. Line 91 in 45cf22a
This property group is not conditional and appears to include the jit and hence the code under coreclr/src/jit. Should I be setting that to false for LLVM? |
Yes, that should be fine. How to you plan to specify LLVM? Is it going to be hardcoded in the branch, or is it going to be a setting somewhere? For the nativeaot branch, we took several shortcuts that regress build of regular .NET runtime when setting up how the build works. We just made sure to add comments around them. These shortcuts would need to be cleaned up before the changes are upstreamed to master. |
I think it will be a setting ultimately. Not really sure how this will all pan out, happy to change things around, as it might be easier if I have some concrete changes to talk around. As an update, I've checked in where I am #247, its not tidied up, and just reflects my attempts to understand where changes are needed. I'm running the build from here with
I have it to the point where things compile but dont run as I'm not understanding how |
You may need to revert a bit of 7ef548e#diff-25943ca2038c811a65a8e53d31c55123b061438c0694e31f2b4d6b970df991fa for wasm. wasm may be depending on cppcodegen paths here and there. |
Ok, thanks, I've got something for RhRegisterOSModule. Next: In
I've got Build log at failure point is:
|
Yes, that's correct. I suspect that the problem is with (Also, I have pushed updated feature/Native into feature/NativeAOT-LLVM to make it easier to look at the diff in github UI.) |
Thanks, yes that looks like it was the problem. As usual I've got a bit further and have another question. I have this error
Taking the first one for
Whereas others, e.g.
I think therefore that the TargetFramework is not getting set, so I tried with specifying it on the command line Line 202 in 021f8f1
ToLowerInvariant() then it does look different, in that I get a System.IO.Compression.dll built, however maybe not in the right place. The failure above is when building System.dll and the references are, to a couple picked at random
However |
I do not see anything obvious why this may be going wrong. Looks like another unexpected iteraction of msbuild properties. |
Yes: dotnet/arcade#6506 |
I feel like I'm making heavy weather of this, but anyway. I'm currently trying to build with
And I'm getting a problem with
and
Should I even be attempting to build these shims? If so I'll need to see why the {Edit). Maybe I just need to set the forwarding rules up somewhere so that this browser target works like CoreCLR for netstandard.dll, but shouldn't the |
Yes, these shims should be building in the wasm build. They are needed for .NET Standard compatibility. Not strictly required for hello world. They are needed to run more interesting apps. You can try disable building them, but I think you will likely hit the underlying problem causing the build break in other places too. Yes, Does this error reproduce with the current state of #247 ? |
Yes, the current state should repro this. I did fix a few other things today that were failing, but they haven't fixed this issue. |
Try omitting The Mono wasm build instructions don't have it and it is what's causing the netstandard.dll to be missing. |
@jkotas Thanks!
Need to:
|
I'm trying to get
to work for
As though it hasn't brought in
I suppose? I never got this bit working in CoreRT either, I used to set IlcPath on the command line. |
I think that it is a general problem with missing cross-compilation support in |
I think part of the problem is runtimelab/src/coreclr/src/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.targets Line 32 in fbe874a
If I add some debug here
I get
So the condition fails as Should I just drop from runtimelab/src/coreclr/src/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.targets Line 11 in fbe874a
-$(PlatformTarget) for wasm or is that going to create different problems?
|
To move forward with cross-compilation, at least for wasm, do you see files like runtimelab/src/coreclr/src/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets Lines 237 to 238 in fbe874a
$(OS) ?
|
Do you see any host-specific logic inside I think most (if not all) logic inside |
runtimelab/src/coreclr/src/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.props Line 94 in fbe874a
is the one that made me ask. |
Good catch - this specific piece of logic should be under host OS condition |
Current state will |
Is there an effort to drop nmake and use ninja in its place? |
We have an effort to replace msbuild with ninja on Windows: dotnet/runtime#44761 . You can ask about any plans for Unix in that issue. |
thanks, Do you know if there were some changes to how
even though in the properties it looks like it is set: |
I am not aware of any changes for I believe that this stack trace is from the new optimized package restore feature in msbuild/NuGet. I know that msbuild projects needed adjustments here and there to work well with it. |
I'm just cleaning things up now. https://github.com/dotnet/runtimelab/pull/247/files is currently showing 1631 files changes, probably because I've merged locally from bb9fe2f (16/11/2020 ). Shall I just do another PR into dotnet:feature/NativeAOT-LLVM from NativeAOT to get it up to date? |
I have just pushed feature/NativeAOT into feature/NativeAOT-LLVM for you since the branches have not diverged yet. Could you please undo the .wasm.cs files deletions from #331 in your PR? |
Thanks, that's much better. Down to 67 files, which I'm checking. |
How does nativeaot build the gc (libclrgc) when Line 51 in 7faa1f0
clr.runtime ?
In runtimelab/src/coreclr/runtime.proj Line 24 in 7faa1f0
|
It includes the files here: https://github.com/dotnet/runtimelab/blob/feature/NativeAOT/src/coreclr/src/nativeaot/Runtime/CMakeLists.txt#L45 |
I see, part of the runtime library itself, not separate. Thanks |
closing, as this turned into help to getting the build working just for wasm. For building LLVM to target other platforms a new issue would be better as less noise. |
In the project files, llvm specific files are included switching on the Platform:
I note there is an
--arch
defined for Wasm. When building for LLVM what would you expect the arguments to be tobuild
? Should there be something that sets the build property ofPlatform
tollvm
for an arch ofwasm
, so it would be something likebuild -a wasm
or as there are going to various sub targets for LLVM, .e.g a win-x86 target, how should this be setup ?The text was updated successfully, but these errors were encountered: