summaryrefslogtreecommitdiffstats
path: root/libcxx/src/new.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2013-10-06 22:13:16 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2013-10-06 22:13:16 +0000
commit926aa5f4f24a2e34dfe8dcbe3875550e6e87f70c (patch)
treef65e07690860b3cbbc71e6b257b0ff275eeb7f94 /libcxx/src/new.cpp
parent6d48bdd2a866f5358aef7c5e69d32d75d71bde05 (diff)
downloadbcm5719-llvm-926aa5f4f24a2e34dfe8dcbe3875550e6e87f70c.tar.gz
bcm5719-llvm-926aa5f4f24a2e34dfe8dcbe3875550e6e87f70c.zip
Eliminate more symbols multiply defined between libsupc++ and libc++.
The remaining multiple definitions were flushed out by attempting to link libsupc++ and libc++ into the same executable with --whole-archive, e.g. clang++ -I../llvm/projects/libcxx/include -nodefaultlibs -Wl,--whole-archive lib/libc++.a /usr/lib/gcc/x86_64-linux-gnu/4.6/libsupc++.a -Wl,--no-whole-archive -lgcc -lgcc_s -lc -lpthread -lrt (The same technique was used to flush out multiple definitions in libstdc++.) Differential Revision: http://llvm-reviews.chandlerc.com/D1824 llvm-svn: 192074
Diffstat (limited to 'libcxx/src/new.cpp')
-rw-r--r--libcxx/src/new.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/libcxx/src/new.cpp b/libcxx/src/new.cpp
index 961c02086d8..f24014d22df 100644
--- a/libcxx/src/new.cpp
+++ b/libcxx/src/new.cpp
@@ -30,11 +30,13 @@
#if defined(LIBCXXRT) || __has_include(<cxxabi.h>)
#include <cxxabi.h>
#endif // __has_include(<cxxabi.h>)
- #ifndef _LIBCPPABI_VERSION
+ #if !defined(_LIBCPPABI_VERSION) && !defined(__GLIBCXX__)
static std::new_handler __new_handler;
#endif // _LIBCPPABI_VERSION
#endif
+#ifndef __GLIBCXX__
+
// Implement all new and delete operators as weak definitions
// in this shared library, so that they can be overriden by programs
// that define non-weak copies of the functions.
@@ -143,13 +145,19 @@ operator delete[] (void* ptr, const std::nothrow_t&) _NOEXCEPT
::operator delete[](ptr);
}
+#endif // !__GLIBCXX__
+
namespace std
{
+#ifndef __GLIBCXX__
const nothrow_t nothrow = {};
+#endif
#ifndef _LIBCPPABI_VERSION
+#ifndef __GLIBCXX__
+
new_handler
set_new_handler(new_handler handler) _NOEXCEPT
{
@@ -162,12 +170,16 @@ get_new_handler() _NOEXCEPT
return __sync_fetch_and_add(&__new_handler, (new_handler)0);
}
+#endif // !__GLIBCXX__
+
#ifndef LIBCXXRT
bad_alloc::bad_alloc() _NOEXCEPT
{
}
+#ifndef __GLIBCXX__
+
bad_alloc::~bad_alloc() _NOEXCEPT
{
}
@@ -178,6 +190,8 @@ bad_alloc::what() const _NOEXCEPT
return "std::bad_alloc";
}
+#endif // !__GLIBCXX__
+
#endif //LIBCXXRT
bad_array_new_length::bad_array_new_length() _NOEXCEPT
OpenPOWER on IntegriCloud