镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

x86/Linux progress #7335

Closed
Closed

Description

@parjong

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.

Activity

  1. parjong commented on Feb 2, 2017

    @parjong
    ContributorAuthor
  2. parjong commented on Feb 3, 2017

    @parjong
    ContributorAuthor

    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.

  3. parjong commented on Feb 10, 2017

    @parjong
    ContributorAuthor

    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.

  4. janvorli commented on Feb 17, 2017

    @janvorli
    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.

  5. parjong commented on Feb 17, 2017

    @parjong
    ContributorAuthor

    @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?

  6. parjong commented on Feb 17, 2017

    @parjong
    ContributorAuthor

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

  7. janvorli commented on Feb 17, 2017

    @janvorli
    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
    
    
  8. parjong commented on Feb 17, 2017

    @parjong
    ContributorAuthor

    I'll first check whether master works for me.

  9. parjong commented on Feb 17, 2017

    @parjong
    ContributorAuthor

    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
    
  10. parjong commented on Feb 17, 2017

    @parjong
    ContributorAuthor

    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
  11. janvorli commented on Feb 17, 2017

    @janvorli
    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.

  12. parjong commented on Feb 17, 2017

    @parjong
    ContributorAuthor

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

  13. janvorli commented on Feb 17, 2017

    @janvorli
    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.

  14. parjong commented on Feb 17, 2017

    @parjong
    ContributorAuthor

    @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.

  15. parjong commented on Feb 20, 2017

    @parjong
    ContributorAuthor

    Here is the result (XML) from b957f8c:

    =======================
         Test Results
    =======================
    # CoreCLR Bin Dir  : 
    # Tests Discovered : 7027
    # Passed           : 5913
    # Failed           : 833
    # Skipped          : 281
    =======================
    
  16. 87 remaining items

  17. ikkentim commented on Mar 21, 2022

    @ikkentim

    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?

  18. weltkante commented on Mar 21, 2022

    @weltkante
    Contributor

    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.

  19. gbalykov commented on Mar 22, 2022

    @gbalykov
    Member

    .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.

  20. ikkentim commented on Mar 23, 2022

    @ikkentim

    @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
    
  21. gbalykov commented on Mar 24, 2022

    @gbalykov
    Member

    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
  22. ikkentim commented on Mar 24, 2022

    @ikkentim

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

  23. ta264 commented on Apr 14, 2022

    @ta264
    Contributor

    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

  24. Adinihal commented on Jan 31, 2024

    @Adinihal

    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

  25. weltkante commented on Jan 31, 2024

    @weltkante
    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.)

  26. josephmoresena commented on Aug 20, 2024

    @josephmoresena
    Contributor

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

  27. nsobiratel commented on Aug 28, 2025

    @nsobiratel

    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

    Hi. Can u help? i try use release build, but cannot install nupkg with error "NETSDK1082 There was no runtime pack for Microsoft.NETCore.App available for the specified RuntimeIdentifier 'linux-x86'. VS 2022. Or required only linux host with installed sdk from release? Can u write all requirements (or steps) to use it?

    package manager output contain lines:

    NU1213: The package Microsoft.NETCore.App.Runtime.linux-x86 6.0.35 has a package type DotnetPlatform that is incompatible with this project. 
    Package 'Microsoft.NETCore.App.Runtime.linux-x86 6.0.35' has a package type 'DotnetPlatform' that is not supported by project.
    
  28. added a commit that references this issue on Nov 6, 2026
    ecfb721
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-x86area-Metadesign-discussionOngoing discussion about design without consensusneeds-further-triageIssue has been initially triaged, but needs deeper consideration or reconsiderationos-linuxLinux OS (any supported distro)os-tizen

    Type

    No type

    Projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions