X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d18e17592e7aabd2cb96fd154858e0a3987d2800..f73218921b124d155d21dd1ca4d0b9b467448780:/tools/cmake/GCCFlags.cmake diff --git a/tools/cmake/GCCFlags.cmake b/tools/cmake/GCCFlags.cmake index e1539d5f85..410bcb7fac 100644 --- a/tools/cmake/GCCFlags.cmake +++ b/tools/cmake/GCCFlags.cmake @@ -23,8 +23,10 @@ if(enable_compile_warnings) if(CMAKE_COMPILER_IS_GNUCXX) set(warnCXXFLAGS "${warnCXXFLAGS} -Wclobbered -Wno-error=clobbered -Wno-unused-local-typedefs -Wno-error=attributes") endif() - if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") # don't care about class that become struct - set(warnCXXFLAGS "${warnCXXFLAGS} -Wno-mismatched-tags") + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + # don't care about class that become struct, avoid issue of empty C structs + # size (coming from libunwind.h) + set(warnCXXFLAGS "${warnCXXFLAGS} -Wno-mismatched-tags -Wno-extern-c-compat") endif() # the one specific to C but refused by C++ @@ -121,7 +123,7 @@ if(enable_model-checking AND enable_compile_optimizations) src/xbt/log.c src/xbt/xbt_log_appender_file.c src/xbt/xbt_log_layout_format.c src/xbt/xbt_log_layout_simple.c src/xbt/dict.cpp src/xbt/dict_elm.c src/xbt/dict_cursor.c - src/xbt/dynar.cpp src/xbt/fifo.c src/xbt/heap.c src/xbt/swag.c + src/xbt/dynar.cpp src/xbt/heap.c src/xbt/swag.c src/xbt/str.c src/xbt/strbuff.c src/xbt/snprintf.c src/xbt/queue.c src/xbt/xbt_os_time.c src/xbt/xbt_os_thread.c @@ -171,9 +173,9 @@ if(enable_address_sanitizer) endif() if(enable_thread_sanitizer) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=thread -fno-omit-frame-pointer") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread -fno-omit-frame-pointer") - set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -fsanitize=thread") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=thread -fno-omit-frame-pointer -no-pie") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread -fno-omit-frame-pointer -no-pie") + set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -fsanitize=thread -no-pie") endif() if(enable_undefined_sanitizer) @@ -212,7 +214,7 @@ if(MINGW) set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS} -Wl,--add-stdcall-alias") # Specify the data model that we are using (yeah it may help Java) - if(ARCH_32_BITS) + if(CMAKE_SIZEOF_VOID_P EQUAL 4) # 32 bits set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32") else()