build: fix vpp compilation failure on ThunderX2 and Amp 79/20379/6
authorJianlin Lv <Jianlin.Lv@arm.com>
Thu, 27 Jun 2019 05:50:30 +0000 (13:50 +0800)
committerDamjan Marion <dmarion@me.com>
Mon, 19 Aug 2019 10:38:35 +0000 (10:38 +0000)
fix compile issue that caused by enabling "-mtune=thunderx2t99"
flag during compilation, such as
"/opt/vpp-agent/dev/vpp/src/vnet/interface_stats.c:164:1:
internal compiler error: Segmentation fault"

Type: fix

Change-Id: Iaf9f80a6c203a7e5b6a40523f14a62bb37091c92
Signed-off-by: Jianlin Lv <Jianlin.Lv@arm.com>
src/cmake/cpu.cmake

index e586ecc..1dd4834 100644 (file)
@@ -76,7 +76,7 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*)")
   endif()
   check_c_compiler_flag("-march=armv8.1-a+crc+crypto -mtune=thunderx2t99" compiler_flag_march_thunderx2t99)
   if(compiler_flag_march_thunderx2t99)
-    if (CMAKE_C_COMPILER_VERSION VERSION_GREATER 7.3)
+    if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 8.3)
       list(APPEND MARCH_VARIANTS "thunderx2t99\;-march=armv8.1-a+crc+crypto -mtune=thunderx2t99 -DCLIB_N_PREFETCHES=8")
     else()
       list(APPEND MARCH_VARIANTS "thunderx2t99\;-march=armv8.1-a+crc+crypto -DCLIB_N_PREFETCHES=8")