-
Notifications
You must be signed in to change notification settings - Fork 132
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
Support virtualized 32-bit build on 64-bit ARM cores #2781
Comments
AFAIK, Can you try this change: diff --git a/Directory.Build.props b/Directory.Build.props
index c373c9beb..af0f16f88 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -9,7 +9,7 @@
<PropertyGroup>
<BuildArchitecture>$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant())</BuildArchitecture>
- <Architecture Condition="'$(Architecture)' == '' AND '$(BuildArchitecture)' == 'arm64'">$(BuildArchitecture)</Architecture>
+ <Architecture Condition="'$(Architecture)' == '' AND ( '$(BuildArchitecture)' == 'arm64' OR '$(BuildArchitecture)' == 'arm') ">$(BuildArchitecture)</Architecture>
<Architecture Condition="'$(Architecture)' == '' AND '$(BuildArchitecture)' == 's390x'">$(BuildArchitecture)</Architecture>
<Architecture Condition="'$(Architecture)' == ''">x64</Architecture>
</PropertyGroup> |
Hmm, actually, come to think of it, this should have done the same thing: - <BuildCommandArgs>$(BuildCommandArgs) --arch $(Platform)</BuildCommandArgs>
+ <BuildCommandArgs>$(BuildCommandArgs) --arch arm</BuildCommandArgs> Looking at the build script, it only handles |
Indeed, this patches aspnetcore's proj file, not run-build.sh |
Look-a-here, we've moved forward. Now we're crashing at fsharp:
eng/common/tools.sh: line 475
eng/common/tools.sh: _InitializeBuildTool
Last time I saw code 139, I think it had something to do with lttng-ust 2.13.1. Given that I've neutralized it by deleting |
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
The code 139 bug seems to have disappeared. The clrjit bug is confirmed fixed with your patch, @omajid. It looks like build on armv7 and armhf works. I'll confirm a full rebuild with the following patches: installer_arm-build.patch From 1bc1a54dfd9c9d448dc671a2bad2f05e0641885c Mon Sep 17 00:00:00 2001
From: "build@apk-groulx" <build@apk-groulx.praxis>
Date: Wed, 9 Mar 2022 08:17:41 +0000
Subject: [PATCH 1/1] arm build
---
Directory.Build.props | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Directory.Build.props b/Directory.Build.props
index c373c9beb..af0f16f88 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -9,7 +9,7 @@
<PropertyGroup>
<BuildArchitecture>$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant())</BuildArchitecture>
- <Architecture Condition="'$(Architecture)' == '' AND '$(BuildArchitecture)' == 'arm64'">$(BuildArchitecture)</Architecture>
+ <Architecture Condition="'$(Architecture)' == '' AND ( '$(BuildArchitecture)' == 'arm64' OR '$(BuildArchitecture)' == 'arm') ">$(BuildArchitecture)</Architecture>
<Architecture Condition="'$(Architecture)' == '' AND '$(BuildArchitecture)' == 's390x'">$(BuildArchitecture)</Architecture>
<Architecture Condition="'$(Architecture)' == ''">x64</Architecture>
</PropertyGroup>
--
2.35.1 runtime_detect-armv8.patch From 79ddbec165071d8f8e51fd7c06600be466972758 Mon Sep 17 00:00:00 2001
From: Antoine Martin <dev@ayakael.net>
Date: Mon, 21 Feb 2022 06:03:34 +0000
Subject: [PATCH 1/1] detect armv8l as armv7l
Alpine pipeline emulates 32bit arm, but CPU is aarch64 coming off as
arm8l. Thus arm detection logics don't know how to read armv8l, thus
this patch reads armv8l as arm platform.
---
eng/native/configureplatform.cmake | 2 +-
eng/native/init-os-and-arch.sh | 2 +-
src/coreclr/tools/aot/crossgen2/crossgen2.props | 1 +
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/eng/native/configureplatform.cmake b/eng/native/configureplatform.cmake
index af1c88bce5b..99556d80c05 100644
--- a/eng/native/configureplatform.cmake
+++ b/eng/native/configureplatform.cmake
@@ -36,7 +36,7 @@ if(CLR_CMAKE_HOST_OS STREQUAL Linux)
# "amd64" string. Accept either of the two here.
if(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL amd64)
set(CLR_CMAKE_HOST_UNIX_AMD64 1)
- elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL armv7l)
+ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL armv7l OR CMAKE_SYSTEM_PROCESSOR STREQUAL armv8l)
set(CLR_CMAKE_HOST_UNIX_ARM 1)
set(CLR_CMAKE_HOST_UNIX_ARMV7L 1)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL arm OR CMAKE_SYSTEM_PROCESSOR STREQUAL armv7-a)
diff --git a/eng/native/init-os-and-arch.sh b/eng/native/init-os-and-arch.sh
index fc4078fa3a9..9ba5b3c227a 100644
--- a/eng/native/init-os-and-arch.sh
+++ b/eng/native/init-os-and-arch.sh
@@ -41,7 +41,7 @@ case "$CPUName" in
arch=x64
;;
- armv7l)
+ armv7l|armv8l)
if (NAME=""; . /etc/os-release; test "$NAME" = "Tizen"); then
arch=armel
else
--
2.34.1 runtime_aarch64-armv7-armhf-lld-fix.patch From 91988b0241a77f1f6524c19e2ce55dda06de7242 Mon Sep 17 00:00:00 2001
Patch-Source: https://src.fedoraproject.org/rpms/dotnet6.0/blob/rawhide/f/runtime-arm64-lld-fix.patch
From: Omair Majid <omajid@redhat.com>
Date: Wed, 16 Feb 2022 18:08:22 +0000
Subject: [PATCH 1/1] arm64 lld fix
---
eng/native/init-compiler.sh | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/eng/native/init-compiler.sh b/eng/native/init-compiler.sh
index 567d18da474..05245c7b9f8 100755
--- a/eng/native/init-compiler.sh
+++ b/eng/native/init-compiler.sh
@@ -108,11 +108,8 @@ if [[ -z "$CC" ]]; then
fi
if [[ "$compiler" == "clang" ]]; then
- if command -v "lld$desired_version" > /dev/null; then
- # Only lld version >= 9 can be considered stable
- if [[ "$majorVersion" -ge 9 ]]; then
- LDFLAGS="-fuse-ld=lld"
- fi
+ if "$CC" -fuse-ld=lld -Wl,--version >/dev/null 2>&1; then
+ LDFLAGS="-fuse-ld=lld"
fi
fi
--
2.34.1 |
So, build passes, but there's no edit actually, there's |
With dotnet/runtime#66477, this is fixed. Arm support proper is to be addressed here: dotnet/installer#13378. Closing. |
The output of
uname -m
in virtualized 32-bit arm environment on 64-bit ARM cores isarmv8l
. Unfortunately, the build process of dotnet 6.0.102 doesn't know what to do with this output, thus defaults to buildingx64
. Just asarmv7l
is detected asarm
, and builds as such,armv8l
should also be detected asarm
.I've thus been trying to figure this out, but I've hit a wall. Here are my current patches:
tarball:
runtime:
Despite that, during installer build, I get the following error:
So either
libclrjit_unix_x64_arm
is incorrect, or the file is never generated. I've tried following in the same direction as dotnet/runtime#49734, but instead of armel it's armv8l. Unfortunately, this didn't work.Are there any arm detection logics that I'm missing?
Made as part of Alpine Linux dotnet6 packaging project, see #2782
The text was updated successfully, but these errors were encountered: