Skip to content
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

x86/Linux progress #7335

Open
parjong opened this issue Feb 2, 2017 · 104 comments
Open

x86/Linux progress #7335

parjong opened this issue Feb 2, 2017 · 104 comments
Labels
arch-x86 area-Meta design-discussion Ongoing discussion about design without consensus needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration os-linux Linux OS (any supported distro) os-tizen
Milestone

Comments

@parjong
Copy link
Contributor

parjong commented Feb 2, 2017

This issue for tracking x86/Linux progress with respect to the regression tests.

Here is the current status on Ubuntu 14.04 Docker Container (on Ubuntu 16.04 x64) and full result:

=======================
     Test Results
=======================
# CoreCLR Bin Dir  : 
# Tests Discovered : 7027
# Passed           : 5592
# Failed           : 1156
# Skipped          : 279
=======================

The above result comes from 63607d8 with https://github.com/parjong/coreclr/tree/fix/x86_4byte_alignment and dotnet/coreclr#9261.

@parjong
Copy link
Contributor Author

parjong commented Feb 2, 2017

\CC @seanshpark @wateret

@parjong
Copy link
Contributor Author

parjong commented Feb 3, 2017

63607d8 (with alignment workaround) shows the following result:

=======================
     Test Results
=======================
# CoreCLR Bin Dir  :
# Tests Discovered : 7027
# Passed           : 5892
# Failed           : 856
# Skipped          : 279
=======================
53 minutes and 59 seconds taken to run CoreCLR tests.

dotnet/coreclr#9121 seems to resolve GC and JIT related failures.

@parjong
Copy link
Contributor Author

parjong commented Feb 10, 2017

Here is the result from 2ecadf5 (without any additional patch):

=======================
     Test Results
=======================
# CoreCLR Bin Dir  :
# Tests Discovered : 7027
# Passed           : 5874
# Failed           : 874
# Skipped          : 279
=======================
65 minutes and 29 seconds taken to run CoreCLR tests.

Recently merged dotnet/coreclr#8849 eliminates the need for alignment workaround. There is a small increase in the number of failed tests, and most of them are caused by stack smashing. Incorrect funclet prolog/epilog may cause this stack smashing issue.

@janvorli
Copy link
Member

@parjong, @seanshpark, @wateret - I was trying to build and run dotnet for x86 Linux today, using the current state of the master branch, but I was unable to make it work. So I was wondering if you could share a list of steps to successfuly build and gather all parts of the dotnet core the way you do it.
I have tried to build the coreclr and corefx native binaries both using the cross build and a build inside of a docker container with x86 ubuntu 14.04 (running the container on x64 Ubuntu 14.04). I have built the corefx managed assemblies on my x64 ubuntu.
When I try to run a simple hello world like app inside of the docker container, I get a strange assertion in the native runtime even before the coreclr_initialize completes.

@parjong
Copy link
Contributor Author

parjong commented Feb 17, 2017

@janvorli It is a bit strange. I have used the same environment (docker container from docker image imported from x86/rootfs in Core CLR). Could you let me know the assert failure that you got?

@parjong
Copy link
Contributor Author

parjong commented Feb 17, 2017

And, I am currently using a bit old Core FX (although I am not sure whether it is relevant).

@janvorli
Copy link
Member

The assert and call stack is below. I guess it has to do something with how I've collected all the files. I have created the docker image myself from vanilla Ubuntu 14.04 x86 image and installed all the dependencies, clang, etc.
Could you please write down a step by step list of how to get a working environment from scratch?

Assert failure(PID 59096 [0x0000e6d8], Thread: 59096 [0xe6d8]): Consistency check failed: Illegal null pointerFAILED: ok
         FAILED: CheckPointer(pMT)
                /home/janvorli/git/coreclr/src/vm/appdomain.cpp, line: 13816
    File: /home/janvorli/git/coreclr/src/inc/check.h Line: 373
    Image: /home/janvorli/dotnet/test/corerun

#0  DBG_DebugBreak () at debugbreak.S:114
dotnet/coreclr#1  0xf7899a88 in DebugBreak () at /home/janvorli/git/coreclr/src/pal/src/debug/debug.cpp:404
dotnet/coreclr#2  0xf6ce977c in CHECK::Setup (this=0xffffbfa4, message=0xf79daf30 "Illegal null pointer", condition=0xf7a6ba26 "ok",
    file=0xf79daf45 "/home/janvorli/git/coreclr/src/inc/check.h", line=373) at /home/janvorli/git/coreclr/src/utilcode/check.cpp:218
dotnet/coreclr#3  0xf6e3e308 in CheckPointer<MethodTable> (o=0x0, ok=NULL_NOT_OK) at /home/janvorli/git/coreclr/src/inc/check.h:373
dotnet/coreclr#4  0xf7226147 in BaseDomain::LookupType (this=0xf7c9f940 <g_pSharedDomainMemory>, id=60) at /home/janvorli/git/coreclr/src/vm/appdomain.cpp:13816
dotnet/coreclr#5  0xf72260f3 in BaseDomain::LookupType (this=0x8077208, id=60) at /home/janvorli/git/coreclr/src/vm/appdomain.cpp:13813
dotnet/coreclr#6  0xf6f4d993 in VSD_ResolveWorker (pTransitionBlock=0xffffc324, siteAddrForRegisterIndirect=354570792, token=3979264)
    at /home/janvorli/git/coreclr/src/vm/virtualcallstub.cpp:1579
dotnet/coreclr#7  0xf71f349a in ResolveWorkerAsmStub () at asmhelpers.S:1041
dotnet/coreclr#8  0xffffc324 in ?? ()
dotnet/coreclr#9  0xf4fd0222 in ?? ()
dotnet/coreclr#10 0xf633b14c in ?? ()
dotnet/coreclr#11 0xf71f31ab in CallDescrWorkerInternal () at asmhelpers.S:442
dotnet/coreclr#12 0xf6f85d08 in CallDescrWorker (pCallDescrData=0xffffcba8) at /home/janvorli/git/coreclr/src/vm/callhelpers.cpp:146
dotnet/coreclr#13 0xf6f85ab9 in CallDescrWorkerWithHandler (pCallDescrData=0xffffcba8, fCriticalCall=0) at /home/janvorli/git/coreclr/src/vm/callhelpers.cpp:89
dotnet/coreclr#14 0xf6f87a2b in MethodDescCallSite::CallTargetWorker (this=0xffffcdd8, pArguments=0xffffcf00, pReturnValue=0xffffcc18, cbReturnValue=8)
    at /home/janvorli/git/coreclr/src/vm/callhelpers.cpp:656
dotnet/coreclr#15 0xf6d56064 in MethodDescCallSite::Call_RetOBJECTREF (this=0xffffcdd8, pArguments=0xffffcf00) at /home/janvorli/git/coreclr/src/vm/callhelpers.h:436
dotnet/coreclr#16 0xf7205fd4 in AppDomain::DoSetup (this=0x8077208, setupInfo=0xffffd2f8) at /home/janvorli/git/coreclr/src/vm/appdomain.cpp:5735
dotnet/coreclr#17 0xf6d4a3cc in CorHost2::_CreateAppDomain (this=0x805e8d8, wszFriendlyName=0x805e910 u"unixcorerun", dwFlags=336, wszAppDomainManagerAssemblyName=0x0,
    wszAppDomainManagerTypeName=0x0, nProperties=5, pPropertyNames=0x805e938, pPropertyValues=0x805e958, pAppDomainID=0xffffd650)
    at /home/janvorli/git/coreclr/src/vm/corhost.cpp:1717
dotnet/coreclr#18 0xf6d4d9ac in CorHost2::CreateAppDomainWithManager (this=0x805e8d8, wszFriendlyName=0x805e910 u"unixcorerun", dwFlags=336,
    wszAppDomainManagerAssemblyName=0x0, wszAppDomainManagerTypeName=0x0, nProperties=5, pPropertyNames=0x805e938, pPropertyValues=0x805e958,
    pAppDomainID=0xffffd650) at /home/janvorli/git/coreclr/src/vm/corhost.cpp:1890
dotnet/coreclr#19 0xf6cd1623 in coreclr_initialize (exePath=0x8052014 "/home/janvorli/dotnet/test/corerun", appDomainFriendlyName=0x804e529 "unixcorerun", propertyCount=5,
    propertyKeys=0xffffd694, propertyValues=0xffffd680, hostHandle=0xffffd654, domainId=0xffffd650)
    at /home/janvorli/git/coreclr/src/dlls/mscoree/unixinterface.cpp:219
dotnet/coreclr#20 0x0804c51f in ExecuteManagedAssembly (currentExeAbsolutePath=0x8052014 "/home/janvorli/dotnet/test/corerun",
    clrFilesAbsolutePath=0x8052084 "/home/janvorli/dotnet/test", managedAssemblyAbsolutePath=0x805204c "/home/janvorli/dotnet/test/nullref.exe",
    managedAssemblyArgc=0, managedAssemblyArgv=0x0) at /home/janvorli/git/coreclr/src/coreclr/hosts/unixcoreruncommon/coreruncommon.cpp:404
dotnet/coreclr#21 0x0804b228 in corerun (argc=2, argv=0xffffd864) at /home/janvorli/git/coreclr/src/coreclr/hosts/unixcorerun/corerun.cpp:149
dotnet/coreclr#22 0x0804b35a in main (argc=2, argv=0xffffd864) at /home/janvorli/git/coreclr/src/coreclr/hosts/unixcorerun/corerun.cpp:161

@parjong
Copy link
Contributor Author

parjong commented Feb 17, 2017

I'll first check whether master works for me.

@parjong
Copy link
Contributor Author

parjong commented Feb 17, 2017

To collect Core FX managed dll(s), I used a bit old collecting script of the following form (OS is Linux):

MANAGED_TAGS=()
MANAGED_TAGS+=("AnyOS.AnyCPU")
MANAGED_TAGS+=("Unix.AnyCPU")
MANAGED_TAGS+=("${OS}.AnyCPU")

    for MANAGED_TAG in ${MANAGED_TAGS[@]}; do
      REPO="${SRC_DIR}/${MANAGED_TAG}.${PRESET}"

      for BASE in $(find "${REPO}"  -iname '*.dll' \! -iwholename '*test*' \! -iwholename '*/ToolRuntime/*' \! -iwholename '*/RemoteExecutorConsoleApp/*' \! -iwholename '*/net*' \! -iwholename '*aot*' -exec dirname {} \; | uniq | xargs -i basename {}); do
        PDB_FILE="${REPO}/${BASE}/${BASE}.pdb"
        DLL_FILE="${REPO}/${BASE}/${BASE}.dll"

        if [[ -f "${DLL_FILE}" ]]; then
          cp -t "${MANAGED_BIN_FILE_INTO}" "${DLL_FILE}"
        fi
      done
    done

@parjong
Copy link
Contributor Author

parjong commented Feb 17, 2017

Here is the brief steps that I am currently using:

  • Cross-build Core CLR with the following command and copy the artifacts into output directory:
coreclr $ ./build.sh cross x86  skipnuget debug cmakeargs "-DSKIP_LLDBPLUGIN=true" clang3.8
...
$ cp bin/Product/Linux.x86.Debug/* [OUTPUT DIR]
  • Collect Core FX native so(s)
corefx $  cp bin/Linux.x86.Debug/* [OUTPUT DIR]
  • Collect Core FX managed dll(s) using the above script

@janvorli
Copy link
Member

@parjong thank you. These match the steps I have done. I guess I'll try to create the docker image from the rootfs as you've said you did to see if it makes any difference.

@parjong
Copy link
Contributor Author

parjong commented Feb 17, 2017

@janvorli Please let me know if there is any problem. I checked the current tip (7f3a87a) and it works for me.

@janvorli
Copy link
Member

@parjong it is weird. I have just deleted the whole bin folder in coreclr, rebuilt the sources one more time and now it works. I am sorry for wasting your time.
Btw, I have not specified the "-DSKIP_LLDBPLUGIN=true" and the libsosplugin.so was also built fine.

@parjong
Copy link
Contributor Author

parjong commented Feb 17, 2017

@janvorli Thanks you for check 👍

FYI, -DSKIP_LLDBPLUGIN=true was just a workaround during bring up, but remains unchanged as lldb-plugin is not used currently.

@parjong
Copy link
Contributor Author

parjong commented Feb 20, 2017

Here is the result (XML) from b957f8c:

=======================
     Test Results
=======================
# CoreCLR Bin Dir  : 
# Tests Discovered : 7027
# Passed           : 5913
# Failed           : 833
# Skipped          : 281
=======================

@parjong
Copy link
Contributor Author

parjong commented Feb 20, 2017

dotnet/coreclr#9601 (although it is under review) seems to make huge progress.

Here is the result XML from b957f8c with dotnet/coreclr#9601:

=======================
     Test Results
=======================
# CoreCLR Bin Dir  :
# Tests Discovered : 7027
# Passed           : 6526
# Failed           : 220
# Skipped          : 281
=======================

@parjong
Copy link
Contributor Author

parjong commented Feb 27, 2017

Here is the result from 6092f90 (log and XML):

=======================
     Test Results
=======================
# CoreCLR Bin Dir  :
# Tests Discovered : 7027
# Passed           : 6614
# Failed           : 131
# Skipped          : 282
=======================

dotnet/coreclr#9601 seems to make huge progress (more than expected)!!!

@parjong
Copy link
Contributor Author

parjong commented Mar 1, 2017

dc3626d finally achieves < 100 failures:

=======================
     Test Results
=======================
# CoreCLR Bin Dir  :
# Tests Discovered : 7027
# Passed           : 6657
# Failed           : 88
# Skipped          : 282
=======================

Here are log and XML.

@janvorli
Copy link
Member

janvorli commented Mar 1, 2017

@parjong great! Thank you for the update.
CC: @gkhanna79

@parjong
Copy link
Contributor Author

parjong commented Mar 9, 2017

Here is the recent result (XML) from cf7d6d9:

=======================
     Test Results
=======================
# CoreCLR Bin Dir  :
# Tests Discovered : 7027
# Passed           : 6707
# Failed           : 51
# Skipped          : 269
=======================

@BruceForstall
Copy link
Member

@parjong How's it look now?

Should we create a Linux/x86 GitHub project (https://github.com/dotnet/coreclr/projects)? It's a relatively new GitHub feature -- not sure how useful it really is.

@parjong
Copy link
Contributor Author

parjong commented Mar 29, 2017

Here is the result from 2401b6e (full log):

=======================
     Test Results
=======================
# CoreCLR Bin Dir  : 
# Tests Discovered : 7061
# Passed           : 6319
# Failed           : 18
# Skipped          : 724
=======================

dotnet/coreclr#10538 resolves this failure, but is not merged in 2401b6e :

  • Loader/classloader/generics/Instantiation/Recursion/genrecur/genrecur.sh

dotnet/coreclr#10188 addresses the following two failures :

  • JIT/Methodical/eh/nested/nonlocalexit/throwinfinallyrecursive_20_d/throwinfinallyrecursive_20_d.sh
  • JIT/Methodical/eh/nested/nonlocalexit/throwinfinallyrecursive_20_r/throwinfinallyrecursive_20_r.sh

dotnet/coreclr#10410 seems to address the following two failures:

  • JIT/Performance/CodeQuality/Serialization/Deserialize/Deserialize.sh
  • JIT/Performance/CodeQuality/Serialization/Serialize/Serialize.sh

The following failures seems to be related with incorrect stack unwinding on esp-frame dotnet/coreclr#10025, or helper-frame dotnet/coreclr#9272). I hope that dotnet/coreclr#10012 addresses these failures:

  • JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_r8_i/conv_ovf_r8_i.sh
  • JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_r8_i4/conv_ovf_r8_i4.sh
  • JIT/Methodical/Arrays/misc/_il_relinitializearray/_il_relinitializearray.sh
  • JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b52578/b52578/b52578.sh
  • JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b52840/b52840/b52840.sh
  • JIT/Regression/CLR-x86-JIT/V1.1-M1-Beta1/b143840/b143840/b143840.sh
  • JIT/Regression/VS-ia64-JIT/V1.2-M01/b12390/b12390/b12390.sh
  • JIT/jit64/rtchecks/overflow/overflow01_div/overflow01_div.sh
  • JIT/jit64/rtchecks/overflow/overflow02_div/overflow02_div.sh
  • JIT/jit64/rtchecks/overflow/overflow04_div/overflow04_div.sh

dotnet/coreclr#10139 is related with these two failures:

  • readytorun/mainv1/mainv1.sh
  • readytorun/mainv2/mainv2.sh

The following failure seems to be related with some GC issue, but not sure yet:

  • JIT/Performance/CodeQuality/Span/SpanBench/SpanBench.sh

@parjong
Copy link
Contributor Author

parjong commented Mar 29, 2017

Here is the result from 1c2ee08:

=======================
     Test Results
=======================
# CoreCLR Bin Dir  :
# Tests Discovered : 7061
# Passed           : 6320
# Failed           : 17
# Skipped          : 724
=======================

As expected, Loader.classloader.generics.Instantiation.Recursion.genrecur.genrecur failure is gone:

Failed test:
  JIT.IL_Conformance.Old.Conformance_Base.conv_ovf_r8_i.conv_ovf_r8_i
  JIT.IL_Conformance.Old.Conformance_Base.conv_ovf_r8_i4.conv_ovf_r8_i4
  JIT.Methodical.Arrays.misc._il_relinitializearray._il_relinitializearray
  JIT.Methodical.eh.nested.nonlocalexit.throwinfinallyrecursive_20_d.throwinfinallyrecursive_20_d
  JIT.Methodical.eh.nested.nonlocalexit.throwinfinallyrecursive_20_r.throwinfinallyrecursive_20_r
  JIT.Performance.CodeQuality.Serialization.Deserialize.Deserialize
  JIT.Performance.CodeQuality.Serialization.Serialize.Serialize
  JIT.Performance.CodeQuality.Span.SpanBench.SpanBench
  JIT.Regression.CLR-x86-JIT.V1-M12-Beta2.b52578.b52578.b52578
  JIT.Regression.CLR-x86-JIT.V1-M12-Beta2.b52840.b52840.b52840
  JIT.Regression.CLR-x86-JIT.V1.1-M1-Beta1.b143840.b143840.b143840
  JIT.Regression.VS-ia64-JIT.V1.2-M01.b12390.b12390.b12390
  JIT.jit64.rtchecks.overflow.overflow01_div.overflow01_div
  JIT.jit64.rtchecks.overflow.overflow02_div.overflow02_div
  JIT.jit64.rtchecks.overflow.overflow04_div.overflow04_div
  readytorun.mainv1.mainv1
  readytorun.mainv2.mainv2

@parjong
Copy link
Contributor Author

parjong commented Apr 13, 2017

fa7293a finally resolves most of unittest failures except 2 readytorun tests:

=======================
     Test Results
=======================
# CoreCLR Bin Dir  :
# Tests Discovered : 7068
# Passed           : 6343
# Failed           : 2
# Skipped          : 723
=======================

Several tests are excluded from the above result.

4 tests based on Windows-specific struct layout rule (#10340)

  • Interop/MarshalAPI/OffsetOf/OffsetOf/OffsetOf.sh
  • JIT/Directed/RVAInit/nested/nested.sh
  • JIT/Directed/RVAInit/simple/simple.sh
  • JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b103058/b103058/b103058.sh

4 tests related with tailcall optimization:

  • JIT/Directed/tailcall/tailcall/tailcall.sh
  • JIT/Methodical/tailcall_v4/hijacking/hijacking.sh
  • JIT/Methodical/tailcall_v4/smallFrame/smallFrame.sh
  • JIT/Regression/JitBlue/devdiv_902271/DevDiv_902271/DevDiv_902271.sh

1 test that takes too much time (about 4 hour?):

  • JIT/Performance/CodeQuality/Burgers/Burgers/Burgers.sh

4 tests incompatible with remote testing:

  • JIT/CheckProjects/CheckProjects/CheckProjects.sh
  • JIT/Performance/CodeQuality/BenchmarksGame/k-nucleotide/k-nucleotide/k-nucleotide.sh
  • JIT/Performance/CodeQuality/BenchmarksGame/regexdna/regexdna/regexdna.sh
  • JIT/Performance/CodeQuality/BenchmarksGame/revcomp/revcomp/revcomp.sh

1 test that was disabled due to hang before (now it works, but I forgot to enable it)

  • JIT/Performance/CodeQuality/Roslyn/CscBench/CscBench.sh

@parjong
Copy link
Contributor Author

parjong commented Apr 20, 2017

bece89e finally shows 0 failed count (although some tests are excluded)

=======================
     Test Results
=======================
# CoreCLR Bin Dir  :
# Tests Discovered : 7068
# Passed           : 6345
# Failed           : 0
# Skipped          : 723
=======================

@janvorli
Copy link
Member

@parjong congratulations for the great progress! Maybe it is time to start running the Pri 1 tests too (that would add about 3000 more tests).

@parjong
Copy link
Contributor Author

parjong commented Apr 21, 2017

@janvorli We already did. Here is the result from a762db4 (full log):

=======================
     Test Results
=======================
# Tests Discovered : 11346
# Passed           : 10528
# Failed           : 7
# Skipped          : 811
=======================

Here is the list of failed tests:

  • CoreMangLib.cti.system.runtime.interopservices.marshal.MarshalSizeOf1_PSC.MarshalSizeOf1_PSC
  • CoreMangLib.cti.system.runtime.interopservices.marshal.MarshalSizeOf2_PSC.MarshalSizeOf2_PSC
  • CoreMangLib.cti.system.intptr.IntPtrToInt64.IntPtrToInt64
  • CoreMangLib.cti.system.string.StringChars.StringChars
  • CoreMangLib.cti.system.uintptr.UIntPtrCtor_UInt64.UIntPtrCtor_UInt64
  • CoreMangLib.cti.system.uintptr.UIntPtrToUInt32.UIntPtrToUInt32
  • GC.Stress.Framework.ReliabilityFramework.ReliabilityFramework

dotnet/coreclr#10340 seems to cause the following failures:

  • CoreMangLib.cti.system.runtime.interopservices.marshal.MarshalSizeOf1_PSC.MarshalSizeOf1_PSC
  • CoreMangLib.cti.system.runtime.interopservices.marshal.MarshalSizeOf2_PSC.MarshalSizeOf2_PSC

dotnet/coreclr#10888 is expected to resolve the following failures:

  • CoreMangLib.cti.system.intptr.IntPtrToInt64.IntPtrToInt64
  • CoreMangLib.cti.system.string.StringChars.StringChars
  • CoreMangLib.cti.system.uintptr.UIntPtrCtor_UInt64.UIntPtrCtor_UInt64
  • CoreMangLib.cti.system.uintptr.UIntPtrToUInt32.UIntPtrToUInt32

GC.Stress.Framework.ReliabilityFramework.ReliabilityFramework is a bit new failure that we need to analyze

@janvorli
Copy link
Member

@parjong Awesome, thank you!
CC: @gkhanna79, @Petermarcu

@swgillespie
Copy link
Contributor

swgillespie commented Apr 21, 2017

@parjong The reliability framework is a test that was just re-enabled recently - feel free to ping me sometime with the failure message and I'd be happy to help investigate it if I can. dotnet/coreclr#11029

@parjong
Copy link
Contributor Author

parjong commented Apr 21, 2017

@swgillespie Thanks you for comment. GC.Stress.Framework.ReliabilityFramework.ReliabilityFramework failed from 04/20. Both x86 and armel have the same failure. I'm not sure about armhf as I do NOT have a result, yet.

@weltkante
Copy link
Contributor

weltkante commented Jul 4, 2021

just for the record, my earlier attempt of cross compiling via rootfs and --cross --arch x86 no longer works and now fails via

error NETSDK1084: There is no application host available for the specified RuntimeIdentifier 'linux-x86'.

so something regressed or needs additional work besides setting up rootfs

@ikkentim
Copy link

What is the current status of this?

I've tried to cross build release/6.0 and main for x86 but I couldn't get it to run a simple hello world.

Has anyone managed to build a usable .net 6/7 for linux-x86?

@weltkante
Copy link
Contributor

weltkante commented Mar 21, 2022

Has anyone managed to build a usable .net 6/7 for linux-x86?

I don't think it was .NET 6, the last working cross compile has been a long time ago, as reported earlier on this thread, and only the runtime not the full SDK. The above regression is still present as of a few months ago when I last tried.

@gbalykov
Copy link
Member

gbalykov commented Mar 22, 2022

.net6 (at least v6.0.0) and .net7 (main) runtime cross builds for linux x86 successfully right now. Build command for .net7:

sudo ./eng/common/cross/build-rootfs.sh x86 bionic
ROOTFS_DIR=`pwd`/.tools/rootfs/x86 ./build.sh --cross --clang9 --arch x86 --runtimeConfiguration Release --librariesConfiguration Release --subset clr.hosts+clr.runtime+clr.jit+clr.corelib+clr.iltools+libs.native+libs.sfx+libs.oob+libs.packages

To pack artifacts:

mkdir runtime_x86
cp artifacts/bin/coreclr/Linux.x86.Release/{corerun,ilasm,ildasm,*.so} runtime_x86
cp artifacts/bin/coreclr/Linux.x86.Release/IL/System.Private.CoreLib.dll runtime_x86
cp artifacts/bin/native/net7.0-Linux-Release-x86/*.so runtime_x86
cp artifacts/bin/microsoft.netcore.app.runtime.linux-x86/Release/runtimes/linux-x86/lib/net7.0/*.dll runtime_x86

I've not tested .net7, but .net6 runs simple helloworld successfully.

@ikkentim
Copy link

ikkentim commented Mar 23, 2022

@gbalykov I'm on branch release/6.0. Subsets clr.hosts libs.sfx libs.oob are not available here so I've built clr.runtime+clr.jit+clr.corelib+clr.iltools+libs.native+libs+libs.packages instead. But I'm getting segmentation faults when running a helloworld. Do you have any suggestions for how I can try to fix this?

sudo ./eng/common/cross/build-rootfs.sh x86 bionic
ROOTFS_DIR=`pwd`/.tools/rootfs/x86 ./build.sh --cross --clang9 --arch x86 --runtimeConfiguration Release --librariesConfiguration Release --subset clr.runtime+clr.jit+clr.corelib+clr.iltools+libs.native+libs+libs.packages
mkdir runtime_x86
cp artifacts/bin/coreclr/Linux.x86.Release/{corerun,ilasm,ildasm,*.so} runtime_x86
cp artifacts/bin/coreclr/Linux.x86.Release/IL/System.Private.CoreLib.dll runtime_x86
cp artifacts/bin/native/net6.0-Linux-Release-x86/*.so runtime_x86
cp artifacts/bin/microsoft.netcore.app.runtime.linux-x86/Release/runtimes/linux-x86/lib/net6.0/*.dll runtime_x86
cd runtime_x86 && gdb corerun
> run ../../helloworld/bin/release/net6.0/helloworld.dll

Thread 1 "corerun" received signal SIGSEGV, Segmentation fault.
0xf7a703f4 in JIT_WriteBarrierEAX_Loc () from /home/tim/runtime6/runtime_x86/libcoreclr.so

@gbalykov
Copy link
Member

gbalykov commented Mar 24, 2022

I've checked current main (7d1191e) and it segfaults on xubuntu 18.04 i386 on simple helloworld.

However, v6.0.0 tag works, but I forgot to mention that you'll also need next patches for .net6 to fix some linux x86 related issues:

Just for reference, to build runtime I use:

sudo ./eng/common/cross/build-rootfs.sh x86 bionic
ROOTFS_DIR=`pwd`/.tools/rootfs/x86 ./build.sh --cross --clang9 --arch x86 --runtimeConfiguration Release --librariesConfiguration Release --subset clr.runtime+clr.jit+clr.corelib+clr.iltools+libs.native+libs.ref+libs.src+libs.packages
mkdir runtime_x86
cp artifacts/bin/coreclr/Linux.x86.Release/{corerun,ilasm,ildasm,*.so} runtime_x86
cp artifacts/bin/coreclr/Linux.x86.Release/IL/System.Private.CoreLib.dll runtime_x86
cp artifacts/bin/native/net6.0-Linux-Release-x86/*.so runtime_x86
cp artifacts/bin/microsoft.netcore.app.runtime.linux-x86/Release/runtimes/linux-x86/lib/net6.0/*.dll runtime_x86

@ikkentim
Copy link

Thanks! With those patches tag v6.0.3 also works.

@ta264
Copy link
Contributor

ta264 commented Apr 14, 2022

With the above 3 patches, and this one also:
#68046

I can build a complete SDK for linux-x86 which seems to be functional.

The build pipeline, SDKs for .NET 6 and .NET 7 preview 3, and a Nuget feed with the AppHosts etc are here:
https://github.com/Servarr/dotnet-linux-x86

@Adinihal
Copy link

Hi @ta264,
actually I am completely new to linux , but I got a requirement for running a 32bit console app in linux as this we can run can you please tell me the steps for this how can I create a build of this Linux-x86 in my ubantu and run a simple .net 32 bit console application,

thanks

@weltkante
Copy link
Contributor

@Adinihal just to make sure you didn't miss the main point of the thread, 32bit Linux is (intentionally) not supported by Microsoft but put together by the community, so if your "requirement" implies having support when things break then its better to reject the 32bit requirement as "not supported by Microsoft" rather than putting yourself into a bad spot where you'll have to learn the hard way how to do things yourself. Making an unsupported runtime work on a new (for you) system is not exactly an easy project to get started with Linux. (Just a friendly advice if you didn't read the thread and weren't aware.)

@josephmoresena
Copy link
Contributor

Is there any progress on this? @ta264 Does NativeAOT work with this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-x86 area-Meta design-discussion Ongoing discussion about design without consensus needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration os-linux Linux OS (any supported distro) os-tizen
Projects
No open projects
Development

No branches or pull requests