From 1aed13500d88d701b668f71fdc453cde5fa99f24 Mon Sep 17 00:00:00 2001 From: Patrick Niklaus Date: Fri, 9 Feb 2018 09:57:16 +0000 Subject: [PATCH] Remove GCC 4.9 support. Minimum is now 5.0. --- .travis.yml | 6 +++--- CMakeLists.txt | 21 ++++----------------- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index 81522f631..f8d76c756 100644 --- a/.travis.yml +++ b/.travis.yml @@ -138,12 +138,12 @@ matrix: env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Release' ENABLE_STXXL=On - os: linux - compiler: "gcc-4.9-release" + compiler: "gcc-5-release" addons: &gcc49 apt: sources: ['ubuntu-toolchain-r-test'] - packages: ['g++-4.9', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev', 'ccache'] - env: CCOMPILER='gcc-4.9' CXXCOMPILER='g++-4.9' BUILD_TYPE='Release' + packages: ['g++-5', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev', 'ccache'] + env: CCOMPILER='gcc-5' CXXCOMPILER='g++-5' BUILD_TYPE='Release' - os: linux compiler: "gcc-6-release" diff --git a/CMakeLists.txt b/CMakeLists.txt index 04c9b17f5..7b22cd273 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,10 +101,10 @@ if(WIN32 AND MSVC_VERSION LESS 1900) message(FATAL_ERROR "Building with Microsoft compiler needs Latest Visual Studio 2015 (Community or better)") endif() -# Strictly require GCC>=4.9 and Clang>=3.4 - GCC 4.8 is already too old for C++14. +# Strictly require GCC>=5.0 and Clang>=3.4 - GCC 4.8 is already too old for C++14. if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) - message(FATAL_ERROR "GCC>=4.9 required. In case you are on Ubuntu upgrade via ppa:ubuntu-toolchain-r/test") + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) + message(FATAL_ERROR "GCC>=5.0 required. In case you are on Ubuntu upgrade via ppa:ubuntu-toolchain-r/test") endif() elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4) @@ -258,8 +258,7 @@ if(CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES MinRelSize OR CM endif() # Since gcc 4.9 the LTO format is non-standart ('slim'), so we need to use the build-in tools - if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND - NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9.0 AND NOT MINGW) + if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND NOT MINGW) find_program(GCC_AR gcc-ar) find_program(GCC_RANLIB gcc-ranlib) if ("${GCC_AR}" STREQUAL "GCC_AR-NOTFOUND" OR "${GCC_RANLIB}" STREQUAL "GCC_RANLIB-NOTFOUND") @@ -287,12 +286,6 @@ if(CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES MinRelSize OR CM set(CMAKE_RANLIB ${LLVM_RANLIB}) endif() endif() - - if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9.0) - message(STATUS "Disabling LTO on GCC < 4.9.0 since it is broken, see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57038") - set(CMAKE_CXX_FLAGS "${OLD_CXX_FLAGS}") - set(ENABLE_LTO Off) - endif() endif() endif() @@ -331,12 +324,6 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU") # using GCC set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OSRM_WARNING_FLAGS} -Werror=strict-overflow=1 -Wno-error=maybe-uninitialized -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ${COLOR_FLAG} -fPIC -ftemplate-depth=1024") - # Disable missing field initializer since this has a lot of false positives with incomplete curly-braces - # initialization support on 4.9 - if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=missing-field-initializers") - endif() - if(WIN32) # using mingw add_dependency_defines(-DWIN32) set(OPTIONAL_SOCKET_LIBS ws2_32 wsock32)