Skip to content

Commit

Permalink
Update libc++ and libc++abi
Browse files Browse the repository at this point in the history
  • Loading branch information
abyss7 committed Jan 9, 2019
1 parent f9eb376 commit 3566412
Show file tree
Hide file tree
Showing 9 changed files with 145 additions and 103 deletions.
6 changes: 4 additions & 2 deletions build/config/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ config("base") {
"-Werror",
]

cflags_cc = [ "-std=c++14" ]
cflags_cc = [ "-std=c++17" ]

include_dirs = [
"//src",
Expand All @@ -23,10 +23,12 @@ config("default_library") {
cflags = [ "-fPIC" ]

cflags_cc = [
"-std=c++14",
"-std=c++17",
"-nostdinc++",
]

defines = [ "_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS" ]

include_dirs = [ "//src/third_party/libcxx/exported/include" ]

ldflags = [ "-nodefaultlibs" ]
Expand Down
2 changes: 1 addition & 1 deletion build/config/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ config("base") {
defines = [ "OS_LINUX" ]

ldflags = [
"-fuse-ld=gold",
"-fuse-ld=lld",
"-rdynamic", # for |backtrace()|
"-rpath",
"\$ORIGIN",
Expand Down
1 change: 1 addition & 0 deletions src/third_party/gperftools/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ source_set("tcmalloc_internal") {
"exported/src/base/low_level_alloc.cc",
"exported/src/central_freelist.cc",
"exported/src/common.cc",
"exported/src/emergency_malloc_for_stacktrace.cc",
"exported/src/heap-profile-table.cc",
"exported/src/heap-profiler.cc",
"exported/src/internal_logging.cc",
Expand Down
2 changes: 1 addition & 1 deletion src/third_party/gperftools/exported
Submodule exported updated 182 files
56 changes: 35 additions & 21 deletions src/third_party/gperftools/linux/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
#define GPERFTOOLS_CONFIG_H_


/* Build new/delete operators for overaligned types */
#define ENABLE_ALIGNED_NEW_DELETE 1

/* Build runtime detection for sized delete */
/* #undef ENABLE_DYNAMIC_SIZED_DELETE */

/* Build sized deletion operators */
/* #undef ENABLE_SIZED_DELETE */

/* Define to 1 if compiler supports __builtin_expect */
#define HAVE_BUILTIN_EXPECT 1

Expand All @@ -24,7 +33,7 @@

/* Define to 1 if you have the declaration of `cfree', and to 0 if you don't.
*/
#define HAVE_DECL_CFREE 1
#define HAVE_DECL_CFREE 0

/* Define to 1 if you have the declaration of `memalign', and to 0 if you
don't. */
Expand Down Expand Up @@ -93,12 +102,12 @@
/* Define to 1 if you have the <linux/ptrace.h> header file. */
#define HAVE_LINUX_PTRACE_H 1

/* Define if this is Linux that has SIGEV_THREAD_ID */
#define HAVE_LINUX_SIGEV_THREAD_ID 1

/* Define to 1 if you have the <malloc.h> header file. */
#define HAVE_MALLOC_H 1

/* Define to 1 if you have the <malloc/malloc.h> header file. */
/* #undef HAVE_MALLOC_MALLOC_H */

/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1

Expand Down Expand Up @@ -148,9 +157,6 @@
/* Define to 1 if you have the <sys/cdefs.h> header file. */
#define HAVE_SYS_CDEFS_H 1

/* Define to 1 if you have the <sys/malloc.h> header file. */
/* #undef HAVE_SYS_MALLOC_H */

/* Define to 1 if you have the <sys/param.h> header file. */
#define HAVE_SYS_PARAM_H 1

Expand All @@ -172,7 +178,7 @@
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1

/* <sys/ucontext.h> is broken on redhat 7 */
/* Define to 1 if you have the <sys/ucontext.h> header file. */
#define HAVE_SYS_UCONTEXT_H 1

/* Define to 1 if you have the <sys/wait.h> header file. */
Expand All @@ -187,6 +193,9 @@
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1

/* Whether <unwind.h> contains _Unwind_Backtrace */
#define HAVE_UNWIND_BACKTRACE 1

/* Define to 1 if you have the <unwind.h> header file. */
#define HAVE_UNWIND_H 1

Expand All @@ -196,6 +205,9 @@
/* define if your compiler has __attribute__ */
#define HAVE___ATTRIBUTE__ 1

/* define if your compiler supports alignment of functions */
#define HAVE___ATTRIBUTE__ALIGNED_FN 1

/* Define to 1 if compiler supports __environ */
#define HAVE___ENVIRON 1

Expand All @@ -208,27 +220,20 @@
/* Define to 1 if int32_t is equivalent to intptr_t */
/* #undef INT32_EQUALS_INTPTR */

/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
/* Define to the sub-directory where libtool stores uninstalled libraries. */
#define LT_OBJDIR ".libs/"

/* Define to 'volatile' if __malloc_hook is declared volatile */
#define MALLOC_HOOK_MAYBE_VOLATILE volatile

/* Define to 1 if your C compiler doesn't accept -c and -o together. */
/* #undef NO_MINUS_C_MINUS_O */

/* Name of package */
#define PACKAGE "gperftools"

/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "google-perftools@googlegroups.com"
#define PACKAGE_BUGREPORT "gperftools@googlegroups.com"

/* Define to the full name of this package. */
#define PACKAGE_NAME "gperftools"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "gperftools 2.2.1"
#define PACKAGE_STRING "gperftools 2.7"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "gperftools"
Expand All @@ -237,7 +242,7 @@
#define PACKAGE_URL ""

/* Define to the version of this package. */
#define PACKAGE_VERSION "2.2.1"
#define PACKAGE_VERSION "2.7"

/* How to access the PC from a struct ucontext */
#define PC_FROM_UCONTEXT uc_mcontext.gregs[REG_RIP]
Expand Down Expand Up @@ -269,13 +274,22 @@
/* #undef PTHREAD_CREATE_JOINABLE */

/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* #undef STDC_HEADERS */

/* the namespace where STL code like vector<> is defined */
#define STL_NAMESPACE std

/* Define 32K of internal pages size for tcmalloc */
/* #undef TCMALLOC_32K_PAGES */

/* Define 64K of internal pages size for tcmalloc */
/* #undef TCMALLOC_64K_PAGES */

/* Define 8 bytes of allocation alignment for tcmalloc */
/* #undef TCMALLOC_ALIGN_8BYTES */

/* Version number of package */
#define VERSION "2.2.1"
#define VERSION "2.7"

/* C99 says: define this to get the PRI... macros from stdint.h */
#ifndef __STDC_FORMAT_MACROS
Expand Down
154 changes: 91 additions & 63 deletions src/third_party/gperftools/linux/gperftools/tcmalloc.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*-
// -*- Mode: C; c-basic-offset: 2; indent-tabs-mode: nil -*-
/* Copyright (c) 2003, Google Inc.
* All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
Expand All @@ -15,7 +15,7 @@
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
Expand All @@ -36,37 +36,38 @@
#ifndef TCMALLOC_TCMALLOC_H_
#define TCMALLOC_TCMALLOC_H_

#include <stddef.h> // for size_t
#ifdef HAVE_SYS_CDEFS_H
#include <sys/cdefs.h> // where glibc defines __THROW
#endif

// __THROW is defined in glibc systems. It means, counter-intuitively,
// "This function will never throw an exception." It's an optional
// optimization tool, but we may need to use it to match glibc prototypes.
#ifndef __THROW /* I guess we're not on a glibc system */
# define __THROW /* __THROW is just an optimization, so ok to make it "" */
#include <stddef.h> /* for size_t */
#ifdef __cplusplus
#include <new> /* for std::nothrow_t, std::align_val_t */
#endif

// Define the version number so folks can check against it
/* Define the version number so folks can check against it */
#define TC_VERSION_MAJOR 2
#define TC_VERSION_MINOR 2
#define TC_VERSION_PATCH ".1"
#define TC_VERSION_STRING "gperftools 2.2.1"

// For struct mallinfo, if it's defined.
#ifdef HAVE_STRUCT_MALLINFO
// Malloc can be in several places on older versions of OS X.
# if defined(HAVE_MALLOC_H)
#define TC_VERSION_MINOR 7
#define TC_VERSION_PATCH ""
#define TC_VERSION_STRING "gperftools 2.7"

/* For struct mallinfo, if it's defined. */
#if 1
# include <malloc.h>
# elif defined(HAVE_SYS_MALLOC_H)
# include <sys/malloc.h>
# elif defined(HAVE_MALLOC_MALLOC_H)
# include <malloc/malloc.h>
#endif

#ifndef PERFTOOLS_NOTHROW

#if __cplusplus >= 201103L
#define PERFTOOLS_NOTHROW noexcept
#elif defined(__cplusplus)
#define PERFTOOLS_NOTHROW throw()
#else
# ifdef __GNUC__
# define PERFTOOLS_NOTHROW __attribute__((__nothrow__))
# else
# define PERFTOOLS_NOTHROW
# endif
#endif

// Annoying stuff for windows -- makes sure clients can import these functions
#endif

#ifndef PERFTOOLS_DLL_DECL
# ifdef _WIN32
# define PERFTOOLS_DLL_DECL __declspec(dllimport)
Expand All @@ -76,60 +77,87 @@
#endif

#ifdef __cplusplus
namespace std {
struct nothrow_t;
}

extern "C" {
#endif
// Returns a human-readable version string. If major, minor,
// and/or patch are not NULL, they are set to the major version,
// minor version, and patch-code (a string, usually "").
/*
* Returns a human-readable version string. If major, minor,
* and/or patch are not NULL, they are set to the major version,
* minor version, and patch-code (a string, usually "").
*/
PERFTOOLS_DLL_DECL const char* tc_version(int* major, int* minor,
const char** patch) __THROW;
const char** patch) PERFTOOLS_NOTHROW;

PERFTOOLS_DLL_DECL void* tc_malloc(size_t size) __THROW;
PERFTOOLS_DLL_DECL void* tc_malloc_skip_new_handler(size_t size) __THROW;
PERFTOOLS_DLL_DECL void tc_free(void* ptr) __THROW;
PERFTOOLS_DLL_DECL void* tc_realloc(void* ptr, size_t size) __THROW;
PERFTOOLS_DLL_DECL void* tc_calloc(size_t nmemb, size_t size) __THROW;
PERFTOOLS_DLL_DECL void tc_cfree(void* ptr) __THROW;
PERFTOOLS_DLL_DECL void* tc_malloc(size_t size) PERFTOOLS_NOTHROW;
PERFTOOLS_DLL_DECL void* tc_malloc_skip_new_handler(size_t size) PERFTOOLS_NOTHROW;
PERFTOOLS_DLL_DECL void tc_free(void* ptr) PERFTOOLS_NOTHROW;
PERFTOOLS_DLL_DECL void tc_free_sized(void *ptr, size_t size) PERFTOOLS_NOTHROW;
PERFTOOLS_DLL_DECL void* tc_realloc(void* ptr, size_t size) PERFTOOLS_NOTHROW;
PERFTOOLS_DLL_DECL void* tc_calloc(size_t nmemb, size_t size) PERFTOOLS_NOTHROW;
PERFTOOLS_DLL_DECL void tc_cfree(void* ptr) PERFTOOLS_NOTHROW;

PERFTOOLS_DLL_DECL void* tc_memalign(size_t __alignment,
size_t __size) __THROW;
size_t __size) PERFTOOLS_NOTHROW;
PERFTOOLS_DLL_DECL int tc_posix_memalign(void** ptr,
size_t align, size_t size) __THROW;
PERFTOOLS_DLL_DECL void* tc_valloc(size_t __size) __THROW;
PERFTOOLS_DLL_DECL void* tc_pvalloc(size_t __size) __THROW;
size_t align, size_t size) PERFTOOLS_NOTHROW;
PERFTOOLS_DLL_DECL void* tc_valloc(size_t __size) PERFTOOLS_NOTHROW;
PERFTOOLS_DLL_DECL void* tc_pvalloc(size_t __size) PERFTOOLS_NOTHROW;

PERFTOOLS_DLL_DECL void tc_malloc_stats(void) __THROW;
PERFTOOLS_DLL_DECL int tc_mallopt(int cmd, int value) __THROW;
PERFTOOLS_DLL_DECL void tc_malloc_stats(void) PERFTOOLS_NOTHROW;
PERFTOOLS_DLL_DECL int tc_mallopt(int cmd, int value) PERFTOOLS_NOTHROW;
#if 1
PERFTOOLS_DLL_DECL struct mallinfo tc_mallinfo(void) __THROW;
PERFTOOLS_DLL_DECL struct mallinfo tc_mallinfo(void) PERFTOOLS_NOTHROW;
#endif

// This is an alias for MallocExtension::instance()->GetAllocatedSize().
// It is equivalent to
// OS X: malloc_size()
// glibc: malloc_usable_size()
// Windows: _msize()
PERFTOOLS_DLL_DECL size_t tc_malloc_size(void* ptr) __THROW;
/*
* This is an alias for MallocExtension::instance()->GetAllocatedSize().
* It is equivalent to
* OS X: malloc_size()
* glibc: malloc_usable_size()
* Windows: _msize()
*/
PERFTOOLS_DLL_DECL size_t tc_malloc_size(void* ptr) PERFTOOLS_NOTHROW;

#ifdef __cplusplus
PERFTOOLS_DLL_DECL int tc_set_new_mode(int flag) __THROW;
PERFTOOLS_DLL_DECL int tc_set_new_mode(int flag) PERFTOOLS_NOTHROW;
PERFTOOLS_DLL_DECL void* tc_new(size_t size);
PERFTOOLS_DLL_DECL void* tc_new_nothrow(size_t size,
const std::nothrow_t&) __THROW;
PERFTOOLS_DLL_DECL void tc_delete(void* p) __THROW;
const std::nothrow_t&) PERFTOOLS_NOTHROW;
PERFTOOLS_DLL_DECL void tc_delete(void* p) PERFTOOLS_NOTHROW;
PERFTOOLS_DLL_DECL void tc_delete_sized(void* p, size_t size) PERFTOOLS_NOTHROW;
PERFTOOLS_DLL_DECL void tc_delete_nothrow(void* p,
const std::nothrow_t&) __THROW;
const std::nothrow_t&) PERFTOOLS_NOTHROW;
PERFTOOLS_DLL_DECL void* tc_newarray(size_t size);
PERFTOOLS_DLL_DECL void* tc_newarray_nothrow(size_t size,
const std::nothrow_t&) __THROW;
PERFTOOLS_DLL_DECL void tc_deletearray(void* p) __THROW;
const std::nothrow_t&) PERFTOOLS_NOTHROW;
PERFTOOLS_DLL_DECL void tc_deletearray(void* p) PERFTOOLS_NOTHROW;
PERFTOOLS_DLL_DECL void tc_deletearray_sized(void* p, size_t size) PERFTOOLS_NOTHROW;
PERFTOOLS_DLL_DECL void tc_deletearray_nothrow(void* p,
const std::nothrow_t&) __THROW;
const std::nothrow_t&) PERFTOOLS_NOTHROW;

#if 1 && __cplusplus >= 201703L
PERFTOOLS_DLL_DECL void* tc_new_aligned(size_t size, std::align_val_t al);
PERFTOOLS_DLL_DECL void* tc_new_aligned_nothrow(size_t size, std::align_val_t al,
const std::nothrow_t&) PERFTOOLS_NOTHROW;
PERFTOOLS_DLL_DECL void tc_delete_aligned(void* p, std::align_val_t al) PERFTOOLS_NOTHROW;
PERFTOOLS_DLL_DECL void tc_delete_sized_aligned(void* p, size_t size, std::align_val_t al) PERFTOOLS_NOTHROW;
PERFTOOLS_DLL_DECL void tc_delete_aligned_nothrow(void* p, std::align_val_t al,
const std::nothrow_t&) PERFTOOLS_NOTHROW;
PERFTOOLS_DLL_DECL void* tc_newarray_aligned(size_t size, std::align_val_t al);
PERFTOOLS_DLL_DECL void* tc_newarray_aligned_nothrow(size_t size, std::align_val_t al,
const std::nothrow_t&) PERFTOOLS_NOTHROW;
PERFTOOLS_DLL_DECL void tc_deletearray_aligned(void* p, std::align_val_t al) PERFTOOLS_NOTHROW;
PERFTOOLS_DLL_DECL void tc_deletearray_sized_aligned(void* p, size_t size, std::align_val_t al) PERFTOOLS_NOTHROW;
PERFTOOLS_DLL_DECL void tc_deletearray_aligned_nothrow(void* p, std::align_val_t al,
const std::nothrow_t&) PERFTOOLS_NOTHROW;
#endif
}
#endif

#endif // #ifndef TCMALLOC_TCMALLOC_H_
/* We're only un-defining for public */
#if !defined(GPERFTOOLS_CONFIG_H_)

#undef PERFTOOLS_NOTHROW

#endif /* GPERFTOOLS_CONFIG_H_ */

#endif /* #ifndef TCMALLOC_TCMALLOC_H_ */
Loading

0 comments on commit 3566412

Please sign in to comment.