ifuncs: start sharing.
We're going to have to add ifuncs to libm, and there will be some SVE
ones for arm64 soon too, so let's start sharing the absolute minimum...
Test: builds
Change-Id: Idbb9dd9477291ed3c15dc3902f65e593b766dfb9
diff --git a/libc/arch-x86/dynamic_function_dispatch.cpp b/libc/arch-x86/dynamic_function_dispatch.cpp
index 370b372..e94fa1f 100644
--- a/libc/arch-x86/dynamic_function_dispatch.cpp
+++ b/libc/arch-x86/dynamic_function_dispatch.cpp
@@ -28,22 +28,10 @@
#include <stddef.h>
+#include <private/bionic_ifuncs.h>
+
extern "C" {
-#define DEFINE_IFUNC_FOR(name) \
- name##_func name __attribute__((ifunc(#name "_resolver"))); \
- __attribute__((visibility("hidden"))) \
- name##_func* name##_resolver()
-
-#define DECLARE_FUNC(type, name) \
- __attribute__((visibility("hidden"))) \
- type name
-
-#define RETURN_FUNC(type, name) { \
- DECLARE_FUNC(type, name); \
- return name; \
- }
-
typedef int memcmp_func(const void* __lhs, const void* __rhs, size_t __n);
DEFINE_IFUNC_FOR(memcmp) {
__builtin_cpu_init();