Diff below does two things: - allows us to build ports gcc without sbrk - resyncs the kprintf implementation with base gcc
ok? Index: 4.9/Makefile =================================================================== RCS file: /cvs/ports/lang/gcc/4.9/Makefile,v retrieving revision 1.60 diff -u -p -u -r1.60 Makefile --- 4.9/Makefile 2 Nov 2018 18:43:56 -0000 1.60 +++ 4.9/Makefile 12 Nov 2018 01:21:17 -0000 @@ -4,7 +4,7 @@ ONLY_FOR_ARCHS = ${GCC49_ARCHS} DPB_PROPERTIES = parallel V = 4.9.4 -REVISION = 13 +REVISION = 14 FULL_VERSION = $V FULL_PKGVERSION = $V @@ -117,6 +117,7 @@ CONFIGURE_STYLE = gnu MODGNU_CONFIG_GUESS_DIRS = ${WRKSRC} ${WRKSRC}/gcc EXTRA_ENV += am_cv_func_iconv=no JAR=no +EXTRA_ENV += ac_cv_func_sbrk=no EXTRA_ENV += ac_cv_prog_M4=/usr/bin/m4 EXTRA_ENV += ac_cv_header_magic_h=no EXTRA_ENV += lt_cv_path_SED=/usr/bin/sed Index: 4.9/patches/patch-gcc_c-family_c-format_c =================================================================== RCS file: /cvs/ports/lang/gcc/4.9/patches/patch-gcc_c-family_c-format_c,v retrieving revision 1.1.1.1 diff -u -p -u -r1.1.1.1 patch-gcc_c-family_c-format_c --- 4.9/patches/patch-gcc_c-family_c-format_c 26 Jun 2014 16:30:16 -0000 1.1.1.1 +++ 4.9/patches/patch-gcc_c-family_c-format_c 12 Nov 2018 01:21:17 -0000 @@ -1,6 +1,7 @@ $OpenBSD: patch-gcc_c-family_c-format_c,v 1.1.1.1 2014/06/26 16:30:16 pascal Exp $ ---- gcc/c-family/c-format.c.orig Wed Nov 20 12:57:27 2013 -+++ gcc/c-family/c-format.c Mon Dec 2 12:20:02 2013 +Index: gcc/c-family/c-format.c +--- gcc/c-family/c-format.c.orig ++++ gcc/c-family/c-format.c @@ -39,6 +39,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, gcc_diag_format_type, gcc_tdiag_format_type, gcc_cdiag_format_type, gcc_cxxdiag_format_type, gcc_gfc_format_type, -@@ -52,6 +53,7 @@ typedef struct function_format_info - unsigned HOST_WIDE_INT first_arg_num; /* number of first arg (zero for varargs) */ - } function_format_info; - -+ - static bool decode_format_attr (tree, function_format_info *, int); - static int decode_format_type (const char *); - -@@ -418,6 +420,15 @@ static const format_length_info gcc_diag_length_specs[ +@@ -418,6 +419,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, + { "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 -@@ -598,7 +609,6 @@ static const format_flag_pair strfmon_flag_pairs[] = - { 0, 0, 0, 0 } - }; - -- - static const format_char_info print_char_table[] = - { - /* C89 conversion specifiers. */ -@@ -642,6 +652,44 @@ static const format_char_info asm_fprintf_char_table[] +@@ -642,6 +653,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, static const format_char_info gcc_diag_char_table[] = { /* C89 conversion specifiers. */ -@@ -821,6 +869,18 @@ static const format_kind_info format_types_orig[] = +@@ -821,6 +870,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 + },