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

Port Mono to Raspberry Pi, ship as new linux-armv6 RID #62594

Merged
merged 46 commits into from
Jan 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
8589f9e
Initial ARMv6 arch addition. Builds mono, not hosts or libs.native
directhex Nov 30, 2021
f8508a5
Fix libatomic linkage on ARMv6
directhex Nov 30, 2021
5545a71
Ignore that CP15 sucks
directhex Nov 30, 2021
c01ac90
Update runtime.json
directhex Dec 1, 2021
2a32b83
Deal with atomics linking issue
directhex Dec 1, 2021
eaae81e
Merge remote-tracking branch 'origin/main' into joshield/armv6
directhex Dec 1, 2021
7817d18
Start bringing up enough CoreCLR to build `ilasm`, like on s390x.
directhex Dec 1, 2021
39a8287
Fix non-thumb asm
directhex Dec 2, 2021
aec66e9
Revert "Ignore that CP15 sucks"
directhex Dec 6, 2021
aed2956
Deal with /usr/include and /crossrootfs/x/usr/include differing signi…
directhex Dec 6, 2021
6c9c51d
Use exact compiler flags for v6
directhex Dec 6, 2021
1653948
Fix ARM -> ARMv6 in RuntimeInformation
directhex Dec 8, 2021
cf3c2e3
Add ARMv6 build to runtime-staging
directhex Dec 8, 2021
e456e4a
Get tests building
directhex Dec 8, 2021
f4cb981
Set endianness
directhex Dec 8, 2021
31335fa
Force Hard Float ABI for ARMv6 (when do we use soft??!?!?!?)
directhex Dec 9, 2021
f661a0e
We don't support armel in dotnet - only Tizen does, and that's CoreCLR
directhex Dec 9, 2021
7ea9115
Merge remote-tracking branch 'origin/main' into joshield/armv6
directhex Dec 9, 2021
03f7fe4
Merge branch 'joshield/armv6' of github.com:directhex/runtime into jo…
directhex Dec 9, 2021
bfa235a
Tpyo
directhex Dec 9, 2021
e8c6ec3
Update src/libraries/System.Runtime.InteropServices.RuntimeInformatio…
directhex Dec 9, 2021
9d40250
Update src/libraries/System.Runtime.InteropServices.RuntimeInformatio…
directhex Dec 9, 2021
954d59c
Update src/native/libs/System.Native/pal_runtimeinformation.h
directhex Dec 9, 2021
d34a413
Merge remote-tracking branch 'origin/main' into joshield/armv6
directhex Dec 10, 2021
8f9b7d8
Don't hardcode the FPU, since Android uses softfp ABI
directhex Dec 14, 2021
725e1e9
Merge remote-tracking branch 'origin/main' into joshield/armv6
directhex Dec 15, 2021
ef756dc
Add a Helix queue on Pi?
directhex Dec 15, 2021
67f67d2
tpyo
directhex Dec 15, 2021
baf6cc8
For now, unconditionally set Helix queue
directhex Dec 15, 2021
a299408
Merge branch 'joshield/armv6' of github.com:directhex/runtime into jo…
directhex Dec 16, 2021
f6b4be4
UseLiveBuilt
directhex Dec 16, 2021
64ce768
Merge remote-tracking branch 'origin/main' into joshield/armv6
directhex Jan 3, 2022
80b7eaa
Merge branch 'joshield/armv6' of github.com:directhex/runtime into jo…
directhex Jan 3, 2022
696efc8
Fix build
directhex Jan 3, 2022
6739626
Merge remote-tracking branch 'origin/main' into joshield/armv6
directhex Jan 4, 2022
5f43ec0
Merge branch 'joshield/armv6' of github.com:directhex/runtime into jo…
directhex Jan 4, 2022
6ccd698
Merge remote-tracking branch 'origin/main' into joshield/armv6
directhex Jan 5, 2022
4fa9287
Merge remote-tracking branch 'origin/main' into joshield/armv6
directhex Jan 7, 2022
31c9691
Get SDK building for armv6
directhex Jan 7, 2022
a8329a3
Instead of a whole separate folder for near-identical files, use defines
directhex Jan 7, 2022
d3b4f43
Merge remote-tracking branch 'origin/main' into joshield/armv6
directhex Jan 7, 2022
c82ed6e
Build clr subset on ARMv6, it's needed for SDK and we want to check i…
directhex Jan 7, 2022
3aa30cc
Merge remote-tracking branch 'origin/main' into joshield/armv6
directhex Jan 10, 2022
c26c029
Cleanup from @am11
directhex Jan 10, 2022
9d5028c
Merge remote-tracking branch 'origin/main' into joshield/armv6
directhex Jan 24, 2022
7c4b261
Yes, it should be elseif
directhex Jan 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<_hostArch>$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant)</_hostArch>
<BuildArchitecture Condition="'$(BuildArchitecture)' == ''">$(_hostArch)</BuildArchitecture>
<TargetArchitecture Condition="'$(TargetArchitecture)' == '' and '$(_hostArch)' == 'arm'">arm</TargetArchitecture>
<TargetArchitecture Condition="'$(TargetArchitecture)' == '' and '$(_hostArch)' == 'armv6'">armv6</TargetArchitecture>
<TargetArchitecture Condition="'$(TargetArchitecture)' == '' and '$(_hostArch)' == 'armel'">armel</TargetArchitecture>
<TargetArchitecture Condition="'$(TargetArchitecture)' == '' and '$(_hostArch)' == 'arm64'">arm64</TargetArchitecture>
<TargetArchitecture Condition="'$(TargetArchitecture)' == '' and '$(_hostArch)' == 'loongarch64'">loongarch64</TargetArchitecture>
Expand Down
2 changes: 1 addition & 1 deletion eng/Subsets.props
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
flavor is used to decide when to build the hosts and installers. -->
<PropertyGroup>
<PrimaryRuntimeFlavor>CoreCLR</PrimaryRuntimeFlavor>
<PrimaryRuntimeFlavor Condition="'$(TargetArchitecture)' == 's390x'">Mono</PrimaryRuntimeFlavor>
<PrimaryRuntimeFlavor Condition="'$(TargetArchitecture)' == 's390x' or '$(TargetArchitecture)' == 'armv6'">Mono</PrimaryRuntimeFlavor>
</PropertyGroup>

<PropertyGroup>
Expand Down
6 changes: 3 additions & 3 deletions eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
usage()
{
echo "Common settings:"
echo " --arch (-a) Target platform: x86, x64, arm, armel, arm64, loongarch64, s390x or wasm."
echo " --arch (-a) Target platform: x86, x64, arm, armv6, armel, arm64, loongarch64, s390x or wasm."
echo " [Default: Your machine's architecture.]"
echo " --binaryLog (-bl) Output binary log."
echo " --cross Optional argument to signify cross compilation."
Expand Down Expand Up @@ -206,12 +206,12 @@ while [[ $# > 0 ]]; do
fi
passedArch="$(echo "$2" | tr "[:upper:]" "[:lower:]")"
case "$passedArch" in
x64|x86|arm|armel|arm64|loongarch64|s390x|wasm)
x64|x86|arm|armv6|armel|arm64|loongarch64|s390x|wasm)
arch=$passedArch
;;
*)
echo "Unsupported target architecture '$2'."
echo "The allowed values are x86, x64, arm, armel, arm64, loongarch64, s390x, and wasm."
echo "The allowed values are x86, x64, arm, armv6, armel, arm64, loongarch64, s390x, and wasm."
exit 1
;;
esac
Expand Down
6 changes: 5 additions & 1 deletion eng/native/build-commons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ usage()
echo ""
echo "Common Options:"
echo ""
echo "BuildArch can be: -arm, -armel, -arm64, -loongarch64, -s390x, x64, x86, -wasm"
echo "BuildArch can be: -arm, -armv6, -armel, -arm64, -loongarch64, -s390x, x64, x86, -wasm"
echo "BuildType can be: -debug, -checked, -release"
echo "-os: target OS (defaults to running OS)"
echo "-bindir: output directory (defaults to $__ProjectRoot/artifacts)"
Expand Down Expand Up @@ -270,6 +270,10 @@ while :; do
__BuildArch=arm
;;

armv6|-armv6)
__BuildArch=armv6
;;

arm64|-arm64)
__BuildArch=arm64
;;
Expand Down
19 changes: 19 additions & 0 deletions eng/native/configurecompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ elseif (CLR_CMAKE_HOST_ARCH_I386)
elseif (CLR_CMAKE_HOST_ARCH_ARM)
set(ARCH_HOST_NAME arm)
add_definitions(-DHOST_ARM)
elseif (CLR_CMAKE_HOST_ARCH_ARMV6)
set(ARCH_HOST_NAME armv6)
add_definitions(-DHOST_ARMV6)
elseif (CLR_CMAKE_HOST_ARCH_ARM64)
set(ARCH_HOST_NAME arm64)
add_definitions(-DHOST_ARM64 -DHOST_64BIT)
Expand All @@ -238,6 +241,8 @@ if (CLR_CMAKE_HOST_UNIX)
message("Detected Linux x86_64")
elseif(CLR_CMAKE_HOST_UNIX_ARM)
message("Detected Linux ARM")
elseif(CLR_CMAKE_HOST_UNIX_ARMV6)
message("Detected Linux ARMv6")
elseif(CLR_CMAKE_HOST_UNIX_ARM64)
message("Detected Linux ARM64")
elseif(CLR_CMAKE_HOST_UNIX_LOONGARCH64)
Expand Down Expand Up @@ -301,6 +306,12 @@ elseif (CLR_CMAKE_TARGET_ARCH_ARM)
set(ARCH_TARGET_NAME arm)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:IGNORE_DEFAULT_TARGET_ARCH>>>:TARGET_ARM>)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:IGNORE_DEFAULT_TARGET_ARCH>>>:TARGET_32BIT>)
elseif (CLR_CMAKE_TARGET_ARCH_ARMV6)
set(ARCH_SOURCES_DIR arm)
set(ARCH_TARGET_NAME armv6)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:IGNORE_DEFAULT_TARGET_ARCH>>>:TARGET_ARM>)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:IGNORE_DEFAULT_TARGET_ARCH>>>:TARGET_ARMV6>)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:IGNORE_DEFAULT_TARGET_ARCH>>>:TARGET_32BIT>)
elseif (CLR_CMAKE_TARGET_ARCH_I386)
set(ARCH_TARGET_NAME x86)
set(ARCH_SOURCES_DIR i386)
Expand Down Expand Up @@ -507,6 +518,14 @@ if(CLR_CMAKE_HOST_UNIX_ARM)
endif(ARM_SOFTFP)
endif(CLR_CMAKE_HOST_UNIX_ARM)

if(CLR_CMAKE_HOST_UNIX_ARMV6)
add_compile_options(-mfpu=vfp)
add_definitions(-DCLR_ARM_FPU_CAPABILITY=0x0)
add_compile_options(-march=armv6zk)
add_compile_options(-mcpu=arm1176jzf-s)
add_compile_options(-mfloat-abi=hard)
endif(CLR_CMAKE_HOST_UNIX_ARMV6)

if(CLR_CMAKE_HOST_UNIX_X86)
add_compile_options(-msse2)
endif()
Expand Down
13 changes: 13 additions & 0 deletions eng/native/configureplatform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ if(CLR_CMAKE_HOST_OS STREQUAL Linux)
set(CLR_CMAKE_HOST_UNIX_ARMV7L 1)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL arm OR CMAKE_SYSTEM_PROCESSOR STREQUAL armv7-a)
set(CLR_CMAKE_HOST_UNIX_ARM 1)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL armv6 OR CMAKE_SYSTEM_PROCESSOR STREQUAL armv6l)
set(CLR_CMAKE_HOST_UNIX_ARMV6 1)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL arm64)
set(CLR_CMAKE_HOST_UNIX_ARM64 1)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL loongarch64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL loongarch64)
Expand Down Expand Up @@ -217,6 +219,13 @@ if(CLR_CMAKE_HOST_UNIX_ARM)
if(CLR_CMAKE_HOST_UNIX_ARMV7L)
set(CLR_CMAKE_HOST_ARCH_ARMV7L 1)
endif()
elseif(CLR_CMAKE_HOST_UNIX_ARMV6)
set(CLR_CMAKE_HOST_ARCH_ARMV6 1)
set(CLR_CMAKE_HOST_ARCH "armv6")

if(CLR_CMAKE_HOST_UNIX_ARMV6L)
set(CLR_CMAKE_HOST_ARCH_ARMV6L 1)
endif()
elseif(CLR_CMAKE_HOST_UNIX_ARM64)
set(CLR_CMAKE_HOST_ARCH_ARM64 1)
set(CLR_CMAKE_HOST_ARCH "arm64")
Expand Down Expand Up @@ -277,6 +286,8 @@ if (CLR_CMAKE_TARGET_ARCH STREQUAL x64)
set(CLR_CMAKE_TARGET_ARCH_LOONGARCH64 1)
elseif(CLR_CMAKE_TARGET_ARCH STREQUAL arm)
set(CLR_CMAKE_TARGET_ARCH_ARM 1)
elseif(CLR_CMAKE_TARGET_ARCH STREQUAL armv6)
set(CLR_CMAKE_TARGET_ARCH_ARMV6 1)
elseif(CLR_CMAKE_TARGET_ARCH STREQUAL armel)
set(CLR_CMAKE_TARGET_ARCH_ARM 1)
set(CLR_CMAKE_TARGET_ARCH_ARMV7L 1)
Expand Down Expand Up @@ -379,6 +390,8 @@ if(CLR_CMAKE_TARGET_UNIX)
set(CLR_CMAKE_TARGET_UNIX_ARM 1)
elseif(CLR_CMAKE_TARGET_ARCH STREQUAL arm)
set(CLR_CMAKE_TARGET_UNIX_ARM 1)
elseif(CLR_CMAKE_TARGET_ARCH STREQUAL armv6)
set(CLR_CMAKE_TARGET_UNIX_ARMV6 1)
elseif(CLR_CMAKE_TARGET_ARCH STREQUAL arm64)
set(CLR_CMAKE_TARGET_UNIX_ARM64 1)
elseif(CLR_CMAKE_TARGET_ARCH STREQUAL loongarch64)
Expand Down
4 changes: 2 additions & 2 deletions eng/native/configuretools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ if(NOT WIN32 AND NOT CLR_CMAKE_TARGET_BROWSER)

if(CLR_CMAKE_TARGET_ANDROID)
set(TOOLSET_PREFIX ${ANDROID_TOOLCHAIN_PREFIX})
elseif(CMAKE_CROSSCOMPILING AND NOT DEFINED CLR_CROSS_COMPONENTS_BUILD AND (CMAKE_SYSTEM_PROCESSOR STREQUAL armv7l OR
CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL arm OR CMAKE_SYSTEM_PROCESSOR STREQUAL s390x))
elseif(CMAKE_CROSSCOMPILING AND NOT DEFINED CLR_CROSS_COMPONENTS_BUILD AND
CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv7l|armv6l|aarch64|arm|s390x)$")
set(TOOLSET_PREFIX "${TOOLCHAIN}-")
else()
set(TOOLSET_PREFIX "")
Expand Down
6 changes: 5 additions & 1 deletion eng/native/functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function(clr_unknown_arch)
elseif(CLR_CROSS_COMPONENTS_BUILD)
message(FATAL_ERROR "Only AMD64, I386 host are supported for linux cross-architecture component. Found: ${CMAKE_SYSTEM_PROCESSOR}")
else()
message(FATAL_ERROR "Only AMD64, ARM64, LOONGARCH64 and ARM are supported. Found: ${CMAKE_SYSTEM_PROCESSOR}")
message(FATAL_ERROR "Only AMD64, ARMV6, ARM64, LOONGARCH64 and ARM are supported. Found: ${CMAKE_SYSTEM_PROCESSOR}")
endif()
endfunction()

Expand Down Expand Up @@ -155,6 +155,10 @@ function(find_unwind_libs UnwindLibs)
find_library(UNWIND_ARCH NAMES unwind-arm)
endif()

if(CLR_CMAKE_HOST_ARCH_ARMV6)
find_library(UNWIND_ARCH NAMES unwind-arm)
endif()

if(CLR_CMAKE_HOST_ARCH_ARM64)
find_library(UNWIND_ARCH NAMES unwind-aarch64)
endif()
Expand Down
4 changes: 4 additions & 0 deletions eng/native/init-os-and-arch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ case "$CPUName" in
fi
;;

armv6l)
arch=armv6
;;

i[3-6]86)
echo "Unsupported CPU $CPUName detected, build might not succeed!"
arch=x86
Expand Down
6 changes: 3 additions & 3 deletions eng/native/tryrun.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ if(DARWIN)
else()
message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only arm64 or x64 is supported for OSX cross build!")
endif()
elseif(TARGET_ARCH_NAME MATCHES "^(armel|arm|arm64|loongarch64|s390x|x86)$" OR FREEBSD OR ILLUMOS)
elseif(TARGET_ARCH_NAME MATCHES "^(armel|arm|armv6|arm64|loongarch64|s390x|x86)$" OR FREEBSD OR ILLUMOS)
set_cache_value(FILE_OPS_CHECK_FERROR_OF_PREVIOUS_CALL_EXITCODE 1)
set_cache_value(GETPWUID_R_SETS_ERRNO_EXITCODE 0)
set_cache_value(HAS_POSIX_SEMAPHORES_EXITCODE 0)
Expand Down Expand Up @@ -146,9 +146,9 @@ elseif(TARGET_ARCH_NAME MATCHES "^(armel|arm|arm64|loongarch64|s390x|x86)$" OR F
set_cache_value(HAVE_FUNCTIONAL_PTHREAD_ROBUST_MUTEXES_EXITCODE 0)
endif()
else()
message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only armel, arm, arm64, loongarch64, s390x and x86 are supported!")
message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only armel, arm, armv6, arm64, loongarch64, s390x and x86 are supported!")
endif()

if(TARGET_ARCH_NAME STREQUAL "x86" OR TARGET_ARCH_NAME STREQUAL "s390x" OR TARGET_ARCH_NAME STREQUAL "loongarch64")
if(TARGET_ARCH_NAME STREQUAL "x86" OR TARGET_ARCH_NAME STREQUAL "s390x" OR TARGET_ARCH_NAME STREQUAL "armv6" OR TARGET_ARCH_NAME STREQUAL "loongarch64")
set_cache_value(HAVE_FUNCTIONAL_PTHREAD_ROBUST_MUTEXES_EXITCODE 0)
endif()
25 changes: 25 additions & 0 deletions eng/pipelines/common/platform-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,31 @@ jobs:
crossrootfsDir: '/crossrootfs/arm'
${{ insert }}: ${{ parameters.jobParameters }}

# Linux armv6
- ${{ if or(containsValue(parameters.platforms, 'Linux_armv6'), in(parameters.platformGroup, 'all', 'gcstress')) }}:
- template: xplat-setup.yml
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
variables: ${{ parameters.variables }}
osGroup: Linux
archType: armv6
targetRid: linux-armv6
platform: Linux_armv6
container:
image: ubuntu-20.04-cross-armv6-raspbian-10-20211208135931-e6e3ac4
registry: mcr
jobParameters:
runtimeFlavor: ${{ parameters.runtimeFlavor }}
stagedBuild: ${{ parameters.stagedBuild }}
buildConfig: ${{ parameters.buildConfig }}
${{ if eq(parameters.passPlatforms, true) }}:
platforms: ${{ parameters.platforms }}
helixQueueGroup: ${{ parameters.helixQueueGroup }}
crossBuild: true
crossrootfsDir: '/crossrootfs/armv6'
${{ insert }}: ${{ parameters.jobParameters }}

# Linux arm64

- ${{ if or(containsValue(parameters.platforms, 'Linux_arm64'), in(parameters.platformGroup, 'all', 'gcstress')) }}:
Expand Down
5 changes: 5 additions & 0 deletions eng/pipelines/libraries/helix-queues-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ jobs:
- (Debian.10.Arm32.Open)Ubuntu.1804.ArmArch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-10-helix-arm32v7-20210304164340-6616c63
- (Debian.11.Arm32.Open)Ubuntu.1804.ArmArch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-11-helix-arm32v7-20210304164347-5a7c380

# Linux armv6
- ${{ if eq(parameters.platform, 'Linux_armv6') }}:
# - ${{ if eq(parameters.jobParameters.isFullMatrix, true) }}:
- (Raspbian.10.Armv6.Open)Raspbian.9.Arm32.IoT.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:raspbian-10-helix-arm32v6-20211215185610-60748cc

# Linux arm64
- ${{ if eq(parameters.platform, 'Linux_arm64') }}:
- ${{ if or(eq(parameters.jobParameters.isExtraPlatforms, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}:
Expand Down
40 changes: 40 additions & 0 deletions eng/pipelines/runtime-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,46 @@ jobs:
eq(variables['monoContainsChange'], true),
eq(variables['isRollingBuild'], true))

#
# Build the whole product using Mono and run libraries tests
#
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
buildConfig: Release
runtimeFlavor: mono
platforms:
- Linux_armv6
variables:
# map dependencies variables to local variables
- name: librariesContainsChange
value: $[ dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ]
- name: monoContainsChange
value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ]
jobParameters:
testScope: innerloop
nameSuffix: AllSubsets_Mono
buildArgs: -s mono+clr+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true
Copy link
Member

Choose a reason for hiding this comment

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

clr

This is failing outerloop builds, e.g. https://dev.azure.com/dnceng/public/_build/results?buildId=1569496&view=logs&jobId=86b05f7f-a5b8-51f0-63db-a6d409e0da15&j=86b05f7f-a5b8-51f0-63db-a6d409e0da15&t=53a3521c-9616-50ba-cf1b-e3b67157a105

[ 39%] Building ASM object debug/ee/wks/CMakeFiles/cordbee_wks_obj.dir/__/arm/dbghelpers.S.o
<instantiation>:5:9: error: invalid instruction, any one of the following would fix this:
        tst r0, #7
        ^
/__w/1/s/src/coreclr/debug/ee/arm/dbghelpers.S:22:5: note: while in macro instantiation
    CHECK_STACK_ALIGNMENT
    ^
<instantiation>:5:9: note: instruction requires: thumb2
        tst r0, #7
        ^
/__w/1/s/src/coreclr/debug/ee/arm/dbghelpers.S:22:5: note: while in macro instantiation
    CHECK_STACK_ALIGNMENT
    ^
<instantiation>:5:17: note: operand must be a register in range [r0, r7]
        tst r0, #7
                ^
/__w/1/s/src/coreclr/debug/ee/arm/dbghelpers.S:22:5: note: while in macro instantiation
    CHECK_STACK_ALIGNMENT
    ^
<instantiation>:5:9: error: invalid instruction, any one of the following would fix this:
        tst r0, #7
        ^
/__w/1/s/src/coreclr/debug/ee/arm/dbghelpers.S:48:5: note: while in macro instantiation
    CHECK_STACK_ALIGNMENT
    ^
<instantiation>:5:9: note: instruction requires: thumb2
        tst r0, #7
        ^
/__w/1/s/src/coreclr/debug/ee/arm/dbghelpers.S:48:5: note: while in macro instantiation
    CHECK_STACK_ALIGNMENT
    ^
<instantiation>:5:17: note: operand must be a register in range [r0, r7]
        tst r0, #7
                ^
/__w/1/s/src/coreclr/debug/ee/arm/dbghelpers.S:48:5: note: while in macro instantiation
    CHECK_STACK_ALIGNMENT
    ^

Copy link
Member Author

Choose a reason for hiding this comment

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

Why?

In Subsets.props, <PrimaryRuntimeFlavor Condition="'$(TargetArchitecture)' == 's390x' or '$(TargetArchitecture)' == 'armv6'">Mono</PrimaryRuntimeFlavor> should be setting PrimaryRuntimeFlavor to Mono, then <DefaultCoreClrSubsets Condition="'$(PrimaryRuntimeFlavor)' != 'CoreCLR'">clr.iltools+clr.packages</DefaultCoreClrSubsets> should be setting it so the clr subset only builds the supported CoreCLR components

I may be failing to parse how coreclr/ci.yml works.

Copy link
Member

Choose a reason for hiding this comment

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

According to the message, this should be #0-#6:


Don't know what would be the implication of changing #7 to #6. cc @janvorli

Alternatively, we can skip armv6 here:

if defined(_DEBUG) && !defined(TARGET_ARMV6)

to get by the error.

Copy link
Member

Choose a reason for hiding this comment

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

Commencing build of " runtime alljits paltests_install nativeaot spmi " target in "CoreCLR component" for Linux.armv6.Checked in /__w/1/s/artifacts/obj/coreclr/Linux.armv6.Checked

@directhex hmm... I think it's this template eng/pipelines/coreclr/templates/build-job.yml invoking src/coreclr/build-runtime.sh directly, not using subsets

# Build CoreCLR Runtime
- ${{ if ne(parameters.osGroup, 'windows') }}:
- script: $(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) $(crossArg) $(osArg) -ci $(compilerArg) $(clrRuntimeComponentsBuildArg) $(pgoInstrumentArg) $(officialBuildIdArg) $(clrInterpreterBuildArg) $(clrRuntimePortableBuildArg) $(CoreClrPgoDataArg)
displayName: Build CoreCLR Runtime

Copy link
Member

Choose a reason for hiding this comment

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

Don't know what would be the implication of changing #7 to #6

It would be invalid change.

We should not be compiling this file for arm v6 at all. These .s files would require substantial changes to work correctly on arm v6.

Copy link
Member

@am11 am11 Jan 25, 2022

Choose a reason for hiding this comment

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

I think it is done this way to match s390x coverage (which builds il{d}asm tools along with mono). However, s390x required libunwind updates and https://github.com/dotnet/runtime/blob/57bfe474518ab5b7cfe6bf7424a79ce3af9d6657/src/coreclr/pal/inc/unixasmmacross390x.inc to make those scenarios work. We would either need armv6 equivalent or disable clr.iltools+clr.packages subsets from building armv6. @directhex, per @jkotas' suggestion, we should disable those subsets armv6 for now (that will unblock the CI, outerloop legs).

Copy link
Member

Choose a reason for hiding this comment

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

clr.iltools should not need any asm macros or libunwind to work. It is accidental dependency.

Copy link
Member

@am11 am11 Jan 25, 2022

Choose a reason for hiding this comment

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

These .s files would require substantial changes to work correctly on arm v6.

This PR made some assembly changes, those should be reverted too? I agree that clr.iltools alone does not require many add_subdirectory() calls src/coreclr/CMakeLists.txt and changes in jit etc. which were made for armv6 and s390x shouldn't be needed.

Copy link
Member Author

Choose a reason for hiding this comment

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

A whole bunch of the iltools build fails without asm macros and libunwind, largely via coreclr pal/ and util/ dirs.

timeoutInMinutes: 120
condition: >-
or(
eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true),
eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true),
eq(variables['isManualOrIsNotPR'], true),
eq(variables['isFullMatrix'], true))
# extra steps, run tests
extraStepsTemplate: /eng/pipelines/libraries/helix.yml
extraStepsParameters:
creator: dotnet-bot
testRunNamePrefixSuffix: Mono_$(_BuildConfig)
condition: >-
or(
eq(variables['librariesContainsChange'], true),
eq(variables['monoContainsChange'], true),
eq(variables['isRollingBuild'], true))

#
# Build the whole product using Mono and run runtime tests with the JIT.
#
Expand Down
4 changes: 2 additions & 2 deletions eng/targetingpacks.targets
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@
RuntimeFrameworkName="$(LocalFrameworkOverrideName)"
LatestRuntimeFrameworkVersion="$(ProductVersion)"
RuntimePackNamePatterns="$(LocalFrameworkOverrideName).Runtime.Mono.**RID**"
RuntimePackRuntimeIdentifiers="linux-arm;linux-arm64;linux-musl-arm64;linux-loongarch64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;win-arm;win-arm64;win-x64;win-x86;linux-musl-arm;osx-arm64;maccatalyst-x64;maccatalyst-arm64;browser-wasm;ios-arm64;ios-arm;iossimulator-arm64;iossimulator-x64;iossimulator-x86;tvos-arm64;tvossimulator-arm64;tvossimulator-x64;android-arm64;android-arm;android-x64;android-x86"
RuntimePackRuntimeIdentifiers="linux-arm;linux-armv6;linux-arm64;linux-musl-arm64;linux-loongarch64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;win-arm;win-arm64;win-x64;win-x86;linux-musl-arm;osx-arm64;maccatalyst-x64;maccatalyst-arm64;browser-wasm;ios-arm64;ios-arm;iossimulator-arm64;iossimulator-x64;iossimulator-x86;tvos-arm64;tvossimulator-arm64;tvossimulator-x64;android-arm64;android-arm;android-x64;android-x86"
RuntimePackLabels="Mono"
Condition="'@(KnownRuntimePack)' == '' or !@(KnownRuntimePack->AnyHaveMetadataValue('TargetFramework', '$(NetCoreAppCurrent)'))"/>
<KnownAppHostPack Include="$(LocalFrameworkOverrideName)"
AppHostPackNamePattern="$(LocalFrameworkOverrideName).Host.**RID**"
AppHostPackVersion="$([MSBuild]::ValueOrDefault('$(_AppHostBaselinePackVersion)', '$(ProductVersion)'))"
AppHostRuntimeIdentifiers="linux-arm;linux-arm64;linux-musl-arm64;linux-loongarch64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;tizen.4.0.0-armel;tizen.5.0.0-armel;win-arm;win-arm64;win-x64;win-x86;linux-musl-arm;osx-arm64"
AppHostRuntimeIdentifiers="linux-arm;linux-armv6;linux-arm64;linux-musl-arm64;linux-loongarch64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;tizen.4.0.0-armel;tizen.5.0.0-armel;win-arm;win-arm64;win-x64;win-x86;linux-musl-arm;osx-arm64"
TargetFramework="$(NetCoreAppCurrent)"
Condition="'@(KnownAppHostPack)' == '' or !@(KnownAppHostPack->AnyHaveMetadataValue('TargetFramework', '$(NetCoreAppCurrent)'))" />
<KnownCrossgen2Pack Include="$(LocalFrameworkOverrideName).Crossgen2"
Expand Down
5 changes: 4 additions & 1 deletion src/coreclr/inc/volatile.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@
#endif

#if defined(__GNUC__)
#if defined(HOST_ARM) || defined(HOST_ARM64)
#if defined(HOST_ARMV6)
// DMB ISH not valid on ARMv6
#define VOLATILE_MEMORY_BARRIER() asm volatile ("mcr p15, 0, r0, c7, c10, 5" : : : "memory")
#elif defined(HOST_ARM) || defined(HOST_ARM64)
// This is functionally equivalent to the MemoryBarrier() macro used on ARM on Windows.
#define VOLATILE_MEMORY_BARRIER() asm volatile ("dmb ish" : : : "memory")
#else
Expand Down
20 changes: 18 additions & 2 deletions src/coreclr/jit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ function(create_standalone_jit)
elseif((TARGETDETAILS_ARCH STREQUAL "arm") OR (TARGETDETAILS_ARCH STREQUAL "armel"))
set(JIT_ARCH_SOURCES ${JIT_ARM_SOURCES})
set(JIT_ARCH_HEADERS ${JIT_ARM_HEADERS})
elseif((TARGETDETAILS_ARCH STREQUAL "armv6") OR (TARGETDETAILS_ARCH STREQUAL "armv6l"))
set(JIT_ARCH_SOURCES ${JIT_ARMV6_SOURCES})
set(JIT_ARCH_HEADERS ${JIT_ARMV6_HEADERS})
elseif(TARGETDETAILS_ARCH STREQUAL "x86")
set(JIT_ARCH_SOURCES ${JIT_I386_SOURCES})
set(JIT_ARCH_HEADERS ${JIT_I386_HEADERS})
Expand Down Expand Up @@ -220,6 +223,10 @@ set( JIT_ARM64_SOURCES
hwintrinsiccodegenarm64.cpp
)

set( JIT_ARMV6_SOURCES
# Not supported as JIT target
)

set( JIT_S390X_SOURCES
# Not supported as JIT target
)
Expand Down Expand Up @@ -362,6 +369,10 @@ set( JIT_ARM_HEADERS
registerarm.h
)

set ( JIT_ARMV6_HEADERS
# Not supported as JIT target
)

set ( JIT_S390X_HEADERS
# Not supported as JIT target
)
Expand All @@ -380,6 +391,8 @@ convert_to_absolute_path(JIT_I386_SOURCES ${JIT_I386_SOURCES})
convert_to_absolute_path(JIT_I386_HEADERS ${JIT_I386_HEADERS})
convert_to_absolute_path(JIT_ARM64_SOURCES ${JIT_ARM64_SOURCES})
convert_to_absolute_path(JIT_ARM64_HEADERS ${JIT_ARM64_HEADERS})
convert_to_absolute_path(JIT_ARMV6_SOURCES ${JIT_ARMV6_SOURCES})
convert_to_absolute_path(JIT_ARMV6_HEADERS ${JIT_ARMV6_HEADERS})
convert_to_absolute_path(JIT_S390X_SOURCES ${JIT_S390X_SOURCES})
convert_to_absolute_path(JIT_S390X_HEADERS ${JIT_S390X_HEADERS})

Expand All @@ -389,6 +402,9 @@ if(CLR_CMAKE_TARGET_ARCH_AMD64)
elseif(CLR_CMAKE_TARGET_ARCH_ARM)
set(JIT_ARCH_SOURCES ${JIT_ARM_SOURCES})
set(JIT_ARCH_HEADERS ${JIT_ARM_HEADERS})
elseif(CLR_CMAKE_TARGET_ARCH_ARMV6)
set(JIT_ARCH_SOURCES ${JIT_ARMV6_SOURCES})
set(JIT_ARCH_HEADERS ${JIT_ARMV6_HEADERS})
elseif(CLR_CMAKE_TARGET_ARCH_I386)
set(JIT_ARCH_SOURCES ${JIT_I386_SOURCES})
set(JIT_ARCH_HEADERS ${JIT_I386_HEADERS})
Expand Down Expand Up @@ -550,13 +566,13 @@ if (CLR_CMAKE_TARGET_ARCH_I386 AND CLR_CMAKE_TARGET_UNIX)
endif (CLR_CMAKE_TARGET_ARCH_I386 AND CLR_CMAKE_TARGET_UNIX)

if (CLR_CMAKE_TARGET_UNIX)
if (NOT ARCH_TARGET_NAME STREQUAL s390x)
if (NOT ARCH_TARGET_NAME STREQUAL s390x AND NOT ARCH_TARGET_NAME STREQUAL armv6)
if(CLR_CMAKE_TARGET_ARCH_ARM OR CLR_CMAKE_TARGET_ARCH_ARM64)
install_clr(TARGETS clrjit_universal_${ARCH_TARGET_NAME}_${ARCH_HOST_NAME} DESTINATIONS . COMPONENT jit)
else()
install_clr(TARGETS clrjit_unix_${ARCH_TARGET_NAME}_${ARCH_HOST_NAME} DESTINATIONS . COMPONENT jit)
endif()
endif(NOT ARCH_TARGET_NAME STREQUAL s390x)
endif(NOT ARCH_TARGET_NAME STREQUAL s390x AND NOT ARCH_TARGET_NAME STREQUAL armv6)
endif()

if (CLR_CMAKE_TARGET_WIN32 AND CLR_CMAKE_PGO_INSTRUMENT)
Expand Down
Loading