Changeset: 2657fe29eebf for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/2657fe29eebf
Modified Files:
        cmake/monetdb-toolchain.cmake
        monetdb_config.h.in
Branch: default
Log Message:

No unaligned memory access When using the undefined behavior sanitizer.


diffs (33 lines):

diff --git a/cmake/monetdb-toolchain.cmake b/cmake/monetdb-toolchain.cmake
--- a/cmake/monetdb-toolchain.cmake
+++ b/cmake/monetdb-toolchain.cmake
@@ -43,7 +43,6 @@ function(monetdb_default_compiler_option
     if(${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
       add_compile_options("-fsanitize=undefined")
       add_compile_options("-fno-omit-frame-pointer")
-      add_compile_definitions(UNDEFINED)
       if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.13.0")
         add_link_options("-fsanitize=undefined")
       else()
diff --git a/monetdb_config.h.in b/monetdb_config.h.in
--- a/monetdb_config.h.in
+++ b/monetdb_config.h.in
@@ -208,7 +208,8 @@
 #cmakedefine WITH_TCMALLOC 1
 #cmakedefine WITH_MALLOC "@WITH_MALLOC@"
 
-#cmakedefine SANITIZER 1
+#cmakedefine SANITIZER 1               /* address sanitizer */
+#cmakedefine UNDEFINED 1               /* undefined behavior sanitizer */
 
 #define BUILD_TYPE "@BUILD_TYPE@"
 #define EXTRA_C_FLAGS "@EXTRA_C_FLAGS@"
@@ -495,7 +496,7 @@ strndup(const char *s, size_t n)
 }
 #endif
 
-#if !defined(SANITIZER) && (defined(__x86_64__) || defined(__amd64__))
+#if !defined(SANITIZER) && !defined(UNDEFINED) && (defined(__x86_64__) || 
defined(__amd64__))
 /* we can do unaligned access (e.g. read 8-byte value from a location
  * which is not a multiple of 8; the list can be extended when we learn
  * about more architectures */
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to