Bug 323116 - The memcheck/tests/ppc64/power_ISA2_05.c fails to build with recent binutils
Summary: The memcheck/tests/ppc64/power_ISA2_05.c fails to build with recent binutils
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.9.0.SVN
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-02 19:21 UTC by Maynard Johnson
Modified: 2013-09-18 14:31 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch to fix this bug (10.03 KB, text/plain)
2013-08-02 19:21 UTC, Maynard Johnson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maynard Johnson 2013-08-02 19:21:34 UTC
Created attachment 81535 [details]
Patch to fix this bug

The following instructions were introduced in the Power ISA 2.05 (i.e., POWER6)
  - lfdp
  - stfdp
  - lfdpx
  - stfdpx

These instructions were promptly deprecated (phased out) in ISA 2.06 (i.e., POWER7).  Recent updates in binutils no longer supports these instructions unless the assembler is invoked with '-mpower6'.  When 'make check' is run on valgrind when using such a newer binutils and running on a ppc64 system newer than POWER6, you get the following build error:

pc64_linux=1 -DVGPV_ppc64_linux_vanilla=1 -DVGA_SEC_ppc32=1 -DVGP_SEC_ppc64_linux=1  -Winline -Wall -Wshadow -g  -Winline -Wall -Wshadow -g -I../../../include -m64 -Wno-long-long  -Wwrite-strings -fno-stack-protector -Wno-write-strings -MT power_ISA2_05-power_ISA2_05.o -MD -MP -MF .deps/power_ISA2_05-power_ISA2_05.Tpo -c -o power_ISA2_05-power_ISA2_05.o `test -f 'power_ISA2_05.c' || echo './'`power_ISA2_05.c
/tmp/cciGIkGG.s: Assembler messages:
/tmp/cciGIkGG.s:387: Error: operand out of domain (31 is not a multiple of 4)
/tmp/cciGIkGG.s:387: Error: syntax error; found `,', expected `('
/tmp/cciGIkGG.s:387: Error: junk at end of line: `,9'
/tmp/cciGIkGG.s:478: Error: operand out of domain (31 is not a multiple of 4)
/tmp/cciGIkGG.s:478: Error: syntax error; found `,', expected `('
/tmp/cciGIkGG.s:478: Error: junk at end of line: `,9'
make[2]: *** [power_ISA2_05-power_ISA2_05.o] Error 1
make[2]: Leaving directory `/tmp/Valgrind_review/valgrind_ISA2_05/memcheck/tests/ppc64'
make[1]: *** [check-am] Error 2
make[1]: Leaving directory `/tmp/Valgrind_review/valgrind_ISA2_05/memcheck/tests/ppc64'
make: *** [check-recursive] Error 1
=============================================

The patch that I will attach to this bug report fixes the problem by adding a configure check to determine if these phased out instructions are supported by the binutils, and the result of that configure check is used to decide whether or not to compile in the source for testing these instructions.

Once I fixed the build problem, I encountered some runtime problems with the testcase.  The testcase was improperly using registers in asm statements where it assumed those regs were not being clobbered in between the asm's, so I changed it to use variables.
Comment 1 Maynard Johnson 2013-08-02 19:25:18 UTC
Currently in SVN, there are two distinct source files for power_ISA2_05.c in memcheck/tests/ppc64 and memcheck/tests/ppc32.  There was no reason for this, and it just makes for maintenance issues, so I fixed up the testcase source to be exactly the same for ppc32 and ppc64.  If possible, we should remove one of these physical source files from SVN and make a symbolic link to the other.
Comment 2 Carl Love 2013-08-09 21:57:18 UTC
The patch was tested and committed.  The commit id is 13490.
Comment 3 Carl Love 2013-08-21 19:49:30 UTC
I created a link from memcheck/tests/ppc32/power_ISA2_05.stdout.exp_Without_FPPO to memcheck/tests/ppc64/power_ISA2_05.stdout.exp_Without_FPPO thinking the files were identical.   The files were not in fact identical.   My mistake.  I removed the link in commit 13505 and added the real file in commit 13506.