Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<TargetArchitecture Condition="'$(TargetArchitecture)' == '' and '$(_hostArch)' == 'arm64'">arm64</TargetArchitecture>
<TargetArchitecture Condition="'$(TargetArchitecture)' == '' and '$(_hostArch)' == 'loongarch64'">loongarch64</TargetArchitecture>
<TargetArchitecture Condition="'$(TargetArchitecture)' == '' and '$(_hostArch)' == 's390x'">s390x</TargetArchitecture>
<TargetArchitecture Condition="'$(TargetArchitecture)' == '' and '$(_hostArch)' == 'ppc64le'">ppc64le</TargetArchitecture>
<TargetArchitecture Condition="'$(TargetArchitecture)' == '' and ('$(TargetOS)' == 'Browser' or '$(RuntimeIdentifier)' == 'browser-wasm')">wasm</TargetArchitecture>
<TargetArchitecture Condition="'$(TargetArchitecture)' == '' and '$(TargetsMobile)' == 'true'">x64</TargetArchitecture>
<TargetArchitecture Condition="'$(TargetArchitecture)' == ''">x64</TargetArchitecture>
Expand Down
2 changes: 1 addition & 1 deletion eng/Subsets.props
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
flavor is used to decide when to build the hosts and installers. -->
<PropertyGroup>
<PrimaryRuntimeFlavor>CoreCLR</PrimaryRuntimeFlavor>
<PrimaryRuntimeFlavor Condition="'$(TargetArchitecture)' == 's390x' or '$(TargetArchitecture)' == 'armv6' or '$(TargetsLinuxBionic)' == 'true'">Mono</PrimaryRuntimeFlavor>
<PrimaryRuntimeFlavor Condition="'$(TargetArchitecture)' == 's390x' or '$(TargetArchitecture)' == 'ppc64le' or '$(TargetArchitecture)' == 'armv6' or '$(TargetsLinuxBionic)' == 'true'">Mono</PrimaryRuntimeFlavor>
</PropertyGroup>

<PropertyGroup>
Expand Down
6 changes: 3 additions & 3 deletions eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
usage()
{
echo "Common settings:"
echo " --arch (-a) Target platform: x86, x64, arm, armv6, armel, arm64, loongarch64, s390x or wasm."
echo " --arch (-a) Target platform: x86, x64, arm, armv6, armel, arm64, loongarch64, s390x, ppc64le or wasm."
echo " [Default: Your machine's architecture.]"
echo " --binaryLog (-bl) Output binary log."
echo " --cross Optional argument to signify cross compilation."
Expand Down Expand Up @@ -206,12 +206,12 @@ while [[ $# > 0 ]]; do
fi
passedArch="$(echo "$2" | tr "[:upper:]" "[:lower:]")"
case "$passedArch" in
x64|x86|arm|armv6|armel|arm64|loongarch64|s390x|wasm)
x64|x86|arm|armv6|armel|arm64|loongarch64|s390x|ppc64le|wasm)
arch=$passedArch
;;
*)
echo "Unsupported target architecture '$2'."
echo "The allowed values are x86, x64, arm, armv6, armel, arm64, loongarch64, s390x, and wasm."
echo "The allowed values are x86, x64, arm, armv6, armel, arm64, loongarch64, s390x, ppc64le and wasm."
exit 1
;;
esac
Expand Down
6 changes: 5 additions & 1 deletion eng/native/build-commons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ usage()
echo ""
echo "Common Options:"
echo ""
echo "BuildArch can be: -arm, -armv6, -armel, -arm64, -loongarch64, -s390x, x64, x86, -wasm"
echo "BuildArch can be: -arm, -armv6, -armel, -arm64, -loongarch64, -s390x, -ppc64le, x64, x86, -wasm"
echo "BuildType can be: -debug, -checked, -release"
echo "-os: target OS (defaults to running OS)"
echo "-bindir: output directory (defaults to $__ProjectRoot/artifacts)"
Expand Down Expand Up @@ -392,6 +392,10 @@ while :; do
__TargetArch=wasm
;;

ppc64le|-ppc64le)
__TargetArch=ppc64le
;;

os|-os)
if [[ -n "$2" ]]; then
__TargetOS="$2"
Expand Down
10 changes: 10 additions & 0 deletions eng/native/configurecompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ elseif (CLR_CMAKE_HOST_ARCH_WASM)
elseif (CLR_CMAKE_HOST_ARCH_MIPS64)
set(ARCH_HOST_NAME mips64)
add_definitions(-DHOST_MIPS64 -DHOST_64BIT=1)
elseif (CLR_CMAKE_HOST_ARCH_POWERPC64)
set(ARCH_HOST_NAME ppc64le)
add_definitions(-DHOST_POWERPC64 -DHOST_64BIT)
else ()
clr_unknown_arch()
endif ()
Expand All @@ -256,6 +259,8 @@ if (CLR_CMAKE_HOST_UNIX)
message("Detected Linux i686")
elseif(CLR_CMAKE_HOST_UNIX_S390X)
message("Detected Linux s390x")
elseif(CLR_CMAKE_HOST_UNIX_POWERPC64)
message("Detected Linux ppc64le")
else()
clr_unknown_arch()
endif()
Expand Down Expand Up @@ -332,6 +337,11 @@ elseif (CLR_CMAKE_TARGET_ARCH_S390X)
set(ARCH_SOURCES_DIR s390x)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:IGNORE_DEFAULT_TARGET_ARCH>>>:TARGET_S390X>)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:IGNORE_DEFAULT_TARGET_ARCH>>>:TARGET_64BIT>)
elseif (CLR_CMAKE_TARGET_ARCH_POWERPC64)
set(ARCH_TARGET_NAME ppc64le)
set(ARCH_SOURCES_DIR ppc64le)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:IGNORE_DEFAULT_TARGET_ARCH>>>:TARGET_POWERPC64>)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:IGNORE_DEFAULT_TARGET_ARCH>>>:TARGET_64BIT>)
elseif (CLR_CMAKE_TARGET_ARCH_WASM)
set(ARCH_TARGET_NAME wasm)
set(ARCH_SOURCES_DIR wasm)
Expand Down
9 changes: 9 additions & 0 deletions eng/native/configureplatform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ if(CLR_CMAKE_HOST_OS STREQUAL Linux)
set(CLR_CMAKE_HOST_UNIX_X86 1)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL s390x)
set(CLR_CMAKE_HOST_UNIX_S390X 1)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL ppc64le)
set(CLR_CMAKE_HOST_UNIX_POWERPC64 1)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL mips64)
set(CLR_CMAKE_HOST_UNIX_MIPS64 1)
else()
Expand Down Expand Up @@ -250,6 +252,9 @@ elseif(CLR_CMAKE_HOST_UNIX_X86)
elseif(CLR_CMAKE_HOST_UNIX_S390X)
set(CLR_CMAKE_HOST_ARCH_S390X 1)
set(CLR_CMAKE_HOST_ARCH "s390x")
elseif(CLR_CMAKE_HOST_UNIX_POWERPC64)
set(CLR_CMAKE_HOST_ARCH_POWERPC64 1)
set(CLR_CMAKE_HOST_ARCH "ppc64le")
elseif(CLR_CMAKE_HOST_BROWSER)
set(CLR_CMAKE_HOST_ARCH_WASM 1)
set(CLR_CMAKE_HOST_ARCH "wasm")
Expand Down Expand Up @@ -303,6 +308,8 @@ if (CLR_CMAKE_TARGET_ARCH STREQUAL x64)
set(ARM_SOFTFP 1)
elseif(CLR_CMAKE_TARGET_ARCH STREQUAL s390x)
set(CLR_CMAKE_TARGET_ARCH_S390X 1)
elseif(CLR_CMAKE_TARGET_ARCH STREQUAL ppc64le)
set(CLR_CMAKE_TARGET_ARCH_POWERPC64 1)
elseif(CLR_CMAKE_TARGET_ARCH STREQUAL wasm)
set(CLR_CMAKE_TARGET_ARCH_WASM 1)
elseif(CLR_CMAKE_TARGET_ARCH STREQUAL mips64)
Expand Down Expand Up @@ -413,6 +420,8 @@ if(CLR_CMAKE_TARGET_UNIX)
set(CLR_CMAKE_TARGET_UNIX_X86 1)
elseif(CLR_CMAKE_TARGET_ARCH STREQUAL s390x)
set(CLR_CMAKE_TARGET_UNIX_S390X 1)
elseif(CLR_CMAKE_TARGET_ARCH STREQUAL ppc64le)
set(CLR_CMAKE_TARGET_UNIX_POWERPC64 1)
elseif(CLR_CMAKE_TARGET_ARCH STREQUAL wasm)
set(CLR_CMAKE_TARGET_UNIX_WASM 1)
elseif(CLR_CMAKE_TARGET_ARCH STREQUAL mips64)
Expand Down
2 changes: 1 addition & 1 deletion eng/native/configuretools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ if(NOT WIN32 AND NOT CLR_CMAKE_TARGET_BROWSER)
if(CLR_CMAKE_TARGET_ANDROID)
set(TOOLSET_PREFIX ${ANDROID_TOOLCHAIN_PREFIX})
elseif(CMAKE_CROSSCOMPILING AND NOT DEFINED CLR_CROSS_COMPONENTS_BUILD AND
CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv8l|armv7l|armv6l|aarch64|arm|s390x)$")
CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv8l|armv7l|armv6l|aarch64|arm|s390x|ppc64le)$")
set(TOOLSET_PREFIX "${TOOLCHAIN}-")
else()
set(TOOLSET_PREFIX "")
Expand Down
4 changes: 4 additions & 0 deletions eng/native/functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ function(find_unwind_libs UnwindLibs)
find_library(UNWIND_ARCH NAMES unwind-s390x)
endif()

if(CLR_CMAKE_HOST_ARCH_POWERPC64)
find_library(UNWIND_ARCH NAMES unwind-ppc64le)
endif()

if(NOT UNWIND_ARCH STREQUAL UNWIND_ARCH-NOTFOUND)
set(UNWIND_LIBS ${UNWIND_ARCH})
endif()
Expand Down
3 changes: 3 additions & 0 deletions eng/native/init-os-and-arch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ case "$CPUName" in
arch=s390x
;;

ppc64le)
arch=ppc64le
;;
*)
echo "Unknown CPU $CPUName detected, configuring as if for x64"
arch=x64
Expand Down
6 changes: 3 additions & 3 deletions eng/native/tryrun.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ if(DARWIN)
else()
message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only arm64 or x64 is supported for OSX cross build!")
endif()
elseif(TARGET_ARCH_NAME MATCHES "^(armel|arm|armv6|arm64|loongarch64|s390x|x86)$" OR FREEBSD OR ILLUMOS)
elseif(TARGET_ARCH_NAME MATCHES "^(armel|arm|armv6|arm64|loongarch64|s390x|ppc64le|x86)$" OR FREEBSD OR ILLUMOS)
set_cache_value(FILE_OPS_CHECK_FERROR_OF_PREVIOUS_CALL_EXITCODE 1)
set_cache_value(GETPWUID_R_SETS_ERRNO_EXITCODE 0)
set_cache_value(HAS_POSIX_SEMAPHORES_EXITCODE 0)
Expand Down Expand Up @@ -146,9 +146,9 @@ elseif(TARGET_ARCH_NAME MATCHES "^(armel|arm|armv6|arm64|loongarch64|s390x|x86)$
set_cache_value(HAVE_FUNCTIONAL_PTHREAD_ROBUST_MUTEXES_EXITCODE 0)
endif()
else()
message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only armel, arm, armv6, arm64, loongarch64, s390x and x86 are supported!")
message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only armel, arm, armv6, arm64, loongarch64, s390x, ppc64le and x86 are supported!")
endif()

if(TARGET_ARCH_NAME STREQUAL "x86" OR TARGET_ARCH_NAME STREQUAL "s390x" OR TARGET_ARCH_NAME STREQUAL "armv6" OR TARGET_ARCH_NAME STREQUAL "loongarch64")
if(TARGET_ARCH_NAME STREQUAL "x86" OR TARGET_ARCH_NAME STREQUAL "s390x" OR TARGET_ARCH_NAME STREQUAL "armv6" OR TARGET_ARCH_NAME STREQUAL "loongarch64" OR TARGET_ARCH_NAME STREQUAL "ppc64le")
set_cache_value(HAVE_FUNCTIONAL_PTHREAD_ROBUST_MUTEXES_EXITCODE 0)
endif()
18 changes: 16 additions & 2 deletions src/coreclr/jit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ function(create_standalone_jit)
elseif(TARGETDETAILS_ARCH STREQUAL "s390x")
set(JIT_ARCH_SOURCES ${JIT_S390X_SOURCES})
set(JIT_ARCH_HEADERS ${JIT_S390X_HEADERS})
elseif(TARGETDETAILS_ARCH STREQUAL "ppc64le")
set(JIT_ARCH_SOURCES ${JIT_POWERPC64_SOURCES})
set(JIT_ARCH_HEADERS ${JIT_POWERPC64_HEADERS})
elseif(TARGETDETAILS_ARCH STREQUAL "loongarch64")
set(JIT_ARCH_SOURCES ${JIT_LOONGARCH64_SOURCES})
set(JIT_ARCH_HEADERS ${JIT_LOONGARCH64_HEADERS})
Expand Down Expand Up @@ -241,6 +244,10 @@ set( JIT_S390X_SOURCES
# Not supported as JIT target
)

set( JIT_POWERPC64_SOURCES
# Not supported as JIT target
)

set( JIT_LOONGARCH64_SOURCES
codegenloongarch64.cpp
emitloongarch64.cpp
Expand Down Expand Up @@ -396,6 +403,10 @@ set ( JIT_S390X_HEADERS
# Not supported as JIT target
)

set ( JIT_POWERPC64_HEADERS
# Not supported as JIT target
)

set( JIT_LOONGARCH64_HEADERS
emitloongarch64.h
emitfmtsloongarch64.h
Expand Down Expand Up @@ -442,6 +453,9 @@ elseif(CLR_CMAKE_TARGET_ARCH_ARM64)
elseif(CLR_CMAKE_TARGET_ARCH_S390X)
set(JIT_ARCH_SOURCES ${JIT_S390X_SOURCES})
set(JIT_ARCH_HEADERS ${JIT_S390X_HEADERS})
elseif(CLR_CMAKE_TARGET_ARCH_POWERPC64)
set(JIT_ARCH_SOURCES ${JIT_POWERPC64_SOURCES})
set(JIT_ARCH_HEADERS ${JIT_POWERPC64_HEADERS})
elseif(CLR_CMAKE_TARGET_ARCH_LOONGARCH64)
set(JIT_ARCH_SOURCES ${JIT_LOONGARCH64_SOURCES})
set(JIT_ARCH_HEADERS ${JIT_LOONGARCH64_HEADERS})
Expand Down Expand Up @@ -600,13 +614,13 @@ if (CLR_CMAKE_TARGET_ARCH_I386 AND CLR_CMAKE_TARGET_UNIX)
endif (CLR_CMAKE_TARGET_ARCH_I386 AND CLR_CMAKE_TARGET_UNIX)

if (CLR_CMAKE_TARGET_UNIX)
if (NOT ARCH_TARGET_NAME STREQUAL s390x AND NOT ARCH_TARGET_NAME STREQUAL armv6)
if (NOT ARCH_TARGET_NAME STREQUAL s390x AND NOT ARCH_TARGET_NAME STREQUAL armv6 AND NOT ARCH_TARGET_NAME STREQUAL ppc64le)
if(CLR_CMAKE_TARGET_ARCH_ARM OR CLR_CMAKE_TARGET_ARCH_ARM64)
install_clr(TARGETS clrjit_universal_${ARCH_TARGET_NAME}_${ARCH_HOST_NAME} DESTINATIONS . COMPONENT jit)
else()
install_clr(TARGETS clrjit_unix_${ARCH_TARGET_NAME}_${ARCH_HOST_NAME} DESTINATIONS . COMPONENT jit)
endif()
endif(NOT ARCH_TARGET_NAME STREQUAL s390x AND NOT ARCH_TARGET_NAME STREQUAL armv6)
endif(NOT ARCH_TARGET_NAME STREQUAL s390x AND NOT ARCH_TARGET_NAME STREQUAL armv6 AND NOT ARCH_TARGET_NAME STREQUAL ppc64le)
endif()

if (CLR_CMAKE_TARGET_WIN32 AND CLR_CMAKE_PGO_INSTRUMENT)
Expand Down
2 changes: 2 additions & 0 deletions src/coreclr/pal/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ elseif(CLR_CMAKE_HOST_ARCH_I386)
set(PAL_ARCH_SOURCES_DIR i386)
elseif(CLR_CMAKE_HOST_ARCH_S390X)
set(PAL_ARCH_SOURCES_DIR s390x)
elseif(CLR_CMAKE_HOST_ARCH_POWERPC64)
set(PAL_ARCH_SOURCES_DIR ppc64le)
endif()

if(CLR_CMAKE_USE_SYSTEM_LIBUNWIND)
Expand Down
2 changes: 2 additions & 0 deletions src/coreclr/pal/src/misc/perfjitdump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ namespace
ELF_MACHINE = EM_LOONGARCH,
#elif defined(HOST_S390X)
ELF_MACHINE = EM_S390,
#elif defined(HOST_POWERPC)
ELF_MACHINE = EM_PPC64,
#else
#error ELF_MACHINE unsupported for target
#endif
Expand Down
6 changes: 6 additions & 0 deletions src/installer/pkg/projects/netcoreappRIDs.props
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,11 @@
<UnofficialBuildRID Include="linux-musl-s390x">
<Platform>s390x</Platform>
</UnofficialBuildRID>
<UnofficialBuildRID Include="linux-ppc64le">
<Platform>ppc64le</Platform>
</UnofficialBuildRID>
<UnofficialBuildRID Include="linux-musl-ppc64le">
<Platform>ppc64le</Platform>
</UnofficialBuildRID>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4294,6 +4294,16 @@
"unix",
"any",
"base"
],
"linux-musl-ppc64le": [
"linux-musl-ppc64le",
"linux-musl",
"linux-ppc64le",
"linux",
"unix-ppc64le",
"unix",
"any",
"base"
],
"linux-musl-x64": [
"linux-musl-x64",
Expand Down Expand Up @@ -4323,6 +4333,14 @@
"any",
"base"
],
"linux-ppc64le": [
"linux-ppc64le",
"linux",
"unix-ppc64le",
"unix",
"any",
"base"
],
"linux-x64": [
"linux-x64",
"linux",
Expand Down Expand Up @@ -8883,6 +8901,12 @@
"any",
"base"
],
"unix-ppc64le": [
"unix-ppc64le",
"unix",
"any",
"base"
],
"unix-x64": [
"unix-x64",
"unix",
Expand Down Expand Up @@ -9525,4 +9549,4 @@
"any",
"base"
]
}
}
19 changes: 18 additions & 1 deletion src/libraries/Microsoft.NETCore.Platforms/src/runtime.json
Original file line number Diff line number Diff line change
Expand Up @@ -1643,6 +1643,12 @@
"linux-s390x"
]
},
"linux-musl-ppc64le": {
"#import": [
"linux-musl",
"linux-ppc64le"
]
},
"linux-musl-x64": {
"#import": [
"linux-musl",
Expand All @@ -1661,6 +1667,12 @@
"unix-s390x"
]
},
"linux-ppc64le": {
"#import": [
"linux",
"unix-ppc64le"
]
},
"linux-x64": {
"#import": [
"linux",
Expand Down Expand Up @@ -3629,6 +3641,11 @@
"unix"
]
},
"unix-ppc64le": {
"#import": [
"unix"
]
},
"unix-x64": {
"#import": [
"unix"
Expand Down Expand Up @@ -3963,4 +3980,4 @@
]
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<ItemGroup>
<RuntimeGroup Include="unix">
<Parent>any</Parent>
<Architectures>x64;x86;arm;armv6;armel;arm64;loongarch64;mips64;s390x</Architectures>
<Architectures>x64;x86;arm;armv6;armel;arm64;loongarch64;mips64;s390x;ppc64le</Architectures>
</RuntimeGroup>
<RuntimeGroup Include="linux">
<Parent>unix</Parent>
<Architectures>x64;x86;arm;armv6;armel;arm64;loongarch64;mips64;s390x</Architectures>
<Architectures>x64;x86;arm;armv6;armel;arm64;loongarch64;mips64;s390x;ppc64le</Architectures>
</RuntimeGroup>
<RuntimeGroup Include="linux-musl">
<Parent>linux</Parent>
<Architectures>x64;x86;arm;armel;arm64;s390x</Architectures>
<Architectures>x64;x86;arm;armel;arm64;s390x;ppc64le</Architectures>
</RuntimeGroup>

<RuntimeGroup Include="alpine">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<SupportsX86Intrinsics Condition="'$(Platform)' == 'x64' or ('$(Platform)' == 'x86' and '$(TargetsUnix)' != 'true')">true</SupportsX86Intrinsics>
<ILLinkSharedDirectory>$(MSBuildThisFileDirectory)ILLink\</ILLinkSharedDirectory>
<IsBigEndian Condition="'$(Platform)' == 's390x'">true</IsBigEndian>
<Is64Bit Condition="'$(Platform)' == 'arm64' or '$(Platform)' == 'x64' or '$(Platform)' == 's390x' or '$(Platform)' == 'loongarch64'">true</Is64Bit>
<Is64Bit Condition="'$(Platform)' == 'arm64' or '$(Platform)' == 'x64' or '$(Platform)' == 's390x' or '$(Platform)' == 'loongarch64' or '$(Platform)' == 'ppc64le'">true</Is64Bit>
<UseMinimalGlobalizationData Condition="'$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true' or '$(TargetsBrowser)' == 'true'">true</UseMinimalGlobalizationData>
</PropertyGroup>
<PropertyGroup>
Expand Down
Loading