[CMAKE] Disable --compress-debug-sections on GCC >= 7.0
authorHervé Poussineau <hpoussin@reactos.org>
Mon, 27 May 2019 10:20:47 +0000 (12:20 +0200)
committerHervé Poussineau <hpoussin@reactos.org>
Mon, 27 May 2019 11:22:40 +0000 (13:22 +0200)
This leads to 'bad reloc address in section .zdebug_info'

sdk/cmake/gcc.cmake

index 71971f2..7716f54 100644 (file)
@@ -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()