Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't build mmalloc when !HAVE_THREAD_LOCAL_STORAGE.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Mon, 27 Jan 2014 16:33:17 +0000 (17:33 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Mon, 27 Jan 2014 16:33:24 +0000 (17:33 +0100)
mm_diff.c uses TLS.

buildtools/Cmake/AddTests.cmake
buildtools/Cmake/CompleteInFiles.cmake
buildtools/Cmake/DefinePackages.cmake
buildtools/Cmake/PrintArgs.cmake
buildtools/Cmake/src/internal_config.h.in
include/simgrid_config.h.in
src/xbt/log.c
src/xbt/xbt_main.c
teshsuite/xbt/CMakeLists.txt

index 207890e..5f18e9a 100644 (file)
@@ -69,7 +69,7 @@ if(NOT enable_memcheck)
   # teshsuite/xbt
   ADD_TEST(xbt-log-large                        ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/log_large_test.tesh)
   ADD_TEST(xbt-log-parallel                     ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/parallel_log_crashtest.tesh)
   # teshsuite/xbt
   ADD_TEST(xbt-log-large                        ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/log_large_test.tesh)
   ADD_TEST(xbt-log-parallel                     ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/parallel_log_crashtest.tesh)
-  IF(HAVE_MMAP)
+  IF(HAVE_MMALLOC)
     IF(${ARCH_32_BITS})
       ADD_TEST(xbt-mmalloc-32                   ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/mmalloc_32.tesh)
     ELSE()
     IF(${ARCH_32_BITS})
       ADD_TEST(xbt-mmalloc-32                   ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/mmalloc_32.tesh)
     ELSE()
index 6f12e9b..f1ff59f 100644 (file)
@@ -176,6 +176,12 @@ IF(NOT "${CMAKE_SYSTEM}" MATCHES "Linux" AND NOT "${CMAKE_SYSTEM}" MATCHES "kFre
   message(STATUS "Warning: MMAP is thought as non functional on this architecture (${CMAKE_SYSTEM})")
 ENDIF()
 
   message(STATUS "Warning: MMAP is thought as non functional on this architecture (${CMAKE_SYSTEM})")
 ENDIF()
 
+if(HAVE_MMAP AND HAVE_THREAD_LOCAL_STORAGE)
+  SET(HAVE_MMALLOC 1)
+else()
+  SET(HAVE_MMALLOC 0)
+endif()
+
 if(WIN32) #THOSE FILES ARE FUNCTIONS ARE NOT DETECTED BUT THEY SHOULD...
   set(HAVE_UCONTEXT_H 1)
   set(HAVE_MAKECONTEXT 1)
 if(WIN32) #THOSE FILES ARE FUNCTIONS ARE NOT DETECTED BUT THEY SHOULD...
   set(HAVE_UCONTEXT_H 1)
   set(HAVE_MAKECONTEXT 1)
@@ -215,7 +221,7 @@ else()
   SET(MALLOCATOR_IS_WANTED 0)
 endif()
 
   SET(MALLOCATOR_IS_WANTED 0)
 endif()
 
-if(enable_model-checking AND HAVE_MMAP)
+if(enable_model-checking AND HAVE_MMALLOC)
   SET(HAVE_MC 1)
   SET(MMALLOC_WANT_OVERRIDE_LEGACY 1)
   include(FindLibunwind)
   SET(HAVE_MC 1)
   SET(MMALLOC_WANT_OVERRIDE_LEGACY 1)
   include(FindLibunwind)
index e88d4e4..69eeb65 100644 (file)
@@ -278,7 +278,7 @@ set(XBT_SRC
   src/xbt_modinter.h
   )
 
   src/xbt_modinter.h
   )
 
-if(HAVE_MMAP)
+if(HAVE_MMALLOC)
   set(XBT_SRC
     ${XBT_SRC}
     src/xbt/mmalloc/mm.c
   set(XBT_SRC
     ${XBT_SRC}
     src/xbt/mmalloc/mm.c
index 3cf6c06..6e12615 100644 (file)
@@ -63,6 +63,7 @@ if(enable_print_message)
   message("HAVE_VASPRINTF ..............: ${HAVE_VASPRINTF}")
   message("HAVE_MMAP ...................: ${HAVE_MMAP}")
   message("HAVE_THREAD_LOCAL_STORAGE ...: ${HAVE_THREAD_LOCAL_STORAGE}")
   message("HAVE_VASPRINTF ..............: ${HAVE_VASPRINTF}")
   message("HAVE_MMAP ...................: ${HAVE_MMAP}")
   message("HAVE_THREAD_LOCAL_STORAGE ...: ${HAVE_THREAD_LOCAL_STORAGE}")
+  message("HAVE_MMALLOC ................: ${HAVE_MMALLOC}")
   message("")
   message("CONTEXT_THREADS .............: ${CONTEXT_THREADS}")
   message("CONTEXT_UCONTEXT ............: ${CONTEXT_UCONTEXT}")
   message("")
   message("CONTEXT_THREADS .............: ${CONTEXT_THREADS}")
   message("CONTEXT_UCONTEXT ............: ${CONTEXT_UCONTEXT}")
index 43270cc..e96a565 100644 (file)
@@ -3,7 +3,7 @@
 /* This file is AUTOMATICALLY GENERATED by Cmake. Edit the following
    template instead buildtools/Cmake/src/internal_config.h.in               */
 
 /* This file is AUTOMATICALLY GENERATED by Cmake. Edit the following
    template instead buildtools/Cmake/src/internal_config.h.in               */
 
-/* Copyright (c) 2004-2013. The SimGrid Team.
+/* Copyright (c) 2004-2014. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
 /* Define to 1 if you have the <execinfo.h> header file. */
 #cmakedefine HAVE_EXECINFO_H @HAVE_EXECINFO_H@
 
 /* Define to 1 if you have the <execinfo.h> header file. */
 #cmakedefine HAVE_EXECINFO_H @HAVE_EXECINFO_H@
 
-/* Define to 1 if you have the `mmap' function. */
-#cmakedefine HAVE_MMAP @HAVE_MMAP@
+/* Define to 1 if mmalloc is compiled in. */
+#cmakedefine HAVE_MMALLOC @HAVE_MMALLOC@
 
 /* Define to 1 if you have the `getdtablesize' function. */
 #cmakedefine HAVE_GETDTABLESIZE @HAVE_GETDTABLESIZE@
 
 /* Define to 1 if you have the `getdtablesize' function. */
 #cmakedefine HAVE_GETDTABLESIZE @HAVE_GETDTABLESIZE@
index 789464f..93a4f6b 100644 (file)
@@ -1,6 +1,6 @@
 /* simgrid_config.h - Results of the configure made visible to user code    */
 
 /* simgrid_config.h - Results of the configure made visible to user code    */
 
-/* Copyright (c) 2009-2013. The SimGrid Team.
+/* Copyright (c) 2009-2014. The SimGrid Team.
    All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
    All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -70,8 +70,8 @@ XBT_PUBLIC_DATA(xbt_dynar_t) sg_cmdline;
 #endif
 
 
 #endif
 
 
-/* Define to 1 if you have the `mmap' function. */
-#cmakedefine HAVE_MMAP @HAVE_MMAP@
+/* Define to 1 if mmalloc is compiled in. */
+#cmakedefine HAVE_MMALLOC @HAVE_MMALLOC@
 
 /* Get the config */
 #undef SIMGRID_NEED_ASPRINTF
 
 /* Get the config */
 #undef SIMGRID_NEED_ASPRINTF
index 952429d..4c527ce 100644 (file)
@@ -546,7 +546,7 @@ static void xbt_log_connect_categories(void)
   XBT_LOG_CONNECT(xbt);
   XBT_LOG_CONNECT(graphxml_parse);
   XBT_LOG_CONNECT(log);
   XBT_LOG_CONNECT(xbt);
   XBT_LOG_CONNECT(graphxml_parse);
   XBT_LOG_CONNECT(log);
-#if HAVE_MMAP
+#if HAVE_MMALLOC
   XBT_LOG_CONNECT(mm_diff);
 #endif
   XBT_LOG_CONNECT(module);
   XBT_LOG_CONNECT(mm_diff);
 #endif
   XBT_LOG_CONNECT(module);
index 141e329..26e8dd1 100644 (file)
@@ -1,14 +1,14 @@
 /* module handling                                                          */
 
 /* module handling                                                          */
 
-/* Copyright (c) 2006-2013. The SimGrid Team.
+/* Copyright (c) 2006-2014. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "xbt/misc.h"
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "xbt/misc.h"
-#include "simgrid_config.h"     /*HAVE_MMAP _XBT_WIN32 */
-#include "internal_config.h"        /* MMALLOC_WANT_OVERRIDE_LEGACY */
+#include "simgrid_config.h"     /* _XBT_WIN32 */
+#include "internal_config.h"    /* MMALLOC_WANT_OVERRIDE_LEGACY */
 
 #include "xbt/sysdep.h"
 #include "xbt/log.h"
 
 #include "xbt/sysdep.h"
 #include "xbt/log.h"
index a181c6d..a7e9235 100644 (file)
@@ -4,7 +4,7 @@ set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
 
 add_executable(log_large_test log_large_test.c)
 add_executable(parallel_log_crashtest parallel_log_crashtest.c)
 
 add_executable(log_large_test log_large_test.c)
 add_executable(parallel_log_crashtest parallel_log_crashtest.c)
-if(HAVE_MMAP)
+if(HAVE_MMALLOC)
   add_executable(mmalloc_test mmalloc_test.c)
 endif()
 add_executable(parmap_test parmap_test.c)
   add_executable(mmalloc_test mmalloc_test.c)
 endif()
 add_executable(parmap_test parmap_test.c)
@@ -13,7 +13,7 @@ add_executable(parmap_test parmap_test.c)
 ### Add definitions for compile
 target_link_libraries(log_large_test simgrid)
 target_link_libraries(parallel_log_crashtest simgrid)
 ### Add definitions for compile
 target_link_libraries(log_large_test simgrid)
 target_link_libraries(parallel_log_crashtest simgrid)
-if(HAVE_MMAP)
+if(HAVE_MMALLOC)
   target_link_libraries(mmalloc_test simgrid)
 endif()
 target_link_libraries(parmap_test simgrid)
   target_link_libraries(mmalloc_test simgrid)
 endif()
 target_link_libraries(parmap_test simgrid)