diff options
Diffstat (limited to 'make/stub_includes/platform')
-rw-r--r-- | make/stub_includes/platform/glibc-compat-symbols.h | 30 | ||||
-rw-r--r-- | make/stub_includes/platform/gluegen_stddef.h | 2 | ||||
-rw-r--r-- | make/stub_includes/platform/gluegen_stdint.h | 2 |
3 files changed, 29 insertions, 5 deletions
diff --git a/make/stub_includes/platform/glibc-compat-symbols.h b/make/stub_includes/platform/glibc-compat-symbols.h index 3599b82..fc19543 100644 --- a/make/stub_includes/platform/glibc-compat-symbols.h +++ b/make/stub_includes/platform/glibc-compat-symbols.h @@ -17,16 +17,40 @@ */ #if defined(__linux__) /* Actually we like to test whether we link against GLIBC .. */ #if defined(__GNUC__) - #if defined(__arm__) + #if defined(__aarch64__) + /* glibc 2.17 is the first glibc version that support aarch64 + however memcpy is not versioned for aarch64 */ + #define GLIBC_COMPAT_SYMBOL(FFF) + #elif defined(__arm__) + /** On recent toolchain memcpy is no more versioned for arm #define GLIBC_COMPAT_SYMBOL(FFF) __asm__(".symver " #FFF "," #FFF "@GLIBC_2.4"); + */ + #define GLIBC_COMPAT_SYMBOL(FFF) + #elif defined(__PPC64__) + /* PPC64 has multiple versions of memcpy from glibc 2.3 and onwards + * while PPC64LE only has one (introduced in glibc 2.17). PPC64LE is + * the more common of the two now so skip versioning. */ + #define GLIBC_COMPAT_SYMBOL(FFF) #elif defined(__amd64__) #define GLIBC_COMPAT_SYMBOL(FFF) __asm__(".symver " #FFF "," #FFF "@GLIBC_2.2.5"); #else #define GLIBC_COMPAT_SYMBOL(FFF) __asm__(".symver " #FFF "," #FFF "@GLIBC_2.0"); #endif /*__amd64__*/ #elif defined(__clang__) - #if defined(__arm__) - #define GLIBC_COMPAT_SYMBOL(FFF) asm(".symver " #FFF "," #FFF "@GLIBC_2.4"); + #if defined(__aarch64__) + /* glibc 2.17 is the first glibc version that support aarch64 + however memcpy is not versioned for aarch64 */ + #define GLIBC_COMPAT_SYMBOL(FFF) + #elif defined(__arm__) + /** On recent toolchain memcpy is no more versioned for arm + #define GLIBC_COMPAT_SYMBOL(FFF) __asm__(".symver " #FFF "," #FFF "@GLIBC_2.4"); + */ + #define GLIBC_COMPAT_SYMBOL(FFF) + #elif defined(__PPC64__) + /* PPC64 has multiple versions of memcpy from glibc 2.3 and onwards + * while PPC64LE only has one (introduced in glibc 2.17). PPC64LE is + * the more common of the two now so skip versioning. */ + #define GLIBC_COMPAT_SYMBOL(FFF) #elif defined(__amd64__) #define GLIBC_COMPAT_SYMBOL(FFF) asm(".symver " #FFF "," #FFF "@GLIBC_2.2.5"); #else diff --git a/make/stub_includes/platform/gluegen_stddef.h b/make/stub_includes/platform/gluegen_stddef.h index 6272bd1..1500684 100644 --- a/make/stub_includes/platform/gluegen_stddef.h +++ b/make/stub_includes/platform/gluegen_stddef.h @@ -15,7 +15,7 @@ #elif defined(_WIN32) typedef __int32 ptrdiff_t; typedef unsigned __int32 size_t; -#elif defined(__ia64__) || defined(__x86_64__) +#elif defined(__LP64__) || defined(__ia64__) || defined(__x86_64__) || defined(__aarch64__) typedef long ptrdiff_t; typedef unsigned long size_t; #else diff --git a/make/stub_includes/platform/gluegen_stdint.h b/make/stub_includes/platform/gluegen_stdint.h index 8b1dbe3..b277817 100644 --- a/make/stub_includes/platform/gluegen_stdint.h +++ b/make/stub_includes/platform/gluegen_stdint.h @@ -33,7 +33,7 @@ typedef __int32 intptr_t; typedef unsigned __int32 uintptr_t; -#elif defined(__ia64__) || defined(__x86_64__) +#elif defined(__LP64__) || defined(__ia64__) || defined(__x86_64__) || defined(__aarch64__) typedef signed char int8_t; typedef unsigned char uint8_t; typedef signed short int16_t; |