Squash commits for public release
This commit is contained in:
13
libs/libcxx/abi/aeabi_runtime.cpp
Normal file
13
libs/libcxx/abi/aeabi_runtime.cpp
Normal file
@@ -0,0 +1,13 @@
|
||||
extern "C" {
|
||||
|
||||
extern int __cxa_atexit(void (*)(void*), void*, void*);
|
||||
int __aeabi_atexit(void* arg, void (*func)(void*), void* dso_handle)
|
||||
{
|
||||
return __cxa_atexit(func, arg, dso_handle);
|
||||
}
|
||||
|
||||
int __aeabi_unwind_cpp_pr0()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
40
libs/libcxx/abi/cxa_runtime.cpp
Normal file
40
libs/libcxx/abi/cxa_runtime.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
#include "cxxabi.h"
|
||||
|
||||
#define __EXIT_ENTRIES_COUNT (64)
|
||||
|
||||
extern "C" {
|
||||
VIS_HIDDEN void* __dso_handle;
|
||||
|
||||
struct VIS_HIDDEN __termination_info {
|
||||
void (*func)(void*);
|
||||
void* arg;
|
||||
void* dso_handle;
|
||||
};
|
||||
|
||||
static struct __termination_info __exit_info[__EXIT_ENTRIES_COUNT];
|
||||
static int __exit_counter = 0;
|
||||
|
||||
int __cxa_atexit(void (*func)(void*), void* arg, void* dso_handle)
|
||||
{
|
||||
if (__exit_counter >= __EXIT_ENTRIES_COUNT) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
__exit_info[__exit_counter++] = {
|
||||
.func = func,
|
||||
.arg = arg,
|
||||
.dso_handle = dso_handle,
|
||||
};
|
||||
return 0;
|
||||
}
|
||||
|
||||
void __cxa_finalize(void* dso_handle)
|
||||
{
|
||||
for (int i = __exit_counter - 1; i >= 0; i--) {
|
||||
if (dso_handle && __exit_info[i].dso_handle != dso_handle) {
|
||||
continue;
|
||||
}
|
||||
__exit_info[i].func(__exit_info[i].arg);
|
||||
}
|
||||
}
|
||||
}
|
||||
119
libs/libcxx/abi/cxxabi.h
Normal file
119
libs/libcxx/abi/cxxabi.h
Normal file
@@ -0,0 +1,119 @@
|
||||
#ifndef _CXXABI_H
|
||||
#define _CXXABI_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <typeinfo>
|
||||
|
||||
#define VIS_HIDDEN __attribute__((visibility("hidden")))
|
||||
#define VIS_INTERNAL __attribute__((visibility("internal")))
|
||||
|
||||
extern "C" {
|
||||
int __cxa_atexit(void (*)(void*), void*, void*);
|
||||
void __cxa_finalize(void*);
|
||||
}
|
||||
|
||||
namespace __cxxabiv1 {
|
||||
|
||||
// Defenitions from https://itanium-cxx-abi.github.io/cxx-abi/abi.html
|
||||
class __fundamental_type_info : public std::type_info {
|
||||
public:
|
||||
~__fundamental_type_info();
|
||||
};
|
||||
class __array_type_info : public std::type_info {
|
||||
public:
|
||||
~__array_type_info();
|
||||
};
|
||||
class __function_type_info : public std::type_info {
|
||||
public:
|
||||
~__function_type_info();
|
||||
};
|
||||
class __enum_type_info : public std::type_info {
|
||||
public:
|
||||
~__enum_type_info();
|
||||
};
|
||||
class __class_type_info : public std::type_info {
|
||||
public:
|
||||
~__class_type_info();
|
||||
|
||||
enum __class_type_info_codes {
|
||||
CLASS_TYPE_INFO_CODE,
|
||||
SI_CLASS_TYPE_INFO_CODE,
|
||||
VMI_CLASS_TYPE_INFO_CODE,
|
||||
};
|
||||
|
||||
virtual __class_type_info_codes class_type_info_code() const { return CLASS_TYPE_INFO_CODE; }
|
||||
};
|
||||
class __si_class_type_info : public __class_type_info {
|
||||
public:
|
||||
~__si_class_type_info();
|
||||
const __class_type_info* __base_type;
|
||||
|
||||
virtual __class_type_info_codes class_type_info_code() const { return SI_CLASS_TYPE_INFO_CODE; }
|
||||
};
|
||||
|
||||
struct __base_class_type_info {
|
||||
public:
|
||||
const __class_type_info* __base_type;
|
||||
long __offset_flags;
|
||||
|
||||
enum __offset_flags_masks {
|
||||
__virtual_mask = 0x1,
|
||||
__public_mask = 0x2,
|
||||
__offset_shift = 8
|
||||
};
|
||||
|
||||
inline bool is_virtual() const { return (__offset_flags & __virtual_mask) != 0; }
|
||||
inline bool is_public() const { return (__offset_flags & __public_mask) != 0; }
|
||||
inline long offset() const { return __offset_flags >> __offset_shift; }
|
||||
inline long flags() const { return __offset_flags & ((1L << __offset_shift) - 1); }
|
||||
};
|
||||
|
||||
class __vmi_class_type_info : public __class_type_info {
|
||||
public:
|
||||
~__vmi_class_type_info();
|
||||
|
||||
uint32_t m_flags;
|
||||
uint32_t m_base_count;
|
||||
__base_class_type_info m_base_info[1];
|
||||
|
||||
enum __flags_masks {
|
||||
__non_diamond_repeat_mask = 0x1,
|
||||
__diamond_shaped_mask = 0x2
|
||||
};
|
||||
|
||||
virtual __class_type_info_codes class_type_info_code() const { return SI_CLASS_TYPE_INFO_CODE; }
|
||||
};
|
||||
|
||||
class __pbase_type_info : public std::type_info {
|
||||
public:
|
||||
~__pbase_type_info();
|
||||
|
||||
unsigned int __flags;
|
||||
const std::type_info* __pointee;
|
||||
|
||||
enum __masks {
|
||||
__const_mask = 0x1,
|
||||
__volatile_mask = 0x2,
|
||||
__restrict_mask = 0x4,
|
||||
__incomplete_mask = 0x8,
|
||||
__incomplete_class_mask = 0x10,
|
||||
__transaction_safe_mask = 0x20,
|
||||
__noexcept_mask = 0x40
|
||||
};
|
||||
};
|
||||
|
||||
class __pointer_type_info : public __pbase_type_info {
|
||||
public:
|
||||
~__pointer_type_info();
|
||||
};
|
||||
|
||||
class __pointer_to_member_type_info : public __pbase_type_info {
|
||||
public:
|
||||
~__pointer_to_member_type_info();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace abi = __cxxabiv1;
|
||||
|
||||
#endif /* _CXXABI_H */
|
||||
9
libs/libcxx/abi/dynamic_cast.cpp
Normal file
9
libs/libcxx/abi/dynamic_cast.cpp
Normal file
@@ -0,0 +1,9 @@
|
||||
#include "cxxabi.h"
|
||||
#include "stdio.h"
|
||||
#include <cstddef>
|
||||
#include <typeinfo>
|
||||
|
||||
extern "C" void* __dynamic_cast(const void* v, const abi::__class_type_info* src, const abi::__class_type_info* dst, std::ptrdiff_t src2dst_offset)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
46
libs/libcxx/abi/type_info_defs.cpp
Normal file
46
libs/libcxx/abi/type_info_defs.cpp
Normal file
@@ -0,0 +1,46 @@
|
||||
#include "cxxabi.h"
|
||||
#include <new>
|
||||
|
||||
namespace __cxxabiv1 {
|
||||
|
||||
__fundamental_type_info::~__fundamental_type_info()
|
||||
{
|
||||
}
|
||||
|
||||
__array_type_info::~__array_type_info()
|
||||
{
|
||||
}
|
||||
|
||||
__function_type_info::~__function_type_info()
|
||||
{
|
||||
}
|
||||
|
||||
__enum_type_info::~__enum_type_info()
|
||||
{
|
||||
}
|
||||
|
||||
__class_type_info::~__class_type_info()
|
||||
{
|
||||
}
|
||||
|
||||
__si_class_type_info::~__si_class_type_info()
|
||||
{
|
||||
}
|
||||
|
||||
__vmi_class_type_info::~__vmi_class_type_info()
|
||||
{
|
||||
}
|
||||
|
||||
__pbase_type_info::~__pbase_type_info()
|
||||
{
|
||||
}
|
||||
|
||||
__pointer_type_info::~__pointer_type_info()
|
||||
{
|
||||
}
|
||||
|
||||
__pointer_to_member_type_info::~__pointer_to_member_type_info()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user