Initial commit
This commit is contained in:
11
package/libs/uclibc++/patches/002-path_to_bash.patch
Normal file
11
package/libs/uclibc++/patches/002-path_to_bash.patch
Normal file
@@ -0,0 +1,11 @@
|
||||
--- a/bin/Makefile
|
||||
+++ b/bin/Makefile
|
||||
@@ -13,7 +13,7 @@ install:
|
||||
$(INSTALL) -m 755 $(WRAPPER) $(PREFIX)$(UCLIBCXX_RUNTIME_BINDIR)
|
||||
|
||||
$(WRAPPER): Makefile
|
||||
- echo '#!/bin/sh' > $@
|
||||
+ echo '#!/usr/bin/env bash' > $@
|
||||
echo '' >> $@
|
||||
echo 'WRAPPER_INCLUDEDIR="$${WRAPPER_INCLUDEDIR:=-I$(UCLIBCXX_RUNTIME_INCLUDEDIR)}"' >> $@
|
||||
echo 'WRAPPER_LIBDIR="$${WRAPPER_LIBDIR:=-L$(UCLIBCXX_RUNTIME_LIBDIR)}"' >> $@
|
||||
38
package/libs/uclibc++/patches/006-eabi_fix.patch
Normal file
38
package/libs/uclibc++/patches/006-eabi_fix.patch
Normal file
@@ -0,0 +1,38 @@
|
||||
--- a/include/typeinfo
|
||||
+++ b/include/typeinfo
|
||||
@@ -44,6 +44,7 @@ namespace __cxxabiv1
|
||||
class __class_type_info;
|
||||
} // namespace __cxxabiv1
|
||||
|
||||
+#ifndef __GXX_MERGED_TYPEINFO_NAMES
|
||||
#if !__GXX_WEAK__
|
||||
// If weak symbols are not supported, typeinfo names are not merged.
|
||||
#define __GXX_MERGED_TYPEINFO_NAMES 0
|
||||
@@ -51,6 +52,7 @@ namespace __cxxabiv1
|
||||
// On platforms that support weak symbols, typeinfo names are merged.
|
||||
#define __GXX_MERGED_TYPEINFO_NAMES 1
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
namespace std
|
||||
{
|
||||
--- a/include/unwind-cxx.h
|
||||
+++ b/include/unwind-cxx.h
|
||||
@@ -173,6 +173,7 @@ extern std::unexpected_handler __unexpec
|
||||
|
||||
// This is the exception class we report -- "GNUCC++\0".
|
||||
const _Unwind_Exception_Class __gxx_exception_class
|
||||
+#ifndef __ARM_EABI_UNWINDER__
|
||||
= ((((((((_Unwind_Exception_Class) 'G'
|
||||
<< 8 | (_Unwind_Exception_Class) 'N')
|
||||
<< 8 | (_Unwind_Exception_Class) 'U')
|
||||
@@ -181,6 +182,9 @@ const _Unwind_Exception_Class __gxx_exce
|
||||
<< 8 | (_Unwind_Exception_Class) '+')
|
||||
<< 8 | (_Unwind_Exception_Class) '+')
|
||||
<< 8 | (_Unwind_Exception_Class) '\0');
|
||||
+#else
|
||||
+= "GNUC++";
|
||||
+#endif
|
||||
|
||||
// GNU C++ personality routine, Version 0.
|
||||
extern "C" _Unwind_Reason_Code __gxx_personality_v0
|
||||
23
package/libs/uclibc++/patches/010-honor-ldflags.patch
Normal file
23
package/libs/uclibc++/patches/010-honor-ldflags.patch
Normal file
@@ -0,0 +1,23 @@
|
||||
--- a/src/Makefile
|
||||
+++ b/src/Makefile
|
||||
@@ -3,9 +3,9 @@ include $(TOPDIR)Rules.mak
|
||||
|
||||
WR_CXX := WRAPPER_INCLUDEDIR=-I$(TOPDIR)include $(TOPDIR)bin/g++-uc
|
||||
|
||||
-LDFLAGS += -nodefaultlibs -shared -Wl,-soname,$(SHARED_MAJORNAME) $(BUILD_EXTRA_LIBRARIES)
|
||||
+EXTRA_LDFLAGS += -nodefaultlibs -shared -Wl,-soname,$(SHARED_MAJORNAME) $(BUILD_EXTRA_LIBRARIES)
|
||||
ifneq ($(DODEBUG),y)
|
||||
-LDFLAGS += -Wl,-s
|
||||
+EXTRA_LDFLAGS += -Wl,-s
|
||||
endif
|
||||
|
||||
SRCS = $(wildcard *.cpp)
|
||||
@@ -60,7 +60,7 @@ $(LIBNAME).a: libgcc_eh libsupc $(EXOBJS
|
||||
$(RANLIB) $@
|
||||
|
||||
$(SHARED_FULLNAME): libgcc_eh libsupc $(EXOBJS)
|
||||
- $(CC) $(LDFLAGS) -o $@ $(EXOBJS) $(SUPOBJS) $(GCCOBJS) $(LIBS)
|
||||
+ $(CC) $(LDFLAGS) $(EXTRA_LDFLAGS) -o $@ $(EXOBJS) $(SUPOBJS) $(GCCOBJS) $(LIBS)
|
||||
$(LN) $@ $(SHARED_MAJORNAME)
|
||||
$(LN) $(SHARED_MAJORNAME) $(LIBNAME).so
|
||||
|
||||
22
package/libs/uclibc++/patches/020-template-fix.patch
Normal file
22
package/libs/uclibc++/patches/020-template-fix.patch
Normal file
@@ -0,0 +1,22 @@
|
||||
--- a/include/ostream
|
||||
+++ b/include/ostream
|
||||
@@ -294,7 +294,7 @@ namespace std {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
- template <class charT,class traits = char_traits<charT> >
|
||||
+ template <class charT,class traits>
|
||||
class _UCXXEXPORT basic_ostream<charT,traits>::sentry
|
||||
{
|
||||
bool ok;
|
||||
--- a/include/istream
|
||||
+++ b/include/istream
|
||||
@@ -340,7 +340,7 @@ namespace std{
|
||||
|
||||
};
|
||||
|
||||
- template <class charT,class traits = char_traits<charT> > class _UCXXEXPORT basic_istream<charT,traits>::sentry {
|
||||
+ template <class charT,class traits> class _UCXXEXPORT basic_istream<charT,traits>::sentry {
|
||||
bool ok;
|
||||
public:
|
||||
explicit _UCXXEXPORT sentry(basic_istream<charT,traits>& os, bool noskipws = false){
|
||||
114
package/libs/uclibc++/patches/030-memory_corruption_fix.patch
Normal file
114
package/libs/uclibc++/patches/030-memory_corruption_fix.patch
Normal file
@@ -0,0 +1,114 @@
|
||||
From 1dc865b8bbb3911abc8ce53c7ae8a59dc90f6fc3 Mon Sep 17 00:00:00 2001
|
||||
From: Ivan Kold <pixus.ru@gmail.com>
|
||||
Date: Thu, 3 Mar 2016 12:56:30 -0800
|
||||
Subject: [PATCH] Fix throw statement causing memory corruption
|
||||
|
||||
The __cxxabiv1::__cxa_throw in the GCC's libsupc++ expects
|
||||
sizeof(__cxa_refcounted_exception) bytes be allocated before
|
||||
exception object.
|
||||
uClibc++ allocates only sizeof(__cxa_exception) before an
|
||||
exception object.
|
||||
The __cxxabiv1::__cxa_throw writes in memory before allocated:
|
||||
// gcc-5.2.0/libstdc++-v3/libsupc++/eh_throw.cc:69
|
||||
__cxa_refcounted_exception *header
|
||||
= __get_refcounted_exception_header_from_obj (obj);
|
||||
header->referenceCount = 1;
|
||||
|
||||
Signed-off-by: Ivan Kold <pixus.ru@gmail.com>
|
||||
---
|
||||
include/unwind-cxx.h | 34 +++++++++++++++++++++++++++++++++-
|
||||
src/eh_alloc.cpp | 8 ++++----
|
||||
2 files changed, 37 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/include/unwind-cxx.h
|
||||
+++ b/include/unwind-cxx.h
|
||||
@@ -1,5 +1,5 @@
|
||||
// -*- C++ -*- Exception handling and frame unwind runtime interface routines.
|
||||
-// Copyright (C) 2001 Free Software Foundation, Inc.
|
||||
+// Copyright (C) 2001-2015 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of GCC.
|
||||
//
|
||||
@@ -13,6 +13,10 @@
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
+// Under Section 7 of GPL version 3, you are granted additional
|
||||
+// permissions described in the GCC Runtime Library Exception, version
|
||||
+// 3.1, as published by the Free Software Foundation.
|
||||
+//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with GCC; see the file COPYING. If not, write to
|
||||
// the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
@@ -40,6 +44,12 @@
|
||||
#include <cstddef>
|
||||
#include "unwind.h"
|
||||
|
||||
+// Original unwind-cxx.h also includes bits/atomic_word.h which is CPU-specific,
|
||||
+// but always defines _Atomic_word as typedef int .
|
||||
+// Only thing that differs is memory-barrier macroses.
|
||||
+typedef int _Atomic_word;
|
||||
+
|
||||
+
|
||||
#pragma GCC visibility push(default)
|
||||
|
||||
namespace __cxxabiv1
|
||||
@@ -79,6 +89,13 @@ struct __cxa_exception
|
||||
_Unwind_Exception unwindHeader;
|
||||
};
|
||||
|
||||
+struct __cxa_refcounted_exception
|
||||
+{
|
||||
+ // Manage this header.
|
||||
+ _Atomic_word referenceCount;
|
||||
+ // __cxa_exception must be last, and no padding can be after it.
|
||||
+ __cxa_exception exc;
|
||||
+};
|
||||
|
||||
// A dependent C++ exception object consists of a header, which is a wrapper
|
||||
// around an unwind object header with additional C++ specific information,
|
||||
@@ -210,6 +227,21 @@ __get_exception_header_from_ue (_Unwind_
|
||||
return reinterpret_cast<__cxa_exception *>(exc + 1) - 1;
|
||||
}
|
||||
|
||||
+// Acquire the C++ refcounted exception header from the C++ object.
|
||||
+static inline __cxa_refcounted_exception *
|
||||
+__get_refcounted_exception_header_from_obj (void *ptr)
|
||||
+{
|
||||
+ return reinterpret_cast<__cxa_refcounted_exception *>(ptr) - 1;
|
||||
+}
|
||||
+
|
||||
+// Acquire the C++ refcounted exception header from the generic exception
|
||||
+// header.
|
||||
+static inline __cxa_refcounted_exception *
|
||||
+__get_refcounted_exception_header_from_ue (_Unwind_Exception *exc)
|
||||
+{
|
||||
+ return reinterpret_cast<__cxa_refcounted_exception *>(exc + 1) - 1;
|
||||
+}
|
||||
+
|
||||
} /* namespace __cxxabiv1 */
|
||||
|
||||
#pragma GCC visibility pop
|
||||
--- a/src/eh_alloc.cpp
|
||||
+++ b/src/eh_alloc.cpp
|
||||
@@ -30,16 +30,16 @@ extern "C" void * __cxa_allocate_excepti
|
||||
void *retval;
|
||||
//The sizeof crap is required by Itanium ABI because we need to provide space for
|
||||
//accounting information which is implementaion (gcc) specified
|
||||
- retval = malloc (thrown_size + sizeof(__cxa_exception));
|
||||
+ retval = malloc (thrown_size + sizeof(__cxa_refcounted_exception));
|
||||
if (0 == retval){
|
||||
std::terminate();
|
||||
}
|
||||
- memset (retval, 0, sizeof(__cxa_exception));
|
||||
- return (void *)((unsigned char *)retval + sizeof(__cxa_exception));
|
||||
+ memset (retval, 0, sizeof(__cxa_refcounted_exception));
|
||||
+ return (void *)((unsigned char *)retval + sizeof(__cxa_refcounted_exception));
|
||||
}
|
||||
|
||||
extern "C" void __cxa_free_exception(void *vptr) throw(){
|
||||
- free( (char *)(vptr) - sizeof(__cxa_exception) );
|
||||
+ free( (char *)(vptr) - sizeof(__cxa_refcounted_exception) );
|
||||
}
|
||||
|
||||
|
||||
20
package/libs/uclibc++/patches/040-delete-c++14.patch
Normal file
20
package/libs/uclibc++/patches/040-delete-c++14.patch
Normal file
@@ -0,0 +1,20 @@
|
||||
--- a/src/del_op.cpp
|
||||
+++ b/src/del_op.cpp
|
||||
@@ -24,3 +24,7 @@
|
||||
_UCXXEXPORT void operator delete(void* ptr) throw(){
|
||||
free(ptr);
|
||||
}
|
||||
+
|
||||
+_UCXXEXPORT void operator delete(void* ptr, size_t size) throw(){
|
||||
+ free(ptr);
|
||||
+}
|
||||
--- a/src/del_opv.cpp
|
||||
+++ b/src/del_opv.cpp
|
||||
@@ -24,3 +24,7 @@
|
||||
_UCXXEXPORT void operator delete[](void * ptr) throw(){
|
||||
free(ptr);
|
||||
}
|
||||
+
|
||||
+_UCXXEXPORT void operator delete[](void * ptr, size_t size) throw(){
|
||||
+ free(ptr);
|
||||
+}
|
||||
@@ -0,0 +1,40 @@
|
||||
From 946b29e62927eadfc4e87f27b8d30e5974b78c4c Mon Sep 17 00:00:00 2001
|
||||
From: Ben Kelly <ben@benjii.net>
|
||||
Date: Mon, 6 Feb 2017 13:08:25 +0200
|
||||
Subject: [PATCH] Bugfix erase() on derived __base_associative
|
||||
|
||||
When calling erase() on a containers derived from __base_associative
|
||||
(e.g. multimap) and providing a pair of iterators a segfault will
|
||||
occur.
|
||||
|
||||
Example code to reproduce:
|
||||
|
||||
typedef std::multimap<int, int> testmap;
|
||||
testmap t;
|
||||
t.insert(std::pair<int, int>(1, 1));
|
||||
t.insert(std::pair<int, int>(2, 1));
|
||||
t.insert(std::pair<int, int>(3, 1));
|
||||
t.erase(t.begin(), t.end());
|
||||
|
||||
Signed-off-by: Ben Kelly <ben@benjii.net>
|
||||
---
|
||||
include/associative_base | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/include/associative_base b/include/associative_base
|
||||
index 27ae0ef..be8b27f 100644
|
||||
--- a/include/associative_base
|
||||
+++ b/include/associative_base
|
||||
@@ -200,8 +200,7 @@ public:
|
||||
}
|
||||
void erase(iterator first, iterator last){
|
||||
while(first != last){
|
||||
- backing.erase(first.base_iterator());
|
||||
- ++first;
|
||||
+ first = backing.erase(first.base_iterator());
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.7.4
|
||||
|
||||
Reference in New Issue
Block a user