diff options
author | NanoAkron <nanoakron@users.noreply.github.com> | 2016-11-11 00:35:58 +0000 |
---|---|---|
committer | NanoAkron <nanoakron@users.noreply.github.com> | 2016-11-12 00:26:49 +0000 |
commit | 65528aef4e1b15f9eabe39ae71a2946f710b6641 (patch) | |
tree | fca0a94a0694e0854962bec6bc0b5f6499345224 /CMakeLists.txt | |
parent | Merge pull request #1312 (diff) | |
download | monero-65528aef4e1b15f9eabe39ae71a2946f710b6641.tar.xz |
Always compile Position Independent Code on 64-bit ARMv8 systems
Diffstat (limited to '')
-rw-r--r-- | CMakeLists.txt | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d4f4f24b..020aa0c37 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,6 +80,7 @@ endif() if (ARM_ID STREQUAL "aarch64") set(ARM 1) set(ARM8 1) + set(BUILD_SHARED_LIBS ON) endif() if(WIN32 OR ARM) @@ -182,10 +183,11 @@ option(STATIC "Link libraries statically" ${DEFAULT_STATIC}) # This is a CMake built-in switch that concerns internal libraries if (NOT DEFINED BUILD_SHARED_LIBS AND NOT STATIC AND CMAKE_BUILD_TYPE_LOWER STREQUAL "debug") - set(BUILD_SHARED_LIBS ON CACHE STRING "Build internal libs as shared") + set(BUILD_SHARED_LIBS ON) endif() + if (BUILD_SHARED_LIBS) - message(STATUS "Building internal libraries as shared") + message(STATUS "Building internal libraries with position independent code") set(PIC_FLAG "-fPIC") else() message(STATUS "Building internal libraries as static") @@ -378,9 +380,6 @@ else() set(COVERAGE_FLAGS "-fprofile-arcs -ftest-coverage --coverage") endif() - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -D_GNU_SOURCE ${MINGW_FLAG} ${STATIC_ASSERT_FLAG} ${WARNINGS} ${C_WARNINGS} ${ARCH_FLAG} ${COVERAGE_FLAGS} ${PIC_FLAG}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -D_GNU_SOURCE ${MINGW_FLAG} ${WARNINGS} ${CXX_WARNINGS} ${ARCH_FLAG} ${COVERAGE_FLAGS} ${PIC_FLAG}") - # With GCC 6.1.1 the compiled binary malfunctions due to aliasing. Until that # is fixed in the code (Issue #847), force compiler to be conservative. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing") @@ -408,8 +407,8 @@ else() message(STATUS "AES support disabled") endif() - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -D_GNU_SOURCE ${MINGW_FLAG} ${STATIC_ASSERT_FLAG} ${WARNINGS} ${C_WARNINGS} ${ARCH_FLAG} ${COVERAGE_FLAGS}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -D_GNU_SOURCE ${MINGW_FLAG} ${WARNINGS} ${CXX_WARNINGS} ${ARCH_FLAG} ${COVERAGE_FLAGS}") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -D_GNU_SOURCE ${MINGW_FLAG} ${STATIC_ASSERT_FLAG} ${WARNINGS} ${C_WARNINGS} ${ARCH_FLAG} ${COVERAGE_FLAGS} ${PIC_FLAG}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -D_GNU_SOURCE ${MINGW_FLAG} ${STATIC_ASSERT_FLAG} ${WARNINGS} ${CXX_WARNINGS} ${ARCH_FLAG} ${COVERAGE_FLAGS} ${PIC_FLAG}") # With GCC 6.1.1 the compiled binary malfunctions due to aliasing. Until that # is fixed in the code (Issue #847), force compiler to be conservative. |