runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Build break when run cross-build of native CoreCLR for Linux/ARM 32bit

Open leemgs opened this issue 10 years ago • 17 comments

When I tried to do cross-build of native CoreCLR for Linux/ARM 32bit on Ubuntu 14.04 LTS X86 64bit PC since 15-Feb-2016, I have always got the build break without additional my patches. Anyone who have the same experience?

leemgs avatar Mar 02 '16 15:03 leemgs

Please provide related error logs or some additional information. (I may have some related experience from native building at ARM emulators.)

Anyway, if this is really happening since 15-Feb, it's yet another ARM build break besides dotnet/runtime#5219 . We really need to handle dotnet/runtime#5208 soon after other messes are cleared up. maybe both for ARM native (emul) build and ARM cross build.

myungjoo avatar Mar 02 '16 15:03 myungjoo

Please feel free to submit a PR with a fix. We will be happy to take it.

sergiy-k avatar Mar 02 '16 18:03 sergiy-k

Please feel free to submit a PR with a fix. We will be happy to take it.

Before submit a PR, here is my local patch. We need to remove ""$__BuildArch" == "x64" to support other targets (e.g. arm, arm64, and so on) as well as x64 target. Alternatively, we may add "$__BuildArch" == "arm" and "$__BuildArch" == "arm64".

--- a/build.sh
+++ b/build.sh
 -196,7 +196,6  isMSBuildOnNETCoreSupported()
     # This needs to be updated alongwith corresponding changes to netci.groovy.
     __isMSBuildOnNETCoreSupported=0

-    if [ "$__BuildArch" == "x64" ]; then
         if [ "$__BuildOS" == "Linux" ]; then
             if [ "$__DistroName" == "ubuntu" ]; then
                 __isMSBuildOnNETCoreSupported=1
 -208,7 +207,6  isMSBuildOnNETCoreSupported()
         elif [ "$__BuildOS" == "OSX" ]; then
             __isMSBuildOnNETCoreSupported=1
         fi
-    fi
 }

leemgs avatar Mar 02 '16 23:03 leemgs

@mmitche, are these checks still required for selective distros?

Going by the code comment:

This needs to be updated alongwith corresponding changes to netci.groovy.

can't coreclr/netci.groovy handle this logic or is it meant for everyone?

ghost avatar Mar 02 '16 23:03 ghost

I'm not familiar with the comment, I'm not sure why this would require changes to netci.

@gkhanna79 Any ideas on what you meant?

mmitche avatar Mar 02 '16 23:03 mmitche

The comment and check are required since we dont support (or have tested) MSBuild (required for building mscorlib, restoring and building packages) on various distros.

gkhanna79 avatar Mar 02 '16 23:03 gkhanna79

@gkhanna79, thanks. Would it make sense to use blacklist strategy for the known platforms which aren't able to handle mscorlib building instead of whitelisting? For example, whenever someone will complain 'I can't build on <Unix-name> version X', we'll add that to the blacklist and ask them to try cross-compiling mscorlib for their distro on some other platform such as Windows, Ubuntu etc.

ghost avatar Mar 02 '16 23:03 ghost

use blacklist strategy for the known platforms which aren't able to handle mscorlib building instead of whitelisting

The number of such platforms are all the distros and Linux variations that we have not tried, which is essentially a large number. I would rather have folks do the opposite - try to update the check for the OS variation they wish to try and commence a build. If all goes good, MSbuild will work and mscorlib.dll and mscorlib.ni.dll will be generated. This will allow us to conservatively move ahead and at some point, we will reverse (or even remove) the check (it may still remain for nuget package generation since it ties do RID definitions applicable for OS/Distro).

gkhanna79 avatar Mar 03 '16 01:03 gkhanna79

As we all know, additional CPU architectures will be continually added in the near future. For example, X86 32bit, ARM 32bit, ARM 64bit, MIPS 32bit, MIPS 64bit, and so on. So, I think that "white list" is better between the whitelist and the blacklist more than above patch style. Any opinion before submitting the patch to resolve this issue?

leemgs avatar Mar 03 '16 07:03 leemgs

@leemgs, given the reply from @gkhanna79, instead of removing x64 check, I think the other solution you provided would make sense, i.e., to add arm[64] elif against if [ "$__BuildArch" == "x64" ] with nested condition for Ubuntu, then we may get support for FreeBSD-on-ARM and other kinds of Unices which run on ARM in future, which result in adding more conditions under this architecture. Perhaps at some point this whole block will be cleaned up at once, when we get significant number of Unices on varied architectures validating the mscorlib builds natively.

ghost avatar Mar 03 '16 08:03 ghost

@jasonwilliams200OK, Thanks. Acked-by: Geunsik Lim. :+1:

leemgs avatar Mar 03 '16 14:03 leemgs

is it possible to precompile apps for arm using crossgen on Ubuntu X86-64?

papaslavik avatar Mar 04 '16 09:03 papaslavik

@papaslavik Certainly not yet, though progress is being made with ARM. I'm not sure if crossgen can generate cross-architecture though?

benpye avatar Mar 04 '16 14:03 benpye

At least when you build coreclr with ./build.sh arm it generates a crossgen binary in Linux.arm.Debug which could be run on the x64 machine, but the code generator there is also for x64...

papaslavik avatar Mar 04 '16 14:03 papaslavik

@papaslavik Certainly not yet,

Right. And, I think that the existing crossgen cannot generate cross-architecture.

At least when you build coreclr with ./build.sh arm it generates a crossgen binary in Linux.arm.Debug which could be run on the x64 machine

@papaslavik , if you run "./build.sh arm" without "./build.sh arm cross", it means that you can get x64 machine binary from crossgen in Linux.arm.Debug folder because you don't add "cross" option. As a result of that, as you mentioned, a crossgen binary in Linux.arm.Debug which could be run on the x64 machine, will be generated.

leemgs avatar Mar 04 '16 15:03 leemgs

I see, thanks!

papaslavik avatar Mar 04 '16 16:03 papaslavik

I'm not sure if crossgen can generate cross-architecture though?

@rahku is working on building a generic infrastructure to support building cross-architecture components as part of the build.

gkhanna79 avatar Mar 04 '16 22:03 gkhanna79