TEST(getauxval, arm_has_AT_HWCAP2) { #ifdefined(__arm__) // There are no known 32-bit processors that implement any of these instructions, so rather // than require that OEMs backport kernel patches, let's just ignore old hardware. Strictly // speaking this would be fooled by someone choosing to ship a 32-bit kernel on 64-bit hardware, // but that doesn't seem very likely in 2016.
utsname u;
ASSERT_EQ(0, uname(&u)); if (strcmp(u.machine, "aarch64") == 0) { // If this test fails, apps that use getauxval to decide at runtime whether crypto hardware is // available will incorrectly assume that it isn't, and will have really bad performance. // If this test fails, ensure that you've enabled COMPAT_BINFMT_ELF in your kernel configuration. // Note that 0 ("I don't support any of these things") is a legitimate response --- we need // to check errno to see whether we got a "true" 0 or a "not found" 0.
errno = 0;
getauxval(AT_HWCAP2);
ASSERT_ERRNO(0) << "64-bit kernel not reporting AT_HWCAP2 to 32-bit ARM process"; return;
} #endif
GTEST_SKIP() << "This test is only meaningful for 32-bit ARM code on 64-bit devices";
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet am 2026-06-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.