Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d98e5fc5 authored by Dimitry Ivanov's avatar Dimitry Ivanov Committed by android-build-merger
Browse files

Merge "Define current ABI string in android-base/macros.h"

am: 2732a7e0

Change-Id: I23b96f14ce8e05a3ab36b7c32a29026f4f08ef60
parents d1821522 2732a7e0
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -179,4 +179,19 @@ void UNUSED(const T&...) {
  } while (0)
#endif

// Current ABI string
#if defined(__arm__)
#define ABI_STRING "arm"
#elif defined(__aarch64__)
#define ABI_STRING "arm64"
#elif defined(__i386__)
#define ABI_STRING "x86"
#elif defined(__x86_64__)
#define ABI_STRING "x86_64"
#elif defined(__mips__) && !defined(__LP64__)
#define ABI_STRING "mips"
#elif defined(__mips__) && defined(__LP64__)
#define ABI_STRING "mips64"
#endif

#endif  // ANDROID_BASE_MACROS_H
+1 −18
Original line number Diff line number Diff line
@@ -24,26 +24,9 @@

#include <string>

#include <android-base/macros.h>
#include <backtrace/Backtrace.h>

// Figure out the abi based on defined macros.
#if defined(__arm__)
#define ABI_STRING "arm"
#elif defined(__aarch64__)
#define ABI_STRING "arm64"
#elif defined(__mips__) && !defined(__LP64__)
#define ABI_STRING "mips"
#elif defined(__mips__) && defined(__LP64__)
#define ABI_STRING "mips64"
#elif defined(__i386__)
#define ABI_STRING "x86"
#elif defined(__x86_64__)
#define ABI_STRING "x86_64"
#else
#error "Unsupported ABI"
#endif


struct log_t{
    // Tombstone file descriptor.
    int tfd;
+0 −17
Original line number Diff line number Diff line
@@ -479,23 +479,6 @@ std::string Leak::ToString(bool log_contents) const {
  return oss.str();
}

// Figure out the abi based on defined macros.
#if defined(__arm__)
#define ABI_STRING "arm"
#elif defined(__aarch64__)
#define ABI_STRING "arm64"
#elif defined(__mips__) && !defined(__LP64__)
#define ABI_STRING "mips"
#elif defined(__mips__) && defined(__LP64__)
#define ABI_STRING "mips64"
#elif defined(__i386__)
#define ABI_STRING "x86"
#elif defined(__x86_64__)
#define ABI_STRING "x86_64"
#else
#error "Unsupported ABI"
#endif

std::string UnreachableMemoryInfo::ToString(bool log_contents) const {
  std::ostringstream oss;
  oss << "  " << leak_bytes << " bytes in ";
+1 −1
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ cc_library {

    host_supported: true,
    srcs: ["native_bridge.cc"],
    shared_libs: ["liblog"],
    shared_libs: ["liblog", "libbase"],

    export_include_dirs=["include"],

+2 −18
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@

#include <cstring>

#include <android-base/macros.h>
#include <log/log.h>

namespace android {
@@ -243,29 +244,12 @@ bool LoadNativeBridge(const char* nb_library_filename,
  }
}

#if defined(__arm__)
static const char* kRuntimeISA = "arm";
#elif defined(__aarch64__)
static const char* kRuntimeISA = "arm64";
#elif defined(__mips__) && !defined(__LP64__)
static const char* kRuntimeISA = "mips";
#elif defined(__mips__) && defined(__LP64__)
static const char* kRuntimeISA = "mips64";
#elif defined(__i386__)
static const char* kRuntimeISA = "x86";
#elif defined(__x86_64__)
static const char* kRuntimeISA = "x86_64";
#else
static const char* kRuntimeISA = "unknown";
#endif


bool NeedsNativeBridge(const char* instruction_set) {
  if (instruction_set == nullptr) {
    ALOGE("Null instruction set in NeedsNativeBridge.");
    return false;
  }
  return strncmp(instruction_set, kRuntimeISA, strlen(kRuntimeISA) + 1) != 0;
  return strncmp(instruction_set, ABI_STRING, strlen(ABI_STRING) + 1) != 0;
}

#ifdef __APPLE__
Loading