Merge "Apply work around b/19059885 to x86"
This commit is contained in:
		@@ -1371,6 +1371,7 @@ LOCAL_LDFLAGS_64 := -Wl,--exclude-libs,libgcc.a
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# TODO: This is to work around b/19059885. Remove after root cause is fixed
 | 
					# TODO: This is to work around b/19059885. Remove after root cause is fixed
 | 
				
			||||||
LOCAL_LDFLAGS_arm := -Wl,--hash-style=both
 | 
					LOCAL_LDFLAGS_arm := -Wl,--hash-style=both
 | 
				
			||||||
 | 
					LOCAL_LDFLAGS_x86 := -Wl,--hash-style=both
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
 | 
					$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
 | 
				
			||||||
$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_arch_dynamic_src_files))
 | 
					$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_arch_dynamic_src_files))
 | 
				
			||||||
@@ -1501,6 +1502,7 @@ LOCAL_CPPFLAGS := $(libc_common_cppflags)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# TODO: This is to work around b/19059885. Remove after root cause is fixed
 | 
					# TODO: This is to work around b/19059885. Remove after root cause is fixed
 | 
				
			||||||
LOCAL_LDFLAGS_arm := -Wl,--hash-style=both
 | 
					LOCAL_LDFLAGS_arm := -Wl,--hash-style=both
 | 
				
			||||||
 | 
					LOCAL_LDFLAGS_x86 := -Wl,--hash-style=both
 | 
				
			||||||
 | 
					
 | 
				
			||||||
LOCAL_SRC_FILES := $(libstdcxx_common_src_files)
 | 
					LOCAL_SRC_FILES := $(libstdcxx_common_src_files)
 | 
				
			||||||
LOCAL_MODULE:= libstdc++
 | 
					LOCAL_MODULE:= libstdc++
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -515,6 +515,7 @@ include $(CLEAR_VARS)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# TODO: This is to work around b/19059885. Remove after root cause is fixed
 | 
					# TODO: This is to work around b/19059885. Remove after root cause is fixed
 | 
				
			||||||
LOCAL_LDFLAGS_arm := -Wl,--hash-style=both
 | 
					LOCAL_LDFLAGS_arm := -Wl,--hash-style=both
 | 
				
			||||||
 | 
					LOCAL_LDFLAGS_x86 := -Wl,--hash-style=both
 | 
				
			||||||
 | 
					
 | 
				
			||||||
LOCAL_MODULE := libm
 | 
					LOCAL_MODULE := libm
 | 
				
			||||||
LOCAL_CLANG := $(libm_clang)
 | 
					LOCAL_CLANG := $(libm_clang)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -35,6 +35,9 @@ LOCAL_CFLAGS += \
 | 
				
			|||||||
    -fvisibility=hidden \
 | 
					    -fvisibility=hidden \
 | 
				
			||||||
    -Wall -Wextra -Wunused -Werror \
 | 
					    -Wall -Wextra -Wunused -Werror \
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					LOCAL_CFLAGS_arm += -D__work_around_b_19059885__
 | 
				
			||||||
 | 
					LOCAL_CFLAGS_x86 += -D__work_around_b_19059885__
 | 
				
			||||||
 | 
					
 | 
				
			||||||
LOCAL_CONLYFLAGS += \
 | 
					LOCAL_CONLYFLAGS += \
 | 
				
			||||||
    -std=gnu99 \
 | 
					    -std=gnu99 \
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1529,7 +1529,7 @@ static void soinfo_unload(soinfo* root) {
 | 
				
			|||||||
          }
 | 
					          }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      } else {
 | 
					      } else {
 | 
				
			||||||
#if !defined(__arm__)
 | 
					#if !defined(__work_around_b_19059885__)
 | 
				
			||||||
        __libc_fatal("soinfo for \"%s\"@%p has no version", si->get_realpath(), si);
 | 
					        __libc_fatal("soinfo for \"%s\"@%p has no version", si->get_realpath(), si);
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
        PRINT("warning: soinfo for \"%s\"@%p has no version", si->get_realpath(), si);
 | 
					        PRINT("warning: soinfo for \"%s\"@%p has no version", si->get_realpath(), si);
 | 
				
			||||||
@@ -2255,7 +2255,7 @@ void soinfo::set_dt_flags_1(uint32_t dt_flags_1) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const char* soinfo::get_realpath() const {
 | 
					const char* soinfo::get_realpath() const {
 | 
				
			||||||
#if defined(__arm__)
 | 
					#if defined(__work_around_b_19059885__)
 | 
				
			||||||
  if (has_min_version(2)) {
 | 
					  if (has_min_version(2)) {
 | 
				
			||||||
    return realpath_.c_str();
 | 
					    return realpath_.c_str();
 | 
				
			||||||
  } else {
 | 
					  } else {
 | 
				
			||||||
@@ -2267,7 +2267,7 @@ const char* soinfo::get_realpath() const {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const char* soinfo::get_soname() const {
 | 
					const char* soinfo::get_soname() const {
 | 
				
			||||||
#if defined(__arm__)
 | 
					#if defined(__work_around_b_19059885__)
 | 
				
			||||||
  if (has_min_version(2)) {
 | 
					  if (has_min_version(2)) {
 | 
				
			||||||
    return soname_;
 | 
					    return soname_;
 | 
				
			||||||
  } else {
 | 
					  } else {
 | 
				
			||||||
@@ -2804,7 +2804,7 @@ bool soinfo::prelink_image() {
 | 
				
			|||||||
  for (ElfW(Dyn)* d = dynamic; d->d_tag != DT_NULL; ++d) {
 | 
					  for (ElfW(Dyn)* d = dynamic; d->d_tag != DT_NULL; ++d) {
 | 
				
			||||||
    if (d->d_tag == DT_SONAME) {
 | 
					    if (d->d_tag == DT_SONAME) {
 | 
				
			||||||
      soname_ = get_string(d->d_un.d_val);
 | 
					      soname_ = get_string(d->d_un.d_val);
 | 
				
			||||||
#if defined(__arm__)
 | 
					#if defined(__work_around_b_19059885__)
 | 
				
			||||||
      strlcpy(old_name_, soname_, sizeof(old_name_));
 | 
					      strlcpy(old_name_, soname_, sizeof(old_name_));
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
      break;
 | 
					      break;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -97,7 +97,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#define SOINFO_VERSION 2
 | 
					#define SOINFO_VERSION 2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined(__arm__)
 | 
					#if defined(__work_around_b_19059885__)
 | 
				
			||||||
#define SOINFO_NAME_LEN 128
 | 
					#define SOINFO_NAME_LEN 128
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -172,7 +172,7 @@ class VersionTracker {
 | 
				
			|||||||
struct soinfo {
 | 
					struct soinfo {
 | 
				
			||||||
 public:
 | 
					 public:
 | 
				
			||||||
  typedef LinkedList<soinfo, SoinfoListAllocator> soinfo_list_t;
 | 
					  typedef LinkedList<soinfo, SoinfoListAllocator> soinfo_list_t;
 | 
				
			||||||
#if defined(__arm__)
 | 
					#if defined(__work_around_b_19059885__)
 | 
				
			||||||
 private:
 | 
					 private:
 | 
				
			||||||
  char old_name_[SOINFO_NAME_LEN];
 | 
					  char old_name_[SOINFO_NAME_LEN];
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
@@ -183,13 +183,13 @@ struct soinfo {
 | 
				
			|||||||
  ElfW(Addr) base;
 | 
					  ElfW(Addr) base;
 | 
				
			||||||
  size_t size;
 | 
					  size_t size;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined(__arm__)
 | 
					#if defined(__work_around_b_19059885__)
 | 
				
			||||||
  uint32_t unused1;  // DO NOT USE, maintained for compatibility.
 | 
					  uint32_t unused1;  // DO NOT USE, maintained for compatibility.
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ElfW(Dyn)* dynamic;
 | 
					  ElfW(Dyn)* dynamic;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined(__arm__)
 | 
					#if defined(__work_around_b_19059885__)
 | 
				
			||||||
  uint32_t unused2; // DO NOT USE, maintained for compatibility
 | 
					  uint32_t unused2; // DO NOT USE, maintained for compatibility
 | 
				
			||||||
  uint32_t unused3; // DO NOT USE, maintained for compatibility
 | 
					  uint32_t unused3; // DO NOT USE, maintained for compatibility
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
@@ -305,7 +305,7 @@ struct soinfo {
 | 
				
			|||||||
  bool is_gnu_hash() const;
 | 
					  bool is_gnu_hash() const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  bool inline has_min_version(uint32_t min_version __unused) const {
 | 
					  bool inline has_min_version(uint32_t min_version __unused) const {
 | 
				
			||||||
#if defined(__arm__)
 | 
					#if defined(__work_around_b_19059885__)
 | 
				
			||||||
    return (flags_ & FLAG_NEW_SOINFO) != 0 && version_ >= min_version;
 | 
					    return (flags_ & FLAG_NEW_SOINFO) != 0 && version_ >= min_version;
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
    return true;
 | 
					    return true;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user