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

Use arm jit for armel in crossgen2, and build the matching bits on all architectures #49734

Merged
merged 4 commits into from
Mar 19, 2021

Conversation

davidwrighton
Copy link
Member

Attempt to address use of crossgen2 on armel architectures. Fixes #49347

@davidwrighton
Copy link
Member Author

@clamp03 I can't actually test this, as I don't know the docker image for doing an armel crossbuild. Can you provide a docker image that I can use here?

@davidwrighton
Copy link
Member Author

The idea of the change is that the unix arm jit will be able to compile targetting soft_fp or normal hardware fp abi. And once we get rid of crossgen, we'll simply delete the armel jit we're currently building in favor of the configurable one.

@clamp03
Copy link
Member

clamp03 commented Mar 17, 2021

@davidwrighton Thank you for the update.

It fails to build armel with this patch in a restore stage.

/home/dheon/work/dotnet/jobs/net6/runtime/.dotnet/sdk/6.0.100-preview.2.21155.3/NuGet.RestoreEx.targets(19,5): error : An unexpected token "armel" was found at character position 26 in condition "'$(TargetArchitecture)=='armel'".  /home/d
heon/work/dotnet/jobs/net6/runtime/src/coreclr/tools/aot/crossgen2/crossgen2.csproj [/home/dheon/work/dotnet/jobs/net6/runtime/Build.proj

This is a Dockerfile that I put all instructions into. (without this patch).

FROM ubuntu:20.04

RUN apt-get update
RUN DEBIAN_FRONTEND="noninteractive" apt-get install -y build-essential git vim curl cmake make llvm-10 clang-10 lldb-10 liblldb-10-dev libunwind8 libunwind8-dev gettext libicu-dev liblttng-ust-dev libcurl4-openssl-dev libssl-dev libnuma-dev libkrb5-dev binutils-arm-linux-gnueabi zlib1g-dev libxml2-utils rpm2cpio cpio

WORKDIR /dotnet/
RUN git clone https://github.com/dotnet/runtime.git

WORKDIR /dotnet/runtime
RUN ROOTFS_DIR=/dotnet/rootfs/armel ./eng/common/cross/build-rootfs.sh armel tizen
RUN ROOTFS_DIR=/dotnet/rootfs/armel ./build.sh --portablebuild false --arch armel --os Linux --clang10 --restore --build --configuration Release --cross --subset clr+libs.native 
RUN ROOTFS_DIR=/dotnet/rootfs/armel ./build.sh --arch armel --os Linux --clang10 --restore --build --configuration Release --cross --subset libs.ref+libs.src+libs.pretest+libs.packages+libs.tests

Thank you.

@davidwrighton
Copy link
Member Author

@clamp03, this looks to be working now although I see errors like the following "bash : error : setlocale: LC_ALL: cannot change locale (en_US.UTF-8) [/dotnet/runtime/src/libraries/Native/build-native.proj]" as it builds, but the failure to run crossgen2 seems to be fixed.

@davidwrighton
Copy link
Member Author

Please let me know if the fix looks good in your scenario.

@davidwrighton
Copy link
Member Author

@dotnet/crossgen-contrib

@clamp03
Copy link
Member

clamp03 commented Mar 18, 2021

@davidwrighton Thank you. And could you check two things?

  • DEBUG BUILD FAIL: JIT_FLAG_SOFTFP_ABI is not defined.

    #elif defined(ARM_SOFTFP)
    // Armel is unconditionally enabled in the JIT. Verify that the VM side agrees.
    assert(jitFlags->IsSet(JitFlags::JIT_FLAG_SOFTFP_ABI));

  • CROSSGEN2 FAIL in HOST(x64): ARM_SOFTFP & CONFIGURABLE_ARM_ABI are not defined in clrjit_arm_x64

    else()
    if (CLR_CMAKE_TARGET_UNIX)
    create_standalone_jit(TARGET clrjit_unix_${ARCH_TARGET_NAME}_${ARCH_HOST_NAME} OS unix ARCH ${ARCH_TARGET_NAME})
    endif(CLR_CMAKE_TARGET_UNIX)

@davidwrighton
Copy link
Member Author

Ok, the debug builds are running through.

@@ -496,6 +496,9 @@ if (CLR_CMAKE_BUILD_SUBSET_ALLJITS AND NOT CLR_CROSS_COMPONENTS_BUILD)
else()
if (CLR_CMAKE_TARGET_UNIX)
create_standalone_jit(TARGET clrjit_unix_${ARCH_TARGET_NAME}_${ARCH_HOST_NAME} OS unix ARCH ${ARCH_TARGET_NAME})
if (ARCH_TARGET_NAME STREQUAL arm)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it better to use CLR_CMAKE_TARGET_ARCH_ARM?

if (CLR_CMAKE_TARGET_ARCH_ARM)

Copy link
Member

@clamp03 clamp03 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works well in my scenario.
Thank you so much.

@davidwrighton
Copy link
Member Author

@trylek could you review this? While @clamp03 has reviewed it, I need a reviewer with write access to also approve it.

@dotnet/crossgen-contrib

Copy link
Member

@trylek trylek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@davidwrighton davidwrighton merged commit 7a94064 into dotnet:main Mar 19, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Apr 18, 2021
@davidwrighton davidwrighton deleted the armel_build_fix branch April 20, 2021 17:47
@karelz karelz added this to the 6.0.0 milestone May 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

armel build fail
5 participants