From e90a2c65519168fd825e57b554cc0d82fffebdc4 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 17 Nov 2013 13:30:46 +0100 Subject: glibc-compat-symbols.h: Use GLIBC_2.0 for 32bit ; Use asm(..) instead of __asm__(..) to support clang ; Branch on OS predef-macro for GLIBC detection, allow __GNUC__ and __clang__ on __linux__ --- make/stub_includes/platform/glibc-compat-symbols.h | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'make/stub_includes') diff --git a/make/stub_includes/platform/glibc-compat-symbols.h b/make/stub_includes/platform/glibc-compat-symbols.h index 5dc1a18..e07641e 100644 --- a/make/stub_includes/platform/glibc-compat-symbols.h +++ b/make/stub_includes/platform/glibc-compat-symbols.h @@ -15,16 +15,21 @@ * * Check build-in macro definitions via 'gcc -dM -E - < /dev/null' */ -#if defined(__GNUC__) && !defined(__clang__) - #if defined(__arm__) - #define GLIBC_COMPAT_SYMBOL(FFF) __asm__(".symver " #FFF "," #FFF "@GLIBC_2.4"); - #elif defined(__amd64__) - #define GLIBC_COMPAT_SYMBOL(FFF) __asm__(".symver " #FFF "," #FFF "@GLIBC_2.2.5"); +#if defined(__linux__) /* Actually we like to test whether we link against GLIBC .. */ + #if defined(__GNUC__) || defined(__clang__) + #if defined(__arm__) + #define GLIBC_COMPAT_SYMBOL(FFF) asm(".symver " #FFF "," #FFF "@GLIBC_2.4"); + #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__*/ #else - #define GLIBC_COMPAT_SYMBOL(FFF) __asm__(".symver " #FFF "," #FFF "@GLIBC_2.2.5"); - #endif /*__amd64__*/ + #warning GLIBC_COMPAT_SYMBOL not supported with current compiler on GNU/Linux + #define GLIBC_COMPAT_SYMBOL(FFF) + #endif #else - #warning GLIBC_COMPAT_SYMBOL not supported with current compiler + #warning GLIBC_COMPAT_SYMBOL not supported with target OS #define GLIBC_COMPAT_SYMBOL(FFF) #endif -- cgit v1.2.3