package/dotnet6-runtime: new package
RFC PATCH 1/1 package/dotnet6-runtime: new package
From: Giulio Benetti <[email protected]>
Add .NET 6 runtime to enable C# console applications to run on embedded Linux. At the moment the package can only be built for arm and aarch64.
https://dotnet.microsoft.com/en-us/download/dotnet/6.0
--- DEVELOPERS | 1 + package/Config.in | 1 + ...rm-asmhelpers.S-fix-building-with-GN.patch | 36 +++++++++ ...rm-pinvokestubs.S-fix-building-with-.patch | 64 +++++++++++++++ ...ipcrossarchnative-option-to-build.sh.patch | 44 +++++++++++ ...-when-verbosity-is-passed-as-option-.patch | 45 +++++++++++ package/dotnet6-runtime/Config.in | 31 ++++++++ package/dotnet6-runtime/dotnet6-runtime.hash | 3 + package/dotnet6-runtime/dotnet6-runtime.mk | 77 +++++++++++++++++++ package/dotnet6-runtime/dotnet6-runtime.sh | 2 + 10 files changed, 304 insertions(+) create mode 100644 package/dotnet6-runtime/0001-src-coreclr-vm-arm-asmhelpers.S-fix-building-with-GN.patch create mode 100644 package/dotnet6-runtime/0002-src-coreclr-vm-arm-pinvokestubs.S-fix-building-with-.patch create mode 100644 package/dotnet6-runtime/0003-Add-skipcrossarchnative-option-to-build.sh.patch create mode 100644 package/dotnet6-runtime/0004-Add-Verbose-true-when-verbosity-is-passed-as-option-.patch create mode 100644 package/dotnet6-runtime/Config.in create mode 100644 package/dotnet6-runtime/dotnet6-runtime.hash create mode 100644 package/dotnet6-runtime/dotnet6-runtime.mk create mode 100644 package/dotnet6-runtime/dotnet6-runtime.sh
DEVELOPERS +1 -0
@@ -1199,6 +1199,7 @@ F: configs/olimex_a* F: package/at/ F: package/binutils/ F: package/cryptsetup/ +F: package/dotnet6-runtime/ F: package/erlang-jiffy/ F: package/esp-hosted/ F: package/gcc/
package/Config.in +1 -0
@@ -650,6 +650,7 @@ endmenu menu "Interpreter languages and scripting" source "package/4th/Config.in" + source "package/dotnet6-runtime/Config.in" source "package/enscript/Config.in" source "package/erlang/Config.in" if BR2_PACKAGE_ERLANG
package/dotnet6-runtime/0001-src-coreclr-vm-arm-asmhelpers.S-fix-building-with-GN.patch new file +36 -0
@@ -0,0 +1,36 @@ +From b2d03d48e2a24b68835a1863956d70af96180ea2 Mon Sep 17 00:00:00 2001 +From: Giulio Benetti <[email protected]> +Date: Wed, 16 Aug 2023 00:09:59 +0200 +Subject: [PATCH] src/coreclr/vm/arm/asmhelpers.S: fix building with GNU AS + +GNU AS doesn't support label subtraction when assigning to a register so +let's load absolute function address to R2 when building with GNU AS. + +Upstream: https://github.com/dotnet/runtime/pull/86692 + +Signed-off-by: Giulio Benetti <[email protected]> +--- + src/coreclr/vm/arm/asmhelpers.S | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/coreclr/vm/arm/asmhelpers.S b/src/coreclr/vm/arm/asmhelpers.S +index 2780f95912f..d5e2f1ba2de 100644 +--- a/src/coreclr/vm/arm/asmhelpers.S ++++ b/src/coreclr/vm/arm/asmhelpers.S +@@ -984,9 +984,13 @@ g_rgWriteBarrierDescriptors: + LEAF_ENTRY JIT_WriteBarrier_Callable + + // Branch to the write barrier ++#if defined(__clang__) + ldr r2, =JIT_WriteBarrier_Loc-(1f+4) // or R3? See targetarm.h + 1: + add r2, pc ++#else ++ ldr r2, =JIT_WriteBarrier_Loc ++#endif + ldr pc, [r2] + + LEAF_END JIT_WriteBarrier_Callable +-- +2.34.1 +
package/dotnet6-runtime/0002-src-coreclr-vm-arm-pinvokestubs.S-fix-building-with-.patch new file +64 -0
64 lines not on this page · raw message
package/dotnet6-runtime/0003-Add-skipcrossarchnative-option-to-build.sh.patch new file +44 -0
44 lines not on this page · raw message
package/dotnet6-runtime/0004-Add-Verbose-true-when-verbosity-is-passed-as-option-.patch new file +45 -0
45 lines not on this page · raw message
package/dotnet6-runtime/Config.in new file +31 -0
@@ -0,0 +1,31 @@ +config BR2_PACKAGE_DOTNET6_RUNTIME_ARCH_SUPPORTS + bool + default y if BR2_aarch64 + # On ARM CoreCLR JIT requires 16 64-bit or 32 32-bit FPU registers + default y if BR2_arm && (BR2_ARM_FPU_VFPV3 || BR2_ARM_FPU_VFPV3D16 || \ + BR2_ARM_FPU_VFPV4 || BR2_ARM_FPU_VFPV4D16) + depends on BR2_USE_MMU # fork() + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_8 # aarch64 fpu assembly registers build failure + +config BR2_PACKAGE_DOTNET6_RUNTIME + bool "dotnet6-runtime" + depends on BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_MUSL + depends on BR2_TOOLCHAIN_HAS_THREADS + depends on !BR2_STATIC_LIBS + depends on BR2_PACKAGE_DOTNET6_RUNTIME_ARCH_SUPPORTS + select BR2_PACKAGE_HOST_CMAKE + select BR2_PACKAGE_ICU + select BR2_PACKAGE_LIBCURL + select BR2_PACKAGE_LIBKRB5 + select BR2_PACKAGE_LIBZLIB + select BR2_PACKAGE_LTTNG_LIBUST + select BR2_PACKAGE_OPENSSL + help + .NET Core 6 Runtime + + https://dotnet.microsoft.com/download/dotnet-core/6.0 + +comment "dotnet-runtime needs a toolchain w/ glibc or musl and threads" + depends on BR2_PACKAGE_DOTNET6_RUNTIME_ARCH_SUPPORTS + depends on !BR2_TOOLCHAIN_USES_GLIBC && !BR2_TOOLCHAIN_USES_MUSL + depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS
package/dotnet6-runtime/dotnet6-runtime.hash new file +3 -0
@@ -0,0 +1,3 @@ +# Locally calculated +sha256 a674c44736bf4f4dfafa800899577ef92cb626b9118b5fbdd0182f8c05b5c2e1 dotnet6-runtime-6.0.22.tar.gz +sha256 cfc21f5e8bd655ae997eec916138b707b1d290b83272c02a95c9f821b8c87310 LICENSE.TXT
package/dotnet6-runtime/dotnet6-runtime.mk new file +77 -0
77 lines not on this page · raw message
package/dotnet6-runtime/dotnet6-runtime.sh new file +2 -0
@@ -0,0 +1,2 @@ +export PATH=$PATH:/usr/share/dotnet +export LD_LIBRARY_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/6.0.16
Signature · 6 lines
2.34.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Same here,
I kindly ping since long time passed.
This patch builds .NET 6 while the other simply download and install .NET 8. They require to be updated of course. I'd appreciate a feedback for both patches.
Thanks in advance!
Best regards
Signature · 4 lines
Giulio Benetti CEO&CTO@Benetti Engineering sas https://www.linkedin.com/company/benetti-engineering-sas/ https://www.linkedin.com/in/giulio-benetti-79975951/
Quoted 405 lines · Giulio Benetti
From: Giulio Benetti <[email protected]>
Add .NET 6 runtime to enable C# console applications to run on embedded Linux. At the moment the package can only be built for arm and aarch64.
https://dotnet.microsoft.com/en-us/download/dotnet/6.0
Cc Jim Reinhart <[email protected]>Cc James Autry <[email protected]>Cc Matthew Maron <[email protected]>Signed-off-by Giulio Benetti <[email protected]>Signed-off-by Giulio Benetti <[email protected]>--- DEVELOPERS | 1 + package/Config.in | 1 + ...rm-asmhelpers.S-fix-building-with-GN.patch | 36 +++++++++ ...rm-pinvokestubs.S-fix-building-with-.patch | 64 +++++++++++++++ ...ipcrossarchnative-option-to-build.sh.patch | 44 +++++++++++ ...-when-verbosity-is-passed-as-option-.patch | 45 +++++++++++ package/dotnet6-runtime/Config.in | 31 ++++++++ package/dotnet6-runtime/dotnet6-runtime.hash | 3 + package/dotnet6-runtime/dotnet6-runtime.mk | 77 +++++++++++++++++++ package/dotnet6-runtime/dotnet6-runtime.sh | 2 + 10 files changed, 304 insertions(+)create mode 100644
package/dotnet6-runtime/0001-src-coreclr-vm-arm-asmhelpers.S-fix-building-with-GN.patchcreate mode 100644package/dotnet6-runtime/0002-src-coreclr-vm-arm-pinvokestubs.S-fix-building-with-.patchcreate mode 100644package/dotnet6-runtime/0003-Add-skipcrossarchnative-option-to-build.sh.patchcreate mode 100644package/dotnet6-runtime/0004-Add-Verbose-true-when-verbosity-is-passed-as-option-.patchcreate mode 100644 package/dotnet6-runtime/Config.in
create mode 100644 package/dotnet6-runtime/dotnet6-runtime.hash
create mode 100644package/dotnet6-runtime/dotnet6-runtime.mk
create mode 100644package/dotnet6-runtime/dotnet6-runtime.shDEVELOPERS +1
-0@@ -1199,6 +1199,7 @@ F: configs/olimex_a* F: package/at/ F: package/binutils/ F: package/cryptsetup/ +F: package/dotnet6-runtime/ F: package/erlang-jiffy/ F: package/esp-hosted/ F: package/gcc/package/Config.in +1
-0@@ -650,6 +650,7 @@ endmenu menu "Interpreter languages and scripting" source "package/4th/Config.in" + source "package/dotnet6-runtime/Config.in" source "package/enscript/Config.in" source "package/erlang/Config.in" if BR2_PACKAGE_ERLANGpackage/dotnet6-runtime/0001-src-coreclr-vm-arm-asmhelpers.S-fix-building-with-GN.patch new file +36
-0@@ -0,0 +1,36 @@ +From b2d03d48e2a24b68835a1863956d70af96180ea2 Mon Sep 17 00:00:00 2001 +From: Giulio Benetti <[email protected]> +Date: Wed, 16 Aug 2023 00:09:59 +0200 +Subject: [PATCH] src/coreclr/vm/arm/asmhelpers.S: fix building with GNU AS + +GNU AS doesn't support label subtraction when assigning to a register so +let's load absolute function address to R2 when building with GNU AS. + +Upstream: https://github.com/dotnet/runtime/pull/86692 + +Signed-off-by: Giulio Benetti <[email protected]> +--- + src/coreclr/vm/arm/asmhelpers.S | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/coreclr/vm/arm/asmhelpers.S b/src/coreclr/vm/arm/asmhelpers.S +index 2780f95912f..d5e2f1ba2de 100644 +--- a/src/coreclr/vm/arm/asmhelpers.S ++++ b/src/coreclr/vm/arm/asmhelpers.S +@@ -984,9 +984,13 @@ g_rgWriteBarrierDescriptors: + LEAF_ENTRY JIT_WriteBarrier_Callable + + // Branch to the write barrier ++#if defined(__clang__) + ldr r2, =JIT_WriteBarrier_Loc-(1f+4) // or R3? See targetarm.h + 1: + add r2, pc ++#else ++ ldr r2, =JIT_WriteBarrier_Loc ++#endif + ldr pc, [r2] + + LEAF_END JIT_WriteBarrier_Callable +-- +2.34.1 +package/dotnet6-runtime/0002-src-coreclr-vm-arm-pinvokestubs.S-fix-building-with-.patch new file +64
-0@@ -0,0 +1,64 @@ +From 5e6bd486cb9a6b9713dee10160c5798bc8e6dec0 Mon Sep 17 00:00:00 2001 +From: Giulio Benetti <[email protected]> +Date: Wed, 16 Aug 2023 00:10:40 +0200 +Subject: [PATCH] src/coreclr/vm/arm/pinvokestubs.S: fix building with GNU AS + +GNU AS doesn't support label subtraction when assigning to a register so +let's load absolute function address to R1/R2 when building with GNU AS. + +Upstream: https://github.com/dotnet/runtime/pull/86692 + +Signed-off-by: Giulio Benetti <[email protected]> +--- + src/coreclr/vm/arm/pinvokestubs.S | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/src/coreclr/vm/arm/pinvokestubs.S b/src/coreclr/vm/arm/pinvokestubs.S +index cd4928003b5..737feec0310 100644 +--- a/src/coreclr/vm/arm/pinvokestubs.S ++++ b/src/coreclr/vm/arm/pinvokestubs.S +@@ -84,9 +84,13 @@ + + PROLOG_PUSH "{r4, lr}" + ++#if defined(__clang__) + ldr r1, =s_gsCookie-(1f+4) + 1: + add r1, pc ++#else ++ ldr r1, =s_gsCookie ++#endif + ldr r1, [r1] + str r1, [r0] + add r4, r0, SIZEOF__GSCookie +@@ -94,9 +98,13 @@ + // r4 = pFrame + + // set first slot to the value of InlinedCallFrame::`vftable' (checked by runtime code) ++#if defined(__clang__) + ldr r1, =_ZTV16InlinedCallFrame+8-(2f+4) + 2: + add r1, pc ++#else ++ ldr r1, =_ZTV16InlinedCallFrame+8 ++#endif + str r1, [r4] + + mov r1, 0 +@@ -146,9 +154,13 @@ + str r2, [r1, #Thread_m_fPreemptiveGCDisabled] + + // Check return trap ++#if defined(__clang__) + ldr r2, =g_TrapReturningThreads-(1f+4) + 1: + add r2, pc ++#else ++ ldr r2, =g_TrapReturningThreads ++#endif + ldr r2, [r2] + cbnz r2, LOCAL_LABEL(RarePath) + +-- +2.34.1 +package/dotnet6-runtime/0003-Add-skipcrossarchnative-option-to-build.sh.patch new file +44
-0@@ -0,0 +1,44 @@ +From 62f78aa8133fa4e926279a00584f31f512f276df Mon Sep 17 00:00:00 2001 +From: Giulio Benetti <[email protected]> +Date: Wed, 7 Jun 2023 16:58:34 +0200 +Subject: [PATCH] Add -skipcrossarchnative option to build.sh + +Upstream: https://github.com/dotnet/runtime/pull/90554 + +Signed-off-by: Giulio Benetti <[email protected]> +--- + eng/build.sh | 5 +++++ + src/coreclr/runtime.proj | 1 + + 2 files changed, 6 insertions(+) + +diff --git a/eng/build.sh b/eng/build.sh +index ea6be90af61..6c21f316832 100755 +--- a/eng/build.sh ++++ b/eng/build.sh +@@ -460,6 +460,11 @@ while [[ $# > 0 ]]; do + shift 1 + ;; + ++ -skipcrossarchnative) ++ arguments="$arguments /p:SkipCrossArchNative=true" ++ shift 1 ++ ;; ++ + *) + extraargs="$extraargs $1" + shift 1 +diff --git a/src/coreclr/runtime.proj b/src/coreclr/runtime.proj +index 3d4705a92f6..42ab2e70d65 100644 +--- a/src/coreclr/runtime.proj ++++ b/src/coreclr/runtime.proj +@@ -13,6 +13,7 @@ + <_CoreClrBuildArg Condition="'$(PortableBuild)' != 'true'" Include="-portablebuild=false" /> + <_CoreClrBuildArg Condition="'$(KeepNativeSymbols)' != 'false'" Include="-keepnativesymbols" /> + <_CoreClrBuildArg Condition="!$([MSBuild]::IsOsPlatform(Windows))" Include="-os $(TargetOS)" /> ++ <_CoreClrBuildArg Condition="'$(SkipCrossArchNative)' == 'true'" Include="-skipcrossarchnative" /> + + <_CoreClrBuildArg Condition="$([MSBuild]::IsOsPlatform(Windows)) and + ('$(TargetArchitecture)' == 'x86' or '$(TargetArchitecture)' == 'x64') and +-- +2.34.1 +package/dotnet6-runtime/0004-Add-Verbose-true-when-verbosity-is-passed-as-option-.patch new file +45
-0@@ -0,0 +1,45 @@ +From 0b999da7b88000e628bb4423af4c01ad2c93c257 Mon Sep 17 00:00:00 2001 +From: Giulio Benetti <[email protected]> +Date: Wed, 7 Jun 2023 18:50:08 +0200 +Subject: [PATCH] Add Verbose=true when --verbosity is passed as option to + build.sh + +Upstream: https://github.com/dotnet/runtime/pull/90554 + +Signed-off-by: Giulio Benetti <[email protected]> +--- + eng/build.sh | 5 +++++ + src/coreclr/runtime.proj | 1 + + 2 files changed, 6 insertions(+) + +diff --git a/eng/build.sh b/eng/build.sh +index 6c21f316832..76e604446fb 100755 +--- a/eng/build.sh ++++ b/eng/build.sh +@@ -465,6 +465,11 @@ while [[ $# > 0 ]]; do + shift 1 + ;; + ++ -verbosity) ++ arguments="$arguments /p:Verbose=true" ++ shift 2 ++ ;; ++ + *) + extraargs="$extraargs $1" + shift 1 +diff --git a/src/coreclr/runtime.proj b/src/coreclr/runtime.proj +index 42ab2e70d65..9acf6436ff3 100644 +--- a/src/coreclr/runtime.proj ++++ b/src/coreclr/runtime.proj +@@ -14,6 +14,7 @@ + <_CoreClrBuildArg Condition="'$(KeepNativeSymbols)' != 'false'" Include="-keepnativesymbols" /> + <_CoreClrBuildArg Condition="!$([MSBuild]::IsOsPlatform(Windows))" Include="-os $(TargetOS)" /> + <_CoreClrBuildArg Condition="'$(SkipCrossArchNative)' == 'true'" Include="-skipcrossarchnative" /> ++ <_CoreClrBuildArg Condition="'$(Verbose)' == 'true'" Include="-verbose" /> + + <_CoreClrBuildArg Condition="$([MSBuild]::IsOsPlatform(Windows)) and + ('$(TargetArchitecture)' == 'x86' or '$(TargetArchitecture)' == 'x64') and +-- +2.34.1 +package/dotnet6-runtime/Config.in new file +31
-0@@ -0,0 +1,31 @@ +config BR2_PACKAGE_DOTNET6_RUNTIME_ARCH_SUPPORTS + bool + default y if BR2_aarch64 + # On ARM CoreCLR JIT requires 16 64-bit or 32 32-bit FPU registers + default y if BR2_arm && (BR2_ARM_FPU_VFPV3 || BR2_ARM_FPU_VFPV3D16 || \ + BR2_ARM_FPU_VFPV4 || BR2_ARM_FPU_VFPV4D16) + depends on BR2_USE_MMU # fork() + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_8 # aarch64 fpu assembly registers build failure + +config BR2_PACKAGE_DOTNET6_RUNTIME + bool "dotnet6-runtime" + depends on BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_MUSL + depends on BR2_TOOLCHAIN_HAS_THREADS + depends on !BR2_STATIC_LIBS + depends on BR2_PACKAGE_DOTNET6_RUNTIME_ARCH_SUPPORTS + select BR2_PACKAGE_HOST_CMAKE + select BR2_PACKAGE_ICU + select BR2_PACKAGE_LIBCURL + select BR2_PACKAGE_LIBKRB5 + select BR2_PACKAGE_LIBZLIB + select BR2_PACKAGE_LTTNG_LIBUST + select BR2_PACKAGE_OPENSSL + help + .NET Core 6 Runtime + + https://dotnet.microsoft.com/download/dotnet-core/6.0 + +comment "dotnet-runtime needs a toolchain w/ glibc or musl and threads" + depends on BR2_PACKAGE_DOTNET6_RUNTIME_ARCH_SUPPORTS + depends on !BR2_TOOLCHAIN_USES_GLIBC && !BR2_TOOLCHAIN_USES_MUSL + depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADSpackage/dotnet6-runtime/dotnet6-runtime.hash new file +3
-0@@ -0,0 +1,3 @@ +# Locally calculated +sha256 a674c44736bf4f4dfafa800899577ef92cb626b9118b5fbdd0182f8c05b5c2e1 dotnet6-runtime-6.0.22.tar.gz +sha256 cfc21f5e8bd655ae997eec916138b707b1d290b83272c02a95c9f821b8c87310 LICENSE.TXTpackage/dotnet6-runtime/dotnet6-runtime.mk new file +77
-0@@ -0,0 +1,77 @@ +################################################################################ +# +# dotnet6-runtime +# +################################################################################ + +DOTNET6_RUNTIME_VERSION = 6.0.22 +DOTNET6_RUNTIME_SITE = $(call github,dotnet,runtime,v$(DOTNET6_RUNTIME_VERSION)) +DOTNET6_RUNTIME_LICENSE = MIT +DOTNET6_RUNTIME_LICENSE_FILES = LICENSE.TXT +DOTNET6_RUNTIME_DEPENDENCIES = host-cmake libzlib openssl libcurl icu libkrb5 lttng-libust + +ifeq ($(BR2_aarch64),y) +DOTNET6_RUNTIME_ARCH = arm64 +else ifeq ($(BR2_arm),y) +DOTNET6_RUNTIME_ARCH = arm +# Set FPU type +DOTNET6_RUNTIME_ARM_FPU_TYPE = $(BR2_GCC_TARGET_FPU) +ifeq ($(BR2_ARM_FPU_VFPV3)$(BR2_ARM_FPU_VFPV4),y) +# Set 0x07 if 32 fpu registers are used +DOTNET6_RUNTIME_ARM_FPU_CAPABILITY = 0x07 +else ifeq ($(BR2_ARM_FPU_VFPV3D16)$(BR2_ARM_FPU_VFPV4D16),y) +# Set 0x03 if 32 fpu registers are used +DOTNET6_RUNTIME_ARM_FPU_CAPABILITY = 0x03 +endif +endif + +ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y) +DOTNET6_RUNTIME_TOOLCHAIN_PREFIX = $(GNU_TARGET_NAME) +else +DOTNET6_RUNTIME_TOOLCHAIN_PREFIX = $(TOOLCHAIN_EXTERNAL_PREFIX) +endif + +ifeq ($(BR2_ENABLE_DEBUG),y) +DOTNET6_RUNTIME_BUILD_CONFIGURATION = Debug +else +DOTNET6_RUNTIME_BUILD_CONFIGURATION = Release +endif + +DOTNET6_RUNTIME_CMAKEARGS = --cmakeargs "-DCMAKE_TOOLCHAIN_FILE="$(HOST_DIR)/share/buildroot/toolchainfile.cmake"" \ + --cmakeargs "-DCMAKE_INSTALL_RUNSTATEDIR="/run"" \ + --cmakeargs "-DCMAKE_CXX_COMPILER_TARGET=$(DOTNET6_RUNTIME_TOOLCHAIN_PREFIX)" \ + --cmakeargs "-DTOOLCHAIN=$(DOTNET6_RUNTIME_TOOLCHAIN_PREFIX)" + +# Append FPU specific defines +ifeq ($(BR2_arm),y) + DOTNET6_RUNTIME_CMAKEARGS += \ + --cmakeargs "-DCLR_ARM_FPU_TYPE=$(DOTNET6_RUNTIME_ARM_FPU_TYPE)" \ + --cmakeargs "-DCLR_ARM_FPU_CAPABILITY=$(DOTNET6_RUNTIME_ARM_FPU_CAPABILITY)" +endif + +define DOTNET6_RUNTIME_BUILD_CMDS + cd $(@D) && PATH=$(BR_PATH) ROOTFS_DIR=$(HOST_DIR) \ + $(SHELL) ./build.sh --subset clr.jit+clr.runtime+libs --verbosity diag \ + --arch $(DOTNET6_RUNTIME_ARCH) --gcc --cross --skipcrossarchnative \ + --configuration $(DOTNET6_RUNTIME_BUILD_CONFIGURATION) \ + $(DOTNET6_RUNTIME_CMAKEARGS) +endef + +define DOTNET6_RUNTIME_INSTALL_TARGET_CMDS + # Copy all .dll libraries to target directory + cp -Rf $(@D)/artifacts/bin/testhost/net6.0-Linux-$(DOTNET6_RUNTIME_BUILD_CONFIGURATION)-$(DOTNET6_RUNTIME_ARCH)/. \ + $(TARGET_DIR)/usr/share/dotnet + # Remove all .dbg, .pdb, .h, .a, .xml files from target + find $(TARGET_DIR)/usr/share/dotnet/ \ + -type f \( -name "*.dbg" -o -name "*.pdb" -o -name "*.h" \ + -o -name "*.a" -o -name "*.xml" \) -delete + + # Create /etc/dotnet/install_location file to point to dotnet + mkdir -p $(TARGET_DIR)/etc/dotnet + echo /usr/share/dotnet > $(TARGET_DIR)/etc/dotnet/install_location + # Export dotnet to PATH and libraries to LD_LIBRARY_PATH + $(INSTALL) -m 0755 -D $(DOTNET6_RUNTIME_PKGDIR)/dotnet6-runtime.sh \ + $(TARGET_DIR)/etc/profile.d/dotnet6-runtime.sh +endef + +$(eval $(generic-package))package/dotnet6-runtime/dotnet6-runtime.sh new file +0
-0
package/dotnet6-runtime/dotnet6-runtime.sh line 2
Quoted 2 lines
package/dotnet6-runtime/dotnet6-runtime.sh new file +2
-0@@ -0,0 +1,2 @@ +export PATH=$PATH:/usr/share/dotnet +export LD_LIBRARY_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/6.0.16
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Hi Guilio,
Some additional comments I made on top of the ones for -prebuilt.
Quoted 6 lines · Giulio Benetti
From: Giulio Benetti <[email protected]>
Add .NET 6 runtime to enable C# console applications to run on embedded Linux. At the moment the package can only be built for arm and aarch64.
Is it useful to have 6 and 8 parallel installed? Is it useful to have version
selection at all?
[snip]
package/dotnet6-runtime/Config.in line 6
Quoted 12 lines
package/dotnet6-runtime/Config.in new file +6
-0@@ -0,0 +1,31 @@ +config BR2_PACKAGE_DOTNET6_RUNTIME_ARCH_SUPPORTS + bool + default y if BR2_aarch64 + # On ARM CoreCLR JIT requires 16 64-bit or 32 32-bit FPU registers + default y if BR2_arm && (BR2_ARM_FPU_VFPV3 || BR2_ARM_FPU_VFPV3D16 || \ + BR2_ARM_FPU_VFPV4 || BR2_ARM_FPU_VFPV4D16)
So... shouldn't this condition exist for the prebuilt version as well?
Also, not supported on x86?
package/dotnet6-runtime/Config.in line 13
Quoted 7 lines
package/dotnet6-runtime/Config.in new file +7
-0+ depends on BR2_USE_MMU # fork() + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_8 # aarch64 fpu assembly registers build failure + +config BR2_PACKAGE_DOTNET6_RUNTIME + bool "dotnet6-runtime" + depends on BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_MUSL + depends on BR2_TOOLCHAIN_HAS_THREADS
This condition is actually redundant with the other one, both musl and glibc
always have threads.
package/dotnet6-runtime/Config.in line 14
Quoted 1 line
package/dotnet6-runtime/Config.in new file +1
-0+ depends on !BR2_STATIC_LIBS
Doesn't the build try to statically link with its dependent libraries? I.e.
doesn't it required BR2_SHARED_STATIC_LIBS (shared because it generates only shared libraries, and static because it only statically links with libraries)?
package/dotnet6-runtime/Config.in line 16
Quoted 2 lines
package/dotnet6-runtime/Config.in new file +2
-0+ depends on BR2_PACKAGE_DOTNET6_RUNTIME_ARCH_SUPPORTS + select BR2_PACKAGE_HOST_CMAKE
Normally there shouldn't be select statements for host packages.
package/dotnet6-runtime/Config.in line 22
Quoted 6 lines
package/dotnet6-runtime/Config.in new file +6
-0+ select BR2_PACKAGE_ICU + select BR2_PACKAGE_LIBCURL + select BR2_PACKAGE_LIBKRB5 + select BR2_PACKAGE_LIBZLIB + select BR2_PACKAGE_LTTNG_LIBUST + select BR2_PACKAGE_OPENSSL
Have you tested that it works (builds) with libressl?
Quoted 25 lines
package/dotnet6-runtime/Config.in new file +9
-0+ help + .NET Core 6 Runtime + + https://dotnet.microsoft.com/download/dotnet-core/6.0 + +comment "dotnet-runtime needs a toolchain w/ glibc or musl and threads" + depends on BR2_PACKAGE_DOTNET6_RUNTIME_ARCH_SUPPORTS + depends on !BR2_TOOLCHAIN_USES_GLIBC && !BR2_TOOLCHAIN_USES_MUSL + depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADSpackage/dotnet6-runtime/dotnet6-runtime.hash new file +3
-0@@ -0,0 +1,3 @@ +# Locally calculated +sha256 a674c44736bf4f4dfafa800899577ef92cb626b9118b5fbdd0182f8c05b5c2e1 dotnet6-runtime-6.0.22.tar.gz +sha256 cfc21f5e8bd655ae997eec916138b707b1d290b83272c02a95c9f821b8c87310 LICENSE.TXTpackage/dotnet6-runtime/dotnet6-runtime.mk new file +1
-0@@ -0,0 +1,77 @@ +################################################################################
package/dotnet6-runtime/dotnet6-runtime.mk line 11
Quoted 10 lines
package/dotnet6-runtime/dotnet6-runtime.mk new file +10
-0+# +# dotnet6-runtime +# +################################################################################ + +DOTNET6_RUNTIME_VERSION = 6.0.22 +DOTNET6_RUNTIME_SITE = $(call github,dotnet,runtime,v$(DOTNET6_RUNTIME_VERSION)) +DOTNET6_RUNTIME_LICENSE = MIT +DOTNET6_RUNTIME_LICENSE_FILES = LICENSE.TXT +DOTNET6_RUNTIME_DEPENDENCIES = host-cmake libzlib openssl libcurl icu libkrb5 lttng-libust
For such a long list, please do one dependency per line.
DOTNET6_RUNTIME_SRC_DEPENDENCIES = \ ...
Also, don't depend on host-cmake instead use $(BR2_CMAKE_HOST_DEPENDENCY)
like cmake-package.
Quoted 11 lines
package/dotnet6-runtime/dotnet6-runtime.mk new file +11
-0+ +ifeq ($(BR2_aarch64),y) +DOTNET6_RUNTIME_ARCH = arm64 +else ifeq ($(BR2_arm),y) +DOTNET6_RUNTIME_ARCH = arm +# Set FPU type +DOTNET6_RUNTIME_ARM_FPU_TYPE = $(BR2_GCC_TARGET_FPU) +ifeq ($(BR2_ARM_FPU_VFPV3)$(BR2_ARM_FPU_VFPV4),y) +# Set 0x07 if 32 fpu registers are used +DOTNET6_RUNTIME_ARM_FPU_CAPABILITY = 0x07 +else ifeq ($(BR2_ARM_FPU_VFPV3D16)$(BR2_ARM_FPU_VFPV4D16),y)
package/dotnet6-runtime/dotnet6-runtime.mk line 32
Quoted 10 lines
package/dotnet6-runtime/dotnet6-runtime.mk new file +10
-0+# Set 0x03 if 32 fpu registers are used +DOTNET6_RUNTIME_ARM_FPU_CAPABILITY = 0x03 +endif +endif + +ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y) +DOTNET6_RUNTIME_TOOLCHAIN_PREFIX = $(GNU_TARGET_NAME) +else +DOTNET6_RUNTIME_TOOLCHAIN_PREFIX = $(TOOLCHAIN_EXTERNAL_PREFIX) +endif
Hm, maybe it's more future-safe to use $(notdir $(TARGET_CROSS))? Of perhapsTARGET_CROSS with the full path just works as well?
package/dotnet6-runtime/dotnet6-runtime.mk line 34
Quoted 2 lines
package/dotnet6-runtime/dotnet6-runtime.mk new file +2
-0+ +ifeq ($(BR2_ENABLE_DEBUG),y)
We changed this into BR2_ENABLE_RUNTIME_DEBUG in cmake-package, should do the
same here.
Quoted 9 lines
package/dotnet6-runtime/dotnet6-runtime.mk new file +9
-0+DOTNET6_RUNTIME_BUILD_CONFIGURATION = Debug +else +DOTNET6_RUNTIME_BUILD_CONFIGURATION = Release +endif + +DOTNET6_RUNTIME_CMAKEARGS = --cmakeargs "-DCMAKE_TOOLCHAIN_FILE="$(HOST_DIR)/share/buildroot/toolchainfile.cmake"" \ + --cmakeargs "-DCMAKE_INSTALL_RUNSTATEDIR="/run"" \ + --cmakeargs "-DCMAKE_CXX_COMPILER_TARGET=$(DOTNET6_RUNTIME_TOOLCHAIN_PREFIX)" \ + --cmakeargs "-DTOOLCHAIN=$(DOTNET6_RUNTIME_TOOLCHAIN_PREFIX)"
package/dotnet6-runtime/dotnet6-runtime.mk line 53
Quoted 10 lines
package/dotnet6-runtime/dotnet6-runtime.mk new file +10
-0+ +# Append FPU specific defines +ifeq ($(BR2_arm),y) + DOTNET6_RUNTIME_CMAKEARGS += \ + --cmakeargs "-DCLR_ARM_FPU_TYPE=$(DOTNET6_RUNTIME_ARM_FPU_TYPE)" \ + --cmakeargs "-DCLR_ARM_FPU_CAPABILITY=$(DOTNET6_RUNTIME_ARM_FPU_CAPABILITY)" +endif + +define DOTNET6_RUNTIME_BUILD_CMDS + cd $(@D) && PATH=$(BR_PATH) ROOTFS_DIR=$(HOST_DIR) \
ROOTFS_DIR=$(HOST_DIR) sounds suspicious... Are you sure that that is correct?
Not STAGING_DIR or TARGET_DIR?
Quoted 14 lines
package/dotnet6-runtime/dotnet6-runtime.mk new file +14
-0+ $(SHELL) ./build.sh --subset clr.jit+clr.runtime+libs --verbosity diag \ + --arch $(DOTNET6_RUNTIME_ARCH) --gcc --cross --skipcrossarchnative \ + --configuration $(DOTNET6_RUNTIME_BUILD_CONFIGURATION) \ + $(DOTNET6_RUNTIME_CMAKEARGS) +endef + +define DOTNET6_RUNTIME_INSTALL_TARGET_CMDS + # Copy all .dll libraries to target directory + cp -Rf $(@D)/artifacts/bin/testhost/net6.0-Linux-$(DOTNET6_RUNTIME_BUILD_CONFIGURATION)-$(DOTNET6_RUNTIME_ARCH)/. \ + $(TARGET_DIR)/usr/share/dotnet + # Remove all .dbg, .pdb, .h, .a, .xml files from target + find $(TARGET_DIR)/usr/share/dotnet/ \ + -type f \( -name "*.dbg" -o -name "*.pdb" -o -name "*.h" \ + -o -name "*.a" -o -name "*.xml" \) -delete
package/dotnet6-runtime/dotnet6-runtime.mk line 77
Quoted 10 lines
package/dotnet6-runtime/dotnet6-runtime.mk new file +10
-0+ + # Create /etc/dotnet/install_location file to point to dotnet + mkdir -p $(TARGET_DIR)/etc/dotnet + echo /usr/share/dotnet > $(TARGET_DIR)/etc/dotnet/install_location + # Export dotnet to PATH and libraries to LD_LIBRARY_PATH + $(INSTALL) -m 0755 -D $(DOTNET6_RUNTIME_PKGDIR)/dotnet6-runtime.sh \ + $(TARGET_DIR)/etc/profile.d/dotnet6-runtime.sh +endef + +$(eval $(generic-package))
I expect that you can't simply bypass the build.sh script and use
cmake-package directly?
Regards,
Arnout
package/dotnet6-runtime/dotnet6-runtime.sh line 2
Quoted 8 lines
package/dotnet6-runtime/dotnet6-runtime.sh new file +2
-0@@ -0,0 +1,2 @@ +export PATH=$PATH:/usr/share/dotnet +export LD_LIBRARY_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/6.0.16
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot