diff --git a/eng/native/init-os-and-arch.sh b/eng/native/init-os-and-arch.sh index 887bb3b72f786..4064314011391 100644 --- a/eng/native/init-os-and-arch.sh +++ b/eng/native/init-os-and-arch.sh @@ -13,8 +13,8 @@ FreeBSD|Linux|NetBSD|OpenBSD|SunOS|Android) Darwin) os=OSX ;; *) - echo "Unsupported OS $OSName detected, configuring as if for Linux" - os=Linux ;; + echo "Unsupported OS $OSName detected!" + exit 1 ;; esac # On Solaris, `uname -m` is discouraged, see https://docs.oracle.com/cd/E36784_01/html/E36870/uname-1.html @@ -74,7 +74,7 @@ case "$CPUName" in arch=ppc64le ;; *) - echo "Unknown CPU $CPUName detected, configuring as if for x64" - arch=x64 + echo "Unknown CPU $CPUName detected!" + exit 1 ;; esac diff --git a/src/coreclr/scripts/coreclr_arguments.py b/src/coreclr/scripts/coreclr_arguments.py index aab997306f190..a568bc9e78e71 100644 --- a/src/coreclr/scripts/coreclr_arguments.py +++ b/src/coreclr/scripts/coreclr_arguments.py @@ -63,7 +63,7 @@ def __init__(self, self.require_built_core_root = require_built_core_root self.require_built_test_dir = require_built_test_dir - self.valid_arches = ["x64", "x86", "arm", "arm64", "wasm"] + self.valid_arches = ["x64", "x86", "arm", "arm64", "loongarch64", "wasm"] self.valid_build_types = ["Debug", "Checked", "Release"] self.valid_host_os = ["windows", "OSX", "Linux", "illumos", "Solaris", "Browser", "Android"] diff --git a/src/tests/run.sh b/src/tests/run.sh index 16756ccf61f17..d2a74b457482e 100755 --- a/src/tests/run.sh +++ b/src/tests/run.sh @@ -39,55 +39,14 @@ function print_usage { echo ' --limitedDumpGeneration : ' } -function check_cpu_architecture { - local CPUName=$(uname -m) - local __arch= - - if [[ "$(uname -s)" == "SunOS" ]]; then - CPUName=$(isainfo -n) - fi - - case $CPUName in - i686) - __arch=x86 - ;; - amd64|x86_64) - __arch=x64 - ;; - armv7l) - __arch=arm - ;; - aarch64|arm64) - __arch=arm64 - ;; - loongarch64) - __arch=loongarch64 - ;; - riscv64) - __arch=riscv64 - ;; - *) - echo "Unknown CPU $CPUName detected, configuring as if for x64" - __arch=x64 - ;; - esac - - echo "$__arch" -} - -################################################################################ -# Handle Arguments -################################################################################ - -ARCH=$(check_cpu_architecture) - # Exit code constants readonly EXIT_CODE_SUCCESS=0 # Script ran normally. readonly EXIT_CODE_EXCEPTION=1 # Script exited because something exceptional happened (e.g. bad arguments, Ctrl-C interrupt). readonly EXIT_CODE_TEST_FAILURE=2 # Script completed successfully, but one or more tests failed. # Argument variables -buildArch=$ARCH +source "$repoRootDir/eng/native/init-os-and-arch.sh" +buildArch="$arch" buildOS= buildConfiguration="Debug" testRootDir= @@ -129,6 +88,9 @@ do arm64) buildArch="arm64" ;; + loongarch64) + buildArch="loongarch64" + ;; wasm) buildArch="wasm" ;;