f35db108b9
This patch imports the runtime library in the GCC tree, ensures that -lasan is passed to the linker when -faddress-sanitizer is used and sets up the build system accordingly. ChangeLog: * configure.ac: Add libsanitizer to target_libraries. * Makefile.def: Ditto. * configure: Regenerate. * Makefile.in: Regenerate. * libsanitizer: New directory for asan runtime. Contains an empty tsan directory. gcc/ChangeLog: * gcc.c (LINK_COMMAND_SPEC): Add -laddress-sanitizer to link command if -faddress-sanitizer is on. libsanitizer: Initial checkin: migrate asan runtime from llvm. From-SVN: r193441
32 lines
979 B
C++
32 lines
979 B
C++
//===-- sanitizer_placement_new.h -------------------------------*- C++ -*-===//
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file is shared between AddressSanitizer and ThreadSanitizer
|
|
// run-time libraries.
|
|
//
|
|
// The file provides 'placement new'.
|
|
// Do not include it into header files, only into source files.
|
|
//===----------------------------------------------------------------------===//
|
|
#ifndef SANITIZER_PLACEMENT_NEW_H
|
|
#define SANITIZER_PLACEMENT_NEW_H
|
|
|
|
#include "sanitizer_internal_defs.h"
|
|
|
|
namespace __sanitizer {
|
|
#if (__WORDSIZE == 64) || defined(__APPLE__)
|
|
typedef uptr operator_new_ptr_type;
|
|
#else
|
|
typedef u32 operator_new_ptr_type;
|
|
#endif
|
|
} // namespace __sanitizer
|
|
|
|
inline void *operator new(__sanitizer::operator_new_ptr_type sz, void *p) {
|
|
return p;
|
|
}
|
|
|
|
#endif // SANITIZER_PLACEMENT_NEW_H
|