How to build sdk from source for new architecture #4501
Replies: 9 comments 24 replies
-
If you want to build in source-only mode, please use the For cross-compilation, I generally use the following additional arguments to Edit: And use https://github.com/dotnet/dotnet/ for building |
Beta Was this translation helpful? Give feedback.
-
For clarity what repo are you building from? |
Beta Was this translation helpful? Give feedback.
-
Hey, edit: tried with some extra parameters, like |
Beta Was this translation helpful? Give feedback.
-
Slightly off-topic, can you help me set up a debian:sid (or any other) container that supports cross-compilation from x86_64/amd64 to riscv64? The obvious thing (at least to me) doesn't work: ROM debian:unstable
ARG TARGET_DEBIAN_ARCH
ARG TARGET_GNU_ARCH
ENV TARGET_DEBIAN_ARCH=${TARGET_DEBIAN_ARCH:-riscv64}
ENV TARGET_GNU_ARCH=${TARGET_GNU_ARCH:-riscv64}
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y \
clang-16 \
cmake \
curl \
g++ \
gcc \
git \
libexpat1-dev \
libgmp-dev \
libncurses5-dev \
libpython3-dev \
libssl-dev \
locales \
make \
nodejs \
python3 \
sudo \
texinfo \
wget
RUN dpkg --add-architecture "$TARGET_DEBIAN_ARCH" && \
apt-get update && \
apt-get install --no-install-recommends --yes \
binutils-multiarch \
crossbuild-essential-"$TARGET_DEBIAN_ARCH" |
Beta Was this translation helpful? Give feedback.
-
I build
I don't know what to do with it? I can turn off |
Beta Was this translation helpful? Give feedback.
-
In the meantime, I would like to ask about one bug that has accompanied me during my
and I wasn't able to find the reason behind it. Could anyone explain me this? Thx :D |
Beta Was this translation helpful? Give feedback.
-
Hi.
passing edit: change in
|
Beta Was this translation helpful? Give feedback.
-
Hi, how to build .net core 8 sdk in source-only mode? |
Beta Was this translation helpful? Give feedback.
-
After setting up the right cross-compilation environment, I was able to apply this patch: --- a/src/aspnetcore/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj
+++ b/src/aspnetcore/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj
@@ -42,7 +42,7 @@
<AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder>$(AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder);.r2rmap</AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder>
<!-- Optimize the framework using the crossgen2 tool. Crossgen2 is not currently supported on s390x or ppc64le or armv6 or loongarch64. -->
- <CrossgenOutput Condition=" '$(TargetArchitecture)' == 's390x' OR '$(TargetArchitecture)' == 'armv6' OR '$(TargetArchitecture)' == 'ppc64le' OR '$(TargetArchitecture)' == 'loongarch64' ">false</CrossgenOutput>
+ <CrossgenOutput Condition=" '$(TargetArchitecture)' == 's390x' OR '$(TargetArchitecture)' == 'armv6' OR '$(TargetArchitecture)' == 'ppc64le' OR '$(TargetArchitecture)' == 'loongarch64' OR '$(TargetArchitecture)' == 'riscv64' ">false</CrossgenOutput>
<!-- VMR doesn't produce valid crossgen for the host/build machine https://github.com/dotnet/source-build/issues/3793 -->
<CrossgenOutput Condition=" '$(DotNetBuild)' == 'true' AND '$(Crossbuild)' == 'true' ">false</CrossgenOutput>
<CrossgenOutput Condition=" '$(CrossgenOutput)' == '' AND '$(Configuration)' != 'Debug' ">true</CrossgenOutput>
--- a/src/sdk/src/Installer/redist-installer/redist-installer.csproj
+++ b/src/sdk/src/Installer/redist-installer/redist-installer.csproj
@@ -9,7 +9,7 @@
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>none</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
<BundleRuntimePacks Condition="'$(BundleRuntimePacks)' == '' and '$(DotNetBuildSourceOnly)' == 'true'">true</BundleRuntimePacks>
<!-- DotNetBuildOrchestrator is (currently) needed in order to obtain NuGet packages from the runtime build. -->
- <BundleNativeAotCompiler Condition="'$(BundleNativeAotCompiler)' == '' and '$(DotNetBuildSourceOnly)' == 'true' and '$(SourceBuildUseMonoRuntime)' != 'true' and '$(DotNetBuildOrchestrator)' == 'true'">true</BundleNativeAotCompiler>
+ <BundleNativeAotCompiler Condition="'$(BundleNativeAotCompiler)' == '' and '$(DotNetBuildSourceOnly)' == 'true' and '$(SourceBuildUseMonoRuntime)' != 'true' and '$(DotNetBuildOrchestrator)' == 'true' and '$(Architecture)' != 'riscv64'">true</BundleNativeAotCompiler>
</PropertyGroup>
<ItemGroup> And then build it using the following commands:
|
Beta Was this translation helpful? Give feedback.
-
I would like to ask for any hint how to build SDK for a new architecture (
riscv
). I was tryingBut building failed with error:
I was trying to build dotnet/sdk
Beta Was this translation helpful? Give feedback.
All reactions