Merge "Ignore relocations in the vdso." into main
diff --git a/libc/include/android/versioning.h b/libc/include/android/versioning.h
index 64528e1..6bab291 100644
--- a/libc/include/android/versioning.h
+++ b/libc/include/android/versioning.h
@@ -22,8 +22,8 @@
#define __INTRODUCED_IN(api_level) __attribute__((__annotate__("introduced_in=" #api_level)))
#define __INTRODUCED_IN_NO_GUARD_FOR_NDK(api_level) __attribute__((__annotate__("introduced_in=" #api_level))) __VERSIONER_NO_GUARD
-#define __DEPRECATED_IN(api_level, ...) __attribute__((__annotate__("deprecated_in=" #api_level)))
-#define __REMOVED_IN(api_level, ...) __attribute__((__annotate__("obsoleted_in=" #api_level)))
+#define __DEPRECATED_IN(api_level, msg) __attribute__((__annotate__("deprecated_in=" #api_level)))
+#define __REMOVED_IN(api_level, msg) __attribute__((__annotate__("obsoleted_in=" #api_level)))
#define __INTRODUCED_IN_32(api_level) __attribute__((__annotate__("introduced_in_32=" #api_level)))
#define __INTRODUCED_IN_64(api_level) __attribute__((__annotate__("introduced_in_64=" #api_level)))
@@ -55,8 +55,8 @@
#endif
#define __INTRODUCED_IN(api_level) __BIONIC_AVAILABILITY(introduced=api_level)
-#define __DEPRECATED_IN(api_level, ...) __BIONIC_AVAILABILITY(deprecated=api_level __VA_OPT__(,message=) __VA_ARGS__)
-#define __REMOVED_IN(api_level, ...) __BIONIC_AVAILABILITY(obsoleted=api_level __VA_OPT__(,message=) __VA_ARGS__)
+#define __DEPRECATED_IN(api_level, msg) __BIONIC_AVAILABILITY(deprecated=api_level, message=msg)
+#define __REMOVED_IN(api_level, msg) __BIONIC_AVAILABILITY(obsoleted=api_level, message=msg)
// The same availability attribute can't be annotated multiple times. Therefore, the macros are
// defined for the configuration that it is valid for so that declarations like the below doesn't
diff --git a/libm/Android.bp b/libm/Android.bp
index c6e44fc..4291c6a 100644
--- a/libm/Android.bp
+++ b/libm/Android.bp
@@ -161,8 +161,6 @@
"upstream-freebsd/lib/msun/src/s_nextafterf.c",
"upstream-freebsd/lib/msun/src/s_remquo.c",
"upstream-freebsd/lib/msun/src/s_remquof.c",
- "upstream-freebsd/lib/msun/src/s_rint.c",
- "upstream-freebsd/lib/msun/src/s_rintf.c",
"upstream-freebsd/lib/msun/src/s_round.c",
"upstream-freebsd/lib/msun/src/s_roundf.c",
"upstream-freebsd/lib/msun/src/s_scalbln.c",
@@ -179,8 +177,6 @@
"upstream-freebsd/lib/msun/src/s_tanh.c",
"upstream-freebsd/lib/msun/src/s_tanhf.c",
"upstream-freebsd/lib/msun/src/s_tgammaf.c",
- "upstream-freebsd/lib/msun/src/s_trunc.c",
- "upstream-freebsd/lib/msun/src/s_truncf.c",
"upstream-freebsd/lib/msun/src/w_cabs.c",
"upstream-freebsd/lib/msun/src/w_cabsf.c",
"upstream-freebsd/lib/msun/src/w_cabsl.c",
@@ -276,9 +272,22 @@
arm: {
srcs: [
"arm/fenv.c",
- "upstream-freebsd/lib/msun/src/s_ceil.c",
- "upstream-freebsd/lib/msun/src/s_ceilf.c",
],
+ armv7_a_neon: {
+ // armv7 arm32 has no instructions to implement these as
+ // builtins, so we build the portable implementations for armv7,
+ // because the NDK still supports armv7.
+ srcs: [
+ "upstream-freebsd/lib/msun/src/s_ceil.c",
+ "upstream-freebsd/lib/msun/src/s_ceilf.c",
+ "upstream-freebsd/lib/msun/src/s_floor.c",
+ "upstream-freebsd/lib/msun/src/s_floorf.c",
+ "upstream-freebsd/lib/msun/src/s_rint.c",
+ "upstream-freebsd/lib/msun/src/s_rintf.c",
+ "upstream-freebsd/lib/msun/src/s_trunc.c",
+ "upstream-freebsd/lib/msun/src/s_truncf.c",
+ ],
+ },
instruction_set: "arm",
version_script: ":libm.arm.map",
no_libcrt: true,
@@ -309,12 +318,8 @@
"upstream-freebsd/lib/msun/src/s_lrintf.c",
"upstream-freebsd/lib/msun/src/s_lround.c",
"upstream-freebsd/lib/msun/src/s_lroundf.c",
- "upstream-freebsd/lib/msun/src/s_rint.c",
- "upstream-freebsd/lib/msun/src/s_rintf.c",
"upstream-freebsd/lib/msun/src/s_round.c",
"upstream-freebsd/lib/msun/src/s_roundf.c",
- "upstream-freebsd/lib/msun/src/s_trunc.c",
- "upstream-freebsd/lib/msun/src/s_truncf.c",
],
version_script: ":libm.arm64.map",
},
@@ -339,12 +344,8 @@
"upstream-freebsd/lib/msun/src/s_lrintf.c",
"upstream-freebsd/lib/msun/src/s_lround.c",
"upstream-freebsd/lib/msun/src/s_lroundf.c",
- "upstream-freebsd/lib/msun/src/s_rint.c",
- "upstream-freebsd/lib/msun/src/s_rintf.c",
"upstream-freebsd/lib/msun/src/s_round.c",
"upstream-freebsd/lib/msun/src/s_roundf.c",
- "upstream-freebsd/lib/msun/src/s_trunc.c",
- "upstream-freebsd/lib/msun/src/s_truncf.c",
],
version_script: ":libm.riscv64.map",
},
@@ -358,10 +359,6 @@
exclude_srcs: [
"upstream-freebsd/lib/msun/src/s_lrint.c",
"upstream-freebsd/lib/msun/src/s_lrintf.c",
- "upstream-freebsd/lib/msun/src/s_rint.c",
- "upstream-freebsd/lib/msun/src/s_rintf.c",
- "upstream-freebsd/lib/msun/src/s_trunc.c",
- "upstream-freebsd/lib/msun/src/s_truncf.c",
],
local_include_dirs: ["i387"],
// The x86 ABI doesn't include this, which is needed for the
@@ -381,10 +378,6 @@
"upstream-freebsd/lib/msun/src/s_llrintf.c",
"upstream-freebsd/lib/msun/src/s_lrint.c",
"upstream-freebsd/lib/msun/src/s_lrintf.c",
- "upstream-freebsd/lib/msun/src/s_rint.c",
- "upstream-freebsd/lib/msun/src/s_rintf.c",
- "upstream-freebsd/lib/msun/src/s_trunc.c",
- "upstream-freebsd/lib/msun/src/s_truncf.c",
],
version_script: ":libm.x86_64.map",
},
diff --git a/libm/NOTICE b/libm/NOTICE
index 3c0e783..a88c351 100644
--- a/libm/NOTICE
+++ b/libm/NOTICE
@@ -622,17 +622,6 @@
-------------------------------------------------------------------
-From: @(#)s_ilogb.c 5.1 93/09/24
-====================================================
-Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
-
-Developed at SunPro, a Sun Microsystems, Inc. business.
-Permission to use, copy, modify, and distribute this
-software is freely granted, provided that this notice
-is preserved.
-
--------------------------------------------------------------------
-
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2003, Steven G. Kargl
diff --git a/libm/builtins.cpp b/libm/builtins.cpp
index 41e145b..22a0191 100644
--- a/libm/builtins.cpp
+++ b/libm/builtins.cpp
@@ -18,13 +18,12 @@
#include "fpmath.h"
-double fabs(double x) { return __builtin_fabs(x); }
-float fabsf(float x) { return __builtin_fabsf(x); }
-long double fabsl(long double x) { return __builtin_fabsl(x); }
-
-#if defined(__aarch64__) || defined(__riscv) || defined(__i386__) || defined(__x86_64__)
-float ceilf(float x) { return __builtin_ceilf(x); }
+#if defined(__arm__) && (__ARM_ARCH <= 7)
+// armv7 arm32 has no instructions to implement these builtins,
+// so we include the msun source in the .bp file instead.
+#else
double ceil(double x) { return __builtin_ceil(x); }
+float ceilf(float x) { return __builtin_ceilf(x); }
#if defined(__ILP32__)
__weak_reference(ceil, ceill);
#endif
@@ -34,21 +33,16 @@
float copysignf(float x, float y) { return __builtin_copysignf(x, y); }
long double copysignl(long double x, long double y) { return __builtin_copysignl(x, y); }
-#if defined(__arm__) && (__ARM_ARCH < 8)
-// armv8 arm32 has a single-instruction implementation for these, but
-// armv7 arm32 doesn't, so __builtin_ doesn't work for arm32.
-#include "math_private.h"
-namespace s_floor {
-#include "upstream-freebsd/lib/msun/src/s_floor.c"
-}
-namespace s_floorf {
-#include "upstream-freebsd/lib/msun/src/s_floorf.c"
-}
-float floorf(float x) { return s_floorf::floorf(x); }
-double floor(double x) { return s_floor::floor(x); }
+double fabs(double x) { return __builtin_fabs(x); }
+float fabsf(float x) { return __builtin_fabsf(x); }
+long double fabsl(long double x) { return __builtin_fabsl(x); }
+
+#if defined(__arm__) && (__ARM_ARCH <= 7)
+// armv7 arm32 has no instructions to implement these builtins,
+// so we include the msun source in the .bp file instead.
#else
-float floorf(float x) { return __builtin_floorf(x); }
double floor(double x) { return __builtin_floor(x); }
+float floorf(float x) { return __builtin_floorf(x); }
#if defined(__ILP32__)
__weak_reference(floor, floorl);
#endif
@@ -79,28 +73,34 @@
long long llroundf(float x) { return __builtin_llroundf(x); }
#endif
-#if defined(__aarch64__) || defined(__riscv) || defined(__i386__) || defined(__x86_64__)
-float rintf(float x) { return __builtin_rintf(x); }
+#if defined(__arm__) && (__ARM_ARCH <= 7)
+// armv7 arm32 has no instructions to implement these builtins,
+// so we include the msun source in the .bp file instead.
+#else
double rint(double x) { return __builtin_rint(x); }
+float rintf(float x) { return __builtin_rintf(x); }
#if defined(__ILP32__)
__weak_reference(rint, rintl);
#endif
#endif
#if defined(__aarch64__) || defined(__riscv)
-float roundf(float x) { return __builtin_roundf(x); }
double round(double x) { return __builtin_round(x); }
+float roundf(float x) { return __builtin_roundf(x); }
#endif
-float sqrtf(float x) { return __builtin_sqrtf(x); }
double sqrt(double x) { return __builtin_sqrt(x); }
+float sqrtf(float x) { return __builtin_sqrtf(x); }
#if defined(__ILP32__)
__weak_reference(sqrt, sqrtl);
#endif
-#if defined(__aarch64__) || defined(__riscv) || defined(__i386__) || defined(__x86_64__)
-float truncf(float x) { return __builtin_truncf(x); }
+#if defined(__arm__) && (__ARM_ARCH <= 7)
+// armv7 arm32 has no instructions to implement these builtins,
+// so we include the msun source in the .bp file instead.
+#else
double trunc(double x) { return __builtin_trunc(x); }
+float truncf(float x) { return __builtin_truncf(x); }
#if defined(__ILP32__)
__weak_reference(trunc, truncl);
#endif
diff --git a/linker/linker_soinfo.cpp b/linker/linker_soinfo.cpp
index d915503..b2170d8 100644
--- a/linker/linker_soinfo.cpp
+++ b/linker/linker_soinfo.cpp
@@ -159,11 +159,6 @@
break;
}
}
-
- if (IsGeneral) {
- TRACE_TYPE(LOOKUP, "NOT FOUND %s in %s@%p",
- name, lib->si_->get_realpath(), reinterpret_cast<void*>(lib->si_->base));
- }
}
// Search the library's hash table chain.
@@ -186,21 +181,11 @@
memcmp(lib->strtab_ + sym->st_name, name, name_len + 1) == 0 &&
is_symbol_global_and_defined(lib->si_, sym)) {
*si_found_in = lib->si_;
- if (IsGeneral) {
- TRACE_TYPE(LOOKUP, "FOUND %s in %s (%p) %zd",
- name, lib->si_->get_realpath(), reinterpret_cast<void*>(sym->st_value),
- static_cast<size_t>(sym->st_size));
- }
return sym;
}
}
++sym_idx;
} while ((chain_value & 1) == 0);
-
- if (IsGeneral) {
- TRACE_TYPE(LOOKUP, "NOT FOUND %s in %s@%p",
- name, lib->si_->get_realpath(), reinterpret_cast<void*>(lib->si_->base));
- }
}
}
@@ -338,9 +323,6 @@
// test against bloom filter
if ((1 & (bloom_word >> h1) & (bloom_word >> h2)) == 0) {
- TRACE_TYPE(LOOKUP, "NOT FOUND %s in %s@%p",
- symbol_name.get_name(), get_realpath(), reinterpret_cast<void*>(base));
-
return nullptr;
}
@@ -348,9 +330,6 @@
uint32_t n = gnu_bucket_[hash % gnu_nbucket_];
if (n == 0) {
- TRACE_TYPE(LOOKUP, "NOT FOUND %s in %s@%p",
- symbol_name.get_name(), get_realpath(), reinterpret_cast<void*>(base));
-
return nullptr;
}
@@ -363,16 +342,10 @@
check_symbol_version(versym, n, verneed) &&
strcmp(get_string(s->st_name), symbol_name.get_name()) == 0 &&
is_symbol_global_and_defined(this, s)) {
- TRACE_TYPE(LOOKUP, "FOUND %s in %s (%p) %zd",
- symbol_name.get_name(), get_realpath(), reinterpret_cast<void*>(s->st_value),
- static_cast<size_t>(s->st_size));
return symtab_ + n;
}
} while ((gnu_chain_[n++] & 1) == 0);
- TRACE_TYPE(LOOKUP, "NOT FOUND %s in %s@%p",
- symbol_name.get_name(), get_realpath(), reinterpret_cast<void*>(base));
-
return nullptr;
}
@@ -392,18 +365,10 @@
if (check_symbol_version(versym, n, verneed) &&
strcmp(get_string(s->st_name), symbol_name.get_name()) == 0 &&
is_symbol_global_and_defined(this, s)) {
- TRACE_TYPE(LOOKUP, "FOUND %s in %s (%p) %zd",
- symbol_name.get_name(), get_realpath(),
- reinterpret_cast<void*>(s->st_value),
- static_cast<size_t>(s->st_size));
return symtab_ + n;
}
}
- TRACE_TYPE(LOOKUP, "NOT FOUND %s in %s@%p %x %zd",
- symbol_name.get_name(), get_realpath(),
- reinterpret_cast<void*>(base), hash, hash % nbucket_);
-
return nullptr;
}