Re: [SH][committed] Setting MULTILIB_EXCEPTIONS in gcc/config/sh/t-linux causes problems

2015-03-26 Thread David Howells
> [1. text/x-patch; sh_multilib_sh1_sh2a_ml_1.patch]   

This works, thanks.  I see the following produced:

  vega>rpm -qlp gcc-sh-linux-gnu-5.0.0-0.1.fc23.x86_64.rpm | grep libgcc
  /usr/lib/gcc/sh-linux-gnu/5.0.0/libgcc.a
  /usr/lib/gcc/sh-linux-gnu/5.0.0/m2/libgcc.a
  /usr/lib/gcc/sh-linux-gnu/5.0.0/m2e/libgcc.a
  /usr/lib/gcc/sh-linux-gnu/5.0.0/m4-single-only/libgcc.a
  /usr/lib/gcc/sh-linux-gnu/5.0.0/m4-single/libgcc.a
  /usr/lib/gcc/sh-linux-gnu/5.0.0/m4/libgcc.a
  /usr/lib/gcc/sh-linux-gnu/5.0.0/mb/libgcc.a
  /usr/lib/gcc/sh-linux-gnu/5.0.0/mb/m2/libgcc.a
  /usr/lib/gcc/sh-linux-gnu/5.0.0/mb/m2a-single/libgcc.a
  /usr/lib/gcc/sh-linux-gnu/5.0.0/mb/m2a/libgcc.a
  /usr/lib/gcc/sh-linux-gnu/5.0.0/mb/m2e/libgcc.a
  /usr/lib/gcc/sh-linux-gnu/5.0.0/mb/m4-single-only/libgcc.a
  /usr/lib/gcc/sh-linux-gnu/5.0.0/mb/m4-single/libgcc.a
  /usr/lib/gcc/sh-linux-gnu/5.0.0/mb/m4/libgcc.a

for:

  --with-multilib-list=m1,m2,m2e,m4,m4-single,m4-single-only,m2a,m2a-single

David


[PATCH] Fix a bunch of print format errors in gcc-5

2015-02-12 Thread David Howells
Hi,

Here's a patch that inserts "%s", into a number of printf-format calls to
avoid:

error: format not a string literal and no format arguments
[-Werror=format-security]

and to avoid reads on uninitialised data should a string with one or more "%"
in it be processed.

David

--- gcc/tree-sra.c.orig 2015-02-12 15:06:20.555985277 +
+++ gcc/tree-sra.c  2015-02-12 15:06:39.089074566 +
@@ -3987,7 +3987,7 @@ dump_dereferences_table (FILE *f,
 {
   basic_block bb;
 
-  fprintf (dump_file, str);
+  fprintf (dump_file, "%s", str);
   FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR_FOR_FN (cfun),
  EXIT_BLOCK_PTR_FOR_FN (cfun), next_bb)
 {
--- gcc/tree-ssa-uninit.c.orig  2015-02-12 15:11:39.439546383 +
+++ gcc/tree-ssa-uninit.c   2015-02-12 15:11:52.101611150 +
@@ -820,7 +820,7 @@ dump_predicates (gimple usestmt,
 {
   size_t i, j;
   pred_chain one_pred_chain = vNULL;
-  fprintf (dump_file, msg);
+  fprintf (dump_file, "%s", msg);
   print_gimple_stmt (dump_file, usestmt, 0, 0);
   fprintf (dump_file, "is guarded by :\n\n");
   size_t num_preds = preds.length ();
--- gcc/opts.c.orig 2015-02-12 15:18:23.444612881 +
+++ gcc/opts.c  2015-02-12 15:22:24.464845706 +
@@ -1106,7 +1106,7 @@ print_filtered_help (unsigned int include_flags,
  if (* (const char **) flag_var != NULL)
snprintf (new_help + strlen (new_help),
  sizeof (new_help) - strlen (new_help),
- * (const char **) flag_var);
+ "%s", * (const char **) flag_var);
}
  else if (option->var_type == CLVC_ENUM)
{
@@ -1120,7 +1120,7 @@ print_filtered_help (unsigned int include_flags,
arg = _("[default]");
  snprintf (new_help + strlen (new_help),
sizeof (new_help) - strlen (new_help),
-   arg);
+   "%s", arg);
}
  else
sprintf (new_help + strlen (new_help),


[PATCH] Fix a number of -Wformat-security warnings in gcc/config/*/*

2015-02-13 Thread David Howells
* config/avr/avr.c (avr_print_operand_address, avr_print_operand): Avoid
-Wformat-security warning.
* config/m68k/m68k.c (print_operand): Likewise.
* config/s390/s390.c (print_operand): Likewise.
* config/tilegx/tilegx.c (tilegx_print_operand): Likewise.

--- gcc/config/avr/avr.c.orig   2015-02-12 16:42:25.915682864 +
+++ gcc/config/avr/avr.c2015-02-12 16:43:12.946934049 +
@@ -2107,7 +2107,7 @@ avr_print_operand_address (FILE *file, r
   switch (GET_CODE (addr))
 {
 case REG:
-  fprintf (file, ptrreg_to_str (REGNO (addr)));
+  fprintf (file, "%s", ptrreg_to_str (REGNO (addr)));
   break;
 
 case PRE_DEC:
@@ -2221,12 +2221,12 @@ avr_print_operand (FILE *file, rtx x, in
   else if (code == 'E' || code == 'F')
 {
   rtx op = XEXP(x, 0);
-  fprintf (file, reg_names[REGNO (op) + ef]);
+  fprintf (file, "%s", reg_names[REGNO (op) + ef]);
 }
   else if (code == 'I' || code == 'J')
 {
   rtx op = XEXP(XEXP(x, 0), 0);
-  fprintf (file, reg_names[REGNO (op) + ij]);
+  fprintf (file, "%s", reg_names[REGNO (op) + ij]);
 }
   else if (REG_P (x))
 {
@@ -2235,7 +2235,7 @@ avr_print_operand (FILE *file, rtx x, in
   else if (code == 'r' && REGNO (x) < 32)
 fprintf (file, "%d", (int) REGNO (x));
   else
-fprintf (file, reg_names[REGNO (x) + abcd]);
+fprintf (file, "%s", reg_names[REGNO (x) + abcd]);
 }
   else if (CONST_INT_P (x))
 {
--- gcc/config/m68k/m68k.c.orig 2015-02-13 11:29:22.395433678 +
+++ gcc/config/m68k/m68k.c  2015-02-13 11:29:29.463468222 +
@@ -4469,7 +4469,7 @@ print_operand (FILE *file, rtx op, int l
   else if (letter == '/')
 asm_fprintf (file, "%R");
   else if (letter == '?')
-asm_fprintf (file, m68k_library_id_string);
+asm_fprintf (file, "%s", m68k_library_id_string);
   else if (letter == 'p')
 {
   output_addr_const (file, op);
--- gcc/config/s390/s390.c.orig 2015-02-12 20:06:35.909940703 +
+++ gcc/config/s390/s390.c  2015-02-12 20:06:47.627008105 +
@@ -5481,11 +5481,11 @@ print_operand (FILE *file, rtx x, int co
   switch (code)
 {
 case 'C':
-  fprintf (file, s390_branch_condition_mnemonic (x, FALSE));
+  fprintf (file, "%s", s390_branch_condition_mnemonic (x, FALSE));
   return;
 
 case 'D':
-  fprintf (file, s390_branch_condition_mnemonic (x, TRUE));
+  fprintf (file, "%s", s390_branch_condition_mnemonic (x, TRUE));
   return;
 
 case 'E':
--- gcc/config/tilegx/tilegx.c.orig 2015-02-12 21:11:36.070847024 +
+++ gcc/config/tilegx/tilegx.c  2015-02-12 21:11:42.891875824 +
@@ -5397,7 +5397,7 @@ tilegx_print_operand (FILE *file, rtx x,
gcc_unreachable ();
  }
 
-   fprintf (file, reg);
+   fprintf (file, "%s", reg);
return;
   }