Date: Sat, 25 Mar 2017 12:51:11 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r315944 - vendor/libcxxrt/dist Message-ID: <201703251251.v2PCpBjl084727@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Sat Mar 25 12:51:11 2017 New Revision: 315944 URL: https://svnweb.freebsd.org/changeset/base/315944 Log: Import libcxxrt master 8a853717e61d5d55cbdf74d9d0a7545da5d5ff92. Interesting fixes: c9601e9 __cxa_demangle_gnu3: fix demangling of wchar_t (#39) 0c7c611 Merge C++ demangler bug fixes from ELF Tool Chain (#40) 2b208d9 __cxa_demangle_gnu3: demangle 'z' as '...', not 'ellipsis' (#41) c94e7e0 Add _US_ACTION_MASK to libcxxrt's arm-specific unwind header (#42) 8a85371 Simplify some code. Modified: vendor/libcxxrt/dist/CMakeLists.txt vendor/libcxxrt/dist/libelftc_dem_gnu3.c vendor/libcxxrt/dist/typeinfo.cc vendor/libcxxrt/dist/unwind-arm.h Modified: vendor/libcxxrt/dist/CMakeLists.txt ============================================================================== --- vendor/libcxxrt/dist/CMakeLists.txt Sat Mar 25 12:29:15 2017 (r315943) +++ vendor/libcxxrt/dist/CMakeLists.txt Sat Mar 25 12:51:11 2017 (r315944) @@ -13,11 +13,8 @@ set(CXXRT_SOURCES add_library(cxxrt-static STATIC ${CXXRT_SOURCES}) add_library(cxxrt-shared SHARED ${CXXRT_SOURCES}) - -if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") - target_link_libraries(cxxrt-shared dl) - target_link_libraries(cxxrt-static dl) -endif() +target_link_libraries(cxxrt-shared ${CMAKE_DL_LIBS}) +target_link_libraries(cxxrt-static ${CMAKE_DL_LIBS}) set_target_properties(cxxrt-static cxxrt-shared PROPERTIES OUTPUT_NAME "cxxrt" Modified: vendor/libcxxrt/dist/libelftc_dem_gnu3.c ============================================================================== --- vendor/libcxxrt/dist/libelftc_dem_gnu3.c Sat Mar 25 12:29:15 2017 (r315943) +++ vendor/libcxxrt/dist/libelftc_dem_gnu3.c Sat Mar 25 12:51:11 2017 (r315944) @@ -846,7 +846,7 @@ cpp_demangle_push_type_qualifier(struct free(buf); ++e_idx; break; - }; + } --idx; } @@ -1007,7 +1007,7 @@ cpp_demangle_read_expr_primary(struct cp return (cpp_demangle_push_str(ddata, "true", 4)); default: return (0); - }; + } case 'd': ++ddata->cur; @@ -1057,7 +1057,7 @@ cpp_demangle_read_expr_primary(struct cp default: return (0); - }; + } } static int @@ -1332,14 +1332,14 @@ cpp_demangle_read_expression(struct cpp_ /* operator sizeof */ ddata->cur += 2; return (cpp_demangle_read_expression_unary(ddata, "sizeof", 6)); - }; + } switch (*ddata->cur) { case 'L': return (cpp_demangle_read_expr_primary(ddata)); case 'T': return (cpp_demangle_read_tmpl_param(ddata)); - }; + } return (0); } @@ -1555,11 +1555,13 @@ cpp_demangle_read_encoding(struct cpp_de if (!cpp_demangle_push_str(ddata, "non-transaction clone for ", 26)) return (0); + break; case 't': default: if (!cpp_demangle_push_str(ddata, "transaction clone for ", 22)) return (0); + break; } ++ddata->cur; return (cpp_demangle_read_encoding(ddata)); @@ -1712,7 +1714,7 @@ cpp_demangle_read_encoding(struct cpp_de if (*ddata->cur == '\0') return (0); break; - }; + } return (cpp_demangle_read_name(ddata)); } @@ -1784,7 +1786,7 @@ cpp_demangle_read_name(struct cpp_demang return (cpp_demangle_read_nested_name(ddata)); case 'Z': return (cpp_demangle_read_local_name(ddata)); - }; + } if (!vector_str_init(&v)) return (0); @@ -1885,7 +1887,7 @@ cpp_demangle_read_nested_name(struct cpp case 'K': ddata->mem_cst = true; break; - }; + } ++ddata->cur; } @@ -1913,7 +1915,7 @@ cpp_demangle_read_nested_name(struct cpp default: if (!cpp_demangle_read_uqname(ddata)) goto clean; - }; + } if ((subst_str = vector_str_substr(output, p_idx, output->size - 1, &subst_str_len)) == NULL) @@ -2188,35 +2190,35 @@ cpp_demangle_read_subst(struct cpp_deman case SIMPLE_HASH('S', 'd'): /* std::basic_iostream<char, std::char_traits<char> > */ - if (!cpp_demangle_push_str(ddata, "std::iostream", 19)) + if (!cpp_demangle_push_str(ddata, "std::basic_iostream", 19)) return (0); - ddata->last_sname = "iostream"; + ddata->last_sname = "basic_iostream"; ddata->cur += 2; if (*ddata->cur == 'I') return (cpp_demangle_read_subst_stdtmpl(ddata, - "std::iostream", 19)); + "std::basic_iostream", 19)); return (1); case SIMPLE_HASH('S', 'i'): /* std::basic_istream<char, std::char_traits<char> > */ - if (!cpp_demangle_push_str(ddata, "std::istream", 18)) + if (!cpp_demangle_push_str(ddata, "std::basic_istream", 18)) return (0); - ddata->last_sname = "istream"; + ddata->last_sname = "basic_istream"; ddata->cur += 2; if (*ddata->cur == 'I') return (cpp_demangle_read_subst_stdtmpl(ddata, - "std::istream", 18)); + "std::basic_istream", 18)); return (1); case SIMPLE_HASH('S', 'o'): /* std::basic_ostream<char, std::char_traits<char> > */ - if (!cpp_demangle_push_str(ddata, "std::ostream", 18)) + if (!cpp_demangle_push_str(ddata, "std::basic_ostream", 18)) return (0); - ddata->last_sname = "istream"; + ddata->last_sname = "basic_ostream"; ddata->cur += 2; if (*ddata->cur == 'I') return (cpp_demangle_read_subst_stdtmpl(ddata, - "std::ostream", 18)); + "std::basic_ostream", 18)); return (1); case SIMPLE_HASH('S', 's'): @@ -2238,7 +2240,7 @@ cpp_demangle_read_subst(struct cpp_deman case SIMPLE_HASH('S', 't'): /* std:: */ return (cpp_demangle_read_subst_std(ddata)); - }; + } if (*(++ddata->cur) == '\0') return (0); @@ -2386,7 +2388,7 @@ cpp_demangle_read_tmpl_arg(struct cpp_de return (cpp_demangle_read_expr_primary(ddata)); case 'X': return (cpp_demangle_read_expression(ddata)); - }; + } return (cpp_demangle_read_type(ddata, 0)); } @@ -2842,7 +2844,7 @@ again: case 'w': /* wchar_t */ - if (!cpp_demangle_push_str(ddata, "wchar_t", 6)) + if (!cpp_demangle_push_str(ddata, "wchar_t", 7)) goto clean; ++ddata->cur; goto rtn; @@ -2863,11 +2865,11 @@ again: case 'z': /* ellipsis */ - if (!cpp_demangle_push_str(ddata, "ellipsis", 8)) + if (!cpp_demangle_push_str(ddata, "...", 3)) goto clean; ++ddata->cur; goto rtn; - }; + } if (!cpp_demangle_read_name(ddata)) goto clean; @@ -3331,7 +3333,7 @@ cpp_demangle_read_uqname(struct cpp_dema return (0); ddata->cur += 2; return (1); - }; + } /* vendor extened operator */ if (*ddata->cur == 'v' && ELFTC_ISDIGIT(*(ddata->cur + 1))) { @@ -3377,7 +3379,7 @@ cpp_demangle_read_uqname(struct cpp_dema return (0); ddata->cur +=2; return (1); - }; + } /* source name */ if (ELFTC_ISDIGIT(*ddata->cur) != 0) @@ -3740,7 +3742,7 @@ hex_to_dec(char c) return (15); default: return (-1); - }; + } } static void Modified: vendor/libcxxrt/dist/typeinfo.cc ============================================================================== --- vendor/libcxxrt/dist/typeinfo.cc Sat Mar 25 12:29:15 2017 (r315943) +++ vendor/libcxxrt/dist/typeinfo.cc Sat Mar 25 12:51:11 2017 (r315944) @@ -86,15 +86,7 @@ extern "C" char* __cxa_demangle(const ch if (NULL != demangled) { size_t len = strlen(demangled); - if (buf == NULL) - { - if (n) - { - *n = len; - } - return demangled; - } - if (*n < len+1) + if (!buf || (*n < len+1)) { buf = static_cast<char*>(realloc(buf, len+1)); } Modified: vendor/libcxxrt/dist/unwind-arm.h ============================================================================== --- vendor/libcxxrt/dist/unwind-arm.h Sat Mar 25 12:29:15 2017 (r315943) +++ vendor/libcxxrt/dist/unwind-arm.h Sat Mar 25 12:51:11 2017 (r315944) @@ -28,7 +28,7 @@ { _URC_OK = 0, /* operation completed successfully */ _URC_FOREIGN_EXCEPTION_CAUGHT = 1, - _URC_END_OF_STACK = 5, + _URC_END_OF_STACK = 5, _URC_HANDLER_FOUND = 6, _URC_INSTALL_CONTEXT = 7, _URC_CONTINUE_UNWIND = 8, @@ -41,10 +41,12 @@ typedef uint32_t _Unwind_State; static const _Unwind_State _US_VIRTUAL_UNWIND_FRAME = 0; static const _Unwind_State _US_UNWIND_FRAME_STARTING = 1; static const _Unwind_State _US_UNWIND_FRAME_RESUME = 2; +static const _Unwind_State _US_ACTION_MASK = 3; #else // GCC fails at knowing what a constant expression is # define _US_VIRTUAL_UNWIND_FRAME 0 # define _US_UNWIND_FRAME_STARTING 1 -# define _US_UNWIND_FRAME_RESUME 2 +# define _US_UNWIND_FRAME_RESUME 2 +# define _US_ACTION_MASK 3 #endif typedef struct _Unwind_Context _Unwind_Context;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703251251.v2PCpBjl084727>