diff options
author | Elliott Hughes <enh@google.com> | 2018-03-23 11:27:04 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2018-03-23 11:27:04 -0700 |
commit | a1194cb636ca058cc3d11f17200fd757302aca67 (patch) | |
tree | 558d6ddf081cb2e5d0a4a0b04026797682a59a5b /core/jni/AndroidRuntime.cpp | |
parent | 6941fcd88cbc10c210eb8264caa6d193404cd840 (diff) |
Use ABI_STRING.
Bug: N/A
Test: builds
Change-Id: I5a9d2a6604887f1f0e9583086e012a086042b7df
Diffstat (limited to 'core/jni/AndroidRuntime.cpp')
-rw-r--r-- | core/jni/AndroidRuntime.cpp | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp index 3784d4daa2e9..6c46cfc751b0 100644 --- a/core/jni/AndroidRuntime.cpp +++ b/core/jni/AndroidRuntime.cpp @@ -20,6 +20,7 @@ #include <android_runtime/AndroidRuntime.h> +#include <android-base/macros.h> #include <android-base/properties.h> #include <binder/IBinder.h> #include <binder/IPCThreadState.h> @@ -860,34 +861,18 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv, bool zygote) // The runtime will compile a boot image, when necessary, not using installd. Thus, we need to // pass the instruction-set-features/variant as an image-compiler-option. - // TODO: Find a better way for the instruction-set. -#if defined(__arm__) - constexpr const char* instruction_set = "arm"; -#elif defined(__aarch64__) - constexpr const char* instruction_set = "arm64"; -#elif defined(__mips__) && !defined(__LP64__) - constexpr const char* instruction_set = "mips"; -#elif defined(__mips__) && defined(__LP64__) - constexpr const char* instruction_set = "mips64"; -#elif defined(__i386__) - constexpr const char* instruction_set = "x86"; -#elif defined(__x86_64__) - constexpr const char* instruction_set = "x86_64"; -#else - constexpr const char* instruction_set = "unknown"; -#endif // Note: it is OK to reuse the buffer, as the values are exactly the same between // * compiler-option, used for runtime compilation (DexClassLoader) // * image-compiler-option, used for boot-image compilation on device // Copy the variant. - sprintf(dex2oat_isa_variant_key, "dalvik.vm.isa.%s.variant", instruction_set); + sprintf(dex2oat_isa_variant_key, "dalvik.vm.isa.%s.variant", ABI_STRING); parseCompilerOption(dex2oat_isa_variant_key, dex2oat_isa_variant, "--instruction-set-variant=", "-Ximage-compiler-option"); parseCompilerOption(dex2oat_isa_variant_key, dex2oat_isa_variant, "--instruction-set-variant=", "-Xcompiler-option"); // Copy the features. - sprintf(dex2oat_isa_features_key, "dalvik.vm.isa.%s.features", instruction_set); + sprintf(dex2oat_isa_features_key, "dalvik.vm.isa.%s.features", ABI_STRING); parseCompilerOption(dex2oat_isa_features_key, dex2oat_isa_features, "--instruction-set-features=", "-Ximage-compiler-option"); parseCompilerOption(dex2oat_isa_features_key, dex2oat_isa_features, |