@@ -182,6 +182,13 @@ endif()
#-------------------------
# Setup the basic C compiler
+# Some compilation flags are not supported in clang, lets allow users to know
+# whether gcc or clang is used.
+if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
+ set(IS_CLANG_BUILD TRUE)
+else()
+ set(IS_CLANG_BUILD FALSE)
+endif()
RDMA_BuildType()
include_directories(${BUILD_INCLUDE})
@@ -16,8 +16,13 @@ function(rdma_cython_module PY_MODULE)
string(REGEX REPLACE "\\.so$" "" SONAME "${FILENAME}${CMAKE_PYTHON_SO_SUFFIX}")
add_library(${SONAME} SHARED ${CFILE})
+ # We need to disable -fvar-tracking-assignments. It's only supported in gcc
+ # so make sure we're not using clang before doing that.
+ if (NOT ${IS_CLANG_BUILD})
+ set(PYVERBS_DEBUG_FLAGS "-fno-var-tracking-assignments")
+ endif()
set_target_properties(${SONAME} PROPERTIES
- COMPILE_FLAGS "${CMAKE_C_FLAGS} -fPIC -fno-strict-aliasing -Wno-unused-function -Wno-redundant-decls -Wno-shadow -Wno-cast-function-type -Wno-implicit-fallthrough -Wno-unknown-warning -Wno-unknown-warning-option"
+ COMPILE_FLAGS "${CMAKE_C_FLAGS} -fPIC -fno-strict-aliasing -Wno-unused-function -Wno-redundant-decls -Wno-shadow -Wno-cast-function-type -Wno-implicit-fallthrough -Wno-unknown-warning -Wno-unknown-warning-option ${PYVERBS_DEBUG_FLAGS}"
LIBRARY_OUTPUT_DIRECTORY "${BUILD_PYTHON}/${PY_MODULE}"
PREFIX "")
target_link_libraries(${SONAME} LINK_PRIVATE ${PYTHON_LIBRARIES} ibverbs)
The -fvar-tracking-assignment flag is causing the following compilation warning: note: variable tracking size limit exceeded with '-fvar-tracking-assignments', retrying without Since it's a debug flag and not necessary for pyverbs functionality, remove it from pyverbs' build. Signed-off-by: Noa Osherovich <noaos@mellanox.com> Reviewd-by: Leon Romanovsky <leonro@mellanox.com> --- CMakeLists.txt | 7 +++++++ buildlib/pyverbs_functions.cmake | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-)