diff options
author | dim <dim@FreeBSD.org> | 2016-06-05 00:25:06 +0800 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2016-06-05 00:25:06 +0800 |
commit | a3e47f972a3d32d6519d564d17e7b0ec9b6930f1 (patch) | |
tree | 2821c36fdf3b58f5ff873c370d54e75a9121399f /devel | |
parent | 01bfca5be34eec3be7ea7ec60c6968122ad858b7 (diff) | |
download | freebsd-ports-gnome-a3e47f972a3d32d6519d564d17e7b0ec9b6930f1.tar.gz freebsd-ports-gnome-a3e47f972a3d32d6519d564d17e7b0ec9b6930f1.tar.zst freebsd-ports-gnome-a3e47f972a3d32d6519d564d17e7b0ec9b6930f1.zip |
Update devel/libcxxrt to the latest upstream version, as of 2016-05-29.
All previous patches have been dropped, since these have all been merged
upsream.
Approved by: mokhi64@gmail.com (maintainer)
PR: 209937
Diffstat (limited to 'devel')
-rw-r--r-- | devel/libcxxrt/Makefile | 5 | ||||
-rw-r--r-- | devel/libcxxrt/distinfo | 4 | ||||
-rw-r--r-- | devel/libcxxrt/files/patch-src_exception.cc | 48 | ||||
-rw-r--r-- | devel/libcxxrt/files/patch-test_CMakeLists.txt | 24 | ||||
-rw-r--r-- | devel/libcxxrt/files/patch-test_test__foreign__exceptions.cc | 128 |
5 files changed, 4 insertions, 205 deletions
diff --git a/devel/libcxxrt/Makefile b/devel/libcxxrt/Makefile index 7ef5077fdbcb..08f8d6431e86 100644 --- a/devel/libcxxrt/Makefile +++ b/devel/libcxxrt/Makefile @@ -1,8 +1,7 @@ # $FreeBSD$ PORTNAME= libcxxrt -PORTVERSION= 20131225 -PORTREVISION= 3 +PORTVERSION= 20160529 CATEGORIES= devel MAINTAINER= mokhi64@gmail.com @@ -12,7 +11,7 @@ LICENSE= BSD2CLAUSE USE_GITHUB= yes GH_ACCOUNT= pathscale -GH_TAGNAME= 2f150a6 +GH_TAGNAME= 516a65c USES= cmake compiler:c++11-lang USE_LDCONFIG= yes diff --git a/devel/libcxxrt/distinfo b/devel/libcxxrt/distinfo index 9fb5729be632..228145b1f406 100644 --- a/devel/libcxxrt/distinfo +++ b/devel/libcxxrt/distinfo @@ -1,2 +1,2 @@ -SHA256 (pathscale-libcxxrt-20131225-2f150a6_GH0.tar.gz) = 70a89c34176d2bc683b5a3b84fea8d585bcf53c6b09d0efedbac3caf315b4fc1 -SIZE (pathscale-libcxxrt-20131225-2f150a6_GH0.tar.gz) = 70243 +SHA256 (pathscale-libcxxrt-20160529-516a65c_GH0.tar.gz) = 5d2b943fb8bcce453d3453246dd25242a01b2107631c52c90dbefff13fec1f65 +SIZE (pathscale-libcxxrt-20160529-516a65c_GH0.tar.gz) = 73293 diff --git a/devel/libcxxrt/files/patch-src_exception.cc b/devel/libcxxrt/files/patch-src_exception.cc deleted file mode 100644 index 2c4dfa5058c7..000000000000 --- a/devel/libcxxrt/files/patch-src_exception.cc +++ /dev/null @@ -1,48 +0,0 @@ ---- src/exception.cc.orig 2013-12-26 03:11:27 UTC -+++ src/exception.cc -@@ -304,13 +304,17 @@ static pthread_key_t eh_key; - static void exception_cleanup(_Unwind_Reason_Code reason, - struct _Unwind_Exception *ex) - { -- __cxa_free_exception(static_cast<void*>(ex)); -+ // Exception layout: -+ // [__cxa_exception [_Unwind_Exception]] [exception object] -+ // -+ // __cxa_free_exception expects a pointer to the exception object -+ __cxa_free_exception(static_cast<void*>(ex + 1)); - } - static void dependent_exception_cleanup(_Unwind_Reason_Code reason, - struct _Unwind_Exception *ex) - { - -- __cxa_free_dependent_exception(static_cast<void*>(ex)); -+ __cxa_free_dependent_exception(static_cast<void*>(ex + 1)); - } - - /** -@@ -340,7 +344,8 @@ static void thread_cleanup(void* thread_ - if (info->foreign_exception_state != __cxa_thread_info::none) - { - _Unwind_Exception *e = reinterpret_cast<_Unwind_Exception*>(info->globals.caughtExceptions); -- e->exception_cleanup(_URC_FOREIGN_EXCEPTION_CAUGHT, e); -+ if (e->exception_cleanup) -+ e->exception_cleanup(_URC_FOREIGN_EXCEPTION_CAUGHT, e); - } - else - { -@@ -1270,12 +1275,13 @@ extern "C" void __cxa_end_catch() - - if (ti->foreign_exception_state != __cxa_thread_info::none) - { -- globals->caughtExceptions = 0; - if (ti->foreign_exception_state != __cxa_thread_info::rethrown) - { - _Unwind_Exception *e = reinterpret_cast<_Unwind_Exception*>(ti->globals.caughtExceptions); -- e->exception_cleanup(_URC_FOREIGN_EXCEPTION_CAUGHT, e); -+ if (e->exception_cleanup) -+ e->exception_cleanup(_URC_FOREIGN_EXCEPTION_CAUGHT, e); - } -+ globals->caughtExceptions = 0; - ti->foreign_exception_state = __cxa_thread_info::none; - return; - } diff --git a/devel/libcxxrt/files/patch-test_CMakeLists.txt b/devel/libcxxrt/files/patch-test_CMakeLists.txt deleted file mode 100644 index 11114df9d65a..000000000000 --- a/devel/libcxxrt/files/patch-test_CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ ---- test/CMakeLists.txt.orig 2013-12-26 03:11:27 UTC -+++ test/CMakeLists.txt -@@ -23,6 +23,11 @@ add_executable(cxxrt-test-shared ${CXXTE - set_property(TARGET cxxrt-test-shared PROPERTY LINK_FLAGS -nodefaultlibs) - target_link_libraries(cxxrt-test-shared cxxrt-shared pthread dl c) - -+include_directories(${CMAKE_SOURCE_DIR}/src) -+add_executable(cxxrt-test-foreign-exceptions test_foreign_exceptions.cc) -+set_property(TARGET cxxrt-test-foreign-exceptions PROPERTY LINK_FLAGS "-nodefaultlibs -Wl,--wrap,_Unwind_RaiseException") -+target_link_libraries(cxxrt-test-foreign-exceptions cxxrt-static gcc_s pthread dl c) -+ - add_test(cxxrt-test-static-test - ${CMAKE_CURRENT_SOURCE_DIR}/run_test.sh - ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/cxxrt-test-static -@@ -35,6 +40,9 @@ add_test(cxxrt-test-shared-test - ${CMAKE_CURRENT_BINARY_DIR}/expected_output.log - ${CMAKE_CURRENT_BINARY_DIR}/test-shared-output.log) - -+add_test(cxxrt-test-foreign-exceptions -+ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/cxxrt-test-foreign-exceptions) -+ - set(valgrind "valgrind -q") - - if(TEST_VALGRIND) diff --git a/devel/libcxxrt/files/patch-test_test__foreign__exceptions.cc b/devel/libcxxrt/files/patch-test_test__foreign__exceptions.cc deleted file mode 100644 index baaaf2ee1bc4..000000000000 --- a/devel/libcxxrt/files/patch-test_test__foreign__exceptions.cc +++ /dev/null @@ -1,128 +0,0 @@ ---- test/test_foreign_exceptions.cc.orig 2016-05-29 13:30:15 UTC -+++ test/test_foreign_exceptions.cc -@@ -0,0 +1,125 @@ -+#include <cstdio> -+#include <cstdlib> -+#include "unwind.h" -+ -+#define EXCEPTION_CLASS(a,b,c,d,e,f,g,h) \ -+ ((static_cast<uint64_t>(a) << 56) +\ -+ (static_cast<uint64_t>(b) << 48) +\ -+ (static_cast<uint64_t>(c) << 40) +\ -+ (static_cast<uint64_t>(d) << 32) +\ -+ (static_cast<uint64_t>(e) << 24) +\ -+ (static_cast<uint64_t>(f) << 16) +\ -+ (static_cast<uint64_t>(g) << 8) +\ -+ (static_cast<uint64_t>(h))) -+ -+// using ld --wrap=_Unwind_RaiseException hook feature -+extern "C" _Unwind_Reason_Code __real__Unwind_RaiseException (_Unwind_Exception *e); -+extern "C" _Unwind_Reason_Code __wrap__Unwind_RaiseException (_Unwind_Exception *e); -+ -+extern "C" _Unwind_Reason_Code __wrap__Unwind_RaiseException (_Unwind_Exception *e) -+{ -+ // clobber exception class forcing libcxx own exceptions to be treated -+ // as foreign exception within libcxx itself -+ e->exception_class = EXCEPTION_CLASS('F','O','R','E','I','G','N','\0'); -+ __real__Unwind_RaiseException(e); -+} -+ -+_Unwind_Exception global_e; -+ -+enum test_status { -+ PENDING, PASSED, FAILED -+}; -+ -+const char test_status_str[][8] = { -+ "PENDING", "PASSED", "FAILED" -+}; -+ -+test_status test1_status = PENDING; -+test_status test2_status = PENDING; -+test_status test3_status = PENDING; -+ -+void test2_exception_cleanup(_Unwind_Reason_Code code, _Unwind_Exception *e) -+{ -+ fputs("(2) exception_cleanup called\n", stderr); -+ if (e != &global_e) { -+ fprintf(stderr, "(2) ERROR: unexpected ptr: expecting %p, got %p\n", &global_e, e); -+ test2_status = FAILED; -+ } -+ if (test2_status == PENDING) -+ test2_status = PASSED; -+} -+ -+struct test3_exception -+{ -+ static int counter; -+ ~test3_exception() -+ { -+ counter++; -+ fputs("(3) exception dtor\n", stderr); -+ } -+}; -+int test3_exception::counter = 0; -+ -+int main() -+{ -+ /////////////////////////////////////////////////////////////// -+ fputs("(1) foreign exception, exception_cleanup=nullptr\n", stderr); -+ try -+ { -+ global_e.exception_class = 0; -+ global_e.exception_cleanup = 0; -+ __real__Unwind_RaiseException(&global_e); -+ } -+ catch (...) -+ { -+ } -+ test1_status = PASSED; -+ fputs("(1) PASS\n", stderr); -+ -+ /////////////////////////////////////////////////////////////// -+ fputs("(2) foreign exception, exception_cleanup present\n", stderr); -+ try -+ { -+ global_e.exception_class = 0; -+ global_e.exception_cleanup = test2_exception_cleanup; -+ __real__Unwind_RaiseException(&global_e); -+ } -+ catch (...) -+ { -+ } -+ fprintf(stderr, "(2) %s\n", test_status_str[test2_status]); -+ -+ /////////////////////////////////////////////////////////////// -+ fputs("(3) C++ exception in foreign environment\n", stderr); -+ int counter_expected; -+ try -+ { -+ // throw was rigged such that the runtime treats C++ exceptions -+ // as foreign ones -+ throw test3_exception(); -+ } -+ catch (test3_exception&) -+ { -+ fputs("(3) ERROR: wrong catch\n", stderr); -+ test3_status = FAILED; -+ } -+ catch (...) -+ { -+ fputs("(3) catch(...)\n", stderr); -+ counter_expected = test3_exception::counter + 1; -+ // one more dtor immediately after we leave catch -+ } -+ if (test3_status == PENDING && test3_exception::counter != counter_expected) { -+ fputs("(3) ERROR: exception dtor didn't run\n", stderr); -+ test3_status = FAILED; -+ } -+ if (test3_status == PENDING) -+ test3_status = PASSED; -+ fprintf(stderr, "(3) %s\n", test_status_str[test3_status]); -+ -+ /////////////////////////////////////////////////////////////// -+ if (test1_status == PASSED && test2_status == PASSED && test3_status == PASSED) -+ return EXIT_SUCCESS; -+ else -+ return EXIT_FAILURE; -+} |