Attached is a new diff fixing build on armv7 and adding patches to fix the build after the switch to clang 6. The patch became pretty big, because clang complains about error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal] in a lot of files. No change in the armv7 fixes, still setting -fbracket-depth=512 in case CC is clang and adding #include <new> in gcc/system.h when compiling c++.
Index: Makefile =================================================================== RCS file: /cvs/ports/lang/gcc/4.9/Makefile,v retrieving revision 1.54 diff -u -p -r1.54 Makefile --- Makefile 15 Mar 2018 01:16:42 -0000 1.54 +++ Makefile 15 Apr 2018 16:02:31 -0000 @@ -4,7 +4,7 @@ ONLY_FOR_ARCHS = ${GCC49_ARCHS} DPB_PROPERTIES = parallel V = 4.9.4 -REVISION = 8 +REVISION = 9 FULL_VERSION = $V FULL_PKGVERSION = $V Index: patches/patch-gcc_bitmap_c =================================================================== RCS file: patches/patch-gcc_bitmap_c diff -N patches/patch-gcc_bitmap_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-gcc_bitmap_c 15 Apr 2018 16:02:31 -0000 @@ -0,0 +1,27 @@ +$OpenBSD$ + +Index: gcc/bitmap.c +--- gcc/bitmap.c.orig ++++ gcc/bitmap.c +@@ -2166,9 +2166,9 @@ print_statistics (bitmap_descriptor_d **slot, output_i + s[41] = 0; + fprintf (stderr, + "%-41s %9u" +- " %15"HOST_WIDEST_INT_PRINT"d %15"HOST_WIDEST_INT_PRINT"d" +- " %15"HOST_WIDEST_INT_PRINT"d" +- " %10"HOST_WIDEST_INT_PRINT"d %10"HOST_WIDEST_INT_PRINT"d\n", ++ " %15" HOST_WIDEST_INT_PRINT "d %15" HOST_WIDEST_INT_PRINT "d" ++ " %15" HOST_WIDEST_INT_PRINT "d" ++ " %10" HOST_WIDEST_INT_PRINT "d %10" HOST_WIDEST_INT_PRINT "d\n", + s, d->created, + d->allocated, d->peak, d->current, + d->nsearches, d->search_iter); +@@ -2201,7 +2201,7 @@ dump_bitmap_statistics (void) + bitmap_desc_hash.traverse <output_info *, print_statistics> (&info); + fprintf (stderr, "---------------------------------------------------------------------------------\n"); + fprintf (stderr, +- "%-41s %9"HOST_WIDEST_INT_PRINT"d %15"HOST_WIDEST_INT_PRINT"d\n", ++ "%-41s %9" HOST_WIDEST_INT_PRINT "d %15" HOST_WIDEST_INT_PRINT "d\n", + "Total", info.count, info.size); + fprintf (stderr, "---------------------------------------------------------------------------------\n"); + } Index: patches/patch-gcc_cgraph_c =================================================================== RCS file: patches/patch-gcc_cgraph_c diff -N patches/patch-gcc_cgraph_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-gcc_cgraph_c 15 Apr 2018 16:02:31 -0000 @@ -0,0 +1,41 @@ +$OpenBSD$ + +Index: gcc/cgraph.c +--- gcc/cgraph.c.orig ++++ gcc/cgraph.c +@@ -1378,7 +1378,7 @@ cgraph_redirect_edge_call_stmt_to_callee (struct cgrap + if (dump_file) + fprintf (dump_file, + "Expanding speculative call of %s/%i -> %s/%i count:" +- HOST_WIDEST_INT_PRINT_DEC"\n", ++ HOST_WIDEST_INT_PRINT_DEC "\n", + xstrdup (e->caller->name ()), + e->caller->order, + xstrdup (e->callee->name ()), +@@ -1976,7 +1976,7 @@ dump_cgraph_node (FILE *f, struct cgraph_node *node) + fprintf (f, " First run: %i\n", node->tp_first_run); + fprintf (f, " Function flags:"); + if (node->count) +- fprintf (f, " executed "HOST_WIDEST_INT_PRINT_DEC"x", ++ fprintf (f, " executed " HOST_WIDEST_INT_PRINT_DEC "x", + (HOST_WIDEST_INT)node->count); + if (node->origin) + fprintf (f, " nested in: %s", node->origin->asm_name ()); +@@ -2028,7 +2028,7 @@ dump_cgraph_node (FILE *f, struct cgraph_node *node) + fprintf (f, "%s/%i ", edge->caller->asm_name (), + edge->caller->order); + if (edge->count) +- fprintf (f, "("HOST_WIDEST_INT_PRINT_DEC"x) ", ++ fprintf (f, "(" HOST_WIDEST_INT_PRINT_DEC "x) ", + (HOST_WIDEST_INT)edge->count); + if (edge->frequency) + fprintf (f, "(%.2f per call) ", +@@ -2055,7 +2055,7 @@ dump_cgraph_node (FILE *f, struct cgraph_node *node) + if (edge->indirect_inlining_edge) + fprintf (f, "(indirect_inlining) "); + if (edge->count) +- fprintf (f, "("HOST_WIDEST_INT_PRINT_DEC"x) ", ++ fprintf (f, "(" HOST_WIDEST_INT_PRINT_DEC "x) ", + (HOST_WIDEST_INT)edge->count); + if (edge->frequency) + fprintf (f, "(%.2f per call) ", Index: patches/patch-gcc_config_elfos_h =================================================================== RCS file: patches/patch-gcc_config_elfos_h diff -N patches/patch-gcc_config_elfos_h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-gcc_config_elfos_h 15 Apr 2018 16:02:31 -0000 @@ -0,0 +1,23 @@ +$OpenBSD$ + +Index: gcc/config/elfos.h +--- gcc/config/elfos.h.orig ++++ gcc/config/elfos.h +@@ -99,7 +99,7 @@ see the files COPYING3 and COPYING.RUNTIME respectivel + + #undef ASM_OUTPUT_SKIP + #define ASM_OUTPUT_SKIP(FILE, SIZE) \ +- fprintf ((FILE), "%s"HOST_WIDE_INT_PRINT_UNSIGNED"\n",\ ++ fprintf ((FILE), "%s" HOST_WIDE_INT_PRINT_UNSIGNED "\n",\ + SKIP_ASM_OP, (SIZE)) + + /* This is how to store into the string LABEL +@@ -167,7 +167,7 @@ see the files COPYING3 and COPYING.RUNTIME respectivel + { \ + fprintf ((FILE), "%s", COMMON_ASM_OP); \ + assemble_name ((FILE), (NAME)); \ +- fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ ++ fprintf ((FILE), "," HOST_WIDE_INT_PRINT_UNSIGNED ",%u\n", \ + (SIZE), (ALIGN) / BITS_PER_UNIT); \ + } \ + while (0) Index: patches/patch-gcc_configure =================================================================== RCS file: /cvs/ports/lang/gcc/4.9/patches/patch-gcc_configure,v retrieving revision 1.5 diff -u -p -r1.5 patch-gcc_configure --- patches/patch-gcc_configure 1 Sep 2016 17:30:33 -0000 1.5 +++ patches/patch-gcc_configure 15 Apr 2018 16:02:31 -0000 @@ -1,7 +1,20 @@ $OpenBSD: patch-gcc_configure,v 1.5 2016/09/01 17:30:33 pascal Exp $ ---- gcc/configure.orig Sun May 22 10:53:32 2016 -+++ gcc/configure Sat Aug 6 19:19:05 2016 -@@ -17367,7 +17367,7 @@ openbsd*) +Index: gcc/configure +--- gcc/configure.orig ++++ gcc/configure +@@ -6597,6 +6597,11 @@ $as_echo "$ac_res" >&6; } + fi + done + CFLAGS="$save_CFLAGS" ++if [[ `uname -m` == armv7 ]] ; then ++ if $CC --version 2>&1 | grep clang; then ++ noexception_flags="$noexception_flags -fbracket-depth=512" ++ fi ++fi + + + # Enable expensive internal checks +@@ -17367,7 +17372,7 @@ openbsd*) *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' @@ -10,7 +23,7 @@ $OpenBSD: patch-gcc_configure,v 1.5 2016 shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in -@@ -21027,7 +21027,7 @@ openbsd*) +@@ -21027,7 +21032,7 @@ openbsd*) *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' @@ -19,7 +32,7 @@ $OpenBSD: patch-gcc_configure,v 1.5 2016 shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in -@@ -27522,6 +27522,7 @@ else +@@ -27522,6 +27527,7 @@ else fi ;; Index: patches/patch-gcc_cppbuiltin_c =================================================================== RCS file: patches/patch-gcc_cppbuiltin_c diff -N patches/patch-gcc_cppbuiltin_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-gcc_cppbuiltin_c 15 Apr 2018 16:02:31 -0000 @@ -0,0 +1,14 @@ +$OpenBSD$ + +Index: gcc/cppbuiltin.c +--- gcc/cppbuiltin.c.orig ++++ gcc/cppbuiltin.c +@@ -129,7 +129,7 @@ static void + define_builtin_macros_for_type_sizes (cpp_reader *pfile) + { + #define define_type_sizeof(NAME, TYPE) \ +- cpp_define_formatted (pfile, NAME"="HOST_WIDE_INT_PRINT_DEC, \ ++ cpp_define_formatted (pfile, NAME"=" HOST_WIDE_INT_PRINT_DEC, \ + tree_to_uhwi (TYPE_SIZE_UNIT (TYPE))) + + define_type_sizeof ("__SIZEOF_INT__", integer_type_node); Index: patches/patch-gcc_defaults_h =================================================================== RCS file: /cvs/ports/lang/gcc/4.9/patches/patch-gcc_defaults_h,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 patch-gcc_defaults_h --- patches/patch-gcc_defaults_h 26 Jun 2014 16:30:17 -0000 1.1.1.1 +++ patches/patch-gcc_defaults_h 15 Apr 2018 16:02:31 -0000 @@ -1,14 +1,24 @@ $OpenBSD: patch-gcc_defaults_h,v 1.1.1.1 2014/06/26 16:30:17 pascal Exp $ ---- gcc/defaults.h.orig Thu Jan 2 23:23:26 2014 -+++ gcc/defaults.h Fri Feb 14 20:24:54 2014 -@@ -1388,6 +1388,10 @@ see the files COPYING3 and COPYING.RUNTIME respectivel - #define SWITCHABLE_TARGET 0 - #endif +Index: gcc/defaults.h +--- gcc/defaults.h.orig ++++ gcc/defaults.h +@@ -123,7 +123,7 @@ see the files COPYING3 and COPYING.RUNTIME respectivel + { \ + fprintf ((FILE), "\t%s\t", TLS_COMMON_ASM_OP); \ + assemble_name ((FILE), (NAME)); \ +- fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ ++ fprintf ((FILE), "," HOST_WIDE_INT_PRINT_UNSIGNED ",%u\n", \ + (SIZE), DECL_ALIGN (DECL) / BITS_PER_UNIT); \ + } \ + while (0) +@@ -1386,6 +1386,10 @@ see the files COPYING3 and COPYING.RUNTIME respectivel -+#ifndef PIE_DEFAULT -+#define PIE_DEFAULT 0 + #ifndef SWITCHABLE_TARGET + #define SWITCHABLE_TARGET 0 +#endif + - #endif /* GCC_INSN_FLAGS_H */ ++#ifndef PIE_DEFAULT ++#define PIE_DEFAULT 0 + #endif - #endif /* ! GCC_DEFAULTS_H */ + #endif /* GCC_INSN_FLAGS_H */ Index: patches/patch-gcc_dwarf2cfi_c =================================================================== RCS file: patches/patch-gcc_dwarf2cfi_c diff -N patches/patch-gcc_dwarf2cfi_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-gcc_dwarf2cfi_c 15 Apr 2018 16:02:31 -0000 @@ -0,0 +1,39 @@ +$OpenBSD$ + +Index: gcc/dwarf2cfi.c +--- gcc/dwarf2cfi.c.orig ++++ gcc/dwarf2cfi.c +@@ -3176,7 +3176,7 @@ output_cfi_directive (FILE *f, dw_cfi_ref cfi) + case DW_CFA_offset_extended: + case DW_CFA_offset_extended_sf: + r = DWARF2_FRAME_REG_OUT (cfi->dw_cfi_oprnd1.dw_cfi_reg_num, 1); +- fprintf (f, "\t.cfi_offset %lu, "HOST_WIDE_INT_PRINT_DEC"\n", ++ fprintf (f, "\t.cfi_offset %lu, " HOST_WIDE_INT_PRINT_DEC "\n", + r, cfi->dw_cfi_oprnd2.dw_cfi_offset); + break; + +@@ -3199,7 +3199,7 @@ output_cfi_directive (FILE *f, dw_cfi_ref cfi) + case DW_CFA_def_cfa: + case DW_CFA_def_cfa_sf: + r = DWARF2_FRAME_REG_OUT (cfi->dw_cfi_oprnd1.dw_cfi_reg_num, 1); +- fprintf (f, "\t.cfi_def_cfa %lu, "HOST_WIDE_INT_PRINT_DEC"\n", ++ fprintf (f, "\t.cfi_def_cfa %lu, " HOST_WIDE_INT_PRINT_DEC "\n", + r, cfi->dw_cfi_oprnd2.dw_cfi_offset); + break; + +@@ -3234,13 +3234,13 @@ output_cfi_directive (FILE *f, dw_cfi_ref cfi) + fprintf (f, "\t.cfi_escape %#x,", DW_CFA_GNU_args_size); + dw2_asm_output_data_uleb128_raw (cfi->dw_cfi_oprnd1.dw_cfi_offset); + if (flag_debug_asm) +- fprintf (f, "\t%s args_size "HOST_WIDE_INT_PRINT_DEC, ++ fprintf (f, "\t%s args_size " HOST_WIDE_INT_PRINT_DEC, + ASM_COMMENT_START, cfi->dw_cfi_oprnd1.dw_cfi_offset); + fputc ('\n', f); + } + else + { +- fprintf (f, "\t.cfi_GNU_args_size "HOST_WIDE_INT_PRINT_DEC "\n", ++ fprintf (f, "\t.cfi_GNU_args_size " HOST_WIDE_INT_PRINT_DEC "\n", + cfi->dw_cfi_oprnd1.dw_cfi_offset); + } + break; Index: patches/patch-gcc_dwarf2out_c =================================================================== RCS file: patches/patch-gcc_dwarf2out_c diff -N patches/patch-gcc_dwarf2out_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-gcc_dwarf2out_c 15 Apr 2018 16:02:31 -0000 @@ -0,0 +1,16 @@ +$OpenBSD$ + +Index: gcc/dwarf2out.c +--- gcc/dwarf2out.c.orig ++++ gcc/dwarf2out.c +@@ -5324,8 +5324,8 @@ print_die (dw_die_ref die, FILE *outfile) + fprintf (outfile, HOST_WIDE_INT_PRINT_UNSIGNED, AT_unsigned (a)); + break; + case dw_val_class_const_double: +- fprintf (outfile, "constant ("HOST_WIDE_INT_PRINT_DEC","\ +- HOST_WIDE_INT_PRINT_UNSIGNED")", ++ fprintf (outfile, "constant (" HOST_WIDE_INT_PRINT_DEC ","\ ++ HOST_WIDE_INT_PRINT_UNSIGNED ")", + a->dw_attr_val.v.val_double.high, + a->dw_attr_val.v.val_double.low); + break; Index: patches/patch-gcc_ipa-inline_c =================================================================== RCS file: patches/patch-gcc_ipa-inline_c diff -N patches/patch-gcc_ipa-inline_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-gcc_ipa-inline_c 15 Apr 2018 16:02:31 -0000 @@ -0,0 +1,14 @@ +$OpenBSD$ + +Index: gcc/ipa-inline.c +--- gcc/ipa-inline.c.orig ++++ gcc/ipa-inline.c +@@ -1727,7 +1727,7 @@ inline_small_functions (void) + badness, + edge->frequency / (double)CGRAPH_FREQ_BASE); + if (edge->count) +- fprintf (dump_file," Called "HOST_WIDEST_INT_PRINT_DEC"x\n", ++ fprintf (dump_file," Called " HOST_WIDEST_INT_PRINT_DEC "x\n", + edge->count); + if (dump_flags & TDF_DETAILS) + edge_badness (edge, true); Index: patches/patch-gcc_ipa-profile_c =================================================================== RCS file: patches/patch-gcc_ipa-profile_c diff -N patches/patch-gcc_ipa-profile_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-gcc_ipa-profile_c 15 Apr 2018 16:02:31 -0000 @@ -0,0 +1,41 @@ +$OpenBSD$ + +Index: gcc/ipa-profile.c +--- gcc/ipa-profile.c.orig ++++ gcc/ipa-profile.c +@@ -163,7 +163,7 @@ dump_histogram (FILE *file, vec<histogram_entry *> his + { + cumulated_time += histogram[i]->count * histogram[i]->time; + cumulated_size += histogram[i]->size; +- fprintf (file, " "HOST_WIDEST_INT_PRINT_DEC": time:%i (%2.2f) size:%i (%2.2f)\n", ++ fprintf (file, " " HOST_WIDEST_INT_PRINT_DEC ": time:%i (%2.2f) size:%i (%2.2f)\n", + (HOST_WIDEST_INT) histogram[i]->count, + histogram[i]->time, + cumulated_time * 100.0 / overall_time, +@@ -516,7 +516,7 @@ ipa_profile (void) + { + gcov_type min, cumulated_time = 0, cumulated_size = 0; + +- fprintf (dump_file, "Overall time: "HOST_WIDEST_INT_PRINT_DEC"\n", ++ fprintf (dump_file, "Overall time: " HOST_WIDEST_INT_PRINT_DEC "\n", + (HOST_WIDEST_INT)overall_time); + min = get_hot_bb_threshold (); + for (i = 0; i < (int)histogram.length () && histogram[i]->count >= min; +@@ -525,7 +525,7 @@ ipa_profile (void) + cumulated_time += histogram[i]->count * histogram[i]->time; + cumulated_size += histogram[i]->size; + } +- fprintf (dump_file, "GCOV min count: "HOST_WIDEST_INT_PRINT_DEC ++ fprintf (dump_file, "GCOV min count: " HOST_WIDEST_INT_PRINT_DEC + " Time:%3.2f%% Size:%3.2f%%\n", + (HOST_WIDEST_INT)min, + cumulated_time * 100.0 / overall_time, +@@ -551,7 +551,7 @@ ipa_profile (void) + cumulated_time += histogram[i]->count * histogram[i]->time; + cumulated_size += histogram[i]->size; + } +- fprintf (dump_file, "Determined min count: "HOST_WIDEST_INT_PRINT_DEC ++ fprintf (dump_file, "Determined min count: " HOST_WIDEST_INT_PRINT_DEC + " Time:%3.2f%% Size:%3.2f%%\n", + (HOST_WIDEST_INT)threshold, + cumulated_time * 100.0 / overall_time, Index: patches/patch-gcc_ipa-prop_c =================================================================== RCS file: patches/patch-gcc_ipa-prop_c diff -N patches/patch-gcc_ipa-prop_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-gcc_ipa-prop_c 15 Apr 2018 16:02:31 -0000 @@ -0,0 +1,23 @@ +$OpenBSD$ + +Index: gcc/ipa-prop.c +--- gcc/ipa-prop.c.orig ++++ gcc/ipa-prop.c +@@ -244,7 +244,7 @@ ipa_print_node_jump_functions_for_edge (FILE *f, struc + { + fprintf (f, "KNOWN TYPE: base "); + print_generic_expr (f, jump_func->value.known_type.base_type, 0); +- fprintf (f, ", offset "HOST_WIDE_INT_PRINT_DEC", component ", ++ fprintf (f, ", offset " HOST_WIDE_INT_PRINT_DEC ", component ", + jump_func->value.known_type.offset); + print_generic_expr (f, jump_func->value.known_type.component_type, 0); + fprintf (f, "\n"); +@@ -284,7 +284,7 @@ ipa_print_node_jump_functions_for_edge (FILE *f, struc + else if (type == IPA_JF_ANCESTOR) + { + fprintf (f, "ANCESTOR: "); +- fprintf (f, "%d, offset "HOST_WIDE_INT_PRINT_DEC", ", ++ fprintf (f, "%d, offset " HOST_WIDE_INT_PRINT_DEC ", ", + jump_func->value.ancestor.formal_id, + jump_func->value.ancestor.offset); + print_generic_expr (f, jump_func->value.ancestor.type, 0); Index: patches/patch-gcc_loop-iv_c =================================================================== RCS file: patches/patch-gcc_loop-iv_c diff -N patches/patch-gcc_loop-iv_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-gcc_loop-iv_c 15 Apr 2018 16:02:31 -0000 @@ -0,0 +1,14 @@ +$OpenBSD$ + +Index: gcc/loop-iv.c +--- gcc/loop-iv.c.orig ++++ gcc/loop-iv.c +@@ -2297,7 +2297,7 @@ determine_max_iter (struct loop *loop, struct niter_de + if (andmax) + nmax = MIN (nmax, andmax); + if (dump_file) +- fprintf (dump_file, ";; Determined upper bound "HOST_WIDEST_INT_PRINT_DEC".\n", ++ fprintf (dump_file, ";; Determined upper bound " HOST_WIDEST_INT_PRINT_DEC ".\n", + nmax); + return nmax; + } Index: patches/patch-gcc_profile_c =================================================================== RCS file: patches/patch-gcc_profile_c diff -N patches/patch-gcc_profile_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-gcc_profile_c 15 Apr 2018 16:02:31 -0000 @@ -0,0 +1,14 @@ +$OpenBSD$ + +Index: gcc/profile.c +--- gcc/profile.c.orig ++++ gcc/profile.c +@@ -318,7 +318,7 @@ is_edge_inconsistent (vec<edge, va_gc> *edges) + if (dump_file) + { + fprintf (dump_file, +- "Edge %i->%i is inconsistent, count"HOST_WIDEST_INT_PRINT_DEC, ++ "Edge %i->%i is inconsistent, count" HOST_WIDEST_INT_PRINT_DEC, + e->src->index, e->dest->index, e->count); + dump_bb (dump_file, e->src, 0, TDF_DETAILS); + dump_bb (dump_file, e->dest, 0, TDF_DETAILS); Index: patches/patch-gcc_stor-layout_c =================================================================== RCS file: patches/patch-gcc_stor-layout_c diff -N patches/patch-gcc_stor-layout_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-gcc_stor-layout_c 15 Apr 2018 16:02:31 -0000 @@ -0,0 +1,14 @@ +$OpenBSD$ + +Index: gcc/stor-layout.c +--- gcc/stor-layout.c.orig ++++ gcc/stor-layout.c +@@ -236,7 +236,7 @@ self_referential_size (tree size) + fntype = build_function_type (return_type, param_type_list); + + /* Build the function declaration. */ +- sprintf (buf, "SZ"HOST_WIDE_INT_PRINT_UNSIGNED, fnno++); ++ sprintf (buf, "SZ" HOST_WIDE_INT_PRINT_UNSIGNED, fnno++); + fnname = get_file_function_name (buf); + fndecl = build_decl (input_location, FUNCTION_DECL, fnname, fntype); + for (t = param_decl_list; t; t = DECL_CHAIN (t)) Index: patches/patch-gcc_system_h =================================================================== RCS file: patches/patch-gcc_system_h diff -N patches/patch-gcc_system_h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-gcc_system_h 15 Apr 2018 16:02:31 -0000 @@ -0,0 +1,13 @@ +$OpenBSD$ + +Index: gcc/system.h +--- gcc/system.h.orig ++++ gcc/system.h +@@ -231,6 +231,7 @@ extern int errno; + file uses a standard library header that includes <cstdlib>, we will get + an error about 'using std::malloc'. */ + #ifdef __cplusplus ++#include <new> + #include <cstdlib> + #endif + Index: patches/patch-gcc_toplev_c =================================================================== RCS file: /cvs/ports/lang/gcc/4.9/patches/patch-gcc_toplev_c,v retrieving revision 1.2 diff -u -p -r1.2 patch-gcc_toplev_c --- patches/patch-gcc_toplev_c 20 Nov 2014 19:54:40 -0000 1.2 +++ patches/patch-gcc_toplev_c 15 Apr 2018 16:02:31 -0000 @@ -1,6 +1,16 @@ $OpenBSD: patch-gcc_toplev_c,v 1.2 2014/11/20 19:54:40 pascal Exp $ ---- gcc/toplev.c.orig Thu Oct 16 15:49:11 2014 -+++ gcc/toplev.c Fri Oct 31 11:59:54 2014 +Index: gcc/toplev.c +--- gcc/toplev.c.orig ++++ gcc/toplev.c +@@ -1041,7 +1041,7 @@ output_stack_usage (void) + } + + fprintf (stack_usage_file, +- "%s:%d:%d:%s\t"HOST_WIDE_INT_PRINT_DEC"\t%s\n", ++ "%s:%d:%d:%s\t" HOST_WIDE_INT_PRINT_DEC "\t%s\n", + lbasename (loc.file), + loc.line, + loc.column, @@ -1546,6 +1546,8 @@ process_options (void) /* Targets must be able to place spill slots at lower addresses. If the Index: patches/patch-gcc_tree-ssa-reassoc_c =================================================================== RCS file: patches/patch-gcc_tree-ssa-reassoc_c diff -N patches/patch-gcc_tree-ssa-reassoc_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-gcc_tree-ssa-reassoc_c 15 Apr 2018 16:02:31 -0000 @@ -0,0 +1,23 @@ +$OpenBSD$ + +Index: gcc/tree-ssa-reassoc.c +--- gcc/tree-ssa-reassoc.c.orig ++++ gcc/tree-ssa-reassoc.c +@@ -4245,7 +4245,7 @@ attempt_builtin_powi (gimple stmt, vec<operand_entry_t + if (elt < vec_len - 1) + fputs (" * ", dump_file); + } +- fprintf (dump_file, ")^"HOST_WIDE_INT_PRINT_DEC"\n", ++ fprintf (dump_file, ")^" HOST_WIDE_INT_PRINT_DEC "\n", + power); + } + } +@@ -4279,7 +4279,7 @@ attempt_builtin_powi (gimple stmt, vec<operand_entry_t + if (elt < vec_len - 1) + fputs (" * ", dump_file); + } +- fprintf (dump_file, ")^"HOST_WIDE_INT_PRINT_DEC"\n", power); ++ fprintf (dump_file, ")^" HOST_WIDE_INT_PRINT_DEC "\n", power); + } + + reassociate_stats.pows_created++; Index: patches/patch-gcc_value-prof_c =================================================================== RCS file: patches/patch-gcc_value-prof_c diff -N patches/patch-gcc_value-prof_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-gcc_value-prof_c 15 Apr 2018 16:02:31 -0000 @@ -0,0 +1,108 @@ +$OpenBSD$ + +Index: gcc/value-prof.c +--- gcc/value-prof.c.orig ++++ gcc/value-prof.c +@@ -266,10 +266,10 @@ dump_histogram_value (FILE *dump_file, histogram_value + unsigned int i; + fprintf (dump_file, " ["); + for (i = 0; i < hist->hdata.intvl.steps; i++) +- fprintf (dump_file, " %d:"HOST_WIDEST_INT_PRINT_DEC, ++ fprintf (dump_file, " %d:" HOST_WIDEST_INT_PRINT_DEC, + hist->hdata.intvl.int_start + i, + (HOST_WIDEST_INT) hist->hvalue.counters[i]); +- fprintf (dump_file, " ] outside range:"HOST_WIDEST_INT_PRINT_DEC, ++ fprintf (dump_file, " ] outside range:" HOST_WIDEST_INT_PRINT_DEC, + (HOST_WIDEST_INT) hist->hvalue.counters[i]); + } + fprintf (dump_file, ".\n"); +@@ -279,8 +279,8 @@ dump_histogram_value (FILE *dump_file, histogram_value + fprintf (dump_file, "Pow2 counter "); + if (hist->hvalue.counters) + { +- fprintf (dump_file, "pow2:"HOST_WIDEST_INT_PRINT_DEC +- " nonpow2:"HOST_WIDEST_INT_PRINT_DEC, ++ fprintf (dump_file, "pow2:" HOST_WIDEST_INT_PRINT_DEC ++ " nonpow2:" HOST_WIDEST_INT_PRINT_DEC, + (HOST_WIDEST_INT) hist->hvalue.counters[0], + (HOST_WIDEST_INT) hist->hvalue.counters[1]); + } +@@ -291,9 +291,9 @@ dump_histogram_value (FILE *dump_file, histogram_value + fprintf (dump_file, "Single value "); + if (hist->hvalue.counters) + { +- fprintf (dump_file, "value:"HOST_WIDEST_INT_PRINT_DEC +- " match:"HOST_WIDEST_INT_PRINT_DEC +- " wrong:"HOST_WIDEST_INT_PRINT_DEC, ++ fprintf (dump_file, "value:" HOST_WIDEST_INT_PRINT_DEC ++ " match:" HOST_WIDEST_INT_PRINT_DEC ++ " wrong:" HOST_WIDEST_INT_PRINT_DEC, + (HOST_WIDEST_INT) hist->hvalue.counters[0], + (HOST_WIDEST_INT) hist->hvalue.counters[1], + (HOST_WIDEST_INT) hist->hvalue.counters[2]); +@@ -305,8 +305,8 @@ dump_histogram_value (FILE *dump_file, histogram_value + fprintf (dump_file, "Average value "); + if (hist->hvalue.counters) + { +- fprintf (dump_file, "sum:"HOST_WIDEST_INT_PRINT_DEC +- " times:"HOST_WIDEST_INT_PRINT_DEC, ++ fprintf (dump_file, "sum:" HOST_WIDEST_INT_PRINT_DEC ++ " times:" HOST_WIDEST_INT_PRINT_DEC, + (HOST_WIDEST_INT) hist->hvalue.counters[0], + (HOST_WIDEST_INT) hist->hvalue.counters[1]); + } +@@ -317,7 +317,7 @@ dump_histogram_value (FILE *dump_file, histogram_value + fprintf (dump_file, "IOR value "); + if (hist->hvalue.counters) + { +- fprintf (dump_file, "ior:"HOST_WIDEST_INT_PRINT_DEC, ++ fprintf (dump_file, "ior:" HOST_WIDEST_INT_PRINT_DEC, + (HOST_WIDEST_INT) hist->hvalue.counters[0]); + } + fprintf (dump_file, ".\n"); +@@ -327,9 +327,9 @@ dump_histogram_value (FILE *dump_file, histogram_value + fprintf (dump_file, "Constant delta "); + if (hist->hvalue.counters) + { +- fprintf (dump_file, "value:"HOST_WIDEST_INT_PRINT_DEC +- " match:"HOST_WIDEST_INT_PRINT_DEC +- " wrong:"HOST_WIDEST_INT_PRINT_DEC, ++ fprintf (dump_file, "value:" HOST_WIDEST_INT_PRINT_DEC ++ " match:" HOST_WIDEST_INT_PRINT_DEC ++ " wrong:" HOST_WIDEST_INT_PRINT_DEC, + (HOST_WIDEST_INT) hist->hvalue.counters[0], + (HOST_WIDEST_INT) hist->hvalue.counters[1], + (HOST_WIDEST_INT) hist->hvalue.counters[2]); +@@ -340,9 +340,9 @@ dump_histogram_value (FILE *dump_file, histogram_value + fprintf (dump_file, "Indirect call "); + if (hist->hvalue.counters) + { +- fprintf (dump_file, "value:"HOST_WIDEST_INT_PRINT_DEC +- " match:"HOST_WIDEST_INT_PRINT_DEC +- " all:"HOST_WIDEST_INT_PRINT_DEC, ++ fprintf (dump_file, "value:" HOST_WIDEST_INT_PRINT_DEC ++ " match:" HOST_WIDEST_INT_PRINT_DEC ++ " all:" HOST_WIDEST_INT_PRINT_DEC, + (HOST_WIDEST_INT) hist->hvalue.counters[0], + (HOST_WIDEST_INT) hist->hvalue.counters[1], + (HOST_WIDEST_INT) hist->hvalue.counters[2]); +@@ -353,7 +353,7 @@ dump_histogram_value (FILE *dump_file, histogram_value + fprintf (dump_file, "Time profile "); + if (hist->hvalue.counters) + { +- fprintf (dump_file, "time:"HOST_WIDEST_INT_PRINT_DEC, ++ fprintf (dump_file, "time:" HOST_WIDEST_INT_PRINT_DEC, + (HOST_WIDEST_INT) hist->hvalue.counters[0]); + } + fprintf (dump_file, ".\n"); +@@ -1533,8 +1533,8 @@ gimple_ic_transform (gimple_stmt_iterator *gsi) + print_generic_expr (dump_file, direct_call->decl, TDF_SLIM); + fprintf (dump_file, " transformation on insn postponned to ipa-profile"); + print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM); +- fprintf (dump_file, "hist->count "HOST_WIDEST_INT_PRINT_DEC +- " hist->all "HOST_WIDEST_INT_PRINT_DEC"\n", count, all); ++ fprintf (dump_file, "hist->count " HOST_WIDEST_INT_PRINT_DEC ++ " hist->all " HOST_WIDEST_INT_PRINT_DEC "\n", count, all); + } + + return true;