From 5fe74532afbd5be15591bac95b40d8d2c9621d32 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Herv=C3=A9=20Poussineau?= Date: Mon, 27 May 2019 12:20:47 +0200 Subject: [PATCH] [CMAKE] Disable --compress-debug-sections on GCC >= 7.0 This leads to 'bad reloc address in section .zdebug_info' --- sdk/cmake/gcc.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sdk/cmake/gcc.cmake b/sdk/cmake/gcc.cmake index 71971f2b6fc..7716f545e4f 100644 --- a/sdk/cmake/gcc.cmake +++ b/sdk/cmake/gcc.cmake @@ -253,7 +253,9 @@ set(CMAKE_EXE_LINKER_FLAGS "-nostdlib -Wl,--enable-auto-image-base,--disable-aut set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_INIT} -Wl,--disable-stdcall-fixup") set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS_INIT} -Wl,--disable-stdcall-fixup") -if((NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") AND (NOT CMAKE_BUILD_TYPE STREQUAL "Release")) +if((CMAKE_C_COMPILER_ID STREQUAL "GNU") AND + (NOT CMAKE_BUILD_TYPE STREQUAL "Release") AND + (NOT CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)) # FIXME: Set this once Clang toolchain works with it set(_compress_debug_sections_flag "-Wa,--compress-debug-sections") endif() -- 2.17.1