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

Add initial support for FreeBSD.arm64 #71486

Merged
merged 29 commits into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b2d90fd
changes to compile runtime under FreeBSD ARM64 host
sec Jun 29, 2022
f333fd0
TOOLSET_PREFIX for FreeBSD host set to llvm during crossbuild
sec Jun 29, 2022
a4b266d
Detect FreeBSD amd64 or aarch64 message
sec Jun 29, 2022
1a6d288
Fix gen-dactable-rva.sh padding zeros
Jun 30, 2022
3f2e848
cross build options for FreeBSD arm64 for mono
Jun 30, 2022
8300f7c
Merge branch 'main' into freebsd.arm64
sec Jun 30, 2022
60ab856
Revert eng/native/configuretools.cmake
Jun 30, 2022
c0c5dea
Try to better detect host arch under FreeBSD
Jun 30, 2022
001bb3d
Indent
Jun 30, 2022
5b623a2
Don't pad DAC_TABLE_RVA
Jun 30, 2022
54d0412
Comment update
Jun 30, 2022
9c8775d
Add freebsd-arm64 RIDs, enable CG2 package generation for FreeBSD builds
Jun 30, 2022
edf36ff
Extra condition for mono build
Jun 30, 2022
951c92a
Added targetos to crossgen2 command during build
sec Jul 5, 2022
98d39cd
Add targetos along with targetarch for crossgen2 commands
sec Jul 5, 2022
88b8895
Merge branch 'dotnet:main' into freebsd.arm64
sec Jul 6, 2022
69a5c15
Typo fixed in comment
sec Jul 7, 2022
ed3368c
Set Cpsr to gp_spsr for FreeBSD/aarch64 (still crashing exception
sec Jul 7, 2022
e1aa560
Merge branch 'main' into freebsd.arm64
sec Aug 11, 2022
4aef1fb
Fix mono configure/build CPU_COUNT for FreeBSD
sec Aug 14, 2022
6575aee
Merge branch 'main' into freebsd.arm64
sec Sep 19, 2022
723ec0b
Merge branch 'main' into freebsd.arm64
sec Oct 20, 2022
48fa1fa
Merge branch 'main' into freebsd.arm64
sec Nov 9, 2022
6f07838
Merge branch 'main' into freebsd.arm64
sec Dec 5, 2022
82139da
Use check_symbol_exists for HAVE_GNU_CPU_COUNT check
sec Dec 5, 2022
3362c01
Merge branch 'main' into freebsd.arm64
sec Dec 21, 2022
14a6f04
fix cross compile error
sec Dec 21, 2022
1303ab7
Merge branch 'main' into freebsd.arm64
sec Jan 5, 2023
e499941
Fix build error with targetos
sec Jan 7, 2023
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
8 changes: 7 additions & 1 deletion eng/native/configurecompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,13 @@ if (CLR_CMAKE_HOST_UNIX)
clr_unknown_arch()
endif()
elseif(CLR_CMAKE_HOST_FREEBSD)
message("Detected FreeBSD amd64")
if(CLR_CMAKE_HOST_UNIX_ARM64)
message("Detected FreeBSD aarch64")
elseif(CLR_CMAKE_HOST_UNIX_AMD64)
message("Detected FreeBSD amd64")
else()
message(FATAL_ERROR "Unsupported FreeBSD architecture")
endif()
elseif(CLR_CMAKE_HOST_NETBSD)
message("Detected NetBSD amd64")
elseif(CLR_CMAKE_HOST_SUNOS)
Expand Down
8 changes: 7 additions & 1 deletion eng/native/configureplatform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,13 @@ endif(CLR_CMAKE_HOST_OS STREQUAL Android)

if(CLR_CMAKE_HOST_OS STREQUAL FreeBSD)
set(CLR_CMAKE_HOST_UNIX 1)
set(CLR_CMAKE_HOST_UNIX_AMD64 1)
if (CMAKE_SYSTEM_PROCESSOR STREQUAL amd64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64)
set(CLR_CMAKE_HOST_UNIX_AMD64 1)
elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL arm64)
set(CLR_CMAKE_HOST_UNIX_ARM64 1)
else()
clr_unknown_arch()
endif()
set(CLR_CMAKE_HOST_FREEBSD 1)
endif(CLR_CMAKE_HOST_OS STREQUAL FreeBSD)

Expand Down
1 change: 1 addition & 0 deletions src/coreclr/crossgen-corelib.proj
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
<CrossGenDllCmd>$(CrossGenDllCmd) -o:$(CoreLibOutputPath)</CrossGenDllCmd>
<CrossGenDllCmd>$(CrossGenDllCmd) -r:$([MSBuild]::NormalizePath('$(BinDir)', 'IL', '*.dll'))</CrossGenDllCmd>
<CrossGenDllCmd>$(CrossGenDllCmd) --targetarch:$(TargetArchitecture)</CrossGenDllCmd>
<CrossGenDllCmd>$(CrossGenDllCmd) --targetos:$(TargetOS)</CrossGenDllCmd>
<CrossGenDllCmd Condition="'$(UsingToolIbcOptimization)' != 'true' and '$(EnableNgenOptimization)' == 'true'">$(CrossGenDllCmd) -m:$(MergedMibcPath) --embed-pgo-data</CrossGenDllCmd>
<CrossGenDllCmd>$(CrossGenDllCmd) -O</CrossGenDllCmd>
<CrossGenDllCmd Condition="'$(Configuration)' == 'Debug' or '$(Configuration)' == 'Checked'">$(CrossGenDllCmd) --verify-type-and-field-layout</CrossGenDllCmd>
Expand Down
2 changes: 2 additions & 0 deletions src/coreclr/inc/crosscomp.h
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,8 @@ typedef struct _T_KNONVOLATILE_CONTEXT_POINTERS {
#define DAC_CS_NATIVE_DATA_SIZE 12
#elif defined(TARGET_FREEBSD) && defined(TARGET_AMD64)
#define DAC_CS_NATIVE_DATA_SIZE 24
#elif defined(TARGET_FREEBSD) && defined(TARGET_ARM64)
#define DAC_CS_NATIVE_DATA_SIZE 24
#elif defined(TARGET_LINUX) && defined(TARGET_ARM)
#define DAC_CS_NATIVE_DATA_SIZE 80
#elif defined(TARGET_LINUX) && defined(TARGET_ARM64)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ The .NET Foundation licenses this file to you under the MIT license.
<IlcArg Include="@(MibcFile->'--mibc:%(Identity)')" />
<IlcArg Condition="$(IlcGenerateMetadataLog) == 'true'" Include="--metadatalog:$(NativeIntermediateOutputPath)%(ManagedBinary.Filename).metadata.csv" />
<IlcArg Condition="$(TargetArchitecture) != ''" Include="--targetarch:$(TargetArchitecture)" />
<IlcArg Condition="$(TargetOS) != ''" Include="--targetos:$(TargetOS)" />
<IlcArg Condition="$(IlcMultiModule) == 'true'" Include="--multifile" />
<IlcArg Condition="$(IlcMultiModule) != 'true' and '$(IlcDehydrate)' != 'false' and '$(ControlFlowGuard)' != 'Guard'" Include="--dehydrate" />
<IlcArg Condition="$(Optimize) == 'true'" Include="-O" />
Expand Down
2 changes: 2 additions & 0 deletions src/coreclr/pal/inc/pal.h
Original file line number Diff line number Diff line change
Expand Up @@ -2619,6 +2619,8 @@ PALIMPORT BOOL PALAPI PAL_GetUnwindInfoSize(SIZE_T baseAddress, ULONG64 ehFrameH
#define PAL_CS_NATIVE_DATA_SIZE 12
#elif defined(__FreeBSD__) && defined(__x86_64__)
#define PAL_CS_NATIVE_DATA_SIZE 24
#elif defined(__FreeBSD__) && defined(HOST_ARM64)
#define PAL_CS_NATIVE_DATA_SIZE 24
#elif defined(__linux__) && defined(HOST_ARM)
#define PAL_CS_NATIVE_DATA_SIZE 80
#elif defined(__linux__) && defined(HOST_ARM64)
Expand Down
8 changes: 7 additions & 1 deletion src/coreclr/pal/src/configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,13 @@ elseif(CLR_CMAKE_TARGET_FREEBSD)
set(PAL_PT_READ_D PT_READ_D)
set(PAL_PT_WRITE_D PT_WRITE_D)
set(HAS_FTRUNCATE_LENGTH_ISSUE 0)
set(BSD_REGS_STYLE "((reg).r_##rr)")
if (CLR_CMAKE_HOST_ARCH_AMD64)
set(BSD_REGS_STYLE "((reg).r_##rr)")
elseif(CLR_CMAKE_HOST_ARCH_ARM64)
set(BSD_REGS_STYLE "((reg).rr)")
else()
message(FATAL_ERROR "Unknown FreeBSD architecture")
endif()
set(HAVE_SCHED_OTHER_ASSIGNABLE 1)
elseif(CLR_CMAKE_TARGET_NETBSD)
set(DEADLOCK_WHEN_THREAD_IS_SUSPENDED_WHILE_BLOCKED_ON_MUTEX 0)
Expand Down
36 changes: 36 additions & 0 deletions src/coreclr/pal/src/exception/seh-unwind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,42 @@ enum
ASSIGN_REG(R29) \
ASSIGN_REG(R30) \
ASSIGN_REG(R31)
#elif (defined(HOST_ARM64) && defined(TARGET_FREEBSD))
#define ASSIGN_UNWIND_REGS \
ASSIGN_REG(X0) \
ASSIGN_REG(X1) \
ASSIGN_REG(X2) \
ASSIGN_REG(X3) \
ASSIGN_REG(X4) \
ASSIGN_REG(X5) \
ASSIGN_REG(X6) \
ASSIGN_REG(X7) \
ASSIGN_REG(X8) \
ASSIGN_REG(X9) \
ASSIGN_REG(X10) \
ASSIGN_REG(X11) \
ASSIGN_REG(X12) \
ASSIGN_REG(X13) \
ASSIGN_REG(X14) \
ASSIGN_REG(X15) \
ASSIGN_REG(X16) \
ASSIGN_REG(X17) \
ASSIGN_REG(X18) \
ASSIGN_REG(X19) \
ASSIGN_REG(X20) \
ASSIGN_REG(X21) \
ASSIGN_REG(X22) \
ASSIGN_REG(X23) \
ASSIGN_REG(X24) \
ASSIGN_REG(X25) \
ASSIGN_REG(X26) \
ASSIGN_REG(X27) \
ASSIGN_REG(X28) \
ASSIGN_REG(Lr) \
ASSIGN_REG(Sp) \
ASSIGN_REG(Pc) \
ASSIGN_REG(Fp) \
ASSIGN_REG(Cpsr)
#else
#error unsupported architecture
#endif
Expand Down
93 changes: 92 additions & 1 deletion src/coreclr/pal/src/include/pal/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,57 @@ inline void *FPREG_Xstate_Ymmh(const ucontext_t *uc)

#if defined(HOST_ARM64)

#ifndef TARGET_OSX
#if defined(TARGET_FREEBSD)

#define MCREG_X0(mc) (mc.mc_gpregs.gp_x[0])
#define MCREG_X1(mc) (mc.mc_gpregs.gp_x[1])
#define MCREG_X2(mc) (mc.mc_gpregs.gp_x[2])
#define MCREG_X3(mc) (mc.mc_gpregs.gp_x[3])
#define MCREG_X4(mc) (mc.mc_gpregs.gp_x[4])
#define MCREG_X5(mc) (mc.mc_gpregs.gp_x[5])
#define MCREG_X6(mc) (mc.mc_gpregs.gp_x[6])
#define MCREG_X7(mc) (mc.mc_gpregs.gp_x[7])
#define MCREG_X8(mc) (mc.mc_gpregs.gp_x[8])
#define MCREG_X9(mc) (mc.mc_gpregs.gp_x[9])
#define MCREG_X10(mc) (mc.mc_gpregs.gp_x[10])
#define MCREG_X11(mc) (mc.mc_gpregs.gp_x[11])
#define MCREG_X12(mc) (mc.mc_gpregs.gp_x[12])
#define MCREG_X13(mc) (mc.mc_gpregs.gp_x[13])
#define MCREG_X14(mc) (mc.mc_gpregs.gp_x[14])
#define MCREG_X15(mc) (mc.mc_gpregs.gp_x[15])
#define MCREG_X16(mc) (mc.mc_gpregs.gp_x[16])
#define MCREG_X17(mc) (mc.mc_gpregs.gp_x[17])
#define MCREG_X18(mc) (mc.mc_gpregs.gp_x[18])
#define MCREG_X19(mc) (mc.mc_gpregs.gp_x[19])
#define MCREG_X20(mc) (mc.mc_gpregs.gp_x[20])
#define MCREG_X21(mc) (mc.mc_gpregs.gp_x[21])
#define MCREG_X22(mc) (mc.mc_gpregs.gp_x[22])
#define MCREG_X23(mc) (mc.mc_gpregs.gp_x[23])
#define MCREG_X24(mc) (mc.mc_gpregs.gp_x[24])
#define MCREG_X25(mc) (mc.mc_gpregs.gp_x[25])
#define MCREG_X26(mc) (mc.mc_gpregs.gp_x[26])
#define MCREG_X27(mc) (mc.mc_gpregs.gp_x[27])
#define MCREG_X28(mc) (mc.mc_gpregs.gp_x[28])

#define MCREG_Cpsr(mc) (mc.mc_gpregs.gp_spsr)
#define MCREG_Lr(mc) (mc.mc_gpregs.gp_lr)
#define MCREG_Sp(mc) (mc.mc_gpregs.gp_sp)
#define MCREG_Pc(mc) (mc.mc_gpregs.gp_elr)
#define MCREG_Fp(mc) (mc.mc_gpregs.gp_x[29])

inline
struct fpregs* GetNativeSigSimdContext(native_context_t *mc)
{
return &(mc->uc_mcontext.mc_fpregs);
}

inline
const struct fpregs* GetConstNativeSigSimdContext(const native_context_t *mc)
{
return GetNativeSigSimdContext(const_cast<native_context_t*>(mc));
}

#elif !defined(TARGET_OSX) // TARGET_FREEBSD

#define MCREG_X0(mc) ((mc).regs[0])
#define MCREG_X1(mc) ((mc).regs[1])
Expand Down Expand Up @@ -957,6 +1007,8 @@ const VfpSigFrame* GetConstNativeSigSimdContext(const native_context_t *mc)

#ifdef HOST_64BIT

#ifdef HOST_AMD64

#define BSDREG_Rbx(reg) BSD_REGS_STYLE(reg,RBX,rbx)
#define BSDREG_Rcx(reg) BSD_REGS_STYLE(reg,RCX,rcx)
#define BSDREG_Rdx(reg) BSD_REGS_STYLE(reg,RDX,rdx)
Expand All @@ -978,6 +1030,45 @@ const VfpSigFrame* GetConstNativeSigSimdContext(const native_context_t *mc)
#define BSDREG_R15(reg) BSD_REGS_STYLE(reg,R15,r15)
#define BSDREG_EFlags(reg) BSD_REGS_STYLE(reg,RFLAGS,rflags)

#elif defined(HOST_ARM64)

#define BSDREG_X0(reg) BSD_REGS_STYLE(reg,X[0],x[0])
#define BSDREG_X1(reg) BSD_REGS_STYLE(reg,X[1],x[1])
#define BSDREG_X2(reg) BSD_REGS_STYLE(reg,X[2],x[2])
#define BSDREG_X3(reg) BSD_REGS_STYLE(reg,X[3],x[3])
#define BSDREG_X4(reg) BSD_REGS_STYLE(reg,X[4],x[4])
#define BSDREG_X5(reg) BSD_REGS_STYLE(reg,X[5],x[5])
#define BSDREG_X6(reg) BSD_REGS_STYLE(reg,X[6],x[6])
#define BSDREG_X7(reg) BSD_REGS_STYLE(reg,X[7],x[7])
#define BSDREG_X8(reg) BSD_REGS_STYLE(reg,X[8],x[8])
#define BSDREG_X9(reg) BSD_REGS_STYLE(reg,X[9],x[9])
#define BSDREG_X10(reg) BSD_REGS_STYLE(reg,X[10],x[10])
#define BSDREG_X11(reg) BSD_REGS_STYLE(reg,X[11],x[11])
#define BSDREG_X12(reg) BSD_REGS_STYLE(reg,X[12],x[12])
#define BSDREG_X13(reg) BSD_REGS_STYLE(reg,X[13],x[13])
#define BSDREG_X14(reg) BSD_REGS_STYLE(reg,X[14],x[14])
#define BSDREG_X15(reg) BSD_REGS_STYLE(reg,X[15],x[15])
#define BSDREG_X16(reg) BSD_REGS_STYLE(reg,X[16],x[16])
#define BSDREG_X17(reg) BSD_REGS_STYLE(reg,X[17],x[17])
#define BSDREG_X18(reg) BSD_REGS_STYLE(reg,X[18],x[18])
#define BSDREG_X19(reg) BSD_REGS_STYLE(reg,X[19],x[19])
#define BSDREG_X20(reg) BSD_REGS_STYLE(reg,X[20],x[20])
#define BSDREG_X21(reg) BSD_REGS_STYLE(reg,X[21],x[21])
#define BSDREG_X22(reg) BSD_REGS_STYLE(reg,X[22],x[22])
#define BSDREG_X23(reg) BSD_REGS_STYLE(reg,X[23],x[23])
#define BSDREG_X24(reg) BSD_REGS_STYLE(reg,X[24],x[24])
#define BSDREG_X25(reg) BSD_REGS_STYLE(reg,X[25],x[25])
#define BSDREG_X26(reg) BSD_REGS_STYLE(reg,X[26],x[26])
#define BSDREG_X27(reg) BSD_REGS_STYLE(reg,X[27],x[27])
#define BSDREG_X28(reg) BSD_REGS_STYLE(reg,X[28],x[28])
#define BSDREG_Pc(reg) BSD_REGS_STYLE(reg,Elr,elr)
#define BSDREG_Fp(reg) BSD_REGS_STYLE(reg,X[29],x[29])
#define BSDREG_Sp(reg) BSD_REGS_STYLE(reg,Sp,sp)
#define BSDREG_Lr(reg) BSD_REGS_STYLE(reg,Lr,lr)
#define BSDREG_Cpsr(reg) BSD_REGS_STYLE(reg,Spsr,spsr)

#endif // HOST_ARM64

#else // HOST_64BIT

#define BSDREG_Ebx(reg) BSD_REGS_STYLE(reg,EBX,ebx)
Expand Down
22 changes: 22 additions & 0 deletions src/coreclr/pal/src/thread/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,17 @@ void CONTEXTToNativeContext(CONST CONTEXT *lpContext, native_context_t *native)
{
*(NEON128*) &fp->__v[i] = lpContext->V[i];
}
#elif defined(TARGET_FREEBSD)
struct fpregs* fp = GetNativeSigSimdContext(native);
if (fp)
{
fp->fp_sr = lpContext->Fpsr;
fp->fp_cr = lpContext->Fpcr;
for (int i = 0; i < 32; i++)
{
*(NEON128*) &fp->fp_q[i] = lpContext->V[i];
}
}
#else // TARGET_OSX
fpsimd_context* fp = GetNativeSigSimdContext(native);
if (fp)
Expand Down Expand Up @@ -777,6 +788,17 @@ void CONTEXTFromNativeContext(const native_context_t *native, LPCONTEXT lpContex
{
lpContext->V[i] = *(NEON128*) &fp->__v[i];
}
#elif defined(TARGET_FREEBSD)
const struct fpregs* fp = GetConstNativeSigSimdContext(native);
if (fp)
{
lpContext->Fpsr = fp->fp_sr;
lpContext->Fpcr = fp->fp_cr;
for (int i = 0; i < 32; i++)
{
lpContext->V[i] = *(NEON128*) &fp->fp_q[i];
}
}
#else // TARGET_OSX
const fpsimd_context* fp = GetConstNativeSigSimdContext(native);
if (fp)
Expand Down
7 changes: 3 additions & 4 deletions src/coreclr/pal/tools/gen-dactable-rva.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ fi
while read -r line; do
if [[ "$line" =~ g_dacTable ]]; then

# Parse line for DAC relative address, if length of value is:
# * shorter than 16, zero pad.
# * longer than 16, capture last 16 characters.
# Parse line for DAC relative address. If length of value is longer than 16,
# capture the last 16 characters.
#
array=($line)
value="$(printf "%016s\n" ${array[2]:(${#array[2]} > 16 ? -16 : 0)})"
value="$(printf "%s\n" ${array[2]:(${#array[2]} > 16 ? -16 : 0)})"

# Write line to file and exit
printf "#define DAC_TABLE_RVA 0x%s\n" "$value" > "$2"
Expand Down
2 changes: 2 additions & 0 deletions src/coreclr/tools/Common/CommandLineHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ public static TargetOS GetTargetOS(string token)
return TargetOS.Linux;
else if (token.Equals("osx", StringComparison.OrdinalIgnoreCase))
return TargetOS.OSX;
else if (token.Equals("freebsd", StringComparison.OrdinalIgnoreCase))
return TargetOS.FreeBSD;

throw new CommandLineException($"Target OS '{token}' is not supported");
}
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/tools/aot/crossgen2/crossgen2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<NativeAotSupported Condition="'$(DotNetBuildFromSource)' == 'true'">false</NativeAotSupported>
<!-- Trimming is not currently working, but set the appropriate feature flags for NativeAOT -->
<PublishTrimmed Condition="'$(NativeAotSupported)' == 'true'">true</PublishTrimmed>
<RuntimeIdentifiers Condition="'$(_IsPublishing)' != 'true' and '$(DotNetBuildFromSource)' != 'true'">linux-x64;linux-musl-x64;linux-arm;linux-musl-arm;linux-arm64;linux-musl-arm64;freebsd-x64;osx-x64;osx-arm64;win-x64;win-x86;win-arm64;win-arm</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="'$(_IsPublishing)' != 'true' and '$(DotNetBuildFromSource)' != 'true'">linux-x64;linux-musl-x64;linux-arm;linux-musl-arm;linux-arm64;linux-musl-arm64;freebsd-x64;freebsd-arm64;osx-x64;osx-arm64;win-x64;win-x86;win-arm64;win-arm</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="'$(DotNetBuildFromSource)' == 'true'">$(PackageRID)</RuntimeIdentifiers>
<SelfContained>false</SelfContained>
<SelfContained Condition="'$(_IsPublishing)' == 'true'">true</SelfContained>
Expand Down
2 changes: 1 addition & 1 deletion src/installer/pkg/projects/netcoreappRIDs.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<Platform>arm64</Platform>
</OfficialBuildRID>
<!-- Not currently built by CoreFX. -->
<!-- <OfficialBuildRID Include="freebsd-x64" /> -->
<!-- <OfficialBuildRID Include="netbsd-x64" /> -->
<!-- <OfficialBuildRID Include="illumos-x64" /> -->
<!-- <OfficialBuildRID Include="solaris-x64" /> -->
Expand Down Expand Up @@ -53,6 +52,7 @@
built during official builds, however we wish to include them
in our runtime.json to enable others to provide them. -->
<UnofficialBuildRID Include="freebsd-x64" />
<UnofficialBuildRID Include="freebsd-arm64" />
<UnofficialBuildRID Include="tizen.4.0.0-armel">
<Platform>armel</Platform>
</UnofficialBuildRID>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
<Import Project="Sdk.props" Sdk="Microsoft.DotNet.SharedFramework.Sdk" />

<PropertyGroup>
<!-- Crossgen is not used for Mono, and does not currently create freebsd packages -->
<SkipBuild Condition="'$(RuntimeFlavor)' == 'Mono' or '$(RuntimeIdentifier)' == 'freebsd-x64'">true</SkipBuild>
Copy link
Member

Choose a reason for hiding this comment

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

@agocke, do you remember why we have duplicate NativeAotSupported properties with different conditions:

<!-- Can't use NativeAOT in source build yet https://github.com/dotnet/runtime/issues/66859 and we
don't want to ship using NativeAOT on MacOS -->
<NativeAotSupported Condition="'$(DotNetBuildFromSource)' == 'true' or '$(TargetOS)' == 'osx'">false</NativeAotSupported>
and
<NativeAotSupported Condition="('$(TargetOS)' == 'windows' or '$(TargetOS)' == 'linux' or '$(TargetOS)' == 'OSX') and ('$(TargetArchitecture)' == 'x64' or '$(TargetArchitecture)' == 'arm64') and ('$(TargetOS)' != 'OSX' or '$(TargetArchitecture)' != 'arm64')">true</NativeAotSupported>

(Subsets.props is inherited by everything which imports Directory.Build.props at repo root)

Can we deduplicate them?

<!-- Crossgen is not used for Mono -->
<SkipBuild Condition="'$(RuntimeFlavor)' == 'Mono'">true</SkipBuild>
<PlatformPackageType>ToolPack</PlatformPackageType>
<SharedFrameworkName>$(SharedFrameworkName).Crossgen2</SharedFrameworkName>
<PgoSuffix Condition="'$(PgoInstrument)' != ''">.PGO</PgoSuffix>
<OverridePackageId>$(SharedFrameworkName)$(PgoSuffix).$(RuntimeIdentifier)</OverridePackageId>
<ArchiveName>dotnet-crossgen2</ArchiveName>
<SharedFrameworkHostFileNameOverride>crossgen2</SharedFrameworkHostFileNameOverride>
<!-- Build this pack for any RID if building from source. Otherwise, only build select RIDs. -->
<RuntimeIdentifiers Condition="'$(DotNetBuildFromSource)' != 'true'">linux-x64;linux-musl-x64;linux-arm;linux-musl-arm;linux-arm64;linux-musl-arm64;freebsd-x64;osx-x64;osx-arm64;win-x64;win-x86;win-arm64;win-arm</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="'$(DotNetBuildFromSource)' != 'true'">linux-x64;linux-musl-x64;linux-arm;linux-musl-arm;linux-arm64;linux-musl-arm64;freebsd-x64;freebsd-arm64;osx-x64;osx-arm64;win-x64;win-x86;win-arm64;win-arm</RuntimeIdentifiers>
<GenerateInstallers>false</GenerateInstallers>
<HostJsonTargetPath>tools/</HostJsonTargetPath>
<PermitDllAndExeFilesLackingFileVersion>true</PermitDllAndExeFilesLackingFileVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

<ItemGroup>
<PublishReadyToRunCrossgen2ExtraArgsList Include="--targetarch:$(TargetArchitecture)"/>
<PublishReadyToRunCrossgen2ExtraArgsList Include="--targetos:$(TargetOS)"/>

<!-- Only use mibc files if UsingToolIbcOptimization is false. Allows enabling/disabling using ibc instead of mibc data -->
<PublishReadyToRunCrossgen2ExtraArgsList Condition="'$(UsingToolIbcOptimization)' != 'true' and '$(EnableNgenOptimization)' == 'true'" Include="@(OptimizationMibcFiles->'-m:%(Identity)')"/>
Expand Down
Loading