Bug 443031 - Gcc -many change requires explicit .machine directives
Summary: Gcc -many change requires explicit .machine directives
Status: CLOSED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: vex (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-27 20:56 UTC by Carl Love
Modified: 2021-10-01 20:49 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Configure,makefile and test case fixes for older powerpc targets. (7.93 KB, patch)
2021-09-30 21:55 UTC, Carl Love
Details
Fixes to add .machine directives for assembly instructions (3.31 KB, patch)
2021-09-30 21:59 UTC, Carl Love
Details
Add .machine directives for the darn instruction (18.27 KB, patch)
2021-09-30 22:01 UTC, Carl Love
Details
Fix dfp tests (5.64 KB, patch)
2021-09-30 22:06 UTC, Carl Love
Details
Add .machine directives to the jm-insns.c test (974 bytes, patch)
2021-09-30 22:07 UTC, Carl Love
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Carl Love 2021-09-27 20:56:42 UTC
Gcc no longer passes the "-many" flag to the assembler.

(gcc commit e154242724b084380e3221df7c08fcdbd8460674 ; "[RS6000] Don't
pass -many to the assembler"

The result of this change is the inline assembly in Valgrind and the test
programs require .machine directives and Makefile changes to ensure the 
correct processor flag be used.
Comment 1 Carl Love 2021-09-27 21:01:02 UTC
Currently working on a series of patches to address this issue.
Comment 2 Carl Love 2021-09-30 21:55:50 UTC
Created attachment 142043 [details]
Configure,makefile and test case fixes for older  powerpc targets.

First patch in a series to add .machine directives to the inline assembly and changes to Makefile.am to ensure the various tests and assembly instructions are being compiled with the correct target.

This patch specifically fixes a number of issues that was preventing Valgrind from compiling and running on older Powerpc systems.
Comment 3 Carl Love 2021-09-30 21:59:52 UTC
Created attachment 142044 [details]
Fixes to add .machine directives for assembly  instructions

Add .machine directives to guest_ppc_helpers.c, scv_test.c, Makefile.am and configure.ac file for the inline powerpc assembly instructions to ensure the instructions are compiled for the correct target.
Comment 4 Carl Love 2021-09-30 22:01:59 UTC
Created attachment 142046 [details]
Add .machine directives for the darn instruction

Add the .machine directives to the guest_ppc_helpers.c for the darn instruction. Similarly, add the .machine directives to the testsuite test_darn_inst.c
Comment 5 Carl Love 2021-09-30 22:06:43 UTC
Created attachment 142048 [details]
Fix dfp tests

Add .machine directive to the configure.ac file to fix the test to detect DFP support.  Add a #else to print the message "HAS_DFP not detected" to the various tests to make it clear the test didn't actually run.
Comment 6 Carl Love 2021-09-30 22:07:47 UTC
Created attachment 142049 [details]
Add .machine directives to the jm-insns.c test
Comment 7 Carl Love 2021-09-30 22:34:35 UTC
commit 7d2cec7f247809f08ce2e93a1a81ce333c6c244b (HEAD -> master, origin/master, origin/HEAD)
Author: Carl Love <cel@us.ibm.com>
Date:   Tue Sep 14 19:36:24 2021 +0000

    Fixes for mcrxr instruction
    
    Add .machine directives to ensure the mcrxr instruction is assembled
    for power 6.  The instruction is not supported on later platforms.

commit 518a2d59ac49fd4cd206912d95da76c1631d439c
Author: Carl Love <cel@us.ibm.com>
Date:   Wed Sep 8 22:01:05 2021 +0000

    Fix dfp tests.
    
    Due to changes between the compiler and linker, we need to add .machine
    arguments to configure file to properly detect the availability of the
    dfp instructions.
    
    Add print statement if HAS_DFP is not enabled to make it
    easier to determine when HAS_DFP is not enabled.

commit 475916cbd37611dcf510c2249c74ff6e31894023
Author: Carl Love <cel@us.ibm.com>
Date:   Tue Sep 14 21:43:49 2021 +0000

    Add .machine directives for the darn instruction

commit e23c2a2291071d1443ff9c6dbce5bbfe2c4cdd7c
Author: Carl Love <cel@us.ibm.com>
Date:   Fri Sep 17 00:33:14 2021 +0000

    Fixes to add .machine directives for assembly instructions

commit a63e9c28b53f20ce1c4bdc0b81da59957a17f4f0
Author: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
Date:   Fri Aug 20 19:07:09 2021 -0300

    powerpc: Add .machine directives for scv, copy, paste, cpabort instructions
    
    GCC is no longer passing the "-many" flag to the assembler.  So, the
    inline assembly instructions statements need to use the .machine directives
    for the specific platform.
    
    (gcc commit e154242724b084380e3221df7c08fcdbd8460674 ; "[RS6000] Don't
    pass -many to the assembler".
    
    Hardware sync instruction (hwsync) added after the copy, paste and cpabort
    instructions to improve the reliability of the test.

commit a9b5f6cfeb0592cb52199cdbe3a36d173b3e32b6
Author: carl love <cel@us.ibm.com>
Date:   Mon Sep 13 13:02:11 2021 -0500

    Configure,makefile and test case fixes for older powerpc targets.
    
    Assorted changes to fix up compile issues as seen during regression
    testing of VG on hardware back as far as Power 6 (ISA 2.05).
Comment 8 Carl Love 2021-09-30 22:45:00 UTC
Patches committed.  Changing status to fixed.