OSDN Git Service

build: Remove the cmake check for malloc.h.
authorPeter Collingbourne <peter@pcc.me.uk>
Wed, 6 Feb 2019 19:20:47 +0000 (19:20 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Wed, 6 Feb 2019 19:20:47 +0000 (19:20 +0000)
As far as I can tell, malloc.h is only being used here to provide
a definition of mallinfo (malloc itself is declared in stdlib.h via
cstdlib). We already have a macro for whether mallinfo is available,
so switch to using that instead.

Differential Revision: https://reviews.llvm.org/D57807

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353329 91177308-0d34-0410-b5e6-96231b3b80d8

cmake/config-ix.cmake
include/llvm/Config/config.h.cmake
lib/Support/Unix/Process.inc
utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn

index 9e9e28f..18026d6 100644 (file)
@@ -28,7 +28,6 @@ check_include_file(dlfcn.h HAVE_DLFCN_H)
 check_include_file(errno.h HAVE_ERRNO_H)
 check_include_file(fcntl.h HAVE_FCNTL_H)
 check_include_file(link.h HAVE_LINK_H)
-check_include_file(malloc.h HAVE_MALLOC_H)
 check_include_file(malloc/malloc.h HAVE_MALLOC_MALLOC_H)
 if( NOT PURE_WINDOWS )
   check_include_file(pthread.h HAVE_PTHREAD_H)
index a66d0fa..53e6c20 100644 (file)
 /* Define to 1 if you have the `mallinfo' function. */
 #cmakedefine HAVE_MALLINFO ${HAVE_MALLINFO}
 
-/* Define to 1 if you have the <malloc.h> header file. */
-#cmakedefine HAVE_MALLOC_H ${HAVE_MALLOC_H}
-
 /* Define to 1 if you have the <malloc/malloc.h> header file. */
 #cmakedefine HAVE_MALLOC_MALLOC_H ${HAVE_MALLOC_MALLOC_H}
 
index 4597ea4..7c834f9 100644 (file)
 #if HAVE_SIGNAL_H
 #include <signal.h>
 #endif
-// DragonFlyBSD, and OpenBSD have deprecated <malloc.h> for
-// <stdlib.h> instead. Unix.h includes this for us already.
-#if defined(HAVE_MALLOC_H) && !defined(__DragonFly__) && \
-    !defined(__OpenBSD__) 
+#if defined(HAVE_MALLINFO)
 #include <malloc.h>
 #endif
 #if defined(HAVE_MALLCTL)
index 0bf598d..ebeb6f3 100644 (file)
@@ -159,7 +159,6 @@ write_cmake_config("config") {
       "HAVE_CRASHREPORTER_INFO=1",
       "HAVE_DECL_ARC4RANDOM=1",
       "HAVE_DLADDR=1",
-      "HAVE_MALLOC_H=",
       "HAVE_MACH_MACH_H=1",
       "HAVE_MALLOC_MALLOC_H=1",
       "HAVE_MALLOC_ZONE_STATISTICS=1",
@@ -171,7 +170,6 @@ write_cmake_config("config") {
       "HAVE_DECL_ARC4RANDOM=",
       "HAVE_DLADDR=",
       "HAVE_MACH_MACH_H=",
-      "HAVE_MALLOC_H=1",
       "HAVE_MALLOC_MALLOC_H=",
       "HAVE_MALLOC_ZONE_STATISTICS=",
       "HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC=",