Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/libc++/dist/libcxxrt Import libcxxrt b2396b5945...
details: https://anonhg.NetBSD.org/src/rev/13dfe809c972
branches: trunk
changeset: 786885:13dfe809c972
user: joerg <joerg%NetBSD.org@localhost>
date: Fri May 17 23:04:37 2013 +0000
description:
Import libcxxrt b2396b5945d7a2697c4762c3e52dc6f732b2eebd from
https://github.com/pathscale/libcxxrt/.
diffstat:
external/bsd/libc++/dist/libcxxrt/AUTHORS | 2 +
external/bsd/libc++/dist/libcxxrt/COPYRIGHT | 3 +
external/bsd/libc++/dist/libcxxrt/LICENSE | 14 +
external/bsd/libc++/dist/libcxxrt/README | 50 +
external/bsd/libc++/dist/libcxxrt/src/abi_namespace.h | 5 +
external/bsd/libc++/dist/libcxxrt/src/atomic.h | 29 +
external/bsd/libc++/dist/libcxxrt/src/auxhelper.cc | 67 +
external/bsd/libc++/dist/libcxxrt/src/cxa_atexit.c | 69 +
external/bsd/libc++/dist/libcxxrt/src/cxa_finalize.c | 32 +
external/bsd/libc++/dist/libcxxrt/src/cxxabi.h | 243 +
external/bsd/libc++/dist/libcxxrt/src/dwarf_eh.h | 479 +
external/bsd/libc++/dist/libcxxrt/src/dynamic_cast.cc | 210 +
external/bsd/libc++/dist/libcxxrt/src/exception.cc | 1500 +++++
external/bsd/libc++/dist/libcxxrt/src/guard.cc | 164 +
external/bsd/libc++/dist/libcxxrt/src/libelftc_dem_gnu3.c | 3473 +++++++++++++
external/bsd/libc++/dist/libcxxrt/src/memory.cc | 154 +
external/bsd/libc++/dist/libcxxrt/src/stdexcept.cc | 86 +
external/bsd/libc++/dist/libcxxrt/src/stdexcept.h | 87 +
external/bsd/libc++/dist/libcxxrt/src/terminate.cc | 40 +
external/bsd/libc++/dist/libcxxrt/src/typeinfo.cc | 121 +
external/bsd/libc++/dist/libcxxrt/src/typeinfo.h | 313 +
external/bsd/libc++/dist/libcxxrt/src/unwind-arm.h | 223 +
external/bsd/libc++/dist/libcxxrt/src/unwind-itanium.h | 170 +
external/bsd/libc++/dist/libcxxrt/src/unwind.h | 40 +
external/bsd/libc++/dist/libcxxrt/test/run_test.sh | 5 +
external/bsd/libc++/dist/libcxxrt/test/test.cc | 56 +
external/bsd/libc++/dist/libcxxrt/test/test.h | 4 +
external/bsd/libc++/dist/libcxxrt/test/test_exception.cc | 243 +
external/bsd/libc++/dist/libcxxrt/test/test_guard.cc | 29 +
external/bsd/libc++/dist/libcxxrt/test/test_typeinfo.cc | 112 +
30 files changed, 8023 insertions(+), 0 deletions(-)
diffs (truncated from 8143 to 300 lines):
diff -r 65187ae2bacb -r 13dfe809c972 external/bsd/libc++/dist/libcxxrt/AUTHORS
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/libc++/dist/libcxxrt/AUTHORS Fri May 17 23:04:37 2013 +0000
@@ -0,0 +1,2 @@
+David Chisnall
+PathScale engineers
diff -r 65187ae2bacb -r 13dfe809c972 external/bsd/libc++/dist/libcxxrt/COPYRIGHT
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/libc++/dist/libcxxrt/COPYRIGHT Fri May 17 23:04:37 2013 +0000
@@ -0,0 +1,3 @@
+PathScale Inc
+NetBSD Foundation
+FreeBSD Foundation
diff -r 65187ae2bacb -r 13dfe809c972 external/bsd/libc++/dist/libcxxrt/LICENSE
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/libc++/dist/libcxxrt/LICENSE Fri May 17 23:04:37 2013 +0000
@@ -0,0 +1,14 @@
+The BSD License
+
+Copyright 2010-2011 PathScale, 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:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the
distribution.
+
+
+
+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 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of
PathScale, Inc.
diff -r 65187ae2bacb -r 13dfe809c972 external/bsd/libc++/dist/libcxxrt/README
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/libc++/dist/libcxxrt/README Fri May 17 23:04:37 2013 +0000
@@ -0,0 +1,50 @@
+libcxxabi
+=========
+
+This library implements the Code Sourcery C++ ABI, as documented here:
+
+http://www.codesourcery.com/public/cxx-abi/abi.html
+
+It is intended to sit below an STL implementation, and provide features required by the compiler for implementation of the C++ language.
+
+Current Status
+--------------
+
+At present, the library implements the following parts of the ABI specification:
+
+- RTTI classes and support for the dynamic_cast<> operator.
+- Exception handling.
+- Thread-safe initializers.
+
+Exception handling requires the assistance of a stack-unwinding library
+implementing the low-level parts of the ABI. Either libgcc_s or libunwind
+should work for this purpose.
+
+The library depends on various libc features, but does not depend on any C++
+features not implemented purely in the compiler or in the library itself.
+
+Supported Platforms
+-------------------
+
+This code was initially developed on FreeBSD/x86, and has also been tested on FreeBSD/x86-64. It should work on other platforms that use the Code Sourcery ABI, for example Itanium, however this is
untested.
+
+This library also supports the ARM EH ABI.
+
+Installation
+------------
+
+The default build system does not perform any installation. It is expected that this will be done by at a higher level. The exact installation steps depend on how you plan on deploying libcxxrt.
+
+There are three files that you may consider installing:
+
+- cxxabi.h (and unwind.h and either unwind-arm.h or unwind-itanium.h)
+- libcxxrt.a
+- libcxxrt.so
+
+The first describes the contract between this library and the compiler / STL implementation (lib[std]{cxx,c++}). Its contents should be considered semi-private, as it is probably not a good idea to
encourage any code above the STL implementation to depend on it. Doing so will introduce portability issues. You may install this file but I recommend simply copying or linking it into your STL
implementation's build directory.
+
+In general, I recommend against installing both the .a and the .so file. For static linking, the .a file should be linked against the static and dynamic versions of your STL implementation.
Statically linking libcxxrt into your STL implementation means that users who dynamically link against the STL implementation can have libcxxrt upgraded automatically when you ship a new version of
your STL implementation.
+
+The other option, installing the .so, is recommended for situations where you have two or more STL implementations and wish to be able to link against both (e.g. where an application links one
library using libstdc++ and another using libc++). To support this case, you should link both STL implementations against libcxxrt.so.
+
+Supporting all of these options in the CMake build system is not practical - the amount of effort required to select the one that you want would be more than the effort required to perform the
installation from an external script or build system.
diff -r 65187ae2bacb -r 13dfe809c972 external/bsd/libc++/dist/libcxxrt/src/abi_namespace.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/libc++/dist/libcxxrt/src/abi_namespace.h Fri May 17 23:04:37 2013 +0000
@@ -0,0 +1,5 @@
+/**
+ * The namespace used for the ABI declarations. This is currently defined to
+ * be the same as GNU libsupc++, however this may change in the future.
+ */
+#define ABI_NAMESPACE __cxxabiv1
diff -r 65187ae2bacb -r 13dfe809c972 external/bsd/libc++/dist/libcxxrt/src/atomic.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/libc++/dist/libcxxrt/src/atomic.h Fri May 17 23:04:37 2013 +0000
@@ -0,0 +1,29 @@
+
+#ifndef __has_builtin
+#define __has_builtin(x) 0
+#endif
+#ifndef __has_feature
+#define __has_feature(x) 0
+#endif
+/**
+ * Swap macro that enforces a happens-before relationship with a corresponding
+ * ATOMIC_LOAD.
+ */
+#if __has_builtin(__c11_atomic_exchange)
+#define ATOMIC_SWAP(addr, val)\
+ __c11_atomic_exchange((_Atomic(__typeof__(val))*)addr, val, __ATOMIC_ACQ_REL)
+#elif __has_builtin(__sync_swap)
+#define ATOMIC_SWAP(addr, val)\
+ __sync_swap(addr, val)
+#else
+#define ATOMIC_SWAP(addr, val)\
+ __sync_lock_test_and_set(addr, val)
+#endif
+
+#if __has_builtin(__c11_atomic_load)
+#define ATOMIC_LOAD(addr)\
+ __c11_atomic_load((_Atomic(__typeof__(*addr))*)addr, __ATOMIC_ACQUIRE)
+#else
+#define ATOMIC_LOAD(addr)\
+ (__sync_synchronize(), *addr)
+#endif
diff -r 65187ae2bacb -r 13dfe809c972 external/bsd/libc++/dist/libcxxrt/src/auxhelper.cc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/libc++/dist/libcxxrt/src/auxhelper.cc Fri May 17 23:04:37 2013 +0000
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2010-2011 PathScale, 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:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 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 A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * aux.cc - Compiler helper functions.
+ *
+ * The functions declared in this file are intended to be called only by code
+ * that is automatically generated by C++ compilers for some common cases.
+ */
+
+#include <stdlib.h>
+#include "stdexcept.h"
+
+/**
+ * Called to generate a bad cast exception. This function is intended to allow
+ * compilers to insert code generating this exception without needing to
+ * duplicate the code for throwing the exception in every call site.
+ */
+extern "C" void __cxa_bad_cast()
+{
+ throw std::bad_cast();
+}
+
+/**
+ * Called to generate a bad typeid exception. This function is intended to
+ * allow compilers to insert code generating this exception without needing to
+ * duplicate the code for throwing the exception in every call site.
+ */
+extern "C" void __cxa_bad_typeid()
+{
+ throw std::bad_typeid();
+}
+
+/**
+ * Compilers may (but are not required to) set any pure-virtual function's
+ * vtable entry to this function. This makes debugging slightly easier, as
+ * users can add a breakpoint on this function to tell if they've accidentally
+ * called a pure-virtual function.
+ */
+extern "C" void __cxa_pure_virtual()
+{
+ abort();
+}
+
diff -r 65187ae2bacb -r 13dfe809c972 external/bsd/libc++/dist/libcxxrt/src/cxa_atexit.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/libc++/dist/libcxxrt/src/cxa_atexit.c Fri May 17 23:04:37 2013 +0000
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2012 David Chisnall.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+/* Special thanks to TBricks for partially funding this work */
+
+#ifdef __sun__
+#include <pthread.h>
+#include <stdlib.h>
+
+static struct atexit_handler {
+ void (*f)(void *);
+ void *p;
+ void *d;
+ struct atexit_handler *next;
+} *head;
+
+static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
+
+int __cxa_atexit( void (*f)(void *), void *p, void *d) {
+ pthread_mutex_lock(&lock);
+ struct atexit_handler *h = malloc(sizeof(*h));
+ if (!h) {
+ pthread_mutex_unlock(&lock);
+ return 1;
+ }
+ h->f = f;
+ h->p = p;
+ h->d = d;
+ h->next = head;
+ head = h;
+ pthread_mutex_unlock(&lock);
+ return 0;
+}
+
+void __cxa_finalize(void *d ) {
+ pthread_mutex_lock(&lock);
+ struct atexit_handler **last = &head;
+ for (struct atexit_handler *h = head ; h ; h = h->next) {
+ if ((h->d == d) || (d == 0)) {
+ *last = h->next;
+ h->f(h->p);
+ free(h);
+ } else {
+ last = &h->next;
+ }
+ }
+ pthread_mutex_unlock(&lock);
+}
+#endif
diff -r 65187ae2bacb -r 13dfe809c972 external/bsd/libc++/dist/libcxxrt/src/cxa_finalize.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/libc++/dist/libcxxrt/src/cxa_finalize.c Fri May 17 23:04:37 2013 +0000
@@ -0,0 +1,32 @@
+/**
+ * Copyright (c) 2012 David Chisnall.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+
+void __cxa_finalize(void *d );
Home |
Main Index |
Thread Index |
Old Index