8310019: MIPS builds are broken after JDK-8304913
Reviewed-by: phh, shade, aoqi
This commit is contained in:
parent
e08e94f1b9
commit
33c6ec9d4e
@ -41,6 +41,8 @@ public enum Architecture {
|
||||
RISCV64,
|
||||
S390,
|
||||
PPC64,
|
||||
MIPSEL,
|
||||
MIPS64EL
|
||||
;
|
||||
|
||||
private static Architecture CURRENT_ARCH = initArch(PlatformProps.CURRENT_ARCH_STRING);
|
||||
@ -102,6 +104,22 @@ public enum Architecture {
|
||||
return PlatformProps.TARGET_ARCH_IS_AARCH64;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@return {@code true} if the current architecture is MIPSEL}
|
||||
*/
|
||||
@ForceInline
|
||||
public static boolean isMIPSEL() {
|
||||
return PlatformProps.TARGET_ARCH_IS_MIPSEL;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@return {@code true} if the current architecture is MIPS64EL}
|
||||
*/
|
||||
@ForceInline
|
||||
public static boolean isMIPS64EL() {
|
||||
return PlatformProps.TARGET_ARCH_IS_MIPS64EL;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@return the current architecture}
|
||||
*/
|
||||
|
@ -57,4 +57,6 @@ class PlatformProps {
|
||||
static final boolean TARGET_ARCH_IS_RISCV64 = "@@OPENJDK_TARGET_CPU@@" == "riscv64";
|
||||
static final boolean TARGET_ARCH_IS_S390 = "@@OPENJDK_TARGET_CPU@@" == "s390";
|
||||
static final boolean TARGET_ARCH_IS_PPC64 = "@@OPENJDK_TARGET_CPU@@" == "ppc64";
|
||||
static final boolean TARGET_ARCH_IS_MIPSEL = "@@OPENJDK_TARGET_CPU@@" == "mipsel";
|
||||
static final boolean TARGET_ARCH_IS_MIPS64EL= "@@OPENJDK_TARGET_CPU@@" == "mips64el";
|
||||
}
|
||||
|
@ -34,6 +34,8 @@ import static jdk.internal.util.Architecture.RISCV64;
|
||||
import static jdk.internal.util.Architecture.S390;
|
||||
import static jdk.internal.util.Architecture.X64;
|
||||
import static jdk.internal.util.Architecture.X86;
|
||||
import static jdk.internal.util.Architecture.MIPSEL;
|
||||
import static jdk.internal.util.Architecture.MIPS64EL;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
@ -72,6 +74,8 @@ public class ArchTest {
|
||||
case "riscv64" -> RISCV64;
|
||||
case "s390x", "s390" -> S390;
|
||||
case "ppc64", "ppc64le" -> PPC64;
|
||||
case "mipsel" -> MIPSEL;
|
||||
case "mips64el" -> MIPS64EL;
|
||||
default -> OTHER;
|
||||
};
|
||||
assertEquals(Architecture.current(), arch, "mismatch in Architecture.current vs " + osArch);
|
||||
@ -89,6 +93,8 @@ public class ArchTest {
|
||||
Arguments.of(ARM, Architecture.isARM()),
|
||||
Arguments.of(RISCV64, Architecture.isRISCV64()),
|
||||
Arguments.of(S390, Architecture.isS390()),
|
||||
Arguments.of(MIPSEL, Architecture.isMIPSEL()),
|
||||
Arguments.of(MIPS64EL, Architecture.isMIPS64EL()),
|
||||
Arguments.of(PPC64, Architecture.isPPC64())
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user