Skip to content

Commit f47906c

Browse files
committed
addpkg(main): dotnet10.0
1 parent 71a6404 commit f47906c

28 files changed

Lines changed: 1394 additions & 8 deletions

packages/dotnet-host/build.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ TERMUX_PKG_HOMEPAGE=https://dotnet.microsoft.com/en-us/
22
TERMUX_PKG_DESCRIPTION="A metapackage for .NET Host"
33
TERMUX_PKG_LICENSE="Public Domain"
44
TERMUX_PKG_MAINTAINER="@truboxl"
5-
TERMUX_PKG_VERSION="9.0"
6-
TERMUX_PKG_REVISION=2
7-
TERMUX_PKG_DEPENDS="dotnet-host-9.0 | dotnet-host-8.0"
8-
TERMUX_PKG_ANTI_BUILD_DEPENDS="dotnet-host-9.0, dotnet-host-8.0"
5+
TERMUX_PKG_VERSION="10.0"
6+
TERMUX_PKG_DEPENDS="dotnet-host-10.0 | dotnet-host-9.0 | dotnet-host-8.0"
7+
TERMUX_PKG_ANTI_BUILD_DEPENDS="dotnet-host-10.0, dotnet-host-9.0, dotnet-host-8.0"
98
TERMUX_PKG_AUTO_UPDATE=false
109
TERMUX_PKG_METAPACKAGE=true
1110
TERMUX_PKG_SKIP_SRC_EXTRACT=true
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
diff --git a/src/runtime/src/native/libs/CMakeLists.txt b/src/runtime/src/native/libs/CMakeLists.txt
2+
index cf8b2b47f..2aee2d51d 100644
3+
--- a/src/runtime/src/native/libs/CMakeLists.txt
4+
+++ b/src/runtime/src/native/libs/CMakeLists.txt
5+
@@ -156,12 +156,9 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI)
6+
endif ()
7+
8+
add_subdirectory(System.Security.Cryptography.Native.Apple)
9+
- elseif (CLR_CMAKE_TARGET_ANDROID AND NOT FORCE_ANDROID_OPENSSL)
10+
- add_subdirectory(System.Security.Cryptography.Native.Android)
11+
- elseif (FORCE_ANDROID_OPENSSL)
12+
- add_subdirectory(System.Security.Cryptography.Native)
13+
else ()
14+
add_subdirectory(System.Net.Security.Native)
15+
add_subdirectory(System.Security.Cryptography.Native)
16+
+ add_subdirectory(System.Security.Cryptography.Native.Android)
17+
endif ()
18+
endif ()
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Always provide memfd_create syscall fallback on Linux/Android.
2+
3+
The iltools/cdac host build in .NET 10 compiles doublemapping.cpp with
4+
TARGET_LINUX defined but not TARGET_ANDROID. When the host glibc defines
5+
MFD_CLOEXEC (glibc 2.27+), the original fallback branch doesn't fire,
6+
and memfd_create may not be available as a function if the build uses
7+
the Bionic sysroot. This ensures the syscall wrapper is always provided.
8+
9+
diff --git a/src/runtime/src/coreclr/minipal/Unix/doublemapping.cpp b/src/runtime/src/coreclr/minipal/Unix/doublemapping.cpp
10+
index 205a2cac7..973a696b3 100644
11+
--- a/src/runtime/src/coreclr/minipal/Unix/doublemapping.cpp
12+
+++ b/src/runtime/src/coreclr/minipal/Unix/doublemapping.cpp
13+
@@ -16,13 +16,12 @@
14+
#include <limits.h>
15+
#include <errno.h>
16+
#include <sys/resource.h>
17+
-#if defined(TARGET_LINUX) && !defined(MFD_CLOEXEC)
18+
+#if defined(TARGET_LINUX) || defined(TARGET_ANDROID)
19+
+#if !defined(MFD_CLOEXEC)
20+
#include <linux/memfd.h>
21+
+#endif
22+
#include <sys/syscall.h> // __NR_memfd_create
23+
#define memfd_create(...) syscall(__NR_memfd_create, __VA_ARGS__)
24+
-#elif defined(TARGET_ANDROID)
25+
-#include <sys/syscall.h> // __NR_memfd_create
26+
-#define memfd_create(...) syscall(__NR_memfd_create, __VA_ARGS__)
27+
-#endif // TARGET_LINUX && !MFD_CLOEXEC
28+
+#endif // TARGET_LINUX || TARGET_ANDROID
29+
#include "minipal.h"
30+
#include "minipal/cpufeatures.h"
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
diff --git a/src/runtime/src/native/libs/System.IO.Compression.Native/CMakeLists.txt b/src/runtime/src/native/libs/System.IO.Compression.Native/CMakeLists.txt
2+
index 0adecdad8..7e6a29704 100644
3+
--- a/src/runtime/src/native/libs/System.IO.Compression.Native/CMakeLists.txt
4+
+++ b/src/runtime/src/native/libs/System.IO.Compression.Native/CMakeLists.txt
5+
@@ -73,7 +73,7 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI)
6+
target_include_directories(System.IO.Compression.Native PRIVATE ${BROTLI_INCLUDE_DIRS})
7+
target_link_libraries(System.IO.Compression.Native PRIVATE ${BROTLI_LIBRARIES})
8+
9+
- if (NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_USE_SYSTEM_BROTLI)
10+
+ if (NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_USE_SYSTEM_BROTLI)
11+
set(DEF_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/System.IO.Compression.Native_unixexports.src)
12+
set(EXPORTS_FILE ${CMAKE_CURRENT_BINARY_DIR}/System.IO.Compression.Native.exports)
13+
generate_exports_file(${DEF_SOURCES} ${EXPORTS_FILE})
14+
@@ -153,7 +153,7 @@ else ()
15+
target_link_libraries(System.IO.Compression.Native PUBLIC ${BROTLI_LIBRARIES})
16+
endif ()
17+
18+
- if (NOT GEN_SHARED_LIB AND NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_BROWSER AND NOT CLR_CMAKE_TARGET_WASI)
19+
+ if (NOT GEN_SHARED_LIB AND NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_BROWSER AND NOT CLR_CMAKE_TARGET_WASI)
20+
set(NATIVECOMPRESSION_SOURCES ${NATIVECOMPRESSION_SOURCES} entrypoints.c)
21+
endif ()
22+
23+
diff --git a/src/runtime/src/native/libs/System.IO.Compression.Native/extra_libs.cmake b/src/runtime/src/native/libs/System.IO.Compression.Native/extra_libs.cmake
24+
index 03b40533e..6c9d6c1be 100644
25+
--- a/src/runtime/src/native/libs/System.IO.Compression.Native/extra_libs.cmake
26+
+++ b/src/runtime/src/native/libs/System.IO.Compression.Native/extra_libs.cmake
27+
@@ -16,7 +16,7 @@ macro(append_extra_compression_libs NativeLibsExtra)
28+
# 'zlib' represents our in-tree zlib, and is used in all other platforms
29+
# that don't meet any of the previous special requirements, like most
30+
# regular Unix and Windows builds.
31+
- list(APPEND ZLIB_LIBRARIES $<IF:$<BOOL:${CLR_CMAKE_USE_SYSTEM_ZLIB}>,z,zlib>)
32+
+ list(APPEND ZLIB_LIBRARIES $<IF:$<BOOL:${CLR_CMAKE_USE_SYSTEM_ZLIB}>,z,zlib> m)
33+
endif ()
34+
list(APPEND ${NativeLibsExtra} ${ZLIB_LIBRARIES})
35+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Make lttng-ust optional instead of required.
2+
3+
The iltools/cdac host build in .NET 10 goes through coreclr PAL
4+
which checks for lttng-ust-dev. This is not available in the Termux
5+
build container nor on Android. Convert the FATAL_ERROR to a WARNING
6+
so the build can proceed without tracing support.
7+
8+
diff --git a/src/runtime/src/coreclr/pal/src/configure.cmake b/src/runtime/src/coreclr/pal/src/configure.cmake
9+
index 3d89ba2f5..dbce1ce32 100644
10+
--- a/src/runtime/src/coreclr/pal/src/configure.cmake
11+
+++ b/src/runtime/src/coreclr/pal/src/configure.cmake
12+
@@ -926,9 +926,10 @@ elseif(CLR_CMAKE_TARGET_BROWSER)
13+
else() # Anything else is Linux
14+
# LTTNG is not available on Android, so don't error out
15+
if(FEATURE_EVENTSOURCE_XPLAT AND NOT HAVE_LTTNG_TRACEPOINT_H)
16+
- unset(HAVE_LTTNG_TRACEPOINT_H CACHE)
17+
- message(FATAL_ERROR "Cannot find liblttng-ust-dev. Try installing liblttng-ust-dev (or the appropriate packages for your platform)")
18+
+ message(WARNING "Cannot find liblttng-ust-dev, disabling FEATURE_EVENTSOURCE_XPLAT")
19+
+ set(FEATURE_EVENTSOURCE_XPLAT 0)
20+
endif()
21+
+
22+
set(DEADLOCK_WHEN_THREAD_IS_SUSPENDED_WHILE_BLOCKED_ON_MUTEX 0)
23+
set(PAL_PTRACE "ptrace((cmd), (pid), (void*)(addr), (data))")
24+
set(HAVE_SCHED_OTHER_ASSIGNABLE 1)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
diff --git a/src/runtime/src/native/libs/System.Security.Cryptography.Native/opensslshim.c b/src/runtime/src/native/libs/System.Security.Cryptography.Native/opensslshim.c
2+
index d99f9fd91..0caae26d3 100644
3+
--- a/src/runtime/src/native/libs/System.Security.Cryptography.Native/opensslshim.c
4+
+++ b/src/runtime/src/native/libs/System.Security.Cryptography.Native/opensslshim.c
5+
@@ -89,14 +89,6 @@ static void OpenLibraryOnce(void)
6+
DlOpen(soName);
7+
}
8+
9+
-#ifdef TARGET_ANDROID
10+
- if (libssl == NULL)
11+
- {
12+
- // Android OpenSSL has no soname
13+
- DlOpen(LIBNAME);
14+
- }
15+
-#endif
16+
-
17+
if (libssl == NULL)
18+
{
19+
// Prefer OpenSSL 3.x
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
diff --git a/src/runtime/eng/common/cross/toolchain.cmake b/src/runtime/eng/common/cross/toolchain.cmake
2+
index 0ff85cf03..875df5c47 100644
3+
--- a/src/runtime/eng/common/cross/toolchain.cmake
4+
+++ b/src/runtime/eng/common/cross/toolchain.cmake
5+
@@ -36,6 +36,8 @@ if(TARGET_ARCH_NAME STREQUAL "arm")
6+
set(TOOLCHAIN "armv7-alpine-linux-musleabihf")
7+
elseif(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/armv6-alpine-linux-musleabihf)
8+
set(TOOLCHAIN "armv6-alpine-linux-musleabihf")
9+
+ elseif(EXISTS ${CROSS_ROOTFS}/usr/lib/arm-linux-androideabi)
10+
+ set(TOOLCHAIN "armv7-linux-androideabi")
11+
else()
12+
set(TOOLCHAIN "arm-linux-gnueabihf")
13+
endif()
14+
@@ -46,6 +48,8 @@ elseif(TARGET_ARCH_NAME STREQUAL "arm64")
15+
set(CMAKE_SYSTEM_PROCESSOR aarch64)
16+
if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/aarch64-alpine-linux-musl)
17+
set(TOOLCHAIN "aarch64-alpine-linux-musl")
18+
+ elseif(EXISTS ${CROSS_ROOTFS}/usr/lib/aarch64-linux-android)
19+
+ set(TOOLCHAIN "aarch64-linux-android")
20+
elseif(LINUX)
21+
set(TOOLCHAIN "aarch64-linux-gnu")
22+
if(TIZEN)
23+
@@ -85,6 +89,8 @@ elseif(TARGET_ARCH_NAME STREQUAL "riscv64")
24+
set(CMAKE_SYSTEM_PROCESSOR riscv64)
25+
if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/riscv64-alpine-linux-musl)
26+
set(TOOLCHAIN "riscv64-alpine-linux-musl")
27+
+ elseif(EXISTS ${CROSS_ROOTFS}/usr/lib/riscv64-linux-android)
28+
+ set(TOOLCHAIN "riscv64-linux-android")
29+
else()
30+
set(TOOLCHAIN "riscv64-linux-gnu")
31+
if(TIZEN)
32+
@@ -102,6 +108,8 @@ elseif(TARGET_ARCH_NAME STREQUAL "x64")
33+
set(CMAKE_SYSTEM_PROCESSOR x86_64)
34+
if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/x86_64-alpine-linux-musl)
35+
set(TOOLCHAIN "x86_64-alpine-linux-musl")
36+
+ elseif(EXISTS ${CROSS_ROOTFS}/usr/lib/x86_64-linux-android)
37+
+ set(TOOLCHAIN "x86_64-linux-android")
38+
elseif(LINUX)
39+
set(TOOLCHAIN "x86_64-linux-gnu")
40+
if(TIZEN)
41+
@@ -118,6 +126,8 @@ elseif(TARGET_ARCH_NAME STREQUAL "x86")
42+
set(CMAKE_SYSTEM_PROCESSOR i686)
43+
if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/i586-alpine-linux-musl)
44+
set(TOOLCHAIN "i586-alpine-linux-musl")
45+
+ elseif(EXISTS ${CROSS_ROOTFS}/usr/lib/i686-linux-android)
46+
+ set(TOOLCHAIN "i686-linux-android")
47+
else()
48+
set(TOOLCHAIN "i686-linux-gnu")
49+
endif()
50+
@@ -230,6 +240,7 @@ else()
51+
set(CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN "${CROSS_ROOTFS}/usr")
52+
set(CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN "${CROSS_ROOTFS}/usr")
53+
set(CMAKE_ASM_COMPILER_EXTERNAL_TOOLCHAIN "${CROSS_ROOTFS}/usr")
54+
+ include(${CROSS_ROOTFS}/../build/cmake/android.toolchain.cmake)
55+
endif()
56+
57+
# Specify link flags
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Description: Set TargetsLinuxBionic from TargetRid and override DefaultSubsets for source-build
2+
When building for linux-bionic via the VMR, TargetOS is 'linux' (not
3+
'linux-bionic'), so TargetsLinuxBionic is never set. This causes two
4+
problems: (1) The Mono native build uses cross/toolchain.cmake which
5+
targets linux-gnu instead of the Android NDK toolchain, causing CRT
6+
link failures (Scrt1.o, crti.o, -lgcc_s not found). (2) The default
7+
subset includes NativeAOT components that set RuntimeFlavor=CoreCLR,
8+
mismatching PrimaryRuntimeFlavor=Mono and breaking tarball packaging.
9+
Fix by deriving TargetsLinuxBionic from TargetRid and adding a
10+
source-build override that uses mono+libs+host+packs (no NativeAOT).
11+
12+
diff --git a/src/runtime/eng/Subsets.props b/src/runtime/eng/Subsets.props
13+
index 5770eec31..a1b2c3d4e 100644
14+
--- a/src/runtime/eng/Subsets.props
15+
+++ b/src/runtime/eng/Subsets.props
16+
@@ -26,6 +26,10 @@
17+
platforms (like s390x) where only Mono is supported. The primary runtime
18+
flavor is used to decide when to build the hosts and installers. -->
19+
<PropertyGroup>
20+
+ <!-- When building from the VMR, TargetOS is 'linux' but TargetRid is 'linux-bionic-*'.
21+
+ Ensure TargetsLinuxBionic is set so the correct subset defaults are used. -->
22+
+ <TargetsLinuxBionic Condition="'$(TargetsLinuxBionic)' != 'true' and $(TargetRid.StartsWith('linux-bionic'))">true</TargetsLinuxBionic>
23+
+
24+
<!-- Determine if the CoreCLR runtime can build/run for the specified target. -->
25+
<_CoreCLRSupportedOS Condition="'$(TargetsMobile)' != 'true' and '$(TargetsLinuxBionic)' != 'true'">true</_CoreCLRSupportedOS>
26+
27+
@@ -77,6 +81,8 @@
28+
<DefaultSubsets Condition="'$(TargetsLinuxBionic)' == 'true' and '$(MonoSupported)' != 'true'">clr.nativeaotruntime+clr.nativeaotlibs+libs+packs</DefaultSubsets>
29+
<!-- In source build, mono is only supported as primary runtime flavor. -->
30+
<DefaultSubsets Condition="'$(DotNetBuildSourceOnly)' == 'true' and '$(PrimaryRuntimeFlavor)' != 'Mono'">clr+libs+tools+host+packs</DefaultSubsets>
31+
+ <!-- For linux-bionic source-build with Mono, skip NativeAOT subsets to keep RuntimeFlavor=Mono. -->
32+
+ <DefaultSubsets Condition="'$(DotNetBuildSourceOnly)' == 'true' and '$(TargetsLinuxBionic)' == 'true' and '$(PrimaryRuntimeFlavor)' == 'Mono'">mono+libs+tools.illink+host+packs</DefaultSubsets>
33+
<DefaultSubsets Condition="'$(DotNetBuildMonoCrossAOT)' == 'true'">mono+packs</DefaultSubsets>
34+
35+
<!-- In the Win-x86 BuildPass2 job in the VMR, we want to build the cross-OS DACs and pack them. -->
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Description: Add prebuilt baseline for Mono LLVM packages
2+
When TargetsLinuxBionic is set, the Mono build initializes LLVM
3+
which downloads prebuilt LLVM packages. The source-build validation
4+
in finish-source-only.proj flags these as new prebuilts not in the
5+
baseline. Add a prebuilt-baseline.xml to whitelist them.
6+
7+
diff --git a/eng/tools/prebuilt-baseline.xml b/eng/tools/prebuilt-baseline.xml
8+
new file mode 100644
9+
index 000000000..000000001
10+
--- /dev/null
11+
+++ b/eng/tools/prebuilt-baseline.xml
12+
@@ -0,0 +1,7 @@
13+
+<UsageData>
14+
+ <Usages>
15+
+ <Usage Id="runtime.placeholder-rid.Microsoft.NETCore.Runtime.Mono.LLVM.Libclang" Version="19.1.0-alpha.1.25461.1" />
16+
+ <Usage Id="runtime.placeholder-rid.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk" Version="19.1.0-alpha.1.25461.1" />
17+
+ <Usage Id="runtime.placeholder-rid.Microsoft.NETCore.Runtime.Mono.LLVM.Tools" Version="19.1.0-alpha.1.25461.1" />
18+
+ </Usages>
19+
+</UsageData>

0 commit comments

Comments
 (0)