[PATCH] gdb: Powerpc fix gdb.multi/multi-arch-exec.exp test

Carl Love cel@us.ibm.com
Sat Nov 20 00:21:14 GMT 2021


GDB maintainers:

The following patch add a check for powerpc64 to properly set the
variable mach.  The variable is used to set the gcc command line
arguments when compiling the test.  Currently without the test mach
defaults to -m32 which causes the test program compile to fail.

This patch adds the needed if statement to check for powerpc64 and set
the mach variable to -m64.

The patch was tested on Power 10 to verify there are no compilation
failures and the test runs successfully.

Please let me know if this patch is acceptable for mainline.  

Thanks.

                     Carl 


--------------------------------------------------------
 gdb: Powerpc fix gdb.multi/multi-arch-exec.exp test

The expect file has a procedure append_arch_options which sets march based
the istarget.  The current if / else statement does not check for
powerpc64.  The else statement is hit which sets march to -m32.  This
results in compilation errors on 64-bit PowerPC.

This patch adds an if statement to check for powerpc64 and if true sets mach
to -m64.

The patch was tested on a Power 10 system.  No compile errors were generated.
The test completes with 1 expected pass and no failures.
---
 gdb/testsuite/gdb.multi/multi-arch-exec.exp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.multi/multi-arch-exec.exp b/gdb/testsuite/gdb.multi/multi-arch-exec.exp
index e9a8abd6748..a5d1ed481a7 100644
--- a/gdb/testsuite/gdb.multi/multi-arch-exec.exp
+++ b/gdb/testsuite/gdb.multi/multi-arch-exec.exp
@@ -71,7 +71,9 @@ proc append_arch2_options {options_var} {
 	}
     }
 
-    if [istarget "s390*-*-*"] {
+    if [istarget "powerpc64*-*-*"] {
+	set march "-m64"
+    } else if [istarget "s390*-*-*"] {
 	set march "-m31"
     } else {
 	set march "-m32"
-- 
2.30.2




More information about the Gdb-patches mailing list