Submitted By:            Douglas R. Reno <renodr at linuxfromscratch dot org>
Date:                    2020-05-12
Initial Package Version: 3.15.0
Origin:                  Upstream
Description:             Adapts the tests and fixes the build with GCC-10.

diff -Naurp valgrind-3.15.0.orig/memcheck/tests/amd64/shr_edx.c valgrind-3.15.0/memcheck/tests/amd64/shr_edx.c
--- valgrind-3.15.0.orig/memcheck/tests/amd64/shr_edx.c	2019-04-13 05:56:22.000000000 -0500
+++ valgrind-3.15.0/memcheck/tests/amd64/shr_edx.c	2020-05-12 10:38:21.215523901 -0500
@@ -8,6 +8,7 @@ ULong result;
 
 extern void shrl32_with_0x10 ( void );
 asm("\n"
+".text\n"
 "shrl32_with_0x10:\n"
 "\tpushq %rdx\n"
 "\tmovq data, %rdx\n"
@@ -20,6 +21,7 @@ asm("\n"
 "\tshrl32_with_0x10_jump:\n"
 "\tmov $0xdeaddead, %edx\n"
 "\tjmp shrl32_with_0x10_cont\n"
+".previous\n"
 );
 
 
diff -Naurp valgrind-3.15.0.orig/none/tests/amd64/fxtract.c valgrind-3.15.0/none/tests/amd64/fxtract.c
--- valgrind-3.15.0.orig/none/tests/amd64/fxtract.c	2019-04-13 05:56:22.000000000 -0500
+++ valgrind-3.15.0/none/tests/amd64/fxtract.c	2020-05-12 10:42:01.780736672 -0500
@@ -6,6 +6,7 @@ double arg, res1, res2;
 
 extern void do_fxtract ( void );
 asm("\n"
+".text\n"
 ".global do_fxtract\n"
 "do_fxtract:\n"
 "\tfinit\n"
@@ -13,7 +14,8 @@ asm("\n"
 "\tfxtract\n"
 "\tfstpl res1\n"
 "\tfstpl res2\n"
-"\tret"
+"\tret\n"
+".previous\n"
 );
 
 void try ( double x )
diff -Naurp valgrind-3.15.0.orig/none/tests/amd64/jrcxz.c valgrind-3.15.0/none/tests/amd64/jrcxz.c
--- valgrind-3.15.0.orig/none/tests/amd64/jrcxz.c	2019-04-13 05:56:22.000000000 -0500
+++ valgrind-3.15.0/none/tests/amd64/jrcxz.c	2020-05-12 10:44:00.365977269 -0500
@@ -8,6 +8,7 @@ ULong arg64, res64;
 
 extern void foo64 ( void );
 asm("\n"
+".text\n"
 "foo64:\n"
 "\tpushq %rcx\n"
 
@@ -25,6 +26,7 @@ asm("\n"
 
 "\tpopq %rcx\n"
 "\tret\n"
+".previous\n"
 );
 
 
@@ -32,6 +34,7 @@ UInt arg32, res32;
 
 extern void foo32 ( void );
 asm("\n"
+".text\n"
 "foo32:\n"
 "\tpushq %rcx\n"
 
@@ -49,6 +52,7 @@ asm("\n"
 
 "\tpopq %rcx\n"
 "\tret\n"
+".previous\n"
 );
 
 
diff -Naurp valgrind-3.15.0.orig/none/tests/amd64/looper.c valgrind-3.15.0/none/tests/amd64/looper.c
--- valgrind-3.15.0.orig/none/tests/amd64/looper.c	2019-04-13 05:56:22.000000000 -0500
+++ valgrind-3.15.0/none/tests/amd64/looper.c	2020-05-12 10:44:44.477445767 -0500
@@ -22,6 +22,7 @@ asm("\n"
 "\tmovq %rax, res\n"
 "\tpopq %rcx\n"
 "\tret\n"
+".previous\n"
 );
 
 extern void loop_ne ( void );
@@ -42,6 +43,7 @@ asm("\n"
 "\tmovq %rax, res\n"
 "\tpopq %rcx\n"
 "\tret\n"
+".previous\n"
 );
 
 extern void loop_e ( void );
@@ -66,6 +68,7 @@ asm("\n"
 "\tmovq %rax, res\n"
 "\tpopq %rcx\n"
 "\tret\n"
+".previous\n"
 );
 
 int main ( void )
diff -Naurp valgrind-3.15.0.orig/none/tests/amd64/sbbmisc.c valgrind-3.15.0/none/tests/amd64/sbbmisc.c
--- valgrind-3.15.0.orig/none/tests/amd64/sbbmisc.c	2019-04-13 05:56:22.000000000 -0500
+++ valgrind-3.15.0/none/tests/amd64/sbbmisc.c	2020-05-12 10:49:20.675444801 -0500
@@ -9,6 +9,7 @@ int in_l, out_l1, out_l2;
 
 extern void sbb_ib_al ( void );
 asm("\n"
+".text\n"
 VG_SYM(sbb_ib_al) ":\n"
 
 #ifndef VGP_amd64_darwin
@@ -37,11 +38,13 @@ VG_SYM(sbb_ib_al) ":\n"
 #endif
 
 "\tretq\n"
+".previous\n"
 );
 
 
 extern void sbb_iw_ax ( void );
 asm("\n"
+".text\n"
 VG_SYM(sbb_iw_ax) ":\n"
 
 #ifndef VGP_amd64_darwin
@@ -69,11 +72,13 @@ VG_SYM(sbb_iw_ax) ":\n"
 #endif
 
 "\tretq\n"
+".previous\n"
 );
 
 
 extern void sbb_il_eax ( void );
 asm("\n"
+".text\n"
 VG_SYM(sbb_il_eax) ":\n"
 
 #ifndef VGP_amd64_darwin
@@ -101,11 +106,13 @@ VG_SYM(sbb_il_eax) ":\n"
 #endif
 
 "\tretq\n"
+".previous\n"
 );
 
 
 extern void sbb_eb_gb ( void );
 asm("\n"
+".text\n"
 VG_SYM(sbb_eb_gb) ":\n"
 
 #ifndef VGP_amd64_darwin
@@ -135,11 +142,13 @@ VG_SYM(sbb_eb_gb) ":\n"
 #endif
 
 "\tretq\n"
+".previous\n"
 );
 
 
 extern void sbb_eb_gb_2 ( void );
 asm("\n"
+".text\n"
 VG_SYM(sbb_eb_gb_2) ":\n"
 "\tpushq %rcx\n"
 
@@ -173,11 +182,13 @@ VG_SYM(sbb_eb_gb_2) ":\n"
 
 "\tpopq %rcx\n"
 "\tretq\n"
+".previous\n"
 );
 
 
 extern void adc_eb_gb ( void );
 asm("\n"
+".text\n"
 VG_SYM(adc_eb_gb) ":\n"
 
 #ifndef VGP_amd64_darwin
@@ -207,11 +218,13 @@ VG_SYM(adc_eb_gb) ":\n"
 #endif
 
 "\tretq\n"
+".previous\n"
 );
 
 
 extern void adc_eb_gb_2 ( void );
 asm("\n"
+".text\n"
 VG_SYM(adc_eb_gb_2) ":\n"
 "\tpushq %rcx\n"
 
@@ -245,10 +258,12 @@ VG_SYM(adc_eb_gb_2) ":\n"
 
 "\tpopq %rcx\n"
 "\tretq\n"
+".previous\n"
 );
 
 extern void adc_ib_al ( void );
 asm("\n"
+".text\n"
 VG_SYM(adc_ib_al) ":\n"
 
 #ifndef VGP_amd64_darwin
@@ -276,11 +291,13 @@ VG_SYM(adc_ib_al) ":\n"
 #endif
 
 "\tretq\n"
+".previous\n"
 );
 
 
 extern void adc_iw_ax ( void );
 asm("\n"
+".text\n"
 VG_SYM(adc_iw_ax) ":\n"
 
 #ifndef VGP_amd64_darwin
@@ -308,11 +325,13 @@ VG_SYM(adc_iw_ax) ":\n"
 #endif
 
 "\tretq\n"
+".previous\n"
 );
 
 
 extern void adc_il_eax ( void );
 asm("\n"
+".text\n"
 VG_SYM(adc_il_eax) ":\n"
 
 #ifndef VGP_amd64_darwin
@@ -340,6 +359,7 @@ VG_SYM(adc_il_eax) ":\n"
 #endif
 
 "\tretq\n"
+".previous\n"
 );
 
 
diff -Naurp valgrind-3.15.0.orig/none/tests/amd64/shrld.c valgrind-3.15.0/none/tests/amd64/shrld.c
--- valgrind-3.15.0.orig/none/tests/amd64/shrld.c	2019-04-13 05:56:22.000000000 -0500
+++ valgrind-3.15.0/none/tests/amd64/shrld.c	2020-05-12 10:51:16.995107083 -0500
@@ -30,6 +30,7 @@ ULong flags_out;
 
 extern void shld64 ( void );
 asm("\n"
+".text\n"
 "shld64:\n"
 "\tpushq %rsi\n"
 "\tpushq %r11\n"
@@ -47,10 +48,12 @@ asm("\n"
 "\tpopq %r11\n"
 "\tpopq %rsi\n"
 "\tret\n"
+".previous\n"
 );
 
 extern void shld32 ( void );
 asm("\n"
+".text\n"
 "shld32:\n"
 "\tpushq %rsi\n"
 "\tpushq %r11\n"
@@ -68,10 +71,12 @@ asm("\n"
 "\tpopq %r11\n"
 "\tpopq %rsi\n"
 "\tret\n"
+".previous\n"
 );
 
 extern void shld16 ( void );
 asm("\n"
+".text\n"
 "shld16:\n"
 "\tpushq %rsi\n"
 "\tpushq %r11\n"
@@ -89,11 +94,13 @@ asm("\n"
 "\tpopq %r11\n"
 "\tpopq %rsi\n"
 "\tret\n"
+".previous\n"
 );
 
 
 extern void shrd64 ( void );
 asm("\n"
+".text\n"
 "shrd64:\n"
 "\tpushq %rsi\n"
 "\tpushq %r11\n"
@@ -111,10 +118,12 @@ asm("\n"
 "\tpopq %r11\n"
 "\tpopq %rsi\n"
 "\tret\n"
+".previous\n"
 );
 
 extern void shrd32 ( void );
 asm("\n"
+".text\n"
 "shrd32:\n"
 "\tpushq %rsi\n"
 "\tpushq %r11\n"
@@ -132,10 +141,12 @@ asm("\n"
 "\tpopq %r11\n"
 "\tpopq %rsi\n"
 "\tret\n"
+".previous\n"
 );
 
 extern void shrd16 ( void );
 asm("\n"
+".text\n"
 "shrd16:\n"
 "\tpushq %rsi\n"
 "\tpushq %r11\n"
@@ -153,6 +164,7 @@ asm("\n"
 "\tpopq %r11\n"
 "\tpopq %rsi\n"
 "\tret\n"
+".previous\n"
 );
 
 
diff -Naurp valgrind-3.15.0.orig/none/tests/amd64/slahf-amd64.c valgrind-3.15.0/none/tests/amd64/slahf-amd64.c
--- valgrind-3.15.0.orig/none/tests/amd64/slahf-amd64.c	2019-04-13 05:56:22.000000000 -0500
+++ valgrind-3.15.0/none/tests/amd64/slahf-amd64.c	2020-05-12 10:52:31.108881162 -0500
@@ -5,6 +5,7 @@ typedef unsigned long long int ULong;
 
 extern ULong lahf_1 ( void );
 asm("\n"
+".text\n"
 "lahf_1:\n"
 "\tpushq $0\n"
 "\tpopfq\n"
@@ -13,10 +14,12 @@ asm("\n"
 "\tsubq %rax, %rdx\n"
 "\t.byte 0x9F\n" /* lahf */
 "\tret\n"
+".previous\n"
 );
 
 extern ULong lahf_0 ( void );
 asm("\n"
+".text\n"
 "lahf_0:\n"
 "\tpushq $0\n"
 "\tpopfq\n"
@@ -25,16 +28,19 @@ asm("\n"
 "\tsubq %rax, %rdx\n"
 "\t.byte 0x9F\n" /* lahf */
 "\tret\n"
+".previous\n"
 );
 
 extern ULong sahf_then_lahf ( ULong );
 asm("\n"
+".text\n"
 "sahf_then_lahf:\n"
 "\tmovq %rdi, %rax\n"
 "\t.byte 0x9E\n" /* sahf */
 "\tmovabsq $0, %rax\n"
 "\t.byte 0x9F\n" /* lahf */
 "\tret\n"
+".previous\n"
 );
 
 int main ( void )
diff -Naurp valgrind-3.15.0.orig/none/tests/x86/cmpxchg8b.c valgrind-3.15.0/none/tests/x86/cmpxchg8b.c
--- valgrind-3.15.0.orig/none/tests/x86/cmpxchg8b.c	2019-04-13 05:56:22.000000000 -0500
+++ valgrind-3.15.0/none/tests/x86/cmpxchg8b.c	2020-05-12 11:07:26.571172399 -0500
@@ -14,6 +14,7 @@ UInt zout;
 
 extern void foo ( void );
 asm("\n"
+    ".text\n"
     VG_SYM(foo) ":\n"
     "\tpushl %eax\n"
     "\tpushl %ebx\n"
@@ -40,6 +41,7 @@ asm("\n"
     "\tpopl %ebx\n"
     "\tpopl %eax\n"
     "\tret\n"
+    ".previous\n"
     );
 
 int main ( void )
diff -Naurp valgrind-3.15.0.orig/none/tests/x86/fxtract.c valgrind-3.15.0/none/tests/x86/fxtract.c
--- valgrind-3.15.0.orig/none/tests/x86/fxtract.c	2019-04-13 05:56:22.000000000 -0500
+++ valgrind-3.15.0/none/tests/x86/fxtract.c	2020-05-12 11:08:00.668132055 -0500
@@ -6,13 +6,15 @@ double arg, res1, res2;
 
 extern void do_fxtract ( void );
 asm("\n"
+".text\n"
 VG_SYM(do_fxtract) ":\n"
 "\tfinit\n"
 "\tfldl " VG_SYM(arg) "\n"
 "\tfxtract\n"
 "\tfstpl " VG_SYM(res1) "\n"
 "\tfstpl " VG_SYM(res2) "\n"
-"\tret"
+"\tret\n"
+".previous\n"
 );
 
 void try ( double x )
diff -Naurp valgrind-3.15.0.orig/none/tests/x86/incdec_alt.c valgrind-3.15.0/none/tests/x86/incdec_alt.c
--- valgrind-3.15.0.orig/none/tests/x86/incdec_alt.c	2019-04-13 05:56:22.000000000 -0500
+++ valgrind-3.15.0/none/tests/x86/incdec_alt.c	2020-05-12 11:13:13.384223539 -0500
@@ -8,6 +8,7 @@ int r1,r2,r3,r4,r5,r6,r7,r8,a1,a2;
 
 extern void foo ( void );
 asm("\n"
+".text\n"
 VG_SYM(foo) ":\n"
 "\tpushl $0\n"
 "\tpopfl\n"
@@ -49,6 +50,7 @@ VG_SYM(foo) ":\n"
 "\tpopl " VG_SYM(r8) "\n"
 
 "\tret\n"
+".previous\n"
 );
 
 int main ( void )
diff -Naurp valgrind-3.15.0.orig/none/tests/x86/lahf.c valgrind-3.15.0/none/tests/x86/lahf.c
--- valgrind-3.15.0.orig/none/tests/x86/lahf.c	2019-04-13 05:56:22.000000000 -0500
+++ valgrind-3.15.0/none/tests/x86/lahf.c	2020-05-12 11:08:40.315099851 -0500
@@ -3,6 +3,7 @@
 
 extern int foo_1 ( void );
 asm("\n"
+".text\n"
 VG_SYM(foo_1) ":\n"
 "\tpushl $0\n"
 "\tpopfl\n"
@@ -11,10 +12,12 @@ VG_SYM(foo_1) ":\n"
 "\tsubl %eax, %edx\n"
 "\tlahf\n"
 "\tret\n"
+".previous\n"
 );
 
 extern int foo_0 ( void );
 asm("\n"
+".text\n"
 VG_SYM(foo_0) ":\n"
 "\tpushl $0\n"
 "\tpopfl\n"
@@ -23,6 +26,7 @@ VG_SYM(foo_0) ":\n"
 "\tsubl %eax, %edx\n"
 "\tlahf\n"
 "\tret\n"
+".previous\n"
 );
 
 int main ( void )
diff -Naurp valgrind-3.15.0.orig/none/tests/x86/looper.c valgrind-3.15.0/none/tests/x86/looper.c
--- valgrind-3.15.0.orig/none/tests/x86/looper.c	2019-04-13 05:56:22.000000000 -0500
+++ valgrind-3.15.0/none/tests/x86/looper.c	2020-05-12 11:09:53.291078154 -0500
@@ -21,6 +21,7 @@ VG_SYM(loop_plain) ":\n"
 "\tmovl %eax, " VG_SYM(res) "\n"
 "\tpopl %ecx\n"
 "\tret\n"
+".previous\n"
 );
 
 extern void loop_ne ( void );
@@ -40,6 +41,7 @@ VG_SYM(loop_ne) ":\n"
 "\tmovl %eax, " VG_SYM(res) "\n"
 "\tpopl %ecx\n"
 "\tret\n"
+".previous\n"
 );
 
 extern void loop_e ( void );
@@ -63,6 +65,7 @@ VG_SYM(loop_e) ":\n"
 "\tmovl %eax, " VG_SYM(res) "\n"
 "\tpopl %ecx\n"
 "\tret\n"
+".previous\n"
 );
 
 int main ( void )
diff -Naurp valgrind-3.15.0.orig/none/tests/x86/sbbmisc.c valgrind-3.15.0/none/tests/x86/sbbmisc.c
--- valgrind-3.15.0.orig/none/tests/x86/sbbmisc.c	2019-04-13 05:56:22.000000000 -0500
+++ valgrind-3.15.0/none/tests/x86/sbbmisc.c	2020-05-12 11:12:25.069164751 -0500
@@ -9,6 +9,7 @@ int in_l, out_l1, out_l2;
 
 extern void sbb_ib_al ( void );
 asm("\n"
+".text\n"
 VG_SYM(sbb_ib_al) ":\n"
 
 "\tmovb " VG_SYM(in_b) ", %al\n"
@@ -22,11 +23,13 @@ VG_SYM(sbb_ib_al) ":\n"
 "\tmovb %al, " VG_SYM(out_b2) "\n"
 
 "\tret\n"
+".previous\n"
 );
 
 
 extern void sbb_iw_ax ( void );
 asm("\n"
+".text\n"
 VG_SYM(sbb_iw_ax) ":\n"
 
 "\tmovw " VG_SYM(in_w) ", %ax\n"
@@ -40,11 +43,13 @@ VG_SYM(sbb_iw_ax) ":\n"
 "\tmovw %ax, " VG_SYM(out_w2) "\n"
 
 "\tret\n"
+".previous\n"
 );
 
 
 extern void sbb_il_eax ( void );
 asm("\n"
+".text\n"
 VG_SYM(sbb_il_eax) ":\n"
 
 "\tmovl " VG_SYM(in_l) ", %eax\n"
@@ -58,11 +63,13 @@ VG_SYM(sbb_il_eax) ":\n"
 "\tmovl %eax, " VG_SYM(out_l2) "\n"
 
 "\tret\n"
+".previous\n"
 );
 
 
 extern void sbb_eb_gb ( void );
 asm("\n"
+".text\n"
 VG_SYM(sbb_eb_gb) ":\n"
 
 "\tmovb " VG_SYM(in_b) ", %al\n"
@@ -76,11 +83,13 @@ VG_SYM(sbb_eb_gb) ":\n"
 "\tmovb %al, " VG_SYM(out_b2) "\n"
 
 "\tret\n"
+".previous\n"
 );
 
 
 extern void sbb_eb_gb_2 ( void );
 asm("\n"
+".text\n"
 VG_SYM(sbb_eb_gb_2) ":\n"
 "\tpushl %ecx\n"
 
@@ -98,11 +107,13 @@ VG_SYM(sbb_eb_gb_2) ":\n"
 
 "\tpopl %ecx\n"
 "\tret\n"
+".previous\n"
 );
 
 
 extern void adc_eb_gb ( void );
 asm("\n"
+".text\n"
 VG_SYM(adc_eb_gb) ":\n"
 
 "\tmovb " VG_SYM(in_b) ", %al\n"
@@ -116,11 +127,13 @@ VG_SYM(adc_eb_gb) ":\n"
 "\tmovb %al, " VG_SYM(out_b2) "\n"
 
 "\tret\n"
+".previous\n"
 );
 
 
 extern void adc_eb_gb_2 ( void );
 asm("\n"
+".text\n"
 VG_SYM(adc_eb_gb_2) ":\n"
 "\tpushl %ecx\n"
 
@@ -138,10 +151,12 @@ VG_SYM(adc_eb_gb_2) ":\n"
 
 "\tpopl %ecx\n"
 "\tret\n"
+".previous\n"
 );
 
 extern void adc_ib_al ( void );
 asm("\n"
+".text\n"
 VG_SYM(adc_ib_al) ":\n"
 
 "\tmovb " VG_SYM(in_b) ", %al\n"
@@ -155,11 +170,13 @@ VG_SYM(adc_ib_al) ":\n"
 "\tmovb %al, " VG_SYM(out_b2) "\n"
 
 "\tret\n"
+".previous\n"
 );
 
 
 extern void adc_iw_ax ( void );
 asm("\n"
+".text\n"
 VG_SYM(adc_iw_ax) ":\n"
 
 "\tmovw " VG_SYM(in_w) ", %ax\n"
@@ -173,11 +190,13 @@ VG_SYM(adc_iw_ax) ":\n"
 "\tmovw %ax, " VG_SYM(out_w2) "\n"
 
 "\tret\n"
+".previous\n"
 );
 
 
 extern void adc_il_eax ( void );
 asm("\n"
+".text\n"
 VG_SYM(adc_il_eax) ":\n"
 
 "\tmovl " VG_SYM(in_l) ", %eax\n"
@@ -191,6 +210,7 @@ VG_SYM(adc_il_eax) ":\n"
 "\tmovl %eax, " VG_SYM(out_l2) "\n"
 
 "\tret\n"
+".previous\n"
 );
 
 
diff -Naurp valgrind-3.15.0.orig/VEX/priv/guest_s390_defs.h valgrind-3.15.0/VEX/priv/guest_s390_defs.h
--- valgrind-3.15.0.orig/VEX/priv/guest_s390_defs.h	2019-04-13 05:56:21.000000000 -0500
+++ valgrind-3.15.0/VEX/priv/guest_s390_defs.h	2020-05-12 11:17:08.980673440 -0500
@@ -264,7 +264,7 @@ extern ULong last_execute_target;
 /* Vector operatons passed to s390x_dirtyhelper_vec_op(...) helper.
    Please don't change ordering of elements and append new items
    before  S390_VEC_OP_LAST. */
-enum {
+typedef enum {
    S390_VEC_OP_INVALID = 0,
    S390_VEC_OP_VPKS = 1,
    S390_VEC_OP_VPKLS = 2,
