From 93a8385d3facb43c13c9e9edcb9b58749d26b491 Mon Sep 17 00:00:00 2001 From: pascal Date: Thu, 27 Dec 2018 15:49:44 +0000 Subject: [PATCH] * merge kprintf format update from gcc 4.9 * fix ABI break in libestdc++ introduced in GCC 6.5.0 From Brad. --- lang/gcc/6/Makefile | 3 +- .../6/patches/patch-gcc_c-family_c-format_c | 40 ++++++------------- ...patch-libstdc++-v3_include_bits_stl_pair_h | 36 +++++++++++++++++ 3 files changed, 51 insertions(+), 28 deletions(-) create mode 100644 lang/gcc/6/patches/patch-libstdc++-v3_include_bits_stl_pair_h diff --git a/lang/gcc/6/Makefile b/lang/gcc/6/Makefile index 2b9e12ab195..fe301e81042 100644 --- a/lang/gcc/6/Makefile +++ b/lang/gcc/6/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.22 2018/12/26 17:09:59 pascal Exp $ +# $OpenBSD: Makefile,v 1.23 2018/12/27 15:49:44 pascal Exp $ ONLY_FOR_ARCHS = ${GCC49_ARCHS} DPB_PROPERTIES = parallel @@ -6,6 +6,7 @@ DPB_PROPERTIES = parallel V = 6.5.0 FULL_VERSION = $V FULL_PKGVERSION = $V +REVISION = 0 ADASTRAP_LIBC-amd64 = 93.0 ADASTRAP_LIBM-amd64 = 10.1 diff --git a/lang/gcc/6/patches/patch-gcc_c-family_c-format_c b/lang/gcc/6/patches/patch-gcc_c-family_c-format_c index 7603581dd99..e1f83cac41a 100644 --- a/lang/gcc/6/patches/patch-gcc_c-family_c-format_c +++ b/lang/gcc/6/patches/patch-gcc_c-family_c-format_c @@ -1,6 +1,7 @@ -$OpenBSD: patch-gcc_c-family_c-format_c,v 1.1.1.1 2016/09/04 16:20:16 pascal Exp $ ---- gcc/c-family/c-format.c.orig Mon Jan 4 15:30:50 2016 -+++ gcc/c-family/c-format.c Tue Aug 23 15:48:16 2016 +$OpenBSD: patch-gcc_c-family_c-format_c,v 1.2 2018/12/27 15:49:44 pascal Exp $ +Index: gcc/c-family/c-format.c +--- gcc/c-family/c-format.c.orig ++++ gcc/c-family/c-format.c @@ -36,6 +36,7 @@ along with GCC; see the file COPYING3. If not see format_type_error. Target-specific format types do not have matching enum values. */ @@ -9,15 +10,7 @@ $OpenBSD: patch-gcc_c-family_c-format_c,v 1.1.1.1 2016/09/04 16:20:16 pascal Exp gcc_diag_format_type, gcc_tdiag_format_type, gcc_cdiag_format_type, gcc_cxxdiag_format_type, gcc_gfc_format_type, -@@ -49,6 +50,7 @@ struct function_format_info - unsigned HOST_WIDE_INT first_arg_num; /* number of first arg (zero for varargs) */ - }; - -+ - static bool decode_format_attr (tree, function_format_info *, int); - static int decode_format_type (const char *); - -@@ -492,6 +494,15 @@ static const format_length_info gcc_diag_length_specs[ +@@ -492,6 +493,16 @@ static const format_length_info gcc_diag_length_specs[ { NO_FMT, NO_FMT, 0 } }; @@ -26,31 +19,24 @@ $OpenBSD: patch-gcc_c-family_c-format_c,v 1.1.1.1 2016/09/04 16:20:16 pascal Exp + { "h", FMT_LEN_h, STD_C89, NO_FMT, 0 }, + { "l", FMT_LEN_l, STD_C89, "ll", FMT_LEN_ll, STD_C9L, 0 }, + { "q", FMT_LEN_ll, STD_EXT, NO_FMT, 0 }, -+ { "L", FMT_LEN_L, STD_C89, NO_FMT, 0 }, ++ { "z", FMT_LEN_z, STD_C99, NO_FMT, 0 }, ++ { "t", FMT_LEN_t, STD_C99, NO_FMT, 0 }, + { NO_FMT, NO_FMT, 0 } +}; + /* The custom diagnostics all accept the same length specifiers. */ #define gcc_tdiag_length_specs gcc_diag_length_specs #define gcc_cdiag_length_specs gcc_diag_length_specs -@@ -669,7 +680,6 @@ static const format_flag_pair strfmon_flag_pairs[] = - { 0, 0, 0, 0 } - }; - -- - static const format_char_info print_char_table[] = - { - /* C89 conversion specifiers. */ -@@ -713,6 +723,44 @@ static const format_char_info asm_fprintf_char_table[] +@@ -713,6 +724,44 @@ static const format_char_info asm_fprintf_char_table[] { NULL, 0, STD_C89, NOLENGTHS, NULL, NULL, NULL } }; +static const format_char_info kprint_char_table[] = +{ + /* C89 conversion specifiers. */ -+ { "di", 0, STD_C89, { T89_I, BADLEN, T89_S, T89_L, T9L_LL, BADLEN, T99_SST, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp0 +'I", "i", NULL }, -+ { "oxX", 0, STD_C89, { T89_UI, BADLEN, T89_US, T89_UL, T9L_ULL, BADLEN, T99_ST, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp0#", "i", NULL }, -+ { "u", 0, STD_C89, { T89_UI, BADLEN, T89_US, T89_UL, T9L_ULL, BADLEN, T99_ST, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp0'I", "i", NULL }, ++ { "di", 0, STD_C89, { T89_I, BADLEN, T89_S, T89_L, T9L_LL, BADLEN, T99_SST, T99_PD, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp0 +'I", "i", NULL }, ++ { "oxX", 0, STD_C89, { T89_UI, BADLEN, T89_US, T89_UL, T9L_ULL, BADLEN, T99_ST, T99_UPD, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp0#", "i", NULL }, ++ { "u", 0, STD_C89, { T89_UI, BADLEN, T89_US, T89_UL, T9L_ULL, BADLEN, T99_ST, T99_UPD, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp0'I", "i", NULL }, + { "c", 0, STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "", NULL }, + { "s", 1, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "cR", NULL }, + { "p", 1, STD_C89, { T89_V, BADLEN, BADLEN, T89_UL, T9L_LL, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp0", "c", NULL }, @@ -86,14 +72,14 @@ $OpenBSD: patch-gcc_c-family_c-format_c,v 1.1.1.1 2016/09/04 16:20:16 pascal Exp static const format_char_info gcc_diag_char_table[] = { /* C89 conversion specifiers. */ -@@ -894,6 +942,18 @@ static const format_kind_info format_types_orig[] = +@@ -894,6 +943,18 @@ static const format_kind_info format_types_orig[] = FMT_FLAG_ARG_CONVERT|FMT_FLAG_EMPTY_PREC_OK, 'w', 0, 'p', 0, 'L', 0, NULL, NULL + }, + { "kprintf", kprintf_length_specs, kprint_char_table, " +#0-'I", NULL, + printf_flag_specs, printf_flag_pairs, -+ FMT_FLAG_ARG_CONVERT|FMT_FLAG_DOLLAR_MULTIPLE|FMT_FLAG_USE_DOLLAR|FMT_FLAG_EMPTY_PREC_OK, ++ FMT_FLAG_ARG_CONVERT|FMT_FLAG_EMPTY_PREC_OK, + 'w', 0, 'p', 0, 'L', 0, + &integer_type_node, &integer_type_node + }, diff --git a/lang/gcc/6/patches/patch-libstdc++-v3_include_bits_stl_pair_h b/lang/gcc/6/patches/patch-libstdc++-v3_include_bits_stl_pair_h new file mode 100644 index 00000000000..81d187da48d --- /dev/null +++ b/lang/gcc/6/patches/patch-libstdc++-v3_include_bits_stl_pair_h @@ -0,0 +1,36 @@ +$OpenBSD: patch-libstdc++-v3_include_bits_stl_pair_h,v 1.1 2018/12/27 15:49:44 pascal Exp $ + +PR libstdc++/87822 fix layout change for nested std::pair + +The introduction of the empty __pair_base base class for PR 86751 +changed the layout of std::pair, ...>. The outer pair and +its first member both have a base class of the same type, which cannot +exist at the same address. This causes the first member to be at a +non-zero offset. + +The solution is to make the base class depend on the template +parameters, so that each pair type has a different base class type, +which allows the base classes of the outer pair and its first member to +have the same address. + +Index: libstdc++-v3/include/bits/stl_pair.h +--- libstdc++-v3/include/bits/stl_pair.h.orig ++++ libstdc++-v3/include/bits/stl_pair.h +@@ -183,7 +183,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + }; + #endif // C++11 + +- class __pair_base ++ template class __pair_base + { + #if __cplusplus >= 201103L + template friend struct pair; +@@ -202,7 +202,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + */ + template + struct pair +- : private __pair_base ++ : private __pair_base<_T1, _T2> + { + typedef _T1 first_type; /// @c first_type is the first bound type + typedef _T2 second_type; /// @c second_type is the second bound type