From 8482b2935a06a8c622e7f302010436cf0fcc2848 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Mon, 5 Jun 2017 23:24:18 -0700 Subject: [PATCH] Fix the newly added msp430 sample with other GCC versions Signed-off-by: Alexey Neyman --- .../4.9.4/1100-msp430-string-literals.patch | 27 +++++++ .../5.4.0/1100-msp430-string-literals.patch | 81 +++++++++++++++++++ .../1100-msp430-string-literals.patch | 27 +++++++ .../1100-msp430-string-literals.patch | 81 +++++++++++++++++++ 4 files changed, 216 insertions(+) create mode 100644 patches/gcc/4.9.4/1100-msp430-string-literals.patch create mode 100644 patches/gcc/5.4.0/1100-msp430-string-literals.patch create mode 100644 patches/gcc/linaro-4.9-2017.01/1100-msp430-string-literals.patch create mode 100644 patches/gcc/linaro-5.4-2017.05/1100-msp430-string-literals.patch diff --git a/patches/gcc/4.9.4/1100-msp430-string-literals.patch b/patches/gcc/4.9.4/1100-msp430-string-literals.patch new file mode 100644 index 00000000..346842e8 --- /dev/null +++ b/patches/gcc/4.9.4/1100-msp430-string-literals.patch @@ -0,0 +1,27 @@ +commit 9d247a3d78b97c004e7ca5e7d6cc9964dba870c7 +Author: jason +Date: Wed May 13 01:11:13 2015 +0000 + + gcc/ + * config/mmix/mmix.c, config/msp430/msp430.c: Add space between + string literal and macro name. + gcc/ada/ + * sigtramp-vxworks.c: Add space between string literal and macro + name. + + git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223106 138bc75d-0d04-0410-961f-82ee72b054a4 + +[4.9 change: remove non-applicable parts of the patch] +diff --git a/gcc/config/msp430/msp430.c b/gcc/config/msp430/msp430.c +index bec168ca2ae..58d0efea1de 100644 +--- a/gcc/config/msp430/msp430.c ++++ b/gcc/config/msp430/msp430.c +@@ -2248,7 +2248,7 @@ static struct + } + const_shift_helpers[] = + { +-#define CSH(N,C,X,G) { "__mspabi_"N, C, X, gen_##G } ++#define CSH(N,C,X,G) { "__mspabi_" N, C, X, gen_##G } + + CSH ("slli", 1, 1, slli_1), + CSH ("slll", 1, 1, slll_1), diff --git a/patches/gcc/5.4.0/1100-msp430-string-literals.patch b/patches/gcc/5.4.0/1100-msp430-string-literals.patch new file mode 100644 index 00000000..819d6d22 --- /dev/null +++ b/patches/gcc/5.4.0/1100-msp430-string-literals.patch @@ -0,0 +1,81 @@ +commit 9d247a3d78b97c004e7ca5e7d6cc9964dba870c7 +Author: jason +Date: Wed May 13 01:11:13 2015 +0000 + + gcc/ + * config/mmix/mmix.c, config/msp430/msp430.c: Add space between + string literal and macro name. + gcc/ada/ + * sigtramp-vxworks.c: Add space between string literal and macro + name. + + git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223106 138bc75d-0d04-0410-961f-82ee72b054a4 + +diff --git a/gcc/ada/sigtramp-vxworks.c b/gcc/ada/sigtramp-vxworks.c +index 2119296dc1d..c697626a03e 100644 +--- a/gcc/ada/sigtramp-vxworks.c ++++ b/gcc/ada/sigtramp-vxworks.c +@@ -342,16 +342,16 @@ CR("") \ + TCR("# Allocate frame and save the non-volatile") \ + TCR("# registers we're going to modify") \ + TCR("mov ip, sp") \ +-TCR("stmfd sp!, {r"S(CFA_REG)", fp, ip, lr, pc}") \ ++TCR("stmfd sp!, {r" S(CFA_REG)", fp, ip, lr, pc}") \ + TCR("# Setup CFA_REG = context, which we'll retrieve as our CFA value") \ +-TCR("ldr r"S(CFA_REG)", [ip]") \ ++TCR("ldr r" S(CFA_REG)", [ip]") \ + TCR("") \ + TCR("# Call the real handler. The signo, siginfo and sigcontext") \ + TCR("# arguments are the same as those we received in r0, r1 and r2") \ + TCR("sub fp, ip, #4") \ + TCR("blx r3") \ + TCR("# Restore our callee-saved items, release our frame and return") \ +-TCR("ldmfd sp, {r"S(CFA_REG)", fp, sp, pc}") ++TCR("ldmfd sp, {r" S(CFA_REG)", fp, sp, pc}") + + #else + Not_implemented; +diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c +index 6e991207dbc..e0699854e25 100644 +--- a/gcc/config/mmix/mmix.c ++++ b/gcc/config/mmix/mmix.c +@@ -2520,7 +2520,7 @@ mmix_output_shiftvalue_op_from_str (FILE *stream, + if (! mmix_shiftable_wyde_value (value)) + { + char s[sizeof ("0xffffffffffffffff")]; +- sprintf (s, "%#"PRIx64, value); ++ sprintf (s, "%#" PRIx64, value); + internal_error ("MMIX Internal: %s is not a shiftable int", s); + } + +@@ -2562,7 +2562,7 @@ mmix_output_octa (FILE *stream, int64_t value, int do_begin_end) + fprintf (stream, "#" HOST_WIDE_INT_PRINT_HEX_PURE, + (HOST_WIDE_INT) value); + else /* Need to avoid the hex output; there's no ...WIDEST...HEX_PURE. */ +- fprintf (stream, "%"PRIu64, value); ++ fprintf (stream, "%" PRIu64, value); + + if (do_begin_end) + fprintf (stream, "\n"); +@@ -2579,7 +2579,7 @@ mmix_output_shifted_value (FILE *stream, int64_t value) + if (! mmix_shiftable_wyde_value (value)) + { + char s[16+2+1]; +- sprintf (s, "%#"PRIx64, value); ++ sprintf (s, "%#" PRIx64, value); + internal_error ("MMIX Internal: %s is not a shiftable int", s); + } + +diff --git a/gcc/config/msp430/msp430.c b/gcc/config/msp430/msp430.c +index bec168ca2ae..58d0efea1de 100644 +--- a/gcc/config/msp430/msp430.c ++++ b/gcc/config/msp430/msp430.c +@@ -2248,7 +2248,7 @@ static struct + } + const_shift_helpers[] = + { +-#define CSH(N,C,X,G) { "__mspabi_"N, C, X, gen_##G } ++#define CSH(N,C,X,G) { "__mspabi_" N, C, X, gen_##G } + + CSH ("slli", 1, 1, slli_1), + CSH ("slll", 1, 1, slll_1), diff --git a/patches/gcc/linaro-4.9-2017.01/1100-msp430-string-literals.patch b/patches/gcc/linaro-4.9-2017.01/1100-msp430-string-literals.patch new file mode 100644 index 00000000..346842e8 --- /dev/null +++ b/patches/gcc/linaro-4.9-2017.01/1100-msp430-string-literals.patch @@ -0,0 +1,27 @@ +commit 9d247a3d78b97c004e7ca5e7d6cc9964dba870c7 +Author: jason +Date: Wed May 13 01:11:13 2015 +0000 + + gcc/ + * config/mmix/mmix.c, config/msp430/msp430.c: Add space between + string literal and macro name. + gcc/ada/ + * sigtramp-vxworks.c: Add space between string literal and macro + name. + + git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223106 138bc75d-0d04-0410-961f-82ee72b054a4 + +[4.9 change: remove non-applicable parts of the patch] +diff --git a/gcc/config/msp430/msp430.c b/gcc/config/msp430/msp430.c +index bec168ca2ae..58d0efea1de 100644 +--- a/gcc/config/msp430/msp430.c ++++ b/gcc/config/msp430/msp430.c +@@ -2248,7 +2248,7 @@ static struct + } + const_shift_helpers[] = + { +-#define CSH(N,C,X,G) { "__mspabi_"N, C, X, gen_##G } ++#define CSH(N,C,X,G) { "__mspabi_" N, C, X, gen_##G } + + CSH ("slli", 1, 1, slli_1), + CSH ("slll", 1, 1, slll_1), diff --git a/patches/gcc/linaro-5.4-2017.05/1100-msp430-string-literals.patch b/patches/gcc/linaro-5.4-2017.05/1100-msp430-string-literals.patch new file mode 100644 index 00000000..819d6d22 --- /dev/null +++ b/patches/gcc/linaro-5.4-2017.05/1100-msp430-string-literals.patch @@ -0,0 +1,81 @@ +commit 9d247a3d78b97c004e7ca5e7d6cc9964dba870c7 +Author: jason +Date: Wed May 13 01:11:13 2015 +0000 + + gcc/ + * config/mmix/mmix.c, config/msp430/msp430.c: Add space between + string literal and macro name. + gcc/ada/ + * sigtramp-vxworks.c: Add space between string literal and macro + name. + + git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223106 138bc75d-0d04-0410-961f-82ee72b054a4 + +diff --git a/gcc/ada/sigtramp-vxworks.c b/gcc/ada/sigtramp-vxworks.c +index 2119296dc1d..c697626a03e 100644 +--- a/gcc/ada/sigtramp-vxworks.c ++++ b/gcc/ada/sigtramp-vxworks.c +@@ -342,16 +342,16 @@ CR("") \ + TCR("# Allocate frame and save the non-volatile") \ + TCR("# registers we're going to modify") \ + TCR("mov ip, sp") \ +-TCR("stmfd sp!, {r"S(CFA_REG)", fp, ip, lr, pc}") \ ++TCR("stmfd sp!, {r" S(CFA_REG)", fp, ip, lr, pc}") \ + TCR("# Setup CFA_REG = context, which we'll retrieve as our CFA value") \ +-TCR("ldr r"S(CFA_REG)", [ip]") \ ++TCR("ldr r" S(CFA_REG)", [ip]") \ + TCR("") \ + TCR("# Call the real handler. The signo, siginfo and sigcontext") \ + TCR("# arguments are the same as those we received in r0, r1 and r2") \ + TCR("sub fp, ip, #4") \ + TCR("blx r3") \ + TCR("# Restore our callee-saved items, release our frame and return") \ +-TCR("ldmfd sp, {r"S(CFA_REG)", fp, sp, pc}") ++TCR("ldmfd sp, {r" S(CFA_REG)", fp, sp, pc}") + + #else + Not_implemented; +diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c +index 6e991207dbc..e0699854e25 100644 +--- a/gcc/config/mmix/mmix.c ++++ b/gcc/config/mmix/mmix.c +@@ -2520,7 +2520,7 @@ mmix_output_shiftvalue_op_from_str (FILE *stream, + if (! mmix_shiftable_wyde_value (value)) + { + char s[sizeof ("0xffffffffffffffff")]; +- sprintf (s, "%#"PRIx64, value); ++ sprintf (s, "%#" PRIx64, value); + internal_error ("MMIX Internal: %s is not a shiftable int", s); + } + +@@ -2562,7 +2562,7 @@ mmix_output_octa (FILE *stream, int64_t value, int do_begin_end) + fprintf (stream, "#" HOST_WIDE_INT_PRINT_HEX_PURE, + (HOST_WIDE_INT) value); + else /* Need to avoid the hex output; there's no ...WIDEST...HEX_PURE. */ +- fprintf (stream, "%"PRIu64, value); ++ fprintf (stream, "%" PRIu64, value); + + if (do_begin_end) + fprintf (stream, "\n"); +@@ -2579,7 +2579,7 @@ mmix_output_shifted_value (FILE *stream, int64_t value) + if (! mmix_shiftable_wyde_value (value)) + { + char s[16+2+1]; +- sprintf (s, "%#"PRIx64, value); ++ sprintf (s, "%#" PRIx64, value); + internal_error ("MMIX Internal: %s is not a shiftable int", s); + } + +diff --git a/gcc/config/msp430/msp430.c b/gcc/config/msp430/msp430.c +index bec168ca2ae..58d0efea1de 100644 +--- a/gcc/config/msp430/msp430.c ++++ b/gcc/config/msp430/msp430.c +@@ -2248,7 +2248,7 @@ static struct + } + const_shift_helpers[] = + { +-#define CSH(N,C,X,G) { "__mspabi_"N, C, X, gen_##G } ++#define CSH(N,C,X,G) { "__mspabi_" N, C, X, gen_##G } + + CSH ("slli", 1, 1, slli_1), + CSH ("slll", 1, 1, slll_1),