aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2019-04-07 23:11:45 +0200
committerSven Gothel <[email protected]>2019-04-07 23:11:45 +0200
commit8efa4c7ba5ee8eb399d31a9884e45f743d4625ad (patch)
treee01314c92ade59cb285600aa0c294ad9b6bdd081 /cmake
parent42de534f0f15ba3e9702ffb8e487c3d5f375ac1e (diff)
Bug 1190: Updating glibc-compat-symbols.h ; Fix armv6hf + adding aarch64 cmake options
Note armv6hf won't compile through due to some neon inline argument mismatch errors. aarch64 did produce a native library, despite tons of warnings.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/glibc-compat-symbols.h22
-rw-r--r--cmake/toolchain.gcc-aarch64.cmake (renamed from cmake/toolchain.gcc-armv6.cmake)6
-rw-r--r--cmake/toolchain.gcc-armv6hf.cmake6
3 files changed, 24 insertions, 10 deletions
diff --git a/cmake/glibc-compat-symbols.h b/cmake/glibc-compat-symbols.h
index 4c9c933c..d8d0d172 100644
--- a/cmake/glibc-compat-symbols.h
+++ b/cmake/glibc-compat-symbols.h
@@ -17,16 +17,30 @@
*/
#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(__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(__amd64__)
#define GLIBC_COMPAT_SYMBOL(FFF) asm(".symver " #FFF "," #FFF "@GLIBC_2.2.5");
#else
@@ -37,7 +51,7 @@
#define GLIBC_COMPAT_SYMBOL(FFF)
#endif
#else
- // #warning GLIBC_COMPAT_SYMBOL not supported with target OS
+ #warning GLIBC_COMPAT_SYMBOL not supported with target OS
#define GLIBC_COMPAT_SYMBOL(FFF)
#endif
diff --git a/cmake/toolchain.gcc-armv6.cmake b/cmake/toolchain.gcc-aarch64.cmake
index 93c374b5..44b9d47b 100644
--- a/cmake/toolchain.gcc-armv6.cmake
+++ b/cmake/toolchain.gcc-aarch64.cmake
@@ -1,12 +1,12 @@
# For normal gcc compilation, but use static-libgcc
-set(CMAKE_C_FLAGS "-fpic -march=armv5te -marm -mfloat-abi=softfp -include ${PROJECT_SOURCE_DIR}/cmake/glibc-compat-symbols.h -I/usr/include")
-set(CMAKE_CXX_FLAGS "-fpic -march=armv5te -marm -mfloat-abi=softfp -include ${PROJECT_SOURCE_DIR}/cmake/glibc-compat-symbols.h -I/usr/include")
+set(CMAKE_C_FLAGS "-fpic -march=armv8-a -include ${PROJECT_SOURCE_DIR}/cmake/glibc-compat-symbols.h -I/usr/include")
+set(CMAKE_CXX_FLAGS "-fpic -march=armv8-a -include ${PROJECT_SOURCE_DIR}/cmake/glibc-compat-symbols.h -I/usr/include")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c++ flags")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c flags")
-set(LINKER_FLAGS "-fpic -march=armv5te -marm -mfloat-abi=softfp -static-libgcc")
+set(LINKER_FLAGS "-fpic -march=armv8-a -static-libgcc")
set(CMAKE_SHARED_LINKER_FLAGS "${LINKER_FLAGS}" CACHE STRING "linker flags" FORCE)
set(CMAKE_MODULE_LINKER_FLAGS "${LINKER_FLAGS}" CACHE STRING "linker flags" FORCE)
diff --git a/cmake/toolchain.gcc-armv6hf.cmake b/cmake/toolchain.gcc-armv6hf.cmake
index ec239661..7648aa4d 100644
--- a/cmake/toolchain.gcc-armv6hf.cmake
+++ b/cmake/toolchain.gcc-armv6hf.cmake
@@ -1,12 +1,12 @@
# For normal gcc compilation, but use static-libgcc
-set(CMAKE_C_FLAGS "-fpic -march=armv6 -marm -mfloat-abi=hard -include ${PROJECT_SOURCE_DIR}/cmake/glibc-compat-symbols.h -I/usr/include")
-set(CMAKE_CXX_FLAGS "-fpic -march=armv6 -marm -mfloat-abi=hard -include ${PROJECT_SOURCE_DIR}/cmake/glibc-compat-symbols.h -I/usr/include")
+set(CMAKE_C_FLAGS "-fpic -march=armv6 -mfpu=vfp -mfloat-abi=hard -marm -include ${PROJECT_SOURCE_DIR}/cmake/glibc-compat-symbols.h -I/usr/include")
+set(CMAKE_CXX_FLAGS "-fpic -march=armv6 -mfpu=vfp -mfloat-abi=hard -marm -include ${PROJECT_SOURCE_DIR}/cmake/glibc-compat-symbols.h -I/usr/include")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c++ flags")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c flags")
-set(LINKER_FLAGS "-fpic -march=armv6 -marm -mfloat-abi=hard -static-libgcc")
+set(LINKER_FLAGS "-fpic -march=armv6 -mfpu=vfp -mfloat-abi=hard -marm -static-libgcc")
set(CMAKE_SHARED_LINKER_FLAGS "${LINKER_FLAGS}" CACHE STRING "linker flags" FORCE)
set(CMAKE_MODULE_LINKER_FLAGS "${LINKER_FLAGS}" CACHE STRING "linker flags" FORCE)